@odigos/ui-kit 0.0.248 → 0.0.249
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/chunks/{helpers-LpbP8L0p.js → helpers-IEFhGXc7.js} +1 -1
- package/lib/chunks/{index-BuxeIAvf.js → index-CRKgHzab.js} +7 -7
- package/lib/chunks/{source-instrument-form-context-BlL_U41q.js → source-instrument-form-context-DjIHPYQJ.js} +1 -1
- package/lib/chunks/{ui-components-DNIrc4p5.js → ui-components-DODwSdKu.js} +1 -1
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/v2.js +133 -168
- package/lib/containers.js +1 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +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.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
package/lib/containers/v2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as a,useRef as i,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as a,useRef as i,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as T,S as k,f as $,e as E,a as I,r as N,h as A,j as O,k as D,l as R,o as P,p as F,q as L,s as _,t as z,w as B,x as M}from"../chunks/helpers-IEFhGXc7.js";import{q as X,R as V,U,V as H,W as G,X as j,Y as W,Z as K,_ as Y,$ as J,f as q,a0 as Z,b as Q,a1 as ee,c as te,F as oe,a2 as ne,a3 as ae,a4 as ie,a5 as le,a6 as re,a7 as se,a8 as ce,a9 as de,aa as ue,ab as pe,i as he,r as ge,ac as me,ad as fe,ae as be,af as ve,ag as ye,ah as Ce,n as Se,S as we,B as xe,G as Te,z as ke,ai as $e,aj as Ee,ak as Ie,J as Ne,al as Ae,L as Oe,M as De,K as Re,O as Pe,am as Fe,an as Le,ao as _e,ap as ze,D as Be,w as Me,aq as Xe,ar as Ve,as as Ue,at as He,au as Ge,av as je,aw as We,ax as Ke,ay as Ye,az as Je,aA as qe,A as Ze,aB as Qe,y as et,aC as tt,aD as ot,aE as nt,aF as at,aG as it,aH as lt,p as rt,C as st,j as ct,I as dt,E as ut,aI as pt,T as ht,aJ as gt,aK as mt,aL as ft,aM as bt,aN as vt,aO as yt,aP as Ct,aQ as St,aR as wt,aS as xt,aT as Tt,aU as kt,o as $t,aV as Et,H as It,aW as Nt,aX as At,aY as Ot,l as Dt,v as Rt,aZ as Pt,a_ as Ft,a$ as Lt,b0 as _t,b1 as zt,b2 as Bt,b3 as Mt,b4 as Xt,b5 as Vt,b6 as Ut,b7 as Ht,b8 as Gt,b9 as jt,ba as Wt,bb as Kt,bc as Yt,bd as Jt,be as qt,g as Zt,d as Qt,bf as eo,Q as to,bg as oo,bh as no,bi as ao,bj as io,bk as lo,bl as ro,bm as so,bn as co,bo as uo,bp as po,bq as ho,br as go,bs as mo,bt as fo,bu as bo,bv as vo,bw as yo,bx as Co,by as So,bz as wo,bA as xo,bB as To,bC as ko,bD as $o,bE as Eo,bF as Io,bG as No,bH as Ao,bI as Oo,bJ as Do,bK as Ro,bL as Po,bM as Fo,bN as Lo,bO as _o,bP as zo,bQ as Bo,bR as Mo,bS as Xo,bT as Vo,bU as Uo,bV as Ho,bW as Go,bX as jo,bY as Wo,bZ as Ko,b_ as Yo,b$ as Jo,c0 as qo,c1 as Zo,c2 as Qo,c3 as en,c4 as tn,c5 as on,c6 as nn,c7 as an,c8 as ln,c9 as rn,ca as sn,cb as cn,cc as dn,cd as un,ce as pn,cf as hn,cg as gn,ch as mn,ci as fn,cj as bn,ck as vn,cl as yn,cm as Cn,cn as Sn,co as wn,cp as xn,cq as Tn,cr as kn,cs as $n,ct as En,cu as In,cv as Nn,cw as An,cx as On,cy as Dn,cz as Rn,cA as Pn,cB as Fn,cC as Ln,cD as _n,cE as zn,cF as Bn,cG as Mn,cH as Xn,cI as Vn,cJ as Un,cK as Hn,cL as Gn,cM as jn,cN as Wn,cO as Kn,cP as Yn,cQ as Jn,cR as qn,cS as Zn,cT as Qn,cU as ea,cV as ta,cW as oa,cX as na,cY as aa,cZ as ia,c_ as la,c$ as ra,d0 as sa,d1 as ca,d2 as da,d3 as ua,d4 as pa,d5 as ha,d6 as ga,d7 as ma,d8 as fa,d9 as ba,da as va,db as ya,dc as Ca,dd as Sa,de as wa,df as xa,dg as Ta,e as ka,dh as $a,di as Ea,dj as Ia,dk as Na,dl as Aa,dm as Oa,dn as Da,dp as Ra,dq as Pa,dr as Fa,ds as La,dt as _a,du as za,dv as Ba,dw as Ma,dx as Xa,dy as Va,dz as Ua,dA as Ha,dB as Ga,dC as ja,dD as Wa,dE as Ka,dF as Ya,dG as Ja,dH as qa,dI as Za,dJ as Qa,dK as ei,dL as ti,dM as oi,dN as ni}from"../chunks/ui-components-DODwSdKu.js";import{TrashIcon as ai,PlusIcon as ii,ArrowRightIcon as li,VSquareIcon as ri,XSquareIcon as si,BookIcon as ci,DeleteIcon as di,EditIcon as ui,GoLogo as pi,JavaLogo as hi,ChevronRightIcon as gi,ActionIcon as mi,DestinationIcon as fi,ChevronUpIcon as bi,ChevronDownIcon as vi,VIcon as yi,XIcon as Ci,InstrumentationRuleIcon as Si,SourceIcon as wi,NamespacesIcon as xi,SettingsIcon as Ti,PodIcon as ki,OdigosLogo as $i,K8sLogo as Ei,RefreshIcon as Ii,ExclamationCircleIcon as Ni,QuestionCircleIcon as Ai,InboundIcon as Oi,OutboundIcon as Di,UserIcon as Ri,TerminalIcon as Pi,SearchIcon as Fi,MinusIcon as Li,ExpandIcon as _i,CopyIcon as zi,DotIcon as Bi,DownloadIcon as Mi,RefreshLeftArrowIcon as Xi,VmLogo as Vi,SamplingIcon as Ui,ExclamationTriangleIcon as Hi,KeyIcon as Gi,DiagnoseIcon as ji,StarIcon as Wi,ArrowIcon as Ki,ConnectionsIcon as Yi,FilterIcon as Ji,DataStreamIcon as qi,PipelineCollectorIcon as Zi,ArrowDownSquareIcon as Qi,ArrowUpSquareIcon as el,GatewayIcon as tl,YamlIcon as ol}from"../icons.js";import{S as nl,D as al,I as il,a as ll,A as rl,P as sl,b as cl,c as dl,R as ul,O as pl,d as hl,e as gl,f as ml,W as fl,g as bl,C as vl,Y as yl,h as Cl,i as Sl,U as wl}from"../chunks/index-CRKgHzab.js";import{u as xl,f as Tl,g as kl,e as $l,i as El,h as Il,S as Nl,k as Al,E as Ol,l as Dl,m as Rl,j as Pl,b as Fl,d as Ll,a as _l,A as zl,R as Bl,c as Ml,D as Xl}from"../chunks/source-instrument-form-context-DjIHPYQJ.js";import{createPortal as Vl}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Ul=[{id:"CREDIT_CARD",label:"Credit card"}],Hl=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],Gl=[{id:W.Pod,label:W.Pod},{id:W.Namespace,label:W.Namespace},{id:W.Node,label:W.Node}],jl=[{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:Gl}],Wl=[{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:Gl}],Kl=/^[a-zA-Z]$/,Yl=new Set(["*","+","?"]),Jl=new Set(["^","$"]),ql={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"},Zl=m.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 o}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
|
+
`,Ql=m.span`
|
|
22
|
+
background: ${({$kind:e})=>ql[e]};
|
|
23
|
+
`,er=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const a=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){a("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){a(e.slice(o,o+2),"class-content"),o+=2;continue}a(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}a(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Yl.has(t)||Jl.has(t))a(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){a(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];Kl.test(t)?a(e.slice(o,o+2),"anchor-quantifier"):a(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(a(t,"literal"),o++):(a("|","alternation"),o++)}else"^"===e[o+1]?(a("[^","class-bracket"),o+=2):(a("[","class-bracket"),o++),n=!0;else a(t,"group"),o++}}return t})(e),[e]);return t(Zl,e?{"data-id":o,children:n.map((e,o)=>t(Ql,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},tr="rgba(102, 191, 255, 0.5)",or=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 o}from"react/jsx-runtime";import{useEffect
|
|
|
33
33
|
-moz-tab-size: 4;
|
|
34
34
|
tab-size: 4;
|
|
35
35
|
margin: 0;
|
|
36
|
-
`,
|
|
36
|
+
`,nr=m.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 o}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
|
+
`,ar=m.div`
|
|
49
|
+
${or}
|
|
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 o}from"react/jsx-runtime";import{useEffect
|
|
|
59
59
|
box-decoration-break: clone;
|
|
60
60
|
-webkit-box-decoration-break: clone;
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
63
|
-
${
|
|
62
|
+
`,ir=m.textarea`
|
|
63
|
+
${or}
|
|
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 o}from"react/jsx-runtime";import{useEffect
|
|
|
78
78
|
&::placeholder {
|
|
79
79
|
color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
80
80
|
}
|
|
81
|
-
`,
|
|
81
|
+
`,lr=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),rr=({regex:o,value:n,onChange:r,minHeight:s=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return lr(t);let o;try{o=new RegExp(e)}catch{return lr(t)}const n=o.exec(t);if(!n)return lr(t);const a=n.index,i=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=n[0].indexOf(n[1]),r=l>=0?a+l:a,s=r+n[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,r),capture:t.slice(r,s),matchPost:t.slice(s,i),after:t.slice(i)}})(o,n),[o,n]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(nr,{$minHeight:s,children:[e(ar,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:tr},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:tr},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(ir,{ref:u,$minHeight:s,value:n,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},sr=m.div`
|
|
82
82
|
flex: 1;
|
|
83
83
|
min-height: 0;
|
|
84
84
|
overflow-y: auto;
|
|
85
|
-
`,
|
|
85
|
+
`,cr=m.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
|
+
`,dr=m.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 o}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
|
+
`,ur=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[s,c]=r(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:Z.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:Z.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:Z.RESULT_INVALID_REGEX_FALLBACK}}const n=o.exec(t);return n?{ok:!0,isMatch:!0,message:n.length>1?n[1]:n[0]}:{ok:!0,isMatch:!1,message:Z.RESULT_NO_MATCH}})(n,s),[n,s]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(q,{isOpen:o,header:{title:Z.TITLE,onClose:()=>{c(""),i()}},children:t(sr,{children:e(cr,{children:[e(V,{$gap:6,children:[t(U,{label:Z.REGEX_LABEL}),t(er,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(Q,{size:te.XXS,color:ee.Secondary,children:Z.REGEX_EMPTY_HINT})]}),e(V,{$gap:6,children:[e(oe,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:Z.TEST_STRING_LABEL}),t(ne,{"data-id":"regex-tester-unescape",label:Z.UNESCAPE_LABEL,tooltip:Z.UNESCAPE_TOOLTIP,variant:ie.Secondary,size:ae.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],a="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=a){t+=a,o++;continue}}t+=e[o]}return t})(e)),disabled:(p=s,!/\\["'\\nrt]/.test(p))})]}),t(rr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:Z.TEST_STRING_PLACEHOLDER,regex:n,value:s,onChange:c,minHeight:240}),t(G,{helpMessage:Z.TEST_STRING_HELP})]}),e(V,{$gap:8,children:[t(U,{label:Z.RESULT_LABEL}),t(dr,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(Q,{size:te.XXS,color:ee.Secondary,children:Z.RESULT_CAPTURE_HINT})]})]})})});var p},pr=X.ExtractAttribute;var hr;!function(e){e.Preset="preset",e.Regex="regex"}(hr||(hr={}));const gr=[se.JSON,se.SQL,se.ResourcePath],mr=(e=se.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),fr=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,br=m.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 o}from"react/jsx-runtime";import{useEffect
|
|
|
108
108
|
display: flex;
|
|
109
109
|
flex-direction: column;
|
|
110
110
|
gap: 8px;
|
|
111
|
-
`,
|
|
111
|
+
`,vr=m.div`
|
|
112
112
|
flex: 1;
|
|
113
113
|
min-width: 0;
|
|
114
|
-
`,
|
|
114
|
+
`,yr=m.div`
|
|
115
115
|
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
116
116
|
padding-top: 24px;
|
|
117
|
-
`,Sr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),wr=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},xr=X.UrlTemplatizationRulesGroups,kr=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Tr={[ge.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:Gl.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(G,{errorMessage:l[o]})]},o))}),t(j,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Wl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(j,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Kl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[ge.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(K,{label:"Overwrite existing values",labelAlign:Y.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(j,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[ge.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(J,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[ge.RenameAttributes]:({value:e,setValue:o,formErrors:a})=>{const i=e[X.Renames],[l,s]=r(()=>Sr(i));return n(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(wr(l),i||{})||s(Sr(i))},[i]),t(j,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),o(X.Renames,wr(t))},errorMessage:a[X.Renames]})},[ge.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Hl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Hl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(G,{errorMessage:i[X.PiiCategories]})]})),[ge.URLTemplatization]:({value:n,setValue:a,formErrors:i})=>{const l=f(),r=n[xr]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(xr,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(s,{children:[t(he,{}),e(V,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(ne,{leftIcon:()=>t(ii,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(pe,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(j,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:kr,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(J,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(G,{errorMessage:i[xr]})]},`url-templatization-group-${n}`)),t(ne,{variant:ie.Secondary,label:"Add rule group",leftIcon:li,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(he,{})]})},[ge.ExtractAttribute]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=i[hr],c=o[hr]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(br)?gr.Regex:gr.Preset)(c)),[p,h]=r(null),g=e=>a(hr,{extractions:e});n(()=>{0===c.length&&g([d===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const m=(e,t)=>{g(c.map((o,n)=>n===e?{...o,...t}:o))},b=()=>{g([...c,d===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===gr.Preset,y=c.length?c:[v?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(V,{$gap:16,$width:"100%",children:[t(le,{options:[{value:gr.Preset,label:re.SEGMENT_PRESET_LABEL,tooltip:re.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:gr.Regex,label:re.SEGMENT_REGEX_LABEL,tooltip:re.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),g([e===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(V,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const a=n===y.length-1,i=o.dataFormat||se.JSON,r=de[i];return e(vr,{"data-id":`extract-row-${n}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(V,{$gap:10,children:[t(U,{label:v?re.PRESET_ROW_TITLE(n):re.REGEX_ROW_TITLE(n)}),v&&t(oe,{$gap:24,children:mr.map(e=>t(ce,{"data-id":`extract-row-${n}-fmt-${e}`,size:ue.L,label:de[e].label,value:i===e,onChange:t=>t&&m(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!v&&t(ne,{"data-id":`extract-row-${n}-test-regex`,label:re.TEST_REGEX_LABEL,variant:ie.Secondary,size:ae.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ne,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(ii,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);g(t.length?t:[d===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),a&&t(ne,{"data-id":`extract-row-${n}-add`,leftIcon:li,variant:ie.Secondary,size:ae.S,onClick:b})]})]}),v?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(yr,{children:t(pe,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>m(n,{lookupKey:e.target.value})})}),t(Cr,{children:t(ri,{size:24,fill:l.v2.colors.silver[200]})}),t(yr,{children:t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})})]}):e(V,{$gap:12,$width:"100%",children:[t(pe,{name:`extract-row-${n}-regex`,label:re.REGEX_LABEL,placeholder:re.REGEX_PLACEHOLDER,helpMessage:re.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>m(n,{regex:e.target.value})}),t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(G,{errorMessage:s})]}),t(pr,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},$r=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Tr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Er=()=>{const o=f(),{selectedOption:n,genericForm:a}=kl();if(!a||!n)return t(me,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ne,{leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(al,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(pe,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t($r,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Ir=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:g,options:m})=>{if(!(!o||Ce(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(il,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:g,placeholder:p,errorMessage:l[f],dropdownOptions:m,value:v||"",setValue:e=>i(f,e)},f)}),Nr=m(oe)`
|
|
117
|
+
`,Cr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Sr=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},wr=X.UrlTemplatizationRulesGroups,xr=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Tr={[ge.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:Hl.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(G,{errorMessage:l[o]})]},o))}),t(j,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:jl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(j,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Wl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[ge.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(K,{label:"Overwrite existing values",labelAlign:Y.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(j,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[ge.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(J,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[ge.RenameAttributes]:({value:e,setValue:o,formErrors:a})=>{const i=e[X.Renames],[l,s]=r(()=>Cr(i));return n(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(Sr(l),i||{})||s(Cr(i))},[i]),t(j,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),o(X.Renames,Sr(t))},errorMessage:a[X.Renames]})},[ge.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Ul.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Ul.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(G,{errorMessage:i[X.PiiCategories]})]})),[ge.URLTemplatization]:({value:n,setValue:a,formErrors:i})=>{const l=f(),r=n[wr]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(wr,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(s,{children:[t(he,{}),e(V,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(ne,{leftIcon:()=>t(ai,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(pe,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(j,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:xr,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(J,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(G,{errorMessage:i[wr]})]},`url-templatization-group-${n}`)),t(ne,{variant:ie.Secondary,label:"Add rule group",leftIcon:ii,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(he,{})]})},[ge.ExtractAttribute]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=i[pr],c=o[pr]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(fr)?hr.Regex:hr.Preset)(c)),[p,h]=r(null),g=e=>a(pr,{extractions:e});n(()=>{0===c.length&&g([d===hr.Preset?mr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const m=(e,t)=>{g(c.map((o,n)=>n===e?{...o,...t}:o))},b=()=>{g([...c,d===hr.Preset?mr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===hr.Preset,y=c.length?c:[v?mr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(V,{$gap:16,$width:"100%",children:[t(le,{options:[{value:hr.Preset,label:re.SEGMENT_PRESET_LABEL,tooltip:re.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:hr.Regex,label:re.SEGMENT_REGEX_LABEL,tooltip:re.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),g([e===hr.Preset?mr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(V,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const a=n===y.length-1,i=o.dataFormat||se.JSON,r=de[i];return e(br,{"data-id":`extract-row-${n}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(V,{$gap:10,children:[t(U,{label:v?re.PRESET_ROW_TITLE(n):re.REGEX_ROW_TITLE(n)}),v&&t(oe,{$gap:24,children:gr.map(e=>t(ce,{"data-id":`extract-row-${n}-fmt-${e}`,size:ue.L,label:de[e].label,value:i===e,onChange:t=>t&&m(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!v&&t(ne,{"data-id":`extract-row-${n}-test-regex`,label:re.TEST_REGEX_LABEL,variant:ie.Secondary,size:ae.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ne,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(ai,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);g(t.length?t:[d===hr.Preset?mr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),a&&t(ne,{"data-id":`extract-row-${n}-add`,leftIcon:ii,variant:ie.Secondary,size:ae.S,onClick:b})]})]}),v?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(vr,{children:t(pe,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>m(n,{lookupKey:e.target.value})})}),t(yr,{children:t(li,{size:24,fill:l.v2.colors.silver[200]})}),t(vr,{children:t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})})]}):e(V,{$gap:12,$width:"100%",children:[t(pe,{name:`extract-row-${n}-regex`,label:re.REGEX_LABEL,placeholder:re.REGEX_PLACEHOLDER,helpMessage:re.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>m(n,{regex:e.target.value})}),t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(G,{errorMessage:s})]}),t(ur,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},kr=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Tr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},$r=()=>{const o=f(),{selectedOption:n,genericForm:a}=xl();if(!a||!n)return t(me,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:ri,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:si,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ne,{leftIcon:ci,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(nl,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(pe,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(kr,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Er=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:g,options:m})=>{if(!(!o||Ce(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(al,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:g,placeholder:p,errorMessage:l[f],dropdownOptions:m,value:v||"",setValue:e=>i(f,e)},f)}),Ir=m(oe)`
|
|
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 o}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
|
-
`,Ar=c(({testConnection:o,isEdit:a},i)=>{const l=f(),{isVm:s}=y(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=Tl(),[v,C]=r(h?.testResult),[S,w]=r(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||s)return;const e=await o($e(u.formData));return C(e),e};return d(i,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,o]),u&&c?e(V,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Se,{status:we.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Se,{status:we.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[!s&&t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:l.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:l.v2.colors.red[800]}],size:be.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(ne,{"data-id":"dest-form-docs",leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(al,{title:"This connection will monitor:",allowedSignals:Te(c.option.supportedSignals),selectedSignals:ke(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(xe.Logs),metrics:e.includes(xe.Metrics),traces:e.includes(xe.Traces),profiles:e.includes(xe.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(pe,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Ir,{signals:ke(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!a&&e(Nr,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:ui,variant:ie.Secondary,textColor:l.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!s&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ie.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:pi,variant:ie.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(me,{title:"No active form"})});Ar.displayName="AddDestinationForm";const Or=[{id:Ee.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ee.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ee.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Dr=[{id:Ee.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ee.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ee.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Rr=["*"],Pr=[{id:Ae.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ae.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ae.DbQuery,label:"Collect DB query",tooltip:""},{id:Ae.Messaging,label:"Collect messaging",tooltip:""}],Fr={[Re.Java]:[new De("","")],[Re.Golang]:[new Oe("")]},Lr={[Pe.CodeAttributes]:({value:i,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);n(()=>{if(!c.length&&!s){const e={[Ee.FilePath]:!0,[Ee.Function]:!0,[Ee.LineNumber]:!0,[Ee.Column]:null,[Ee.Namespace]:null,[Ee.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ee).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(V,{$gap:6,children:Or.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(G,{errorMessage:s})]}),e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(V,{$gap:6,children:Dr.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(G,{errorMessage:s})]})]})},[Pe.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Re.Golang]||[]).map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Re.Java]||[]).map(e=>new De(e.className,e.methodName)),[i]);return n(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[Re.Golang]:Fr[Re.Golang],[Re.Java]:Fr[Re.Java]})},[]),e(o,{children:[e(V,{children:[e(oe,{$gap:8,children:[t(hi,{}),t(U,{label:"Golang custom probes"})]}),t(j,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Re.Golang]=e.map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Re.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(V,{children:[e(oe,{$gap:8,children:[t(gi,{}),t(U,{label:"Java custom probes"})]}),t(j,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Re.Golang]=c,t[Re.Java]=e.map(e=>new De(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Pe.HeadersCollection]:({value:e,setValue:o,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Ne.HeaderKeys]||[],[e]),s=e=>{const t={[Ne.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{r.length||l||s(Rr)},[]),t(J,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[Pe.PayloadCollection]:({value:o,setValue:i,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!r){const e={[Ae.HttpRequest]:{},[Ae.HttpResponse]:{},[Ae.DbQuery]:{},[Ae.Messaging]:{}};i("payloadCollection",e)}},[]);return e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Type of data to collect"}),t(V,{$gap:6,children:Pr.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Ae.HttpRequest]:o.includes(Ae.HttpRequest)?{}:null,[Ae.HttpResponse]:o.includes(Ae.HttpResponse)?{}:null,[Ae.DbQuery]:o.includes(Ae.DbQuery)?{}:null,[Ae.Messaging]:o.includes(Ae.Messaging)?{}:null};i("payloadCollection",n)})(e,t)})},e))}),t(G,{errorMessage:r})]})},[Pe.UnknownType]:null},_r=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Lr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},zr=()=>{const o=f(),{selectedOption:n,genericForm:a,sourceOptions:i,namespaceOptions:l}=$l();if(!a||!n)return t(me,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(ne,{leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(ll,{option:n,formState:r}),e(oe,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Fe,{label:Le[e],leftIcon:_e(e),backgroundColor:o.v2.colors.purple[900]},e))]}),t(rl,{scopes:r.sourceScopes,onChange:e=>s("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:n.type===Pe.CustomInstrumentation?[]:n.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(pe,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:r.ruleName,onChange:({target:{value:e}})=>s("ruleName",e),errorMessage:c.ruleName}),t(_r,{ruleType:n.type,value:r,setValue:(e,t)=>s(e,t),formErrors:c}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes,onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},Br=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=El();if(!e)return null;const{existingName:a,editingName:i}=e;return t(ze,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Be.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ie.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ie.Secondary,onClick:n}})},Mr=({autoFocus:o})=>{const{dataStreams:n}=Me(),{genericForm:i,excludeName:l,editingName:r}=El(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(V,{$width:"100%",$gap:12,children:[t(pe,{name:"data-stream-name",label:Be.STREAM_NAME,placeholder:Be.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Be.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Se,{status:we.Warning,message:Be.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Xr=()=>{const{selectedStreamName:e}=Me(),{genericForm:o}=Il();if(!o)return t(me,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(pe,{name:"sourceName",label:Be.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Vr=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ur=m.div`
|
|
128
|
+
`,Nr=c(({testConnection:o,isEdit:a},i)=>{const l=f(),{isVm:s}=y(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=Tl(),[v,C]=r(h?.testResult),[S,w]=r(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||s)return;const e=await o($e(u.formData));return C(e),e};return d(i,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,o]),u&&c?e(V,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Se,{status:we.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Se,{status:we.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[!s&&t(le,{options:[{icon:ri,label:"Enabled",value:!1,selectedBgColor:l.v2.colors.green[800]},{icon:si,label:"Disabled",value:!0,selectedBgColor:l.v2.colors.red[800]}],size:be.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(ne,{"data-id":"dest-form-docs",leftIcon:ci,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(nl,{title:"This connection will monitor:",allowedSignals:ke(c.option.supportedSignals),selectedSignals:Te(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(xe.Logs),metrics:e.includes(xe.Metrics),traces:e.includes(xe.Traces),profiles:e.includes(xe.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(pe,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Er,{signals:Te(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!a&&e(Ir,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:di,variant:ie.Secondary,textColor:l.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!s&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ie.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:ui,variant:ie.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(me,{title:"No active form"})});Nr.displayName="AddDestinationForm";const Ar=[{id:Ee.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ee.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ee.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Or=[{id:Ee.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ee.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ee.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Dr=["*"],Rr=[{id:Ae.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ae.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ae.DbQuery,label:"Collect DB query",tooltip:""},{id:Ae.Messaging,label:"Collect messaging",tooltip:""}],Pr={[Re.Java]:[new De("","")],[Re.Golang]:[new Oe("")]},Fr={[Pe.CodeAttributes]:({value:i,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);n(()=>{if(!c.length&&!s){const e={[Ee.FilePath]:!0,[Ee.Function]:!0,[Ee.LineNumber]:!0,[Ee.Column]:null,[Ee.Namespace]:null,[Ee.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ee).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(V,{$gap:6,children:Ar.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(G,{errorMessage:s})]}),e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(V,{$gap:6,children:Or.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(G,{errorMessage:s})]})]})},[Pe.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Re.Golang]||[]).map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Re.Java]||[]).map(e=>new De(e.className,e.methodName)),[i]);return n(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[Re.Golang]:Pr[Re.Golang],[Re.Java]:Pr[Re.Java]})},[]),e(o,{children:[e(V,{children:[e(oe,{$gap:8,children:[t(pi,{}),t(U,{label:"Golang custom probes"})]}),t(j,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Re.Golang]=e.map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Re.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(V,{children:[e(oe,{$gap:8,children:[t(hi,{}),t(U,{label:"Java custom probes"})]}),t(j,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Re.Golang]=c,t[Re.Java]=e.map(e=>new De(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Pe.HeadersCollection]:({value:e,setValue:o,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Ne.HeaderKeys]||[],[e]),s=e=>{const t={[Ne.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{r.length||l||s(Dr)},[]),t(J,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[Pe.PayloadCollection]:({value:o,setValue:i,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!r){const e={[Ae.HttpRequest]:{},[Ae.HttpResponse]:{},[Ae.DbQuery]:{},[Ae.Messaging]:{}};i("payloadCollection",e)}},[]);return e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Type of data to collect"}),t(V,{$gap:6,children:Rr.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Ae.HttpRequest]:o.includes(Ae.HttpRequest)?{}:null,[Ae.HttpResponse]:o.includes(Ae.HttpResponse)?{}:null,[Ae.DbQuery]:o.includes(Ae.DbQuery)?{}:null,[Ae.Messaging]:o.includes(Ae.Messaging)?{}:null};i("payloadCollection",n)})(e,t)})},e))}),t(G,{errorMessage:r})]})},[Pe.UnknownType]:null},Lr=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Fr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},_r=()=>{const o=f(),{selectedOption:n,genericForm:a,sourceOptions:i,namespaceOptions:l}=kl();if(!a||!n)return t(me,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:ri,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:si,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(ne,{leftIcon:ci,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(il,{option:n,formState:r}),e(oe,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Fe,{label:Le[e],leftIcon:_e(e),backgroundColor:o.v2.colors.purple[900]},e))]}),t(ll,{scopes:r.sourceScopes,onChange:e=>s("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:n.type===Pe.CustomInstrumentation?[]:n.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(pe,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:r.ruleName,onChange:({target:{value:e}})=>s("ruleName",e),errorMessage:c.ruleName}),t(Lr,{ruleType:n.type,value:r,setValue:(e,t)=>s(e,t),formErrors:c}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes,onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},zr=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=$l();if(!e)return null;const{existingName:a,editingName:i}=e;return t(ze,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Be.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ie.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ie.Secondary,onClick:n}})},Br=({autoFocus:o})=>{const{dataStreams:n}=Me(),{genericForm:i,excludeName:l,editingName:r}=$l(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(V,{$width:"100%",$gap:12,children:[t(pe,{name:"data-stream-name",label:Be.STREAM_NAME,placeholder:Be.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Be.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Se,{status:we.Warning,message:Be.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Mr=()=>{const{selectedStreamName:e}=Me(),{genericForm:o}=El();if(!o)return t(me,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(pe,{name:"sourceName",label:Be.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Xr=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Vr=m.div`
|
|
129
129
|
display: flex;
|
|
130
130
|
flex-direction: column;
|
|
131
131
|
gap: 24px;
|
|
132
|
-
`,
|
|
132
|
+
`,Ur=m.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
|
+
`,Hr=({value:e})=>{const o=f();return t(Fe,e?{status:we.Success,label:We,leftIcon:ri}:{label:Ke,leftIcon:si,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},Gr=({value:e,onChange:o})=>{const n=f(),i=a(()=>[{icon:ri,label:We,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:si,label:Ke,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(le,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},jr=()=>{const e=Il();switch(e.formType){case Nl.Create:return t(Wr,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Nl.View:return e.data?e.isEditing?t(Wr,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Kr,{data:e.data,renderAction:()=>t(Hr,{value:!e.data?.rule.disabled})}):null;case Nl.EditAutoNoisy:return t(Yr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:je,sectionTitle:Ue,sectionSubTitle:Ge,presetLabel:Ve,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Gr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Nl.EditAutoCostReduction:return t(Yr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:He,sectionTitle:Ue,presetLabel:Ve,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Gr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Nl.EditAutoHighlyRelevant:return t(Vr,{children:t(rl,{title:e.localEnabled?void 0:Xe,summary:e.summary,renderAction:()=>t(Gr,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Wr=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:r})=>e(Vr,{children:[t(dl,{category:o,formState:n,renderAction:r}),e(Ur,{$faded:!!n.disabled,children:[t(ul,{category:o,formState:n,onChange:a}),t(ll,{scopes:n.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(pl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(hl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(gl,{ruleType:n.ruleType,formState:n,onChange:a}),t(ml,{category:o,formState:n,onChange:a})]})]}),Kr=({data:o,renderAction:n})=>e(Vr,{children:[t(dl,{readOnly:!0,summary:o.summary,renderAction:n}),t(ul,{readOnly:!0,data:o}),t(ll,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(pl,{readOnly:!0,data:o}),t(ml,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(gl,{readOnly:!0,rule:o.rule})]}),Yr=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:r,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:g,customPercentage:m,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>g(e),[g]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(Vr,{children:[t(rl,{title:o?void 0:a,summary:n,renderAction:b}),t(Ur,{$faded:!o,children:e(Ye,{richTitle:{title:i,subTitle:r},children:[d&&t(V,{$alignItems:"flex-start",children:t(le,{options:Xr,selected:u,setSelected:v})}),S&&t(sl,{description:s,options:cl,selected:h,onSelect:y,customName:c,customLabel:Je,customPlaceholder:"5%",customValue:m,onCustomChange:C})]})})]})},Jr=m.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 o}from"react/jsx-runtime";import{useEffect
|
|
|
148
148
|
&:hover {
|
|
149
149
|
background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>o.v2.colors[t?"purple":"silver"][e?"700":"800"]};
|
|
150
150
|
}
|
|
151
|
-
`,
|
|
151
|
+
`,qr=m.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
157
|
background-color: ${({theme:e})=>e.v2.colors.white[500]+qe["004"]};
|
|
158
|
-
`,
|
|
158
|
+
`,Zr=({dataId:o,icon:n,title:a,description:i,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:g})=>e(Jr,{"data-id":o||`list-item-${a}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(V,{$gap:4,children:[e(oe,{$gap:12,children:[g&&t(H,{partiallyChecked:h||!1,value:p||!1,onChange:e=>g(e)}),n&&t(qr,{children:t(n,{size:20})}),t(Q,{size:te.XS,children:a})]}),i&&t(Q,{size:te.XXXS,color:ee.Secondary,children:i})]}),(l||c)&&e(oe,{$gap:8,children:[c,l&&t(gi,{size:18})]})]}),Qr=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createAction:l,withOverlay:s})=>{const[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=xl(),f=a(()=>(c?Ze.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):Ze).filter(e=>!!e),[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(Zr,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p?.type,f.length,h]),v=a(()=>p?[t($r,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:mi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(fl,{ref:u,isOpen:!0,withOverlay:s,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await l(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Be.CREATING_ACTION,subTitle:Be.CREATING_ACTION_SUBTITLE},header:{icon:mi,title:Be.ADD_ACTION,subTitle:Be.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},es=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(et).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=a(()=>{const e=Object.values(xe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(tt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(le,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},ts=m.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:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
|
|
165
|
-
`,
|
|
165
|
+
`,os=m.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
|
+
`,ns=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(ts,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:l,children:[e(os,{$isOpen:s,children:[e(oe,{$gap:10,children:[t(Q,{size:te.XS,children:o}),n&&t(Ie,{text:n,withIcon:!0}),t(Fe,{label:a.length,status:l?we.Default:void 0})]}),t(ot,{icon:s?bi:vi,size:nt.M,onClick:()=>c(e=>!e)})]}),s?t(V,{children:a.length?u.toArray(a):t(Qe,{$padding:"12px 0",children:t(me,{})})}):null]})},as=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||ke(e.supportedSignals).includes(o.signalType))):e,is=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(Zr,{icon:lt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Fe,{status:n.succeeded?we.Success:we.Error,leftIcon:n.succeeded?yi:Ci})}),ls=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=Tl();return o?.length?t(ns,{title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:o.map((o,n)=>t(is,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(ns,{purpleColors:!0,title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(is,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===r&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var rs;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(rs||(rs={}));const ss=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===rs.SELF_HOSTED?n.push(...e.items):e.name===rs.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=rt(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=st(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[et.DETECTED]:o,[et.SELF_HOSTED]:n,[et.MANAGED]:a}},cs=({onClose:e,onBack:o,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,getDestinationCategories:d,getPotentialDestinations:u,initialInputs:p,testConnection:h,createDestination:g,updateDestination:m,withOverlay:f,disableAnimation:b})=>{const[v,y]=r(""),[C,S]=r({categoryType:null,signalType:null}),{destinations:w}=ct(),{activeForm:x,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:$}=Tl();n(()=>{p&&$(p)},[p]);const[E,I]=r(!0),[N,A]=r([]),[O,D]=r({[et.ALL]:[],[et.UNSAVED]:[],[et.EXISTS]:[],[et.DETECTED]:[],[et.SELF_HOSTED]:[],[et.MANAGED]:[]});n(()=>{const e=w.map(e=>{let t;for(const o of N){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=st(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});D(t=>({...t,[et.EXISTS]:e}))},[w,N]);const R=l(async()=>{try{I(!0);const[e,t]=await Promise.all([d(),u()]);e&&A(e.destinationCategories.categories),D(o=>({...o,...ss(e,t)}))}catch(e){}finally{I(!1)}},[]);n(()=>{R()},[]);const P=l(async()=>{const e=(await Promise.all(k.map(({option:e,formData:t})=>{const o=$e(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e]))return m(e.id,o,s)}return g(o,s)}))).filter(e=>e?.error);if(e.length)return{error:e.map(e=>e?.error).join("\n")}},[k,s,g,m]),F=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Tl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(ls,{listType:et.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(et)){if(i.categoryType&&i.categoryType!==e)continue;const l=as(o[e],n,i);l.length&&a.push(t(ls,{listType:e,destinationOptions:l},e))}return e&&a.push(t(Qe,{$height:"100%",children:t(at,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:E,destinationsByCategory:O,searchText:v,filters:C}),L=(({testConnection:e})=>{const{activeForm:o}=Tl();return{width:"60%",list:o?[t(Nr,{testConnection:e},o.option.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:fi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(fl,{isOpen:!0,withOverlay:f,disableAnimation:b,onClose:e,onBack:o?()=>o(k):void 0,onNext:i?()=>i(k):void 0,nextIsSkip:!k.length,onSave:P,disableSave:!x&&!k.length,isFetching:E,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:Be.CREATING_DESTINATION,subTitle:Be.CREATING_DESTINATION_SUBTITLE},header:{icon:fi,title:Be.ADD_DESTINATIONS,subTitle:Be.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:v,onChange:y},filters:t(es,{destinationsByCategory:O,filters:C,setFilters:S}),leftColumn:F,rightColumn:L})},ds=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createInstrumentationRule:l,withOverlay:s})=>{const[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=kl(),f=a(()=>c?dt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):dt,[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(Zr,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(_r,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:Si,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(fl,{ref:u,isOpen:!0,withOverlay:s,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await l(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Be.CREATING_INSTRUMENTATION_RULE,subTitle:Be.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Si,title:Be.ADD_INSTRUMENTATION_RULE,subTitle:Be.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},us={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Be.FETCHING_NAMESPACES,subTitle:Be.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Be.SELECT_NAMESPACE,subTitle:Be.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},ps={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===ut.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},hs=e=>e?ps:us,gs="No matches",ms="No sources",fs=e=>`No sources matched the filter '${e}'`,bs=e=>(e?"Unselect":"Select")+" all",vs="Show only:",ys="Selected",Cs="Auto",Ss="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",ws="Enterprise only",xs=m.div``,Ts=m.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 o}from"react/jsx-runtime";import{useEffect
|
|
|
176
176
|
transition-duration: 0s;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
${
|
|
179
|
+
${xs}:hover & {
|
|
180
180
|
visibility: visible;
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
`,ks=({workloadName:e,workloadKind:o,isChecked:n,onToggle:a,disabled:i,disabledReason:l})=>{const r=f(),s=()=>{};return t(xs,{children:t(Zr,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?s:a,isChecked:n,onCheckboxChange:i?s:a,children:i&&l?t(Fe,{label:l,status:we.Default,textSize:te.XXXS}):t(Ts,{children:t(Fe,{label:o,status:we.Info,textSize:te.XXXS,backgroundColor:r.v2.colors.blue[900]})})})})},$s=m.div``,Es=m.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
|
+
${$s}:hover & {
|
|
189
189
|
visibility: visible;
|
|
190
190
|
}
|
|
191
|
-
`,Ns=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Es,{children:t(Qr,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(oe,{$gap:12,children:[!d&&t(Is,{$visible:r||i,children:t(Ie,{text:ws,children:t(K,{label:Ss,labelAlign:Y.Left,size:gt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(oe,{$gap:8,children:[t(Q,{variant:mt.Span,size:te.XXXS,color:ee.Secondary,align:"right",children:Cs}),t(Fe,{label:`${l.sourced}/${l.total}`,status:r?we.Default:pt.Unknown,minWidth:"42px"})]})]})})})},As=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Ns,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(as,{title:n,list:c,noBgColor:!0}):c},Os=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:g})=>{const{isVm:m}=y(),f=gs(m),{selectedStreamName:b}=Me(),{progress:v,resetProgress:C}=ft(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:k,handleSourceChange:T,handleSelectAll:$,formDiff:E,isFormDirty:I}=Fl();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:yt,clusterName:vt,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(b)??!1)}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[N,A]=r(""),[O,D]=r(ut.Namespace),[R,P]=r({showOnlySelected:!1}),[F,L]=r({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=gs(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Rl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Pl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(As,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,r]);return{width:"60%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ie,{text:b?Be.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${b?`${v} / ${C}`:C}`,status:pt.Unknown})})]}),t(Q,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:te.XS,children:vs(m)})]}),list:f.length?f:o?[t(Qe,{$height:"100%",children:t(at,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(Qe,{$height:"100%",children:t(me,c?{icon:ki,title:ms,subTitle:h.noGroupMatchedFilter(c)}:{icon:ki,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:F,setSelectedArea:L,searchText:O===ut.Namespace?N:"",searchBy:O,filters:R}),z=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=gs(u),h=d===ht.Onprem,g=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),m=a(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ol(e,r,c)):[],[g,r,c]),f=a(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=a(()=>{if(!g)return[];const{clusterId:e}=l.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Dl.has(l);return t($s,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:r,disabledReason:xs},`${e}#${o}#${a}#${l}`)})},[m,g,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(Ie,{text:v?Be.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${v?`${C} / ${S}`:S}`,status:pt.Unknown})})]}),t(Q,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:te.XS,children:vs(f)})]}),list:b.length?b:[t(Qe,{$height:"100%",children:t(me,g?r?{icon:xi,title:ms,subTitle:bs(r)}:{icon:xi,title:fs,subTitle:p.noItemsInGroupSubTitle}:{icon:xi,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:{value:F},searchText:O===ut.Source?N:"",searchBy:O,filters:R});return t(bl,{isOpen:!0,withOverlay:h,disableAnimation:g,onClose:o?()=>{C(bt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(E):void 0,onNext:l?()=>l(E):void 0,nextIsSkip:!I,onSave:()=>d(E),header:{icon:xi,title:Be.ADD_SOURCE,subTitle:Be.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:N,onChange:e=>{A(e),O===ut.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(O),segment:{options:[{label:f.groupSegmentLabel,value:ut.Namespace},{label:f.itemSegmentLabel,value:ut.Source}],selected:O,setSelected:D}},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:ys}),t(K,{name:"filter-selected",size:gt.S,label:Cs,value:R.showOnlySelected,onChange:e=>P(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:S,progress:{title:Be.CREATING_SOURCES,subTitle:Be.CREATING_SOURCES_SUBTITLE,percentage:v[bt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:z})},Ds=(e,t)=>{const o=[{id:"type",title:Be.TYPE,label:t.label},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Be.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Be.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Be.NOTES,label:e.notes}),o},Rs=({onClose:i,actionId:s,updateAction:c,deleteAction:d})=>{const u=f(),{actions:p}=ct(),{selectedOption:h,loadAction:g,validateFormData:m,genericForm:b}=kl(),[v,y]=r(!1),[C,S]=r(!1),[w,x]=r(null),k=v&&!!b?.isFormDirty,T=a(()=>p?.find(e=>Ct(e)===s),[s,p]),$=a(()=>Ze.find(({type:e})=>e===T?.type)??null,[T?.type]);n(()=>{T&&g(T)},[T]);const E=l(()=>{T&&y(!0)},[T]),I=l(()=>{T&&(g(T),y(!1))},[T,g]),N=l(()=>{k?x("close"):i()},[k,i]),A=l(()=>{k?x("cancel"):I()},[k,I]),O=l(()=>{const e=w;x(null),"close"===e?(I(),i()):I()},[w,I,i]),D=l(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=m();e||(await c(T.id,t),y(!1))}},[T,m,c]),R=l(()=>{T&&S(!0)},[T]),P=l(async()=>{T&&(await d(T.id,T.type),i())},[T,d,i]);if(!T||!$)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?we.Success:pt.Unknown,label:e?"True":"False",invertColors:!0});if(o===ge.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===ge.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ge.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ge.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:a,regex:i},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})})}return o===ge.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(o,{children:[t(q,{isOpen:!0,header:{icon:Tt(T.type),title:$.label,onClose:N,actions:[{id:"edit-action-btn-edit",label:St.EDIT,icon:pi,active:v,onClick:E},{id:"edit-action-btn-delete",label:St.DELETE,icon:ii,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:St.SAVE,variant:ie.Primary,onClick:D}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:v&&h?t(Er,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(kt,{conditions:T.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Ds(T,$)})]}),!!F?.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(vl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(yl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})},Ps=({onClose:o,connections:i,selectedConnectionIds:l,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=r(""),[h,g]=r({showOnlySelected:!1}),m=a(()=>i.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&l.includes(e.id);return t&&o}),[i.length,l.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=r(!1),[y,C]=r(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=$t(y||{rollout:{automaticRolloutDisabled:!1}}),T=a(()=>l.length>1||void 0!==y&&!x(y,S),[l.length,y,S]);return n(()=>{1===l.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),k(e)}v(!1)})(l[0]):C(void 0)},[l.length]),t(bl,{isOpen:!0,onClose:o,onSave:()=>d(S,l),header:{icon:Ti,title:"Cluster Configuration"},connectionIds:{value:l,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:"Show only:"}),t(K,{size:gt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:b,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,children:"Clusters"}),t(Fe,{label:m.length,status:pt.Unknown})]}),e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,align:"right",children:"Selected clusters"}),t(Fe,{label:`${l.length}/${m.length}`,status:pt.Unknown})]})]}),list:m.map(e=>t(Qr,{title:e.name,isChecked:l.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(Q,{size:te.XS,children:"Configurations"}),list:[t(K,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Fs=e=>{const t=[{id:"type",title:Be.TYPE,label:e.destinationType.displayName},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}],o=ke(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Be.MONITORS,label:o}),e.name&&t.push({id:"name",title:Be.NAME,label:e.name}),t},Ls=({onClose:s,destinationId:c,getDestinationCategories:d,testConnection:u,updateDestination:p,deleteDestination:h})=>{const g=f(),{isVm:m}=y(),{destinations:b}=ct(),{selectedStreamName:v}=Me(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Tl(),k=i(null),[T,$]=r(!1),[E,I]=r(!1),[N,A]=r(null),[O,D]=r(!0),[R,P]=r(null),F=T&&!!x?.isFormDirty,L=a(()=>Nt(b,v),[b,v]),_=a(()=>L?.find(e=>Ct(e)===c),[c,L]);n(()=>{let e=!1;return D(!0),d().then(t=>{e||A(t?.destinationCategories.categories??[])}).catch(t=>{e||A([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&N&&S(_,N)},[_,N]);const z=a(()=>_&&N?At(N,_):[],[_,N]),B=l(()=>{_&&$(!0)},[_]),M=l(()=>{_&&N&&(S(_,N),$(!1))},[_,N,S]),X=l(()=>{F?P("close"):s()},[F,s]),U=l(()=>{F?P("cancel"):M()},[F,M]),H=l(()=>{const e=R;P(null),"close"===e?(M(),s()):M()},[R,M,s]),G=l(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,$e(t)),$(!1))}},[_,w,p]),j=l(()=>{_&&I(!0)},[_]),W=l(async()=>{_&&(await h(_.id),s())},[_,h,s]);if(!_)return null;const{icon:K,iconSrc:Y}=lt(_.destinationType.type),J=((e,t)=>{const o=[],n=Et(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=ke(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&Ce(h,i,a))return;const{type:m}=st(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===It.MultiInput){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===It.KeyValuePair){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(_,z);return e(o,{children:[t(q,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:St.EDIT,icon:pi,active:T,onClick:B},{id:"edit-destination-btn-delete",label:St.DELETE,icon:ii,color:g.v2.colors.red[500],active:E,onClick:j}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:U},...C?.option.testConnectionSupported&&!m?[{"data-id":"edit-destination-btn-test-connection",label:St.TEST_CONNECTION,variant:ie.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:St.SAVE,variant:ie.Primary,onClick:G}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:O?t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})}):T&&C?t(Ar,{ref:k,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[!m&&t(kt,{conditions:_.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Fs(_)})]}),!!J.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(xt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(xt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(vl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:W}),t(yl,{isOpen:null!==R,onClose:()=>P(null),onApprove:H})]})},_s=(e,t)=>{const o=[{id:"type",title:Be.TYPE,label:t.label},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Be.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Be.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Be.NOTES,label:e.notes}),o},zs=({onClose:i,ruleId:s,updateInstrumentationRule:c,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=ct(),{addNotification:h}=Dt(),{selectedOption:g,loadRule:m,validateFormData:b,genericForm:v}=$l(),[y,C]=r(!1),[S,w]=r(!1),[x,k]=r(null),T=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>Ct(e)===s),[s,p]),E=a(()=>dt.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&m($)},[$]);const I=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_EDIT_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,h]),N=l(()=>{$&&(m($),C(!1))},[$,m]),A=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):N()},[T,N]),D=l(()=>{const e=x;k(null),"close"===e?(N(),i()):N()},[x,N,i]),R=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await c($.ruleId,t),C(!1))}},[$,b,c]),P=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_DELETE_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,h]),F=l(async()=>{$&&(await d($.ruleId),i())},[$,d,i]);if(!$||!E)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.headersCollection?.[Ne.HeaderKeys]?.length&&e.headersCollection[Ne.HeaderKeys].forEach(e=>{e&&n.push(t(Q,{size:te.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Re.Java]?.forEach((e,a)=>{const i=new De(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Re.Golang]?.forEach((e,a)=>{const i=new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})($,u);return e(o,{children:[t(q,{isOpen:!0,header:{icon:Ft($.type),title:E.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:St.EDIT,icon:pi,active:y,onClick:I},{id:"edit-rule-btn-delete",label:St.DELETE,icon:ii,color:u.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:St.SAVE,variant:ie.Primary,onClick:R}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:y&&g?t(zr,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(kt,{conditions:$.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:_s($,E)})]}),t(rl,{readOnly:!0,scopes:$.sourceScopes??null}),!!L.length&&t(xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:L})}),!!E.supportedLanguages.length&&t(xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(Pt,{label:Le[e],leftIcon:_e(e),flex:"0.5"},e))})})})]})})})}),t(vl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(yl,{isOpen:null!==x,onClose:()=>k(null),onApprove:D})]})};var Bs;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(Bs||(Bs={}));const Ms=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Lt(),g=_t(!!o),m=a(()=>({title:l,icon:$i,withCopy:!0}),[l]),f=a(()=>{const e=[],t=zt(c);t&&e.push(t);const o=zt(d,Ei,"health");o&&e.push(o);const n=zt(u,Ii,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ni,label:St.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Be.NODE,label:r,withCopy:!0},{id:"age",title:Be.AGE,label:s?h(s,{style:"short"}):Be.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:g,children:t(xt,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Xs=m.div`
|
|
191
|
+
`,Is=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t($s,{children:t(Zr,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(oe,{$gap:12,children:[!d&&t(Es,{$visible:r||i,children:t(Ie,{text:Ss,children:t(K,{label:Cs,labelAlign:Y.Left,size:gt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(oe,{$gap:8,children:[t(Q,{variant:mt.Span,size:te.XXXS,color:ee.Secondary,align:"right",children:ys}),t(Fe,{label:`${l.sourced}/${l.total}`,status:r?we.Default:pt.Unknown,minWidth:"42px"})]})]})})})},Ns=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Is,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(ns,{title:n,list:c,noBgColor:!0}):c},As=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:g})=>{const{isVm:m}=y(),f=hs(m),{selectedStreamName:b}=Me(),{progress:v,resetProgress:C}=ft(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:T,handleSourceChange:k,handleSelectAll:$,formDiff:E,isFormDirty:I}=Pl();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:yt,clusterName:vt,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(b)??!1)}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[N,A]=r(""),[O,D]=r(ut.Namespace),[R,P]=r({showOnlySelected:!1}),[F,L]=r({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=hs(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Dl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Rl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(Ns,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,r]);return{width:"60%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ie,{text:b?Be.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${b?`${v} / ${C}`:C}`,status:pt.Unknown})})]}),t(Q,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:te.XS,children:bs(m)})]}),list:f.length?f:o?[t(Qe,{$height:"100%",children:t(at,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(Qe,{$height:"100%",children:t(me,c?{icon:xi,title:gs,subTitle:h.noGroupMatchedFilter(c)}:{icon:xi,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:T,handleSourceChange:k,handleSelectAll:$,selectedArea:F,setSelectedArea:L,searchText:O===ut.Namespace?N:"",searchBy:O,filters:R}),z=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=hs(u),h=d===ht.Onprem,g=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),m=a(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Al(e,r,c)):[],[g,r,c]),f=a(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=a(()=>{if(!g)return[];const{clusterId:e}=l.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Ol.has(l);return t(ks,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:r,disabledReason:ws},`${e}#${o}#${a}#${l}`)})},[m,g,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(Ie,{text:v?Be.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${v?`${C} / ${S}`:S}`,status:pt.Unknown})})]}),t(Q,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:te.XS,children:bs(f)})]}),list:b.length?b:[t(Qe,{$height:"100%",children:t(me,g?r?{icon:wi,title:gs,subTitle:fs(r)}:{icon:wi,title:ms,subTitle:p.noItemsInGroupSubTitle}:{icon:wi,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:T,handleSourceChange:k,handleSelectAll:$,selectedArea:{value:F},searchText:O===ut.Source?N:"",searchBy:O,filters:R});return t(fl,{isOpen:!0,withOverlay:h,disableAnimation:g,onClose:o?()=>{C(bt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(E):void 0,onNext:l?()=>l(E):void 0,nextIsSkip:!I,onSave:()=>d(E),header:{icon:wi,title:Be.ADD_SOURCE,subTitle:Be.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:N,onChange:e=>{A(e),O===ut.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(O),segment:{options:[{label:f.groupSegmentLabel,value:ut.Namespace},{label:f.itemSegmentLabel,value:ut.Source}],selected:O,setSelected:D}},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:vs}),t(K,{name:"filter-selected",size:gt.S,label:ys,value:R.showOnlySelected,onChange:e=>P(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:S,progress:{title:Be.CREATING_SOURCES,subTitle:Be.CREATING_SOURCES_SUBTITLE,percentage:v[bt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:z})},Os=(e,t)=>{const o=[{id:"type",title:Be.TYPE,label:t.label},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Be.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Be.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Be.NOTES,label:e.notes}),o},Ds=({onClose:i,actionId:s,updateAction:c,deleteAction:d})=>{const u=f(),{actions:p}=ct(),{selectedOption:h,loadAction:g,validateFormData:m,genericForm:b}=xl(),[v,y]=r(!1),[C,S]=r(!1),[w,x]=r(null),T=v&&!!b?.isFormDirty,k=a(()=>p?.find(e=>Ct(e)===s),[s,p]),$=a(()=>Ze.find(({type:e})=>e===k?.type)??null,[k?.type]);n(()=>{k&&g(k)},[k]);const E=l(()=>{k&&y(!0)},[k]),I=l(()=>{k&&(g(k),y(!1))},[k,g]),N=l(()=>{T?x("close"):i()},[T,i]),A=l(()=>{T?x("cancel"):I()},[T,I]),O=l(()=>{const e=w;x(null),"close"===e?(I(),i()):I()},[w,I,i]),D=l(async()=>{if(k){const{errorMessage:e,preparedFormData:t}=m();e||(await c(k.id,t),y(!1))}},[k,m,c]),R=l(()=>{k&&S(!0)},[k]),P=l(async()=>{k&&(await d(k.id,k.type),i())},[k,d,i]);if(!k||!$)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?we.Success:pt.Unknown,label:e?"True":"False",invertColors:!0});if(o===ge.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===ge.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ge.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ge.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:a,regex:i},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})})}return o===ge.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(k);return e(o,{children:[t(q,{isOpen:!0,header:{icon:kt(k.type),title:$.label,onClose:N,actions:[{id:"edit-action-btn-edit",label:St.EDIT,icon:ui,active:v,onClick:E},{id:"edit-action-btn-delete",label:St.DELETE,icon:ai,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:St.SAVE,variant:ie.Primary,onClick:D}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:v&&h?t($r,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(Tt,{conditions:k.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Os(k,$)})]}),!!F?.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(bl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(vl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})},Rs=({onClose:o,connections:i,selectedConnectionIds:l,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=r(""),[h,g]=r({showOnlySelected:!1}),m=a(()=>i.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&l.includes(e.id);return t&&o}),[i.length,l.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=r(!1),[y,C]=r(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:T}=$t(y||{rollout:{automaticRolloutDisabled:!1}}),k=a(()=>l.length>1||void 0!==y&&!x(y,S),[l.length,y,S]);return n(()=>{1===l.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),T(e)}v(!1)})(l[0]):C(void 0)},[l.length]),t(fl,{isOpen:!0,onClose:o,onSave:()=>d(S,l),header:{icon:Ti,title:"Cluster Configuration"},connectionIds:{value:l,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:"Show only:"}),t(K,{size:gt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:k,isFetching:b,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,children:"Clusters"}),t(Fe,{label:m.length,status:pt.Unknown})]}),e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,align:"right",children:"Selected clusters"}),t(Fe,{label:`${l.length}/${m.length}`,status:pt.Unknown})]})]}),list:m.map(e=>t(Zr,{title:e.name,isChecked:l.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(Q,{size:te.XS,children:"Configurations"}),list:[t(K,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Ps=e=>{const t=[{id:"type",title:Be.TYPE,label:e.destinationType.displayName},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}],o=Te(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Be.MONITORS,label:o}),e.name&&t.push({id:"name",title:Be.NAME,label:e.name}),t},Fs=({onClose:s,destinationId:c,getDestinationCategories:d,testConnection:u,updateDestination:p,deleteDestination:h})=>{const g=f(),{isVm:m}=y(),{destinations:b}=ct(),{selectedStreamName:v}=Me(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Tl(),T=i(null),[k,$]=r(!1),[E,I]=r(!1),[N,A]=r(null),[O,D]=r(!0),[R,P]=r(null),F=k&&!!x?.isFormDirty,L=a(()=>Nt(b,v),[b,v]),_=a(()=>L?.find(e=>Ct(e)===c),[c,L]);n(()=>{let e=!1;return D(!0),d().then(t=>{e||A(t?.destinationCategories.categories??[])}).catch(t=>{e||A([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&N&&S(_,N)},[_,N]);const z=a(()=>_&&N?At(N,_):[],[_,N]),B=l(()=>{_&&$(!0)},[_]),M=l(()=>{_&&N&&(S(_,N),$(!1))},[_,N,S]),X=l(()=>{F?P("close"):s()},[F,s]),U=l(()=>{F?P("cancel"):M()},[F,M]),H=l(()=>{const e=R;P(null),"close"===e?(M(),s()):M()},[R,M,s]),G=l(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,$e(t)),$(!1))}},[_,w,p]),j=l(()=>{_&&I(!0)},[_]),W=l(async()=>{_&&(await h(_.id),s())},[_,h,s]);if(!_)return null;const{icon:K,iconSrc:Y}=lt(_.destinationType.type),J=((e,t)=>{const o=[],n=Et(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=Te(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&Ce(h,i,a))return;const{type:m}=st(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===It.MultiInput){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===It.KeyValuePair){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(_,z);return e(o,{children:[t(q,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:St.EDIT,icon:ui,active:k,onClick:B},{id:"edit-destination-btn-delete",label:St.DELETE,icon:ai,color:g.v2.colors.red[500],active:E,onClick:j}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:U},...C?.option.testConnectionSupported&&!m?[{"data-id":"edit-destination-btn-test-connection",label:St.TEST_CONNECTION,variant:ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:St.SAVE,variant:ie.Primary,onClick:G}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:O?t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})}):k&&C?t(Nr,{ref:T,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[!m&&t(Tt,{conditions:_.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Ps(_)})]}),!!J.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(xt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(xt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(bl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:W}),t(vl,{isOpen:null!==R,onClose:()=>P(null),onApprove:H})]})},Ls=(e,t)=>{const o=[{id:"type",title:Be.TYPE,label:t.label},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Be.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Be.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Be.NOTES,label:e.notes}),o},_s=({onClose:i,ruleId:s,updateInstrumentationRule:c,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=ct(),{addNotification:h}=Dt(),{selectedOption:g,loadRule:m,validateFormData:b,genericForm:v}=kl(),[y,C]=r(!1),[S,w]=r(!1),[x,T]=r(null),k=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>Ct(e)===s),[s,p]),E=a(()=>dt.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&m($)},[$]);const I=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_EDIT_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,h]),N=l(()=>{$&&(m($),C(!1))},[$,m]),A=l(()=>{k?T("close"):i()},[k,i]),O=l(()=>{k?T("cancel"):N()},[k,N]),D=l(()=>{const e=x;T(null),"close"===e?(N(),i()):N()},[x,N,i]),R=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await c($.ruleId,t),C(!1))}},[$,b,c]),P=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_DELETE_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,h]),F=l(async()=>{$&&(await d($.ruleId),i())},[$,d,i]);if(!$||!E)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.headersCollection?.[Ne.HeaderKeys]?.length&&e.headersCollection[Ne.HeaderKeys].forEach(e=>{e&&n.push(t(Q,{size:te.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Re.Java]?.forEach((e,a)=>{const i=new De(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Re.Golang]?.forEach((e,a)=>{const i=new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})($,u);return e(o,{children:[t(q,{isOpen:!0,header:{icon:Ft($.type),title:E.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:St.EDIT,icon:ui,active:y,onClick:I},{id:"edit-rule-btn-delete",label:St.DELETE,icon:ai,color:u.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:St.SAVE,variant:ie.Primary,onClick:R}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:y&&g?t(_r,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(Tt,{conditions:$.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Ls($,E)})]}),t(ll,{readOnly:!0,scopes:$.sourceScopes??null}),!!L.length&&t(xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:L})}),!!E.supportedLanguages.length&&t(xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(Pt,{label:Le[e],leftIcon:_e(e),flex:"0.5"},e))})})})]})})})}),t(bl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(vl,{isOpen:null!==x,onClose:()=>T(null),onApprove:D})]})};var zs;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(zs||(zs={}));const Bs=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Lt(),g=_t(!!o),m=a(()=>({title:l,icon:ki,withCopy:!0}),[l]),f=a(()=>{const e=[],t=zt(c);t&&e.push(t);const o=zt(d,$i,"health");o&&e.push(o);const n=zt(u,Ei,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ii,label:St.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Be.NODE,label:r,withCopy:!0},{id:"age",title:Be.AGE,label:s?h(s,{style:"short"}):Be.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:g,children:t(xt,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Ms=m.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 o}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
|
+
`,Xs=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=Xt(o?.status),r=Ot(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Bt.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Bt.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Bt.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Ms,{$noPadding:i,children:[t(Mt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(oe,{$gap:8,children:[t(Us,{label:Be.PODS,count:c}),t(Us,{label:Be.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Us,{label:Be.ODIGOS_HEALTHY,icon:$i,count:u,total:c}),t(Us,{label:Be.KUBERNETES_HEALTHY,icon:Ei,count:p,total:c})]})]}):null},Vs=m.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 o}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
|
+
`,Us=({count:o,total:n,label:a,icon:i})=>{const l=f(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Vs,{children:[e(oe,{$gap:0,$alignItems:"flex-end",children:[t(Q,{size:te.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(Q,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(oe,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(Q,{size:te.XXXS,nowrap:!0,children:a})]})]})},Hs=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===Vt.PID)??e.identifyingAttributes?.find(({name:e})=>e===Vt.VPID);return t?.value??null};var Gs;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(Gs||(Gs={}));const js=({overrideProcessNum:o,healthy:i,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=r(Gs.IdentifyingAttributes),g=_t(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Gs.IdentifyingAttributes,label:Be.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:Gs.InstrumentationLibraries,label:Be.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Ni,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[s,c]);n(()=>{b&&h(b)},[b]);const y=a(()=>{switch(p){case Gs.IdentifyingAttributes:return t(V,{children:s?.map(e=>t(qs,{label:e.name,value:e.value},e.name))});case Gs.InstrumentationLibraries:return t(V,{children:c?.map(e=>t(qs,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[p,s,c]),C=a(()=>Hs({overrideProcessNum:o,identifyingAttributes:s}),[o,s]);return t("div",{ref:g,children:e(xt,{bgTint:"800",richTitle:{title:C?`${Be.PROCESS} ${Be.PID(C)}`:Be.PROCESS_FALLBACK_NAME},renderOnRightSide:t(Q,{color:i?ee.Success:ee.Error,size:te.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?we.Success:we.Error,leftIcon:$i,label:i?Be.HEALTHY:Be.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(le,{options:m,selected:p,setSelected:h}),!v&&y]})})},Ws=m.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 o}from"react/jsx-runtime";import{useEffect
|
|
|
216
216
|
&:hover {
|
|
217
217
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
218
218
|
}
|
|
219
|
-
`,
|
|
219
|
+
`,Ks=m(Q)`
|
|
220
220
|
flex: 0 0 30%;
|
|
221
|
-
`,
|
|
221
|
+
`,Ys=m(Q)`
|
|
222
222
|
flex: 1 1 auto;
|
|
223
223
|
min-width: 0;
|
|
224
|
-
`,
|
|
224
|
+
`,Js=m(oe)`
|
|
225
225
|
flex: 1 1 auto;
|
|
226
226
|
justify-content: flex-end;
|
|
227
227
|
min-width: 0;
|
|
228
|
-
`,
|
|
228
|
+
`,qs=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const r="boolean"==typeof i;return e(Ws,{children:[t(Ks,{size:te.XXS,color:ee.Secondary,children:o}),n&&t(Ys,{size:te.XXS,color:ee.Primary,align:"right",children:n}),(r||a)&&e(Js,{children:[a&&t(Fe,{status:we.Info,label:Be.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&t(Fe,{status:i?we.Success:we.Error,label:i?Be.HEALTHY:Be.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Zs=p(null),Qs=({value:e,children:o})=>t(Zs.Provider,{value:e,children:o}),ec=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:Be.CONTAINERS,titleSize:te.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(xt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(oc,{...e,language:Ut(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},tc=m.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
|
+
`,oc=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:g,processes:m,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Lt(),C=_t(v),S=a(()=>({title:n,icon:o?_e(o):Ai,iconWithWrapper:!0}),[n,o]),w=a(()=>{const e=[],t=zt({status:i?Bt.Success:Bt.Disabled,reasonEnum:i?Be.INSTRUMENTED_WITH_DISTRO(i):Be.UNINSTRUMENTED,message:""});t&&e.push(t);const o=zt(h,$i,"health");o&&e.push(o);const n=zt(g,Ei,"health");return n&&e.push(n),e},[g,h,i]),x=a(()=>[{id:"runningTime",title:Be.RUNNING_TIME,label:l?y(l,{style:"short"}):Be.NOT_RUNNING,labelTooltip:`${Be.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?we.Success:Ht.Disabled,leftIcon:r?ri:si,label:r?Be.STARTED:Be.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?we.Success:Ht.Disabled,leftIcon:s?ri:si,label:s?Be.READY:Be.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?we.Error:we.Success,leftIcon:d?si:ri,label:d?Be.CRASHLOOP:Be.NO_CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Be.RESTARTS,badge:{status:c?we.Error:void 0,label:c||0,textSize:te.XXXS}}],[l,y,r,s,d,c]),T=a(()=>p?Ot(u):"",[p,u]);return t("div",{ref:C,children:e(xt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(tc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:Gt.Pink,leftIcon:Ei,label:T}),t(Q,{size:te.XXXS,color:ee.Error,children:p})]})}),(m??[]).map((e,o)=>{const a=o+1,i=b&&(l=f,r=e,!!l?.processPid&&Hs({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(js,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${n}-process-${a}`)})]})})},nc=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:Be.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=a(()=>[{label:Be.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Be.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Be.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(xt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(jt,{bgTint:"700",label:e,value:o},e))})},ac=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=h(Zs);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===zs.Pods?l:null,s=n?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=a(()=>({title:Be.PODS,badge:{label:s.length}}),[s.length]);return t(V,{$gap:12,children:c?e(o,{children:[t(Xs,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(xt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(Bs,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(nc,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(ec,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(Qe,{$height:"70vh",children:t(me,{title:Be.NO_RUNNING_PODS,subTitle:Be.NO_RUNNING_PODS_SUBTITLE})})})},ic=({source:o,fetchPeerSources:i})=>{const s=a(()=>o.serviceName||o.id.name,[o]),[c,d]=r(!1),[u,p]=r(null),h=l(()=>{d(!0),i(s).then(({data:e})=>p(e?.peerSources??null)).finally(()=>d(!1))},[s]);return n(()=>{h()},[h]),!u||c?t(Qe,c?{$height:"70vh",children:t(at,{withSpinner:!0})}:{$height:"70vh",children:t(me,{subTitle:Be.COULD_NOT_FETCH_PEER_SOURCES})}):e(oe,{$gap:16,$alignItems:"flex-start",children:[t(lc,{icon:Oi,title:Be.INBOUND,subTitle:Be.INBOUND_DESCRIPTION(s),onRefresh:h,items:u?.inbound??[]}),t(lc,{icon:Di,title:Be.OUTBOUND,subTitle:Be.OUTBOUND_DESCRIPTION(s),onRefresh:h,items:u?.outbound??[]})]})},lc=({icon:o,title:n,subTitle:i,onRefresh:l,items:s})=>{const[c,d]=r(""),u=a(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(xt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:te.XS,subTitle:i,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ii,onClick:l}}],children:[t(Kt,{value:c,onChange:d,width:"100%"}),t(Yt,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(Qe,{$height:"50vh",children:t(me,{icon:o,title:Be.NO_RESULTS,subTitle:Be.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(sc,{...e},`${n}-${e.serviceName}`)):[t(Qe,{$height:"50vh",children:t(me,{icon:o,title:`No ${n} connections yet`,subTitle:n===Be.INBOUND?Be.NO_INBOUND_CONNECTIONS_DESCRIPTION:Be.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},rc=m.div`
|
|
236
236
|
display: flex;
|
|
237
237
|
align-items: center;
|
|
238
238
|
justify-content: space-between;
|
|
@@ -246,44 +246,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
246
246
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
247
247
|
}
|
|
248
248
|
`}
|
|
249
|
-
`,
|
|
250
|
-
display: flex;
|
|
251
|
-
align-items: center;
|
|
252
|
-
gap: 6px;
|
|
253
|
-
padding: 8px 12px 8px ${({$paddingLeft:e})=>e}px;
|
|
254
|
-
border-radius: 8px;
|
|
255
|
-
cursor: ${({$clickable:e})=>e?"pointer":"default"};
|
|
256
|
-
transition: background-color 0.15s ease;
|
|
257
|
-
&:hover {
|
|
258
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
259
|
-
}
|
|
260
|
-
`,kc=m.div`
|
|
261
|
-
display: flex;
|
|
262
|
-
align-items: center;
|
|
263
|
-
justify-content: center;
|
|
264
|
-
flex-shrink: 0;
|
|
265
|
-
width: 18px;
|
|
266
|
-
height: 18px;
|
|
267
|
-
`,Tc=m.div`
|
|
268
|
-
flex: 1;
|
|
269
|
-
min-width: 0;
|
|
270
|
-
display: flex;
|
|
271
|
-
`,$c=({chevron:o,onClick:n,label:a,name:i,badges:l,action:r,paddingLeft:s})=>{const c=f();return e(xc,{$clickable:!!n,$paddingLeft:s,onClick:n,children:[o&&t(kc,{children:t(o,{size:18,fill:c.v2.colors.silver[200]})}),t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:a}),t(Tc,{children:t(Q,{size:te.XS,nowrap:!0,children:i})}),r&&t(Ie,{text:r.tooltip,children:t(ot,{icon:r.icon,size:nt.XS,onClick:r.onClick})}),l.map(({key:e,...o})=>t(Ec,{...o},e))]})},Ec=({status:e,leftIcon:o,label:n,tooltip:a})=>{const i=o||(e===we.Success?si:ci);return t(Fe,{status:e,leftIcon:i,label:n,tooltip:a,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0})},Ic=({overrideProcessNum:e,pod:o,container:n,process:i})=>{const{jumpToProcess:l}=lc(),r=a(()=>Js({overrideProcessNum:e,identifyingAttributes:i.identifyingAttributes}),[e,i.identifyingAttributes]),s=a(()=>{const e=[],t=zt(i.healthStatus,Ei,"health");return t&&e.push(t),e},[]);return t($c,{label:Be.PROCESS,name:r?Be.PID(r):Be.PROCESS_FALLBACK_NAME,paddingLeft:Ys,action:{icon:Li,onClick:()=>l(o,n,i),tooltip:Be.OPEN_IN_POD_TAB},badges:s})},Nc=m.div`
|
|
272
|
-
display: flex;
|
|
273
|
-
flex-direction: column;
|
|
274
|
-
align-self: stretch;
|
|
275
|
-
border-radius: 8px;
|
|
276
|
-
background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[750]:"transparent"};
|
|
277
|
-
`,Ac=({pod:o,container:n})=>{const[i,l]=r(!1),{jumpToContainer:s}=lc(),c=a(()=>{const e=[],t=Xt(n.odigosHealthStatus?.status);t&&e.push({key:"odigos-health",status:t,leftIcon:Ei,label:io(t,n.odigosHealthStatus?.reasonEnum),tooltip:n.odigosHealthStatus?.message});const o=Xt(n.k8sHealthStatus?.status);return o&&e.push({key:"k8s-health",status:o,leftIcon:Ii,label:io(o,n.k8sHealthStatus?.reasonEnum),tooltip:n.k8sHealthStatus?.message}),e},[]),d=n.processes??[],u=d.length>0;return e(Nc,{$isExpanded:i,children:[t($c,{chevron:u?i?yi:mi:void 0,onClick:u?()=>l(e=>!e):void 0,label:Be.CONTAINER,name:n.containerName,paddingLeft:Ks+(u?0:24),action:{icon:Li,onClick:()=>s(o,n),tooltip:Be.OPEN_IN_POD_TAB},badges:c}),u&&i&&t(V,{$gap:0,$padding:`0 ${js}px`,children:d.map((e,a)=>{const i=a+1;return t(Ic,{overrideProcessNum:i,pod:o,container:n,process:e},`pod-${o.podName}-container-${n.containerName}-process-${i}`)})})]})},Oc=m.div`
|
|
278
|
-
display: flex;
|
|
279
|
-
flex-direction: column;
|
|
280
|
-
align-self: stretch;
|
|
281
|
-
border-radius: 8px;
|
|
282
|
-
background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[800]:"transparent"};
|
|
283
|
-
padding-bottom: ${({$isExpanded:e})=>e?"12px":"0"};
|
|
284
|
-
`,Dc=({pod:o})=>{const[n,i]=r(!1),{jumpToPod:l}=lc(),s=o.containers??[],c=s.length>0,d=a(()=>{const e=[],t=zt(o.agentInjectedStatus);t&&e.push(t);const n=zt(o.odigosHealthStatus,Ei,"health");n&&e.push(n);const a=zt(o.k8sHealthStatus,Ii,"health");return a&&e.push(a),e},[o.k8sHealthStatus,o.odigosHealthStatus,o.agentInjectedStatus]);return e(Oc,{$isExpanded:n,children:[t($c,{chevron:c?n?yi:mi:void 0,onClick:c?()=>i(e=>!e):void 0,label:Be.POD,name:o.podName,paddingLeft:Ws+(c?0:24),action:{icon:Li,onClick:()=>l(o),tooltip:Be.OPEN_IN_POD_TAB},badges:d}),n&&c&&t(V,{$gap:0,$padding:`0 ${Gs}px`,children:s.map(e=>t(Ac,{pod:o,container:e},`pod-${o.podName}-container-${e.containerName}`))})]})},Rc=({pods:e})=>e?.length?t(V,{$gap:4,children:e.map(e=>t(Dc,{pod:e},`pod-${e.podName}`))}):t(Qe,{children:t(me,{title:Be.NO_RUNNING_PODS,subTitle:Be.NO_RUNNING_PODS_SUBTITLE})}),Pc=({source:o})=>t(xt,{bgTint:"1000",richTitle:{title:Be.PODS,badge:{label:o.pods?.length||0}},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(xt,{bgTint:"900",children:[t(Vs,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:o.pods,noPadding:!0}),t(Rc,{pods:o.pods})]})}),Fc=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?lo(e.workloadOdigosHealthStatus.status):pt.Unknown,title:Ot(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Mt,{...o,width:"100%"}):null},Lc="calc(50% - 6px)",_c=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Xt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Ot(t):`${Be.ROLLOUT} ${Ot(t)}`,subTitle:a,action:i!==we.Success?{icon:Ni,tooltip:Be.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),r=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=Xt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Ot(t):`${Be.ROLLBACK} ${Ot(t)}`,subTitle:n,action:a!==we.Success?{icon:Ni,tooltip:Be.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||r?t(xt,{bgTint:"1000",children:e(oe,{$gap:12,$alignItems:"stretch",children:[l&&t(Mt,{invertColors:!0,slim:!0,width:r?Lc:"100%",...l}),r&&t(Mt,{invertColors:!0,slim:!0,width:Lc,...r})]})}):null},zc=p(null),Bc=m.div`
|
|
249
|
+
`,sc=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=Jt(e=>e.drawerEntityId),r=ct(e=>e.sources),s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(qt(s))!==JSON.stringify(qt(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[Zt({serviceName:o,attributes:e})]}if("user"===o?.toLowerCase())return[Ri];const e=s?Qt(s):void 0;return e?.length?e:[Ai]},[n,i,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Jt.getState();e(ut.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(rc,{onClick:u,$withClick:!!u,children:[e(oe,{$gap:8,children:[t(eo,{icons:d}),t(Q,{size:te.XXS,children:o})]}),n&&t(Fe,{status:we.Info,label:Be.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:Be.VIRTUAL_TOOLTIP})]})},cc=({source:o,fetchK8sManifest:i})=>{const l=f(),[s,c]=r(!0),[d,u]=r(void 0),[p,h]=r(!0),[g,m]=r(void 0);n(()=>{i(o.id.namespace,o.id.kind,o.id.name).then(u).finally(()=>c(!1)),i(o.id.namespace,to.InstrumentationConfig,`${o.id.kind}-${o.id.name}`.toLowerCase()).then(m).finally(()=>h(!1))},[i,o.id.namespace,o.id.kind,o.id.name]);const b=a(()=>[{label:Be.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:Be.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:Be.GET_POD_YAML,value:`kubectl get ${to.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.name,o.id.namespace]);return e(xt,{bgTint:"1000",children:[t(xt,{bgTint:"900",richTitle:{icon:Pi,title:Be.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:b.map(({label:e,value:o})=>t(jt,{label:e,value:o},e))}),s?t(oo,{size:1}):t(yl,{bgTint:"800",codeBgColor:l.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(oo,{size:1}):t(yl,{bgTint:"800",codeBgColor:l.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g})]})},dc=({title:o,children:n})=>e(V,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,children:o}),n]}),uc=({source:o})=>{const n=a(()=>{const[e,t]=no(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(dc,{title:Be.THROUGHPUT_LAST_10_SECONDS,children:e(oe,{$alignItems:"flex-end",$gap:4,children:[t(Q,{size:te.L,children:n.value}),t(Q,{size:te.XS,variant:mt.Span,children:n.units})]})})},pc=({source:o})=>{const{CopyButton:n}=ao();return t(dc,{title:Be.NAMESPACE,children:e(oe,{children:[t(Pt,{variant:Gt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:nt.XS})]})})},hc=({source:e})=>t(dc,{title:Be.KIND,children:t(oe,{children:t(Pt,{variant:Gt.Blue,label:e.id.kind})})}),gc=({source:o})=>{const{CopyButton:n}=ao();return t(dc,{title:Be.NAME,children:e(oe,{children:[t(Pt,{variant:Gt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:nt.XS})]})})},mc=({source:o})=>{const{isVm:n}=y();return t(xt,{children:e(oe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!n&&t(uc,{source:o}),!n&&t(pc,{source:o}),t(hc,{source:o}),t(gc,{source:o})]})})},fc=({source:e})=>t(xt,{bgTint:"900",children:t(Xs,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}),bc=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?io(e.workloadOdigosHealthStatus.status):pt.Unknown,title:Ot(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Mt,{...o,width:"100%"}):null},vc="calc(50% - 6px)",yc=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Xt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Ot(t):`${Be.ROLLOUT} ${Ot(t)}`,subTitle:a,action:i!==we.Success?{icon:Ii,tooltip:Be.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),r=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=Xt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Ot(t):`${Be.ROLLBACK} ${Ot(t)}`,subTitle:n,action:a!==we.Success?{icon:Ii,tooltip:Be.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||r?e(oe,{$gap:12,$alignItems:"stretch",children:[l&&t(Mt,{invertColors:!0,slim:!0,width:r?vc:"100%",...l}),r&&t(Mt,{invertColors:!0,slim:!0,width:vc,...r})]}):null},Cc=p(null),Sc=m.div`
|
|
285
250
|
position: relative;
|
|
286
|
-
`,
|
|
251
|
+
`,wc=({children:e})=>{const o=i(null);return t(Sc,{ref:o,children:t(Cc.Provider,{value:o,children:e})})},xc=m.div`
|
|
287
252
|
position: fixed;
|
|
288
253
|
top: ${({$coords:e})=>e.top}px;
|
|
289
254
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -297,14 +262,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
297
262
|
padding: 12px 16px;
|
|
298
263
|
border-radius: 12px;
|
|
299
264
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
300
|
-
`,
|
|
265
|
+
`,Tc=m.div`
|
|
301
266
|
display: flex;
|
|
302
267
|
align-items: flex-end;
|
|
303
268
|
justify-content: space-between;
|
|
304
269
|
gap: 8px;
|
|
305
|
-
`,
|
|
270
|
+
`,kc=m.div`
|
|
306
271
|
flex: 1;
|
|
307
|
-
|
|
272
|
+
`,$c=({width:o,onClose:n,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:s,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:m})=>{const b=f(),v=h(Cc),[y,C]=r(null);return lo(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Vl(e(xc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(V,{$gap:4,children:[t(Q,{size:te.XXS,children:c}),t(Q,{size:te.XXXS,color:ee.Secondary,children:d})]}),e(Tc,{children:[t(kc,{children:p}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${m||0} 0`,children:[t(ne,{variant:ie.Secondary,onClick:l,leftIcon:ai,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ae.S,textColor:b.v2.colors.red[500]}),t(ne,{variant:ie.Primary,onClick:a,leftIcon:yi,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ae.S})]})]}),t("div",{children:t(Se,{status:we.Warning,message:u})})]}),document.body):null},Ec=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=$t(l),p=a(()=>{if(!o)return[];const e=ro[o].community,t=s===ht.Onprem?ro[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,s]),[h,g]=r(!1),[m,f]=r(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(oe,{$gap:4,$alignItems:"center",children:[n?t(Fe,{status:we.Info,invertColors:!0,label:Be.OVERIDDEN}):null,e(wc,{children:[t(Ie,{text:Be.OVERRIDE_OTEL_DISTRO_NAME,children:t(ot,{icon:ui,onClick:b})}),m&&t($c,{width:"500px",onClose:b,onSave:async()=>{g(!0),await i(c),g(!1),b()},saveTooltip:Be.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await i({otelDistroName:null}),g(!1),b()},deleteTooltip:Be.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Be.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Be.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Be.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(tt,{label:Be.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Ic=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:s}=Dt(),{formData:c,handleFormChange:d,resetFormData:u}=$t(i),p=a(()=>so.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,g]=r(!1),[m,f]=r(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(oe,{children:[o?t(Fe,{status:we.Info,invertColors:!0,label:Be.OVERIDDEN}):null,e(wc,{children:[t(Ie,{text:Be.OVERRIDE_RUNTIME_DETAILS,children:t(ot,{icon:ui,onClick:b})}),m&&t($c,{width:"500px",onClose:b,onSave:async()=>{!c.version||co(c.version)?(g(!0),await n(c),g(!1),b()):s({type:we.Warning,message:Rt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Be.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await n({language:null,version:""}),g(!1),b()},deleteTooltip:Be.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Be.OVERRIDE_RUNTIME_DETAILS,subTitle:Be.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Be.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(oe,{$gap:8,children:[t(tt,{label:Be.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(pe,{label:Be.RUNTIME_VERSION,placeholder:Be.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Nc=({source:e,onOverride:o})=>{const{isVm:n}=y(),{containers:i,containersRichTitle:l}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Be.DETECTED_PROCESSES:`${e.id.kind} ${Be.CONTAINERS}`,tooltip:t?.message||(n?Be.DETECTED_PROCESSES_DESCRIPTION:Be.DETECTED_CONTAINERS_DESCRIPTION),badge:Xt(t?.status)===Ht.Loading?{status:Ht.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(xt,{bgTint:"1000",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:i.map(e=>e&&t(Rc,{...e,onOverride:o},`source-container-${e.containerName}`))})})},Ac=m.div`
|
|
308
273
|
display: flex;
|
|
309
274
|
flex-direction: column;
|
|
310
275
|
align-self: stretch;
|
|
@@ -312,28 +277,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
312
277
|
padding: 8px 12px;
|
|
313
278
|
border-radius: 8px;
|
|
314
279
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
315
|
-
`,
|
|
280
|
+
`,Oc=m.div`
|
|
316
281
|
display: flex;
|
|
317
282
|
align-items: center;
|
|
318
283
|
justify-content: center;
|
|
319
284
|
padding: 8px;
|
|
320
285
|
border-radius: 10px;
|
|
321
286
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
322
|
-
`,
|
|
287
|
+
`,Dc=m.div`
|
|
323
288
|
display: flex;
|
|
324
289
|
flex-direction: column;
|
|
325
290
|
gap: 12px;
|
|
326
291
|
padding: 8px 12px;
|
|
327
292
|
border-radius: 8px;
|
|
328
293
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
329
|
-
`,qc=({onOverride:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=f(),d=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=a(()=>({language:Ut(n),version:po(n)||void 0}),[n]),p=a(()=>!!s?.otelDistroName,[s]),h=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!d,[l,d]),m=a(()=>g?Oi:_e(u.language),[g,u]),b=a(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),v=a(()=>g?{status:Ht.Loading,label:Be.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?we.Success:Ht.Disabled,leftIcon:r?.otelDistroName?si:ci,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),y=e=>o({containerName:i,...p?h:{},...d?u:{},...e});return e(Kc,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Yc,{children:t(m,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(Q,{children:i}),t(Pt,b?{variant:Gt.Blue,label:b}:{variant:Gt.Loader,label:Be.DETECTING_RUNTIME_INFO}),t(jc,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(Fe,{...v,textSize:te.XXXS}),t(Gc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!r||r.agentEnabled||g?null:t(Jc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:Gt.Pink,label:Ot(r.agentEnabledStatus?.reasonEnum)||Be.NO_AVAILABLE_AGENT}),t(Q,{size:te.XXXS,color:ee.Secondary,children:r?.agentEnabledStatus?.message})]})})]})},Zc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>{const{isVm:l}=y();return e(V,{$gap:12,children:[t(wc,{source:o}),t(Fc,{source:o}),!l&&t(_c,{source:o,onClickRollout:n,onClickRollback:a}),!l&&t(Wc,{source:o,onOverride:i}),!l&&t(Pc,{source:o})]})};function Qc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function ed(e){const t=Math.abs(e);return t>=1e9?`${td(e/1e9)}s`:t>=1e6?`${td(e/1e6)}ms`:t>=1e3?`${td(e/1e3)}μs`:String(Math.round(e))}function td(e){return e.toFixed(2).replace(/\.?0+$/,"")}function od(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function nd(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function ad(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function id(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1}=i,c=od(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(r&&(d=d.filter(t=>r(Qc(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Qc(e,l.nameIndex)===Qc(e,t.nameIndex)&&a.add(nd(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(nd(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(nd(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const g=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,m=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/g,m)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,r=Math.max(f-v,1),s=Qc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:r,name:s,matchesSearch:ad(s,b)}})}function ld(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var rd,sd;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(rd||(rd={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(sd||(sd={}));function cd(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function dd(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function ud(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const pd=({flamebearer:o,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const m=f(),b=i(null),v=i(null),y=i({x:0,y:0}),C=i(o.numTicks),[S,w]=r({w:0,h:0}),[x,k]=r(""),[T,$]=r(null),[E,I]=r([]),[N,A]=r(!1),[O,D]=r(rd.Fit),[R,P]=r(sd.Fit),[F,L]=r(!1),_=Math.max(1,Math.min(Math.floor(S.w*O),8192)),z=Math.max(1,Math.min(Math.floor(S.h*R),8192)),B=E.length>0?E[E.length-1]:null,M=B?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,I([]))},[o.numTicks]),g(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!N)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[N]),n(()=>(p?.(N),()=>{N&&p?.(!1)}),[N,p]);const X=a(()=>id(o,_,z,s,c,{zoomRoot:B,shouldKeepName:d,collapseRecursive:F}),[o,s,c,z,_,B,d,F]),V=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?c.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,c]),U=l(e=>{if(_<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=dd((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*z,V);if(n){const e=nd(n);$(e);const t=M>0?(100*n.size/M).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";k(`${n.name}\ntotal ${ed(n.size)} (${t}% of view, ${a}% of profile) · self ${ed(n.self)}`)}else $(null),k("")},[V,o.numTicks,z,_,M]),H=l(e=>{U(e)},[U]),G=l(()=>{$(null),k("")},[]),j=l(e=>{y.current={x:e.clientX,y:e.clientY}},[]),W=l(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||z<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=dd((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*z,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);I(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,z,_]);g(()=>{const e=v.current;if(!e||_<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,z),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(z*a),e.style.width=`${_}px`,e.style.height=`${z}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,_,z),X?.length?function(e,t,o,n,a,i,l,r){const s=i.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=ld(s,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=cd(d,r),m=`${s} (${ed(d)}, ${g}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(nd(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,_,z,X,c,m,T,o.numTicks):(i.fillStyle=m.v2.colors.silver[900],i.fillRect(0,0,_,z)))},[X,o.numTicks,T,c,z,_,m]);const J=l(()=>A(e=>!e),[]),q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(M/o.numTicks*100))):100,Z=a(()=>function(e,t){const o=od(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let r=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!r||e.size>r.size||e.size===r.size&&e.level<r.level)&&(r=e);return r}(o,B),[o,B]),re=null!==Z,se=E.length>0,ce=B?Qc(o,B.nameIndex):"",de=l(()=>I([]),[]),ue=l(()=>I(e=>e.slice(0,-1)),[]),pe=l(()=>{Z&&I(e=>[...e,Z])},[Z]);return e("div",{style:N?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:m.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(oe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(K,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Y.Left,size:gt.S,value:F,onChange:L}),e(oe,{$gap:8,children:[e(oe,{children:[t(ne,{variant:ie.Secondary,size:ae.S,label:"Reset zoom",leftIcon:_i,onClick:de,disabled:!E.length}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:zi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!se,onClick:ue}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(Q,{size:te.XXS,color:ee.Secondary,nowrap:!0,align:"center",children:`${q}%`})}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:li,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!re,onClick:pe})]}),e(oe,{children:[t(Ie,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(le,{variant:ho.Filled,options:[{value:rd.Fit,label:"W: Fit"},{value:rd.X10,label:"10x"}],selected:O,setSelected:D})}),t(Ie,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(le,{variant:ho.Filled,options:[{value:sd.Fit,label:"H: Fit"},{value:sd.X10,label:"10x"}],selected:R,setSelected:P})})]}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:24,leftIcon:N?Si:Li,tooltip:N?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:J})]})]}),t(Ie,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:N?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:z||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:T?"pointer":"default"},onPointerDown:j,onPointerMove:H,onPointerLeave:G,onClick:W})})})}),e(oe,{$justifyContent:"space-between",children:[t(Q,B?{size:te.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${ce} • ${ed(M)} samples in view`}:{size:te.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(Q,{size:te.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ud(h.totalBytesUsed)} / ${ud(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var hd,gd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(hd||(hd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(gd||(gd={}));const md=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function fd(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(gd.FilterOutVoid)&&"void"===o)return!1;if(t.includes(gd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&md.test(o)))return!1}return!0}const bd={options:[{id:gd.FilterOutVoid,label:"Filter out void symbols"},{id:gd.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>fd(e.cells.find(e=>e.key===hd.Symbol)?.rawValue?.toString()??"",t)},vd=({rows:e,languages:o,filters:n,onFiltersChange:i})=>{const l=a(()=>[{key:hd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(go.Java)?bd:void 0,noFilter:!o?.includes(go.Java)},{key:hd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:hd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),r=a(()=>e.map(e=>({cells:[{key:hd.Symbol,rawValue:e.name},{key:hd.Self,rawValue:ed(e.self)},{key:hd.Total,rawValue:ed(e.total)}]})),[e]);return t(mo,{variant:fo.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:n,onFiltersChange:i,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Bi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var yd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(yd||(yd={}));const Cd=m(V)`
|
|
294
|
+
`,Rc=({onOverride:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=f(),d=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=a(()=>({language:Ut(n),version:uo(n)||void 0}),[n]),p=a(()=>!!s?.otelDistroName,[s]),h=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!d,[l,d]),m=a(()=>g?Ai:_e(u.language),[g,u]),b=a(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),v=a(()=>g?{status:Ht.Loading,label:Be.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?we.Success:Ht.Disabled,leftIcon:r?.otelDistroName?ri:si,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),y=e=>o({containerName:i,...p?h:{},...d?u:{},...e});return e(Ac,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Oc,{children:t(m,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(Q,{children:i}),t(Pt,b?{variant:Gt.Blue,label:b}:{variant:Gt.Loader,label:Be.DETECTING_RUNTIME_INFO}),t(Ic,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(Fe,{...v,textSize:te.XXXS}),t(Ec,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!r||r.agentEnabled||g?null:t(Dc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:Gt.Pink,label:Ot(r.agentEnabledStatus?.reasonEnum)||Be.NO_AVAILABLE_AGENT}),t(Q,{size:te.XXXS,color:ee.Secondary,children:r?.agentEnabledStatus?.message})]})})]})},Pc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>{const{isVm:l}=y();return e(V,{$gap:12,children:[t(mc,{source:o}),t(bc,{source:o}),!l&&t(yc,{source:o,onClickRollout:n,onClickRollback:a}),!l&&t(Nc,{source:o,onOverride:i}),!l&&t(fc,{source:o})]})};function Fc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function Lc(e){const t=Math.abs(e);return t>=1e9?`${_c(e/1e9)}s`:t>=1e6?`${_c(e/1e6)}ms`:t>=1e3?`${_c(e/1e3)}μs`:String(Math.round(e))}function _c(e){return e.toFixed(2).replace(/\.?0+$/,"")}function zc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function Bc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Mc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Xc(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1}=i,c=zc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(r&&(d=d.filter(t=>r(Fc(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Fc(e,l.nameIndex)===Fc(e,t.nameIndex)&&a.add(Bc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(Bc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Bc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const g=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,m=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/g,m)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,r=Math.max(f-v,1),s=Fc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:r,name:s,matchesSearch:Mc(s,b)}})}function Vc(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var Uc,Hc;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Uc||(Uc={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Hc||(Hc={}));function Gc(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function jc(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function Wc(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 Kc=({flamebearer:o,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const m=f(),b=i(null),v=i(null),y=i({x:0,y:0}),C=i(o.numTicks),[S,w]=r({w:0,h:0}),[x,T]=r(""),[k,$]=r(null),[E,I]=r([]),[N,A]=r(!1),[O,D]=r(Uc.Fit),[R,P]=r(Hc.Fit),[F,L]=r(!1),_=Math.max(1,Math.min(Math.floor(S.w*O),8192)),z=Math.max(1,Math.min(Math.floor(S.h*R),8192)),B=E.length>0?E[E.length-1]:null,M=B?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,I([]))},[o.numTicks]),g(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!N)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[N]),n(()=>(p?.(N),()=>{N&&p?.(!1)}),[N,p]);const X=a(()=>Xc(o,_,z,s,c,{zoomRoot:B,shouldKeepName:d,collapseRecursive:F}),[o,s,c,z,_,B,d,F]),V=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?c.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,c]),U=l(e=>{if(_<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=jc((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*z,V);if(n){const e=Bc(n);$(e);const t=M>0?(100*n.size/M).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";T(`${n.name}\ntotal ${Lc(n.size)} (${t}% of view, ${a}% of profile) · self ${Lc(n.self)}`)}else $(null),T("")},[V,o.numTicks,z,_,M]),H=l(e=>{U(e)},[U]),G=l(()=>{$(null),T("")},[]),j=l(e=>{y.current={x:e.clientX,y:e.clientY}},[]),W=l(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||z<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=jc((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*z,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);I(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,z,_]);g(()=>{const e=v.current;if(!e||_<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,z),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(z*a),e.style.width=`${_}px`,e.style.height=`${z}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,_,z),X?.length?function(e,t,o,n,a,i,l,r){const s=i.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Vc(s,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=Gc(d,r),m=`${s} (${Lc(d)}, ${g}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(Bc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,_,z,X,c,m,k,o.numTicks):(i.fillStyle=m.v2.colors.silver[900],i.fillRect(0,0,_,z)))},[X,o.numTicks,k,c,z,_,m]);const J=l(()=>A(e=>!e),[]),q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(M/o.numTicks*100))):100,Z=a(()=>function(e,t){const o=zc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let r=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!r||e.size>r.size||e.size===r.size&&e.level<r.level)&&(r=e);return r}(o,B),[o,B]),re=null!==Z,se=E.length>0,ce=B?Fc(o,B.nameIndex):"",de=l(()=>I([]),[]),ue=l(()=>I(e=>e.slice(0,-1)),[]),pe=l(()=>{Z&&I(e=>[...e,Z])},[Z]);return e("div",{style:N?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:m.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(oe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(K,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Y.Left,size:gt.S,value:F,onChange:L}),e(oe,{$gap:8,children:[e(oe,{children:[t(ne,{variant:ie.Secondary,size:ae.S,label:"Reset zoom",leftIcon:Fi,onClick:de,disabled:!E.length}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:Li,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!se,onClick:ue}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(Q,{size:te.XXS,color:ee.Secondary,nowrap:!0,align:"center",children:`${q}%`})}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:ii,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!re,onClick:pe})]}),e(oe,{children:[t(Ie,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(le,{variant:po.Filled,options:[{value:Uc.Fit,label:"W: Fit"},{value:Uc.X10,label:"10x"}],selected:O,setSelected:D})}),t(Ie,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(le,{variant:po.Filled,options:[{value:Hc.Fit,label:"H: Fit"},{value:Hc.X10,label:"10x"}],selected:R,setSelected:P})})]}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:24,leftIcon:N?Ci:_i,tooltip:N?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:J})]})]}),t(Ie,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:N?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:z||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:k?"pointer":"default"},onPointerDown:j,onPointerMove:H,onPointerLeave:G,onClick:W})})})}),e(oe,{$justifyContent:"space-between",children:[t(Q,B?{size:te.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${ce} • ${Lc(M)} samples in view`}:{size:te.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(Q,{size:te.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Wc(h.totalBytesUsed)} / ${Wc(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var Yc,Jc;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Yc||(Yc={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Jc||(Jc={}));const qc=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Zc(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Jc.FilterOutVoid)&&"void"===o)return!1;if(t.includes(Jc.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&qc.test(o)))return!1}return!0}const Qc={options:[{id:Jc.FilterOutVoid,label:"Filter out void symbols"},{id:Jc.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>Zc(e.cells.find(e=>e.key===Yc.Symbol)?.rawValue?.toString()??"",t)},ed=({rows:e,languages:o,filters:n,onFiltersChange:i})=>{const l=a(()=>[{key:Yc.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(ho.Java)?Qc:void 0,noFilter:!o?.includes(ho.Java)},{key:Yc.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Yc.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),r=a(()=>e.map(e=>({cells:[{key:Yc.Symbol,rawValue:e.name},{key:Yc.Self,rawValue:Lc(e.self)},{key:Yc.Total,rawValue:Lc(e.total)}]})),[e]);return t(go,{variant:mo.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:n,onFiltersChange:i,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:zi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var td;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(td||(td={}));const od=m(V)`
|
|
330
295
|
width: 100%;
|
|
331
296
|
flex: 1;
|
|
332
297
|
border-radius: 16px;
|
|
333
298
|
overflow: hidden;
|
|
334
299
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
335
300
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
336
|
-
`,
|
|
301
|
+
`,nd=m.div`
|
|
337
302
|
display: flex;
|
|
338
303
|
align-items: center;
|
|
339
304
|
gap: 10px;
|
|
@@ -341,11 +306,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
341
306
|
padding: 12px 12px 8px;
|
|
342
307
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
343
308
|
border-radius: 16px 16px 0 0;
|
|
344
|
-
`,
|
|
309
|
+
`,ad=m(oe)`
|
|
345
310
|
flex-shrink: 0;
|
|
346
311
|
align-items: center;
|
|
347
312
|
gap: 4px;
|
|
348
|
-
`,
|
|
313
|
+
`,id=m.div`
|
|
349
314
|
flex: 1;
|
|
350
315
|
display: flex;
|
|
351
316
|
align-items: stretch;
|
|
@@ -353,20 +318,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
353
318
|
padding: 16px;
|
|
354
319
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
355
320
|
border-radius: 0 0 16px 16px;
|
|
356
|
-
`,
|
|
321
|
+
`,ld=m(V)`
|
|
357
322
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
358
323
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
359
324
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
360
325
|
gap: 10px;
|
|
361
|
-
`,
|
|
326
|
+
`,rd=m(V)`
|
|
362
327
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
363
328
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
364
329
|
gap: 10px;
|
|
365
|
-
|
|
330
|
+
`,sd=m(oe)`
|
|
366
331
|
width: 100%;
|
|
367
332
|
min-height: 32px;
|
|
368
333
|
flex-shrink: 0;
|
|
369
|
-
`,
|
|
334
|
+
`,cd=({source:o,fetchProfilingSlots:c,enableProfiling:d,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=f(),g=o.id,[m,b]=r(!0),[v,y]=r(null),[C,S]=r(null),[w,x]=r(0),[T,k]=r(td.Both),[$,E]=r(""),[I,N]=r({}),A=i(null),O=l(async()=>{try{const e=[c()];m&&e.push(u(g));const[t,o]=await Promise.all(e);t&&y(t),o?.profileJson&&S(o.profileJson)}finally{x(e=>e+1)}},[c,u,g]);n(()=>{let e=!1;return(async()=>{await d(g),e||(await O(),e||(A.current=setInterval(O,3e3)))})(),()=>{e=!0,A.current&&clearInterval(A.current)}},[d,O,g]);const D=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(C),[C]),R=a(()=>D?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=Fc(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||a>r.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(D.flamebearer):[],[D]),P=a(()=>{const e=$.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,$]),F=T===td.Table||T===td.Both,L=T===td.Flame||T===td.Both,_=F&&L,z=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),B=a(()=>function(e,t){if(!t?.includes(ho.Java))return;const o=e?.[Yc.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>Zc(e,o):void 0}(I,z),[I,z]);return!C&&w<2?t(Qe,{$height:"70vh",children:t(at,{withSpinner:!0})}):e(od,{$gap:0,$width:"100%",children:[e(nd,{children:[t(Ie,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(ad,{children:t(Q,{size:te.S,weight:500,color:ee.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(oe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Kt,{value:$,onChange:E,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(le,{variant:po.Filled,options:[{value:td.Table,label:"Top table"},{value:td.Flame,label:"Flame graph"},{value:td.Both,label:"Both"}],selected:T,setSelected:k}),t(ne,m?{variant:ie.Secondary,size:ae.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Bi,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:ie.Secondary,size:ae.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Bi,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(id,{$gap:F&&L?16:0,children:D?e(s,{children:[F&&e(ld,{$splitWithFlame:_,children:[t(sd,{$justifyContent:"flex-end",children:t(ne,{variant:ie.Secondary,size:ae.S,label:"Download snapshot",rightIcon:Mi,onClick:()=>{if(!C)return;const e=new Blob([C],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!C})}),t(ed,{rows:P,languages:z,filters:I,onFiltersChange:N})]}),L&&e(rd,{$splitWithTable:_,children:[e(sd,{$justifyContent:"space-between",children:[t(Fe,{label:D?`Total in view ${Lc(D.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:te.XXS}),e(oe,{$gap:12,children:[!m&&t(ne,{variant:ie.Secondary,size:ae.S,label:"Refresh",leftIcon:Ii,onClick:O}),t(K,{label:"Auto refresh",labelAlign:Y.Left,size:gt.S,value:m,onChange:b})]})]}),t(Kc,{flamebearer:D.flamebearer,maxRowPx:24,searchQuery:$,shouldKeepName:B,minHostHeight:280,onFullscreenChange:p,profilingSlots:v},T)]})]}):t(Qe,{children:t(me,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},dd=[to.Deployment,to.StatefulSet,to.DaemonSet,to.DeploymentConfig,to.Rollout,to.Pod];var ud;!function(e){e.Workload="Workload",e.Pod="Pod"}(ud||(ud={}));const pd=e=>!!e&&Xt(e.status)===we.Error,hd=e=>pd(e.healthStatus),gd=e=>pd(e.odigosHealthStatus)||(e.processes??[]).some(hd),md=e=>pd(e.agentInjectedStatus)||pd(e.odigosHealthStatus)||(e.containers??[]).some(gd),fd=({onClose:o,effectiveConfig:s,sourceId:c,fetchSourceById:d,persistSources:u,updateSource:p,restartWorkloads:h,restartPod:g,recoverFromRollback:m,fetchPeerSources:b,enableProfiling:v,fetchProfilingSlots:C,fetchSourceProfiling:S,fetchK8sManifest:w})=>{const x=f(),{isVm:T}=y(),{selectedStreamName:k}=Me(),{genericForm:$,loadSource:E,validateFormData:I}=El(),[N,A]=r(!1),[O,D]=r(!1),[R,P]=r(!1),[F,L]=r(zs.Overview),[_,z]=r(null),[B,M]=r({openFor:null}),X=(()=>{const[e,t]=r(null),o=l(e=>{t({tab:zs.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:zs.Pods,podName:e.podName,containerName:o.containerName})},[]),i=l((e,o,n)=>{const a=Hs({identifyingAttributes:n.identifyingAttributes});t({tab:zs.Pods,podName:e.podName,containerName:o.containerName,processPid:a})},[]),s=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:s}),[e,o,n,i,s])})();n(()=>{X.jumpToTarget&&L(X.jumpToTarget.tab)},[X.jumpToTarget]),n(()=>{_&&JSON.stringify(qt(c))!==JSON.stringify(qt(_))&&z(null)},[c,_]);const U=i(!1),H=l(async()=>z(await d(c)||null),[c]);n(()=>{if(U.current||(H(),U.current=!0),!N){const e=setInterval(()=>H(),3e3);return()=>clearInterval(e)}},[H,N]),n(()=>{_&&E(_)},[_]);const G=_&&dd.includes(_.id.kind),j=a(()=>{const e=[],o=(_?.pods??[]).some(md);return e.push({value:zs.Overview,label:Be.OVERVIEW}),T||(e.push({value:zs.Pods,label:Be.PODS,icon:o?e=>t(Ni,{...e,fill:x.v2.colors.red[500]}):void 0}),e.push({value:zs.PeerSources,label:Be.PEER_SOURCES}),s?.profiling?.enabled&&e.push({value:zs.Profiling,label:Be.PROFILING}),e.push({value:zs.Debug,label:Be.DEBUG})),e},[T,s,_?.pods]),W=l(()=>A(!0),[]),K=l(()=>{_&&E(_),A(!1)},[_]),Y=l(async()=>{if(!_||!$)return;const{errorMessage:e,preparedFormData:t}=I();if(e)return;const o=t.otelServiceName!==_.id.name?t.otelServiceName:"";await p(c,{...t,otelServiceName:o}),A(!1)},[_,$,I,c,p]),J=l(()=>D(!0),[]),Z=l(async()=>{_&&(await u({[yt]:[{namespace:_.id.namespace,name:_.id.name,kind:_.id.kind,selected:!1,currentStreamName:k}]}),D(!1),o())},[_,u,k,o]),Q=l(()=>{M({openFor:ud.Workload})},[]),ee=l(e=>{L(e),X.clearJumpToTarget()},[X]),oe=l(async()=>{await m(c)},[m,c]),ne=l(async()=>{B.openFor===ud.Workload?await h([c]):B.openFor===ud.Pod&&B.podNamespace&&B.podName&&await g(B.podNamespace,B.podName),M({openFor:null})},[B,h,g,c]),ae=a(()=>{const e=[];return N||F===zs.Overview&&(e.push({id:"edit-source-btn-edit",label:St.EDIT,icon:ui,active:N,onClick:W}),!T&&G&&e.push({id:"edit-source-btn-restart",label:St.RESTART,icon:Xi,onClick:Q}),e.push({id:"edit-source-btn-delete",label:St.DELETE,icon:ai,color:x.v2.colors.red[500],active:O,onClick:J})),e},[F,N,O,T,G,W,Q,J,x]),re=a(()=>{if(!_)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:_.id.name,leftIcon:T?void 0:Ei}),_.serviceName&&_.serviceName!==_.id.name&&e.push({...t,label:_.serviceName,leftIcon:$i,textColor:x.v2.colors.silver[200]}),e},[_,x,T]);if(!_)return t(q,{isOpen:!0,children:t(Qe,{$height:"80vh",children:t(at,{withSpinner:!0})})});const se=F===zs.Profiling?R?"95vw":"80vw":N?void 0:"60vw";return e(Qs,{value:X,children:[t(q,{isOpen:!0,width:se,header:{icon:T?Vi:fo(_.containers)[0],titleBadges:re,onClose:()=>{ee(zs.Overview),z(null),P(!1),o()},actions:ae},footer:{actions:N?[{"data-id":"edit-source-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:K},{"data-id":"edit-source-btn-save",label:St.SAVE,variant:ie.Primary,onClick:Y}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:e(V,{$gap:16,children:[!N&&j.length>1&&t(le,{options:j,selected:F,setSelected:ee}),(()=>{switch(F){case zs.Overview:return N?t(Mr,{}):t(Pc,{source:_,onClickRollout:Q,onClickRollback:oe,onOverride:e=>p(c,e)});case zs.Pods:return t(ac,{source:_,onClickRestartPod:G?(e,t)=>M({openFor:ud.Pod,podNamespace:e,podName:t}):void 0});case zs.PeerSources:return t(ic,{source:_,fetchPeerSources:b});case zs.Profiling:return t(cd,{source:_,fetchProfilingSlots:C,enableProfiling:v,fetchSourceProfiling:S,onFlameFullscreenChange:P});case zs.Debug:return t(cc,{source:_,fetchK8sManifest:w});default:return null}})()]})})}),t(bl,{target:"source",action:"uninstrument",isOpen:O,onClose:()=>D(!1),onApprove:Z}),t(bl,{target:`${B.openFor?.toLowerCase()??""}`,action:"restart",description:Be.RESTART_POD_DESCRIPTION,isOpen:!!B.openFor,onClose:()=>M({openFor:null}),onApprove:ne,overrideApproveButtonLabel:Be.DELETE_POD_TO_RESTART})]})},bd=m.div`
|
|
370
335
|
display: flex;
|
|
371
336
|
align-items: center;
|
|
372
337
|
gap: 8px;
|
|
@@ -376,9 +341,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
376
341
|
&:hover {
|
|
377
342
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
378
343
|
}
|
|
379
|
-
`,
|
|
344
|
+
`,vd=m.div`
|
|
380
345
|
flex: 1;
|
|
381
|
-
`,
|
|
346
|
+
`,yd=({onClick:o})=>{const n=f().v2.colors.red[500];return e(bd,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(Q,{size:te.XS,weight:500,color:n,children:Co}),t(ai,{size:16,fill:n})]})};function Cd(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(yd,{onClick:l}),r&&t(Se,{status:we.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(vd,{}),t(ne,{"data-id":"sampling-view-edit-btn-cancel",label:bo,variant:ie.Secondary,size:ae.S,onClick:a}),t(ne,{"data-id":"sampling-view-edit-btn-save",label:vo,variant:ie.Primary,size:ae.S,onClick:i,disabled:!!r})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(yd,{onClick:a}),t(vd,{}),t(ne,{"data-id":"sampling-view-btn-cancel",label:bo,variant:ie.Secondary,size:ae.S,onClick:i}),t(ne,{"data-id":"sampling-view-btn-edit",label:yo,variant:ie.Primary,size:ae.S,onClick:l})]})}}const Sd={[Nl.EditAutoNoisy]:{title:Oo,subTitle:Ao,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Nl.EditAutoCostReduction]:{title:No,subTitle:Io,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Nl.EditAutoHighlyRelevant]:{title:Eo,subTitle:$o,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},wd=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(q,{isOpen:e,width:Ro,header:{icon:Ui,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(wt,{$padding:"12px",children:t(jr,{})})}),xd=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:r})=>{const{category:s,formData:c,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=Il(Nl.Create);n(()=>{e&&d()},[e]);const h=l(()=>{if(i){const e=i(c);if(e)return void p(e)}a(c)},[c,a,i,p]),g={note:u?{status:we.Warning,message:u.message,action:r?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>r(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:bo,variant:ie.Secondary,size:ae.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:To,variant:ie.Primary,size:ae.S,onClick:h,disabled:!!u}]};return t(wd,{isOpen:e,title:ko[s],subTitle:So[s],onClose:o,footer:g})},Td=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:i,onNavigateToDuplicate:r})=>{const{data:s,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:g}=Il(Nl.View),m=s?.rule.name||xo,f=c&&s?wo[s.category]:`${m} preview`,b=l(()=>{if(s&&c){if(i){const e=i(d);if(e)return void g(e)}n(d,s.rule.ruleId,s.samplingId)}},[s,c,d,n,i,g]),v=l(()=>{s&&o(s.rule.ruleId,s.samplingId)},[s,o]),y=a(()=>{if(!s)return;const t=h?{message:h.message,onViewRule:r?()=>r(h.ruleId):void 0}:null;return Cd(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(wd,{isOpen:!!s,title:f,subTitle:s?So[s.category]:"",onClose:e,footer:y})},kd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Il(Nl.EditAutoNoisy),r=l(()=>n(a,i),[n,a,i]);return t(Id,{formType:Nl.EditAutoNoisy,isOpen:e,onClose:o,onSave:r})},$d=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Il(Nl.EditAutoCostReduction),r=l(()=>n(a,i),[n,a,i]);return t(Id,{formType:Nl.EditAutoCostReduction,isOpen:e,onClose:o,onSave:r})},Ed=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=Il(Nl.EditAutoHighlyRelevant),i=l(()=>n(a),[n,a]);return t(Id,{formType:Nl.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},Id=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=Sd[e];return t(wd,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:bo,variant:ie.Secondary,size:ae.S,onClick:n},{"data-id":i.saveId,label:Do,variant:ie.Primary,size:ae.S,onClick:a}]}})},Nd=e=>{switch(e.formType){case Nl.Create:return t(Fl,{formType:Nl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(xd,{...e})});case Nl.View:return t(Fl,{formType:Nl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Td,{...e})});case Nl.EditAutoNoisy:return t(Fl,{formType:Nl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(kd,{...e})});case Nl.EditAutoCostReduction:return t(Fl,{formType:Nl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t($d,{...e})});case Nl.EditAutoHighlyRelevant:return t(Fl,{formType:Nl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Ed,{...e})})}},Ad=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=ao(),g=!i||a||!c.newToken;return Po({key:"Enter",active:!g},s),e(oe,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(pe,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(oe,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(at,{title:"Saving...",withGradient:!0}):e(o,{children:[t(ne,{variant:ie.Secondary,size:ae.S,leftIcon:Ci,onClick:r,disabled:a}),t(ne,{variant:ie.Primary,size:ae.S,leftIcon:yi,onClick:s,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(Q,{size:te.XS,children:new Array(55).fill("•").join("")}),e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(ot,{icon:ui,onClick:l})]})]})},Od=({expiresAt:e,callbackValid:o,callbackExpired:i})=>{const{formatTimeAgo:l}=Lt(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Fo(e,0)?we.Error:Fo(e,2592e6)?we.Warning:we.Success,[e]),d=a(()=>c===we.Success?yi:c===we.Warning?Hi:Ni,[c]);return n(()=>{c===we.Success?o():c===we.Error&&i()},[c]),t(Ie,{text:s,children:t(Fe,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},Dd=m.div`
|
|
382
347
|
display: flex;
|
|
383
348
|
flex-direction: column;
|
|
384
349
|
gap: 12px;
|
|
@@ -386,7 +351,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
386
351
|
border-radius: 12px;
|
|
387
352
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
388
353
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
389
|
-
`,
|
|
354
|
+
`,Rd=({children:e})=>{const o=f();return t(Q,{size:te.XXXS,color:o.v2.colors.grey[150],children:e})},Pd=({token:o,updateToken:n})=>{const[a,i]=r(!1),[l,s]=r(!1),[c,d]=r(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:g,resetFormData:m}=$t({newToken:""});return t(Ye,{richTitle:{icon:Gi,title:"Odigos Pro Token"},children:e(Dd,{$isExpired:c,children:[e(oe,{$justifyContent:"space-between",children:[e(V,{$gap:4,children:[t(Rd,{children:"Issued for"}),t(Q,{size:te.XS,children:o.name||"N/A"})]}),e(V,{$gap:4,children:[t(Rd,{children:"Expiration"}),t(Od,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(V,{})]}),t(oe,{children:e(V,{children:[t(Rd,{children:"Token"}),t(Ad,{token:o.token,newToken:u.newToken,isLoading:l,isEditing:a,onEdit:()=>i(!0),onCancel:()=>(i(!1),s(!1),void p("newToken","")),onSave:()=>(async()=>{s(!0);const e=await n(u.newToken.trim());s(!1),e?.error?g("newToken",e.error):(i(!1),m())})(),formData:u,handleFormChange:p,handleErrorChange:g,formErrors:h})]})})]})})},Fd=m.div`
|
|
390
355
|
display: flex;
|
|
391
356
|
flex-direction: column;
|
|
392
357
|
align-items: center;
|
|
@@ -395,23 +360,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
395
360
|
padding: 12px 24px;
|
|
396
361
|
border-radius: 8px;
|
|
397
362
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
398
|
-
`,eu=({downloadDiagnose:o})=>{const{progress:n}=ft(),{namespaces:a}=ct(),[i,l]=r(null),{formData:s,handleFormChange:c,resetFormData:d}=$t({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ye,{richTitle:{icon:Wi,title:"Diagnose"},children:i?e(Qd,{children:[t(at,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[bt.DownloadingDiagnose]?.percentage,percentage:n[bt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[bt.DownloadingDiagnose]?.percentage,visualIcon:Xi,startedAt:i}),n[bt.DownloadingDiagnose]?.list?.length&&t(V,{$width:"100%",children:n[bt.DownloadingDiagnose].list.map(o=>e(oe,{$gap:4,$alignItems:"center",children:[o.status===we.Success?t(Ci,{size:16}):o.status===we.Error?t(Si,{size:16}):t(at,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(Q,{size:te.XXXS,color:ee.Secondary,children:o.label})]},o.label))})]}):e(V,{$gap:24,children:[t(Q,{size:te.XXS,color:ee.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(V,{$gap:16,children:[e(oe,{$gap:8,children:[t(H,{label:"Profiles",value:s.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include pprof profiles"})]}),e(oe,{$gap:8,children:[t(H,{label:"Metrics",value:s.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include Prometheus metrics"})]}),e(oe,{$gap:8,children:[t(H,{label:"Source Workloads",value:s.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(_o,{alignX:Bo.Left,alignY:zo.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:s.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(s.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:ie.Secondary,disabled:s.includeSourceWorkloads,leftIcon:s.sourceWorkloadNamespaces.length?()=>t(Fe,{label:s.sourceWorkloadNamespaces.length,status:we.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(ne,{label:"Download Diagnose",rightIcon:Xi,variant:ie.Primary,onClick:async()=>{l(Date.now()),await o(s),l(null),d()},disabled:null!==i})})]})})},tu=({fetchDescribeOdigos:e})=>{const{platformType:o,version:a,tier:i}=y(),[l,s]=r(null);return n(()=>{e().then(({data:e})=>s(e?.describeOdigos||null))},[]),t(Ye,{richTitle:{icon:Fi,title:"General Information"},children:t(xt,{cellsPerRow:2,items:[{id:Mo(),title:"Odigos Version",label:a},{id:Mo(),title:`${o.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Mo(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Mo(),title:"Tier",label:i}]})})},ou=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:r})=>e(q,{isOpen:o,header:{icon:Fi,title:"System Overview",onClose:n},children:[l&&t(tu,{fetchDescribeOdigos:l}),i&&a&&t(Zd,{token:a,updateToken:i}),r&&t(eu,{downloadDiagnose:r})]}),nu=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:r})=>{const{addDataStreams:s,setSelectedStreamName:c}=Me(),{requestSubmit:d}=El(),u=l(async e=>{r?await r(e):(s([e]),c(e.name)),a()},[r,s,c,a]),p=l(()=>d(u),[d,u]);return Fo({key:"Enter",active:n},p),e(o,{children:[t(ze,{isOpen:n,onClose:a,onCloseEnd:i,title:Be.NAME_YOUR_STREAM,description:Be.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:St.DONE,variant:ie.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:a},children:t(Mr,{autoFocus:!0})}),t(Br,{})]})},au=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s,updateDataStream:c})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=El();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,g=l(async e=>{await c(s,e),i()},[c,s,i]),m=l(()=>p(g),[p,g]);return Fo({key:"Enter",active:a},m),e(o,{children:[t(ze,{isOpen:a,onClose:i,onCloseEnd:r,title:Be.RENAME_STREAM(s),description:Be.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:St.SAVE,variant:ie.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:i},children:t(Mr,{autoFocus:!0})}),t(Br,{})]})},iu=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),lu=m.div`
|
|
363
|
+
`,Ld=({downloadDiagnose:o})=>{const{progress:n}=ft(),{namespaces:a}=ct(),[i,l]=r(null),{formData:s,handleFormChange:c,resetFormData:d}=$t({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ye,{richTitle:{icon:ji,title:"Diagnose"},children:i?e(Fd,{children:[t(at,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[bt.DownloadingDiagnose]?.percentage,percentage:n[bt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[bt.DownloadingDiagnose]?.percentage,visualIcon:Mi,startedAt:i}),n[bt.DownloadingDiagnose]?.list?.length&&t(V,{$width:"100%",children:n[bt.DownloadingDiagnose].list.map(o=>e(oe,{$gap:4,$alignItems:"center",children:[o.status===we.Success?t(yi,{size:16}):o.status===we.Error?t(Ci,{size:16}):t(at,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(Q,{size:te.XXXS,color:ee.Secondary,children:o.label})]},o.label))})]}):e(V,{$gap:24,children:[t(Q,{size:te.XXS,color:ee.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(V,{$gap:16,children:[e(oe,{$gap:8,children:[t(H,{label:"Profiles",value:s.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include pprof profiles"})]}),e(oe,{$gap:8,children:[t(H,{label:"Metrics",value:s.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include Prometheus metrics"})]}),e(oe,{$gap:8,children:[t(H,{label:"Source Workloads",value:s.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Lo,{alignX:zo.Left,alignY:_o.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:s.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(s.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:ie.Secondary,disabled:s.includeSourceWorkloads,leftIcon:s.sourceWorkloadNamespaces.length?()=>t(Fe,{label:s.sourceWorkloadNamespaces.length,status:we.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(ne,{label:"Download Diagnose",rightIcon:Mi,variant:ie.Primary,onClick:async()=>{l(Date.now()),await o(s),l(null),d()},disabled:null!==i})})]})})},_d=({fetchDescribeOdigos:e})=>{const{platformType:o,version:a,tier:i}=y(),[l,s]=r(null);return n(()=>{e().then(({data:e})=>s(e?.describeOdigos||null))},[]),t(Ye,{richTitle:{icon:Pi,title:"General Information"},children:t(xt,{cellsPerRow:2,items:[{id:Bo(),title:"Odigos Version",label:a},{id:Bo(),title:`${o.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Bo(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Bo(),title:"Tier",label:i}]})})},zd=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:r})=>e(q,{isOpen:o,header:{icon:Pi,title:"System Overview",onClose:n},children:[l&&t(_d,{fetchDescribeOdigos:l}),i&&a&&t(Pd,{token:a,updateToken:i}),r&&t(Ld,{downloadDiagnose:r})]}),Bd=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:r})=>{const{addDataStreams:s,setSelectedStreamName:c}=Me(),{requestSubmit:d}=$l(),u=l(async e=>{r?await r(e):(s([e]),c(e.name)),a()},[r,s,c,a]),p=l(()=>d(u),[d,u]);return Po({key:"Enter",active:n},p),e(o,{children:[t(ze,{isOpen:n,onClose:a,onCloseEnd:i,title:Be.NAME_YOUR_STREAM,description:Be.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:St.DONE,variant:ie.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:a},children:t(Br,{autoFocus:!0})}),t(zr,{})]})},Md=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s,updateDataStream:c})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=$l();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,g=l(async e=>{await c(s,e),i()},[c,s,i]),m=l(()=>p(g),[p,g]);return Po({key:"Enter",active:a},m),e(o,{children:[t(ze,{isOpen:a,onClose:i,onCloseEnd:r,title:Be.RENAME_STREAM(s),description:Be.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:St.SAVE,variant:ie.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:i},children:t(Br,{autoFocus:!0})}),t(zr,{})]})},Xd=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),Vd=m.div`
|
|
399
364
|
position: absolute;
|
|
400
365
|
top: 50%;
|
|
401
366
|
left: 50%;
|
|
402
367
|
transform: translate(-50%, -50%);
|
|
403
368
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
404
|
-
`,
|
|
369
|
+
`,Ud="onboarding-done",Hd=()=>{const{currentModal:o,setCurrentModal:n}=Mo(),a=()=>n("");return e(Xo,{isOpen:o===Ud,onClose:a,children:[t(Xd,{}),t(Vd,{children:e(V,{$gap:32,$alignItems:"center",children:[e(V,{$gap:24,$alignItems:"center",children:[t(Q,{size:te.L,weight:500,children:"Welcome to"}),t(Cl,{size:260}),t(Q,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(ne,{label:"Get Started",rightIcon:li,onClick:a})]})})]})},Gd=m.div`
|
|
405
370
|
display: flex;
|
|
406
371
|
flex-direction: column;
|
|
407
372
|
gap: 8px;
|
|
408
373
|
padding: 4px 8px;
|
|
409
374
|
border-radius: 8px;
|
|
410
375
|
width: 100%;
|
|
411
|
-
`,
|
|
376
|
+
`,jd=m.div`
|
|
412
377
|
white-space: pre;
|
|
413
378
|
overflow-x: auto;
|
|
414
|
-
`,
|
|
379
|
+
`,Wd=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:r,toggleName:s})=>{const c=f();return e(Gd,{children:[e(oe,{$gap:8,$justifyContent:"space-between",children:[e(oe,{$gap:4,children:[t(Q,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Fe,{label:Vo,leftIcon:Wi,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(K,{name:s??`sampling-onboarding-toggle-${o}`,label:a,labelAlign:Y.Left,value:i,onChange:l,size:gt.S})]}),t(jd,{children:t(S,{parts:r})})]})},Kd=m.div`
|
|
415
380
|
position: relative;
|
|
416
381
|
display: flex;
|
|
417
382
|
align-items: center;
|
|
@@ -421,18 +386,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
421
386
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
422
387
|
border-top-left-radius: 18px;
|
|
423
388
|
border-top-right-radius: 18px;
|
|
424
|
-
`,
|
|
389
|
+
`,Yd=m.div`
|
|
425
390
|
position: absolute;
|
|
426
391
|
left: 16px;
|
|
427
392
|
top: 50%;
|
|
428
393
|
transform: translateY(-50%);
|
|
429
|
-
`,
|
|
394
|
+
`,Jd=m.div`
|
|
430
395
|
height: 16px;
|
|
431
396
|
width: 100%;
|
|
432
397
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
433
398
|
border-top-left-radius: 18px;
|
|
434
399
|
border-top-right-radius: 18px;
|
|
435
|
-
`,
|
|
400
|
+
`,qd=m.div`
|
|
436
401
|
width: ${({$width:e})=>e}px;
|
|
437
402
|
display: flex;
|
|
438
403
|
flex-direction: column;
|
|
@@ -440,7 +405,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
440
405
|
gap: 22px;
|
|
441
406
|
padding: 8px 32px 32px 32px;
|
|
442
407
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
443
|
-
`,
|
|
408
|
+
`,Zd=e=>t(Ki,{rotate:90,...e}),Qd=({children:o,center:n,onNext:a,nextLabel:i=Uo,nextLoading:l})=>e(oe,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,a&&t(ne,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:Zd,variant:ie.Primary,size:ae.M,onClick:a,loading:l})]}),eu=e=>t(Ki,{rotate:-90,...e}),tu=({title:o,onBack:n})=>{const a=f();return e(Kd,{$hasBack:!!n,children:[n&&t(Yd,{children:t(ot,{"data-id":"sampling-onboarding-back",icon:eu,size:nt.M,onClick:n})}),t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},ou=m.div`
|
|
444
409
|
box-sizing: border-box;
|
|
445
410
|
width: ${({$width:e})=>e??"100%"};
|
|
446
411
|
${({$fillHeight:e})=>e&&b`
|
|
@@ -453,16 +418,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
453
418
|
padding: 16px;
|
|
454
419
|
border-radius: 16px;
|
|
455
420
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
456
|
-
`,
|
|
421
|
+
`,nu=({children:e,fillHeight:o,width:n})=>t(ou,{$fillHeight:o,$width:n,children:e}),au=m.ul`
|
|
457
422
|
margin: 0;
|
|
458
423
|
padding: 0;
|
|
459
424
|
list-style: disc;
|
|
460
|
-
`,
|
|
425
|
+
`,iu=m.li`
|
|
461
426
|
margin-left: 18px;
|
|
462
427
|
& + & {
|
|
463
428
|
margin-top: 6px;
|
|
464
429
|
}
|
|
465
|
-
`,
|
|
430
|
+
`,lu=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(au,{children:e.map((e,o)=>t(iu,{style:{color:a},children:t(Q,{size:te.XXS,color:a,children:e})},o))})},ru=({items:o})=>{const n=f();return t(V,{$gap:16,children:o.map((o,a)=>e(oe,{$gap:8,$alignItems:"flex-start",children:[e(Q,{size:te.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(V,{$gap:2,children:[t(Q,{size:te.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(Q,{size:te.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},su=({message:e})=>t(Se,{status:we.Default,message:e,fullWidth:!0,smallIcon:!0}),cu=m.div`
|
|
466
431
|
width: 100%;
|
|
467
432
|
padding: 8px;
|
|
468
433
|
display: flex;
|
|
@@ -470,12 +435,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
470
435
|
gap: 4px;
|
|
471
436
|
border-radius: 16px;
|
|
472
437
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
473
|
-
`,
|
|
438
|
+
`,du=m.div`
|
|
474
439
|
display: flex;
|
|
475
440
|
align-items: center;
|
|
476
441
|
gap: 8px;
|
|
477
442
|
padding: 4px 8px 12px 8px;
|
|
478
|
-
`,
|
|
443
|
+
`,uu=m.div`
|
|
479
444
|
width: 100%;
|
|
480
445
|
display: flex;
|
|
481
446
|
flex-direction: column;
|
|
@@ -483,20 +448,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
483
448
|
padding: 8px;
|
|
484
449
|
border-radius: 12px;
|
|
485
450
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
486
|
-
`,
|
|
451
|
+
`,pu=({children:e})=>{const o=f();return t(Q,{size:te.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},hu=m.div`
|
|
487
452
|
white-space: pre-line;
|
|
488
|
-
`,
|
|
453
|
+
`,gu=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=f(),c=a(()=>w({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(tu,{title:Ho,onBack:l}),e(qd,{$width:854,children:[t(pu,{children:Go}),e(V,{$gap:8,$width:"100%",children:[t(nu,{children:t(hu,{children:t(Q,{size:te.XXS,color:s.v2.colors.silver[200],children:jo})})}),e(V,{$gap:8,$width:"100%",children:[e(cu,{children:[t(du,{children:t(Q,{size:te.S,weight:500,color:s.v2.colors.white[500],children:Wo})}),t(uu,{children:t(Wd,{name:Yo,recommended:!0,toggleLabel:Ko,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(su,{message:Jo})]})]})]}),t(Qd,{onNext:r})]})},mu=e=>t(Ki,{rotate:90,...e}),fu=({onClose:n})=>{const a=f();return e(o,{children:[t(Jd,{}),e(qd,{$width:732,children:[t(qo,{icon:Ui}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Zo}),Qo.split("\n").map(e=>t(pu,{children:e},e)),e(nu,{children:[t(Q,{size:te.XS,color:a.v2.colors.silver[200],children:en}),t(lu,{color:a.v2.colors.white[500],items:[tn,on,nn]})]})]})]}),t(Qd,{center:!0,children:t(ne,{"data-id":"sampling-onboarding-btn-go-to",label:an,rightIcon:mu,variant:ie.Primary,size:ae.M,onClick:n})})]})},bu=e=>t(Ki,{rotate:90,...e}),vu=m.div`
|
|
489
454
|
display: flex;
|
|
490
455
|
flex-direction: column;
|
|
491
456
|
align-items: center;
|
|
492
457
|
gap: 8px;
|
|
493
458
|
width: 100%;
|
|
494
|
-
`,
|
|
459
|
+
`,yu=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(Jd,{}),e(qd,{$width:732,children:[t(qo,{icon:Ui}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[e(vu,{children:[t(Q,{size:te.M,weight:500,color:i.v2.colors.white[500],children:ln}),t(pu,{children:rn})]}),e(nu,{children:[t(Q,{size:te.XS,color:i.v2.colors.silver[200],children:sn}),t(ru,{items:[{title:dn,description:cn},{title:pn,description:un},{title:gn,description:hn}]}),t(su,{message:mn})]})]})]}),e(Qd,{center:!0,children:[t(ne,{"data-id":"sampling-onboarding-btn-skip",label:fn,variant:ie.Secondary,onClick:n}),t(ne,{"data-id":"sampling-onboarding-btn-start",label:bn,rightIcon:bu,variant:ie.Primary,onClick:a})]})]})},Cu=m.div`
|
|
495
460
|
display: flex;
|
|
496
461
|
align-items: stretch;
|
|
497
462
|
gap: 16px;
|
|
498
463
|
width: 100%;
|
|
499
|
-
`,
|
|
464
|
+
`,Su=m.div`
|
|
500
465
|
flex: 1;
|
|
501
466
|
display: flex;
|
|
502
467
|
flex-direction: column;
|
|
@@ -516,18 +481,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
516
481
|
background-color: ${t.v2.colors.silver[700]};
|
|
517
482
|
}
|
|
518
483
|
`}
|
|
519
|
-
`,
|
|
484
|
+
`,wu=m.div`
|
|
520
485
|
display: flex;
|
|
521
486
|
align-items: center;
|
|
522
487
|
gap: 8px;
|
|
523
488
|
padding: 12px 16px;
|
|
524
|
-
`,
|
|
489
|
+
`,xu=m.div`
|
|
525
490
|
flex: 1;
|
|
526
491
|
padding: 8px;
|
|
527
492
|
display: flex;
|
|
528
493
|
flex-direction: column;
|
|
529
494
|
gap: 8px;
|
|
530
|
-
`,
|
|
495
|
+
`,Tu=m.div`
|
|
531
496
|
flex: 1;
|
|
532
497
|
display: flex;
|
|
533
498
|
flex-direction: column;
|
|
@@ -535,17 +500,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
535
500
|
padding: 12px;
|
|
536
501
|
border-radius: 12px;
|
|
537
502
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
538
|
-
`,
|
|
503
|
+
`,ku=m.div`
|
|
539
504
|
display: flex;
|
|
540
505
|
justify-content: flex-end;
|
|
541
|
-
|
|
506
|
+
`,$u=m.div`
|
|
542
507
|
display: flex;
|
|
543
508
|
align-items: center;
|
|
544
509
|
gap: 8px;
|
|
545
510
|
padding: 4px 12px 4px 4px;
|
|
546
511
|
border-radius: 8px;
|
|
547
512
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
548
|
-
`,
|
|
513
|
+
`,Eu=m.div`
|
|
549
514
|
display: flex;
|
|
550
515
|
align-items: center;
|
|
551
516
|
justify-content: center;
|
|
@@ -553,13 +518,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
553
518
|
height: 24px;
|
|
554
519
|
border-radius: 6px;
|
|
555
520
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
556
|
-
`,
|
|
521
|
+
`,Iu=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Su,{$selected:o,onClick:n,children:[e(wu,{children:[t(ce,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:ue.L}),t(Ui,{size:24,fill:d.v2.colors.white[500]}),t(Q,{size:te.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(xu,{children:[e(Tu,{$selected:o,children:[e(V,{$gap:8,children:[t(Fe,{...l,textSize:te.XXXS}),t(Q,{size:te.XXS,color:u,children:i})]}),r&&r.length>0&&t(lu,{color:u,items:r}),s&&e($u,{children:[t(Eu,{children:t(Hi,{size:18,fill:d.v2.colors.yellow[500]})}),t(Q,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(ku,{children:t(ne,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:Pn,rightIcon:ci,variant:ie.Text,size:ae.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Nu=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:r})=>{const s=f(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(tu,{title:vn,onBack:i}),e(qd,{$width:854,children:[t(pu,{children:yn}),e(Cu,{children:[t(Iu,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:kn,description:Tn,badgeProps:{label:xn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Sn,wn],warning:Cn,onReadMore:c}),t(Iu,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:An,description:Nn,badgeProps:{label:In,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[$n,En],onReadMore:c}),t(Iu,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:Rn,description:Dn,badgeProps:{label:On,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Qd,{onNext:l})]})},Au=({onBack:n,onNext:i,submitting:l})=>{const r=f(),s=a(()=>[{title:zn,bullets:[Fn,Ln,_n]},{title:Hn,bullets:[Bn,Mn,Xn,Vn,Un]}],[]);return e(o,{children:[t(tu,{title:Gn,onBack:n}),e(qd,{$width:854,children:[t(pu,{children:jn}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(nu,{fillHeight:!0,width:"50%",children:[t(Q,{size:te.XS,color:r.v2.colors.white[500],children:o.title}),t(lu,{items:o.bullets})]},n))}),t(su,{message:Wn})]}),t(Qd,{onNext:i,nextLoading:l})]})},Ou=m.div`
|
|
557
522
|
white-space: pre-line;
|
|
558
|
-
`,
|
|
523
|
+
`,Du=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=f(),d=a(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(tu,{title:Kn,onBack:l}),e(qd,{$width:854,children:[t(pu,{children:Yn}),e(V,{$gap:8,$width:"100%",children:[e(nu,{children:[t(Ou,{children:t(Q,{size:te.XXS,color:c.v2.colors.silver[200],children:Jn})}),t(su,{message:Wn})]}),e(cu,{children:[e(du,{children:[t(Q,{size:te.S,weight:500,color:c.v2.colors.white[500],children:qn}),t(Ai,{size:16,fill:c.v2.colors.silver[200]})]}),t(uu,{children:t(Wd,{name:Qn,recommended:!0,toggleLabel:Zn,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Qd,{onNext:r,nextLoading:s})]})},Ru=m.div`
|
|
559
524
|
white-space: pre-line;
|
|
560
|
-
`,
|
|
525
|
+
`,Pu=m.div`
|
|
561
526
|
width: fit-content;
|
|
562
|
-
`,Qu=["50","25","10","1","0.1"],ep=({value:o,onChange:n,label:i})=>{const l=f(),r=a(()=>Qu.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(V,{$gap:8,children:[t(Q,{size:te.XS,color:l.v2.colors.white[500],children:i}),t(Zu,{children:t(le,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},tp=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(yu,{title:ta,onBack:s}),e(mu,{$width:854,children:[t(Au,{children:oa}),e(V,{$gap:8,$width:"100%",children:[e(Su,{children:[t(qu,{children:t(Q,{size:te.XXS,color:u.v2.colors.silver[200],children:na})}),t(ku,{items:[aa,ia,la,ra,sa]}),t($u,{message:Kn})]}),e(Eu,{children:[e(Iu,{children:[t(Q,{size:te.S,weight:500,color:u.v2.colors.white[500],children:ca}),t(Oi,{size:16,fill:u.v2.colors.silver[200]})]}),t(Nu,{children:t(uu,{name:ea,recommended:!0,toggleLabel:Qn,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Nu,{children:t(ep,{value:l,onChange:r,label:da})})]})]})]}),t(bu,{onNext:c,nextLoading:d})]})},op=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:c,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=r("welcome"),[g,m]=r(!0),[f,b]=r("keep-list"),[v,y]=r(!0),[C,S]=r("25"),[w,x]=r(!1);n(()=>{e&&(h("welcome"),m(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const k=l(async()=>{const e=i??"default",t=[];g!==(a?.enabled??!1)&&t.push(c(g,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,c,g,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let T=null;switch(p){case"welcome":T=t(_u,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":T=t(Du,{enabled:g,onEnabledChange:m,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":T=t(Wu,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(tp,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"drop-list":T=t(Ju,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"advanced":T=t(Ku,{onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"success":T=t(Pu,{onClose:o})}return t(Vo,{isOpen:e,onClose:o,children:T})};var np,ap;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(np||(np={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(ap||(ap={}));const ip=[{key:ap.Name,label:"Name"},{key:ap.Type,label:"Type",textAlign:"right"},{key:ap.Status,label:"Status"},{key:ap.OdigosVersion,label:"Odigos Version"},{key:ap.ConnectedSince,label:"Connected Since"},{key:ap.LastActivity,label:"Last Activity"}],lp=(e,t)=>{const o=e.find(e=>e.key===ap.Id)?.rawValue;return t(o?.toString()||"")},rp=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===ap.Status)?.rawValue===we.Success)(e))return[{id:Mo(),label:"Delete Connection",rightIcon:ui,onClick:()=>lp(e,a)}];const d=lp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&k(n.odigosVersion,o)}),u=lp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&k(o.odigosVersion,n)}),p=[];return i&&p.push({id:Mo(),tooltip:u?Be.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:xi,disabled:!u,onClick:()=>lp(e,i)}),l&&p.push({id:Mo(),tooltip:Be.ADD_DESTINATION,rightIcon:bi,onClick:()=>lp(e,l)}),r&&p.push({id:Mo(),tooltip:Be.ADD_ACTION,rightIcon:fi,onClick:()=>lp(e,r)}),s&&p.push({id:Mo(),tooltip:Be.ADD_INSTRUMENTATION_RULE,rightIcon:wi,onClick:()=>lp(e,s)}),c&&p.push({id:Mo(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ti,disabled:!d,onClick:()=>lp(e,c)}),p}},sp=({connections:o,getConnections:i,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,getEffectiveConfig:u,applyConfigurations:p,snapshotMinSupportedVersion:h=0,getAllClusterSnapshots:g,persistSources:m,getDestinationCategories:b,getPotentialDestinations:v,testConnection:C,createDestination:S,updateDestination:w,createAction:x,createInstrumentationRule:T})=>{const $=f(),{isVm:E}=y(),{formatTimeAgo:I}=Lt(),[N,A]=r(!1),[O,D]=r(o||[]),R=l(async()=>{try{A(!0),D(await i()??[])}catch(e){}finally{A(!1)}},[]);n(()=>{O.length||R()},[]);const[P,F]=r(""),[L,_]=r(null),[z,B]=r([]),M=a(()=>L===np.BulkConfig?d:L===np.BulkSource?h:0,[L,d,h]),{supportedConnections:X,supportedConnectionIds:V}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===we.Success,n=k(e.odigosVersion,t);return o&&n}))(O,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[O.length,M]);n(()=>{if(!L||L===np.Delete)return;const e=z.filter(e=>!V.includes(e));e.length&&B(t=>t.filter(t=>!e.includes(t)))},[L,z.length,V.length]);const U=a(()=>O.filter(e=>!P||e.name.toLowerCase().includes(P.toLowerCase())).map(e=>({cells:[{key:ap.Id,rawValue:e.id},{key:ap.Name,rawValue:e.name},{key:ap.Type,rawValue:e.type},{key:ap.Status,rawValue:e.status,component:()=>(e=>{const o=e===we.Success?"Connection live":"Connection lost",n=e===we.Success?Ci:Si;return t(Fe,{status:e,label:o,leftIcon:n})})(e.status)},{key:ap.OdigosVersion,rawValue:e.odigosVersion},{key:ap.ConnectedSince,rawValue:e.connectedAt?I(e.connectedAt):"-"},{key:ap.LastActivity,rawValue:e.lastSeenAt?I(e.lastSeenAt):"-"}],onClick:e.status!==we.Success||L?void 0:()=>s(e),isSelected:z.includes(e.id),onSelect:()=>B(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>B(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==we.Success||L===np.BulkConfig&&!k(e.odigosVersion,d)||L===np.BulkSource&&!k(e.odigosVersion,h)})),[O,z,P,L,d,h]),H=a(()=>{const e=(e,t)=>{B([e]),_(t)};return rp({connections:O,configMinSupportedVersion:d,snapshotMinSupportedVersion:h,onDelete:t=>e(t,np.Delete),onAddSource:!E&&g&&m?t=>e(t,np.BulkSource):void 0,onAddDestination:!E&&b&&v&&S?t=>e(t,np.BulkDestination):void 0,onAddAction:!E&&x?t=>e(t,np.BulkAction):void 0,onAddInstrumentationRule:!E&&T?t=>e(t,np.BulkInstrumentationRule):void 0,onEditConfiguration:!E&&u&&p?t=>e(t,np.BulkConfig):void 0})},[E,O,d,u,p,h,g,m,b,v,S,x,T]),G=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];o&&r.push({id:Mo(),type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:"Add Sources",rightIcon:xi,onClick:o}});const s=[n?{id:np.BulkDestination,label:Be.ADD_DESTINATION,icon:bi}:null,a?{id:np.BulkAction,label:Be.ADD_ACTION,icon:fi}:null,i?{id:np.BulkInstrumentationRule,label:Be.ADD_INSTRUMENTATION_RULE,icon:wi}:null,l?{id:np.BulkConfig,label:"Manage Configurations",icon:Ti}:null];return s.some(Boolean)&&r.push({id:Mo(),type:Wt.ButtonDropData,buttonProps:{variant:ie.Secondary,size:ae.S,label:"Bulk Operations",onClick:e=>{e===np.BulkSource?o?.():e===np.BulkDestination?n?.():e===np.BulkAction?a?.():e===np.BulkInstrumentationRule?i?.():e===np.BulkConfig&&l?.()}},dropDataProps:{alignX:Bo.Left,items:s}}),r.push({id:Mo(),type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:St.CANCEL,onClick:t}}),r})({onCancel:()=>B([]),onAddSource:!E&&g&&m?()=>_(np.BulkSource):void 0,onAddDestination:!E&&b&&v&&S?()=>_(np.BulkDestination):void 0,onAddAction:!E&&x?()=>_(np.BulkAction):void 0,onAddInstrumentationRule:!E&&T?()=>_(np.BulkInstrumentationRule):void 0,onManageConfigurations:!E&&u&&p?()=>_(np.BulkConfig):void 0}),[E,u,p,g,m,b,v,S,x,T]);return t(ua,{children:e(Ye,{fullHeight:!0,richTitle:{icon:Ji,title:Be.CONNECTIONS,badge:{label:O.length.toString(),status:pt.Unknown}},search:{placeholder:"Search by cluster name",value:P,onChange:e=>F(e),width:"300px"},actions:[{id:Mo(),type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ni,onClick:R,disabled:N}}],children:[t(mo,{variant:fo.Pretty,headerBackgroundColor:$.v2.colors.silver[1e3],isLoading:N,withCheckboxes:!0,columns:ip,rows:U,rowActionsPushRightPosition:L?`calc(${wl} - 24px)`:void 0,getRowActions:H}),L===np.BulkConfig&&u&&p&&t(Ps,{onClose:()=>_(null),connections:X,selectedConnectionIds:z,setSelectedConnectionIds:B,getEffectiveConfig:u,onApply:p}),L===np.BulkSource&&g&&m&&t(_l,{selectedConnectionIds:z,children:t(Os,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,getAllClusterSnapshots:g,persistSources:async e=>await(m?.(e))})}),L===np.BulkDestination&&b&&v&&C&&S&&w&&t(zl,{children:t(ds,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,getDestinationCategories:b,getPotentialDestinations:v,testConnection:e=>C(e,z),createDestination:e=>S(e,z),updateDestination:(e,t)=>w(e,t,z)})}),L===np.BulkAction&&x&&t(Bl,{children:t(es,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createAction:e=>x(e,z)})}),L===np.BulkInstrumentationRule&&T&&t(Ml,{children:t(us,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createInstrumentationRule:e=>T(e,z)})}),t(vl,{target:"connection",isOpen:L===np.Delete,onClose:()=>{B([]),_(null)},onApprove:async()=>{const e=z[0];e&&(await c(e),await R())}}),t(pa,{isOpen:!!z.length&&!L,richTitle:{icon:si,title:"Selected Clusters",badge:{label:z.length}},actions:G})]})})},cp=m.div`
|
|
527
|
+
`,Fu=["50","25","10","1","0.1"],Lu=({value:o,onChange:n,label:i})=>{const l=f(),r=a(()=>Fu.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(V,{$gap:8,children:[t(Q,{size:te.XS,color:l.v2.colors.white[500],children:i}),t(Pu,{children:t(le,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},_u=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(tu,{title:ea,onBack:s}),e(qd,{$width:854,children:[t(pu,{children:ta}),e(V,{$gap:8,$width:"100%",children:[e(nu,{children:[t(Ru,{children:t(Q,{size:te.XXS,color:u.v2.colors.silver[200],children:oa})}),t(lu,{items:[na,aa,ia,la,ra]}),t(su,{message:Wn})]}),e(cu,{children:[e(du,{children:[t(Q,{size:te.S,weight:500,color:u.v2.colors.white[500],children:sa}),t(Ai,{size:16,fill:u.v2.colors.silver[200]})]}),t(uu,{children:t(Wd,{name:Qn,recommended:!0,toggleLabel:Zn,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(uu,{children:t(Lu,{value:l,onChange:r,label:ca})})]})]})]}),t(Qd,{onNext:c,nextLoading:d})]})},zu=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:c,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=r("welcome"),[g,m]=r(!0),[f,b]=r("keep-list"),[v,y]=r(!0),[C,S]=r("25"),[w,x]=r(!1);n(()=>{e&&(h("welcome"),m(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const T=l(async()=>{const e=i??"default",t=[];g!==(a?.enabled??!1)&&t.push(c(g,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,c,g,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let k=null;switch(p){case"welcome":k=t(yu,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":k=t(gu,{enabled:g,onEnabledChange:m,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":k=t(Nu,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":k=t(_u,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"drop-list":k=t(Du,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"advanced":k=t(Au,{onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"success":k=t(fu,{onClose:o})}return t(Xo,{isOpen:e,onClose:o,children:k})};var Bu,Mu;!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"}(Bu||(Bu={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Mu||(Mu={}));const Xu=[{key:Mu.Name,label:"Name"},{key:Mu.Type,label:"Type",textAlign:"right"},{key:Mu.Status,label:"Status"},{key:Mu.OdigosVersion,label:"Odigos Version"},{key:Mu.ConnectedSince,label:"Connected Since"},{key:Mu.LastActivity,label:"Last Activity"}],Vu=(e,t)=>{const o=e.find(e=>e.key===Mu.Id)?.rawValue;return t(o?.toString()||"")},Uu=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Mu.Status)?.rawValue===we.Success)(e))return[{id:Bo(),label:"Delete Connection",rightIcon:di,onClick:()=>Vu(e,a)}];const d=Vu(e,e=>{const n=t.find(t=>t.id===e);return!!n&&T(n.odigosVersion,o)}),u=Vu(e,e=>{const o=t.find(t=>t.id===e);return!!o&&T(o.odigosVersion,n)}),p=[];return i&&p.push({id:Bo(),tooltip:u?Be.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:wi,disabled:!u,onClick:()=>Vu(e,i)}),l&&p.push({id:Bo(),tooltip:Be.ADD_DESTINATION,rightIcon:fi,onClick:()=>Vu(e,l)}),r&&p.push({id:Bo(),tooltip:Be.ADD_ACTION,rightIcon:mi,onClick:()=>Vu(e,r)}),s&&p.push({id:Bo(),tooltip:Be.ADD_INSTRUMENTATION_RULE,rightIcon:Si,onClick:()=>Vu(e,s)}),c&&p.push({id:Bo(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ti,disabled:!d,onClick:()=>Vu(e,c)}),p}},Hu=({connections:o,getConnections:i,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,getEffectiveConfig:u,applyConfigurations:p,snapshotMinSupportedVersion:h=0,getAllClusterSnapshots:g,persistSources:m,getDestinationCategories:b,getPotentialDestinations:v,testConnection:C,createDestination:S,updateDestination:w,createAction:x,createInstrumentationRule:k})=>{const $=f(),{isVm:E}=y(),{formatTimeAgo:I}=Lt(),[N,A]=r(!1),[O,D]=r(o||[]),R=l(async()=>{try{A(!0),D(await i()??[])}catch(e){}finally{A(!1)}},[]);n(()=>{O.length||R()},[]);const[P,F]=r(""),[L,_]=r(null),[z,B]=r([]),M=a(()=>L===Bu.BulkConfig?d:L===Bu.BulkSource?h:0,[L,d,h]),{supportedConnections:X,supportedConnectionIds:V}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===we.Success,n=T(e.odigosVersion,t);return o&&n}))(O,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[O.length,M]);n(()=>{if(!L||L===Bu.Delete)return;const e=z.filter(e=>!V.includes(e));e.length&&B(t=>t.filter(t=>!e.includes(t)))},[L,z.length,V.length]);const U=a(()=>O.filter(e=>!P||e.name.toLowerCase().includes(P.toLowerCase())).map(e=>({cells:[{key:Mu.Id,rawValue:e.id},{key:Mu.Name,rawValue:e.name},{key:Mu.Type,rawValue:e.type},{key:Mu.Status,rawValue:e.status,component:()=>(e=>{const o=e===we.Success?"Connection live":"Connection lost",n=e===we.Success?yi:Ci;return t(Fe,{status:e,label:o,leftIcon:n})})(e.status)},{key:Mu.OdigosVersion,rawValue:e.odigosVersion},{key:Mu.ConnectedSince,rawValue:e.connectedAt?I(e.connectedAt):"-"},{key:Mu.LastActivity,rawValue:e.lastSeenAt?I(e.lastSeenAt):"-"}],onClick:e.status!==we.Success||L?void 0:()=>s(e),isSelected:z.includes(e.id),onSelect:()=>B(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>B(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==we.Success||L===Bu.BulkConfig&&!T(e.odigosVersion,d)||L===Bu.BulkSource&&!T(e.odigosVersion,h)})),[O,z,P,L,d,h]),H=a(()=>{const e=(e,t)=>{B([e]),_(t)};return Uu({connections:O,configMinSupportedVersion:d,snapshotMinSupportedVersion:h,onDelete:t=>e(t,Bu.Delete),onAddSource:!E&&g&&m?t=>e(t,Bu.BulkSource):void 0,onAddDestination:!E&&b&&v&&S?t=>e(t,Bu.BulkDestination):void 0,onAddAction:!E&&x?t=>e(t,Bu.BulkAction):void 0,onAddInstrumentationRule:!E&&k?t=>e(t,Bu.BulkInstrumentationRule):void 0,onEditConfiguration:!E&&u&&p?t=>e(t,Bu.BulkConfig):void 0})},[E,O,d,u,p,h,g,m,b,v,S,x,k]),G=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];o&&r.push({id:Bo(),type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:"Add Sources",rightIcon:wi,onClick:o}});const s=[n?{id:Bu.BulkDestination,label:Be.ADD_DESTINATION,icon:fi}:null,a?{id:Bu.BulkAction,label:Be.ADD_ACTION,icon:mi}:null,i?{id:Bu.BulkInstrumentationRule,label:Be.ADD_INSTRUMENTATION_RULE,icon:Si}:null,l?{id:Bu.BulkConfig,label:"Manage Configurations",icon:Ti}:null];return s.some(Boolean)&&r.push({id:Bo(),type:Wt.ButtonDropData,buttonProps:{variant:ie.Secondary,size:ae.S,label:"Bulk Operations",onClick:e=>{e===Bu.BulkSource?o?.():e===Bu.BulkDestination?n?.():e===Bu.BulkAction?a?.():e===Bu.BulkInstrumentationRule?i?.():e===Bu.BulkConfig&&l?.()}},dropDataProps:{alignX:zo.Left,items:s}}),r.push({id:Bo(),type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:St.CANCEL,onClick:t}}),r})({onCancel:()=>B([]),onAddSource:!E&&g&&m?()=>_(Bu.BulkSource):void 0,onAddDestination:!E&&b&&v&&S?()=>_(Bu.BulkDestination):void 0,onAddAction:!E&&x?()=>_(Bu.BulkAction):void 0,onAddInstrumentationRule:!E&&k?()=>_(Bu.BulkInstrumentationRule):void 0,onManageConfigurations:!E&&u&&p?()=>_(Bu.BulkConfig):void 0}),[E,u,p,g,m,b,v,S,x,k]);return t(da,{children:e(Ye,{fullHeight:!0,richTitle:{icon:Yi,title:Be.CONNECTIONS,badge:{label:O.length.toString(),status:pt.Unknown}},search:{placeholder:"Search by cluster name",value:P,onChange:e=>F(e),width:"300px"},actions:[{id:Bo(),type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ii,onClick:R,disabled:N}}],children:[t(go,{variant:mo.Pretty,headerBackgroundColor:$.v2.colors.silver[1e3],isLoading:N,withCheckboxes:!0,columns:Xu,rows:U,rowActionsPushRightPosition:L?`calc(${Sl} - 24px)`:void 0,getRowActions:H}),L===Bu.BulkConfig&&u&&p&&t(Rs,{onClose:()=>_(null),connections:X,selectedConnectionIds:z,setSelectedConnectionIds:B,getEffectiveConfig:u,onApply:p}),L===Bu.BulkSource&&g&&m&&t(Ll,{selectedConnectionIds:z,children:t(As,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,getAllClusterSnapshots:g,persistSources:async e=>await(m?.(e))})}),L===Bu.BulkDestination&&b&&v&&C&&S&&w&&t(_l,{children:t(cs,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,getDestinationCategories:b,getPotentialDestinations:v,testConnection:e=>C(e,z),createDestination:e=>S(e,z),updateDestination:(e,t)=>w(e,t,z)})}),L===Bu.BulkAction&&x&&t(zl,{children:t(Qr,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createAction:e=>x(e,z)})}),L===Bu.BulkInstrumentationRule&&k&&t(Bl,{children:t(ds,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createInstrumentationRule:e=>k(e,z)})}),t(bl,{target:"connection",isOpen:L===Bu.Delete,onClose:()=>{B([]),_(null)},onApprove:async()=>{const e=z[0];e&&(await c(e),await R())}}),t(ua,{isOpen:!!z.length&&!L,richTitle:{icon:ri,title:"Selected Clusters",badge:{label:z.length}},actions:G})]})})},Gu=m.div`
|
|
563
528
|
display: flex;
|
|
564
529
|
align-items: center;
|
|
565
530
|
justify-content: space-between;
|
|
@@ -568,26 +533,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
568
533
|
width: 100%;
|
|
569
534
|
border-radius: 16px;
|
|
570
535
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
571
|
-
`,
|
|
536
|
+
`,ju=m.div`
|
|
572
537
|
display: flex;
|
|
573
538
|
align-items: center;
|
|
574
539
|
justify-content: center;
|
|
575
540
|
padding: 8px;
|
|
576
541
|
border-radius: 8px;
|
|
577
542
|
background-color: ${({theme:e})=>e.v2.colors.white[500]+qe["004"]};
|
|
578
|
-
`,
|
|
543
|
+
`,Wu=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=f(),c=()=>o(2),d=()=>o(3),u=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,a)=>{if(!o.selected)return null;const i=o.kind||ut.Namespace,l=i===ut.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(Gu,{children:[t(Q,{nowrap:!0,children:l}),t(Fe,{label:i,status:we.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((o,n)=>{const a=lt(o.option.type).icon;return e(Gu,{children:[e(oe,{$gap:8,children:[a&&t(ju,{children:t(a,{size:24})}),t(Q,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Fe,{status:o.testResult.succeeded?we.Success:we.Error,leftIcon:o.testResult.succeeded?yi:Ci})]},`destination-${n}`)})||[],[l]);return t(fl,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:$i,title:Be.SUMMARY,subTitle:Be.REVIEW_SETUP},leftColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(wi,{size:24}),t(Q,{nowrap:!0,children:Be.SELECTED_SOURCES}),t(Fe,{label:u.length})]}),t(ne,{"data-id":"summary-edit-sources",leftIcon:ui,variant:ie.Secondary,size:ae.S,onClick:c})]}),list:u.length?u:[t(Qe,{$height:"100%",children:t(me,{icon:wi,title:Be.NO_SOURCES_SELECTED,subTitle:Be.ADD_SOURCE_PROMPT,button:{leftIcon:ii,label:Be.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(fi,{size:24}),t(Q,{nowrap:!0,children:Be.SELECTED_DESTINATIONS}),t(Fe,{label:p.length})]}),t(ne,{"data-id":"summary-edit-destinations",leftIcon:ui,variant:ie.Secondary,size:ae.S,onClick:d})]}),list:p.length?p:[t(Qe,{"data-id":"summary-no-destinations",$height:"100%",children:t(me,{icon:fi,title:Be.NO_DESTINATIONS_SELECTED,subTitle:Be.ADD_DESTINATION_PROMPT,button:{leftIcon:ii,label:Be.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Ku=m.div`
|
|
579
544
|
position: relative;
|
|
580
545
|
overflow: hidden;
|
|
581
546
|
width: 100vw;
|
|
582
547
|
height: 100vh;
|
|
583
548
|
box-sizing: border-box;
|
|
584
|
-
`,
|
|
549
|
+
`,Yu=m.svg`
|
|
585
550
|
position: absolute;
|
|
586
551
|
top: 50%;
|
|
587
552
|
left: 50%;
|
|
588
553
|
transform: translate(-50%, -50%);
|
|
589
554
|
z-index: -1;
|
|
590
|
-
`,
|
|
555
|
+
`,Ju=[{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"}],qu=[{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:Ju},{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:Ju},{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:Ju}],Zu=({paddingXAxis:o="0px",paddingYAxis:i="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=a(()=>s/qu[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Ku,{$paddingXAxis:o,$paddingYAxis:i,children:[qu.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(Yu,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},Qu=m.div`
|
|
591
556
|
display: flex;
|
|
592
557
|
flex-direction: column;
|
|
593
558
|
align-items: center;
|
|
@@ -598,7 +563,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
598
563
|
width: 50vw;
|
|
599
564
|
border-radius: 16px;
|
|
600
565
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
601
|
-
`,
|
|
566
|
+
`,ep=m.div`
|
|
602
567
|
display: flex;
|
|
603
568
|
flex-direction: column;
|
|
604
569
|
align-items: center;
|
|
@@ -608,15 +573,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
608
573
|
& * {
|
|
609
574
|
text-align: center;
|
|
610
575
|
}
|
|
611
|
-
`,
|
|
576
|
+
`,tp=({onStart:o})=>t(q,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(Qe,{$height:"100%",children:e(Qu,{children:[e(ep,{children:[t(Q,{size:te.L,weight:500,children:Be.GET_STARTED_WITH}),t(Cl,{size:260}),t(Q,{size:te.S,weight:400,children:Be.GET_STARTED_DESCRIPTION})]}),t(ne,{"data-id":"onboarding-get-started",label:St.GET_STARTED,rightIcon:li,size:ae.L,onClick:o})]})})}),op=[{step:1,label:Be.INSTALLATION,forceDoneBadge:!0},{step:2,label:Be.SOURCES_SETUP},{step:3,label:Be.DESTINATIONS_SETUP},{step:4,label:Be.SUMMARY}],np=m.div`
|
|
612
577
|
display: flex;
|
|
613
578
|
flex-direction: column;
|
|
614
579
|
gap: 32px;
|
|
615
580
|
padding: 64px;
|
|
616
|
-
`,
|
|
581
|
+
`,ap=({pagePaddingXAxis:o,pagePaddingYAxis:n,fetchNamespacesWithWorkloads:a,persistSources:i,getDestinationCategories:l,getPotentialDestinations:s,testConnection:c,createDestination:d,updateDestination:u,onDone:p})=>{const{setCurrentModal:h}=Mo(),[g,m]=r(1),[f,b]=r(!1),[v,y]=r(null),[C,S]=r(null),w=()=>m(e=>e+1),x=()=>m(e=>e-1);return e(Zu,{paddingXAxis:o,paddingYAxis:n,children:[e(np,{children:[t(Cl,{useInline:!0}),t(pa,{currentStep:g,data:op,gap:32})]}),t(Ll,{initialInputs:v,children:e(_l,{children:[1===g&&t(tp,{onStart:w}),2===g&&t(As,{disableAnimation:!0,onBack:e=>{y(e),x()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:a,persistSources:i}),3===g&&t(cs,{disableAnimation:!0,onBack:e=>{S(e),x()},onNext:e=>{S(e),w()},getDestinationCategories:l,getPotentialDestinations:s,initialInputs:C,testConnection:c,createDestination:d,updateDestination:u}),4===g&&t(Wu,{disableAnimation:!0,setStep:m,onSave:async()=>{if(!f){b(!0);try{const e=[];v&&e.push(i(v)),C&&e.push(...C.map(e=>d(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value?.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};h(Ud),p()}catch(e){return b(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},ip=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),lp=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},rp=m.div`
|
|
617
582
|
position: relative;
|
|
618
583
|
display: inline-flex;
|
|
619
|
-
|
|
584
|
+
`,sp=m.button`
|
|
620
585
|
display: inline-flex;
|
|
621
586
|
align-items: center;
|
|
622
587
|
gap: 8px;
|
|
@@ -629,7 +594,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
629
594
|
&:hover {
|
|
630
595
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
631
596
|
}
|
|
632
|
-
`,
|
|
597
|
+
`,cp=m.div`
|
|
633
598
|
position: absolute;
|
|
634
599
|
top: calc(100% + 8px);
|
|
635
600
|
right: 0;
|
|
@@ -642,28 +607,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
642
607
|
border-radius: 12px;
|
|
643
608
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
644
609
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
645
|
-
`,
|
|
610
|
+
`,dp=m.div`
|
|
646
611
|
display: flex;
|
|
647
612
|
flex-direction: column;
|
|
648
613
|
gap: 12px;
|
|
649
614
|
padding: 16px;
|
|
650
615
|
max-height: 60vh;
|
|
651
616
|
overflow-y: auto;
|
|
652
|
-
`,
|
|
617
|
+
`,up=m.div`
|
|
653
618
|
display: flex;
|
|
654
619
|
align-items: center;
|
|
655
620
|
gap: 8px;
|
|
656
621
|
padding: 12px 16px;
|
|
657
622
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
658
|
-
`,
|
|
623
|
+
`,pp=m.div`
|
|
659
624
|
display: flex;
|
|
660
625
|
align-items: center;
|
|
661
626
|
gap: 8px;
|
|
662
627
|
margin-left: auto;
|
|
663
|
-
`,
|
|
628
|
+
`,hp=()=>{const o=f(),l=ct(e=>e.sources),s=ct(e=>e.namespaces),{selectedStreamName:c}=Me(),{getItemSS:d,setItemSS:u,removeItemSS:p}=ba(),{namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=ha(),x=a(()=>ga(l,c),[l,c]);n(()=>{const e=d(ma.OVERVIEW_FILTERS,w());C(e)},[]);const[T,k]=r({namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y}),[$,E]=r(lp(T)),[I,N]=r(!1);n(()=>{if(!I){const e={namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y};k(e),E(lp(e))}},[I,h,g,m,b,v,y]);const A=i(null);lo(A,()=>N(!1)),Po({key:"Escape",active:I},()=>N(!1));const O=a(()=>{const e=new Set,t=[];return s.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[s]),D=a(()=>{const e=new Set,t=[];return x.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[x]),R=a(()=>{const e=new Set,t=[];return x.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Le[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[x]),P=a(()=>fa.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=a(()=>{const e=new Set,t=[];return x.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Ot(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[x]),L=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));k(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},_=I?bi:vi,z=a(()=>ip(T.languages),[T.languages]);return e(rp,{ref:A,children:[e(sp,{"data-id":"filters-trigger",$isOpen:I,type:"button",onClick:()=>N(e=>!e),children:[t(Ji,{size:16,fill:o.v2.colors.white[500]}),t(Q,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),$>0&&t(Fe,{label:$,status:pt.Unknown,textSize:te.XXXS}),t(_,{size:16,fill:o.v2.colors.silver[200]})]}),I&&e(cp,{children:[e(dp,{children:[t(tt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!O.length,options:O,values:ip(T.namespaces),setValues:e=>L("namespaces",O,e)}),t(tt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:ip(T.kinds),setValues:e=>L("kinds",D,e)}),t(tt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!R.length,options:R,values:z,setValues:e=>L("languages",R,e)}),t(tt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:ip(T.monitors),setValues:e=>L("monitors",P,e)}),t(tt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:ip(T.podsAgentInjectionStatus),setValues:e=>L("podsAgentInjectionStatus",F,e)}),t(K,{label:"Show only sources with errors",size:gt.L,value:!!T.onlyErrors,onChange:e=>k(t=>({...t,onlyErrors:e}))})]}),e(up,{children:[t(ne,{"data-id":"filters-reset",size:ae.S,variant:ie.Text,label:"Reset",onClick:()=>{p(ma.OVERVIEW_FILTERS),S(),k(w()),E(0),N(!1)},textColor:o.v2.colors.red[500]}),e(pp,{children:[t(ne,{"data-id":"filters-cancel",size:ae.S,variant:ie.Secondary,label:"Cancel",onClick:()=>N(!1)}),t(ne,{"data-id":"filters-apply",size:ae.S,variant:ie.Primary,label:"Apply",onClick:()=>{u(ma.OVERVIEW_FILTERS,T),C(T),E(lp(T)),N(!1)}})]})]})]})]})},gp="40vw",mp=m.div`
|
|
664
629
|
position: relative;
|
|
665
|
-
width: ${
|
|
666
|
-
`,
|
|
630
|
+
width: ${gp};
|
|
631
|
+
`,fp=m.div`
|
|
667
632
|
position: absolute;
|
|
668
633
|
top: calc(100% + 8px);
|
|
669
634
|
left: 0;
|
|
@@ -672,23 +637,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
672
637
|
flex-direction: column;
|
|
673
638
|
gap: 8px;
|
|
674
639
|
padding: 8px;
|
|
675
|
-
width: calc(${
|
|
640
|
+
width: calc(${gp} - 16px);
|
|
676
641
|
border-radius: 12px;
|
|
677
642
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
678
643
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
679
|
-
`,
|
|
644
|
+
`,bp=m.div`
|
|
680
645
|
display: flex;
|
|
681
646
|
align-items: center;
|
|
682
647
|
overflow-x: auto;
|
|
683
|
-
`,
|
|
648
|
+
`,vp=m.div`
|
|
684
649
|
display: flex;
|
|
685
650
|
flex-direction: column;
|
|
686
651
|
gap: 0;
|
|
687
652
|
max-height: 60vh;
|
|
688
653
|
overflow-y: auto;
|
|
689
|
-
`,
|
|
654
|
+
`,yp=m.div`
|
|
690
655
|
padding: 8px 12px 4px 12px;
|
|
691
|
-
`,
|
|
656
|
+
`,Cp=m.div`
|
|
692
657
|
display: flex;
|
|
693
658
|
align-items: center;
|
|
694
659
|
gap: 8px;
|
|
@@ -698,9 +663,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
698
663
|
&:hover {
|
|
699
664
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
700
665
|
}
|
|
701
|
-
`,
|
|
666
|
+
`,Sp=m.div`
|
|
702
667
|
padding: 16px 8px;
|
|
703
|
-
`,
|
|
668
|
+
`,wp=({preventPopup:o=!1})=>{const n=f(),{onClickNode:l}=va(),{searchText:c,setSearchText:d}=ha(),{selectedStreamName:u}=Me(),p=ct(e=>e.sources),h=ct(e=>e.destinations),g=ct(e=>e.actions),m=ct(e=>e.instrumentationRules),b=i(null),[v,y]=r(!1),[C,S]=r("all"),w=!o&&(!!c||v),x=()=>{d(""),y(!1),S("all")};lo(b,()=>x()),Po({key:"Escape",active:w},x);const{categories:T,searchResults:k}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,s=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:ut.Source,label:"Sources",count:r.length,entities:[]},{category:ut.Action,label:"Actions",count:s.length,entities:[]},{category:ut.Destination,label:"Destinations",count:c.length,entities:[]},{category:ut.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===ut.InstrumentationRule?l:e.category===ut.Source?r:e.category===ut.Action?s:e.category===ut.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:m,sources:ga(p,u),actions:g,destinations:Nt(h,u),searchText:c,selectedCategory:C}),[m,p,g,h,u,c,C]),$=a(()=>T.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[T]),E=k.some(({entities:e})=>e.length>0);return e(mp,{ref:b,children:[t(Kt,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>y(!0),width:gp}),w&&e(fp,{children:[$.length>1&&t(bp,{children:t(le,{options:$,selected:C,setSelected:S})}),E?t(vp,{children:k.map(({category:o,label:a,entities:i},r)=>{if(!i.length)return null;const c=Ca(o);return e(s,{children:[t(yp,{children:t(Q,{size:te.XXS,color:ee.Secondary,children:a})}),i.map((a,i)=>e(Cp,{onClick:()=>{const e=Ct(a);l(null,{data:{type:o,id:e}}),x()},children:[c&&t(c,{size:16,fill:n.v2.colors.white[500]}),t(Q,{size:te.XS,nowrap:!0,children:ya(a,o,{extended:!0})})]},`entity-${r}-${i}`))]},`category-list-${o}`)})}):t(Sp,{children:t(me,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},xp=m.div`
|
|
704
669
|
position: relative;
|
|
705
670
|
display: flex;
|
|
706
671
|
align-items: center;
|
|
@@ -711,7 +676,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
711
676
|
box-sizing: border-box;
|
|
712
677
|
border-radius: 16px 16px 0 0;
|
|
713
678
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
714
|
-
`,
|
|
679
|
+
`,Tp=m.div`
|
|
715
680
|
position: absolute;
|
|
716
681
|
bottom: 0;
|
|
717
682
|
left: 0;
|
|
@@ -720,7 +685,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
720
685
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
721
686
|
border-radius: 32px;
|
|
722
687
|
transition: width 0.3s;
|
|
723
|
-
`,
|
|
688
|
+
`,kp=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Mo();return e(xp,{children:[e(oe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(H,{size:Sa.S,partiallyChecked:r,value:!!s,onChange:c}),t(Q,{size:te.S,nowrap:!0,children:`${Ot(o)}s`}),t(Fe,{label:n,tooltip:a,status:pt.Unknown,textSize:te.XXXS})]}),e(oe,{children:[t(ot,{"data-id":`add-${o}`,icon:ii,onClick:()=>u(o)}),t(ot,{"data-id":`refresh-${o}`,icon:Ii,onClick:l,disabled:i})]}),"number"==typeof d&&t(Tp,{$percent:d})]})},$p=m(V)`
|
|
724
689
|
align-items: center !important;
|
|
725
690
|
justify-content: center !important;
|
|
726
691
|
align-self: stretch;
|
|
@@ -735,7 +700,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
735
700
|
&:hover {
|
|
736
701
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
737
702
|
}
|
|
738
|
-
`,
|
|
703
|
+
`,Ep=({entityType:o,description:n})=>{const{setCurrentModal:a}=Mo();return e($p,{onClick:()=>a(o),children:[e(oe,{$gap:4,children:[t(ii,{size:16}),t(Q,{size:te.S,children:`Add ${Ot(o)}`})]}),t(Q,{size:te.XXS,align:"center",children:n})]})},Ip=m.div`
|
|
739
704
|
display: flex;
|
|
740
705
|
align-items: center;
|
|
741
706
|
gap: 12px;
|
|
@@ -750,10 +715,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
750
715
|
&:hover {
|
|
751
716
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
752
717
|
}
|
|
753
|
-
`,
|
|
718
|
+
`,Np=m(oe)`
|
|
754
719
|
flex: 1;
|
|
755
720
|
min-width: 0;
|
|
756
|
-
`,
|
|
721
|
+
`,Ap=({entityId:o,entityType:n,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:g})=>{const m=f(),b=n===ut.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=Jt(),{selectedSources:w,setSelectedSources:x}=wa(),T=g,k=b?T.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind):-1},[b,w,k,T.id]),E=v&&!h?xa(we.Info,m):l?xa(l,m):void 0,I=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(Ip,{"data-id":I,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(H,{size:Sa.S,value:-1!==$,onChange:()=>{const e={...w};e[k]||(e[k]=[]),-1===$?e[k].push(T):e[k].splice($,1),x(e)}}),t(eo,{icons:u,icon:d,iconSrc:p}),e(Np,{$gap:4,children:[t(fe,{size:te.XS,nowrap:!0,children:i}),t(oe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(Ie,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Fe,{label:c,status:l&&[we.Error,we.Warning].includes(l)?l:pt.Unknown,leftIcon:E,textSize:te.XXXS})})})]})]})};function Op(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Ht.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Bt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Dp(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Ht.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Rp=m.div`
|
|
757
722
|
position: absolute;
|
|
758
723
|
top: 0;
|
|
759
724
|
left: 0;
|
|
@@ -764,22 +729,22 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
764
729
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
765
730
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
766
731
|
pointer-events: none;
|
|
767
|
-
`,
|
|
732
|
+
`,Pp=m.div`
|
|
768
733
|
display: flex;
|
|
769
734
|
align-items: center;
|
|
770
735
|
gap: 8px;
|
|
771
736
|
padding: 4px 8px 0;
|
|
772
|
-
`,
|
|
737
|
+
`,Fp=m.div`
|
|
773
738
|
flex: 1;
|
|
774
739
|
height: 1px;
|
|
775
740
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
776
|
-
`,
|
|
741
|
+
`,Lp=({namespace:e})=>{const o=f();return t(Rp,{children:t(Q,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},_p=({namespace:o})=>{const n=f();return e(Pp,{children:[t(Fp,{}),t(Q,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Fp,{})]})},zp={[ut.InstrumentationRule]:Be.NO_DATA_INSTRUMENTATION_RULES,[ut.Source]:Be.NO_DATA_SOURCES,[ut.Action]:Be.NO_DATA_ACTIONS,[ut.Destination]:Be.NO_DATA_DESTINATIONS},Bp=m.div`
|
|
777
742
|
display: flex;
|
|
778
743
|
flex-direction: column;
|
|
779
744
|
flex: 1 0 0;
|
|
780
745
|
min-width: 0;
|
|
781
746
|
${({$isVm:e})=>e?"width: 45vw;":""}
|
|
782
|
-
`,
|
|
747
|
+
`,Mp=m.div`
|
|
783
748
|
display: flex;
|
|
784
749
|
flex-direction: column;
|
|
785
750
|
align-items: stretch;
|
|
@@ -789,7 +754,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
789
754
|
border-radius: 0 0 16px 16px;
|
|
790
755
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
791
756
|
overflow: hidden;
|
|
792
|
-
`,
|
|
757
|
+
`,Xp=m.div`
|
|
793
758
|
position: relative;
|
|
794
759
|
display: flex;
|
|
795
760
|
flex-direction: column;
|
|
@@ -801,7 +766,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
801
766
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
802
767
|
height: ${({$height:e})=>e}px;
|
|
803
768
|
overflow: hidden;
|
|
804
|
-
`,
|
|
769
|
+
`,Vp=(e,t,o,n)=>{const a=Ct(e);if(!a)return null;const i=t===ut.Source;let l,r,s=!1,c=e;if(i){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Bt.Failure:return{status:we.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Bt.Notice:return{status:we.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Bt.Pending:case Bt.Waiting:return{status:void 0,faded:!1,displaySource:Op(e)};case Bt.Unsupported:case Bt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Dp(e)}}}(e);l=t.status,s=t.faded,r=t.tooltip,c=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=ka(e.conditions);l=t,s=o}const d=ya(e,t,{extended:i,prioritizeDisplayName:!i});let u,p,h,g,m;switch(t){case ut.Source:{u=Qt(e),p=Ca(ut.Source);const t=n?.get($a(a));g=no(t);break}case ut.Destination:{const t=lt(e.destinationType.type);p=t.icon,h=t.iconSrc;const o=n?.get($a(a));g=no(o),m=!e.disabled;break}case ut.Action:p=kt(e.type),m=!e.disabled;break;case ut.InstrumentationRule:p=Ft(e.type),m=!e.disabled}return{key:$a(a),entityId:a,namespace:i?e.id.namespace:void 0,raw:c,itemProps:{entityId:a,entityType:t,title:d,status:l,faded:s,tooltip:r,throughput:g,icon:p,icons:u,iconSrc:h,isActive:m,raw:c}}},Up=({entityType:o,entities:i,unfilteredCount:s,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),g=o===ut.Source,m=i.length!==s,f=ft(e=>g?e.progress[bt.Instrumenting]?.percentage:void 0),b=ft(e=>g?e.progress[bt.Uninstrumenting]?.percentage:void 0),v=!g||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=wa(),w=a(()=>g?Object.values(C).reduce((e,t)=>e+t.length,0):0,[g,C]),x=a(()=>{if(!c)return;const e=new Map,t=o===ut.Source?c.sources:o===ut.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(Ta(o),o.throughput);return e},[c,o]),T=a(()=>i.map(e=>Vp(e,o,0,x)).filter(Boolean),[i,o,x,h]),[k,$]=r(""),{elements:E,indexToNamespace:I,multipleNs:N,dividerCount:A}=a(()=>{const e=[],o=[],n=new Set(T.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const n of T)g&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(_p,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(Ap,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[T,g]);n(()=>{if(g&&I.length&&!k){const e=I.find(Boolean);e&&$(e)}},[g,I]);const O=l(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==k&&$(t)},[I,k]);if(h&&[ut.InstrumentationRule,ut.Action].includes(o))return null;const D=58*T.length+(N?28:0)+32*A,R=Math.max(0,u-52-16),P=Math.min(R,D)+8,F="number"==typeof v?`${v}%`:m?`${i.length}/${s}`:s;return e(Bp,{$isVm:h,children:[t(kp,{entityType:o,badge:F,badgeTooltip:m?Be.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&i?.length!==w,allSelected:w>0&&i?.length===w,onSelectAll:g?e=>{if(g)if(e){const e={};i?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(Mp,{children:i.length?e(Xp,{$height:P,children:[N&&k&&t(Lp,{namespace:k}),t(Yt,{gap:4,elements:E,onTopIndexChange:N?O:void 0})]}):d?t(oo,{size:3}):t(Ep,{entityType:o,description:zp[o]??Be.TO_COLLECT_OTEL_DATA})})]})},Hp=m.div`
|
|
805
770
|
width: 100%;
|
|
806
771
|
flex: 1;
|
|
807
772
|
min-height: 0;
|
|
@@ -809,10 +774,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
809
774
|
display: flex;
|
|
810
775
|
align-items: stretch;
|
|
811
776
|
gap: 16px;
|
|
812
|
-
`,
|
|
777
|
+
`,Gp=({metrics:o,refetchSources:n,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:r})=>{const s=ha(),{selectedStreamName:c}=Me(),{containerRef:d,containerHeight:u}=Ea(),p=ct(e=>e.sources),h=ct(e=>e.sourcesLoading),g=ct(e=>e.destinations),m=ct(e=>e.destinationsLoading),f=ct(e=>e.actions),b=ct(e=>e.actionsLoading),v=ct(e=>e.instrumentationRules),y=ct(e=>e.instrumentationRulesLoading),C=a(()=>ga(p,c),[p,c]),S=a(()=>Nt(g,c),[g,c]),w=a(()=>Ia(C,s),[C,s]),x=a(()=>Na(S,s),[S,s]),T=a(()=>Aa(f,s),[f,s]);return e(Hp,{ref:d,children:[t(Up,{entityType:ut.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:u,refetch:r}),t(Up,{entityType:ut.Source,entities:w,unfilteredCount:C.length,metrics:o,loading:h,maxHeight:u,refetch:n}),t(Up,{entityType:ut.Action,entities:T,unfilteredCount:f.length,loading:b,maxHeight:u,refetch:l}),t(Up,{entityType:ut.Destination,entities:x,unfilteredCount:S.length,metrics:o,loading:m,maxHeight:u,refetch:i})]})},jp=({effectiveConfig:n,fetchNamespacesWithWorkloads:i,persistSources:l,restartWorkloads:r,restartPod:s,recoverFromRollback:c,updateSource:d,fetchSourceById:u,fetchPeerSources:p,enableProfiling:h,fetchProfilingSlots:g,fetchSourceProfiling:m,fetchK8sManifest:f,getDestinationCategories:b,getPotentialDestinations:v,testConnection:y,createDestination:C,updateDestination:S,deleteDestination:w,createInstrumentationRule:x,updateInstrumentationRule:T,deleteInstrumentationRule:k,createAction:$,updateAction:E,deleteAction:I,workloads:N})=>{const{currentModal:A,setCurrentModal:O}=Mo(),{drawerType:D,drawerEntityId:R,setDrawerType:P,setDrawerEntityId:F}=Jt(),L=()=>{O(""),P(null),F(null)},_=a(()=>(N??[]).map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[N]),z=a(()=>Array.from(new Set((N??[]).map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[N]);return e(o,{children:[t(Hd,{}),A===ut.Source&&t(Ll,{children:t(As,{onClose:L,fetchNamespacesWithWorkloads:i,persistSources:l,withOverlay:!0})}),A===ut.Destination&&t(_l,{children:t(cs,{onClose:L,getDestinationCategories:b,getPotentialDestinations:v,testConnection:y,createDestination:C,updateDestination:S,withOverlay:!0})}),A===ut.InstrumentationRule&&t(Bl,{sourceOptions:_,namespaceOptions:z,children:t(ds,{onClose:L,createInstrumentationRule:x,withOverlay:!0})}),A===ut.Action&&t(zl,{children:t(Qr,{onClose:L,createAction:$,withOverlay:!0})}),D===ut.Source&&R&&t(Ml,{children:t(fd,{onClose:L,effectiveConfig:n,sourceId:R,persistSources:l,restartWorkloads:r,restartPod:s,recoverFromRollback:c,updateSource:d,fetchSourceById:u,fetchPeerSources:p,enableProfiling:h,fetchSourceProfiling:m,fetchProfilingSlots:g,fetchK8sManifest:f})}),D===ut.Destination&&R&&t(_l,{children:t(Fs,{onClose:L,destinationId:R,getDestinationCategories:b,testConnection:y,updateDestination:S,deleteDestination:w})}),D===ut.InstrumentationRule&&R&&t(Bl,{sourceOptions:_,namespaceOptions:z,children:t(_s,{onClose:L,ruleId:R,updateInstrumentationRule:T,deleteInstrumentationRule:k})}),D===ut.Action&&R&&t(zl,{children:t(Ds,{onClose:L,actionId:R,updateAction:E,deleteAction:I})})]})},Wp="multi-source-deselect",Kp="multi-source-restart",Yp="multi-source-uninstrument",Jp="Selected sources",qp="Deselect",Zp="Restart",Qp="Uninstrument",eh="Rollout Restart Workloads",th="Are you sure you want to rollout restart these workloads?",oh="Go Back",nh="Confirm",ah=({restartWorkloads:i,persistSources:s})=>{const{selectedStreamName:c}=Me(),{selectedSources:d,setSelectedSources:u}=wa(),[p,h]=r(!1),[g,m]=r(!1),f=a(()=>Object.values(d).reduce((e,t)=>e+t.length,0),[d]),b=l(()=>{u({})},[u]),v=l(()=>h(!1),[]),y=l(()=>m(!1),[]);n(()=>{b()},[c,b]);const C=l(()=>{i(Object.values(d).flat().filter(e=>e.id.kind!==to.StaticPod).map(qt)),b()},[i,d,b]),S=l(()=>{s(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:c}))]))),b()},[s,d,c,b]),w=a(()=>[{id:Wp,type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:qp,onClick:b}},{id:Kp,type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,label:Zp,leftIcon:Xi,onClick:()=>h(!0)}},{id:Yp,type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:Qp,leftIcon:ai,onClick:()=>m(!0)}}],[b]);return e(o,{children:[t(ua,{isOpen:f>0,richTitle:{icon:wi,title:Jp,badge:{label:f}},actions:w}),t(ze,{isOpen:p,title:eh,description:th,onClose:v,denyButton:{label:oh,variant:ie.Secondary,onClick:v},approveButton:{label:nh,variant:ie.Primary,onClick:()=>{C(),v()}}}),t(bl,{isOpen:g,action:"uninstrument",target:`${f} source${1===f?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},ih=e=>`Data Stream: ${e}`,lh="Search streams...",rh="No streams match",sh=m.div`
|
|
813
778
|
position: relative;
|
|
814
779
|
display: inline-flex;
|
|
815
|
-
`,
|
|
780
|
+
`,ch=m.div`
|
|
816
781
|
display: inline-flex;
|
|
817
782
|
align-items: center;
|
|
818
783
|
gap: 6px;
|
|
@@ -823,7 +788,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
823
788
|
&:hover {
|
|
824
789
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
825
790
|
}
|
|
826
|
-
`,
|
|
791
|
+
`,dh=m.div`
|
|
827
792
|
position: absolute;
|
|
828
793
|
top: calc(100% + 8px);
|
|
829
794
|
left: 0;
|
|
@@ -837,18 +802,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
837
802
|
border-radius: 12px;
|
|
838
803
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
839
804
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
840
|
-
`,
|
|
805
|
+
`,uh=m.div`
|
|
841
806
|
display: flex;
|
|
842
807
|
align-items: center;
|
|
843
808
|
gap: 8px;
|
|
844
809
|
width: 100%;
|
|
845
|
-
`,
|
|
810
|
+
`,ph=m.div`
|
|
846
811
|
display: flex;
|
|
847
812
|
flex-direction: column;
|
|
848
813
|
gap: 0;
|
|
849
814
|
max-height: 240px;
|
|
850
815
|
overflow-y: auto;
|
|
851
|
-
`,
|
|
816
|
+
`,hh=m.div`
|
|
852
817
|
display: flex;
|
|
853
818
|
align-items: center;
|
|
854
819
|
gap: 8px;
|
|
@@ -859,29 +824,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
859
824
|
&:hover {
|
|
860
825
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
861
826
|
}
|
|
862
|
-
`,
|
|
827
|
+
`,gh=m.div`
|
|
863
828
|
flex: 1;
|
|
864
829
|
min-width: 0;
|
|
865
830
|
overflow: hidden;
|
|
866
831
|
text-overflow: ellipsis;
|
|
867
832
|
white-space: nowrap;
|
|
868
|
-
`,
|
|
833
|
+
`,mh=m.div`
|
|
869
834
|
display: flex;
|
|
870
835
|
align-items: center;
|
|
871
836
|
gap: 2px;
|
|
872
837
|
flex-shrink: 0;
|
|
873
|
-
`,
|
|
838
|
+
`,fh=m.div`
|
|
874
839
|
display: flex;
|
|
875
840
|
padding-top: 4px;
|
|
876
841
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
877
|
-
`,
|
|
842
|
+
`,bh=({updateDataStream:l,deleteDataStream:s,createDataStream:c})=>{const d=f(),{isVm:u}=y(),{clearStore:p}=Oa(),{dataStreams:h,selectedStreamName:g,setSelectedStreamName:m}=Me(),b=i(null),[v,C]=r(!1),[S,w]=r(""),[x,T]=r(""),[k,$]=r(!1),[E,I]=r(!1),[N,A]=r(!1),[O,D]=r(""),[R,P]=r(!1);lo(b,()=>C(!1)),n(()=>{v||w("")},[v]);const F=a(()=>{if(!S)return h;const e=S.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(e))},[h,S]),L=v?bi:vi;return u?null:e(o,{children:[e(sh,{ref:b,children:[e(ch,{"data-id":"data-stream-select",$isOpen:v,onClick:()=>C(e=>!e),children:[t(qi,{size:24}),t(Q,{size:te.S,weight:500,nowrap:!0,children:ih(g)}),t(Fe,{label:h.length,status:pt.Unknown,textSize:te.XXXS}),t(L,{size:20,fill:d.v2.colors.silver[200]})]}),v&&e(dh,{children:[t(uh,{children:t(Kt,{value:S,onChange:w,placeholder:lh,width:"100%"})}),t(ph,{children:0===F.length?t(hh,{children:t(Q,{size:te.XS,color:ee.Secondary,children:rh})}):F.map(({name:o})=>{const n=o===Da;return e(hh,{"data-id":`stream-row-${o}`,$selected:o===g,onClick:()=>(e=>{e!==g&&(p(),m(e)),C(!1)})(o),children:[t(gh,{children:t(Q,{size:te.XS,nowrap:!0,children:o})}),e(mh,{children:[t(ot,{"data-id":`stream-edit-${o}`,icon:ui,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),T(o),$(!0)}}),!n&&t(ot,{"data-id":`stream-delete-${o}`,icon:ai,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),D(o),P(!0)}})]})]},`stream-${o}`)})}),t(fh,{children:t(ne,{"data-id":"add-stream-trigger",variant:ie.Secondary,size:ae.S,leftIcon:ii,label:`${St.NEW} ${Be.STREAM_NAME}`,fullWidth:!0,onClick:()=>{C(!1),p(),A(!0),I(!0)}})})]})]}),N&&t(Xl,{defaultExcludeName:g,children:t(Bd,{isOpen:E,onClose:()=>I(!1),onCloseEnd:()=>A(!1),createDataStream:c})}),x&&t(Xl,{children:t(Md,{isOpen:k,dataStreamName:x,onClose:()=>$(!1),onCloseEnd:()=>T(""),updateDataStream:l})}),t(bl,{target:`${Be.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:R,onClose:()=>P(!1),onApprove:async()=>{O&&await s(O)}})]})},vh=v`
|
|
878
843
|
0% {
|
|
879
844
|
background-position: 200% 50%;
|
|
880
845
|
}
|
|
881
846
|
100% {
|
|
882
847
|
background-position: 0% 50%;
|
|
883
848
|
}
|
|
884
|
-
`,
|
|
849
|
+
`,yh=m.div`
|
|
885
850
|
display: flex;
|
|
886
851
|
align-items: center;
|
|
887
852
|
justify-content: space-evenly;
|
|
@@ -892,50 +857,50 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
892
857
|
|
|
893
858
|
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%)`};
|
|
894
859
|
background-size: 200% 100%;
|
|
895
|
-
animation: ${
|
|
896
|
-
`,
|
|
860
|
+
animation: ${vh} 15s linear infinite;
|
|
861
|
+
`,Ch=[Si,wi,mi,fi],Sh=({metrics:o,refetchSources:n,refetchDestinations:a,refetchActions:i,refetchInstrumentationRules:l,updateDataStream:r,deleteDataStream:c,createDataStream:d,...u})=>{const p=f();return e(da,{children:[e(Ye,{fullHeight:!0,customTitle:t(bh,{updateDataStream:r,deleteDataStream:c,createDataStream:d}),customSearch:t(wp,{}),filters:t(hp,{}),children:[t(yh,{children:Ch.map((o,n)=>e(s,{children:[t(o,{size:24}),n<Ch.length-1&&t(gi,{fill:p.v2.colors.white[500]+qe["020"],size:24})]},o.name))}),t(Gp,{metrics:o,refetchSources:n,refetchDestinations:a,refetchActions:i,refetchInstrumentationRules:l})]}),t(jp,{...u}),t(ah,{restartWorkloads:u.restartWorkloads,persistSources:u.persistSources})]})};var wh;!function(e){e.Gateway="gateway",e.Node="node"}(wh||(wh={}));const xh=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Mi,size:ae.S,variant:ie.Text,onClick:o,disabled:l}}),n&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ii,size:ae.S,variant:ie.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(Ra,{icon:Zi,title:"Collectors Pipeline"}),t(Pa,{actions:r})]})},Th=({pod:o,getExtendedPodInfo:i,onClose:l})=>{const{formatTimeAgo:s}=Lt(),[c,d]=r(null);n(()=>{o?i(o.namespace,o.name).then(e=>d(e??null)):d(null)},[o]);const u=a(()=>[{id:Bo(),title:"Node",label:c?.node??"-",withCopy:!0},{id:Bo(),title:"Status",badge:{status:Fa(c?.status),label:c?.status??"-"}}],[c]),p=a(()=>c?.containers?.map(e=>({id:Bo(),items:[{id:Bo(),title:"Container",label:e.name??"-"},{id:Bo(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:Bo(),title:"Ready",badge:{status:e.ready?we.Success:we.Error,leftIcon:e.ready?ri:si,label:e.ready?"True":"False",invertColors:!0}},{id:Bo(),title:"Started",badge:{status:e.started?we.Success:we.Error,leftIcon:e.started?ri:si,label:e.started?"True":"False",invertColors:!0}},{id:Bo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Bo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Bo(),title:Be.RESTARTS,label:e.restarts.toString()},{id:Bo(),title:"State Reason",label:e.stateReason??"-"},{id:Bo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Bo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return t(q,{isOpen:!!o,header:{icon:ki,title:"Pod Information",onClose:l},children:c?e(xt,{bgTint:"1000",richTitle:{icon:ki,title:c.name,withCopy:!0},children:[t(xt,{bgTint:"900",cellsPerRow:2,items:u}),e(xt,{bgTint:"900",richTitle:{icon:Pi,title:Be.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(jt,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),t(jt,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),t(jt,{value:`kubectl logs ${c.name} -n ${c.namespace}`})]}),t(xt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:p.length?p.map(({id:e,items:o})=>t(xt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(me,{title:"No containers",subTitle:"Pod has no containers"})}),t(yl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})})})};var kh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(kh||(kh={}));const $h=e=>{const t=[{key:kh.PodName,label:"Pod Name"},{key:kh.Status,label:"Status"},{key:kh.Restarts,label:Be.RESTARTS},{key:kh.NodeName,label:"Node Name"},{key:kh.Age,label:"Age"},{key:kh.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:kh.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Eh=({isLoading:o,pods:n,getExtendedPodInfo:i,withSpanDropRate:l})=>{const s=f(),{formatTimeAgo:c}=Lt(),[d,u]=r(null),p=a(()=>n.map(o=>({onClick:()=>u(o),cells:[{key:kh.PodName,rawValue:o.name},{key:kh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Fe,{status:Fa(e),label:e});var e}},{key:kh.Restarts,rawValue:o.restartsCount.toString()},{key:kh.NodeName,rawValue:o.nodeName},{key:kh.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(Q,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?we.Error:we.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?we.Error:we.Success;return e(oe,{$gap:4,children:[t(Ie,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Fe,{status:l,label:`Receiver ${i}%`,leftIcon:l===we.Error?Qi:el,useSecondaryTone:!0,invertColors:!0})}),t(Ie,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Fe,{status:c,label:`Exporter ${s}%`,leftIcon:c===we.Error?Qi:el,useSecondaryTone:!0,invertColors:!0})})]})}},{key:kh.Age,rawValue:c(o.creationTimestamp)},{key:kh.DockerImage,rawValue:o.image}]})),[n,s]);return e(xt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:ki,title:"Pods"},children:[t(go,{variant:mo.Data,isLoading:o,columns:$h(l),rows:p}),t(Th,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)})]})},Ih=({isOpen:e,onClose:o,title:n,yaml:a})=>t(q,{isOpen:e,header:{icon:tl,title:n,onClose:o},children:t(yl,{yaml:a,defaultOpen:!0})}),Nh=e=>{switch(e){case La.Healthy:return"All desired replicas are updated, available, and ready";case La.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case La.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case La.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case La.Down:return"No available replicas";case La.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Ah;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Ah||(Ah={}));const Oh=m.div`
|
|
897
862
|
flex: 0.5;
|
|
898
863
|
padding: 12px;
|
|
899
864
|
border-radius: 12px;
|
|
900
865
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
901
|
-
`,
|
|
866
|
+
`,Dh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:s}=Lt(),[c,d]=r(null),u=a(()=>(e=>{switch(e){case wh.Gateway:return"Deployment";case wh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=a(()=>((e,t,o,n)=>{const a={status:pt.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case wh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case wh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:we.Info,label:"Rollout in progress",rightIcon:Ii,useSecondaryTone:!0}:l?{status:pt.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,i,s),[n,i,o,s]),h=a(()=>((e,t,o,n)=>{let a=n?we.Info:pt.Unknown,i=n?"Loading":La.Unknown,l=n?"Fetching data...":Nh(La.Unknown);switch(e){case wh.Gateway:a=t?.status?Fa(t?.status):a,i=t?.status??i,l=t?.status?Nh(t.status):l;break;case wh.Node:a=o?.status?Fa(o?.status):a,i=o?.status??i,l=o?.status?Nh(o.status):l}return{status:a,title:i,description:l}})(o,n,i,l),[n,i,o,l]),g=a(()=>((e,t,o)=>{switch(e){case wh.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 wh.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),m=a(()=>((e,t,o,n)=>{switch(e){case wh.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case wh.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,i,l),[n,i,o,l]),f=a(()=>(o===wh.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===wh.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(xt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:tl,title:u,badge:p},actions:[{id:Bo(),type:Wt.ButtonDropData,buttonProps:{variant:ie.Secondary,size:ae.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Ah.ManifestYaml,label:u,icon:ol},{id:Ah.ConfigMapYaml,label:"ConfigMap",icon:ol}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(_a,{...h})}),g.map(e=>t(Oh,{children:t("div",{children:t(za,{...e})})},e.title)),m.map(e=>t(Ba,{...e},e.title))]}),t(Ih,{isOpen:c===Ah.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(Ih,{isOpen:c===Ah.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Rh=[{value:wh.Gateway,label:"Gateway"},{value:wh.Node,label:"Node Collector"}],Ph=({minSupportedVersion:o=0,effectiveConfig:i,getGatewayInfo:s,getGatewayPods:c,getNodeCollectorInfo:d,getNodeCollectorPods:u,getExtendedPodInfo:p})=>{const{isVersionSupported:h,version:g}=y(o),[m,f]=r(!1),[b,v]=r(wh.Gateway),[C,S]=r(null),[w,x]=r([]),[T,k]=r(null),[$,E]=r([]),I=l(async e=>{e?.silent||f(!0);try{switch(b){case wh.Gateway:S(await s()??null),x(await c()??[]);break;case wh.Node:k(await d()??null),E(await u()??[])}}catch(e){}e?.silent||f(!1)},[b]),N=l(()=>I(),[I]);n(()=>{I();const e=setInterval(()=>I({silent:!0}),3e3);return()=>clearInterval(e)},[I]);const A=a(()=>b===wh.Gateway?w:$,[w,$,b]);return e(da,{children:[t(xh,{disabled:!h,loading:m,onClickDownloadDiagnose:void 0,onClickRefresh:N}),e(Ma,{children:[e(V,{children:[t(le,{variant:po.Underline,size:be.L,options:Rh,selected:b,setSelected:v}),t(Dh,{selectedTab:b,gatewayInfo:C,nodeCollectorInfo:T,isLoading:m})]}),t(Eh,{isLoading:m,pods:A,getExtendedPodInfo:p,withSpanDropRate:!1===i?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!h&&t(wl,{minSupportedVersion:o,currentVersion:g||""})]})]})},Fh=m.div`
|
|
902
867
|
display: inline-flex;
|
|
903
868
|
align-items: center;
|
|
904
869
|
min-width: 0;
|
|
905
870
|
overflow: hidden;
|
|
906
871
|
white-space: pre;
|
|
907
872
|
text-overflow: ellipsis;
|
|
908
|
-
`,
|
|
873
|
+
`,Lh=m.div`
|
|
909
874
|
display: flex;
|
|
910
875
|
flex-direction: column;
|
|
911
876
|
gap: 4px;
|
|
912
877
|
min-width: 0;
|
|
913
878
|
flex: 1;
|
|
914
879
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
915
|
-
`,
|
|
880
|
+
`,_h=m(oe)`
|
|
916
881
|
flex-shrink: 0;
|
|
917
882
|
gap: 6px;
|
|
918
883
|
align-items: center;
|
|
919
884
|
min-height: 22px;
|
|
920
|
-
`;const
|
|
885
|
+
`;const zh=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Bh=[{value:"all",label:Va},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Mh=({title:o,items:n,isLoading:i,showTypeFilter:s,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=f(),[g,m]=r(""),[b,v]=r("all"),y=a(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,b,s);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,g),e},[n,b,s,g]),C=a(()=>y.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(h,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(Lh,{$disabled:o.disabled,children:[t(Fh,{children:t(S,{parts:o.summary})}),o.name&&t(Q,{size:te.XXS,color:ee.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(_h,{children:[o.disabled&&t(Fe,{label:Xa,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Fe,{label:o.typeBadge,textSize:te.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),w=a(()=>{const e=e=>t(di,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=l(e=>{const t=C.indexOf(e);if(t<0)return[];const o=y[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:yo,leftIcon:ui,onClick:()=>u(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>p(o.ruleId,o.samplingId)}]:[]},[C,y,u,p,w]);return t(Ye,{fullHeight:!0,richTitle:{icon:Ui,title:o,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:g,onChange:m,placeholder:"Search..",width:"500px",...s?{segment:{"data-id":"sampling-segment-type-filter",options:Bh,selected:b,setSelected:v}}:{}},children:t(go,{variant:mo.Pretty,hideHeader:!0,isLoading:i,noDataProps:g.trim()?{hideIcon:!0,title:Ua,subTitle:ja(g)}:{hideIcon:!0,title:Ga,button:{label:Ha,onClick:d}},columns:zh,rows:C,getRowActions:x})})},Xh=({workloads:o,samplingRules:s,k8sHealthProbesConfig:c,loading:d,docsUrl:u,fetchSamplingRules:p,createNoisyOperationRule:h,updateNoisyOperationRule:g,createHighlyRelevantOperationRule:m,updateHighlyRelevantOperationRule:f,createCostReductionRule:b,updateCostReductionRule:v,deleteSamplingRule:y,updateK8sHealthProbesConfig:C})=>{const S=a(()=>o.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[o]),T=a(()=>Array.from(new Set(o.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[o]),[X,U]=r(k.Noisy),[H,G]=r(null),[j,W]=r(!1),[K,Y]=r(!1),[J,q]=r(null),[Z,Q]=r(!1),[ee,te]=r(!1),[re,se]=r(!1),[ce,de]=r(!1);i(!1),n(()=>{},[d,s]);const ue=a(()=>w(c),[c]),pe=a(()=>$(s),[s]),he=a(()=>x(pe?.rule??null),[pe]),ge=a(()=>E(s),[s]),me=a(()=>I(ge?.rule??null),[ge]),fe=i(H);fe.current=H,n(()=>{const e=fe.current;if(!e)return;const t=N(s,e);t?G(t):(G(null),W(!1))},[s]);const ve=a(()=>{const e=new Set;return pe&&e.add(pe.rule.ruleId),ge&&e.add(ge.rule.ruleId),e},[pe,ge]),ye=a(()=>A(s,X,ve),[s,X,ve]),Ce=l(()=>Y(!0),[]),xe=l(()=>Y(!1),[]);l(()=>de(!1),[]);const Te=l(async e=>{const t=s[0]?.id??"default";switch(L[X]){case"noisy":await h(t,R(e));break;case"highlyRelevant":await m(t,D(e));break;case"costReduction":await b(t,O(e))}Y(!1)},[s,X,h,m,b]),ke=l(e=>{const t=P(s,e);t&&(W(!1),G(t))},[s]),$e=l(()=>{G(null),W(!1)},[]),Ee=l((e,t)=>{const o=H;if(o&&o.rule.ruleId===e&&o.samplingId===t)W(!0),G({...o});else for(const o of s){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return W(!0),void G({category:n.category,rule:n.rule,samplingId:t,summary:F(n.category,n.rule)})}},[H,s]),Ie=l(async(e,t,o)=>{const n=H?.category;if(n){switch(n){case"noisy":await g(o,t,R(e));break;case"highlyRelevant":await f(o,t,D(e));break;case"costReduction":await v(o,t,O(e))}W(!1)}},[H,g,f,v]),Ne=l((e,t)=>{q({ruleId:e,samplingId:t})},[]),Ae=l(async()=>{if(!J)return;const{ruleId:e,samplingId:t}=J,o=H?.category||L[X];await y(t,e,o),G(null),W(!1),q(null)},[J,H,X,y]),Oe=l(()=>q(null),[]),De=l(async(e,t)=>{await C(e,t),Q(!1)},[C]),Re=l(async e=>{const t=s[0]?.id??"default",o=pe;o?await f(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await m(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),te(!1)},[s,pe,m,f]),Pe=l(async(e,t)=>{const o=s[0]?.id??"default",n=ge;n?await v(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await b(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[s,ge,b,v]),Fe=l(e=>{const t=L[X];let o=null;switch(t){case"noisy":{const n=R(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=D(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=O(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:Wa,ruleId:o}:null},[s,X]),Le=l(e=>{const t=H?.category,o=H?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const a=R(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}case"highlyRelevant":{const a=D(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},o);break}case"costReduction":{const a=O(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}}return n?{message:Wa,ruleId:n}:null},[s,H]),_e=l(e=>{Y(!1);for(const t of s){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return W(!0),void G({category:o.category,rule:o.rule,samplingId:t.id,summary:F(o.category,o.rule)})}},[s]),Be=a(()=>{const e=[];return u&&e.push({id:Bo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ka,leftIcon:ci,size:ae.S,variant:ie.Text,onClick:()=>window.open(u,"_blank")}}),e.push({id:Bo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ya,leftIcon:Ii,size:ae.S,variant:ie.Text,onClick:p,loading:d}}),e.push({id:Bo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Ja,rightIcon:ii,size:ae.S,variant:ie.Primary,onClick:Ce}}),e},[u,p,d,Ce]);return e(da,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ra,{icon:Ui,title:Za,subTitle:qa}),t(Pa,{actions:Be})]}),e(V,{$gap:12,$fullHeight:!0,children:[t(le,{variant:po.Underline,size:be.L,options:z,selected:X,setSelected:U}),e(oe,{$justifyContent:"space-between",children:[t(Se,{status:we.Default,message:B[X]}),u&&t(ne,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:ci,size:ae.S,variant:ie.Text,onClick:()=>window.open(u,"_blank")})]}),X===k.Noisy?t(rl,{title:je,summary:ue,onEdit:()=>Q(!0)}):X===k.HighlyRelevant?t(rl,{title:Xe,summary:he,onEdit:()=>te(!0)}):X===k.CostReduction?t(rl,{title:He,summary:me,onEdit:()=>se(!0)}):null,t(Mh,{title:M[X],items:ye,isLoading:d,showTypeFilter:X===k.HighlyRelevant,onRuleClick:ke,onCreateRule:Ce,onEditRule:Ee,onDeleteRule:Ne})]}),t(Nd,{formType:Nl.View,data:H,defaultEditMode:j,onClose:$e,onDelete:Ne,onSaveEdit:Ie,sourceOptions:S,namespaceOptions:T,validateForm:Le,onNavigateToDuplicate:_e}),t(Nd,{formType:Nl.Create,isOpen:K,category:L[X],onClose:xe,onSubmit:Te,sourceOptions:S,namespaceOptions:T,validateForm:Fe,onNavigateToDuplicate:_e}),t(Nd,{formType:Nl.EditAutoNoisy,isOpen:Z,enabled:c?.enabled??!1,keepPercentage:c?.keepPercentage??0,onClose:()=>Q(!1),onSave:De}),t(Nd,{formType:Nl.EditAutoHighlyRelevant,isOpen:ee,enabled:!!pe&&!pe.rule.disabled,onClose:()=>te(!1),onSave:Re}),t(Nd,{formType:Nl.EditAutoCostReduction,isOpen:re,enabled:!!ge&&!ge.rule.disabled,dropPercentage:ge?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Pe}),t(ze,{title:oi,description:ti,isOpen:!!J,onClose:Oe,denyButton:{label:ei,variant:ie.Secondary,onClick:Oe},approveButton:{label:Qa,variant:ie.Primary,onClick:()=>{Ae(),Oe()}}}),false]})},Vh=m.div`
|
|
921
886
|
display: flex;
|
|
922
887
|
align-items: center;
|
|
923
888
|
justify-content: space-between;
|
|
924
889
|
padding: 0 12px;
|
|
925
|
-
`,
|
|
890
|
+
`,Uh=({disabled:o,loading:n,tabs:i,selectedTab:l,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[u,p]=r(!1),h=a(()=>{const e=[];return c&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Reset",leftIcon:ai,size:ae.S,variant:ie.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ii,size:ae.S,variant:ie.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(Vh,{children:[e(oe,{$gap:12,$alignItems:"center",children:[t(Ra,{icon:Ti,title:"Odigos Settings"}),t(tt,{width:"350px",options:i,values:[l],setValues:e=>s(e[0]),disabled:o})]}),t(Pa,{actions:h}),t(ze,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:ie.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:ie.Primary,onClick:()=>{c?.(),p(!1)}}})]})},Hh=m(oe)`
|
|
926
891
|
flex: 1;
|
|
927
892
|
min-height: 0;
|
|
928
893
|
width: 100%;
|
|
929
894
|
align-self: stretch;
|
|
930
|
-
`,
|
|
895
|
+
`,Gh=m(V)`
|
|
931
896
|
flex: 1;
|
|
932
897
|
min-height: 0;
|
|
933
898
|
height: 100%;
|
|
934
899
|
overflow-y: auto;
|
|
935
|
-
`,
|
|
900
|
+
`,jh=m(Gh)`
|
|
936
901
|
> section {
|
|
937
902
|
min-height: 100%;
|
|
938
903
|
box-sizing: border-box;
|
|
939
904
|
flex-shrink: 0;
|
|
940
905
|
}
|
|
941
|
-
`,
|
|
906
|
+
`,Wh=e=>"general"===e.name?0:"advanced"===e.name?2:1,Kh=({minSupportedVersion:o=0,configYamls:i,configYamlsLoading:l,effectiveConfig:s,effectiveConfigLoading:c,refetch:d,factoryReset:u,onSave:p,saveLoading:h})=>{const{isVersionSupported:g,version:m,isEnterprise:f}=y(o),b=a(()=>{if(!s)return{};const{manifestYAML:e,provenance:t,...o}=s;return o},[s]),{formData:v,handleFormChange:C,getNestedValue:S,getFormDiff:w,isFormDirty:x}=$t(b);n(()=>{"{}"!==JSON.stringify(b)&&"{}"===JSON.stringify(v)&&C(void 0,void 0,b)},[b,v]);const T=a(()=>[...i].sort((e,t)=>Wh(e)-Wh(t)),[i]),k=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(s?.provenance),[s?.provenance]),$=a(()=>{const e=new Set;for(const t of i)for(const o of t.fields)o.componentType===It.Dropdown&&e.add(o.helmValuePath);return e},[i]),E=a(()=>i.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:S("formData",e.helmValuePath)}))),[i,v,S]),[I,N]=r(!1),A=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(w(b,v),$);await(p?.(e)),C(void 0,void 0,{})},O=a(()=>[{id:Bo(),type:Wt.Button,buttonProps:{"data-id":"settings-save",variant:ie.Primary,size:ae.S,label:"Save Changes",leftIcon:yi,loading:h,onClick:()=>N(!0)}},{id:Bo(),type:Wt.Button,buttonProps:{"data-id":"settings-cancel",variant:ie.Secondary,size:ae.S,label:"Cancel",leftIcon:Ci,onClick:()=>C(void 0,void 0,b)}}],[h,w,b,v,C]),D=a(()=>T.map(e=>({id:e.name,label:e.displayName})),[T]),R=a(()=>T.map(e=>e.name),[T]),{selectedSection:P,setSelectedSection:F,setSectionRef:L,setScrollContainerRef:_}=ni({sectionNames:R});return e(da,{$gap:12,children:[t(Uh,{disabled:!g,loading:l||c,tabs:D,selectedTab:P,setSelectedTab:F,onClickReset:u?()=>u().then(()=>d?.()):void 0,onClickRefresh:d?()=>d():void 0}),e(Ma,{children:[!g&&t(wl,{minSupportedVersion:o,currentVersion:m||""}),t(ua,{isOpen:x,richTitle:{icon:Ti,title:"Config Settings"},actions:O}),t(ze,{isOpen:I,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>N(!1),denyButton:{label:"Keep editing",variant:ie.Secondary,onClick:()=>N(!1)},approveButton:{label:"Save changes",variant:ie.Primary,onClick:()=>{A(),N(!1)}}}),e(Hh,{$gap:24,$alignItems:"stretch",children:[t(Gh,{ref:_,$gap:24,$width:"100%",children:i.length?T.map(o=>t(Ye,{id:o.name,ref:e=>L(o.name,e),richTitle:{icon:Ti,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!f)return null;if(o.renderCondition&&!Ce(o.renderCondition,[],E))return null;const n=st(o.componentProps||"{}",{}),a=k[o.helmValuePath];return e(V,{$gap:4,children:[t(al,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?we.Warning:pt.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||h,value:S("formData",o.helmValuePath),setValue:e=>C(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t(Se,{status:we.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):l?t(Qe,{$height:"30vh",children:t(at,{withSpinner:!0})}):t(Ye,{richTitle:{icon:Ti,title:"Config Settings"},children:t(me,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(jh,{children:c&&!s?.manifestYAML?t(Qe,{$height:"30vh",children:t(at,{withSpinner:!0})}):t(yl,{title:"Effective Config YAML",yaml:s?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0})})]})]})]})};export{Qr as AddActionDrawer,$r as AddActionForm,Bd as AddDataStreamModal,cs as AddDestinationDrawer,Nr as AddDestinationForm,ds as AddRuleDrawer,_r as AddRuleForm,As as AddSourceDrawer,Hu as CentralConnections,Br as DataStreamForm,zr as DataStreamMergeWarning,Ds as EditActionDrawer,Rs as EditConfigDrawer,Md as EditDataStreamModal,Fs as EditDestinationDrawer,_s as EditRuleDrawer,fd as EditSourceDrawer,Mr as EditSourceForm,Ud as ONBOARDING_DONE_MODAL_ID,ap as Onboarding,Hd as OnboardingDone,Sh as Overview,Ph as PipelineCollectors,ur as RegexTesterDrawer,zu as SamplingOnboardingModal,Nd as SamplingRuleDrawer,jr as SamplingRuleForm,Xh as SamplingRules,Kh as Settings,zd as SystemDrawer,Rh as TABS};
|