@odigos/ui-kit 0.0.259 → 0.0.261
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 +21 -0
- package/lib/chunks/{connections-scope-CogqbI1K.js → connections-scope-DhNWocBO.js} +1 -1
- package/lib/chunks/{index-Bio7SJqx.js → index-DILEVYlK.js} +12 -12
- package/lib/chunks/odigos-context-BYgtdAtj.js +19 -0
- package/lib/chunks/source-instrument-form-context-oDlfTrOD.js +1 -0
- package/lib/chunks/{ui-components-CrXELmQx.js → ui-components-BDSEcaSZ.js} +197 -197
- package/lib/chunks/use-odigos-api-DHCLONPK.js +5 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/actions/index.d.ts +5 -1
- package/lib/constants/sampling/index.d.ts +4 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/edit-source-drawer/sampling/index.d.ts +1 -1
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/index.d.ts +3 -1
- package/lib/containers/_v2/_forms/add-action-form/dynamic-fields/index.d.ts +20 -0
- package/lib/containers/_v2/sampling-rules/helpers.d.ts +5 -4
- package/lib/containers/v2.js +155 -143
- package/lib/containers.js +1 -1
- package/lib/contexts/action-form-context.d.ts +1 -1
- package/lib/contexts/odigos-api/capabilities.d.ts +1 -0
- package/lib/contexts/odigos-api/hooks/use-actions-api.d.ts +12 -1
- package/lib/contexts/odigos-api/hooks/use-snapshots-api.d.ts +14 -6
- package/lib/contexts/odigos-api/types.d.ts +2 -1
- package/lib/contexts/odigos-api.js +1 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/useActionFormData.d.ts +1 -1
- package/lib/hooks/useInstrumentationRuleFormData.d.ts +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +40 -4
- package/lib/types/common/index.d.ts +2 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/helpers-zByTbpzZ.js +0 -19
- package/lib/chunks/source-instrument-form-context-CowQuxT5.js +0 -1
- package/lib/chunks/use-odigos-api-UctF_jx_.js +0 -5
package/lib/containers/v2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect as o,useMemo as a,useRef as i,useCallback as l,useState as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect as o,useMemo as a,useRef as i,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as m}from"react";import g,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,e as w,f as x,h as k,g as T,j as $,k as I,l as E,d as A,b as N,c as O,S as R,o as D,R as P,p as F,q as L,a as _,r as M,s as z,t as B,w as X,x as V,y as U,z as G,A as H,B as j,D as W,E as K,F as Y}from"../chunks/odigos-context-BYgtdAtj.js";import{f as J,a7 as q,a8 as Z,V as Q,a9 as ee,aa as te,ab as ne,ac as oe,ad as ae,ae as ie,af as le,ag as re,T as se,O as ce,a as de,y as ue,B as pe,z as he,L as me,M as ge,ah as fe,ai as be,aj as ve,ak as ye,al as Ce,am as Se,an as we,ao as xe,l as ke,s as Te,g as $e,N as Ie,ap as Ee,aq as Ae,ar as Ne,Y as Oe,o as Re,as as De,S as Pe,k as Fe,m as Le,at as _e,au as Me,av as ze,H as Be,aw as Xe,G as Ve,J as Ue,C as Ge,n as He,R as je,ax as We,ay as Ke,az as Ye,p as Je,h as qe,aA as Ze,aB as Qe,aC as et,aD as tt,aE as nt,aF as ot,aG as at,aH as it,aI as lt,aJ as rt,aK as st,aL as ct,aM as dt,aN as ut,aO as pt,D as ht,aP as mt,aQ as gt,aR as ft,aS as bt,aT as vt,aU as yt,e as Ct,I as St,E as wt,b as xt,aV as kt,aW as Tt,$ as $t,aX as It,aY as Et,a1 as At,a4 as Nt,A as Ot,aZ as Rt,a_ as Dt,a$ as Pt,b0 as Ft,d as Lt,b1 as _t,b2 as Mt,b3 as zt,b4 as Bt,W as Xt,F as Vt,b5 as Ut,b6 as Gt,b7 as Ht,b8 as jt,b9 as Wt,ba as Kt,bb as Yt,bc as Jt,bd as qt,be as Zt,bf as Qt,bg as en,bh as tn,U as nn,Q as on,bi as an,bj as ln,q as rn,r as sn,w as cn,K as dn,bk as un,bl as pn,bm as hn,bn as mn,bo as gn,bp as fn,bq as bn,br as vn,bs as yn,bt as Cn,bu as Sn,bv as wn,bw as xn,bx as kn,by as Tn,bz as $n,bA as In,bB as En,bC as An,bD as Nn,bE as On,bF as Rn,bG as Dn,bH as Pn,bI as Fn,bJ as Ln,bK as _n,bL as Mn,bM as zn,bN as Bn,bO as Xn,bP as Vn,bQ as Un,bR as Gn,bS as Hn,bT as jn,bU as Wn,bV as Kn,bW as Yn,bX as Jn,bY as qn,bZ as Zn,b_ as Qn,b$ as eo,c0 as to,c1 as no,c2 as oo,c3 as ao,c4 as io,c5 as lo,c6 as ro,c7 as so,c8 as co,c9 as uo,ca as po,cb as ho,cc as mo,cd as go,ce as fo,cf as bo,cg as vo,ch as yo,ci as Co,cj as So,ck as wo,cl as xo,cm as ko,cn as To,co as $o,cp as Io,cq as Eo,cr as Ao,cs as No,ct as Oo,cu as Ro,cv as Do,cw as Po,cx as Fo,cy as Lo,cz as _o,cA as Mo,cB as zo,cC as Bo,cD as Xo,cE as Vo,cF as Uo,cG as Go,cH as Ho,cI as jo,cJ as Wo,cK as Ko,cL as Yo,cM as Jo,cN as qo,cO as Zo,cP as Qo,cQ as ea,cR as ta,cS as na,cT as oa,cU as aa,cV as ia,cW as la,cX as ra,cY as sa,cZ as ca,c_ as da,c$ as ua,d0 as pa,d1 as ha,d2 as ma,d3 as ga,d4 as fa,d5 as ba,d6 as va,d7 as ya,d8 as Ca,d9 as Sa,da as wa,db as xa,dc as ka,dd as Ta,de as $a,df as Ia,dg as Ea,dh as Aa,di as Na,x as Oa,dj as Ra,v as Da,dk as Pa,dl as Fa,dm as La,dn as _a,dp as Ma,dq as za,dr as Ba,ds as Xa,a0 as Va,dt as Ua,du as Ga,dv as Ha,dw as ja,dx as Wa,dy as Ka,dz as Ya,dA as Ja,dB as qa,dC as Za,dD as Qa,dE as ei,dF as ti,dG as ni,dH as oi,dI as ai,dJ as ii,dK as li,dL as ri,dM as si,dN as ci,dO as di,dP as ui,dQ as pi,dR as hi,dS as mi}from"../chunks/ui-components-BDSEcaSZ.js";import{TrashIcon as gi,PlusIcon as fi,ArrowRightIcon as bi,VSquareIcon as vi,XSquareIcon as yi,BookIcon as Ci,DeleteIcon as Si,EditIcon as wi,GoLogo as xi,JavaLogo as ki,ChevronRightIcon as Ti,ActionIcon as $i,DestinationIcon as Ii,ChevronUpIcon as Ei,ChevronDownIcon as Ai,VIcon as Ni,XIcon as Oi,InstrumentationRuleIcon as Ri,SourceIcon as Di,NamespacesIcon as Pi,SettingsIcon as Fi,PodIcon as Li,OdigosLogo as _i,K8sLogo as Mi,RefreshIcon as zi,ExclamationCircleIcon as Bi,QuestionCircleIcon as Xi,InboundIcon as Vi,OutboundIcon as Ui,UserIcon as Gi,TerminalIcon as Hi,MinusIcon as ji,SearchIcon as Wi,ExpandIcon as Ki,CopyIcon as Yi,DotIcon as Ji,ArrowDownIcon as qi,DownloadIcon as Zi,RefreshLeftArrowIcon as Qi,VmLogo as el,SamplingIcon as tl,ExclamationTriangleIcon as nl,KeyIcon as ol,DiagnoseIcon as al,StarIcon as il,ArrowIcon as ll,ConnectionsIcon as rl,FilterIcon as sl,DataStreamIcon as cl,PipelineCollectorIcon as dl,ArrowDownSquareIcon as ul,ArrowUpSquareIcon as pl,GatewayIcon as hl,YamlIcon as ml}from"../icons.js";import{d as gl}from"../chunks/use-odigos-api-DHCLONPK.js";import{D as fl,S as bl,I as vl,a as yl,A as Cl,P as Sl,b as wl,c as xl,R as kl,O as Tl,d as $l,e as Il,f as El,W as Al,g as Nl,C as Ol,Y as Rl,h as Dl,i as Pl,U as Fl}from"../chunks/index-DILEVYlK.js";import{O as Ll}from"../chunks/connections-scope-DhNWocBO.js";import{u as _l,f as Ml,g as zl,e as Bl,i as Xl,h as Vl,S as Ul,k as Gl,E as Hl,l as jl,m as Wl,j as Kl,b as Yl,d as Jl,a as ql,A as Zl,R as Ql,c as er,D as tr}from"../chunks/source-instrument-form-context-oDlfTrOD.js";import{U as nr}from"../chunks/consts-D6GCMJ6c.js";import{createPortal as or}from"react-dom";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const ar=[{id:"CREDIT_CARD",label:"Credit card"}],ir=[{id:J.CollectContainerAttributes,label:"Collect container attributes"},{id:J.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:J.CollectWorkloadId,label:"Collect workload ID"},{id:J.CollectClusterId,label:"Collect cluster ID"}],lr=[{id:ne.Pod,label:ne.Pod},{id:ne.Namespace,label:ne.Namespace},{id:ne.Node,label:ne.Node}],rr=[{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:lr}],sr=[{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:lr}],cr=/^[a-zA-Z]$/,dr=new Set(["*","+","?"]),ur=new Set(["^","$"]),pr={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},hr=g.div`
|
|
2
2
|
padding: 8px 16px;
|
|
3
3
|
border-radius: 6px;
|
|
4
4
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
@@ -18,9 +18,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
18
18
|
box-decoration-break: clone;
|
|
19
19
|
-webkit-box-decoration-break: clone;
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
22
|
-
background: ${({$kind:e})=>
|
|
23
|
-
`,
|
|
21
|
+
`,mr=g.span`
|
|
22
|
+
background: ${({$kind:e})=>pr[e]};
|
|
23
|
+
`,gr=({pattern:e,"data-id":n})=>{const o=a(()=>(e=>{const t=[];let n=0,o=!1;const a=(e,n)=>{const o=t[t.length-1];o&&o.kind===n?o.text+=e:t.push({text:e,kind:n})};for(;n<e.length;){const t=e[n];if(o){if("]"===t){a("]","class-bracket"),o=!1,n++;continue}if("\\"===t&&n+1<e.length){a(e.slice(n,n+2),"class-content"),n+=2;continue}a(t,"class-content"),n++}else{if("("===t&&"?"===e[n+1]){let t=2;const o=e[n+2];if(":"===o||"="===o||"!"===o)t=3;else if("<"===o){const o=e[n+3];if("="===o||"!"===o)t=4;else{const o=e.indexOf(">",n+2);-1!==o&&(t=o-n+1)}}a(e.slice(n,n+t),"group"),n+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(dr.has(t)||ur.has(t))a(t,"anchor-quantifier"),n++;else{if("{"===t){const t=e.indexOf("}",n);if(t>n&&/^\{\d+,?\d*\}$/.test(e.slice(n,t+1))){a(e.slice(n,t+1),"anchor-quantifier"),n=t+1;continue}}if("\\"===t&&n+1<e.length){const t=e[n+1];cr.test(t)?a(e.slice(n,n+2),"anchor-quantifier"):a(e.slice(n,n+2),"literal"),n+=2;continue}"|"!==t?(a(t,"literal"),n++):(a("|","alternation"),n++)}else"^"===e[n+1]?(a("[^","class-bracket"),n+=2):(a("[","class-bracket"),n++),o=!0;else a(t,"group"),n++}}return t})(e),[e]);return t(hr,e?{"data-id":n,children:o.map((e,n)=>t(mr,{$kind:e.kind,children:e.text},n))}:{"data-id":n,children:" "})},fr="rgba(102, 191, 255, 0.5)",br=b`
|
|
24
24
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
25
25
|
font-size: 12px;
|
|
26
26
|
line-height: 20px;
|
|
@@ -33,7 +33,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
33
33
|
-moz-tab-size: 4;
|
|
34
34
|
tab-size: 4;
|
|
35
35
|
margin: 0;
|
|
36
|
-
`,
|
|
36
|
+
`,vr=g.div`
|
|
37
37
|
position: relative;
|
|
38
38
|
width: 100%;
|
|
39
39
|
min-height: ${({$minHeight:e})=>e}px;
|
|
@@ -45,8 +45,8 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
45
45
|
&:focus-within {
|
|
46
46
|
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
47
47
|
}
|
|
48
|
-
`,
|
|
49
|
-
${
|
|
48
|
+
`,yr=g.div`
|
|
49
|
+
${br}
|
|
50
50
|
position: absolute;
|
|
51
51
|
inset: 0;
|
|
52
52
|
padding: 12px;
|
|
@@ -59,8 +59,8 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
59
59
|
box-decoration-break: clone;
|
|
60
60
|
-webkit-box-decoration-break: clone;
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
63
|
-
${
|
|
62
|
+
`,Cr=g.textarea`
|
|
63
|
+
${br}
|
|
64
64
|
position: relative;
|
|
65
65
|
z-index: 1;
|
|
66
66
|
display: block;
|
|
@@ -78,18 +78,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
78
78
|
&::placeholder {
|
|
79
79
|
color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
80
80
|
}
|
|
81
|
-
`,
|
|
81
|
+
`,Sr=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),wr=({regex:n,value:o,onChange:r,minHeight:s=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return Sr(t);let n;try{n=new RegExp(e)}catch{return Sr(t)}const o=n.exec(t);if(!o)return Sr(t);const a=o.index,i=o.index+o[0].length;if(o.length<2||null==o[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=o[0].indexOf(o[1]),r=l>=0?a+l:a,s=r+o[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,r),capture:t.slice(r,s),matchPost:t.slice(s,i),after:t.slice(i)}})(n,o),[n,o]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(vr,{$minHeight:s,children:[e(yr,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:fr},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:fr},children:p.matchPost}),p.after,o.endsWith("\n")?" ":""]}),t(Cr,{ref:u,$minHeight:s,value:o,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},xr=g.div`
|
|
82
82
|
flex: 1;
|
|
83
83
|
min-height: 0;
|
|
84
84
|
overflow-y: auto;
|
|
85
|
-
`,
|
|
85
|
+
`,kr=g.div`
|
|
86
86
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
87
87
|
border-radius: 8px;
|
|
88
88
|
padding: 8px;
|
|
89
89
|
display: flex;
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
gap: 12px;
|
|
92
|
-
`,
|
|
92
|
+
`,Tr=g.div`
|
|
93
93
|
padding: 8px 16px;
|
|
94
94
|
border-radius: 8px;
|
|
95
95
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
@@ -100,7 +100,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
100
100
|
word-break: break-all;
|
|
101
101
|
white-space: pre-wrap;
|
|
102
102
|
user-select: text;
|
|
103
|
-
|
|
103
|
+
`,$r=({isOpen:n,regex:o,onClose:i,initialTestString:l=""})=>{const[s,c]=r(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:re.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:re.RESULT_EMPTY_INPUT};let n;try{n=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:re.RESULT_INVALID_REGEX_FALLBACK}}const o=n.exec(t);return o?{ok:!0,isMatch:!0,message:o.length>1?o[1]:o[0]}:{ok:!0,isMatch:!1,message:re.RESULT_NO_MATCH}})(o,s),[o,s]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(le,{isOpen:n,header:{title:re.TITLE,onClose:()=>{c(""),i()}},children:t(xr,{children:e(kr,{children:[e(q,{$gap:6,children:[t(Z,{label:re.REGEX_LABEL}),t(gr,{pattern:o,"data-id":"regex-tester-regex"}),!o&&t(se,{size:de.XXS,color:ce.Secondary,children:re.REGEX_EMPTY_HINT})]}),e(q,{$gap:6,children:[e(ue,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(Z,{label:re.TEST_STRING_LABEL}),t(pe,{"data-id":"regex-tester-unescape",label:re.UNESCAPE_LABEL,tooltip:re.UNESCAPE_TOOLTIP,variant:me.Secondary,size:he.S,onClick:()=>c(e=>(e=>{let t="";for(let n=0;n<e.length;n++){if("\\"===e[n]&&n+1<e.length){const o=e[n+1],a="n"===o?"\n":"t"===o?"\t":"r"===o?"\r":'"'===o?'"':"'"===o?"'":"\\"===o?"\\":null;if(null!=a){t+=a,n++;continue}}t+=e[n]}return t})(e)),disabled:(p=s,!/\\["'\\nrt]/.test(p))})]}),t(wr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:re.TEST_STRING_PLACEHOLDER,regex:o,value:s,onChange:c,minHeight:240}),t(ee,{helpMessage:re.TEST_STRING_HELP})]}),e(q,{$gap:8,children:[t(Z,{label:re.RESULT_LABEL}),t(Tr,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(se,{size:de.XXS,color:ce.Secondary,children:re.RESULT_CAPTURE_HINT})]})]})})});var p},Ir=J.ExtractAttribute;var Er;!function(e){e.Preset="preset",e.Regex="regex"}(Er||(Er={}));const Ar=[be.JSON,be.SQL,be.ResourcePath],Nr=(e=be.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),Or=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,Rr=g.div`
|
|
104
104
|
width: 100%;
|
|
105
105
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
106
106
|
border-radius: 8px;
|
|
@@ -108,13 +108,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
108
108
|
display: flex;
|
|
109
109
|
flex-direction: column;
|
|
110
110
|
gap: 8px;
|
|
111
|
-
`,
|
|
111
|
+
`,Dr=g.div`
|
|
112
112
|
flex: 1;
|
|
113
113
|
min-width: 0;
|
|
114
|
-
`,
|
|
114
|
+
`,Pr=g.div`
|
|
115
115
|
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
116
116
|
padding-top: 24px;
|
|
117
|
-
`,$s=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Is=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Es=j.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"}],Ns={[ye.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(o(()=>{a[j.CollectContainerAttributes]||a[j.CollectReplicaSetAttributes]||a[j.CollectWorkloadId]||a[j.CollectClusterId]||a[j.LabelsAttributes]?.length||a[j.AnnotationsAttributes]?.length||(i(j.CollectContainerAttributes,!0),i(j.CollectReplicaSetAttributes,!0),i(j.CollectWorkloadId,!0),i(j.CollectClusterId,!0),i(j.LabelsAttributes,[]),i(j.AnnotationsAttributes,[]))},[]),e(n,{children:[t(W,{$gap:6,children:Jl.map(({id:n,label:o})=>e(W,{children:[t(Y,{label:o,value:a[n]||!1,onChange:e=>i(n,e)}),t(J,{errorMessage:l[n]})]},n))}),t(q,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Zl,values:a[j.LabelsAttributes]||[],setValues:e=>i(j.LabelsAttributes,e),errorMessage:l[j.LabelsAttributes]}),t(q,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Ql,values:a[j.AnnotationsAttributes]||[],setValues:e=>i(j.AnnotationsAttributes,e),errorMessage:l[j.AnnotationsAttributes]})]})),[ye.AddClusterInfo]:({value:o,setValue:a,formErrors:i})=>{const l=f();return e(n,{children:[t(Q,{label:"Overwrite existing values",labelAlign:ee.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[j.OverwriteExistingValues]||!1,onChange:e=>a(j.OverwriteExistingValues,e)}),t(q,{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[j.ClusterAttributes]||[],setValues:e=>a(j.ClusterAttributes,e),errorMessage:i[j.ClusterAttributes]})]})},[ye.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(te,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[j.AttributeNamesToDelete]||[],setValues:e=>n(j.AttributeNamesToDelete,e),errorMessage:o[j.AttributeNamesToDelete]}),[ye.RenameAttributes]:({value:e,setValue:n,formErrors:a})=>{const i=e[j.Renames],[l,r]=s(()=>$s(i));return o(()=>{((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])})(Is(l),i||{})||r($s(i))},[i]),t(q,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));r(t),n(j.Renames,Is(t))},errorMessage:a[j.Renames]})},[ye.PiiMasking]:({value:n,setValue:a,formErrors:i})=>(o(()=>{n[j.PiiCategories]?.length||a(j.PiiCategories,Yl.map(({id:e})=>e))},[]),e(W,{$gap:12,children:[t(K,{label:"Attributes to mask"}),t(W,{$gap:6,children:Yl.map(({id:e,label:o})=>t(Y,{label:o,value:n[j.PiiCategories]?.includes(e)||!1,onChange:t=>{const o=n[j.PiiCategories]||[],i=t?[...o,e]:o.filter(t=>t!==e);a(j.PiiCategories,i)}},e))}),t(J,{errorMessage:i[j.PiiCategories]})]})),[ye.URLTemplatization]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=o[Es]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(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(ve,{}),e(W,{$gap:12,children:[e(se,{$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:`Rule Group ${o+1}`}),t(re,{leftIcon:()=>t(li,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(be,{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(q,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:As,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(te,{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(J,{errorMessage:i[Es]})]},`url-templatization-group-${o}`)),t(re,{variant:de.Secondary,label:"Add rule group",leftIcon:si,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ve,{})]})},[ye.ExtractAttribute]:({value:n,setValue:a,formErrors:i})=>{const l=f(),r=i[vs],c=n[vs]?.extractions||[],[d,u]=s(()=>(e=>e.length&&e.some(ws)?ys.Regex:ys.Preset)(c)),[p,h]=s(null),m=e=>a(vs,{extractions:e});o(()=>{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))},b=()=>{m([...c,d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===ys.Preset,y=c.length?c:[v?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(W,{$gap:16,$width:"100%",children:[t(ue,{options:[{value:ys.Preset,label:pe.SEGMENT_PRESET_LABEL,tooltip:pe.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:ys.Regex,label:pe.SEGMENT_REGEX_LABEL,tooltip:pe.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(W,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const a=o===y.length-1,i=n.dataFormat||he.JSON,s=ge[i];return e(xs,{"data-id":`extract-row-${o}`,children:[e(se,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(W,{$gap:10,children:[t(K,{label:v?pe.PRESET_ROW_TITLE(o):pe.REGEX_ROW_TITLE(o)}),v&&t(se,{$gap:24,children:Cs.map(e=>t(me,{"data-id":`extract-row-${o}-fmt-${e}`,size:fe.L,label:ge[e].label,value:i===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(se,{$gap:4,$alignItems:"center",children:[!v&&t(re,{"data-id":`extract-row-${o}-test-regex`,label:pe.TEST_REGEX_LABEL,variant:de.Secondary,size:ce.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(re,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(li,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),a&&t(re,{"data-id":`extract-row-${o}-add`,leftIcon:si,variant:de.Secondary,size:ce.S,onClick:b})]})]}),v?e(se,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(ks,{children:t(be,{name:`extract-row-${o}-lookupKey`,label:s.keyLabel,placeholder:s.placeholder,helpMessage:s.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Ts,{children:t(ri,{size:24,fill:l.v2.colors.silver[200]})}),t(ks,{children:t(be,{name:`extract-row-${o}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(W,{$gap:12,$width:"100%",children:[t(be,{name:`extract-row-${o}-regex`,label:pe.REGEX_LABEL,placeholder:pe.REGEX_PLACEHOLDER,helpMessage:pe.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(be,{name:`extract-row-${o}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(J,{errorMessage:r})]}),t(bs,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},Os=({actionType:e,value:n,setValue:o,formErrors:a})=>{if(!e)return null;const i=Ns[e];return i?t(i,{value:n,setValue:o,formErrors:a}):null},Rs=()=>{const n=f(),{selectedOption:o,genericForm:a}=El();if(!a||!o)return t(Ce,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(W,{$gap:24,children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:o.docsDescription}),e(se,{$gap:12,children:[t(ue,{options:[{icon:ci,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:di,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:we.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(re,{leftIcon:ui,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}${o.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(sl,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(be,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Os,{actionType:o.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(ke,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},Ds=({signals:e,fields:n,disabled:o,formData:a,handleFormChange:i,formErrors:l})=>n?.map(({renderCondition:n,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!n||Te(n,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(rl,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:o,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>i(f,e)},f)}),Ps=g(se)`
|
|
117
|
+
`,Fr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Lr=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},_r=J.UrlTemplatizationRulesGroups,Mr=[{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"}],zr=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},Br=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,placeholder:t.placeholder,componentType:t.componentType,options:zr(t.options??t.values)}})},Xr=e=>{const t="string"==typeof e.componentProperties?Te(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:zr(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:Br(t.columns),wrapKey:t.wrapKey,fields:Array.isArray(t.fields)?t.fields.map(Xr):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel}},Vr=e=>Array.isArray(e)?e:[],Ur=({field:e,value:n,setValue:o,errorMessage:a,disabled:i})=>{const{name:l,componentType:r,title:s,tooltip:c,placeholder:d,required:u,initialValue:p,options:h,itemWrapperKey:m,columns:g,wrapKey:f}=e;if(r===ke.MultiTabledInput){const e=Vr(f?n?.[f]:n);return t(te,{name:l,label:s,tooltip:c,required:u,disabled:i,columns:g||[],values:e,setValues:e=>o(f?{[f]:e}:e),errorMessage:a})}if(r===ke.MultiInput&&m){const e=Vr(n).map(e=>String(e?.[m]??""));return t(ie,{name:l,label:s,tooltip:c,required:u,disabled:i,placeholder:d,values:e,setValues:e=>o(e.map(e=>({[m]:e}))),errorMessage:a})}return t(fl,{componentType:r,name:l,label:s,tooltip:c,disabled:i,required:u,placeholder:d,errorMessage:a,dropdownOptions:h,value:(null==n?p:n)??"",setValue:o})},Gr=({field:o,value:a,setValue:i,disabled:l})=>{const r=f(),c=Vr(a),d=c.length?c:[{}],u=o.fields||[],p=e=>i(e);return e(n,{children:[d.map((n,a)=>e(s,{children:[t(we,{}),e(q,{$gap:12,children:[e(ue,{$justifyContent:"space-between",$alignItems:"center",children:[t(Z,{label:`${o.itemLabel||o.title||"Item"} ${a+1}`}),t(pe,{leftIcon:()=>t(gi,{fill:r.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>(e=>{const t=d.filter((t,n)=>n!==e);p(t)})(a),disabled:l||1===d.length})]}),u.map(e=>t(Ur,{field:e,value:n[e.name],setValue:t=>((e,t,n)=>p(d.map((o,a)=>a===e?{...o,[t]:n}:o)))(a,e.name,t),disabled:l},`${o.name}-group-${a}-${e.name}`))]})]},`${o.name}-group-${a}`)),t(pe,{variant:me.Secondary,label:o.addLabel||"Add",leftIcon:fi,onClick:()=>p([...d,{}]),disabled:l}),t(we,{})]})},Hr=({signals:e,fields:o,value:a,setValue:i,formErrors:l,disabled:r})=>{const s=(o||[]).filter(e=>!!e).map(e=>Xr(e));return t(n,{children:s.map(n=>{const o=Object.entries(a||{}).map(([e,t])=>({name:e,value:t}));if(!(!n.renderCondition||xe(n.renderCondition,e,o)))return null;const s=a?.[n.name];return n.componentType===ke.FieldGroup?t(Gr,{field:n,value:s,setValue:e=>i(n.name,e),disabled:r},n.name):t(Ur,{field:n,value:s,setValue:e=>i(n.name,e),errorMessage:l[n.name],disabled:r},n.name)})})},jr={[$e.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(o(()=>{a[J.CollectContainerAttributes]||a[J.CollectReplicaSetAttributes]||a[J.CollectWorkloadId]||a[J.CollectClusterId]||a[J.LabelsAttributes]?.length||a[J.AnnotationsAttributes]?.length||(i(J.CollectContainerAttributes,!0),i(J.CollectReplicaSetAttributes,!0),i(J.CollectWorkloadId,!0),i(J.CollectClusterId,!0),i(J.LabelsAttributes,[]),i(J.AnnotationsAttributes,[]))},[]),e(n,{children:[t(q,{$gap:6,children:ir.map(({id:n,label:o})=>e(q,{children:[t(Q,{label:o,value:a[n]||!1,onChange:e=>i(n,e)}),t(ee,{errorMessage:l[n]})]},n))}),t(te,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:rr,values:a[J.LabelsAttributes]||[],setValues:e=>i(J.LabelsAttributes,e),errorMessage:l[J.LabelsAttributes]}),t(te,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:sr,values:a[J.AnnotationsAttributes]||[],setValues:e=>i(J.AnnotationsAttributes,e),errorMessage:l[J.AnnotationsAttributes]})]})),[$e.AddClusterInfo]:({value:o,setValue:a,formErrors:i})=>{const l=f();return e(n,{children:[t(oe,{label:"Overwrite existing values",labelAlign:ae.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[J.OverwriteExistingValues]||!1,onChange:e=>a(J.OverwriteExistingValues,e)}),t(te,{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[J.ClusterAttributes]||[],setValues:e=>a(J.ClusterAttributes,e),errorMessage:i[J.ClusterAttributes]})]})},[$e.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(ie,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[J.AttributeNamesToDelete]||[],setValues:e=>n(J.AttributeNamesToDelete,e),errorMessage:o[J.AttributeNamesToDelete]}),[$e.RenameAttributes]:({value:e,setValue:n,formErrors:a})=>{const i=e[J.Renames],[l,s]=r(()=>Fr(i));return o(()=>{((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])})(Lr(l),i||{})||s(Fr(i))},[i]),t(te,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(J.Renames,Lr(t))},errorMessage:a[J.Renames]})},[$e.PiiMasking]:({value:n,setValue:a,formErrors:i})=>(o(()=>{n[J.PiiCategories]?.length||a(J.PiiCategories,ar.map(({id:e})=>e))},[]),e(q,{$gap:12,children:[t(Z,{label:"Attributes to mask"}),t(q,{$gap:6,children:ar.map(({id:e,label:o})=>t(Q,{label:o,value:n[J.PiiCategories]?.includes(e)||!1,onChange:t=>{const o=n[J.PiiCategories]||[],i=t?[...o,e]:o.filter(t=>t!==e);a(J.PiiCategories,i)}},e))}),t(ee,{errorMessage:i[J.PiiCategories]})]})),[$e.URLTemplatization]:({value:o,setValue:a,formErrors:i})=>{const l=f(),r=o[_r]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(_r,e),d=(e,t)=>c(r.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[r.map((n,o)=>e(s,{children:[t(we,{}),e(q,{$gap:12,children:[e(ue,{$justifyContent:"space-between",$alignItems:"center",children:[t(Z,{label:`Rule Group ${o+1}`}),t(pe,{leftIcon:()=>t(gi,{fill:l.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>{return e=o,c(r.filter((t,n)=>n!==e));var e},disabled:1===r.length})]}),t(Se,{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(te,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Mr,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(ie,{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(ee,{errorMessage:i[_r]})]},`url-templatization-group-${o}`)),t(pe,{variant:me.Secondary,label:"Add rule group",leftIcon:fi,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(we,{})]})},[$e.ExtractAttribute]:({value:n,setValue:a,formErrors:i})=>{const l=f(),s=i[Ir],c=n[Ir]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(Or)?Er.Regex:Er.Preset)(c)),[p,h]=r(null),m=e=>a(Ir,{extractions:e});o(()=>{0===c.length&&m([d===Er.Preset?Nr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},b=()=>{m([...c,d===Er.Preset?Nr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===Er.Preset,y=c.length?c:[v?Nr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(q,{$gap:16,$width:"100%",children:[t(ge,{options:[{value:Er.Preset,label:fe.SEGMENT_PRESET_LABEL,tooltip:fe.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:Er.Regex,label:fe.SEGMENT_REGEX_LABEL,tooltip:fe.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===Er.Preset?Nr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(q,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const a=o===y.length-1,i=n.dataFormat||be.JSON,r=ye[i];return e(Rr,{"data-id":`extract-row-${o}`,children:[e(ue,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(q,{$gap:10,children:[t(Z,{label:v?fe.PRESET_ROW_TITLE(o):fe.REGEX_ROW_TITLE(o)}),v&&t(ue,{$gap:24,children:Ar.map(e=>t(ve,{"data-id":`extract-row-${o}-fmt-${e}`,size:Ce.L,label:ye[e].label,value:i===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(ue,{$gap:4,$alignItems:"center",children:[!v&&t(pe,{"data-id":`extract-row-${o}-test-regex`,label:fe.TEST_REGEX_LABEL,variant:me.Secondary,size:he.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(pe,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(gi,{fill:l.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===Er.Preset?Nr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),a&&t(pe,{"data-id":`extract-row-${o}-add`,leftIcon:fi,variant:me.Secondary,size:he.S,onClick:b})]})]}),v?e(ue,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Dr,{children:t(Se,{name:`extract-row-${o}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Pr,{children:t(bi,{size:24,fill:l.v2.colors.silver[200]})}),t(Dr,{children:t(Se,{name:`extract-row-${o}-targetAttributeName`,label:fe.TARGET_LABEL,placeholder:fe.TARGET_PLACEHOLDER,helpMessage:fe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(q,{$gap:12,$width:"100%",children:[t(Se,{name:`extract-row-${o}-regex`,label:fe.REGEX_LABEL,placeholder:fe.REGEX_PLACEHOLDER,helpMessage:fe.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(Se,{name:`extract-row-${o}-targetAttributeName`,label:fe.TARGET_LABEL,placeholder:fe.TARGET_PLACEHOLDER,helpMessage:fe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(ee,{errorMessage:s})]}),t($r,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},Wr=({actionType:e,value:n,setValue:o,formErrors:a,dynamicFields:i,signals:l})=>{if(!e)return null;if(i?.length)return t(Hr,{fields:i,value:n,setValue:o,formErrors:a||{},signals:l||[]});const r=jr[e];return r?t(r,{value:n,setValue:o,formErrors:a}):null},Kr=()=>{const n=f(),{selectedOption:o,genericForm:a}=_l();if(!a||!o)return t(Ie,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(q,{$gap:24,children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(Ee,{size:de.XXXS,maxLines:2,children:o.description}),e(ue,{$gap:12,children:[t(ge,{options:[{icon:vi,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:yi,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Ae.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(pe,{leftIcon:Ci,variant:me.Secondary,size:he.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(bl,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(Se,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(Wr,{actionType:o.type,dynamicFields:o.fields,signals:i.signals||[],value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Ne,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Yr=({signals:e,fields:n,disabled:o,formData:a,handleFormChange:i,formErrors:l})=>n?.map(({renderCondition:n,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!n||xe(n,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(fl,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:o,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>i(f,e)},f)}),Jr=g(ue)`
|
|
118
118
|
position: sticky;
|
|
119
119
|
bottom: 4px;
|
|
120
120
|
align-self: center;
|
|
@@ -125,17 +125,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
125
125
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
126
126
|
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
127
127
|
z-index: 1;
|
|
128
|
-
`,Fs=c(({isEdit:n},a)=>{const i=f(),{isVm:l}=y(),{destinationsApi:r}=ll(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:b}=Al(),[v,C]=s(h?.testResult),[S,w]=s(!!h);o(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await r.testConnection(Oe(u.formData));return C(e),e};return d(a,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,r]),u&&c?e(W,{$gap:24,style:{minHeight:"100%"},children:[e(se,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t($e,{status:Ie.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t($e,{status:Ie.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(se,{$gap:12,children:[!l&&t(ue,{options:[{icon:ci,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:di,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:we.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(re,{"data-id":"dest-form-docs",leftIcon:ui,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(sl,{title:"This connection will monitor:",allowedSignals:Ne(c.option.supportedSignals),selectedSignals:Ae(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(Ee.Logs),metrics:e.includes(Ee.Metrics),traces:e.includes(Ee.Traces),profiles:e.includes(Ee.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(be,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Ds,{signals:Ae(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(n=>n.key===e?{...n,value:t}:n)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!n&&e(Ps,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:pi,variant:de.Secondary,textColor:i.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:de.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(re,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:hi,variant:de.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(re,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t(Ce,{title:"No active form"})});Fs.displayName="AddDestinationForm";const Ls=[{id:Re.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Re.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Re.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],_s=[{id:Re.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Re.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Re.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ms=["*"],zs=[{id:Fe.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Fe.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Fe.DbQuery,label:"Collect DB query",tooltip:""},{id:Fe.Messaging,label:"Collect messaging",tooltip:""}],Bs={[Me.Java]:[new _e("","")],[Me.Golang]:[new Le("")]},Xs={[ze.CodeAttributes]:({value:i,setValue:l,formErrors:s})=>{const r=s.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);o(()=>{if(!c.length&&!r){const e={[Re.FilePath]:!0,[Re.Function]:!0,[Re.LineNumber]:!0,[Re.Column]:null,[Re.Namespace]:null,[Re.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),o=Object.values(Re).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(W,{$gap:6,children:Ls.map(({id:e,label:n,tooltip:o})=>t(De,{text:o,withIcon:!0,children:t(Y,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:r})]}),e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(W,{$gap:6,children:_s.map(({id:e,label:n,tooltip:o})=>t(De,{text:o,withIcon:!0,children:t(Y,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:r})]})]})},[ze.CustomInstrumentation]:({value:i,setValue:l,formErrors:s})=>{const r=s.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Me.Golang]||[]).map(e=>new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Me.Java]||[]).map(e=>new _e(e.className,e.methodName)),[i]);return o(()=>{i?.customInstrumentations||r||l("customInstrumentations",{[Me.Golang]:Bs[Me.Golang],[Me.Java]:Bs[Me.Java]})},[]),e(n,{children:[e(W,{children:[e(se,{$gap:8,children:[t(mi,{}),t(K,{label:"Golang custom probes"})]}),t(q,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Me.Golang]=e.map(e=>new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Me.Java]=d,l("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]}),e(W,{children:[e(se,{$gap:8,children:[t(gi,{}),t(K,{label:"Java custom probes"})]}),t(q,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Me.Golang]=c,t[Me.Java]=e.map(e=>new _e(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]})]})},[ze.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const l=i.headersCollection,s=a(()=>e?.headersCollection?.[Pe.HeaderKeys]||[],[e]),r=e=>{const t={[Pe.HeaderKeys]:e};n("headersCollection",t)};return o(()=>{s.length||l||r(Ms)},[]),t(te,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:r,errorMessage:l})},[ze.PayloadCollection]:({value:n,setValue:i,formErrors:l})=>{const s=l.payloadCollection,r=a(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);o(()=>{if(!r.length&&!s){const e={[Fe.HttpRequest]:{},[Fe.HttpResponse]:{},[Fe.DbQuery]:{},[Fe.Messaging]:{}};i("payloadCollection",e)}},[]);return e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Type of data to collect"}),t(W,{$gap:6,children:zs.map(({id:e,label:n,tooltip:o})=>t(De,{text:o,withIcon:!0,children:t(Y,{label:n,value:r.includes(e),onChange:t=>((e,t)=>{const n=t?[...r,e]:r.filter(t=>t!==e),o={[Fe.HttpRequest]:n.includes(Fe.HttpRequest)?{}:null,[Fe.HttpResponse]:n.includes(Fe.HttpResponse)?{}:null,[Fe.DbQuery]:n.includes(Fe.DbQuery)?{}:null,[Fe.Messaging]:n.includes(Fe.Messaging)?{}:null};i("payloadCollection",o)})(e,t)})},e))}),t(J,{errorMessage:s})]})},[ze.UnknownType]:null},Vs=({ruleType:e,value:n,setValue:o,formErrors:a})=>{if(!e)return null;const i=Xs[e];return i?t(i,{value:n,setValue:o,formErrors:a}):null},Us=()=>{const n=f(),{selectedOption:o,genericForm:a,sourceOptions:i,namespaceOptions:l}=Nl();if(!a||!o)return t(Ce,{title:"No active form"});const{formData:s,handleFormChange:r,formErrors:c}=a;return e(W,{$gap:24,children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:o.docsDescription}),e(se,{$gap:12,children:[t(ue,{options:[{icon:ci,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:di,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:we.S,selected:s.disabled,setSelected:e=>r("disabled",e)}),t(re,{leftIcon:ui,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}${o.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(cl,{option:o,formState:s}),e(se,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Supported Languages:"}),o.supportedLanguages.map(e=>t(Be,{label:Xe[e],leftIcon:Ve(e),backgroundColor:n.v2.colors.purple[900]},e))]}),t(dl,{scopes:s.sourceScopes,onChange:e=>r("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:o.type===ze.CustomInstrumentation?[]:o.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(be,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>r("ruleName",e),errorMessage:c.ruleName}),t(Vs,{ruleType:o.type,value:s,setValue:(e,t)=>r(e,t),formErrors:c}),t(ke,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>r("notes",e),errorMessage:c.notes})]})},Gs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Ol();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Ue,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:Ge.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:de.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:de.Secondary,onClick:o}})},Hs=({autoFocus:n})=>{const{dataStreams:o}=He(),{genericForm:i,excludeName:l,editingName:s}=Ol(),{formData:r,formErrors:c,handleFormChange:d}=i,u=r.name,p=a(()=>o.find(e=>e.name===u&&e.name!==l),[o,u,l]);return e(W,{$width:"100%",$gap:12,children:[t(be,{name:"data-stream-name",label:Ge.STREAM_NAME,placeholder:Ge.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Ge.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t($e,{status:Ie.Warning,message:Ge.DATA_STREAM_MERGE_WARNING(s,p.name),fullWidth:!0})]})},js=()=>{const{selectedStreamName:e}=He(),{genericForm:n}=Rl();if(!n)return t(Ce,{title:"No active form"});const{formData:o,handleFormChange:a,formErrors:i}=n;return t(be,{name:"sourceName",label:Ge.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}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Ws=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ks=g.div`
|
|
128
|
+
`,qr=c(({isEdit:n},a)=>{const i=f(),{isVm:l}=y(),{destinationsApi:s}=gl(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:b}=Ml(),[v,C]=r(h?.testResult),[S,w]=r(!!h);o(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await s.testConnection(_e(u.formData));return C(e),e};return d(a,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,s]),u&&c?e(q,{$gap:24,style:{minHeight:"100%"},children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Oe,{status:Re.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Oe,{status:Re.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(ue,{$gap:12,children:[!l&&t(ge,{options:[{icon:vi,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:yi,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:Ae.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(pe,{"data-id":"dest-form-docs",leftIcon:Ci,variant:me.Secondary,size:he.S,onClick:()=>window.open(`${De}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(bl,{title:"This connection will monitor:",allowedSignals:Le(c.option.supportedSignals),selectedSignals:Fe(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(Pe.Logs),metrics:e.includes(Pe.Metrics),traces:e.includes(Pe.Traces),profiles:e.includes(Pe.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(Se,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Yr,{signals:Fe(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(n=>n.key===e?{...n,value:t}:n)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!n&&e(Jr,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Si,variant:me.Secondary,textColor:i.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:me.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:wi,variant:me.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:me.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:me.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t(Ie,{title:"No active form"})});qr.displayName="AddDestinationForm";const Zr=[{id:Me.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Me.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Me.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Qr=[{id:Me.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Me.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Me.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],es=["*"],ts=[{id:Xe.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Xe.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Xe.DbQuery,label:"Collect DB query",tooltip:""},{id:Xe.Messaging,label:"Collect messaging",tooltip:""}],ns={[Ge.Java]:[new Ue("","")],[Ge.Golang]:[new Ve("")]},os={[He.CodeAttributes]:({value:i,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);o(()=>{if(!c.length&&!s){const e={[Me.FilePath]:!0,[Me.Function]:!0,[Me.LineNumber]:!0,[Me.Column]:null,[Me.Namespace]:null,[Me.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),o=Object.values(Me).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(q,{$gap:6,children:Zr.map(({id:e,label:n,tooltip:o})=>t(ze,{text:o,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ee,{errorMessage:s})]}),e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(q,{$gap:6,children:Qr.map(({id:e,label:n,tooltip:o})=>t(ze,{text:o,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ee,{errorMessage:s})]})]})},[He.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Ge.Golang]||[]).map(e=>new Ve(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Ge.Java]||[]).map(e=>new Ue(e.className,e.methodName)),[i]);return o(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[Ge.Golang]:ns[Ge.Golang],[Ge.Java]:ns[Ge.Java]})},[]),e(n,{children:[e(q,{children:[e(ue,{$gap:8,children:[t(xi,{}),t(Z,{label:"Golang custom probes"})]}),t(te,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Ge.Golang]=e.map(e=>new Ve(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ge.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(q,{children:[e(ue,{$gap:8,children:[t(ki,{}),t(Z,{label:"Java custom probes"})]}),t(te,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ge.Golang]=c,t[Ge.Java]=e.map(e=>new Ue(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[He.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Be.HeaderKeys]||[],[e]),s=e=>{const t={[Be.HeaderKeys]:e};n("headersCollection",t)};return o(()=>{r.length||l||s(es)},[]),t(ie,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[He.PayloadCollection]:({value:n,setValue:i,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);o(()=>{if(!s.length&&!r){const e={[Xe.HttpRequest]:{},[Xe.HttpResponse]:{},[Xe.DbQuery]:{},[Xe.Messaging]:{}};i("payloadCollection",e)}},[]);return e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Type of data to collect"}),t(q,{$gap:6,children:ts.map(({id:e,label:n,tooltip:o})=>t(ze,{text:o,withIcon:!0,children:t(Q,{label:n,value:s.includes(e),onChange:t=>((e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e),o={[Xe.HttpRequest]:n.includes(Xe.HttpRequest)?{}:null,[Xe.HttpResponse]:n.includes(Xe.HttpResponse)?{}:null,[Xe.DbQuery]:n.includes(Xe.DbQuery)?{}:null,[Xe.Messaging]:n.includes(Xe.Messaging)?{}:null};i("payloadCollection",o)})(e,t)})},e))}),t(ee,{errorMessage:r})]})},[He.UnknownType]:null},as=({ruleType:e,value:n,setValue:o,formErrors:a})=>{if(!e)return null;const i=os[e];return i?t(i,{value:n,setValue:o,formErrors:a}):null},is=()=>{const n=f(),{selectedOption:o,genericForm:a,sourceOptions:i,namespaceOptions:l}=zl();if(!a||!o)return t(Ie,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=a;return e(q,{$gap:24,children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(Ee,{size:de.XXXS,maxLines:2,children:o.docsDescription}),e(ue,{$gap:12,children:[t(ge,{options:[{icon:vi,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:yi,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Ae.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(pe,{leftIcon:Ci,variant:me.Secondary,size:he.S,onClick:()=>window.open(`${De}${o.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(vl,{option:o,formState:r}),e(ue,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Supported Languages:"}),o.supportedLanguages.map(e=>t(je,{label:We[e],leftIcon:Ke(e),backgroundColor:n.v2.colors.purple[900]},e))]}),t(yl,{scopes:r.sourceScopes,onChange:e=>s("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:o.type===He.CustomInstrumentation?[]:o.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(Se,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:r.ruleName,onChange:({target:{value:e}})=>s("ruleName",e),errorMessage:c.ruleName}),t(as,{ruleType:o.type,value:r,setValue:(e,t)=>s(e,t),formErrors:c}),t(Ne,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes,onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},ls=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Bl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Ye,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:Je.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:me.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:me.Secondary,onClick:o}})},rs=({autoFocus:n})=>{const{dataStreams:o}=qe(),{genericForm:i,excludeName:l,editingName:r}=Bl(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>o.find(e=>e.name===u&&e.name!==l),[o,u,l]);return e(q,{$width:"100%",$gap:12,children:[t(Se,{name:"data-stream-name",label:Je.STREAM_NAME,placeholder:Je.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Je.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Oe,{status:Re.Warning,message:Je.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},ss=()=>{const{selectedStreamName:e}=qe(),{genericForm:n}=Xl();if(!n)return t(Ie,{title:"No active form"});const{formData:o,handleFormChange:a,formErrors:i}=n;return t(Se,{name:"sourceName",label:Je.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}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},cs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],ds=g.div`
|
|
129
129
|
display: flex;
|
|
130
130
|
flex-direction: column;
|
|
131
131
|
gap: 24px;
|
|
132
|
-
`,
|
|
132
|
+
`,us=g.div`
|
|
133
133
|
display: contents;
|
|
134
134
|
& > * {
|
|
135
135
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
136
136
|
transition: opacity 0.2s ease;
|
|
137
137
|
}
|
|
138
|
-
`,
|
|
138
|
+
`,ps=({value:e})=>{const n=f();return t(je,e?{status:Re.Success,label:at,leftIcon:vi}:{label:it,leftIcon:yi,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},hs=({value:e,onChange:n})=>{const o=f(),i=a(()=>[{icon:vi,label:at,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:yi,label:it,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ge,{options:i,selected:e,setSelected:n??(()=>{}),disabled:!n})},ms=()=>{const e=Vl();switch(e.formType){case Ul.Create:return t(gs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(hs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Ul.View:return e.data?e.isEditing?t(gs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(hs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(fs,{data:e.data,renderAction:()=>t(ps,{value:!e.data?.rule.disabled})}):null;case Ul.EditAutoNoisy:return t(bs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ot,sectionTitle:et,sectionSubTitle:nt,presetLabel:Qe,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(hs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ul.EditAutoCostReduction:return t(bs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:tt,sectionTitle:et,presetLabel:Qe,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(hs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ul.EditAutoHighlyRelevant:return t(ds,{children:t(Cl,{title:e.localEnabled?void 0:Ze,summary:e.summary,renderAction:()=>t(hs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},gs=({category:n,formData:o,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:r})=>e(ds,{children:[t(xl,{category:n,formState:o,renderAction:r}),e(us,{$faded:!!o.disabled,children:[t(kl,{category:n,formState:o,onChange:a}),t(yl,{scopes:o.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Tl,{category:n,formState:o,onChange:a}),"highlyRelevant"===n&&t($l,{formState:o,onChange:a}),"highlyRelevant"===n&&t(Il,{ruleType:o.ruleType,formState:o,onChange:a}),t(El,{category:n,formState:o,onChange:a})]})]}),fs=({data:n,renderAction:o})=>e(ds,{children:[t(xl,{readOnly:!0,summary:n.summary,renderAction:o}),t(kl,{readOnly:!0,data:n}),t(yl,{readOnly:!0,scopes:C(n.rule.sourceScopes)}),t(Tl,{readOnly:!0,data:n}),t(El,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(Il,{readOnly:!0,rule:n.rule})]}),bs=({enabled:n,summary:o,inactiveTitle:a,sectionTitle:i,sectionSubTitle:r,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>m(e),[m]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(ds,{children:[t(Cl,{title:n?void 0:a,summary:o,renderAction:b}),t(us,{$faded:!n,children:e(lt,{richTitle:{title:i,subTitle:r},children:[d&&t(q,{$alignItems:"flex-start",children:t(ge,{options:cs,selected:u,setSelected:v})}),S&&t(Sl,{description:s,options:wl,selected:h,onSelect:y,customName:c,customLabel:rt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},vs=g.div`
|
|
139
139
|
display: flex;
|
|
140
140
|
align-items: center;
|
|
141
141
|
justify-content: space-between;
|
|
@@ -148,27 +148,27 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
148
148
|
&:hover {
|
|
149
149
|
background-color: ${({$isSelected:e,$purpleColors:t,theme:n})=>n.v2.colors[t?"purple":"silver"][e?"700":"800"]};
|
|
150
150
|
}
|
|
151
|
-
`,
|
|
151
|
+
`,ys=g.div`
|
|
152
152
|
display: flex;
|
|
153
153
|
align-items: center;
|
|
154
154
|
justify-content: center;
|
|
155
155
|
padding: 8px;
|
|
156
156
|
border-radius: 8px;
|
|
157
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
158
|
-
`,
|
|
157
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+st["004"]};
|
|
158
|
+
`,Cs=({dataId:n,icon:o,title:a,description:i,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(vs,{"data-id":n||`list-item-${a}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(q,{$gap:4,children:[e(ue,{$gap:12,children:[m&&t(Q,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),o&&t(ys,{children:t(o,{size:20})}),t(se,{size:de.XS,children:a})]}),i&&t(se,{size:de.XXXS,color:ce.Secondary,children:i})]}),(l||c)&&e(ue,{$gap:8,children:[c,l&&t(Ti,{size:18})]})]}),Ss=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:l})=>{const{actionsApi:s}=gl(),{platformType:c,version:d}=y(),[u,p]=r(""),h=i(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=_l(),{options:v,loading:C}=s.useActionTypes(),S=a(()=>v.length?v:ct(c,d),[v,c,d]),w=a(()=>(u?S.filter(e=>e?.label?.toLowerCase().includes(u.toLowerCase())):S).filter(e=>!!e),[S,u]),x=a(()=>{if(C)return[t(dt,{$padding:"8px 12px",children:t(ut,{size:6})},"loading")];return w.map(e=>{const n=m?.type===e.type;return t(Cs,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)})},[C,m?.type,w,g]),k=a(()=>C?[t(dt,{$padding:"8px 12px",children:t(ut,{size:4})},"loading")]:m?[t(Kr,{},m.type)]:[t(pt,{$height:"100%",children:t(Ie,{icon:$i,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[C,m]);return t(Al,{ref:h,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await s.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:Je.CREATING_ACTION,subTitle:Je.CREATING_ACTION_SUBTITLE},header:{icon:$i,title:Je.ADD_ACTION,subTitle:Je.ADD_ACTION_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:u,onChange:p},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:k}})},ws=({destinationsByCategory:o,filters:i,setFilters:l})=>{const r=a(()=>Object.values(ht).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),s=a(()=>{const e=Object.values(Pe).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(mt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ge,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},xs=g.div`
|
|
159
159
|
display: flex;
|
|
160
160
|
flex-direction: column;
|
|
161
161
|
padding: 8px;
|
|
162
162
|
border-radius: 16px;
|
|
163
163
|
border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
|
|
164
164
|
background-color: ${({$noBgColor:e,$purpleColors:t,theme:n})=>e?"transparent":t?n.v2.colors.purple[900]:n.v2.colors.silver[800]};
|
|
165
|
-
`,
|
|
165
|
+
`,ks=g.div`
|
|
166
166
|
display: flex;
|
|
167
167
|
align-items: center;
|
|
168
168
|
justify-content: space-between;
|
|
169
169
|
gap: 12px;
|
|
170
170
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
171
|
-
`,
|
|
171
|
+
`,Ts=({title:n,tooltip:o,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(xs,{"data-id":`collapse-${n}`,$noBgColor:i,$purpleColors:l,children:[e(ks,{$isOpen:s,children:[e(ue,{$gap:10,children:[t(se,{size:de.XS,children:n}),o&&t(ze,{text:o,withIcon:!0}),t(je,{label:a.length,status:l?Re.Default:void 0})]}),t(gt,{icon:s?Ei:Ai,size:ft.M,onClick:()=>c(e=>!e)})]}),s?t(q,{children:a.length?u.toArray(a):t(pt,{$padding:"12px 0",children:t(Ie,{})})}):null]})},$s=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||Le(e.supportedSignals).includes(n.signalType))):e,Is=({option:e,formData:n,testResult:o,isSelected:a,onSelect:i})=>t(Cs,{icon:yt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:a,onClick:()=>i(),children:o&&t(je,{status:o.succeeded?Re.Success:Re.Error,leftIcon:o.succeeded?Ni:Oi})}),Es=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:a,onChangeActiveForm:i}=Ml();return n?.length?t(Ts,{title:vt[e].TITLE,tooltip:vt[e].DESCRIPTION,list:n.map((n,o)=>t(Is,{option:n,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=n.id&&""!==n.id?a?.option.id===n.id:a?.option.type===n.type),onSelect:()=>i({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(Ts,{purpleColors:!0,title:vt[e].TITLE,tooltip:vt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(Is,{option:n,formData:o,testResult:l,isSelected:a?.unsavedIdx===r&&a?.listType===e,onSelect:()=>i({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var As;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(As||(As={}));const Ns=(e,t)=>{const n=[],o=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===As.SELF_HOSTED?o.push(...e.items):e.name===As.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=Ct(o),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const o=Te(t.fields,{});Object.keys(o).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[a]))}}}),{[ht.DETECTED]:n,[ht.SELF_HOSTED]:o,[ht.MANAGED]:a}},Os=({onClose:e,onBack:n,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=gl(),[m,g]=r(""),[f,b]=r({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:w}=h.usePotentialDestinations(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=Ml();o(()=>{d&&$(d)},[d]);const I=C||w,E=a(()=>y?.destinationCategories?.categories??[],[y]),[A,N]=r({[ht.ALL]:[],[ht.UNSAVED]:[],[ht.EXISTS]:[],[ht.DETECTED]:[],[ht.SELF_HOSTED]:[],[ht.MANAGED]:[]});o(()=>{const e=v.map(e=>{let t;for(const n of E){const o=n.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const n=Te(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})):[]}});N(t=>({...t,[ht.EXISTS]:e}))},[v,E]),o(()=>{(y||S)&&N(e=>({...e,...Ns(y,S)}))},[y,S]);const O=l(async()=>{for(const{option:e,formData:t}of T){const n=_e(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),o=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==o[e])){await h.update(e.id,n);continue}}await h.create(n)}},[T,h]),R=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:i})=>{const{unsavedDestinations:l}=Ml();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(Es,{listType:ht.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(ht)){if(i.categoryType&&i.categoryType!==e)continue;const l=$s(n[e],o,i);l.length&&a.push(t(Es,{listType:e,destinationOptions:l},e))}return e&&a.push(t(pt,{$height:"100%",children:t(bt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,n,o,i,e])}})({isFetching:I,destinationsByCategory:A,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Ml();return{width:"60%",list:e?[t(qr,{},e.option.type)]:[t(pt,{$height:"100%",children:t(Ie,{icon:Ii,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Al,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:n?()=>n(T):void 0,onNext:i?()=>i(T):void 0,nextIsSkip:!T.length,onSave:O,disableSave:!x&&!T.length,isFetching:I,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Je.CREATING_DESTINATION,subTitle:Je.CREATING_DESTINATION_SUBTITLE},header:{icon:Ii,title:Je.ADD_DESTINATIONS,subTitle:Je.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(ws,{destinationsByCategory:A,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},Rs=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:l})=>{const{instrumentationRulesApi:s}=gl(),[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=zl(),f=a(()=>c?St.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):St,[c]),b=a(()=>f.map(e=>{const n=p?.type===e.type;return t(Cs,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(is,{},p.type)]:[t(pt,{$height:"100%",children:t(Ie,{icon:Ri,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(Al,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await s.create(t,p?.type)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Je.CREATING_INSTRUMENTATION_RULE,subTitle:Je.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ri,title:Je.ADD_INSTRUMENTATION_RULE,subTitle:Je.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Ds={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Je.FETCHING_NAMESPACES,subTitle:Je.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:Je.SELECT_NAMESPACE,subTitle:Je.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Ps={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===wt.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"},Fs=e=>e?Ps:Ds,Ls="No matches",_s="No sources",Ms=e=>`No sources matched the filter '${e}'`,zs=e=>(e?"Unselect":"Select")+" all",Bs="Show only:",Xs="Selected",Vs="Auto",Us="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Gs="Enterprise only",Hs=g.div``,js=g.div`
|
|
172
172
|
visibility: hidden;
|
|
173
173
|
|
|
174
174
|
transition: visibility 0s;
|
|
@@ -176,19 +176,19 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
176
176
|
transition-duration: 0s;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
${
|
|
179
|
+
${Hs}:hover & {
|
|
180
180
|
visibility: visible;
|
|
181
181
|
}
|
|
182
|
-
`,
|
|
182
|
+
`,Ws=({workloadName:e,workloadKind:n,isChecked:o,onToggle:a,disabled:i,disabledReason:l})=>{const r=f(),s=()=>{};return t(Hs,{children:t(Cs,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?s:a,isChecked:o,onCheckboxChange:i?s:a,children:i&&l?t(je,{label:l,status:Re.Default,textSize:de.XXXS}):t(js,{children:t(je,{label:n,status:Re.Info,textSize:de.XXXS,backgroundColor:r.v2.colors.blue[900]})})})})},Ks=g.div``,Ys=g.div`
|
|
183
183
|
visibility: ${({$visible:e})=>e?"visible":"hidden"};
|
|
184
184
|
|
|
185
185
|
transition: visibility 0s;
|
|
186
186
|
${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
|
|
187
187
|
|
|
188
|
-
${
|
|
188
|
+
${Ks}:hover & {
|
|
189
189
|
visibility: visible;
|
|
190
190
|
}
|
|
191
|
-
`,Pr=({clusterId:n,namespaceName:o,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(Rr,{children:t(ar,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(se,{$gap:12,children:[!d&&t(Dr,{$visible:s||i,children:t(De,{text:Ir,children:t(Q,{label:$r,labelAlign:ee.Left,size:bt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(se,{$gap:8,children:[t(ae,{variant:vt.Span,size:le.XXXS,color:ie.Secondary,align:"right",children:Tr}),t(Be,{label:`${l.sourced}/${l.total}`,status:s?Ie.Default:Ie.Unknown,minWidth:"42px"})]})]})})})},Fr=({withCollapse:e,clusterId:n,clusterName:o,namespaces:i,selectedArea:l,setSelectedArea:s,handleSourceChange:r})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Pr,{clusterId:n,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>s({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:r},`${n}#${e}`)),[n,o,i,l]);return e?t(cr,{title:o,list:c,noBgColor:!0}):c},Lr=({onClose:n,onBack:i,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=y(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=ll(),{data:f,loading:b,refetch:v}=m.useSnapshots(),{items:C,loading:S,refetch:w}=g.useNamespaces(),x=yr(p),{selectedStreamName:k}=He(),{progress:T,resetProgress:$}=yt(),{isFetching:I,setIsFetching:E,setSnapshots:A,formData:N,handleSourceChange:O,handleSelectAll:R,formDiff:D,isFormDirty:P}=zl();o(()=>{v(),w()},[]);const F=a(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:St,clusterName:Ct,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[f,C,k]);o(()=>{E(b||S),F&&A(F)},[F,b,S,E,A]);const[L,_]=s(""),[M,z]=s(gt.Namespace),[B,X]=s({showOnlySelected:!1}),[V,U]=s({clusterId:"",clusterName:"",namespaceName:""}),G=(({isFetching:n,formData:o,handleSourceChange:i,handleSelectAll:l,selectedArea:s,setSelectedArea:r,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=yr(p),m=a(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>_l(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Ml(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,u]),g=a(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(Fr,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:s,setSelectedArea:r,handleSourceChange:i},e):null),n=e.filter(e=>null!==e);return{list:n,withFilterCount:n.length!==e.length,filteredCount:n.length,totalCount:e.length}},[m,s]);return{width:"60%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:h.groupColumnHeader}),t(De,{text:b?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${b?`${v} / ${C}`:C}`,status:Ie.Unknown})})]}),t(ae,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:le.XS,children:xr(g)})]}),list:f.length?f:n?[t(at,{$height:"100%",children:t(ct,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(at,{$height:"100%",children:t(Ce,c?{icon:Ti,title:Cr,subTitle:h.noGroupMatchedFilter(c)}:{icon:Ti,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:V,setSelectedArea:U,searchText:M===gt.Namespace?L:"",searchBy:M,filters:B}),H=(({formData:n,handleSourceChange:o,handleSelectAll:i,selectedArea:l,searchText:s,searchBy:r,filters:c})=>{const{tier:d,isVm:u}=y(),p=yr(u),h=d===ft.Onprem,m=a(()=>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]),g=a(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Fl(e,s,c)):[],[m,s,c]),f=a(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=a(()=>{if(!m)return[];const{clusterId:e}=l.value,{name:n}=m;return g.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&Ll.has(l);return t(Or,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:a,kind:l}}),disabled:s,disabledReason:Er},`${e}#${n}#${a}#${l}`)})},[g,m,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(De,{text:v?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${v?`${C} / ${S}`:S}`,status:Ie.Unknown})})]}),t(ae,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:s,searchBy:r,filters:c}),disabled:!b.length,size:le.XS,children:xr(f)})]}),list:b.length?b:[t(at,{$height:"100%",children:t(Ce,m?s?{icon:ki,title:Cr,subTitle:wr(s)}:{icon:ki,title:Sr,subTitle:p.noItemsInGroupSubTitle}:{icon:ki,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:{value:V},searchText:M===gt.Source?L:"",searchBy:M,filters:B});return t(Cl,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:n?()=>{$(wt.BulkInstrumenting),n()}:void 0,onBack:i?()=>i(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:ki,title:Ge.ADD_SOURCE,subTitle:Ge.ADD_SOURCES_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:L,onChange:e=>{_(e),M===gt.Namespace&&U({clusterId:"",clusterName:"",namespaceName:""})},placeholder:x.searchPlaceholder(M),segment:{options:[{label:x.groupSegmentLabel,value:gt.Namespace},{label:x.itemSegmentLabel,value:gt.Source}],selected:M,setSelected:z}},filters:e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:kr}),t(Q,{name:"filter-selected",size:bt.S,label:Tr,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:I,progress:{title:Ge.CREATING_SOURCES,subTitle:Ge.CREATING_SOURCES_SUBTITLE,percentage:T[wt.BulkInstrumenting]?.percentage||0},leftColumn:G,rightColumn:H})},_r=(e,t)=>{const n=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?Ie.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.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:Ge.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:Ge.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:Ge.NOTES,label:e.notes}),n},Mr=({onClose:i,actionId:r})=>{const c=f(),{actionsApi:d}=ll(),{items:u,refetch:p}=d.useActions(),{selectedOption:h,loadAction:m,validateFormData:g,genericForm:b}=El();o(()=>{p()},[]);const[v,y]=s(!1),[C,S]=s(!1),[w,x]=s(null),k=v&&!!b?.isFormDirty,T=a(()=>u?.find(e=>xt(e)===r),[r,u]),$=a(()=>ot.find(({type:e})=>e===T?.type)??null,[T?.type]);o(()=>{T&&m(T)},[T]);const I=l(()=>{T&&y(!0)},[T]),E=l(()=>{T&&(m(T),y(!1))},[T,m]),A=l(()=>{k?x("close"):i()},[k,i]),N=l(()=>{k?x("cancel"):E()},[k,E]),O=l(()=>{const e=w;x(null),"close"===e?(E(),i()):E()},[w,E,i]),R=l(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=g();e||(await d.update(T.id,t),y(!1))}},[T,g,d]),D=l(()=>{T&&S(!0)},[T]),P=l(async()=>{T&&(await d.remove(T.id,T.type),i())},[T,d,i]);if(!T||!$)return null;const F=(e=>{const t=[],{type:n,fields:o}=e,a=e=>({status:e?Ie.Success:Ie.Unknown,label:e?"True":"False",invertColors:!0});if(n===ye.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(o.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(o.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(o.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(o.collectClusterId)}),o.labelsAttributes?.forEach(({labelKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||Z.Pod,r=(o.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:n}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),o.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||Z.Pod,r=(o.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:n}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),n===ye.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(o.overwriteExistingValues)}),o.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:n},o)=>{t.push({id:`cluster-attr-${o}`,title:e,label:n})})),n===ye.DeleteAttributes&&o.attributeNamesToDelete?.forEach((e,n)=>{t.push({id:`del-attr-${n}`,title:"Attribute"+((o.attributeNamesToDelete?.length??0)>1?` #${n+1}`:""),label:e})}),n===ye.RenameAttributes&&Object.entries(o.renames||{}).forEach(([e,n],o)=>{t.push({id:`rename-${o}`,title:e,label:n})}),n===ye.PiiMasking&&o.piiCategories?.forEach((e,n)=>{t.push({id:`pii-${n}`,title:"Category"+((o.piiCategories?.length??0)>1?` #${n+1}`:""),label:e})}),n===ye.ExtractAttribute){const e=o.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:n,lookupKey:o,dataFormat:a,regex:i},l)=>{const s=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${s}New Attribute Name`,label:n||"-"}),o&&t.push({id:`extract-${l}-lookupKey`,title:`${s}Lookup Key`,label:o}),a&&t.push({id:`extract-${l}-format`,title:`${s}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${s}Regex`,label:i})})}return n===ye.URLTemplatization&&o.urlTemplatizationRulesGroups?.forEach((e,n)=>{const a=(o.urlTemplatizationRulesGroups?.length??0)>1?`Group #${n+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${n}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((o,i)=>{const l=[o.kind,o.name].filter(Boolean).join("/");l&&t.push({id:`group-${n}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${n}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${n}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(n,{children:[t(ne,{isOpen:!0,header:{icon:Et(T.type),title:$.label,onClose:A,actions:[{id:"edit-action-btn-edit",label:kt.EDIT,icon:hi,active:v,onClick:I},{id:"edit-action-btn-delete",label:kt.DELETE,icon:li,color:c.v2.colors.red[500],active:C,onClick:D}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:N},{"data-id":"edit-action-btn-save",label:kt.SAVE,variant:de.Primary,onClick:R}]:[]},children:t(Tt,{$padding:"4px 12px 12px",children:v&&h?t(Rs,{}):t(W,{$gap:16,children:e($t,{bgTint:"1000",children:[e($t,{bgTint:"900",children:[t(It,{conditions:T.conditions||[]}),t($t,{bgTint:"800",cellsPerRow:2,items:_r(T,$)})]}),!!F?.length&&t($t,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t($t,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(Sl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(wl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})},zr=({onClose:n,connections:l,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=ll(),[u,p]=s(""),[h,m]=s({showOnlySelected:!1}),g=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&n}),[l.length,r.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=At(C||{rollout:{automaticRolloutDisabled:!1}}),T=i(k);T.current=k,o(()=>{C&&T.current(C)},[C]);const $=a(()=>r.length>1||void 0!==C&&!x(C,S),[r.length,C,S]);return t(Cl,{isOpen:!0,onClose:n,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:$i,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:"Show only:"}),t(Q,{size:bt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:$,isFetching:y,leftColumn:{width:"35%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,children:"Clusters"}),t(Be,{label:g.length,status:Ie.Unknown})]}),e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,align:"right",children:"Selected clusters"}),t(Be,{label:`${r.length}/${g.length}`,status:Ie.Unknown})]})]}),list:g.map(e=>t(ar,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ae,{size:le.XS,children:"Configurations"}),list:[t(Q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Br=e=>{const t=[{id:"type",title:Ge.TYPE,label:e.destinationType.displayName},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?Ie.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}],n=Ae(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:Ge.MONITORS,label:n}),e.name&&t.push({id:"name",title:Ge.NAME,label:e.name}),t},Xr=({onClose:r,destinationId:c})=>{const d=f(),{isVm:u}=y(),{destinationsApi:p}=ll(),{selectedStreamName:h}=He(),{items:m,refetch:g}=p.useDestinations(),{data:b,loading:v}=p.useDestinationCategories(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Al();o(()=>{g()},[]);const k=i(null),[T,$]=s(!1),[I,E]=s(!1),[A,N]=s(null),O=T&&!!x?.isFormDirty,R=a(()=>Rt(m,h),[m,h]),D=a(()=>R?.find(e=>xt(e)===c),[c,R]),P=b?.destinationCategories?.categories??null;o(()=>{D&&P&&S(D,P)},[D,P]);const F=a(()=>D&&P?Dt(P,D):[],[D,P]),L=l(()=>{D&&$(!0)},[D]),_=l(()=>{D&&P&&(S(D,P),$(!1))},[D,P,S]),M=l(()=>{O?N("close"):r()},[O,r]),z=l(()=>{O?N("cancel"):_()},[O,_]),B=l(()=>{const e=A;N(null),"close"===e?(_(),r()):_()},[A,_,r]),X=l(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=w();e||(await p.update(D.id,Oe(t)),$(!1))}},[D,w,p]),V=l(()=>{D&&E(!0)},[D]),U=l(async()=>{D&&(await p.remove(D.id),r())},[D,p,r]);if(!D)return null;const{icon:G,iconSrc:H}=ut(D.destinationType.type),j=((e,t)=>{const n=[],o=Nt(e,t),a=o.map(e=>({name:e.key,value:e.value})),i=Ae(e.exportedSignals);let l=[];const s=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Te(h,i,a))return;const{type:g}=ht(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==r&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(r)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(u===Ot.MultiInput){const t=ht(r,null);if(Array.isArray(t)&&t.length)return s(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(u===Ot.KeyValuePair){const t=ht(r,null);if(Array.isArray(t)&&t.length)return s(),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:r})}else l.push({id:e,title:o,label:"-"})}),s(),n})(D,F);return e(n,{children:[t(ne,{isOpen:!0,header:{icon:G,iconSrc:H,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:kt.EDIT,icon:hi,active:T,onClick:L},{id:"edit-destination-btn-delete",label:kt.DELETE,icon:li,color:d.v2.colors.red[500],active:I,onClick:V}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:z},...C?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:kt.TEST_CONNECTION,variant:de.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:kt.SAVE,variant:de.Primary,onClick:X}]:[]},children:t(Tt,{$padding:"4px 12px 12px",children:v?t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})}):T&&C?t(Fs,{ref:k,isEdit:!0}):t(W,{$gap:16,children:e($t,{bgTint:"1000",children:[e($t,{bgTint:"900",children:[!u&&t(It,{conditions:D.conditions||[]}),t($t,{bgTint:"800",cellsPerRow:2,items:Br(D)})]}),!!j.length&&t($t,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:j.map(e=>"cells"===e.kind?t($t,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t($t,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Sl,{target:"destination",isOpen:I,onClose:()=>E(!1),onApprove:U}),t(wl,{isOpen:null!==A,onClose:()=>N(null),onApprove:B})]})},Vr=(e,t)=>{const n=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?Ie.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}];return e.ruleName&&n.push({id:"name",title:Ge.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:Ge.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:Ge.NOTES,label:e.notes}),n},Ur=({onClose:i,ruleId:r})=>{const c=f(),{addNotification:d}=Ft(),{instrumentationRulesApi:u}=ll(),{items:p,refetch:h}=u.useRules(),{selectedOption:m,loadRule:g,validateFormData:b,genericForm:v}=Nl();o(()=>{h()},[]);const[y,C]=s(!1),[S,w]=s(!1),[x,k]=s(null),T=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>xt(e)===r),[r,p]),I=a(()=>mt.find(({type:e})=>e===$?.type)??null,[$?.type]);o(()=>{$&&g($)},[$]);const E=l(()=>{if($){if(!$.mutable)return void d({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_EDIT_RULE,crdType:gt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,d]),A=l(()=>{$&&(g($),C(!1))},[$,g]),N=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):A()},[T,A]),R=l(()=>{const e=x;k(null),"close"===e?(A(),i()):A()},[x,A,i]),D=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),C(!1))}},[$,b,u]),P=l(()=>{if($){if(!$.mutable)return void d({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_DELETE_RULE,crdType:gt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,d]),F=l(async()=>{$&&(await u.remove($.ruleId,$.type),i())},[$,u,i]);if(!$||!I)return null;const L=((e,n)=>{const o=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,n])=>{n&&o.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,n])=>{n&&o.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Pe.HeaderKeys]?.length&&e.headersCollection[Pe.HeaderKeys].forEach((e,n)=>{e&&o.push(t(ae,{size:le.XS,children:e},`header-${n}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Me.Java]?.forEach((e,a)=>{const i=new _e(e.className,e.methodName);if(i.Verify()){0===a&&o.push(t(ae,{size:le.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();o.push(t(ae,{size:le.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`java-probe-${a}-${e}`))}}),e.customInstrumentations[Me.Golang]?.forEach((e,a)=>{const i=new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&o.push(t(ae,{size:le.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();o.push(t(ae,{size:le.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${a}-${e}`))}})),o})($,c);return e(n,{children:[t(ne,{isOpen:!0,header:{icon:Mt($.type),title:I.label,onClose:N,actions:[{id:"edit-rule-btn-edit",label:kt.EDIT,icon:hi,active:y,onClick:E},{id:"edit-rule-btn-delete",label:kt.DELETE,icon:li,color:c.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:kt.SAVE,variant:de.Primary,onClick:D}]:[]},children:t(Tt,{$padding:"4px 12px 12px",children:y&&m?t(Us,{}):t(W,{$gap:16,children:e($t,{bgTint:"1000",children:[e($t,{bgTint:"900",children:[t(It,{conditions:$.conditions||[]}),t($t,{bgTint:"800",cellsPerRow:2,items:Vr($,I)})]}),t(dl,{readOnly:!0,scopes:$.sourceScopes??null}),!!L.length&&t($t,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t($t,{bgTint:"800",children:L})}),!!I.supportedLanguages.length&&t($t,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t($t,{bgTint:"800",children:t(se,{$gap:12,$wrap:"wrap",children:I.supportedLanguages.map(e=>t(_t,{label:Xe[e],leftIcon:Ve(e),flex:"0.5"},e))})})})]})})})}),t(Sl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(wl,{isOpen:null!==x,onClose:()=>k(null),onApprove:R})]})};var Gr;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(Gr||(Gr={}));const Hr=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:i,podName:l,nodeName:s,startTime:r,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=zt(),m=Bt(!!n),g=a(()=>({title:l,icon:Ii,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Xt(c);t&&e.push(t);const n=Xt(d,Ei,"health");n&&e.push(n);const o=Xt(u,Ai,"health");return o&&e.push(o),e},[c,d,u]),b=a(()=>o?[{id:`restart-pod-${l}`,icon:Ni,label:kt.RESTART_POD,onClick:()=>o(i,l)}]:void 0,[o,i,l]),v=a(()=>[{id:"nodeName",title:Ge.NODE,label:s,withCopy:!0},{id:"age",title:Ge.AGE,label:r?h(r,{style:"short"}):Ge.NOT_RUNNING,labelTooltip:r}],[s,r,h]);return t("div",{ref:m,children:t($t,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},jr=g.div`
|
|
191
|
+
`,Js=({clusterId:n,namespaceName:o,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(Ks,{children:t(Cs,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(ue,{$gap:12,children:[!d&&t(Ys,{$visible:r||i,children:t(ze,{text:Us,children:t(oe,{label:Vs,labelAlign:ae.Left,size:kt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(ue,{$gap:8,children:[t(se,{variant:Tt.Span,size:de.XXXS,color:ce.Secondary,align:"right",children:Xs}),t(je,{label:`${l.sourced}/${l.total}`,status:r?Re.Default:Re.Unknown,minWidth:"42px"})]})]})})})},qs=({withCollapse:e,clusterId:n,clusterName:o,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Js,{clusterId:n,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,o,i,l]);return e?t(Ts,{title:o,list:c,noBgColor:!0}):c},Zs=({onClose:n,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=y(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=gl(),{data:f,loading:b,refetch:v}=m.useSnapshots(),{items:C,loading:S,refetch:w}=g.useNamespaces(),x=Fs(p),{selectedStreamName:k}=qe(),{progress:T,resetProgress:$}=$t(),{isFetching:I,setIsFetching:E,setSnapshots:A,formData:N,handleSourceChange:O,handleSelectAll:R,formDiff:D,isFormDirty:P}=Kl();o(()=>{v(),w()},[]);const F=a(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:Et,clusterName:It,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[f,C,k]);o(()=>{E(b||S),F&&A(F)},[F,b,S,E,A]);const[L,_]=r(""),[M,z]=r(wt.Namespace),[B,X]=r({showOnlySelected:!1}),[V,U]=r({clusterId:"",clusterName:"",namespaceName:""}),G=(({isFetching:n,formData:o,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=Fs(p),m=a(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>jl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Wl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,u]),g=a(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(qs,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==a,filteredCount:n,totalCount:a}},[m,o,r]);return{width:"60%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,nowrap:!0,children:h.groupColumnHeader}),t(ze,{text:b?Je.FILTERED_COUNT_TOOLTIP:void 0,children:t(je,{label:`${b?`${v} / ${C}`:C}`,status:Re.Unknown})})]}),t(se,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:de.XS,children:zs(g)})]}),list:f.length?f:n?[t(pt,{$height:"100%",children:t(bt,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(pt,{$height:"100%",children:t(Ie,c?{icon:Pi,title:Ls,subTitle:h.noGroupMatchedFilter(c)}:{icon:Pi,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:V,setSelectedArea:U,searchText:M===wt.Namespace?L:"",searchBy:M,filters:B}),H=(({formData:n,handleSourceChange:o,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=Fs(u),h=d===xt.Onprem,m=a(()=>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]),g=a(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Gl(e,r,c)):[],[m,r,c]),f=a(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=a(()=>{if(!m)return[];const{clusterId:e}=l.value,{name:n}=m;return g.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Hl.has(l);return t(Ws,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:a,kind:l}}),disabled:r,disabledReason:Gs},`${e}#${n}#${a}#${l}`)})},[g,m,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(ze,{text:v?Je.FILTERED_COUNT_TOOLTIP:void 0,children:t(je,{label:`${v?`${C} / ${S}`:S}`,status:Re.Unknown})})]}),t(se,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:de.XS,children:zs(f)})]}),list:b.length?b:[t(pt,{$height:"100%",children:t(Ie,m?r?{icon:Di,title:Ls,subTitle:Ms(r)}:{icon:Di,title:_s,subTitle:p.noItemsInGroupSubTitle}:{icon:Di,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:{value:V},searchText:M===wt.Source?L:"",searchBy:M,filters:B});return t(Al,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:n?()=>{$(At.BulkInstrumenting),n()}:void 0,onBack:i?()=>i(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:Di,title:Je.ADD_SOURCE,subTitle:Je.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{_(e),M===wt.Namespace&&U({clusterId:"",clusterName:"",namespaceName:""})},placeholder:x.searchPlaceholder(M),segment:{options:[{label:x.groupSegmentLabel,value:wt.Namespace},{label:x.itemSegmentLabel,value:wt.Source}],selected:M,setSelected:z}},filters:e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,nowrap:!0,children:Bs}),t(oe,{name:"filter-selected",size:kt.S,label:Xs,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:I,progress:{title:Je.CREATING_SOURCES,subTitle:Je.CREATING_SOURCES_SUBTITLE,percentage:T[At.BulkInstrumenting]?.percentage||0},leftColumn:G,rightColumn:H})},Qs=(e,t)=>{const n=[{id:"type",title:Je.TYPE,label:t.label},{id:"status",title:Je.STATUS,badge:{status:e.disabled?Re.Unknown:Re.Success,label:e.disabled?Je.DISABLED:Je.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:Je.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:Je.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:Je.NOTES,label:e.notes}),n},ec=({onClose:i,actionId:s})=>{const c=f(),{actionsApi:d}=gl(),{items:u,refetch:p}=d.useActions(),{options:h}=d.useActionTypes(),{selectedOption:m,loadAction:g,validateFormData:b,genericForm:v}=_l();o(()=>{p()},[]);const[y,C]=r(!1),[S,w]=r(!1),[x,k]=r(null),T=y&&!!v?.isFormDirty,$=a(()=>u?.find(e=>Nt(e)===s),[s,u]),I=a(()=>h.find(({type:e})=>e===$?.type)??Ot.find(({type:e})=>e===$?.type)??null,[h,$?.type]);o(()=>{$&&g($,I)},[$,I]);const E=l(()=>{$&&C(!0)},[$]),A=l(()=>{$&&(g($,I),C(!1))},[$,I,g]),N=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):A()},[T,A]),R=l(()=>{const e=x;k(null),"close"===e?(A(),i()):A()},[x,A,i]),D=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await d.update($.id,t),C(!1))}},[$,b,d]),P=l(()=>{$&&w(!0)},[$]),F=l(async()=>{$&&(await d.remove($.id,$.type),i())},[$,d,i]);if(!$||!I)return null;const L=(e=>{const t=[],{type:n,fields:o}=e,a=e=>({status:e?Re.Success:Re.Unknown,label:e?"True":"False",invertColors:!0});if(n===$e.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(o.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(o.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(o.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(o.collectClusterId)}),o.labelsAttributes?.forEach(({labelKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||ne.Pod,s=(o.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:n}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),o.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||ne.Pod,s=(o.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:n}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),n===$e.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(o.overwriteExistingValues)}),o.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:n},o)=>{t.push({id:`cluster-attr-${o}`,title:e,label:n})})),n===$e.DeleteAttributes&&o.attributeNamesToDelete?.forEach((e,n)=>{t.push({id:`del-attr-${n}`,title:"Attribute"+((o.attributeNamesToDelete?.length??0)>1?` #${n+1}`:""),label:e})}),n===$e.RenameAttributes&&Object.entries(o.renames||{}).forEach(([e,n],o)=>{t.push({id:`rename-${o}`,title:e,label:n})}),n===$e.PiiMasking&&o.piiCategories?.forEach((e,n)=>{t.push({id:`pii-${n}`,title:"Category"+((o.piiCategories?.length??0)>1?` #${n+1}`:""),label:e})}),n===$e.ExtractAttribute){const e=o.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:n,lookupKey:o,dataFormat:a,regex:i},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:n||"-"}),o&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:o}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})})}return n===$e.URLTemplatization&&o.urlTemplatizationRulesGroups?.forEach((e,n)=>{const a=(o.urlTemplatizationRulesGroups?.length??0)>1?`Group #${n+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${n}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((o,i)=>{const l=[o.kind,o.name].filter(Boolean).join("/");l&&t.push({id:`group-${n}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${n}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${n}-notes`,title:`${a}Notes`,label:e.notes})}),t})($);return e(n,{children:[t(le,{isOpen:!0,header:{icon:Ft($.type),title:I.label,onClose:N,actions:[{id:"edit-action-btn-edit",label:Rt.EDIT,icon:wi,active:y,onClick:E},{id:"edit-action-btn-delete",label:Rt.DELETE,icon:gi,color:c.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-action-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:O},{"data-id":"edit-action-btn-save",label:Rt.SAVE,variant:me.Primary,onClick:D}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:y&&m?t(Kr,{}):t(q,{$gap:16,children:e(Dt,{bgTint:"1000",children:[e(Dt,{bgTint:"900",children:[t(Pt,{conditions:$.conditions||[]}),t(Dt,{bgTint:"800",cellsPerRow:2,items:Qs($,I)})]}),!!L?.length&&t(Dt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Dt,{bgTint:"800",cellsPerRow:2,items:L})})]})})})}),t(Nl,{target:"action",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(Ol,{isOpen:null!==x,onClose:()=>k(null),onApprove:R})]})},tc=({onClose:n,connections:l,selectedConnectionIds:s,setSelectedConnectionIds:c})=>{const{configApi:d}=gl(),[u,p]=r(""),[h,m]=r({showOnlySelected:!1}),g=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&s.includes(e.id);return t&&n}),[l.length,s.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===s.length?s[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=Lt(C||{rollout:{automaticRolloutDisabled:!1}}),T=i(k);T.current=k,o(()=>{C&&T.current(C)},[C]);const $=a(()=>s.length>1||void 0!==C&&!x(C,S),[s.length,C,S]);return t(Al,{isOpen:!0,onClose:n,onSave:async()=>await(d.applyConfigurations?.(S,s))??void 0,header:{icon:Fi,title:"Cluster Configuration"},connectionIds:{value:s,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,nowrap:!0,children:"Show only:"}),t(oe,{size:kt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:$,isFetching:y,leftColumn:{width:"35%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,children:"Clusters"}),t(je,{label:g.length,status:Re.Unknown})]}),e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,align:"right",children:"Selected clusters"}),t(je,{label:`${s.length}/${g.length}`,status:Re.Unknown})]})]}),list:g.map(e=>t(Cs,{title:e.name,isChecked:s.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(se,{size:de.XS,children:"Configurations"}),list:[t(oe,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},nc=e=>{const t=[{id:"type",title:Je.TYPE,label:e.destinationType.displayName},{id:"status",title:Je.STATUS,badge:{status:e.disabled?Re.Unknown:Re.Success,label:e.disabled?Je.DISABLED:Je.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:Je.MONITORS,label:n}),e.name&&t.push({id:"name",title:Je.NAME,label:e.name}),t},oc=({onClose:s,destinationId:c})=>{const d=f(),{isVm:u}=y(),{destinationsApi:p}=gl(),{selectedStreamName:h}=qe(),{items:m,refetch:g}=p.useDestinations(),{data:b,loading:v}=p.useDestinationCategories(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Ml();o(()=>{g()},[]);const k=i(null),[T,$]=r(!1),[I,E]=r(!1),[A,N]=r(null),O=T&&!!x?.isFormDirty,R=a(()=>Mt(m,h),[m,h]),D=a(()=>R?.find(e=>Nt(e)===c),[c,R]),P=b?.destinationCategories?.categories??null;o(()=>{D&&P&&S(D,P)},[D,P]);const F=a(()=>D&&P?zt(P,D):[],[D,P]),L=l(()=>{D&&$(!0)},[D]),_=l(()=>{D&&P&&(S(D,P),$(!1))},[D,P,S]),M=l(()=>{O?N("close"):s()},[O,s]),z=l(()=>{O?N("cancel"):_()},[O,_]),B=l(()=>{const e=A;N(null),"close"===e?(_(),s()):_()},[A,_,s]),X=l(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=w();e||(await p.update(D.id,_e(t)),$(!1))}},[D,w,p]),V=l(()=>{D&&E(!0)},[D]),U=l(async()=>{D&&(await p.remove(D.id),s())},[D,p,s]);if(!D)return null;const{icon:G,iconSrc:H}=yt(D.destinationType.type),j=((e,t)=>{const n=[],o=_t(e,t),a=o.map(e=>({name:e.key,value:e.value})),i=Fe(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:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&xe(h,i,a))return;const{type:g}=Te(p,{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(u===ke.MultiInput){const t=Te(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(u===ke.KeyValuePair){const t=Te(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,F);return e(n,{children:[t(le,{isOpen:!0,header:{icon:G,iconSrc:H,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Rt.EDIT,icon:wi,active:T,onClick:L},{id:"edit-destination-btn-delete",label:Rt.DELETE,icon:gi,color:d.v2.colors.red[500],active:I,onClick:V}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:z},...C?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:Rt.TEST_CONNECTION,variant:me.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Rt.SAVE,variant:me.Primary,onClick:X}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:v?t(pt,{$height:"50vh",children:t(bt,{withSpinner:!0})}):T&&C?t(qr,{ref:k,isEdit:!0}):t(q,{$gap:16,children:e(Dt,{bgTint:"1000",children:[e(Dt,{bgTint:"900",children:[!u&&t(Pt,{conditions:D.conditions||[]}),t(Dt,{bgTint:"800",cellsPerRow:2,items:nc(D)})]}),!!j.length&&t(Dt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:j.map(e=>"cells"===e.kind?t(Dt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Dt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Nl,{target:"destination",isOpen:I,onClose:()=>E(!1),onApprove:U}),t(Ol,{isOpen:null!==A,onClose:()=>N(null),onApprove:B})]})},ac=(e,t)=>{const n=[{id:"type",title:Je.TYPE,label:t.label},{id:"status",title:Je.STATUS,badge:{status:e.disabled?Re.Unknown:Re.Success,label:e.disabled?Je.DISABLED:Je.ENABLED}}];return e.ruleName&&n.push({id:"name",title:Je.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:Je.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:Je.NOTES,label:e.notes}),n},ic=({onClose:i,ruleId:s})=>{const c=f(),{addNotification:d}=Xt(),{instrumentationRulesApi:u}=gl(),{items:p,refetch:h}=u.useRules(),{selectedOption:m,loadRule:g,validateFormData:b,genericForm:v}=zl();o(()=>{h()},[]);const[y,C]=r(!1),[S,w]=r(!1),[x,k]=r(null),T=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>Nt(e)===s),[s,p]),I=a(()=>St.find(({type:e})=>e===$?.type)??null,[$?.type]);o(()=>{$&&g($)},[$]);const E=l(()=>{if($){if(!$.mutable)return void d({type:Re.Warning,title:Vt.FORBIDDEN,message:Vt.CANNOT_EDIT_RULE,crdType:wt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,d]),A=l(()=>{$&&(g($),C(!1))},[$,g]),N=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):A()},[T,A]),R=l(()=>{const e=x;k(null),"close"===e?(A(),i()):A()},[x,A,i]),D=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),C(!1))}},[$,b,u]),P=l(()=>{if($){if(!$.mutable)return void d({type:Re.Warning,title:Vt.FORBIDDEN,message:Vt.CANNOT_DELETE_RULE,crdType:wt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,d]),F=l(async()=>{$&&(await u.remove($.ruleId,$.type),i())},[$,u,i]);if(!$||!I)return null;const L=((e,n)=>{const o=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,n])=>{n&&o.push(t(se,{size:de.XS,children:`• ${Bt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,n])=>{n&&o.push(t(se,{size:de.XS,children:`• ${Bt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Be.HeaderKeys]?.length&&e.headersCollection[Be.HeaderKeys].forEach((e,n)=>{e&&o.push(t(se,{size:de.XS,children:e},`header-${n}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ge.Java]?.forEach((e,a)=>{const i=new Ue(e.className,e.methodName);if(i.Verify()){0===a&&o.push(t(se,{size:de.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();o.push(t(se,{size:de.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`java-probe-${a}-${e}`))}}),e.customInstrumentations[Ge.Golang]?.forEach((e,a)=>{const i=new Ve(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&o.push(t(se,{size:de.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();o.push(t(se,{size:de.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${a}-${e}`))}})),o})($,c);return e(n,{children:[t(le,{isOpen:!0,header:{icon:Gt($.type),title:I.label,onClose:N,actions:[{id:"edit-rule-btn-edit",label:Rt.EDIT,icon:wi,active:y,onClick:E},{id:"edit-rule-btn-delete",label:Rt.DELETE,icon:gi,color:c.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:Rt.SAVE,variant:me.Primary,onClick:D}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:y&&m?t(is,{}):t(q,{$gap:16,children:e(Dt,{bgTint:"1000",children:[e(Dt,{bgTint:"900",children:[t(Pt,{conditions:$.conditions||[]}),t(Dt,{bgTint:"800",cellsPerRow:2,items:ac($,I)})]}),t(yl,{readOnly:!0,scopes:$.sourceScopes??null}),!!L.length&&t(Dt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Dt,{bgTint:"800",children:L})}),!!I.supportedLanguages.length&&t(Dt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Dt,{bgTint:"800",children:t(ue,{$gap:12,$wrap:"wrap",children:I.supportedLanguages.map(e=>t(Ut,{label:We[e],leftIcon:Ke(e),flex:"0.5"},e))})})})]})})})}),t(Nl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(Ol,{isOpen:null!==x,onClose:()=>k(null),onApprove:R})]})};var lc;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(lc||(lc={}));const rc=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Ht(),m=jt(!!n),g=a(()=>({title:l,icon:Li,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Wt(c);t&&e.push(t);const n=Wt(d,_i,"health");n&&e.push(n);const o=Wt(u,Mi,"health");return o&&e.push(o),e},[c,d,u]),b=a(()=>o?[{id:`restart-pod-${l}`,icon:zi,label:Rt.RESTART_POD,onClick:()=>o(i,l)}]:void 0,[o,i,l]),v=a(()=>[{id:"nodeName",title:Je.NODE,label:r,withCopy:!0},{id:"age",title:Je.AGE,label:s?h(s,{style:"short"}):Je.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Dt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},sc=g.div`
|
|
192
192
|
display: flex;
|
|
193
193
|
align-items: center;
|
|
194
194
|
justify-content: space-between;
|
|
@@ -196,7 +196,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
196
196
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
197
197
|
border-radius: 12px;
|
|
198
198
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
199
|
-
`,
|
|
199
|
+
`,cc=({podsOdigosHealthStatus:n,pods:o,noPadding:i})=>{const l=Jt(n?.status),r=Bt(n?.name),s=n?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:o?.length||0,injectionsAsExpectedCount:o?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Kt.Success?1:0),0)||0,odigosHealthyPodsCount:o?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Kt.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Kt.Success?1:0),0)||0}),[o]);return o?.length&&n&&l?e(sc,{$noPadding:i,children:[t(Yt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(ue,{$gap:8,children:[t(uc,{label:Je.PODS,count:c}),t(uc,{label:Je.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(uc,{label:Je.ODIGOS_HEALTHY,icon:_i,count:u,total:c}),t(uc,{label:Je.KUBERNETES_HEALTHY,icon:Mi,count:p,total:c})]})]}):null},dc=g.div`
|
|
200
200
|
display: flex;
|
|
201
201
|
flex-direction: column;
|
|
202
202
|
justify-content: center;
|
|
@@ -207,7 +207,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
207
207
|
width: fit-content;
|
|
208
208
|
border-radius: 8px;
|
|
209
209
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
210
|
-
`,
|
|
210
|
+
`,uc=({count:n,total:o,label:a,icon:i})=>{const l=f(),r=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(dc,{children:[e(ue,{$gap:0,$alignItems:"flex-end",children:[t(se,{size:de.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==o&&t(se,{size:de.S,color:r,weight:500,nowrap:!0,children:`/${o}`})]}),e(ue,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(se,{size:de.XXXS,nowrap:!0,children:a})]})]})},pc=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===qt.PID)??e.identifyingAttributes?.find(({name:e})=>e===qt.VPID);return t?.value??null};var hc;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(hc||(hc={}));const mc=({overrideProcessNum:n,healthy:i,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=r(hc.IdentifyingAttributes),m=jt(!!d),{tabOptions:g,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:hc.IdentifyingAttributes,label:Je.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:hc.InstrumentationLibraries,label:Je.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Bi,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.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]);o(()=>{b&&h(b)},[b]);const y=a(()=>{switch(p){case hc.IdentifyingAttributes:return t(q,{children:s?.map((e,n)=>t(yc,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case hc.InstrumentationLibraries:return t(q,{children:c?.map((e,n)=>t(yc,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[p,s,c]),C=a(()=>pc({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Dt,{bgTint:"800",richTitle:{title:C?`${Je.PROCESS} ${Je.PID(C)}`:Je.PROCESS_FALLBACK_NAME},renderOnRightSide:t(se,{color:i?ce.Success:ce.Error,size:de.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?Re.Success:Re.Error,leftIcon:_i,label:i?Je.HEALTHY:Je.NOT_HEALTHY,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(ge,{options:g,selected:p,setSelected:h}),!v&&y]})})},gc=g.div`
|
|
211
211
|
display: flex;
|
|
212
212
|
align-items: flex-start;
|
|
213
213
|
gap: 8px;
|
|
@@ -216,23 +216,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
216
216
|
&:hover {
|
|
217
217
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
218
218
|
}
|
|
219
|
-
`,
|
|
219
|
+
`,fc=g(se)`
|
|
220
220
|
flex: 0 0 30%;
|
|
221
|
-
`,
|
|
221
|
+
`,bc=g(se)`
|
|
222
222
|
flex: 1 1 auto;
|
|
223
223
|
min-width: 0;
|
|
224
|
-
`,
|
|
224
|
+
`,vc=g(ue)`
|
|
225
225
|
flex: 1 1 auto;
|
|
226
226
|
justify-content: flex-end;
|
|
227
227
|
min-width: 0;
|
|
228
|
-
`,
|
|
228
|
+
`,yc=({label:n,value:o,isStandardLibrary:a,healthy:i,message:l})=>{const r="boolean"==typeof i;return e(gc,{children:[t(fc,{size:de.XXS,color:ce.Secondary,children:n}),o&&t(bc,{size:de.XXS,color:ce.Primary,align:"right",children:o}),(r||a)&&e(vc,{children:[a&&t(je,{status:Re.Info,label:Je.STANDARD,textSize:de.XXXS,invertColors:!0}),r&&t(je,{status:i?Re.Success:Re.Error,label:i?Je.HEALTHY:Je.NOT_HEALTHY,textSize:de.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Cc=p(null),Sc=({value:e,children:n})=>t(Cc.Provider,{value:e,children:n}),wc=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const i=e??[],l=a(()=>({title:Je.CONTAINERS,titleSize:de.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Dt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(q,{$gap:8,children:i.map(e=>{const n=o?.containerName===e.containerName;return t(kc,{...e,language:Zt(r.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},xc=g.div`
|
|
229
229
|
display: flex;
|
|
230
230
|
flex-direction: column;
|
|
231
231
|
gap: 12px;
|
|
232
232
|
padding: 8px 12px;
|
|
233
233
|
border-radius: 8px;
|
|
234
234
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
235
|
-
`,
|
|
235
|
+
`,kc=({language:n,containerName:o,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Ht(),C=jt(v),S=a(()=>({title:o,icon:n?Ke(n):Xi,iconWithWrapper:!0}),[o,n]),w=a(()=>{const e=[],t=Wt({status:i?Kt.Success:Kt.Disabled,reasonEnum:i?Je.INSTRUMENTED_WITH_DISTRO(i):Je.UNINSTRUMENTED,message:""});t&&e.push(t);const n=Wt(h,_i,"health");n&&e.push(n);const o=Wt(m,Mi,"health");return o&&e.push(o),e},[m,h,i]),x=a(()=>[{id:"runningTime",title:Je.RUNNING_TIME,label:l?y(l,{style:"short"}):Je.NOT_RUNNING,labelTooltip:`${Je.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Re.Success:Re.Disabled,leftIcon:r?vi:yi,label:r?Je.STARTED:Je.NOT_STARTED,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Re.Success:Re.Disabled,leftIcon:s?vi:yi,label:s?Je.READY:Je.NOT_READY,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Re.Error:Re.Success,leftIcon:d?yi:vi,label:d?Je.CRASHLOOP:Je.NO_CRASHLOOP,textSize:de.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Je.RESTARTS,badge:{status:c?Re.Error:void 0,label:c||0,textSize:de.XXXS}}],[l,y,r,s,d,c]),k=a(()=>p?Bt(u):"",[p,u]);return t("div",{ref:C,children:e(Dt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(xc,{children:e(ue,{$gap:10,$alignItems:"center",children:[t(Ut,{variant:Qt.Pink,leftIcon:Mi,label:k}),t(se,{size:de.XXXS,color:ce.Error,children:p})]})}),(g??[]).map((e,n)=>{const a=n+1,i=b&&(l=f,r=e,!!l?.processPid&&pc({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(mc,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${o}-process-${a}`)})]})})},Tc=({podName:e,namespace:n,hasRestarted:o})=>{const i=a(()=>({title:Je.DEBUG_COMMANDS,titleSize:de.XS}),[]),l=a(()=>[{label:Je.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:Je.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:Je.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Dt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:n})=>t(en,{bgTint:"700",label:e,value:n},e))})},$c=({source:o,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=h(Cc);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===lc.Pods?l:null,s=o?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=a(()=>({title:Je.PODS,badge:{label:s.length}}),[s.length]);return t(q,{$gap:12,children:c?e(n,{children:[t(cc,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:s}),t(Dt,{bgTint:"1000",richTitle:u,children:s.map(n=>{const a=r?.podName===n.podName,l=a&&!r?.containerName;return e(rc,{...n,namespace:o.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(Tc,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(wc,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:a?r:null})]},`pod-${n.podName}`)})})]}):t(pt,{$height:"70vh",children:t(Ie,{title:Je.NO_RUNNING_PODS,subTitle:Je.NO_RUNNING_PODS_SUBTITLE})})})},Ic=({source:n})=>{const o=a(()=>n.serviceName||n.id.name,[n]),{sourcesApi:i}=gl(),{data:l,loading:r,refetch:s}=i.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(pt,r?{$height:"70vh",children:t(bt,{withSpinner:!0})}:{$height:"70vh",children:t(Ie,{subTitle:Je.COULD_NOT_FETCH_PEER_SOURCES})}):e(ue,{$gap:16,$alignItems:"flex-start",children:[t(Ec,{icon:Vi,title:Je.INBOUND,subTitle:Je.INBOUND_DESCRIPTION(o),onRefresh:s,items:c?.inbound??[]}),t(Ec,{icon:Ui,title:Je.OUTBOUND,subTitle:Je.OUTBOUND_DESCRIPTION(o),onRefresh:s,items:c?.outbound??[]})]})},Ec=({icon:n,title:o,subTitle:i,onRefresh:l,items:s})=>{const[c,d]=r(""),u=a(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Dt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:de.XS,subTitle:i,subTitleSize:de.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:tn.Button,buttonProps:{variant:me.Secondary,size:he.S,leftIcon:zi,onClick:l}}],children:[t(nn,{value:c,onChange:d,width:"100%"}),t(on,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(pt,{$height:"50vh",children:t(Ie,{icon:n,title:Je.NO_RESULTS,subTitle:Je.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(Nc,{...e},`${o}-${e.serviceName}`)):[t(pt,{$height:"50vh",children:t(Ie,{icon:n,title:`No ${o} connections yet`,subTitle:o===Je.INBOUND?Je.NO_INBOUND_CONNECTIONS_DESCRIPTION:Je.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Ac=g.div`
|
|
236
236
|
display: flex;
|
|
237
237
|
align-items: center;
|
|
238
238
|
justify-content: space-between;
|
|
@@ -246,9 +246,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
246
246
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
247
247
|
}
|
|
248
248
|
`}
|
|
249
|
-
`,
|
|
249
|
+
`,Nc=({serviceName:n,isVirtual:o,nodeAttributes:i})=>{const l=an(e=>e.drawerEntityId),{items:r}=gl().sourcesApi.useSources(),s=a(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=a(()=>s&&JSON.stringify(ln(s))!==JSON.stringify(ln(l)),[s,l]),d=a(()=>{if(o){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[rn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===nr)return[Gi];const e=s?sn(s):void 0;return e?.length?e:[Xi]},[o,i,n,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=an.getState();e(wt.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(Ac,{onClick:u,$withClick:!!u,children:[e(ue,{$gap:8,children:[t(cn,{icons:d}),t(se,{size:de.XXS,children:n})]}),o&&t(je,{status:Re.Info,label:Je.VIRTUAL,textSize:de.XXXS,invertColors:!0,tooltip:Je.VIRTUAL_TOOLTIP})]})},Oc=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}},Rc=({source:n})=>{const i=f(),{k8sManifestApi:l}=gl(),[s,c]=r(!0),[d,u]=r(void 0),[p,h]=r(!0),[m,g]=r(void 0);o(()=>{l.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>u(Oc(e))).finally(()=>c(!1)),l.fetch({namespace:n.id.namespace,kind:dn.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(Oc(e))).finally(()=>h(!1))},[l,n.id.namespace,n.id.kind,n.id.name]);const b=a(()=>[{label:Je.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:Je.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:Je.GET_POD_YAML,value:`kubectl get ${dn.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Dt,{bgTint:"1000",children:[t(Dt,{bgTint:"900",richTitle:{icon:Hi,title:Je.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:b.map(({label:e,value:n},o)=>t(en,{label:e,value:n},`debug-cmd-${o}-${e}`))}),s?t(ut,{size:1}):t(Rl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),p?t(ut,{size:1}):t(Rl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},Dc=({title:n,children:o})=>e(q,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,children:n}),o]}),Pc=({source:n})=>{const o=a(()=>{const[e,t]=un(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(Dc,{title:Je.THROUGHPUT_LAST_10_SECONDS,children:e(ue,{$alignItems:"flex-end",$gap:4,children:[t(se,{size:de.L,children:o.value}),t(se,{size:de.XS,variant:Tt.Span,children:o.units})]})})},Fc=({source:n})=>{const{CopyButton:o}=pn();return t(Dc,{title:Je.NAMESPACE,children:e(ue,{children:[t(Ut,{variant:Qt.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:ft.XS})]})})},Lc=({source:e})=>t(Dc,{title:Je.KIND,children:t(ue,{children:t(Ut,{variant:Qt.Blue,label:e.id.kind})})}),_c=({source:n})=>{const{CopyButton:o}=pn();return t(Dc,{title:Je.NAME,children:e(ue,{children:[t(Ut,{variant:Qt.Blue,label:n.id.name}),t(o,{value:n.id.name,size:ft.XS})]})})},Mc=({source:n})=>{const{isVm:o}=y();return t(Dt,{children:e(ue,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!o&&t(Pc,{source:n}),!o&&t(Fc,{source:n}),t(Lc,{source:n}),t(_c,{source:n})]})})},zc=({source:e})=>e.pods?.length?t(Dt,{bgTint:"900",children:t(cc,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Bc=({source:e})=>{const n=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?hn(e.workloadOdigosHealthStatus.status):Re.Unknown,title:Bt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Yt,{...n,width:"100%"}):null},Xc="calc(50% - 6px)",Vc=({source:n,onClickRollout:o,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=n.conditions?.rollout||{},i=Jt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Bt(t):`${Je.ROLLOUT} ${Bt(t)}`,subTitle:a,action:i!==Re.Success?{icon:zi,tooltip:Je.ROLLOUT_RESTART,onClick:o}:void 0}},[n]),r=a(()=>{const{status:e,reasonEnum:t,message:o}=n.autoRollback?.autoRollbackStatus||{},a=Jt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Bt(t):`${Je.ROLLBACK} ${Bt(t)}`,subTitle:o,action:a!==Re.Success?{icon:zi,tooltip:Je.ROLLBACK_RECOVER,onClick:i}:void 0}},[n]);return l||r?e(ue,{$gap:12,$alignItems:"stretch",children:[l&&t(Yt,{invertColors:!0,slim:!0,width:r?Xc:"100%",...l}),r&&t(Yt,{invertColors:!0,slim:!0,width:Xc,...r})]}):null},Uc=p(null),Gc=g.div`
|
|
250
250
|
position: relative;
|
|
251
|
-
`,
|
|
251
|
+
`,Hc=({children:e})=>{const n=i(null);return t(Gc,{ref:n,children:t(Uc.Provider,{value:n,children:e})})},jc=g.div`
|
|
252
252
|
position: fixed;
|
|
253
253
|
top: ${({$coords:e})=>e.top}px;
|
|
254
254
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -262,14 +262,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
262
262
|
padding: 12px 16px;
|
|
263
263
|
border-radius: 12px;
|
|
264
264
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
265
|
-
`,
|
|
265
|
+
`,Wc=g.div`
|
|
266
266
|
display: flex;
|
|
267
267
|
align-items: flex-end;
|
|
268
268
|
justify-content: space-between;
|
|
269
269
|
gap: 8px;
|
|
270
|
-
`,
|
|
270
|
+
`,Kc=g.div`
|
|
271
271
|
flex: 1;
|
|
272
|
-
`,
|
|
272
|
+
`,Yc=({width:n,onClose:o,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:s,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:g})=>{const b=f(),v=h(Uc),[y,C]=r(null);return mn(v??{current:null},o),m(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?or(e(jc,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(q,{$gap:4,children:[t(se,{size:de.XXS,children:c}),t(se,{size:de.XXXS,color:ce.Secondary,children:d})]}),e(Wc,{children:[t(Kc,{children:p}),e(ue,{$gap:8,$width:"fit-content",$margin:`0 0 ${g||0} 0`,children:[t(pe,{variant:me.Secondary,onClick:l,leftIcon:gi,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:he.S,textColor:b.v2.colors.red[500]}),t(pe,{variant:me.Primary,onClick:a,leftIcon:Ni,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:he.S})]})]}),t("div",{children:t(Oe,{status:Re.Warning,message:u})})]}),document.body):null},Jc=({language:n,overridden:o,onOverride:i,defaultValues:l})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=Lt(l),p=a(()=>{if(!n)return[];const e=gn[n].community,t=s===xt.Onprem?gn[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]=r(!1),[g,f]=r(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(ue,{$gap:4,$alignItems:"center",children:[o?t(je,{status:Re.Info,invertColors:!0,label:Je.OVERIDDEN}):null,e(Hc,{children:[t(ze,{text:Je.OVERRIDE_OTEL_DISTRO_NAME,children:t(gt,{icon:wi,onClick:b})}),g&&t(Yc,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(c),m(!1),b()},saveTooltip:Je.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:Je.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Je.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Je.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Je.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(mt,{label:Je.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},qc=({overridden:n,onOverride:o,defaultValues:i,originalValues:l})=>{const{addNotification:s}=Xt(),{formData:c,handleFormChange:d,resetFormData:u}=Lt(i),p=a(()=>fn.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=r(!1),[g,f]=r(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(ue,{children:[n?t(je,{status:Re.Info,invertColors:!0,label:Je.OVERIDDEN}):null,e(Hc,{children:[t(ze,{text:Je.OVERRIDE_RUNTIME_DETAILS,children:t(gt,{icon:wi,onClick:b})}),g&&t(Yc,{width:"500px",onClose:b,onSave:async()=>{!c.version||bn(c.version)?(m(!0),await o(c),m(!1),b()):s({type:Re.Warning,message:Vt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Je.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:Je.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Je.OVERRIDE_RUNTIME_DETAILS,subTitle:Je.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Je.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(ue,{$gap:8,children:[t(mt,{label:Je.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(Se,{label:Je.RUNTIME_VERSION,placeholder:Je.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Zc=({source:e})=>{const{isVm:n}=y(),{containers:o,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Je.DETECTED_PROCESSES:`${e.id.kind} ${Je.CONTAINERS}`,tooltip:t?.message||(n?Je.DETECTED_PROCESSES_DESCRIPTION:Je.DETECTED_CONTAINERS_DESCRIPTION),badge:Jt(t?.status)===Re.Loading?{status:Re.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(Dt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(q,{$gap:8,children:o.map(n=>n&&t(nd,{...n,sourceId:e.id},`source-container-${n.containerName}`))})})},Qc=g.div`
|
|
273
273
|
display: flex;
|
|
274
274
|
flex-direction: column;
|
|
275
275
|
align-self: stretch;
|
|
@@ -277,26 +277,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
277
277
|
padding: 8px 12px;
|
|
278
278
|
border-radius: 8px;
|
|
279
279
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
280
|
-
`,
|
|
280
|
+
`,ed=g.div`
|
|
281
281
|
display: flex;
|
|
282
282
|
align-items: center;
|
|
283
283
|
justify-content: center;
|
|
284
284
|
padding: 8px;
|
|
285
285
|
border-radius: 10px;
|
|
286
286
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
287
|
-
`,
|
|
287
|
+
`,td=g.div`
|
|
288
288
|
display: flex;
|
|
289
289
|
flex-direction: column;
|
|
290
290
|
gap: 12px;
|
|
291
291
|
padding: 8px 12px;
|
|
292
292
|
border-radius: 8px;
|
|
293
293
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
294
|
-
`,
|
|
294
|
+
`,nd=({sourceId:n,...o})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=o,c=f(),{sourcesApi:d}=gl(),u=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),p=a(()=>({language:Zt(o),version:vn(o)||void 0}),[o]),h=a(()=>!!s?.otelDistroName,[s]),m=a(()=>({otelDistroName:s?.otelDistroName||o.agentEnabled?.otelDistroName}),[s,o]),g=a(()=>!l&&!u,[l,u]),b=a(()=>g?Xi:Ke(p.language),[g,p]),v=a(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),y=a(()=>g?{status:Re.Loading,label:Je.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Re.Success:Re.Disabled,leftIcon:r?.otelDistroName?vi:yi,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(n,{containerName:i,...h?m:{},...u?p:{},...e}),S=a(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Je.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Je.TAIL_SAMPLING),e},[o]);return e(Qc,{children:[e(ue,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ue,{$gap:8,$alignItems:"center",children:[t(ed,{children:t(b,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(se,{children:i}),t(Ut,v?{variant:Qt.Blue,label:v}:{variant:Qt.Loader,label:Je.DETECTING_RUNTIME_INFO}),t(qc,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(ue,{$gap:8,$alignItems:"center",children:[t(je,{...y,textSize:de.XXXS}),t(Jc,{language:p.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(td,{children:e(ue,{$gap:10,$alignItems:"center",children:[t(Ut,{variant:Qt.Pink,label:Bt(r.agentEnabledStatus?.reasonEnum)||Je.NO_AVAILABLE_AGENT}),t(se,{size:de.XXXS,color:ce.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(td,{children:t(ue,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(je,{label:e,leftIcon:vi,status:Re.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${n}`))})})]})},od=({source:n,onClickRollout:o,onClickRollback:a})=>{const{isVm:i}=y();return e(q,{$gap:12,children:[t(Mc,{source:n}),t(Bc,{source:n}),!i&&t(Vc,{source:n,onClickRollout:o,onClickRollback:a}),!i&&t(Zc,{source:n}),!i&&t(zc,{source:n})]})},ad=g(q)`
|
|
295
295
|
width: 100%;
|
|
296
296
|
max-height: 320px;
|
|
297
297
|
overflow-y: auto;
|
|
298
298
|
gap: 8px;
|
|
299
|
-
`,
|
|
299
|
+
`,id=g(ue)`
|
|
300
300
|
width: 100%;
|
|
301
301
|
align-items: center;
|
|
302
302
|
gap: 8px;
|
|
@@ -306,14 +306,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
306
306
|
& > * {
|
|
307
307
|
font-family: monospace !important;
|
|
308
308
|
}
|
|
309
|
-
`,Gc=({pendingModify:n,onClose:o,onConfirm:a})=>{const i=f();return t(Ue,{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:de.Secondary,label:"Cancel",onClick:o},approveButton:{variant:de.Primary,label:"Confirm",onClick:a},children:n&&e(Vc,{children:[n.add.map(n=>e(Uc,{children:[t(Be,{leftIcon:si,status:Ie.Success,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:le.XXS}),t(ae,{size:le.XS,color:ie.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(Uc,{children:[t(Be,{leftIcon:_i,status:Ie.Error,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:le.XXS}),t(ae,{size:le.XS,color:ie.Primary,children:n})]},`remove-${n}`))]})})};function Hc(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 jc(e){const t=Math.abs(e);return t>=1e9?`${Wc(e/1e9)}s`:t>=1e6?`${Wc(e/1e6)}ms`:t>=1e3?`${Wc(e/1e3)}μs`:String(Math.round(e))}function Wc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Kc(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let a=0;for(let e=0;e+3<o.length;e+=4){const i=o[e],l=o[e+1],s=o[e+2],r=o[e+3],c=a+i;t.push({level:n,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function Yc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Jc(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 a=[t];for(let e=t.level+1;e<=n;e++){const t=a.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){a.push(e);break}}return a}function qc(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Zc(e,t,n,o,a,i={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1,allRects:c}=i,d=c??Kc(e);let u=l?Jc(d,l):d;if(0===u.length)return null;if(s&&(u=u.filter(t=>s(Hc(e,t.nameIndex))),0===u.length))return null;if(r&&(u=function(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 a=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const i=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Hc(e,l.nameIndex)===Hc(e,t.nameIndex)&&a.add(Yc(l))}if(0===a.size)return n;const i=[];for(const e of n){if(a.has(Yc(e)))continue;let t=0;for(let n=0;n<e.level;n++){const i=o.get(n);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Yc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=a.trim(),y=b>8?1:0;return u.map(n=>{const o=n.level-p,a=(n.offset-h)/m*t,i=Math.max(n.size/m*t,1),l=o*b,s=Math.max(b-y,1),r=Hc(e,n.nameIndex);return{...n,x:a,y:l,w:i,h:s,name:r,matchesSearch:qc(r,v)}})}function Qc(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],a=[{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 a[n%a.length]}var ed,td;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(ed||(ed={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(td||(td={}));function nd(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function od(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 ad(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const id=({flamebearer:n,maxRowPx:r,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:b,onResetZoom:v})=>{const y=f(),C=i(null),S=i(null),w=i({x:0,y:0}),x=i(n.numTicks),[k,T]=s({w:0,h:0}),[$,I]=s(""),[E,A]=s(null),[N,O]=s([]),[R,D]=s(!1),[P,F]=s(ed.Fit),[L,_]=s(td.Fit),[M,z]=s(!1),B=Math.max(1,Math.min(Math.floor(k.w*P),8192)),X=Math.max(1,Math.min(Math.floor(k.h*L),8192)),V=N.length>0?N[N.length-1]:null,U=V?.size??n.numTicks,G=a(()=>Kc(n),[n]);o(()=>{x.current!==n.numTicks&&(x.current=n.numTicks,O([]))},[n.numTicks]),o(()=>{if(!b)return;if(!V)return void b(null);const e=Jc(G,V),t=new Set;for(const o of e){const e=Hc(n,o.nameIndex);e&&t.add(e)}b([...t])},[V,n,G,b]),m(()=>{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()},[]),o(()=>{if(!R)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[R]),o(()=>(p?.(R),()=>{R&&p?.(!1)}),[R,p]);const H=a(()=>Zc(n,B,X,r,c,{zoomRoot:V,shouldKeepName:d,collapseRecursive:M,allRects:G}),[n,r,c,X,B,V,d,M,G]),j=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(H?.length?c.trim()?H.filter(e=>e.matchesSearch):H:[]),[H,c]),W=l(e=>{if(B<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=od((e.clientX-t.left)/t.width*B,(e.clientY-t.top)/t.height*X,j);if(o){const e=Yc(o);A(e);const t=U>0?(100*o.size/U).toFixed(1):"0",a=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${jc(o.size)} (${t}% of view, ${a}% of profile) · self ${jc(o.self)}`)}else A(null),I("")},[j,n.numTicks,X,B,U]),K=l(e=>{W(e)},[W]),Y=l(()=>{A(null),I("")},[]),J=l(e=>{w.current={x:e.clientX,y:e.clientY}},[]),q=l(e=>{const{x:t,y:n}=w.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(B<2||X<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const a=od((e.clientX-o.left)/o.width*B,(e.clientY-o.top)/o.height*X,j);if(!a)return;g?.(a.name);const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[j,X,B,g]);m(()=>{const e=S.current;if(!e||B<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(B,X),a=Math.min(t,16384/o);e.width=Math.floor(B*a),e.height=Math.floor(X*a),e.style.width=`${B}px`,e.style.height=`${X}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,B,X),H?.length?function(e,t,n,o,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,n);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Qc(r,i);e.fillStyle=p,e.fillRect(n,o,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+a-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(a-1,0),Math.max(l-1,0));const m=nd(d,s),g=`${r} (${jc(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(Yc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,B,X,H,c,y,E,n.numTicks):(i.fillStyle=y.v2.colors.silver[900],i.fillRect(0,0,B,X)))},[H,n.numTicks,E,c,X,B,y]);const Z=l(()=>D(e=>!e),[]),te=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ne=a(()=>function(e,t,n){const o=n??Kc(e),a=t?.offset??0,i=a+(t?.size??e.numTicks),l=(t?.level??-1)+1,s=t?.size??e.numTicks;let r=null;for(const e of o)e.level<l||e.offset<a||e.offset+e.size>i||e.size>=s||(!r||e.size>r.size||e.size===r.size&&e.level<r.level)&&(r=e);return r}(n,V,G),[n,V,G]),oe=null!==ne,pe=N.length>0,he=V?Hc(n,V.nameIndex):"",me=l(()=>{O([]),v?.()},[v]),ge=l(()=>O(e=>e.slice(0,-1)),[]),fe=l(()=>{ne&&O(e=>[...e,ne])},[ne]);return e("div",{style:R?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(se,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(Q,{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:ee.Left,size:bt.S,value:M,onChange:z}),e(se,{$gap:8,children:[e(se,{children:[t(re,{variant:de.Secondary,size:ce.S,label:"Reset zoom",leftIcon:Mi,onClick:me,disabled:!N.length}),t(re,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:_i,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!pe,onClick:ge}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,align:"center",children:`${te}%`})}),t(re,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:si,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!oe,onClick:fe})]}),e(se,{children:[t(De,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:mn.Filled,options:[{value:ed.Fit,label:"W: Fit"},{value:ed.X10,label:"10x"}],selected:P,setSelected:F})}),t(De,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:mn.Filled,options:[{value:td.Fit,label:"H: Fit"},{value:td.X10,label:"10x"}],selected:L,setSelected:_})})]}),t(re,{variant:de.Secondary,size:ce.S,iconSize:24,leftIcon:R?wi:zi,tooltip:R?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(De,{fullWidth:!0,keepAlive:!0,text:$,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:R?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:P>1?"auto":"hidden",overflowY:L>1?"auto":"hidden"},children:t("div",{style:{width:B||"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(se,{$justifyContent:"space-between",children:[t(ae,V?{size:le.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${he} • ${jc(U)} samples in view`}:{size:le.XXXS,color:y.v2.colors.silver[300],children:g?"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(ae,{size:le.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ad(h.totalBytesUsed)} / ${ad(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},ld=[gn.Go,gn.Java],sd="Profiling Symbols";function rd(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:function(e){return e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?gn.Go:e.includes(" ")||e.includes("(")?gn.Java:gn.Go}(e);if(n===gn.Go){const t=function(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 a=t.slice(0,o),i=t.slice(o+1);if(!a||!i)return null;const l=i.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Le(a,"",l[1],l[2]);return e.Verify()?e:null}const s=new Le(a,i);return s.Verify()?s:null}(e);return t?{language:n,golang:t}:null}if(n===gn.Java){const t=function(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 a=t.lastIndexOf(".");if(-1===a)return null;const i=t.slice(0,a),l=t.slice(a+1),s=new _e(i,l);return s.Verify()?s:null}(e);return t?{language:n,java:t}:null}return null}function cd(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function dd(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:a=[],languages:i=[]}=e,l=!o.length||o.some(e=>cd(e,t.id)),s=!a.length||a.includes(t.id.namespace),r=!i.length||null==n||i.includes(n);return l&&s&&r}function ud(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function pd(e,t){return e.className===t.className&&e.methodName===t.methodName}function hd(e,t,n,o){const a=rd(e,n);if(!a)return[];const i=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!dd(e.sourceScopes,t,a.language))continue;const o=!!a.golang&&!!n[Me.Golang]?.some(e=>ud(e,a.golang)),l=!!a.java&&!!n[Me.Java]?.some(e=>pd(e,a.java));(o||l)&&i.push({rule:e,resolved:a})}return i}function md({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:i}=ll(),{items:r}=o.useRules(),[c,d]=s(new Set),[u,p]=s(new Set),[h,m]=s(null),g=a(()=>function(e){const t=new Set(e??[]);return ld.filter(e=>t.has(e))}(t),[t]),f=i.canCreateInstrumentationRule,b=a(()=>function(e,t){const n=e.filter(e=>e.type===ze.CustomInstrumentation&&e.ruleName===sd&&dd(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>cd(e,t.id)))??n[0]??null}(r,e),[r,e]),v=f&&g.length>0,y=a(()=>{const t=new Map;for(const o of n){const n=!!rd(o.name,g),a=hd(o.name,e,g,r),i=!!b&&a.some(e=>e.rule.ruleId===b.ruleId),l=a.filter(e=>e.rule.ruleId!==b?.ruleId),s=!i&&l.length>0,c=v&&n,d=s;let u;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];u=`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 p=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=u??"Managed by another rule":0===a.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(o.name,{parsable:n,inManagedRule:i,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[n,r,e,g,f,v,b]),C=a(()=>{const e=new Set;return y.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[y]),S=a(()=>[...c].filter(e=>y.get(e)?.addEnabled&&!C.has(e)),[c,y,C]),w=a(()=>[...u].filter(e=>C.has(e)),[u,C]),x=S.length+w.length,k=l(e=>{const t=y.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[y,u,c]),T=l((e,t)=>{const n=y.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?p(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):d(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[y]),$=l(()=>{d(new Set),p(new Set)},[]),I=l(t=>{(async()=>{const n=t.add.map(e=>rd(e,g)).filter(e=>!!e),a=t.remove.map(e=>rd(e,g)).filter(e=>!!e);if(b){const{customInstrumentations:e,isEmpty:t}=function(e,t,n){const o=e.customInstrumentations??{};let a=[...o[Me.Golang]??[]],i=[...o[Me.Java]??[]];for(const e of n)e.golang&&(a=a.filter(t=>!ud(t,e.golang))),e.java&&(i=i.filter(t=>!pd(t,e.java)));for(const e of t)e.golang&&!a.some(t=>ud(t,e.golang))&&a.push(e.golang),e.java&&!i.some(t=>pd(t,e.java))&&i.push(e.java);return{customInstrumentations:{[Me.Golang]:a,[Me.Java]:i},isEmpty:0===a.length&&0===i.length}}(b,n,a);t?await o.remove(b.ruleId,ze.CustomInstrumentation):await o.update(b.ruleId,function(e,t){return{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}}(b,e),ze.CustomInstrumentation)}else n.length>0&&await o.create(function(e,t){const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),a={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:sd,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:a,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Me.Golang]:n,[Me.Java]:o}}}(n,e),ze.CustomInstrumentation)})()},[b,g,e,o]),E=l(()=>{x&&m({add:S,remove:w})},[x,S,w]),A=l(e=>m({add:[e],remove:[]}),[]),N=l(e=>m({add:[],remove:[e]}),[]),O=l(()=>m(null),[]),R=l(()=>{h&&(I(h),m(null),$())},[h,I,$]),D=l(e=>y.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[y]);return{instrumentation:a(()=>({getSymbolState:D,onAdd:A,onRemove:N,selectionEnabled:v,isSelected:k,onToggleSymbol:T}),[D,A,N,v,k,T]),pendingCount:x,pendingModify:h,closeModify:O,openBulkModify:E,resetSelection:$,confirmModify:R}}var gd,fd,bd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(gd||(gd={})),function(e){e.OnlyInstrumentable="only-instrumentable"}(fd||(fd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(bd||(bd={}));const vd=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function yd(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(bd.FilterOutVoid)&&"void"===n)return!1;if(t.includes(bd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&vd.test(n)))return!1}return!0}const Cd=({rows:e,languages:n,instrumentation:o,searchQuery:i,filters:s,onFiltersChange:r,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!n?.includes(gn.Java),h=a(()=>{const t=c?new Set(c):null,n=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,i,c]),m=a(()=>{const e=[];if(o.selectionEnabled&&e.push({id:fd.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:bd.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:bd.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===gd.Symbol)?.rawValue?.toString()??"";return!(t.includes(fd.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&yd(n,t)}}},[o,p]),g=a(()=>[{key:gd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:gd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:gd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:gd.Symbol,rawValue:e.name},{key:gd.Self,rawValue:jc(e.self)},{key:gd.Total,rawValue:jc(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=l(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),a=[];return n.inManagedRule?a.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:li,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):a.push({id:`add-instrumentation-${t}`,label:"",leftIcon:si,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),a.push({id:`copy-${t}`,label:"",leftIcon:Bi,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),a},[o]);return t(fn,{variant:bn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:s,onFiltersChange:r,activeRowId:d,scrollSignal:u,getRowActions:b})};var Sd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Sd||(Sd={}));const wd=g(W)`
|
|
309
|
+
`,ld=({pendingModify:n,onClose:o,onConfirm:a})=>{const i=f();return t(Ye,{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:me.Secondary,label:"Cancel",onClick:o},approveButton:{variant:me.Primary,label:"Confirm",onClick:a},children:n&&e(ad,{children:[n.add.map(n=>e(id,{children:[t(je,{leftIcon:fi,status:Re.Success,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:de.XXS}),t(se,{size:de.XS,color:ce.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(id,{children:[t(je,{leftIcon:ji,status:Re.Error,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:de.XXS}),t(se,{size:de.XS,color:ce.Primary,children:n})]},`remove-${n}`))]})})};function rd(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 sd(e){const t=Math.abs(e);return t>=1e9?`${cd(e/1e9)}s`:t>=1e6?`${cd(e/1e6)}ms`:t>=1e3?`${cd(e/1e3)}μs`:String(Math.round(e))}function cd(e){return e.toFixed(2).replace(/\.?0+$/,"")}function dd(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let a=0;for(let e=0;e+3<o.length;e+=4){const i=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=a+i;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function ud(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function pd(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 a=[t];for(let e=t.level+1;e<=n;e++){const t=a.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){a.push(e);break}}return a}function hd(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function md(e,t,n,o,a,i={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=i,d=c??dd(e);let u=l?pd(d,l):d;if(0===u.length)return null;if(r&&(u=u.filter(t=>r(rd(e,t.nameIndex))),0===u.length))return null;if(s&&(u=function(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 a=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const i=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&rd(e,l.nameIndex)===rd(e,t.nameIndex)&&a.add(ud(l))}if(0===a.size)return n;const i=[];for(const e of n){if(a.has(ud(e)))continue;let t=0;for(let n=0;n<e.level;n++){const i=o.get(n);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(ud(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=a.trim(),y=b>8?1:0;return u.map(n=>{const o=n.level-p,a=(n.offset-h)/m*t,i=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=rd(e,n.nameIndex);return{...n,x:a,y:l,w:i,h:r,name:s,matchesSearch:hd(s,v)}})}function gd(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],a=[{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 a[n%a.length]}var fd,bd;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(fd||(fd={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(bd||(bd={}));function vd(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function yd(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 Cd(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Sd=({flamebearer:n,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:b,onResetZoom:v})=>{const y=f(),C=i(null),S=i(null),w=i({x:0,y:0}),x=i(n.numTicks),[k,T]=r({w:0,h:0}),[$,I]=r(""),[E,A]=r(null),[N,O]=r([]),[R,D]=r(!1),[P,F]=r(fd.Fit),[L,_]=r(bd.Fit),[M,z]=r(!1),B=Math.max(1,Math.min(Math.floor(k.w*P),8192)),X=Math.max(1,Math.min(Math.floor(k.h*L),8192)),V=N.length>0?N[N.length-1]:null,U=V?.size??n.numTicks,G=a(()=>dd(n),[n]);o(()=>{x.current!==n.numTicks&&(x.current=n.numTicks,O([]))},[n.numTicks]),o(()=>{if(!b)return;if(!V)return void b(null);const e=pd(G,V),t=new Set;for(const o of e){const e=rd(n,o.nameIndex);e&&t.add(e)}b([...t])},[V,n,G,b]),m(()=>{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()},[]),o(()=>{if(!R)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[R]),o(()=>(p?.(R),()=>{R&&p?.(!1)}),[R,p]);const H=a(()=>md(n,B,X,s,c,{zoomRoot:V,shouldKeepName:d,collapseRecursive:M,allRects:G}),[n,s,c,X,B,V,d,M,G]),j=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(H?.length?c.trim()?H.filter(e=>e.matchesSearch):H:[]),[H,c]),W=l(e=>{if(B<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=yd((e.clientX-t.left)/t.width*B,(e.clientY-t.top)/t.height*X,j);if(o){const e=ud(o);A(e);const t=U>0?(100*o.size/U).toFixed(1):"0",a=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${sd(o.size)} (${t}% of view, ${a}% of profile) · self ${sd(o.self)}`)}else A(null),I("")},[j,n.numTicks,X,B,U]),K=l(e=>{W(e)},[W]),Y=l(()=>{A(null),I("")},[]),J=l(e=>{w.current={x:e.clientX,y:e.clientY}},[]),q=l(e=>{const{x:t,y:n}=w.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(B<2||X<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const a=yd((e.clientX-o.left)/o.width*B,(e.clientY-o.top)/o.height*X,j);if(!a)return;g?.(a.name);const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[j,X,B,g]);m(()=>{const e=S.current;if(!e||B<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(B,X),a=Math.min(t,16384/o);e.width=Math.floor(B*a),e.height=Math.floor(X*a),e.style.width=`${B}px`,e.style.height=`${X}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,B,X),H?.length?function(e,t,n,o,a,i,l,r){const s=i.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:a,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=gd(s,i);e.fillStyle=p,e.fillRect(n,o,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+a-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(a-1,0),Math.max(l-1,0));const m=vd(d,r),g=`${s} (${sd(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(ud(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,B,X,H,c,y,E,n.numTicks):(i.fillStyle=y.v2.colors.silver[900],i.fillRect(0,0,B,X)))},[H,n.numTicks,E,c,X,B,y]);const Z=l(()=>D(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ee=a(()=>function(e,t,n){const o=n??dd(e),a=t?.offset??0,i=a+(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<a||e.offset+e.size>i||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(n,V,G),[n,V,G]),te=null!==ee,ne=N.length>0,ie=V?rd(n,V.nameIndex):"",le=l(()=>{O([]),v?.()},[v]),re=l(()=>O(e=>e.slice(0,-1)),[]),fe=l(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:R?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(ue,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(oe,{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:ae.Left,size:kt.S,value:M,onChange:z}),e(ue,{$gap:8,children:[e(ue,{children:[t(pe,{variant:me.Secondary,size:he.S,label:"Reset zoom",leftIcon:Wi,onClick:le,disabled:!N.length}),t(pe,{variant:me.Secondary,size:he.S,iconSize:20,leftIcon:ji,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ne,onClick:re}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(se,{size:de.XXS,color:ce.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(pe,{variant:me.Secondary,size:he.S,iconSize:20,leftIcon:fi,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:fe})]}),e(ue,{children:[t(ze,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ge,{variant:yn.Filled,options:[{value:fd.Fit,label:"W: Fit"},{value:fd.X10,label:"10x"}],selected:P,setSelected:F})}),t(ze,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ge,{variant:yn.Filled,options:[{value:bd.Fit,label:"H: Fit"},{value:bd.X10,label:"10x"}],selected:L,setSelected:_})})]}),t(pe,{variant:me.Secondary,size:he.S,iconSize:24,leftIcon:R?Oi:Ki,tooltip:R?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(ze,{fullWidth:!0,keepAlive:!0,text:$,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:R?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:P>1?"auto":"hidden",overflowY:L>1?"auto":"hidden"},children:t("div",{style:{width:B||"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(ue,{$justifyContent:"space-between",children:[t(se,V?{size:de.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ie} • ${sd(U)} samples in view`}:{size:de.XXXS,color:y.v2.colors.silver[300],children:g?"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(se,{size:de.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Cd(h.totalBytesUsed)} / ${Cd(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},wd=[Cn.Go,Cn.Java],xd="Profiling Symbols";function kd(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:function(e){return e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Cn.Go:e.includes(" ")||e.includes("(")?Cn.Java:Cn.Go}(e);if(n===Cn.Go){const t=function(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 a=t.slice(0,o),i=t.slice(o+1);if(!a||!i)return null;const l=i.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Ve(a,"",l[1],l[2]);return e.Verify()?e:null}const r=new Ve(a,i);return r.Verify()?r:null}(e);return t?{language:n,golang:t}:null}if(n===Cn.Java){const t=function(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 a=t.lastIndexOf(".");if(-1===a)return null;const i=t.slice(0,a),l=t.slice(a+1),r=new Ue(i,l);return r.Verify()?r:null}(e);return t?{language:n,java:t}:null}return null}function Td(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function $d(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:a=[],languages:i=[]}=e,l=!o.length||o.some(e=>Td(e,t.id)),r=!a.length||a.includes(t.id.namespace),s=!i.length||null==n||i.includes(n);return l&&r&&s}function Id(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Ed(e,t){return e.className===t.className&&e.methodName===t.methodName}function Ad(e,t,n,o){const a=kd(e,n);if(!a)return[];const i=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!$d(e.sourceScopes,t,a.language))continue;const o=!!a.golang&&!!n[Ge.Golang]?.some(e=>Id(e,a.golang)),l=!!a.java&&!!n[Ge.Java]?.some(e=>Ed(e,a.java));(o||l)&&i.push({rule:e,resolved:a})}return i}function Nd({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:i}=gl(),{items:s}=o.useRules(),[c,d]=r(new Set),[u,p]=r(new Set),[h,m]=r(null),g=a(()=>function(e){const t=new Set(e??[]);return wd.filter(e=>t.has(e))}(t),[t]),f=i.canCreateInstrumentationRule,b=a(()=>function(e,t){const n=e.filter(e=>e.type===He.CustomInstrumentation&&e.ruleName===xd&&$d(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>Td(e,t.id)))??n[0]??null}(s,e),[s,e]),v=f&&g.length>0,y=a(()=>{const t=new Map;for(const o of n){const n=!!kd(o.name,g),a=Ad(o.name,e,g,s),i=!!b&&a.some(e=>e.rule.ruleId===b.ruleId),l=a.filter(e=>e.rule.ruleId!==b?.ruleId),r=!i&&l.length>0,c=v&&n,d=r;let u;if(r){const e=[...new Set(l.map(e=>e.rule.ruleName))];u=`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 p=!1,h="Add this symbol to the “Profiling Symbols” rule";r?h=u??"Managed by another rule":0===a.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(o.name,{parsable:n,inManagedRule:i,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[n,s,e,g,f,v,b]),C=a(()=>{const e=new Set;return y.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[y]),S=a(()=>[...c].filter(e=>y.get(e)?.addEnabled&&!C.has(e)),[c,y,C]),w=a(()=>[...u].filter(e=>C.has(e)),[u,C]),x=S.length+w.length,k=l(e=>{const t=y.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[y,u,c]),T=l((e,t)=>{const n=y.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?p(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):d(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[y]),$=l(()=>{d(new Set),p(new Set)},[]),I=l(t=>{(async()=>{const n=t.add.map(e=>kd(e,g)).filter(e=>!!e),a=t.remove.map(e=>kd(e,g)).filter(e=>!!e);if(b){const{customInstrumentations:e,isEmpty:t}=function(e,t,n){const o=e.customInstrumentations??{};let a=[...o[Ge.Golang]??[]],i=[...o[Ge.Java]??[]];for(const e of n)e.golang&&(a=a.filter(t=>!Id(t,e.golang))),e.java&&(i=i.filter(t=>!Ed(t,e.java)));for(const e of t)e.golang&&!a.some(t=>Id(t,e.golang))&&a.push(e.golang),e.java&&!i.some(t=>Ed(t,e.java))&&i.push(e.java);return{customInstrumentations:{[Ge.Golang]:a,[Ge.Java]:i},isEmpty:0===a.length&&0===i.length}}(b,n,a);t?await o.remove(b.ruleId,He.CustomInstrumentation):await o.update(b.ruleId,function(e,t){return{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}}(b,e),He.CustomInstrumentation)}else n.length>0&&await o.create(function(e,t){const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),a={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:xd,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:a,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ge.Golang]:n,[Ge.Java]:o}}}(n,e),He.CustomInstrumentation)})()},[b,g,e,o]),E=l(()=>{x&&m({add:S,remove:w})},[x,S,w]),A=l(e=>m({add:[e],remove:[]}),[]),N=l(e=>m({add:[],remove:[e]}),[]),O=l(()=>m(null),[]),R=l(()=>{h&&(I(h),m(null),$())},[h,I,$]),D=l(e=>y.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[y]);return{instrumentation:a(()=>({getSymbolState:D,onAdd:A,onRemove:N,selectionEnabled:v,isSelected:k,onToggleSymbol:T}),[D,A,N,v,k,T]),pendingCount:x,pendingModify:h,closeModify:O,openBulkModify:E,resetSelection:$,confirmModify:R}}var Od,Rd,Dd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Od||(Od={})),function(e){e.OnlyInstrumentable="only-instrumentable"}(Rd||(Rd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Dd||(Dd={}));const Pd=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Fd(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Dd.FilterOutVoid)&&"void"===n)return!1;if(t.includes(Dd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&Pd.test(n)))return!1}return!0}const Ld=({rows:e,languages:n,instrumentation:o,searchQuery:i,filters:r,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!n?.includes(Cn.Java),h=a(()=>{const t=c?new Set(c):null,n=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,i,c]),m=a(()=>{const e=[];if(o.selectionEnabled&&e.push({id:Rd.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:Dd.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:Dd.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===Od.Symbol)?.rawValue?.toString()??"";return!(t.includes(Rd.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&Fd(n,t)}}},[o,p]),g=a(()=>[{key:Od.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Od.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Od.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:Od.Symbol,rawValue:e.name},{key:Od.Self,rawValue:sd(e.self)},{key:Od.Total,rawValue:sd(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=l(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),a=[];return n.inManagedRule?a.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:gi,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):a.push({id:`add-instrumentation-${t}`,label:"",leftIcon:fi,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),a.push({id:`copy-${t}`,label:"",leftIcon:Yi,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),a},[o]);return t(Sn,{variant:wn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:r,onFiltersChange:s,activeRowId:d,scrollSignal:u,getRowActions:b})};var _d;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(_d||(_d={}));const Md=g(q)`
|
|
310
310
|
width: 100%;
|
|
311
311
|
flex: 1;
|
|
312
312
|
border-radius: 16px;
|
|
313
313
|
overflow: hidden;
|
|
314
314
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
315
315
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
316
|
-
`,
|
|
316
|
+
`,zd=g.div`
|
|
317
317
|
display: flex;
|
|
318
318
|
align-items: center;
|
|
319
319
|
gap: 10px;
|
|
@@ -321,11 +321,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
321
321
|
padding: 12px 12px 8px;
|
|
322
322
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
323
323
|
border-radius: 16px 16px 0 0;
|
|
324
|
-
`,
|
|
324
|
+
`,Bd=g(ue)`
|
|
325
325
|
flex-shrink: 0;
|
|
326
326
|
align-items: center;
|
|
327
327
|
gap: 4px;
|
|
328
|
-
`,
|
|
328
|
+
`,Xd=g.div`
|
|
329
329
|
flex: 1;
|
|
330
330
|
display: flex;
|
|
331
331
|
align-items: stretch;
|
|
@@ -333,20 +333,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
333
333
|
padding: 16px;
|
|
334
334
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
335
335
|
border-radius: 0 0 16px 16px;
|
|
336
|
-
|
|
336
|
+
`,Vd=g(q)`
|
|
337
337
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
338
338
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
339
339
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
340
340
|
gap: 10px;
|
|
341
|
-
`,
|
|
341
|
+
`,Ud=g(q)`
|
|
342
342
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
343
343
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
344
344
|
gap: 10px;
|
|
345
|
-
`,
|
|
345
|
+
`,Gd=g(ue)`
|
|
346
346
|
width: 100%;
|
|
347
347
|
min-height: 32px;
|
|
348
348
|
flex-shrink: 0;
|
|
349
|
-
`,
|
|
349
|
+
`,Hd=({source:n,onFlameFullscreenChange:c})=>{const d=f(),u=n.id,{profilingApi:p}=gl(),[h,m]=r(!0),[g,b]=r(_d.Both),[v,y]=r(""),[C,S]=r({}),[w,x]=r(!1),k=i(!1);o(()=>{k.current||(k.current=!0,p.enableProfiling?.(u),x(!0))},[p,u]);const{data:T}=p.useSlots({skip:!w,pollInterval:3e3,fetchPolicy:"network-only"}),{data:$,loading:I,refetch:E}=p.useSourceProfiling(u,{skip:!w,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),A=$?.profileJson??null,N=a(()=>function(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}}(A),[A]),O=a(()=>N?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const o=e.levels[n];for(let n=0;n+3<o.length;n+=4){const a=o[n+1],i=o[n+2],l=rd(e,o[n+3]);if(!l)continue;const r=t.get(l);(!r||a>r.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(N.flamebearer):[],[N]),R=g===_d.Table||g===_d.Both,D=g===_d.Flame||g===_d.Both,P=R&&D,F=a(()=>n.runtimeInfo?.detectedLanguages||n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),[n]),L=a(()=>function(e,t){if(!t?.includes(Cn.Java))return;const n=(e?.[Od.Symbol]?.filter(Boolean)??[]).filter(e=>e===Dd.FilterOutVoid||e===Dd.OnlyWithReturnValues);return 0!==n.length?e=>Fd(e,n):void 0}(C,F),[C,F]),{instrumentation:_,pendingCount:M,pendingModify:z,closeModify:B,openBulkModify:X,resetSelection:V,confirmModify:U}=Nd({source:n,languages:F,rows:O}),[G,H]=r(null),[j,W]=r(0),[K,Y]=r(null),J=l(e=>{H(e),W(e=>e+1),b(e=>e===_d.Flame?_d.Both:e)},[]);return!A&&I?t(pt,{$height:"70vh",children:t(bt,{withSpinner:!0})}):e(Md,{$gap:0,$width:"100%",children:[e(zd,{children:[t(ze,{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(Bd,{children:t(se,{size:de.S,weight:500,color:ce.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(ue,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(nn,{value:v,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(ge,{variant:yn.Filled,options:[{value:_d.Table,label:"Top table"},{value:_d.Flame,label:"Flame graph"},{value:_d.Both,label:"Both"}],selected:g,setSelected:b}),t(pe,h?{variant:me.Secondary,size:he.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(Ji,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:me.Secondary,size:he.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Ji,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(Xd,{$gap:R&&D?16:0,children:N?e(s,{children:[R&&e(Vd,{$splitWithFlame:P,children:[e(Gd,{$justifyContent:"space-between",children:[e(q,{$margin:"0 0 0 20px",children:[t(se,{size:de.XXXS,nowrap:!0,children:"Please select symbols to"}),e(ue,{$gap:8,children:[e(ue,{children:[t(qi,{size:24}),t(se,{size:de.S,color:ce.Success,nowrap:!0,children:"Custom Instrument"})]}),t(pe,{leftIcon:Ci,variant:me.Secondary,size:he.S,onClick:()=>window.open(`${De}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(ue,{$gap:8,children:[K&&t(ze,{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(je,{label:`Zoomed: ${K.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:de.XXS})}),t(pe,{variant:me.Secondary,size:he.S,label:"Download snapshot",rightIcon:Zi,onClick:()=>{if(!A)return;const e=new Blob([A],{type:"application/json"}),t=URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,o.click(),URL.revokeObjectURL(t)},disabled:!A})]})]}),t(Ld,{rows:O,languages:F,instrumentation:_,searchQuery:v,filters:C,onFiltersChange:S,zoomedSymbols:K,highlightSymbol:G,scrollSignal:j})]}),D&&e(Ud,{$splitWithTable:P,children:[e(Gd,{$justifyContent:"space-between",children:[t(je,{label:N?`Total in view ${sd(N.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:de.XXS}),e(ue,{$gap:12,children:[!h&&t(pe,{variant:me.Secondary,size:he.S,label:"Refresh",leftIcon:zi,onClick:E}),t(oe,{label:"Auto refresh",labelAlign:ae.Left,size:kt.S,value:h,onChange:m})]})]}),t(Sd,{flamebearer:N.flamebearer,maxRowPx:24,searchQuery:v,shouldKeepName:L,minHostHeight:280,onFullscreenChange:c,profilingSlots:T??null,onFrameClick:J,onZoomedSymbolsChange:Y,onResetZoom:()=>H(null)},g)]})]}):t(pt,{children:t(Ie,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(ld,{pendingModify:z,onClose:B,onConfirm:U}),t(xn,{isOpen:M>0,richTitle:{icon:Ri,title:"Profiling Symbols",badge:{label:M}},actions:[{id:"profiling-bulk-cancel",type:tn.Button,buttonProps:{variant:me.Secondary,size:he.S,label:"Cancel",onClick:V}},{id:"profiling-bulk-apply",type:tn.Button,buttonProps:{variant:me.Primary,size:he.S,label:"Modify Rule",leftIcon:wi,onClick:X}}]})]})},jd=g.div`
|
|
350
350
|
position: relative;
|
|
351
351
|
display: flex;
|
|
352
352
|
align-items: center;
|
|
@@ -354,17 +354,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
354
354
|
padding: 8px 16px;
|
|
355
355
|
border-radius: 12px;
|
|
356
356
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
357
|
-
`,
|
|
357
|
+
`,Wd=g.div`
|
|
358
358
|
display: flex;
|
|
359
359
|
flex-direction: column;
|
|
360
360
|
gap: 4px;
|
|
361
361
|
flex: 1;
|
|
362
362
|
min-width: 0;
|
|
363
|
-
`,
|
|
363
|
+
`,Kd=g.div`
|
|
364
364
|
min-width: 0;
|
|
365
365
|
white-space: pre;
|
|
366
366
|
overflow-x: auto;
|
|
367
|
-
`,
|
|
367
|
+
`,Yd=g.div`
|
|
368
368
|
position: absolute;
|
|
369
369
|
top: 50%;
|
|
370
370
|
right: 8px;
|
|
@@ -373,11 +373,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
373
373
|
pointer-events: none;
|
|
374
374
|
transition: opacity 0.15s ease;
|
|
375
375
|
|
|
376
|
-
${
|
|
376
|
+
${jd}:hover & {
|
|
377
|
+
opacity: 1;
|
|
378
|
+
pointer-events: auto;
|
|
379
|
+
}
|
|
380
|
+
`,Jd=({name:n,summary:o,onJumpToRule:a})=>e(jd,{children:[e(Wd,{children:[n&&t(se,{size:de.XXXS,color:ce.Secondary,nowrap:!0,children:n}),t(Kd,{children:t(S,{parts:o})})]}),a&&t(Yd,{children:t(ze,{text:Je.OPEN_IN_SAMPLING_PAGE,children:t(pe,{"data-id":"sampling-rule-jump",variant:me.Primary,size:he.S,leftIcon:Ki,onClick:a})})})]}),qd=g.div`
|
|
381
|
+
opacity: 0;
|
|
382
|
+
pointer-events: none;
|
|
383
|
+
transition: opacity 0.15s ease;
|
|
384
|
+
`,Zd=g.div`
|
|
385
|
+
&:hover ${qd} {
|
|
377
386
|
opacity: 1;
|
|
378
387
|
pointer-events: auto;
|
|
379
388
|
}
|
|
380
|
-
`,
|
|
389
|
+
`,Qd=g.div`
|
|
390
|
+
display: flex;
|
|
391
|
+
align-items: center;
|
|
392
|
+
padding: 4px 12px;
|
|
393
|
+
`,eu=({source:e,onRedirectToSampling:n})=>t(Dt,{bgTint:"1000",richTitle:{title:Je.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(ou,{container:e,onRedirectToSampling:n},e.containerName))});var tu;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(tu||(tu={}));const nu=e=>"noisy"===e.type?w(e.rule,"source"):"highlyRelevant"===e.type?x(e.rule,"source"):"costReduction"===e.type?k(e.rule,"source"):[],ou=({container:n,onRedirectToSampling:o})=>{const[i,l]=r(tu.All),s=an(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===tu.Noisy?d:i===tu.HighlyRelevant?u:i===tu.CostReduction?p:[...d,...u,...p],[i,u,p]),m=d.length+u.length+p.length,g=a(()=>(e,t)=>{s({ruleId:e,category:t}),o()},[o,s]),f=t(qd,{children:t(pe,{"data-id":"sampling-container-create-rule",variant:me.Secondary,size:he.S,label:kn,rightIcon:fi,onClick:e=>{e.stopPropagation(),o()}})});return t(Zd,{children:e(Dt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Dt,{bgTint:"800",richTitle:{title:Je.HEAD_SAMPLING,badge:{label:c.length}},children:[t(se,{size:de.XXS,children:Je.NOISY_OPERATIONS}),t(q,{$gap:4,children:c.map(e=>t(Jd,{name:e.name,summary:w(e),onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Qd,{children:t(se,{size:de.XS,color:ce.Secondary,children:Je.HEAD_SAMPLING})}),m?e(Dt,{bgTint:"800",richTitle:{title:Je.TAIL_SAMPLING,badge:{label:m}},children:[t(ge,{options:(b=d.length,v=u.length,y=p.length,[{value:tu.All,label:"All",badge:{label:b+v+y,textSize:de.XXXS}},{value:tu.Noisy,label:Je.NOISY_OPERATIONS,badge:{label:b,textSize:de.XXXS}},{value:tu.HighlyRelevant,label:Je.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:de.XXXS}},{value:tu.CostReduction,label:Je.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:de.XXXS}}]),selected:i,setSelected:l}),t(q,{$gap:4,children:h.length?h.map(e=>t(Jd,{name:e.rule.name,summary:nu(e),onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Ie,{title:`No ${i===tu.All?`${tu.Noisy}, ${tu.HighlyRelevant} and ${tu.CostReduction}`:i} operations`})})]}):t(Qd,{children:t(se,{size:de.XS,color:ce.Secondary,children:Je.TAIL_SAMPLING})})]})});var b,v,y},au=[dn.Deployment,dn.StatefulSet,dn.DaemonSet,dn.DeploymentConfig,dn.Rollout,dn.Pod];var iu;!function(e){e.Workload="Workload",e.Pod="Pod"}(iu||(iu={}));const lu=e=>!!e&&Jt(e.status)===Re.Error,ru=e=>lu(e.healthStatus),su=e=>lu(e.odigosHealthStatus)||(e.processes??[]).some(ru),cu=e=>lu(e.agentInjectedStatus)||lu(e.odigosHealthStatus)||(e.containers??[]).some(su),du=({onClose:n,sourceId:s,onRedirectToSampling:c})=>{const d=f(),{isVm:u}=y(),{sourcesApi:p,configApi:h}=gl(),{selectedStreamName:m}=qe(),{genericForm:g,loadSource:b,validateFormData:v}=Xl(),{data:C}=h.useEffectiveConfig(),[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(!1),[I,E]=r(lc.Overview),[A,N]=r(null),[O,R]=r({openFor:null}),D=(()=>{const[e,t]=r(null),n=l(e=>{t({tab:lc.Pods,podName:e.podName})},[]),o=l((e,n)=>{t({tab:lc.Pods,podName:e.podName,containerName:n.containerName})},[]),i=l((e,n,o)=>{const a=pc({identifyingAttributes:o.identifyingAttributes});t({tab:lc.Pods,podName:e.podName,containerName:n.containerName,processPid:a})},[]),s=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:i,clearJumpToTarget:s}),[e,n,o,i,s])})();o(()=>{D.jumpToTarget&&E(D.jumpToTarget.tab)},[D.jumpToTarget]),o(()=>{A&&JSON.stringify(ln(s))!==JSON.stringify(ln(A))&&N(null)},[s,A]);const P=i(!1),F=l(async()=>N(await p.fetchById(s)||null),[s,p]);o(()=>{if(P.current||(F(),P.current=!0),!S){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,S]),o(()=>{A&&b(A)},[A]);const L=A&&au.includes(A.id.kind),_=a(()=>{const e=[],n=(A?.pods??[]).some(cu);return e.push({value:lc.Overview,label:Je.OVERVIEW}),u||(e.push({value:lc.Pods,label:Je.PODS,icon:n?e=>t(Bi,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:lc.PeerSources,label:Je.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:lc.Profiling,label:Je.PROFILING}),e.push({value:lc.Sampling,label:Je.SAMPLING}),e.push({value:lc.Debug,label:Je.DEBUG})),e},[u,C,A?.pods]),M=l(()=>w(!0),[]),z=a(()=>()=>{n(),c()},[n,c]),B=l(()=>{A&&b(A),w(!1)},[A]),X=l(async()=>{if(!A||!g)return;const{errorMessage:e,preparedFormData:t}=v();if(e)return;const n=t.otelServiceName!==A.id.name?t.otelServiceName:"";await p.update(s,{...t,otelServiceName:n}),w(!1)},[A,g,v,s,p]),V=l(()=>k(!0),[]),U=l(async()=>{A&&(await p.persistV2({[Et]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,selected:!1,currentStreamName:m}]}),k(!1),n())},[A,p,m,n]),G=l(()=>{R({openFor:iu.Workload})},[]),H=l(e=>{E(e),D.clearJumpToTarget()},[D]),j=l(async()=>{await p.recoverFromRollback(s)},[p,s]),W=l(()=>R({openFor:null}),[]),K=l(async()=>{O.openFor===iu.Workload?await p.restartWorkloads([s]):O.openFor===iu.Pod&&O.podNamespace&&O.podName&&await p.restartPod(O.podNamespace,O.podName),W()},[O,p,s,W]),Y=a(()=>{const{kind:e,name:t}=s;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[s]),J=a(()=>{const e=[];return S||I===lc.Overview&&(e.push({id:"edit-source-btn-edit",label:Rt.EDIT,icon:wi,active:S,onClick:M}),!u&&L&&e.push({id:"edit-source-btn-restart",label:Je.ROLLOUT,icon:Qi,onClick:G}),e.push({id:"edit-source-btn-delete",label:Rt.UNINSTRUMENT,icon:gi,color:d.v2.colors.red[500],active:x,onClick:V})),e},[I,S,x,u,L,M,G,V,d]),Z=a(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:de.S};return e.push({...t,label:A.id.name,leftIcon:u?void 0:Mi}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:_i,textColor:d.v2.colors.silver[200]}),e},[A,d,u]);if(!A)return t(le,{isOpen:!0,children:t(pt,{$height:"80vh",children:t(bt,{withSpinner:!0})})});const Q=I===lc.Profiling?T?"95vw":"fit-content":S?void 0:"60vw";return e(Sc,{value:D,children:[t(le,{isOpen:!0,width:Q,minWidth:"777px",header:{icon:u?el:Tn(A.containers)[0],titleBadges:Z,onClose:()=>{H(lc.Overview),N(null),$(!1),n()},actions:J},footer:{actions:S?[{"data-id":"edit-source-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:Rt.SAVE,variant:me.Primary,onClick:X}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:e(q,{$gap:16,children:[!S&&_.length>1&&t(ge,{options:_,selected:I,setSelected:H}),(()=>{switch(I){case lc.Overview:return S?t(ss,{}):t(od,{source:A,onClickRollout:G,onClickRollback:j});case lc.Pods:return t($c,{source:A,onClickRestartPod:L?(e,t)=>R({openFor:iu.Pod,podNamespace:e,podName:t}):void 0});case lc.PeerSources:return t(Ic,{source:A});case lc.Profiling:return t(Hd,{source:A,onFlameFullscreenChange:$});case lc.Sampling:return t(eu,{source:A,onRedirectToSampling:z});case lc.Debug:return t(Rc,{source:A});default:return null}})()]})})}),t(Nl,{target:"source",action:"uninstrument",isOpen:x,onClose:()=>k(!1),onApprove:U}),t(Ye,{isOpen:O.openFor===iu.Workload,title:Y.title,description:Y.description,onClose:W,denyButton:{label:"Go back",variant:me.Secondary,onClick:W},approveButton:{label:Rt.CONFIRM,variant:me.Primary,onClick:K}}),t(Nl,{target:"pod",action:"restart",description:Je.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:O.openFor===iu.Pod,onClose:W,onApprove:K,overrideApproveButtonLabel:Je.DELETE_POD_TO_RESTART})]})},uu=g.div`
|
|
381
394
|
display: flex;
|
|
382
395
|
align-items: center;
|
|
383
396
|
gap: 8px;
|
|
@@ -387,9 +400,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
387
400
|
&:hover {
|
|
388
401
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
389
402
|
}
|
|
390
|
-
`,
|
|
403
|
+
`,pu=g.div`
|
|
391
404
|
flex: 1;
|
|
392
|
-
`,
|
|
405
|
+
`,hu=({onClick:n})=>{const o=f().v2.colors.red[500];return e(uu,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(se,{size:de.XS,weight:500,color:o,children:An}),t(gi,{size:16,fill:o})]})};function mu(o){if(o.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:r}=o;return{children:e(n,{children:[t(hu,{onClick:l}),r&&t(Oe,{status:Re.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(pu,{}),t(pe,{"data-id":"sampling-view-edit-btn-cancel",label:$n,variant:me.Secondary,size:he.S,onClick:a}),t(pe,{"data-id":"sampling-view-edit-btn-save",label:In,variant:me.Primary,size:he.S,onClick:i,disabled:!!r})]})}}const{onDelete:a,onCancel:i,onEdit:l}=o;return{children:e(n,{children:[t(hu,{onClick:a}),t(pu,{}),t(pe,{"data-id":"sampling-view-btn-cancel",label:$n,variant:me.Secondary,size:he.S,onClick:i}),t(pe,{"data-id":"sampling-view-btn-edit",label:En,variant:me.Primary,size:he.S,onClick:l})]})}}const gu={[Ul.EditAutoNoisy]:{title:Un,subTitle:Vn,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Ul.EditAutoCostReduction]:{title:Xn,subTitle:Bn,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Ul.EditAutoHighlyRelevant]:{title:zn,subTitle:Mn,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},fu=({isOpen:e,title:n,subTitle:o,onClose:a,footer:i,renderBody:l})=>t(le,{isOpen:e,width:Hn,header:{icon:tl,title:n,subTitle:o,onClose:a},footer:i,children:l?l():t(dt,{$padding:"12px",children:t(ms,{})})}),bu=({isOpen:i,onClose:s,onSubmit:c,validateForm:d,onNavigateToDuplicate:u})=>{const{category:p,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Vl(Ul.Create),[b,v]=r(!1);o(()=>{i&&(m(),v(!1))},[i]);const y=l(()=>{v(!1),c(h)},[h,c]),C=l(()=>{if(d){const e=d(h);if(e)return void f(e)}!function(e,t){return JSON.stringify(e)===JSON.stringify(T(t))}(h,p)?y():v(!0)},[h,p,d,f,y]),S=a(()=>b?function(e,t){switch(e){case"noisy":return w(E(t));case"highlyRelevant":return x(I(t));case"costReduction":return k($(t))}}(p,h):[],[b,p,h]),A={note:g?{status:Re.Warning,message:g.message,action:u?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>u(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:$n,variant:me.Secondary,size:he.S,onClick:s},{"data-id":"sampling-create-btn-submit",label:kn,variant:me.Primary,size:he.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(fu,{isOpen:i,title:Dn[p],subTitle:Nn[p],onClose:s,footer:A}),t(Ye,{isOpen:b,title:Ln,description:Fn,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Pn,variant:me.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:kn,variant:me.Primary,onClick:y},children:e(q,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(se,{size:de.XS,weight:500,color:ce.Secondary,children:_n}),t("div",{style:{width:"100%"},children:t(Cl,{summary:S})})]})})]})},vu=({onClose:e,onDelete:n,onSaveEdit:o,validateForm:i,onNavigateToDuplicate:r})=>{const{data:s,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:m}=Vl(Ul.View),g=s?.rule.name||Rn,f=c&&s?On[s.category]:`${g} preview`,b=l(()=>{if(s&&c){if(i){const e=i(d);if(e)return void m(e)}o(d,s.rule.ruleId,s.samplingId),p()}},[s,c,d,o,i,m,p]),v=l(()=>{s&&n(s.rule.ruleId,s.samplingId)},[s,n]),y=a(()=>{if(!s)return;const t=h?{message:h.message,onViewRule:r?()=>r(h.ruleId):void 0}:null;return mu(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[s,c,h,p,b,v,u,e,r]);return t(fu,{isOpen:!!s,title:f,subTitle:s?Nn[s.category]:"",onClose:e,footer:y})},yu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a,resolvedPercentage:i}=Vl(Ul.EditAutoNoisy),r=l(()=>o(a,i),[o,a,i]);return t(wu,{formType:Ul.EditAutoNoisy,isOpen:e,onClose:n,onSave:r})},Cu=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a,resolvedPercentage:i}=Vl(Ul.EditAutoCostReduction),r=l(()=>o(a,i),[o,a,i]);return t(wu,{formType:Ul.EditAutoCostReduction,isOpen:e,onClose:n,onSave:r})},Su=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:a}=Vl(Ul.EditAutoHighlyRelevant),i=l(()=>o(a),[o,a]);return t(wu,{formType:Ul.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:i})},wu=({formType:e,isOpen:n,onClose:o,onSave:a})=>{const i=gu[e];return t(fu,{isOpen:n,title:i.title,subTitle:i.subTitle,onClose:o,footer:{actions:[{"data-id":i.cancelId,label:$n,variant:me.Secondary,size:he.S,onClick:o},{"data-id":i.saveId,label:Gn,variant:me.Primary,size:he.S,onClick:a}]}})},xu=e=>{switch(e.formType){case Ul.Create:return t(Yl,{formType:Ul.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(bu,{...e})});case Ul.View:return t(Yl,{formType:Ul.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(vu,{...e})});case Ul.EditAutoNoisy:return t(Yl,{formType:Ul.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(yu,{...e})});case Ul.EditAutoCostReduction:return t(Yl,{formType:Ul.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Cu,{...e})});case Ul.EditAutoHighlyRelevant:return t(Yl,{formType:Ul.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Su,{...e})})}},ku=({token:o,isLoading:a,isEditing:i,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=pn(),m=!i||a||!c.newToken;return jn({key:"Enter",active:!m},s),e(ue,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Se,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(ue,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(bt,{title:"Saving...",withGradient:!0}):e(n,{children:[t(pe,{variant:me.Secondary,size:he.S,leftIcon:Oi,onClick:r,disabled:a}),t(pe,{variant:me.Primary,size:he.S,leftIcon:Ni,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(se,{size:de.XS,children:new Array(55).fill("•").join("")}),e(ue,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(gt,{icon:wi,onClick:l})]})]})},Tu=({expiresAt:e,callbackValid:n,callbackExpired:i})=>{const{formatTimeAgo:l}=Ht(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Wn(e,0)?Re.Error:Wn(e,2592e6)?Re.Warning:Re.Success,[e]),d=a(()=>c===Re.Success?Ni:c===Re.Warning?nl:Bi,[c]);return o(()=>{c===Re.Success?n():c===Re.Error&&i()},[c]),t(ze,{text:s,children:t(je,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},$u=g.div`
|
|
393
406
|
display: flex;
|
|
394
407
|
flex-direction: column;
|
|
395
408
|
gap: 12px;
|
|
@@ -397,7 +410,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
397
410
|
border-radius: 12px;
|
|
398
411
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
399
412
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
400
|
-
`,
|
|
413
|
+
`,Iu=({children:e})=>{const n=f();return t(se,{size:de.XXXS,color:n.v2.colors.grey[150],children:e})},Eu=({token:n})=>{const{tokensApi:o}=gl(),[a,i]=r(!1),[l,s]=r(!1),[c,d]=r(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=Lt({newToken:""});return t(lt,{richTitle:{icon:ol,title:"Odigos Pro Token"},children:e($u,{$isExpired:c,children:[e(ue,{$justifyContent:"space-between",children:[e(q,{$gap:4,children:[t(Iu,{children:"Issued for"}),t(se,{size:de.XS,children:n.name||"N/A"})]}),e(q,{$gap:4,children:[t(Iu,{children:"Expiration"}),t(Tu,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(q,{})]}),t(ue,{children:e(q,{children:[t(Iu,{children:"Token"}),t(ku,{token:n.token,newToken:u.newToken,isLoading:a,isEditing:l,onEdit:()=>s(!0),onCancel:()=>(s(!1),void p("newToken","")),onSave:()=>(async()=>{if(!o.updateToken)return;i(!0);const e=await o.updateToken(u.newToken.trim());i(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},Au=g.div`
|
|
401
414
|
display: flex;
|
|
402
415
|
flex-direction: column;
|
|
403
416
|
align-items: center;
|
|
@@ -406,23 +419,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
406
419
|
padding: 12px 24px;
|
|
407
420
|
border-radius: 8px;
|
|
408
421
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
409
|
-
`,uu=()=>{const{progress:n}=yt(),{describeApi:o,namespacesApi:a}=ll(),{items:i}=a.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:u}=At({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(et,{richTitle:{icon:Yi,title:"Diagnose"},children:l?e(du,{children:[t(ct,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[wt.DownloadingDiagnose]?.percentage,percentage:n[wt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[wt.DownloadingDiagnose]?.percentage,visualIcon:Ui,startedAt:l}),n[wt.DownloadingDiagnose]?.list?.length&&t(W,{$width:"100%",children:n[wt.DownloadingDiagnose].list.map((n,o)=>e(se,{$gap:4,$alignItems:"center",children:[n.status===Ie.Success?t(Si,{size:16}):n.status===Ie.Error?t(wi,{size:16}):t(ct,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ae,{size:le.XXXS,color:ie.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(W,{$gap:24,children:[t(ae,{size:le.XXS,color:ie.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(W,{$gap:16,children:[e(se,{$gap:8,children:[t(Y,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include pprof profiles"})]}),e(se,{$gap:8,children:[t(Y,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include Prometheus metrics"})]}),e(se,{$gap:8,children:[t(Y,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(zn,{alignX:Xn.Left,alignY:Bn.Bottom,items:i.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:de.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Be,{label:c.sourceWorkloadNamespaces.length,status:Ie.Default}):void 0}}),t(se,{$justifyContent:"flex-end",children:t(re,{label:"Download Diagnose",rightIcon:Ui,variant:de.Primary,onClick:async()=>{o.downloadDiagnose&&(r(Date.now()),await o.downloadDiagnose(c),r(null),u())},disabled:null!==l})})]})})},pu=()=>{const{platformType:e,version:n,tier:a}=y(),{describeApi:i}=ll(),[l,r]=s(null);return o(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(et,{richTitle:{icon:Li,title:"General Information"},children:t($t,{cellsPerRow:2,items:[{id:Vn(),title:"Odigos Version",label:n},{id:Vn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Vn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Vn(),title:"Tier",label:a}]})})},hu=({isOpen:n,onClose:o})=>{const{describeApi:a,tokensApi:i}=ll(),l=i.useTokens().items[0];return e(ne,{isOpen:n,header:{icon:Li,title:"System Overview",onClose:o},children:[a.fetchDescribeOdigos&&t(pu,{}),i.updateToken&&l&&t(cu,{token:l}),a.downloadDiagnose&&t(uu,{})]})},mu=({isOpen:o,onClose:a,onCloseEnd:i})=>{const{addDataStreams:s,setSelectedStreamName:r}=He(),{dataStreamsApi:c}=ll(),{requestSubmit:d}=Ol(),u=l(async e=>{c.create?await c.create(e):(s([e]),r(e.name)),a()},[c,s,r,a]),p=l(()=>d(u),[d,u]);return _n({key:"Enter",active:o},p),e(n,{children:[t(Ue,{isOpen:o,onClose:a,onCloseEnd:i,title:Ge.NAME_YOUR_STREAM,description:Ge.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:kt.DONE,variant:de.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:a},children:t(Hs,{autoFocus:!0})}),t(Gs,{})]})},gu=({isOpen:a,onClose:i,onCloseEnd:s,dataStreamName:r})=>{const{dataStreamsApi:c}=ll(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Ol();o(()=>{a&&r&&u(r)},[a,r]);const h=!!d?.isFormDirty,m=l(async e=>{await c.update(r,e),i()},[c,r,i]),g=l(()=>p(m),[p,m]);return _n({key:"Enter",active:a},g),e(n,{children:[t(Ue,{isOpen:a,onClose:i,onCloseEnd:s,title:Ge.RENAME_STREAM(r),description:Ge.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:kt.SAVE,variant:de.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:i},children:t(Hs,{autoFocus:!0})}),t(Gs,{})]})},fu=({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)"})})]})]}),bu=g.div`
|
|
422
|
+
`,Nu=()=>{const{progress:n}=$t(),{describeApi:o,namespacesApi:a}=gl(),{items:i}=a.useNamespaces(),[l,s]=r(null),{formData:c,handleFormChange:d,resetFormData:u}=Lt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(lt,{richTitle:{icon:al,title:"Diagnose"},children:l?e(Au,{children:[t(bt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[At.DownloadingDiagnose]?.percentage,percentage:n[At.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[At.DownloadingDiagnose]?.percentage,visualIcon:Zi,startedAt:l}),n[At.DownloadingDiagnose]?.list?.length&&t(q,{$width:"100%",children:n[At.DownloadingDiagnose].list.map((n,o)=>e(ue,{$gap:4,$alignItems:"center",children:[n.status===Re.Success?t(Ni,{size:16}):n.status===Re.Error?t(Oi,{size:16}):t(bt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(se,{size:de.XXXS,color:ce.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(q,{$gap:24,children:[t(se,{size:de.XXS,color:ce.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(q,{$gap:16,children:[e(ue,{$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(se,{size:de.XXXS,color:ce.Secondary,children:"Include pprof profiles"})]}),e(ue,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(se,{size:de.XXXS,color:ce.Secondary,children:"Include Prometheus metrics"})]}),e(ue,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(se,{size:de.XXXS,color:ce.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Kn,{alignX:Jn.Left,alignY:Yn.Bottom,items:i.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:me.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(je,{label:c.sourceWorkloadNamespaces.length,status:Re.Default}):void 0}}),t(ue,{$justifyContent:"flex-end",children:t(pe,{label:"Download Diagnose",rightIcon:Zi,variant:me.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),u())},disabled:null!==l})})]})})},Ou=()=>{const{platformType:e,version:n,tier:a}=y(),{describeApi:i}=gl(),[l,s]=r(null);return o(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(lt,{richTitle:{icon:Hi,title:"General Information"},children:t(Dt,{cellsPerRow:2,items:[{id:qn(),title:"Odigos Version",label:n},{id:qn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:qn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:qn(),title:"Tier",label:a}]})})},Ru=({isOpen:n,onClose:o})=>{const{describeApi:a,tokensApi:i}=gl(),l=i.useTokens().items[0];return e(le,{isOpen:n,header:{icon:Hi,title:"System Overview",onClose:o},children:[a.fetchDescribeOdigos&&t(Ou,{}),i.updateToken&&l&&t(Eu,{token:l}),a.downloadDiagnose&&t(Nu,{})]})},Du=({isOpen:o,onClose:a,onCloseEnd:i})=>{const{addDataStreams:r,setSelectedStreamName:s}=qe(),{dataStreamsApi:c}=gl(),{requestSubmit:d}=Bl(),u=l(async e=>{c.create?await c.create(e):(r([e]),s(e.name)),a()},[c,r,s,a]),p=l(()=>d(u),[d,u]);return jn({key:"Enter",active:o},p),e(n,{children:[t(Ye,{isOpen:o,onClose:a,onCloseEnd:i,title:Je.NAME_YOUR_STREAM,description:Je.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Rt.DONE,variant:me.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:a},children:t(rs,{autoFocus:!0})}),t(ls,{})]})},Pu=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s})=>{const{dataStreamsApi:c}=gl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Bl();o(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,m=l(async e=>{await c.update(s,e),i()},[c,s,i]),g=l(()=>p(m),[p,m]);return jn({key:"Enter",active:a},g),e(n,{children:[t(Ye,{isOpen:a,onClose:i,onCloseEnd:r,title:Je.RENAME_STREAM(s),description:Je.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Rt.SAVE,variant:me.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Rt.CANCEL,variant:me.Secondary,onClick:i},children:t(rs,{autoFocus:!0})}),t(ls,{})]})},Fu=({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)"})})]})]}),Lu=g.div`
|
|
410
423
|
position: absolute;
|
|
411
424
|
top: 50%;
|
|
412
425
|
left: 50%;
|
|
413
426
|
transform: translate(-50%, -50%);
|
|
414
427
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
415
|
-
`,
|
|
428
|
+
`,_u="onboarding-done",Mu=()=>{const{currentModal:n,setCurrentModal:o}=Zn(),a=()=>o("");return e(Qn,{isOpen:n===_u,onClose:a,children:[t(Fu,{}),t(Lu,{children:e(q,{$gap:32,$alignItems:"center",children:[e(q,{$gap:24,$alignItems:"center",children:[t(se,{size:de.L,weight:500,children:"Welcome to"}),t(Dl,{size:260}),t(se,{size:de.S,weight:400,children:"Your observability control plane is ready."})]}),t(pe,{label:"Get Started",rightIcon:bi,onClick:a})]})})]})},zu=g.div`
|
|
416
429
|
display: flex;
|
|
417
430
|
flex-direction: column;
|
|
418
431
|
gap: 8px;
|
|
419
432
|
padding: 4px 8px;
|
|
420
433
|
border-radius: 8px;
|
|
421
434
|
width: 100%;
|
|
422
|
-
`,
|
|
435
|
+
`,Bu=g.div`
|
|
423
436
|
white-space: pre;
|
|
424
437
|
overflow-x: auto;
|
|
425
|
-
`,
|
|
438
|
+
`,Xu=({name:n,recommended:o,toggleLabel:a,enabled:i,onEnabledChange:l,summary:r,toggleName:s})=>{const c=f();return e(zu,{children:[e(ue,{$gap:8,$justifyContent:"space-between",children:[e(ue,{$gap:4,children:[t(se,{size:de.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(je,{label:eo,leftIcon:il,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:de.XXXS})]}),t(oe,{name:s??`sampling-onboarding-toggle-${n}`,label:a,labelAlign:ae.Left,value:i,onChange:l,size:kt.S})]}),t(Bu,{children:t(S,{parts:r})})]})},Vu=g.div`
|
|
426
439
|
position: relative;
|
|
427
440
|
display: flex;
|
|
428
441
|
align-items: center;
|
|
@@ -432,18 +445,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
432
445
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
433
446
|
border-top-left-radius: 18px;
|
|
434
447
|
border-top-right-radius: 18px;
|
|
435
|
-
`,
|
|
448
|
+
`,Uu=g.div`
|
|
436
449
|
position: absolute;
|
|
437
450
|
left: 16px;
|
|
438
451
|
top: 50%;
|
|
439
452
|
transform: translateY(-50%);
|
|
440
|
-
`,
|
|
453
|
+
`,Gu=g.div`
|
|
441
454
|
height: 16px;
|
|
442
455
|
width: 100%;
|
|
443
456
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
444
457
|
border-top-left-radius: 18px;
|
|
445
458
|
border-top-right-radius: 18px;
|
|
446
|
-
|
|
459
|
+
`,Hu=g.div`
|
|
447
460
|
width: ${({$width:e})=>e}px;
|
|
448
461
|
display: flex;
|
|
449
462
|
flex-direction: column;
|
|
@@ -451,7 +464,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
451
464
|
gap: 22px;
|
|
452
465
|
padding: 8px 32px 32px 32px;
|
|
453
466
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
454
|
-
`,
|
|
467
|
+
`,ju=e=>t(ll,{rotate:90,...e}),Wu=({children:n,center:o,onNext:a,nextLabel:i=to,nextLoading:l})=>e(ue,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,a&&t(pe,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:ju,variant:me.Primary,size:he.M,onClick:a,loading:l})]}),Ku=e=>t(ll,{rotate:-90,...e}),Yu=({title:n,onBack:o})=>{const a=f();return e(Vu,{$hasBack:!!o,children:[o&&t(Uu,{children:t(gt,{"data-id":"sampling-onboarding-back",icon:Ku,size:ft.M,onClick:o})}),t(se,{size:de.M,weight:500,color:a.v2.colors.white[500],align:"center",children:n})]})},Ju=g.div`
|
|
455
468
|
box-sizing: border-box;
|
|
456
469
|
width: ${({$width:e})=>e??"100%"};
|
|
457
470
|
${({$fillHeight:e})=>e&&b`
|
|
@@ -464,16 +477,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
464
477
|
padding: 16px;
|
|
465
478
|
border-radius: 16px;
|
|
466
479
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
467
|
-
`,
|
|
480
|
+
`,qu=({children:e,fillHeight:n,width:o})=>t(Ju,{$fillHeight:n,$width:o,children:e}),Zu=g.ul`
|
|
468
481
|
margin: 0;
|
|
469
482
|
padding: 0;
|
|
470
483
|
list-style: disc;
|
|
471
|
-
`,
|
|
484
|
+
`,Qu=g.li`
|
|
472
485
|
margin-left: 18px;
|
|
473
486
|
& + & {
|
|
474
487
|
margin-top: 6px;
|
|
475
488
|
}
|
|
476
|
-
`,
|
|
489
|
+
`,ep=({items:e,color:n})=>{const o=f(),a=n||o.v2.colors.silver[200];return t(Zu,{children:e.map((e,n)=>t(Qu,{style:{color:a},children:t(se,{size:de.XXS,color:a,children:e})},n))})},tp=({items:n})=>{const o=f();return t(q,{$gap:16,children:n.map((n,a)=>e(ue,{$gap:8,$alignItems:"flex-start",children:[e(se,{size:de.XS,color:o.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(q,{$gap:2,children:[t(se,{size:de.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(se,{size:de.XS,color:o.v2.colors.silver[200],children:n.description})]})]},a))})},np=({message:e})=>t(Oe,{status:Re.Default,message:e,fullWidth:!0,smallIcon:!0}),op=g.div`
|
|
477
490
|
width: 100%;
|
|
478
491
|
padding: 8px;
|
|
479
492
|
display: flex;
|
|
@@ -481,12 +494,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
481
494
|
gap: 4px;
|
|
482
495
|
border-radius: 16px;
|
|
483
496
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
484
|
-
`,
|
|
497
|
+
`,ap=g.div`
|
|
485
498
|
display: flex;
|
|
486
499
|
align-items: center;
|
|
487
500
|
gap: 8px;
|
|
488
501
|
padding: 4px 8px 12px 8px;
|
|
489
|
-
`,
|
|
502
|
+
`,ip=g.div`
|
|
490
503
|
width: 100%;
|
|
491
504
|
display: flex;
|
|
492
505
|
flex-direction: column;
|
|
@@ -494,20 +507,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
494
507
|
padding: 8px;
|
|
495
508
|
border-radius: 12px;
|
|
496
509
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
497
|
-
`,
|
|
510
|
+
`,lp=({children:e})=>{const n=f();return t(se,{size:de.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},rp=g.div`
|
|
498
511
|
white-space: pre-line;
|
|
499
|
-
`,
|
|
512
|
+
`,sp=({enabled:o,onEnabledChange:i,onBack:l,onNext:r})=>{const s=f(),c=a(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(Yu,{title:no,onBack:l}),e(Hu,{$width:854,children:[t(lp,{children:oo}),e(q,{$gap:8,$width:"100%",children:[t(qu,{children:t(rp,{children:t(se,{size:de.XXS,color:s.v2.colors.silver[200],children:ao})})}),e(q,{$gap:8,$width:"100%",children:[e(op,{children:[t(ap,{children:t(se,{size:de.S,weight:500,color:s.v2.colors.white[500],children:io})}),t(ip,{children:t(Xu,{name:ro,recommended:!0,toggleLabel:lo,enabled:o,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(np,{message:so})]})]})]}),t(Wu,{onNext:r})]})},cp=e=>t(ll,{rotate:90,...e}),dp=({onClose:o})=>{const a=f();return e(n,{children:[t(Gu,{}),e(Hu,{$width:732,children:[t(co,{icon:tl}),e(q,{$gap:16,$alignItems:"center",$width:"100%",children:[t(se,{size:de.M,weight:500,color:a.v2.colors.white[500],children:uo}),po.split("\n").map((e,n)=>t(lp,{children:e},`subtitle-${n}-${e}`)),e(qu,{children:[t(se,{size:de.XS,color:a.v2.colors.silver[200],children:ho}),t(ep,{color:a.v2.colors.white[500],items:[mo,go,fo]})]})]})]}),t(Wu,{center:!0,children:t(pe,{"data-id":"sampling-onboarding-btn-go-to",label:bo,rightIcon:cp,variant:me.Primary,size:he.M,onClick:o})})]})},up=e=>t(ll,{rotate:90,...e}),pp=g.div`
|
|
500
513
|
display: flex;
|
|
501
514
|
flex-direction: column;
|
|
502
515
|
align-items: center;
|
|
503
516
|
gap: 8px;
|
|
504
517
|
width: 100%;
|
|
505
|
-
`,
|
|
518
|
+
`,hp=({onSkip:o,onNext:a})=>{const i=f();return e(n,{children:[t(Gu,{}),e(Hu,{$width:732,children:[t(co,{icon:tl}),e(q,{$gap:16,$alignItems:"center",$width:"100%",children:[e(pp,{children:[t(se,{size:de.M,weight:500,color:i.v2.colors.white[500],children:vo}),t(lp,{children:yo})]}),e(qu,{children:[t(se,{size:de.XS,color:i.v2.colors.silver[200],children:Co}),t(tp,{items:[{title:wo,description:So},{title:ko,description:xo},{title:$o,description:To}]}),t(np,{message:Io})]})]})]}),e(Wu,{center:!0,children:[t(pe,{"data-id":"sampling-onboarding-btn-skip",label:Eo,variant:me.Secondary,onClick:o}),t(pe,{"data-id":"sampling-onboarding-btn-start",label:Ao,rightIcon:up,variant:me.Primary,onClick:a})]})]})},mp=g.div`
|
|
506
519
|
display: flex;
|
|
507
520
|
align-items: stretch;
|
|
508
521
|
gap: 16px;
|
|
509
522
|
width: 100%;
|
|
510
|
-
`,
|
|
523
|
+
`,gp=g.div`
|
|
511
524
|
flex: 1;
|
|
512
525
|
display: flex;
|
|
513
526
|
flex-direction: column;
|
|
@@ -527,18 +540,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
527
540
|
background-color: ${t.v2.colors.silver[700]};
|
|
528
541
|
}
|
|
529
542
|
`}
|
|
530
|
-
`,
|
|
543
|
+
`,fp=g.div`
|
|
531
544
|
display: flex;
|
|
532
545
|
align-items: center;
|
|
533
546
|
gap: 8px;
|
|
534
547
|
padding: 12px 16px;
|
|
535
|
-
`,
|
|
548
|
+
`,bp=g.div`
|
|
536
549
|
flex: 1;
|
|
537
550
|
padding: 8px;
|
|
538
551
|
display: flex;
|
|
539
552
|
flex-direction: column;
|
|
540
553
|
gap: 8px;
|
|
541
|
-
`,
|
|
554
|
+
`,vp=g.div`
|
|
542
555
|
flex: 1;
|
|
543
556
|
display: flex;
|
|
544
557
|
flex-direction: column;
|
|
@@ -546,17 +559,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
546
559
|
padding: 12px;
|
|
547
560
|
border-radius: 12px;
|
|
548
561
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
549
|
-
`,
|
|
562
|
+
`,yp=g.div`
|
|
550
563
|
display: flex;
|
|
551
564
|
justify-content: flex-end;
|
|
552
|
-
`,
|
|
565
|
+
`,Cp=g.div`
|
|
553
566
|
display: flex;
|
|
554
567
|
align-items: center;
|
|
555
568
|
gap: 8px;
|
|
556
569
|
padding: 4px 12px 4px 4px;
|
|
557
570
|
border-radius: 8px;
|
|
558
571
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
559
|
-
`,
|
|
572
|
+
`,Sp=g.div`
|
|
560
573
|
display: flex;
|
|
561
574
|
align-items: center;
|
|
562
575
|
justify-content: center;
|
|
@@ -564,13 +577,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
564
577
|
height: 24px;
|
|
565
578
|
border-radius: 6px;
|
|
566
579
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
567
|
-
`,
|
|
580
|
+
`,wp=({selected:n,onSelect:o,name:a,description:i,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=f(),u=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(gp,{$selected:n,onClick:o,children:[e(fp,{children:[t(ve,{"data-id":`sampling-onboarding-radio-${a}`,value:n,onChange:o,size:Ce.L}),t(tl,{size:24,fill:d.v2.colors.white[500]}),t(se,{size:de.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(bp,{children:[e(vp,{$selected:n,children:[e(q,{$gap:8,children:[t(je,{...l,textSize:de.XXXS}),t(se,{size:de.XXS,color:u,children:i})]}),r&&r.length>0&&t(ep,{color:u,items:r}),s&&e(Cp,{children:[t(Sp,{children:t(nl,{size:18,fill:d.v2.colors.yellow[500]})}),t(se,{size:de.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(yp,{children:t(pe,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:jo,rightIcon:Ci,variant:me.Text,size:he.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},xp=({strategy:o,onStrategyChange:a,onBack:i,onNext:l,docsUrl:r})=>{const s=f(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(Yu,{title:No,onBack:i}),e(Hu,{$width:854,children:[t(lp,{children:Oo}),e(mp,{children:[t(wp,{selected:"keep-list"===o,onSelect:()=>a("keep-list"),name:_o,description:Lo,badgeProps:{label:Fo,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Do,Po],warning:Ro,onReadMore:c}),t(wp,{selected:"drop-list"===o,onSelect:()=>a("drop-list"),name:Vo,description:Xo,badgeProps:{label:Bo,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Mo,zo],onReadMore:c}),t(wp,{selected:"advanced"===o,onSelect:()=>a("advanced"),name:Ho,description:Go,badgeProps:{label:Uo,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Wu,{onNext:l})]})},kp=({onBack:o,onNext:i,submitting:l})=>{const r=f(),s=a(()=>[{title:Jo,bullets:[Wo,Ko,Yo]},{title:na,bullets:[qo,Zo,Qo,ea,ta]}],[]);return e(n,{children:[t(Yu,{title:oa,onBack:o}),e(Hu,{$width:854,children:[t(lp,{children:aa}),t(ue,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,o)=>e(qu,{fillHeight:!0,width:"50%",children:[t(se,{size:de.XS,color:r.v2.colors.white[500],children:n.title}),t(ep,{items:n.bullets})]},o))}),t(np,{message:ia})]}),t(Wu,{onNext:i,nextLoading:l})]})},Tp=g.div`
|
|
568
581
|
white-space: pre-line;
|
|
569
|
-
|
|
582
|
+
`,$p=({errorPresetEnabled:o,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=f(),d=a(()=>N(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Yu,{title:la,onBack:l}),e(Hu,{$width:854,children:[t(lp,{children:ra}),e(q,{$gap:8,$width:"100%",children:[e(qu,{children:[t(Tp,{children:t(se,{size:de.XXS,color:c.v2.colors.silver[200],children:sa})}),t(np,{message:ia})]}),e(op,{children:[e(ap,{children:[t(se,{size:de.S,weight:500,color:c.v2.colors.white[500],children:ca}),t(Xi,{size:16,fill:c.v2.colors.silver[200]})]}),t(ip,{children:t(Xu,{name:ua,recommended:!0,toggleLabel:da,enabled:o,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Wu,{onNext:r,nextLoading:s})]})},Ip=g.div`
|
|
570
583
|
white-space: pre-line;
|
|
571
|
-
`,
|
|
584
|
+
`,Ep=g.div`
|
|
572
585
|
width: fit-content;
|
|
573
|
-
`,dp=["50","25","10","1","0.1"],up=({value:n,onChange:o,label:i})=>{const l=f(),s=a(()=>dp.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(W,{$gap:8,children:[t(ae,{size:le.XS,color:l.v2.colors.white[500],children:i}),t(cp,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:s,selected:n,setSelected:o})})]})},pp=({errorPresetEnabled:o,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:s,onBack:r,onNext:c,submitting:d})=>{const u=f(),p=a(()=>$(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Nu,{title:oa,onBack:r}),e($u,{$width:854,children:[t(Xu,{children:aa}),e(W,{$gap:8,$width:"100%",children:[e(Ru,{children:[t(rp,{children:t(ae,{size:le.XXS,color:u.v2.colors.silver[200],children:ia})}),t(Fu,{items:[la,sa,ra,ca,da]}),t(_u,{message:Jo})]}),e(Mu,{children:[e(zu,{children:[t(ae,{size:le.S,weight:500,color:u.v2.colors.white[500],children:ua}),t(Ri,{size:16,fill:u.v2.colors.silver[200]})]}),t(Bu,{children:t(wu,{name:na,recommended:!0,toggleLabel:ta,enabled:o,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Bu,{children:t(up,{value:l,onChange:s,label:pa})})]})]})]}),t(Eu,{onNext:c,nextLoading:d})]})},hp=({isOpen:e,onClose:n,k8sHealthProbesConfig:a,samplingId:i,docsUrl:r})=>{const{samplingApi:c}=ll(),[d,u]=s("welcome"),[p,h]=s(!0),[m,g]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);o(()=>{e&&(u("welcome"),h(a?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,a?.enabled]);const w=l(async()=>{const e=i??"default",t=[];if(p!==(a?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:a?.keepPercentage??0}))}if("advanced"!==m&&f){const n=c.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=c.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),u("success")}catch{}finally{S(!1)}},[i,c,p,a?.enabled,a?.keepPercentage,m,f,v]);let x=null;switch(d){case"welcome":x=t(Ku,{onSkip:n,onNext:()=>u("noisy")});break;case"noisy":x=t(Uu,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":x=t(ap,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":x=t(pp,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":x=t(sp,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":x=t(ip,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":x=t(Hu,{onClose:n})}return t(Gn,{isOpen:e,onClose:n,children:x})};var mp,gp;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(mp||(mp={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(gp||(gp={}));const fp=[{key:gp.Name,label:"Name"},{key:gp.Type,label:"Type",textAlign:"right"},{key:gp.Status,label:"Status"},{key:gp.OdigosVersion,label:"Odigos Version"},{key:gp.ConnectedSince,label:"Connected Since"},{key:gp.LastActivity,label:"Last Activity"}],bp=(e,t)=>{const n=e.find(e=>e.key===gp.Id)?.rawValue;return t(n?.toString()||"")},vp=e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===gp.Status)?.rawValue===Ie.Success)(e))return[{id:Vn(),label:"Delete Connection",rightIcon:pi,onClick:()=>bp(e,a)}];const d=bp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&I(o.odigosVersion,n)}),u=bp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&I(n.odigosVersion,o)}),p=[];return i&&p.push({id:Vn(),tooltip:u?Ge.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:ki,disabled:!u,onClick:()=>bp(e,i)}),l&&p.push({id:Vn(),tooltip:Ge.ADD_DESTINATION,rightIcon:vi,onClick:()=>bp(e,l)}),s&&p.push({id:Vn(),tooltip:Ge.ADD_ACTION,rightIcon:bi,onClick:()=>bp(e,s)}),r&&p.push({id:Vn(),tooltip:Ge.ADD_INSTRUMENTATION_RULE,rightIcon:xi,onClick:()=>bp(e,r)}),c&&p.push({id:Vn(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:$i,disabled:!d,onClick:()=>bp(e,c)}),p}},yp=({connections:n,getConnections:i,onClickConnection:r,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=f(),{formatTimeAgo:h}=zt(),{capabilities:m}=ll(),[g,b]=s(!1),[v,y]=s(n||[]),C=l(async()=>{try{b(!0),y(await i()??[])}catch(e){}finally{b(!1)}},[]);o(()=>{v.length||C()},[]);const[S,w]=s(""),[x,k]=s(null),[T,$]=s([]),E=a(()=>x===mp.BulkConfig?d:x===mp.BulkSource?u:0,[x,d,u]),{supportedConnections:A,supportedConnectionIds:N}=a(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Ie.Success,o=I(e.odigosVersion,t);return n&&o}))(v,E);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[v,E]);o(()=>{if(!x||x===mp.Delete)return;const e=T.filter(e=>!N.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[x,T.length,N.length]);const O=a(()=>v.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:gp.Id,rawValue:e.id},{key:gp.Name,rawValue:e.name},{key:gp.Type,rawValue:e.type},{key:gp.Status,rawValue:e.status,component:()=>(e=>{const n=e===Ie.Success?"Connection live":"Connection lost",o=e===Ie.Success?Si:wi;return t(Be,{status:e,label:n,leftIcon:o})})(e.status)},{key:gp.OdigosVersion,rawValue:e.odigosVersion},{key:gp.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:gp.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Ie.Success||x?void 0:()=>r(e),isSelected:T.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Ie.Success||x===mp.BulkConfig&&!I(e.odigosVersion,d)||x===mp.BulkSource&&!I(e.odigosVersion,u)})),[v,T,S,x,d,u,h,r]),R=a(()=>{const e=(e,t)=>{$([e]),k(t)};return vp({connections:v,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,mp.Delete),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?t=>e(t,mp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?t=>e(t,mp.BulkDestination):void 0,onAddAction:m.canCreateAction?t=>e(t,mp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?t=>e(t,mp.BulkInstrumentationRule):void 0,onEditConfiguration:m.canApplyEffectiveConfig?t=>e(t,mp.BulkConfig):void 0})},[v,d,u,m]),D=a(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];n&&s.push({id:Vn(),type:Yt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:"Add Sources",rightIcon:ki,onClick:n}});const r=[o?{id:mp.BulkDestination,label:Ge.ADD_DESTINATION,icon:vi}:null,a?{id:mp.BulkAction,label:Ge.ADD_ACTION,icon:bi}:null,i?{id:mp.BulkInstrumentationRule,label:Ge.ADD_INSTRUMENTATION_RULE,icon:xi}:null,l?{id:mp.BulkConfig,label:"Manage Configurations",icon:$i}:null];return r.some(Boolean)&&s.push({id:Vn(),type:Yt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"Bulk Operations",onClick:e=>{e===mp.BulkSource?n?.():e===mp.BulkDestination?o?.():e===mp.BulkAction?a?.():e===mp.BulkInstrumentationRule?i?.():e===mp.BulkConfig&&l?.()}},dropDataProps:{alignX:Xn.Left,items:r}}),s.push({id:Vn(),type:Yt.Button,buttonProps:{variant:de.Text,size:ce.S,label:kt.CANCEL,onClick:t}}),s})({onCancel:()=>$([]),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?()=>k(mp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?()=>k(mp.BulkDestination):void 0,onAddAction:m.canCreateAction?()=>k(mp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?()=>k(mp.BulkInstrumentationRule):void 0,onManageConfigurations:m.canApplyEffectiveConfig?()=>k(mp.BulkConfig):void 0}),[m]);return t(ha,{children:e(et,{fullHeight:!0,richTitle:{icon:Zi,title:Ge.CONNECTIONS,badge:{label:v.length.toString(),status:Ie.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:Vn(),type:Yt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ni,onClick:C,disabled:g}}],children:[t(fn,{variant:bn.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:g,withCheckboxes:!0,columns:fp,rows:O,rowActionsPushRightPosition:x?`calc(${Tl} - 24px)`:void 0,getRowActions:R}),x===mp.BulkConfig&&m.canApplyEffectiveConfig&&t(Il,{connectionIds:T,children:t(zr,{onClose:()=>k(null),connections:A,selectedConnectionIds:T,setSelectedConnectionIds:$})}),x===mp.BulkSource&&m.canFetchSnapshots&&m.canBulkPersistSources&&t(Il,{connectionIds:T,children:t(Xl,{selectedConnectionIds:T,children:t(Lr,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===mp.BulkDestination&&m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canTestConnection&&m.canCreateDestination&&t(Il,{connectionIds:T,children:t(Vl,{children:t(gr,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===mp.BulkAction&&m.canCreateAction&&t(Il,{connectionIds:T,children:t(Ul,{children:t(ir,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===mp.BulkInstrumentationRule&&m.canCreateInstrumentationRule&&t(Il,{connectionIds:T,children:t(Gl,{children:t(fr,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),t(Sl,{target:"connection",isOpen:x===mp.Delete,onClose:()=>{$([]),k(null)},onApprove:async()=>{const e=T[0];e&&(await c(e),await C())}}),t(vn,{isOpen:!!T.length&&!x,richTitle:{icon:ci,title:"Selected Clusters",badge:{label:T.length}},actions:D})]})})},Cp=g.div`
|
|
586
|
+
`,Ap=["50","25","10","1","0.1"],Np=({value:n,onChange:o,label:i})=>{const l=f(),r=a(()=>Ap.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(q,{$gap:8,children:[t(se,{size:de.XS,color:l.v2.colors.white[500],children:i}),t(Ep,{children:t(ge,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},Op=({errorPresetEnabled:o,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>N(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Yu,{title:pa,onBack:s}),e(Hu,{$width:854,children:[t(lp,{children:ha}),e(q,{$gap:8,$width:"100%",children:[e(qu,{children:[t(Ip,{children:t(se,{size:de.XXS,color:u.v2.colors.silver[200],children:ma})}),t(ep,{items:[ga,fa,ba,va,ya]}),t(np,{message:ia})]}),e(op,{children:[e(ap,{children:[t(se,{size:de.S,weight:500,color:u.v2.colors.white[500],children:Ca}),t(Xi,{size:16,fill:u.v2.colors.silver[200]})]}),t(ip,{children:t(Xu,{name:ua,recommended:!0,toggleLabel:da,enabled:o,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(ip,{children:t(Np,{value:l,onChange:r,label:Sa})})]})]})]}),t(Wu,{onNext:c,nextLoading:d})]})},Rp=({isOpen:e,onClose:n,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s})=>{const{samplingApi:c}=gl(),[d,u]=r("welcome"),[p,h]=r(!0),[m,g]=r("keep-list"),[f,b]=r(!0),[v,y]=r("25"),[C,S]=r(!1);o(()=>{e&&(u("welcome"),h(a?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,a?.enabled]);const w=l(async()=>{const e=i??"default",t=[];if(p!==(a?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:a?.keepPercentage??0}))}if("advanced"!==m&&f){const n=c.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=c.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),u("success")}catch{}finally{S(!1)}},[i,c,p,a?.enabled,a?.keepPercentage,m,f,v]);let x=null;switch(d){case"welcome":x=t(hp,{onSkip:n,onNext:()=>u("noisy")});break;case"noisy":x=t(sp,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":x=t(xp,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":x=t(Op,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":x=t($p,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":x=t(kp,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":x=t(dp,{onClose:n})}return t(Qn,{isOpen:e,onClose:n,children:x})};var Dp,Pp;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Dp||(Dp={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Pp||(Pp={}));const Fp=[{key:Pp.Name,label:"Name"},{key:Pp.Type,label:"Type",textAlign:"right"},{key:Pp.Status,label:"Status"},{key:Pp.OdigosVersion,label:"Odigos Version"},{key:Pp.ConnectedSince,label:"Connected Since"},{key:Pp.LastActivity,label:"Last Activity"}],Lp=(e,t)=>{const n=e.find(e=>e.key===Pp.Id)?.rawValue;return t(n?.toString()||"")},_p=e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Pp.Status)?.rawValue===Re.Success)(e))return[{id:qn(),label:"Delete Connection",rightIcon:Si,onClick:()=>Lp(e,a)}];const d=Lp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&O(o.odigosVersion,n)}),u=Lp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&O(n.odigosVersion,o)}),p=[];return i&&p.push({id:qn(),tooltip:u?Je.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Di,disabled:!u,onClick:()=>Lp(e,i)}),l&&p.push({id:qn(),tooltip:Je.ADD_DESTINATION,rightIcon:Ii,onClick:()=>Lp(e,l)}),r&&p.push({id:qn(),tooltip:Je.ADD_ACTION,rightIcon:$i,onClick:()=>Lp(e,r)}),s&&p.push({id:qn(),tooltip:Je.ADD_INSTRUMENTATION_RULE,rightIcon:Ri,onClick:()=>Lp(e,s)}),c&&p.push({id:qn(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Fi,disabled:!d,onClick:()=>Lp(e,c)}),p}},Mp=({connections:n,getConnections:i,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=f(),{formatTimeAgo:h}=Ht(),{capabilities:m}=gl(),[g,b]=r(!1),[v,y]=r(n||[]),C=l(async()=>{try{b(!0),y(await i()??[])}catch(e){}finally{b(!1)}},[]);o(()=>{v.length||C()},[]);const[S,w]=r(""),[x,k]=r(null),[T,$]=r([]),I=a(()=>x===Dp.BulkConfig?d:x===Dp.BulkSource?u:0,[x,d,u]),{supportedConnections:E,supportedConnectionIds:A}=a(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Re.Success,o=O(e.odigosVersion,t);return n&&o}))(v,I);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[v,I]);o(()=>{if(!x||x===Dp.Delete)return;const e=T.filter(e=>!A.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[x,T.length,A.length]);const N=a(()=>v.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:Pp.Id,rawValue:e.id},{key:Pp.Name,rawValue:e.name},{key:Pp.Type,rawValue:e.type},{key:Pp.Status,rawValue:e.status,component:()=>(e=>{const n=e===Re.Success?"Connection live":"Connection lost",o=e===Re.Success?Ni:Oi;return t(je,{status:e,label:n,leftIcon:o})})(e.status)},{key:Pp.OdigosVersion,rawValue:e.odigosVersion},{key:Pp.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:Pp.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Re.Success||x?void 0:()=>s(e),isSelected:T.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Re.Success||x===Dp.BulkConfig&&!O(e.odigosVersion,d)||x===Dp.BulkSource&&!O(e.odigosVersion,u)})),[v,T,S,x,d,u,h,s]),R=a(()=>{const e=(e,t)=>{$([e]),k(t)};return _p({connections:v,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,Dp.Delete),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?t=>e(t,Dp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?t=>e(t,Dp.BulkDestination):void 0,onAddAction:m.canCreateAction?t=>e(t,Dp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?t=>e(t,Dp.BulkInstrumentationRule):void 0,onEditConfiguration:m.canApplyEffectiveConfig?t=>e(t,Dp.BulkConfig):void 0})},[v,d,u,m]),D=a(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];n&&r.push({id:qn(),type:tn.Button,buttonProps:{variant:me.Primary,size:he.S,label:"Add Sources",rightIcon:Di,onClick:n}});const s=[o?{id:Dp.BulkDestination,label:Je.ADD_DESTINATION,icon:Ii}:null,a?{id:Dp.BulkAction,label:Je.ADD_ACTION,icon:$i}:null,i?{id:Dp.BulkInstrumentationRule,label:Je.ADD_INSTRUMENTATION_RULE,icon:Ri}:null,l?{id:Dp.BulkConfig,label:"Manage Configurations",icon:Fi}:null];return s.some(Boolean)&&r.push({id:qn(),type:tn.ButtonDropData,buttonProps:{variant:me.Secondary,size:he.S,label:"Bulk Operations",onClick:e=>{e===Dp.BulkSource?n?.():e===Dp.BulkDestination?o?.():e===Dp.BulkAction?a?.():e===Dp.BulkInstrumentationRule?i?.():e===Dp.BulkConfig&&l?.()}},dropDataProps:{alignX:Jn.Left,items:s}}),r.push({id:qn(),type:tn.Button,buttonProps:{variant:me.Text,size:he.S,label:Rt.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?()=>k(Dp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?()=>k(Dp.BulkDestination):void 0,onAddAction:m.canCreateAction?()=>k(Dp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?()=>k(Dp.BulkInstrumentationRule):void 0,onManageConfigurations:m.canApplyEffectiveConfig?()=>k(Dp.BulkConfig):void 0}),[m]);return t(wa,{children:e(lt,{fullHeight:!0,richTitle:{icon:rl,title:Je.CONNECTIONS,badge:{label:v.length.toString(),status:Re.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:qn(),type:tn.Button,buttonProps:{variant:me.Secondary,size:he.S,leftIcon:zi,onClick:C,disabled:g}}],children:[t(Sn,{variant:wn.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:g,withCheckboxes:!0,columns:Fp,rows:N,rowActionsPushRightPosition:x?`calc(${Pl} - 24px)`:void 0,getRowActions:R}),x===Dp.BulkConfig&&m.canApplyEffectiveConfig&&t(Ll,{connectionIds:T,children:t(tc,{onClose:()=>k(null),connections:E,selectedConnectionIds:T,setSelectedConnectionIds:$})}),x===Dp.BulkSource&&m.canFetchSnapshots&&m.canBulkPersistSources&&t(Ll,{connectionIds:T,children:t(Jl,{selectedConnectionIds:T,children:t(Zs,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Dp.BulkDestination&&m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canTestConnection&&m.canCreateDestination&&t(Ll,{connectionIds:T,children:t(ql,{children:t(Os,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Dp.BulkAction&&m.canCreateAction&&t(Ll,{connectionIds:T,children:t(Zl,{children:t(Ss,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Dp.BulkInstrumentationRule&&m.canCreateInstrumentationRule&&t(Ll,{connectionIds:T,children:t(Ql,{children:t(Rs,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),t(Nl,{target:"connection",isOpen:x===Dp.Delete,onClose:()=>{$([]),k(null)},onApprove:async()=>{const e=T[0];e&&(await c(e),await C())}}),t(xn,{isOpen:!!T.length&&!x,richTitle:{icon:vi,title:"Selected Clusters",badge:{label:T.length}},actions:D})]})})},zp=g.div`
|
|
574
587
|
display: flex;
|
|
575
588
|
align-items: center;
|
|
576
589
|
justify-content: space-between;
|
|
@@ -579,26 +592,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
579
592
|
width: 100%;
|
|
580
593
|
border-radius: 16px;
|
|
581
594
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
582
|
-
`,
|
|
595
|
+
`,Bp=g.div`
|
|
583
596
|
display: flex;
|
|
584
597
|
align-items: center;
|
|
585
598
|
justify-content: center;
|
|
586
599
|
padding: 8px;
|
|
587
600
|
border-radius: 8px;
|
|
588
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
589
|
-
`,
|
|
601
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+st["004"]};
|
|
602
|
+
`,Xp=({setStep:n,onSave:o,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=f(),c=()=>n(2),d=()=>n(3),u=a(()=>Object.values(i||{}).flatMap((n,o)=>n.map((n,a)=>{if(!n.selected)return null;const i=n.kind||wt.Namespace,l=i===wt.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(zp,{children:[t(se,{nowrap:!0,children:l}),t(je,{label:i,status:Re.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${o}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((n,o)=>{const a=yt(n.option.type).icon;return e(zp,{children:[e(ue,{$gap:8,children:[a&&t(Bp,{children:t(a,{size:24})}),t(se,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(je,{status:n.testResult.succeeded?Re.Success:Re.Error,leftIcon:n.testResult.succeeded?Ni:Oi})]},`destination-${o}`)})||[],[l]);return t(Al,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:o,header:{icon:_i,title:Je.SUMMARY,subTitle:Je.REVIEW_SETUP},leftColumn:{width:"50%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(Di,{size:24}),t(se,{nowrap:!0,children:Je.SELECTED_SOURCES}),t(je,{label:u.length})]}),t(pe,{"data-id":"summary-edit-sources",leftIcon:wi,variant:me.Secondary,size:he.S,onClick:c})]}),list:u.length?u:[t(pt,{$height:"100%",children:t(Ie,{icon:Di,title:Je.NO_SOURCES_SELECTED,subTitle:Je.ADD_SOURCE_PROMPT,button:{leftIcon:fi,label:Je.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(Ii,{size:24}),t(se,{nowrap:!0,children:Je.SELECTED_DESTINATIONS}),t(je,{label:p.length})]}),t(pe,{"data-id":"summary-edit-destinations",leftIcon:wi,variant:me.Secondary,size:he.S,onClick:d})]}),list:p.length?p:[t(pt,{"data-id":"summary-no-destinations",$height:"100%",children:t(Ie,{icon:Ii,title:Je.NO_DESTINATIONS_SELECTED,subTitle:Je.ADD_DESTINATION_PROMPT,button:{leftIcon:fi,label:Je.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Vp=g.div`
|
|
590
603
|
position: relative;
|
|
591
604
|
overflow: hidden;
|
|
592
605
|
width: 100vw;
|
|
593
606
|
height: 100vh;
|
|
594
607
|
box-sizing: border-box;
|
|
595
|
-
`,
|
|
608
|
+
`,Up=g.svg`
|
|
596
609
|
position: absolute;
|
|
597
610
|
top: 50%;
|
|
598
611
|
left: 50%;
|
|
599
612
|
transform: translate(-50%, -50%);
|
|
600
613
|
z-index: -1;
|
|
601
|
-
`,
|
|
614
|
+
`,Gp=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],Hp=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Gp},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Gp},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:Gp}],jp=({paddingXAxis:n="0px",paddingYAxis:i="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=a(()=>s/Hp[0].width,[s]);return o(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Vp,{$paddingXAxis:n,$paddingYAxis:i,children:[Hp.map(({width:n,height:o,pathOpacity:a,path:i,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(Up,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${o}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:n},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},o))})})]},c)}),l]})},Wp=g.div`
|
|
602
615
|
display: flex;
|
|
603
616
|
flex-direction: column;
|
|
604
617
|
align-items: center;
|
|
@@ -609,7 +622,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
609
622
|
width: 50vw;
|
|
610
623
|
border-radius: 16px;
|
|
611
624
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
612
|
-
`,
|
|
625
|
+
`,Kp=g.div`
|
|
613
626
|
display: flex;
|
|
614
627
|
flex-direction: column;
|
|
615
628
|
align-items: center;
|
|
@@ -619,15 +632,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
619
632
|
& * {
|
|
620
633
|
text-align: center;
|
|
621
634
|
}
|
|
622
|
-
`,
|
|
635
|
+
`,Yp=({onStart:n})=>t(le,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(pt,{$height:"100%",children:e(Wp,{children:[e(Kp,{children:[t(se,{size:de.L,weight:500,children:Je.GET_STARTED_WITH}),t(Dl,{size:260}),t(se,{size:de.S,weight:400,children:Je.GET_STARTED_DESCRIPTION})]}),t(pe,{"data-id":"onboarding-get-started",label:Rt.GET_STARTED,rightIcon:bi,size:he.L,onClick:n})]})})}),Jp=[{step:1,label:Je.INSTALLATION,forceDoneBadge:!0},{step:2,label:Je.SOURCES_SETUP},{step:3,label:Je.DESTINATIONS_SETUP},{step:4,label:Je.SUMMARY}],qp=g.div`
|
|
623
636
|
display: flex;
|
|
624
637
|
flex-direction: column;
|
|
625
638
|
gap: 32px;
|
|
626
639
|
padding: 64px;
|
|
627
|
-
`,
|
|
640
|
+
`,Zp=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:a})=>{const{setCurrentModal:i}=Zn(),{sourcesApi:l,destinationsApi:s}=gl(),[c,d]=r(1),[u,p]=r(!1),[h,m]=r(null),[g,f]=r(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(jp,{paddingXAxis:n,paddingYAxis:o,children:[e(qp,{children:[t(Dl,{useInline:!0}),t(xa,{currentStep:c,data:Jp,gap:32})]}),t(Jl,{initialInputs:h,children:e(ql,{children:[1===c&&t(Yp,{onStart:b}),2===c&&t(Zs,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(Os,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Xp,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.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")};i(_u),a()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Qp=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),eh=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},th=g.div`
|
|
628
641
|
position: relative;
|
|
629
642
|
display: inline-flex;
|
|
630
|
-
`,
|
|
643
|
+
`,nh=g.button`
|
|
631
644
|
display: inline-flex;
|
|
632
645
|
align-items: center;
|
|
633
646
|
gap: 8px;
|
|
@@ -640,7 +653,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
640
653
|
&:hover {
|
|
641
654
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
642
655
|
}
|
|
643
|
-
`,
|
|
656
|
+
`,oh=g.div`
|
|
644
657
|
position: absolute;
|
|
645
658
|
top: calc(100% + 8px);
|
|
646
659
|
right: 0;
|
|
@@ -653,25 +666,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
653
666
|
border-radius: 12px;
|
|
654
667
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
655
668
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
656
|
-
`,
|
|
669
|
+
`,ah=g.div`
|
|
657
670
|
display: flex;
|
|
658
671
|
flex-direction: column;
|
|
659
672
|
gap: 12px;
|
|
660
673
|
padding: 16px;
|
|
661
674
|
max-height: 60vh;
|
|
662
675
|
overflow-y: auto;
|
|
663
|
-
`,
|
|
676
|
+
`,ih=g.div`
|
|
664
677
|
display: flex;
|
|
665
678
|
align-items: center;
|
|
666
679
|
gap: 8px;
|
|
667
680
|
padding: 12px 16px;
|
|
668
681
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
669
|
-
`,
|
|
682
|
+
`,lh=g.div`
|
|
670
683
|
display: flex;
|
|
671
684
|
align-items: center;
|
|
672
685
|
gap: 8px;
|
|
673
686
|
margin-left: auto;
|
|
674
|
-
`,
|
|
687
|
+
`,rh=()=>{const n=f(),{sourcesApi:l,namespacesApi:s}=gl(),c=l.useSources().items,d=s.useNamespaces().items,{selectedStreamName:u}=qe(),{getItemSS:p,setItemSS:h,removeItemSS:m}=Ea(),{namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:w,clearAll:x,getEmptyState:k}=ka(),T=a(()=>Ta(c,u),[c,u]);o(()=>{const e=p($a.OVERVIEW_FILTERS,k());w(e)},[]);const[$,I]=r({namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[E,A]=r(eh($)),[N,O]=r(!1);o(()=>{if(!N){const e={namespaces:g,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),A(eh(e))}},[N,g,b,v,y,C,S]);const R=i(null);mn(R,()=>O(!1)),jn({key:"Escape",active:N},()=>O(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[d]),P=a(()=>{const e=new Set,t=[];return T.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[T]),F=a(()=>{const e=new Set,t=[];return T.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:We[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[T]),L=a(()=>Ia.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),_=a(()=>{const e=new Set,t=[];return T.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:a}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:Bt(o)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[T]),M=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));I(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},z=N?Ei:Ai,B=a(()=>Qp($.languages),[$.languages]);return e(th,{ref:R,children:[e(nh,{"data-id":"filters-trigger",$isOpen:N,type:"button",onClick:()=>O(e=>!e),children:[t(sl,{size:16,fill:n.v2.colors.white[500]}),t(se,{size:de.XS,weight:500,nowrap:!0,children:"Filters"}),E>0&&t(je,{label:E,status:Re.Unknown,textSize:de.XXXS}),t(z,{size:16,fill:n.v2.colors.silver[200]})]}),N&&e(oh,{children:[e(ah,{children:[t(mt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Qp($.namespaces),setValues:e=>M("namespaces",D,e)}),t(mt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:Qp($.kinds),setValues:e=>M("kinds",P,e)}),t(mt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:B,setValues:e=>M("languages",F,e)}),t(mt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:Qp($.monitors),setValues:e=>M("monitors",L,e)}),t(mt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:Qp($.podsAgentInjectionStatus),setValues:e=>M("podsAgentInjectionStatus",_,e)}),t(oe,{label:"Show only sources with errors",size:kt.L,value:!!$.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(ih,{children:[t(pe,{"data-id":"filters-reset",size:he.S,variant:me.Text,label:"Reset",onClick:()=>{m($a.OVERVIEW_FILTERS),x(),I(k()),A(0),O(!1)},textColor:n.v2.colors.red[500]}),e(lh,{children:[t(pe,{"data-id":"filters-cancel",size:he.S,variant:me.Secondary,label:"Cancel",onClick:()=>O(!1)}),t(pe,{"data-id":"filters-apply",size:he.S,variant:me.Primary,label:"Apply",onClick:()=>{h($a.OVERVIEW_FILTERS,$),w($),A(eh($)),O(!1)}})]})]})]})]})},sh=g.div`
|
|
675
688
|
position: relative;
|
|
676
689
|
display: flex;
|
|
677
690
|
align-items: center;
|
|
@@ -682,7 +695,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
682
695
|
box-sizing: border-box;
|
|
683
696
|
border-radius: 16px 16px 0 0;
|
|
684
697
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
685
|
-
`,
|
|
698
|
+
`,ch=g.div`
|
|
686
699
|
position: absolute;
|
|
687
700
|
bottom: 0;
|
|
688
701
|
left: 0;
|
|
@@ -691,7 +704,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
691
704
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
692
705
|
border-radius: 32px;
|
|
693
706
|
transition: width 0.3s;
|
|
694
|
-
`,
|
|
707
|
+
`,dh=({entityType:n,badge:o,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Zn();return e(sh,{children:[e(ue,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:Aa.S,partiallyChecked:r,value:!!s,onChange:c}),t(se,{size:de.S,nowrap:!0,children:`${Bt(n)}s`}),t(je,{label:o,tooltip:a,status:Re.Unknown,textSize:de.XXXS})]}),e(ue,{children:[t(gt,{"data-id":`add-${n}`,icon:fi,onClick:()=>u(n)}),t(gt,{"data-id":`refresh-${n}`,icon:zi,onClick:l,disabled:i})]}),"number"==typeof d&&t(ch,{$percent:d})]})},uh=g(q)`
|
|
695
708
|
align-items: center !important;
|
|
696
709
|
justify-content: center !important;
|
|
697
710
|
align-self: stretch;
|
|
@@ -706,7 +719,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
706
719
|
&:hover {
|
|
707
720
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
708
721
|
}
|
|
709
|
-
`,
|
|
722
|
+
`,ph=({entityType:n,description:o})=>{const{setCurrentModal:a}=Zn();return e(uh,{onClick:()=>a(n),children:[e(ue,{$gap:4,children:[t(fi,{size:16}),t(se,{size:de.S,children:`Add ${Bt(n)}`})]}),t(se,{size:de.XXS,align:"center",children:o})]})},hh=g.div`
|
|
710
723
|
display: flex;
|
|
711
724
|
align-items: center;
|
|
712
725
|
gap: 12px;
|
|
@@ -721,10 +734,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
721
734
|
&:hover {
|
|
722
735
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
723
736
|
}
|
|
724
|
-
`,
|
|
737
|
+
`,mh=g(ue)`
|
|
725
738
|
flex: 1;
|
|
726
739
|
min-width: 0;
|
|
727
|
-
`,
|
|
740
|
+
`,gh=({entityId:n,entityType:o,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=f(),b=o===wt.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=an(),{selectedSources:w,setSelectedSources:x}=Na(),k=m,T=b?k.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[b,w,T,k.id]),I=v&&!h?Oa(Re.Info,g):l?Oa(l,g):void 0,E=b&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}`:n;return e(hh,{"data-id":E,$faded:y,onClick:()=>{C(o),S(n)},children:[b&&t(Q,{size:Aa.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(cn,{icons:u,icon:d,iconSrc:p}),e(mh,{$gap:4,children:[t(Ee,{size:de.XS,nowrap:!0,children:i}),t(ue,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(ze,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(je,{label:c,status:l&&[Re.Error,Re.Warning].includes(l)?l:Re.Unknown,leftIcon:I,textSize:de.XXXS})})})]})]})};function fh(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Re.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Kt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function bh(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Re.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const vh=g.div`
|
|
728
741
|
position: absolute;
|
|
729
742
|
top: 0;
|
|
730
743
|
left: 0;
|
|
@@ -735,22 +748,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
735
748
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
736
749
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
737
750
|
pointer-events: none;
|
|
738
|
-
`,
|
|
751
|
+
`,yh=g.div`
|
|
739
752
|
display: flex;
|
|
740
753
|
align-items: center;
|
|
741
754
|
gap: 8px;
|
|
742
755
|
padding: 4px 8px 0;
|
|
743
|
-
`,
|
|
756
|
+
`,Ch=g.div`
|
|
744
757
|
flex: 1;
|
|
745
758
|
height: 1px;
|
|
746
759
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
747
|
-
`,
|
|
760
|
+
`,Sh=({namespace:e})=>{const n=f();return t(vh,{children:t(se,{size:de.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},wh=({namespace:n})=>{const o=f();return e(yh,{children:[t(Ch,{}),t(se,{size:de.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(Ch,{})]})},xh={[wt.InstrumentationRule]:Je.NO_DATA_INSTRUMENTATION_RULES,[wt.Source]:Je.NO_DATA_SOURCES,[wt.Action]:Je.NO_DATA_ACTIONS,[wt.Destination]:Je.NO_DATA_DESTINATIONS},kh=g.div`
|
|
748
761
|
display: flex;
|
|
749
762
|
flex-direction: column;
|
|
750
763
|
flex: 1 0 0;
|
|
751
764
|
min-width: 0;
|
|
752
|
-
|
|
753
|
-
`,lh=g.div`
|
|
765
|
+
`,Th=g.div`
|
|
754
766
|
display: flex;
|
|
755
767
|
flex-direction: column;
|
|
756
768
|
align-items: stretch;
|
|
@@ -760,7 +772,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
760
772
|
border-radius: 0 0 16px 16px;
|
|
761
773
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
762
774
|
overflow: hidden;
|
|
763
|
-
|
|
775
|
+
`,$h=g.div`
|
|
764
776
|
position: relative;
|
|
765
777
|
display: flex;
|
|
766
778
|
flex-direction: column;
|
|
@@ -772,7 +784,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
772
784
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
773
785
|
height: ${({$height:e})=>e}px;
|
|
774
786
|
overflow: hidden;
|
|
775
|
-
`,
|
|
787
|
+
`,Ih=(e,t,n)=>{const o=Nt(e);if(!o)return null;const a=t===wt.Source;let i,l,r=!1,s=e;if(a){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Kt.Failure:return{status:Re.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Kt.Notice:return{status:Re.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Kt.Pending:case Kt.Waiting:return{status:void 0,faded:!1,displaySource:fh(e)};case Kt.Unsupported:case Kt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:bh(e)}}}(e);i=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:n}=Da(e.conditions);i=t,r=n}const c=Pa(e,t,{extended:a,prioritizeDisplayName:!a});let d,u,p,h,m;switch(t){case wt.Source:{d=sn(e),u=La(wt.Source);const t=n?.get(Fa(o));h=un(t);break}case wt.Destination:{const t=yt(e.destinationType.type);u=t.icon,p=t.iconSrc;const a=n?.get(Fa(o));h=un(a),m=!e.disabled;break}case wt.Action:u=Ft(e.type),m=!e.disabled;break;case wt.InstrumentationRule:u=Gt(e.type),m=!e.disabled}return{key:Fa(o),entityId:o,namespace:a?e.id.namespace:void 0,raw:s,itemProps:{entityId:o,entityType:t,title:c,status:i,faded:r,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:m,raw:s}}},Eh=({entityType:n,entities:i,unfilteredCount:s,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const h=n===wt.Source,m=i.length!==s,g=$t(e=>h?e.progress[At.Instrumenting]?.percentage:void 0),f=$t(e=>h?e.progress[At.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Na(),C=a(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=a(()=>{if(!c)return;const e=new Map,t=n===wt.Source?c.sources:n===wt.Destination?c.destinations:void 0;if(t)for(const n of t)e.set(Ra(n),n.throughput);return e},[c,n]),w=a(()=>i.map(e=>Ih(e,n,S)).filter(Boolean),[i,n,S]),[x,k]=r(""),{elements:T,indexToNamespace:$,multipleNs:I,dividerCount:E}=a(()=>{const e=[],n=[],o=new Set(w.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const o of w)h&&o.namespace&&o.namespace!==i&&(""!==i&&(n.push(o.namespace),e.push(t(wh,{namespace:o.namespace},`ns-divider-${o.namespace}`)),a+=1),i=o.namespace),n.push(o.namespace||""),e.push(t(gh,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:a}},[w,h]);o(()=>{if(h&&$.length&&!x){const e=$.find(Boolean);e&&k(e)}},[h,$]);const A=l(e=>{if(!$.length)return;const t=$[Math.min(e,$.length-1)];t&&t!==x&&k(t)},[$,x]),N=58*w.length+(I?28:0)+32*E,O=Math.max(0,u-52-16),R=Math.min(O,N)+8,D="number"==typeof b?`${b}%`:m?`${i.length}/${s}`:s;return e(kh,{children:[t(dh,{entityType:n,badge:D,badgeTooltip:m?Je.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,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(Th,{children:i.length?e($h,{$height:R,children:[I&&x&&t(Sh,{namespace:x}),t(on,{gap:4,elements:T,onTopIndexChange:I?A:void 0})]}):d?t(ut,{size:3}):t(ph,{entityType:n,description:xh[n]??Je.TO_COLLECT_OTEL_DATA})})]})},Ah=g.div`
|
|
776
788
|
width: 100%;
|
|
777
789
|
flex: 1;
|
|
778
790
|
min-height: 0;
|
|
@@ -780,10 +792,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
780
792
|
display: flex;
|
|
781
793
|
align-items: stretch;
|
|
782
794
|
gap: 16px;
|
|
783
|
-
`,
|
|
795
|
+
`,Nh={sources:[],destinations:[]},Oh=()=>{const n=ka(),{selectedStreamName:o}=qe(),{containerRef:i,containerHeight:l}=_a(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=gl(),{items:p,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=an(e=>e.drawerType),S=Zn(e=>e.currentModal),{data:w}=u.useMetrics({skip:!(p.length&&m.length&&!C&&!S),pollInterval:1e4,fetchPolicy:"network-only"}),x=w?.getOverviewMetrics??Nh,k=a(()=>Ta(p,o),[p,o]),T=a(()=>Mt(m,o),[m,o]),$=a(()=>Ma(k,n),[k,n]),I=a(()=>za(T,n),[T,n]),E=a(()=>Ba(f,n),[f,n]);return e(Ah,{ref:i,children:[t(Eh,{entityType:wt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(Eh,{entityType:wt.Source,entities:$,unfilteredCount:k.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(Eh,{entityType:wt.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(Eh,{entityType:wt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},Rh="40vw",Dh=g.div`
|
|
784
796
|
position: relative;
|
|
785
|
-
width: ${
|
|
786
|
-
`,
|
|
797
|
+
width: ${Rh};
|
|
798
|
+
`,Ph=g.div`
|
|
787
799
|
position: absolute;
|
|
788
800
|
top: calc(100% + 8px);
|
|
789
801
|
left: 0;
|
|
@@ -792,23 +804,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
792
804
|
flex-direction: column;
|
|
793
805
|
gap: 8px;
|
|
794
806
|
padding: 8px;
|
|
795
|
-
width: calc(${
|
|
807
|
+
width: calc(${Rh} - 16px);
|
|
796
808
|
border-radius: 12px;
|
|
797
809
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
798
810
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
799
|
-
`,
|
|
811
|
+
`,Fh=g.div`
|
|
800
812
|
display: flex;
|
|
801
813
|
align-items: center;
|
|
802
814
|
overflow-x: auto;
|
|
803
|
-
`,
|
|
815
|
+
`,Lh=g.div`
|
|
804
816
|
display: flex;
|
|
805
817
|
flex-direction: column;
|
|
806
818
|
gap: 0;
|
|
807
819
|
max-height: 60vh;
|
|
808
820
|
overflow-y: auto;
|
|
809
|
-
`,
|
|
821
|
+
`,_h=g.div`
|
|
810
822
|
padding: 8px 12px 4px 12px;
|
|
811
|
-
`,
|
|
823
|
+
`,Mh=g.div`
|
|
812
824
|
display: flex;
|
|
813
825
|
align-items: center;
|
|
814
826
|
gap: 8px;
|
|
@@ -818,12 +830,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
818
830
|
&:hover {
|
|
819
831
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
820
832
|
}
|
|
821
|
-
`,
|
|
833
|
+
`,zh=g.div`
|
|
822
834
|
padding: 16px 8px;
|
|
823
|
-
`,
|
|
835
|
+
`,Bh=({preventPopup:n=!1})=>{const o=f(),{onClickNode:l}=Xa(),{searchText:c,setSearchText:d}=ka(),{selectedStreamName:u}=qe(),{sourcesApi:p,destinationsApi:h,actionsApi:m,instrumentationRulesApi:g}=gl(),b=p.useSources().items,v=h.useDestinations().items,y=m.useActions().items,C=g.useRules().items,S=i(null),[w,x]=r(!1),[k,T]=r("all"),$=!n&&(!!c||w),I=()=>{d(""),x(!1),T("all")};mn(S,()=>I()),jn({key:"Escape",active:$},I);const{categories:E,searchResults:A}=a(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,s=a?n.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,c=a?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,d=[{category:wt.Source,label:"Sources",count:r.length,entities:[]},{category:wt.Action,label:"Actions",count:s.length,entities:[]},{category:wt.Destination,label:"Destinations",count:c.length,entities:[]},{category:wt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===wt.InstrumentationRule?l:e.category===wt.Source?r:e.category===wt.Action?s:e.category===wt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:C,sources:Ta(b,u),actions:y,destinations:Mt(v,u),searchText:c,selectedCategory:k}),[C,b,y,v,u,c,k]),N=a(()=>E.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[E]),O=A.some(({entities:e})=>e.length>0);return e(Dh,{ref:S,children:[t(nn,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>x(!0),width:Rh}),$&&e(Ph,{children:[N.length>1&&t(Fh,{children:t(ge,{options:N,selected:k,setSelected:T})}),O?t(Lh,{children:A.map(({category:n,label:a,entities:i},r)=>{if(!i.length)return null;const c=La(n);return e(s,{children:[t(_h,{children:t(se,{size:de.XXS,color:ce.Secondary,children:a})}),i.map((a,i)=>e(Mh,{onClick:()=>{const e=Nt(a);l(null,{data:{type:n,id:e}}),I()},children:[c&&t(c,{size:16,fill:o.v2.colors.white[500]}),t(se,{size:de.XS,nowrap:!0,children:Pa(a,n,{extended:!0})})]},`entity-${r}-${i}`))]},`category-list-${n}`)})}):t(zh,{children:t(Ie,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},Xh=({onRedirectToSampling:o})=>{const{sourcesApi:i}=gl(),{items:l}=i.useSources(),{currentModal:r,setCurrentModal:s}=Zn(),{drawerType:c,drawerEntityId:d,setDrawerType:u,setDrawerEntityId:p}=an(),h=()=>{s("")},m=()=>{u(null),p(null)},g=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),f=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t(Mu,{}),r===wt.Source&&t(Jl,{children:t(Zs,{onClose:h,withOverlay:!0})}),r===wt.Destination&&t(ql,{children:t(Os,{onClose:h,withOverlay:!0})}),r===wt.InstrumentationRule&&t(Ql,{sourceOptions:g,namespaceOptions:f,children:t(Rs,{onClose:h,withOverlay:!0})}),r===wt.Action&&t(Zl,{children:t(Ss,{onClose:h,withOverlay:!0})}),c===wt.Source&&d&&t(er,{children:t(du,{onClose:m,sourceId:d,onRedirectToSampling:o})}),c===wt.Destination&&d&&t(ql,{children:t(oc,{onClose:m,destinationId:d})}),c===wt.InstrumentationRule&&d&&t(Ql,{sourceOptions:g,namespaceOptions:f,children:t(ic,{onClose:m,ruleId:d})}),c===wt.Action&&d&&t(Zl,{children:t(ec,{onClose:m,actionId:d})})]})},Vh=e=>`Data Stream: ${e}`,Uh="Search streams...",Gh="No streams match",Hh=g.div`
|
|
824
836
|
position: relative;
|
|
825
837
|
display: inline-flex;
|
|
826
|
-
`,
|
|
838
|
+
`,jh=g.div`
|
|
827
839
|
display: inline-flex;
|
|
828
840
|
align-items: center;
|
|
829
841
|
gap: 6px;
|
|
@@ -834,7 +846,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
834
846
|
&:hover {
|
|
835
847
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
836
848
|
}
|
|
837
|
-
`,
|
|
849
|
+
`,Wh=g.div`
|
|
838
850
|
position: absolute;
|
|
839
851
|
top: calc(100% + 8px);
|
|
840
852
|
left: 0;
|
|
@@ -848,18 +860,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
848
860
|
border-radius: 12px;
|
|
849
861
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
850
862
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
851
|
-
`,
|
|
863
|
+
`,Kh=g.div`
|
|
852
864
|
display: flex;
|
|
853
865
|
align-items: center;
|
|
854
866
|
gap: 8px;
|
|
855
867
|
width: 100%;
|
|
856
|
-
`,
|
|
868
|
+
`,Yh=g.div`
|
|
857
869
|
display: flex;
|
|
858
870
|
flex-direction: column;
|
|
859
871
|
gap: 0;
|
|
860
872
|
max-height: 240px;
|
|
861
873
|
overflow-y: auto;
|
|
862
|
-
`,
|
|
874
|
+
`,Jh=g.div`
|
|
863
875
|
display: flex;
|
|
864
876
|
align-items: center;
|
|
865
877
|
gap: 8px;
|
|
@@ -870,29 +882,29 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
870
882
|
&:hover {
|
|
871
883
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
872
884
|
}
|
|
873
|
-
`,
|
|
885
|
+
`,qh=g.div`
|
|
874
886
|
flex: 1;
|
|
875
887
|
min-width: 0;
|
|
876
888
|
overflow: hidden;
|
|
877
889
|
text-overflow: ellipsis;
|
|
878
890
|
white-space: nowrap;
|
|
879
|
-
`,
|
|
891
|
+
`,Zh=g.div`
|
|
880
892
|
display: flex;
|
|
881
893
|
align-items: center;
|
|
882
894
|
gap: 2px;
|
|
883
895
|
flex-shrink: 0;
|
|
884
|
-
`,
|
|
896
|
+
`,Qh=g.div`
|
|
885
897
|
display: flex;
|
|
886
898
|
padding-top: 4px;
|
|
887
899
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
888
|
-
`,
|
|
900
|
+
`,em=()=>{const l=f(),{isVm:s}=y(),{clearStore:c}=Va(),{dataStreamsApi:d}=gl();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=qe(),m=i(null),[g,b]=r(!1),[v,C]=r(""),[S,w]=r(""),[x,k]=r(!1),[T,$]=r(!1),[I,E]=r(!1),[A,N]=r(""),[O,R]=r(!1);mn(m,()=>b(!1)),o(()=>{g||C("")},[g]);const D=a(()=>{if(!v)return u;const e=v.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,v]),P=g?Ei:Ai;return s?null:e(n,{children:[e(Hh,{ref:m,children:[e(jh,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>b(e=>!e),children:[t(cl,{size:24}),t(se,{size:de.S,weight:500,nowrap:!0,children:Vh(p)}),t(je,{label:u.length,status:Re.Unknown,textSize:de.XXXS}),t(P,{size:20,fill:l.v2.colors.silver[200]})]}),g&&e(Wh,{children:[t(Kh,{children:t(nn,{value:v,onChange:C,placeholder:Uh,width:"100%"})}),t(Yh,{children:0===D.length?t(Jh,{children:t(se,{size:de.XS,color:ce.Secondary,children:Gh})}):D.map(({name:n})=>{const o=n===Ua;return e(Jh,{"data-id":`stream-row-${n}`,$selected:n===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),b(!1)})(n),children:[t(qh,{children:t(se,{size:de.XS,nowrap:!0,children:n})}),e(Zh,{children:[t(gt,{"data-id":`stream-edit-${n}`,icon:wi,size:ft.XS,onClick:e=>{e.stopPropagation(),b(!1),w(n),k(!0)}}),!o&&t(gt,{"data-id":`stream-delete-${n}`,icon:gi,size:ft.XS,onClick:e=>{e.stopPropagation(),b(!1),N(n),R(!0)}})]})]},`stream-${n}`)})}),t(Qh,{children:t(pe,{"data-id":"add-stream-trigger",variant:me.Secondary,size:he.S,leftIcon:fi,label:`${Rt.NEW} ${Je.STREAM_NAME}`,fullWidth:!0,onClick:()=>{b(!1),c(),E(!0),$(!0)}})})]})]}),I&&t(tr,{defaultExcludeName:p,children:t(Du,{isOpen:T,onClose:()=>$(!1),onCloseEnd:()=>E(!1)})}),S&&t(tr,{children:t(Pu,{isOpen:x,dataStreamName:S,onClose:()=>k(!1),onCloseEnd:()=>w("")})}),t(Nl,{target:`${Je.STREAM_NAME.toLowerCase()} "${A}"`,isOpen:O,onClose:()=>R(!1),onApprove:async()=>{A&&await d.remove(A)}})]})},tm="multi-source-deselect",nm="multi-source-restart",om="multi-source-uninstrument",am="Selected sources",im="Deselect",lm="Restart",rm="Uninstrument",sm="Rollout Restart Workloads",cm="Are you sure you want to rollout restart these workloads?",dm="Go Back",um="Confirm",pm=()=>{const{selectedStreamName:i}=qe(),{selectedSources:s,setSelectedSources:c}=Na(),{sourcesApi:d}=gl(),[u,p]=r(!1),[h,m]=r(!1),g=a(()=>Object.values(s).reduce((e,t)=>e+t.length,0),[s]),f=l(()=>{c({})},[c]),b=l(()=>p(!1),[]),v=l(()=>m(!1),[]);o(()=>{f()},[i,f]);const y=l(()=>{d.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==dn.StaticPod).map(ln)),f()},[d,s,f]),C=l(()=>{d.persistV2(Object.fromEntries(Object.entries(s).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:i}))]))),f()},[d,s,i,f]),S=a(()=>[{id:tm,type:tn.Button,buttonProps:{variant:me.Text,size:he.S,label:im,onClick:f}},{id:nm,type:tn.Button,buttonProps:{variant:me.Secondary,size:he.S,label:lm,leftIcon:Qi,onClick:()=>p(!0)}},{id:om,type:tn.Button,buttonProps:{variant:me.Primary,size:he.S,label:rm,leftIcon:gi,onClick:()=>m(!0)}}],[f]);return e(n,{children:[t(xn,{isOpen:g>0,richTitle:{icon:Di,title:am,badge:{label:g}},actions:S}),t(Ye,{isOpen:u,title:sm,description:cm,onClose:b,denyButton:{label:dm,variant:me.Secondary,onClick:b},approveButton:{label:um,variant:me.Primary,onClick:()=>{y(),b()}}}),t(Nl,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},hm=v`
|
|
889
901
|
0% {
|
|
890
902
|
background-position: 200% 50%;
|
|
891
903
|
}
|
|
892
904
|
100% {
|
|
893
905
|
background-position: 0% 50%;
|
|
894
906
|
}
|
|
895
|
-
`,
|
|
907
|
+
`,mm=g.div`
|
|
896
908
|
display: flex;
|
|
897
909
|
align-items: center;
|
|
898
910
|
justify-content: space-evenly;
|
|
@@ -903,50 +915,50 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
903
915
|
|
|
904
916
|
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%)`};
|
|
905
917
|
background-size: 200% 100%;
|
|
906
|
-
animation: ${
|
|
907
|
-
`,
|
|
918
|
+
animation: ${hm} 15s linear infinite;
|
|
919
|
+
`,gm=[Ri,Di,$i,Ii],fm=({onRedirectToSampling:n})=>{const o=f();return e(wa,{children:[e(lt,{fullHeight:!0,customTitle:t(em,{}),customSearch:t(Bh,{}),filters:t(rh,{}),children:[t(mm,{children:gm.map((n,a)=>e(s,{children:[t(n,{size:24}),a<gm.length-1&&t(Ti,{fill:o.v2.colors.white[500]+st["020"],size:24})]},n.name))}),t(Oh,{})]}),t(Xh,{onRedirectToSampling:n}),t(pm,{})]})};var bm;!function(e){e.Gateway="gateway",e.Node="node"}(bm||(bm={}));const vm=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return n&&e.push({id:qn(),type:tn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Zi,size:he.S,variant:me.Text,onClick:n,disabled:l}}),o&&e.push({id:qn(),type:tn.Button,buttonProps:{label:"Refresh",leftIcon:zi,size:he.S,variant:me.Text,onClick:o,disabled:l,loading:i}}),e},[n,o,l,i]);return e(ue,{$alignItems:"center",$justifyContent:"space-between",children:[t(Ga,{icon:dl,title:"Collectors Pipeline"}),t(Ha,{actions:r})]})},ym=({pod:n,onClose:o})=>{const{formatTimeAgo:i}=Ht(),{collectorsApi:l}=gl(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=a(()=>[{id:qn(),title:"Node",label:r?.node??"-",withCopy:!0},{id:qn(),title:"Status",badge:{status:ja(r?.status),label:r?.status??"-"}}],[r]),c=a(()=>r?.containers?.map(e=>({id:qn(),items:[{id:qn(),title:"Container",label:e.name??"-"},{id:qn(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:qn(),title:"Ready",badge:{status:e.ready?Re.Success:Re.Error,leftIcon:e.ready?vi:yi,label:e.ready?"True":"False",invertColors:!0}},{id:qn(),title:"Started",badge:{status:e.started?Re.Success:Re.Error,leftIcon:e.started?vi:yi,label:e.started?"True":"False",invertColors:!0}},{id:qn(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:qn(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:qn(),title:Je.RESTARTS,label:e.restarts.toString()},{id:qn(),title:"State Reason",label:e.stateReason??"-"},{id:qn(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:qn(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(le,{isOpen:!!n,header:{icon:Li,title:"Pod Information",onClose:o},children:r?e(Dt,{bgTint:"1000",richTitle:{icon:Li,title:r.name,withCopy:!0},children:[t(Dt,{bgTint:"900",cellsPerRow:2,items:s}),e(Dt,{bgTint:"900",richTitle:{icon:Hi,title:Je.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(en,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(en,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(en,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Dt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Dt,{bgTint:"800",cellsPerRow:2,items:n},e)):t(Ie,{title:"No containers",subTitle:"Pod has no containers"})}),t(Rl,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(pt,{$height:"50vh",children:t(bt,{withSpinner:!0})})})};var Cm;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(Cm||(Cm={}));const Sm=e=>{const t=[{key:Cm.PodName,label:"Pod Name"},{key:Cm.Status,label:"Status"},{key:Cm.Restarts,label:Je.RESTARTS},{key:Cm.NodeName,label:"Node Name"},{key:Cm.Age,label:"Age"},{key:Cm.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Cm.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},wm=({isLoading:n,pods:o,withSpanDropRate:i})=>{const l=f(),{formatTimeAgo:s}=Ht(),[c,d]=r(null),u=a(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:Cm.PodName,rawValue:n.name},{key:Cm.Status,rawValue:n.status,component:()=>{return e=n.status,t(je,{status:ja(e),label:e});var e}},{key:Cm.Restarts,rawValue:n.restartsCount.toString()},{key:Cm.NodeName,rawValue:n.nodeName},{key:Cm.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(se,{children:"-"});const a=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),i=a>0?Math.round((o?.metricsDroppedRps??0)/a*100):0,l=i>0?Re.Error:Re.Success,r=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),s=r>0?Math.round((o?.exporterFailedRps??0)/r*100):0,c=s>0?Re.Error:Re.Success;return e(ue,{$gap:4,children:[t(ze,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(je,{status:l,label:`Receiver ${i}%`,leftIcon:l===Re.Error?ul:pl,useSecondaryTone:!0,invertColors:!0})}),t(ze,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(je,{status:c,label:`Exporter ${s}%`,leftIcon:c===Re.Error?ul:pl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Cm.Age,rawValue:s(n.creationTimestamp)},{key:Cm.DockerImage,rawValue:n.image}]})),[o,l]);return e(Dt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Li,title:"Pods"},children:[t(Sn,{variant:wn.Data,isLoading:n,columns:Sm(i),rows:u}),t(ym,{pod:c,onClose:()=>d(null)})]})},xm=({isOpen:e,onClose:n,title:o,yaml:a})=>t(le,{isOpen:e,header:{icon:hl,title:o,onClose:n},children:t(Rl,{yaml:a,defaultOpen:!0})}),km=e=>{switch(e){case Wa.Healthy:return"All desired replicas are updated, available, and ready";case Wa.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Wa.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Wa.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Wa.Down:return"No available replicas";case Wa.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Tm;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Tm||(Tm={}));const $m=g.div`
|
|
908
920
|
flex: 0.5;
|
|
909
921
|
padding: 12px;
|
|
910
922
|
border-radius: 12px;
|
|
911
923
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
912
|
-
`,
|
|
924
|
+
`,Im=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:s}=Ht(),[c,d]=r(null),u=a(()=>(e=>{switch(e){case bm.Gateway:return"Deployment";case bm.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),p=a(()=>((e,t,n,o)=>{const a={status:Re.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case bm.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case bm.Node:i=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return a}return i?{status:Re.Info,label:"Rollout in progress",rightIcon:zi,useSecondaryTone:!0}:l?{status:Re.Disabled,label:`Last Rollout: ${o(l)}`}:a})(n,o,i,s),[o,i,n,s]),h=a(()=>((e,t,n,o)=>{let a=o?Re.Info:Re.Unknown,i=o?"Loading":Wa.Unknown,l=o?"Fetching data...":km(Wa.Unknown);switch(e){case bm.Gateway:a=t?.status?ja(t?.status):a,i=t?.status??i,l=t?.status?km(t.status):l;break;case bm.Node:a=n?.status?ja(n?.status):a,i=n?.status??i,l=n?.status?km(n.status):l}return{status:a,title:i,description:l}})(n,o,i,l),[o,i,n,l]),m=a(()=>((e,t,n)=>{switch(e){case bm.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 bm.Node:return[{gaugeWidth:128,min:0,max:n?.nodes?.desired??0,current:n?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(n,o,i),[o,i,n]),g=a(()=>((e,t,n,o)=>{switch(e){case bm.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:o}]}];case bm.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:o}]}];default:return[]}})(n,o,i,l),[o,i,n,l]),f=a(()=>(n===bm.Gateway?o?.manifestYAML:i?.manifestYAML)??"",[o,i,n]),b=a(()=>(n===bm.Gateway?o?.configMapYAML:i?.configMapYAML)??"",[o,i,n]);return e(Dt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:hl,title:u,badge:p},actions:[{id:qn(),type:tn.ButtonDropData,buttonProps:{variant:me.Secondary,size:he.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Tm.ManifestYaml,label:u,icon:ml},{id:Tm.ConfigMapYaml,label:"ConfigMap",icon:ml}]}}],children:[e(ue,{$gap:16,children:[t("div",{children:t(Ka,{...h})}),m.map(e=>t($m,{children:t("div",{children:t(Ya,{...e})})},e.title)),g.map(e=>t(Ja,{...e},e.title))]}),t(xm,{isOpen:c===Tm.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(xm,{isOpen:c===Tm.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Em=[{value:bm.Gateway,label:"Gateway"},{value:bm.Node,label:"Node Collector"}],Am=({minSupportedVersion:n=0})=>{const{isVersionSupported:o,version:i}=y(n),[s,c]=r(bm.Gateway),d=s===bm.Gateway,u=s===bm.Node,{collectorsApi:p,configApi:h}=gl(),{data:m}=h.useEffectiveConfig(),{data:g,loading:f,refetch:b}=p.useGatewayInfo({skip:!d}),{data:v=[],loading:C,refetch:S}=p.useGatewayPods({skip:!d}),{data:w,loading:x,refetch:k}=p.useNodeCollectorInfo({skip:!u}),{data:T=[],loading:$,refetch:I}=p.useNodeCollectorPods({skip:!u}),E=d&&(f||C)||u&&(x||$),A=l(()=>{d?(b(),S()):u&&(k(),I())},[d,u,b,S,k,I]),N=a(()=>d?v:T,[v,T,d]);return e(wa,{children:[t(vm,{disabled:!o,loading:E,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e(qa,{children:[e(q,{children:[t(ge,{variant:yn.Underline,size:Ae.L,options:Em,selected:s,setSelected:c}),t(Im,{selectedTab:s,gatewayInfo:g??null,nodeCollectorInfo:w??null,isLoading:E})]}),t(wm,{isLoading:E,pods:N,withSpanDropRate:!1===m?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(Fl,{minSupportedVersion:n,currentVersion:i||""})]})]})},Nm=g.div`
|
|
913
925
|
display: inline-flex;
|
|
914
926
|
align-items: center;
|
|
915
927
|
min-width: 0;
|
|
916
928
|
overflow: hidden;
|
|
917
929
|
white-space: pre;
|
|
918
930
|
text-overflow: ellipsis;
|
|
919
|
-
`,
|
|
931
|
+
`,Om=g.div`
|
|
920
932
|
display: flex;
|
|
921
933
|
flex-direction: column;
|
|
922
934
|
gap: 4px;
|
|
923
935
|
min-width: 0;
|
|
924
936
|
flex: 1;
|
|
925
937
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
926
|
-
`,
|
|
938
|
+
`,Rm=g(ue)`
|
|
927
939
|
flex-shrink: 0;
|
|
928
940
|
gap: 6px;
|
|
929
941
|
align-items: center;
|
|
930
942
|
min-height: 22px;
|
|
931
|
-
`;const
|
|
943
|
+
`;const Dm=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Pm=[{value:"all",label:Qa},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Fm=({title:n,items:o,isLoading:i,showTypeFilter:s,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=f(),[m,g]=r(""),[b,v]=r("all"),y=a(()=>{let e=function(e,t,n){return n&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(o,b,s);return e=function(e,t){if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),o=e.summary.map(e=>e.text).join("").toLowerCase();return t||o.includes(n)})}(e,m),e},[o,b,s,m]),C=a(()=>y.map(n=>{const o=n.typeBadge?function(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(Om,{$disabled:n.disabled,children:[t(Nm,{children:t(S,{parts:n.summary})}),n.name&&t(se,{size:de.XXS,color:ce.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(Rm,{children:[n.disabled&&t(je,{label:Za,textSize:de.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(je,{label:n.typeBadge,textSize:de.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>c(n)}}),[y,h,c]),w=a(()=>{const e=e=>t(Si,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=l(e=>{const t=C.indexOf(e);if(t<0)return[];const n=y[t];return n?[{id:"edit","data-id":"sampling-rule-action-edit",label:En,leftIcon:wi,onClick:()=>u(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>p(n.ruleId,n.samplingId)}]:[]},[C,y,u,p,w]);return t(lt,{fullHeight:!0,richTitle:{icon:tl,title:n,badge:{label:o.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...s?{segment:{"data-id":"sampling-segment-type-filter",options:Pm,selected:b,setSelected:v}}:{}},children:t(Sn,{variant:wn.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:ei,subTitle:oi(m)}:{hideIcon:!0,title:ni,button:{label:ti,onClick:d}},columns:Dm,rows:C,getRowActions:x})})},Lm=({docsUrl:n})=>{const{samplingApi:s,sourcesApi:c}=gl(),{items:d}=c.useSources(),u=a(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:m,refetch:g}=s.useSamplingRules(),f=l((e,t)=>s.createNoisy?.({samplingId:e,rule:t}),[s]),b=l((e,t,n)=>s.updateNoisy?.(t,{samplingId:e,rule:n}),[s]),v=l((e,t)=>s.createHighlyRelevant?.({samplingId:e,rule:t}),[s]),y=l((e,t,n)=>s.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[s]),C=l((e,t)=>s.createCostReduction?.({samplingId:e,rule:t}),[s]),S=l((e,t,n)=>s.updateCostReduction?.(t,{samplingId:e,rule:n}),[s]),w=l((e,t,n)=>"noisy"===n?s.deleteNoisy?.(t,e):"highlyRelevant"===n?s.deleteHighlyRelevant?.(t,e):"costReduction"===n?s.deleteCostReduction?.(t,e):void 0,[s]),x=l((e,t)=>s.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[s]),k=a(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[u]),T=a(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[$,I]=r(R.Noisy),[E,O]=r(null),[J,Z]=r(!1),[Q,ee]=r(!1),[te,ne]=r(null),[oe,ae]=r(!1),[ie,le]=r(!1),[re,se]=r(!1),[ce,de]=r(!1);i(!1),o(()=>{},[h,p]);const{pendingViewSamplingRule:fe,setPendingViewSamplingRule:be}=an();o(()=>{if(!fe)return;if(h||0===p.length)return;be(null);const e=D(p,fe.ruleId,fe.category);e&&(I(P[fe.category]),Z(!1),O(e))},[h,p,fe,be]);const ve=a(()=>A(m),[m]),ye=a(()=>F(p),[p]),Ce=a(()=>N(ye?.rule??null),[ye]),Se=a(()=>L(p),[p]),we=a(()=>_(Se?.rule??null),[Se]),xe=i(E);xe.current=E,o(()=>{const e=xe.current;if(!e)return;const t=M(p,e);t?O(t):(O(null),Z(!1))},[p]);const ke=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Te=a(()=>z(p,$,ke),[p,$,ke]),$e=l(()=>ee(!0),[]),Ie=l(()=>ee(!1),[]);l(()=>de(!1),[]);const Ee=l(async e=>{const t=p[0]?.id??"default";switch(H[$]){case"noisy":await f(t,V(e));break;case"highlyRelevant":await v(t,X(e));break;case"costReduction":await C(t,B(e))}ee(!1)},[p,$,f,v,C]),Ne=l(e=>{const t=U(p,e);t&&(Z(!1),O(t))},[p]),De=l(()=>{O(null),Z(!1)},[]),Pe=l((e,t)=>{const n=E;if(n&&n.rule.ruleId===e&&n.samplingId===t)Z(!0),O({...n});else for(const n of p){if(n.id!==t)continue;const o=[...n.noisyOperations.map(e=>({category:"noisy",rule:e})),...n.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...n.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return Z(!0),void O({category:o.category,rule:o.rule,samplingId:t,summary:G(o.category,o.rule)})}},[E,p]),Fe=l(async(e,t,n)=>{const o=E?.category;if(o){switch(o){case"noisy":await b(n,t,V(e));break;case"highlyRelevant":await y(n,t,X(e));break;case"costReduction":await S(n,t,B(e))}Z(!1)}},[E,b,y,S]),Le=l((e,t)=>{ne({ruleId:e,samplingId:t})},[]),_e=l(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,n=E?.category||H[$];await w(t,e,n),O(null),Z(!1),ne(null)},[te,E,$,w]),Me=l(()=>ne(null),[]),ze=l(async(e,t)=>{await x(e,t),ae(!1)},[x]),Be=l(async e=>{const t=p[0]?.id??"default",n=ye;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}),le(!1)},[p,ye,v,y]),Xe=l(async(e,t)=>{const n=p[0]?.id??"default",o=Se;o?await S(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:o.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[p,Se,C,S]),Ve=l(e=>{const t=H[$];let n=null;switch(t){case"noisy":{const o=V(e);n=j(p,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=X(e);n=j(p,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=B(e);n=j(p,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:ai,ruleId:n}:null},[p,$]),Ue=l(e=>{const t=E?.category,n=E?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const a=V(e);o=j(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},n);break}case"highlyRelevant":{const a=X(e);o=j(p,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},n);break}case"costReduction":{const a=B(e);o=j(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},n);break}}return o?{message:ai,ruleId:o}:null},[p,E]),Ge=l(e=>{ee(!1);for(const t of p){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 Z(!0),void O({category:n.category,rule:n.rule,samplingId:t.id,summary:G(n.category,n.rule)})}},[p]),He=a(()=>{const e=[];return n&&e.push({id:qn(),type:tn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:ii,leftIcon:Ci,size:he.S,variant:me.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:qn(),type:tn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:li,leftIcon:zi,size:he.S,variant:me.Text,onClick:g,loading:h}}),e.push({id:qn(),type:tn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ri,rightIcon:fi,size:he.S,variant:me.Primary,onClick:$e}}),e},[n,g,h,$e]);return e(wa,{children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(Ga,{icon:tl,title:ci,subTitle:si}),t(Ha,{actions:He})]}),e(q,{$gap:12,$fullHeight:!0,children:[t(ge,{variant:yn.Underline,size:Ae.L,options:W,selected:$,setSelected:I}),e(ue,{$justifyContent:"space-between",children:[t(Oe,{status:Re.Default,message:K[$]}),n&&t(pe,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ci,size:he.S,variant:me.Text,onClick:()=>window.open(n,"_blank")})]}),$===R.Noisy?t(Cl,{title:ot,summary:ve,onEdit:()=>ae(!0)}):$===R.HighlyRelevant?t(Cl,{title:Ze,summary:Ce,onEdit:()=>le(!0)}):$===R.CostReduction?t(Cl,{title:tt,summary:we,onEdit:()=>se(!0)}):null,t(Fm,{title:Y[$],items:Te,isLoading:h,showTypeFilter:$===R.HighlyRelevant,onRuleClick:Ne,onCreateRule:$e,onEditRule:Pe,onDeleteRule:Le})]}),t(xu,{formType:Ul.View,data:E,defaultEditMode:J,onClose:De,onDelete:Le,onSaveEdit:Fe,sourceOptions:k,namespaceOptions:T,validateForm:Ue,onNavigateToDuplicate:Ge}),t(xu,{formType:Ul.Create,isOpen:Q,category:H[$],onClose:Ie,onSubmit:Ee,sourceOptions:k,namespaceOptions:T,validateForm:Ve,onNavigateToDuplicate:Ge}),t(xu,{formType:Ul.EditAutoNoisy,isOpen:oe,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ae(!1),onSave:ze}),t(xu,{formType:Ul.EditAutoHighlyRelevant,isOpen:ie,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(xu,{formType:Ul.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(Ye,{title:hi,description:pi,isOpen:!!te,onClose:Me,denyButton:{label:ui,variant:me.Secondary,onClick:Me},approveButton:{label:di,variant:me.Primary,onClick:()=>{_e(),Me()}}}),false]})},_m=g.div`
|
|
932
944
|
display: flex;
|
|
933
945
|
align-items: center;
|
|
934
946
|
justify-content: space-between;
|
|
935
947
|
padding: 0 12px;
|
|
936
|
-
`,
|
|
948
|
+
`,Mm=({disabled:n,loading:o,tabs:i,selectedTab:l,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[u,p]=r(!1),h=a(()=>{const e=[];return c&&e.push({id:qn(),type:tn.Button,buttonProps:{label:"Reset",leftIcon:gi,size:he.S,variant:me.Text,onClick:()=>p(!0),disabled:n}}),d&&e.push({id:qn(),type:tn.Button,buttonProps:{label:"Refresh",leftIcon:zi,size:he.S,variant:me.Text,onClick:d,disabled:n,loading:o}}),e},[n,o,d]);return e(_m,{children:[e(ue,{$gap:12,$alignItems:"center",children:[t(Ga,{icon:Fi,title:"Odigos Settings"}),t(mt,{width:"350px",options:i,values:[l],setValues:e=>s(e[0]),disabled:n})]}),t(Ha,{actions:h}),t(Ye,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:me.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:me.Primary,onClick:()=>{c?.(),p(!1)}}})]})},zm=g(ue)`
|
|
937
949
|
flex: 1;
|
|
938
950
|
min-height: 0;
|
|
939
951
|
width: 100%;
|
|
940
952
|
align-self: stretch;
|
|
941
|
-
`,
|
|
953
|
+
`,Bm=g(q)`
|
|
942
954
|
flex: 1;
|
|
943
955
|
min-height: 0;
|
|
944
956
|
height: 100%;
|
|
945
957
|
overflow-y: auto;
|
|
946
|
-
`,
|
|
958
|
+
`,Xm=g(Bm)`
|
|
947
959
|
> section {
|
|
948
960
|
min-height: 100%;
|
|
949
961
|
box-sizing: border-box;
|
|
950
962
|
flex-shrink: 0;
|
|
951
963
|
}
|
|
952
|
-
`,
|
|
964
|
+
`,Vm=e=>"general"===e.name?0:"advanced"===e.name?2:1,Um=({minSupportedVersion:n=0})=>{const{isVersionSupported:i,version:l,isEnterprise:s}=y(n),{configApi:c}=gl(),{data:d,loading:u}=c.useConfigYamls(),{data:p,loading:h,refetch:m}=c.useEffectiveConfig(),g=d?.configYamls??[],[f,b]=r(!1),v=async()=>{c.resetLocalUiConfigToDefaults&&await c.resetLocalUiConfigToDefaults()},C=a(()=>{if(!p)return{};const{manifestYAML:e,provenance:t,...n}=p;return n},[p]),{formData:S,handleFormChange:w,getNestedValue:x,getFormDiff:k,isFormDirty:T}=Lt(C);o(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(S)&&w(void 0,void 0,C)},[C,S]);const $=a(()=>[...g].sort((e,t)=>Vm(e)-Vm(t)),[g]),I=a(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(p?.provenance),[p?.provenance]),E=a(()=>{const e=new Set;for(const t of g)for(const n of t.fields)n.componentType===ke.Dropdown&&e.add(n.helmValuePath);return e},[g]),A=a(()=>g.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:x("formData",e.helmValuePath)}))),[g,S,x]),[N,O]=r(!1),R=async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const o=t[n];o in e&&"object"==typeof e[o]&&null!==e[o]||(e[o]={}),e=e[o]}e[t[t.length-1]]=n},o=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=o;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&n(o,t,a.replaceAll("-","_"))}return o})(k(C,S),E);await(async e=>{c.updateLocalUiConfig&&(b(!0),await c.updateLocalUiConfig(e),b(!1),await m())})(e),w(void 0,void 0,{})},D=a(()=>[{id:qn(),type:tn.Button,buttonProps:{"data-id":"settings-save",variant:me.Primary,size:he.S,label:"Save Changes",leftIcon:Ni,loading:f,onClick:()=>O(!0)}},{id:qn(),type:tn.Button,buttonProps:{"data-id":"settings-cancel",variant:me.Secondary,size:he.S,label:"Cancel",leftIcon:Oi,onClick:()=>w(void 0,void 0,C)}}],[f,k,C,S,w]),P=a(()=>$.map(e=>({id:e.name,label:e.displayName})),[$]),F=a(()=>$.map(e=>e.name),[$]),{selectedSection:L,setSelectedSection:_,setSectionRef:M,setScrollContainerRef:z}=mi({sectionNames:F});return e(wa,{$gap:12,children:[t(Mm,{disabled:!i,loading:u||h,tabs:P,selectedTab:L,setSelectedTab:_,onClickReset:v?()=>v().then(()=>m?.()):void 0,onClickRefresh:m?()=>m():void 0}),e(qa,{children:[!i&&t(Fl,{minSupportedVersion:n,currentVersion:l||""}),t(xn,{isOpen:T,richTitle:{icon:Fi,title:"Config Settings"},actions:D}),t(Ye,{isOpen:N,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:()=>O(!1),denyButton:{label:"Keep editing",variant:me.Secondary,onClick:()=>O(!1)},approveButton:{label:"Save changes",variant:me.Primary,onClick:()=>{R(),O(!1)}}}),e(zm,{$gap:24,$alignItems:"stretch",children:[t(Bm,{ref:z,$gap:24,$width:"100%",children:g.length?$.map(n=>t(lt,{id:n.name,ref:e=>M(n.name,e),richTitle:{icon:Fi,title:n.displayName},children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!s)return null;if(n.renderCondition&&!xe(n.renderCondition,[],A))return null;const o=Te(n.componentProps||"{}",{}),a=I[n.helmValuePath];return e(q,{$gap:4,children:[t(fl,{componentType:n.componentType,inputType:o.type,name:n.helmValuePath,label:n.displayName,tooltip:n.description,badge:a?{status:"odigos-local-ui-config"===a?Re.Warning:Re.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:n.isHelmOnly||f,value:x("formData",n.helmValuePath),setValue:e=>w(n.helmValuePath,e),dropdownOptions:o.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},n.helmValuePath),n.isHelmOnly?t(Oe,{status:Re.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},n.helmValuePath)})},n.name)):u?t(pt,{$height:"30vh",children:t(bt,{withSpinner:!0})}):t(lt,{richTitle:{icon:Fi,title:"Config Settings"},children:t(Ie,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(Xm,{children:h&&!p?.manifestYAML?t(pt,{$height:"30vh",children:t(bt,{withSpinner:!0})}):t(Rl,{title:"Effective Config YAML",yaml:p?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0})})]})]})]})};export{Ss as AddActionDrawer,Kr as AddActionForm,Du as AddDataStreamModal,Os as AddDestinationDrawer,qr as AddDestinationForm,Rs as AddRuleDrawer,is as AddRuleForm,Zs as AddSourceDrawer,Mp as CentralConnections,rs as DataStreamForm,ls as DataStreamMergeWarning,ec as EditActionDrawer,tc as EditConfigDrawer,Pu as EditDataStreamModal,oc as EditDestinationDrawer,ic as EditRuleDrawer,du as EditSourceDrawer,ss as EditSourceForm,_u as ONBOARDING_DONE_MODAL_ID,Zp as Onboarding,Mu as OnboardingDone,fm as Overview,Am as PipelineCollectors,$r as RegexTesterDrawer,Rp as SamplingOnboardingModal,xu as SamplingRuleDrawer,ms as SamplingRuleForm,Lm as SamplingRules,Um as Settings,Ru as SystemDrawer,Em as TABS};
|