@odigos/ui-kit 0.0.267 → 0.0.268
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 +13 -0
- package/lib/chunks/{index-DUhfkGj1.js → index-C4ggK_Tz.js} +1 -1
- package/lib/chunks/{odigos-context-DzuZq_D5.js → odigos-context-pyaT77YA.js} +1 -1
- package/lib/chunks/{source-instrument-form-context-oSSPNkMA.js → source-instrument-form-context-Bryjhxz4.js} +1 -1
- package/lib/chunks/{ui-components-Dq_j4_BI.js → ui-components--pbkVlso.js} +213 -208
- package/lib/components/condition/index.d.ts +6 -18
- package/lib/components.js +1 -1
- package/lib/constants/instrumentation-rules/index.d.ts +1 -0
- package/lib/constants/instrumentation-rules/supported-languages.d.ts +16 -0
- package/lib/constants.js +1 -1
- package/lib/containers.js +244 -231
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/instrumentation-rules/index.d.ts +3 -2
- package/lib/types/workload/index.d.ts +12 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEffect as i,useMemo as a,useRef as l,useCallback as r,useState as s,Fragment as c,forwardRef as d,useImperativeHandle as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,f as T,e as k,d as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEffect as i,useMemo as a,useRef as l,useCallback as r,useState as s,Fragment as c,forwardRef as d,useImperativeHandle as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,f as T,e as k,d as I,q as E,g as N,h as $,j as O,p as A,l as R,c as D,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as q,I as J,J as Z}from"./chunks/odigos-context-pyaT77YA.js";import{bi as Q,w as ee,x as te,C as oe,aT as ne,I as ie,bs as ae,d as le,e as re,j as se,aX as ce,bt as de,N as pe,Q as ue,U as he,y as me,m as ge,n as fe,B as be,S as ve,bu as ye,bv as Ce,a1 as Se,bw as xe,bx as we,k as Te,by as ke,F as Ie,bz as Ee,s as Ne,T as $e,bA as Oe,bj as Ae,aW as Re,bB as De,bC as _e,i as Pe,az as Le,aB as Fe,bD as Me,bo as ze,bp as Be,bn as Xe,bE as Ue,u as Ve,H as He,r as je,G as Ge,J as We,q as Ke,p as Ye,bF as qe,bG as Je,bH as Ze,bI as Qe,bJ as et,W as tt,D as ot,b6 as nt,bK as it,bL as at,bM as lt,bN as rt,bO as st,bP as ct,bQ as dt,bR as pt,z as ut,bS as ht,bT as mt,bU as gt,bV as ft,bW as bt,aV as vt,bm as yt,h as Ct,bX as St,bY as xt,aY as wt,bZ as Tt,b_ as kt,aR as It,bq as Et,b5 as Nt,b as $t,f as Ot,b$ as At,b7 as Rt,c0 as Dt,c1 as _t,b9 as Pt,c2 as Lt,a_ as Ft,c3 as Mt,c as zt,l as Bt,bc as Xt,bh as Ut,ay as Vt,c4 as Ht,c5 as jt,bg as Gt,c6 as Wt,c7 as Kt,c8 as Yt,v as qt,b1 as Jt,b2 as Zt,aD as Qt,c9 as eo,ca as to,cb as oo,cc as no,cd as io,ce as ao,cf as lo,cg as ro,ch as so,aJ as co,ci as po,cj as uo,A as ho,aZ as mo,aU as go,ck as fo,cl as bo,cm as vo,cn as yo,co as Co,cp as So,br as xo,cq as wo,cr as To,cs as ko,ct as Io,cu as Eo,cv as No,cw as $o,cx as Oo,cy as Ao,cz as Ro,aI as Do,cA as _o,cB as Po,cC as Lo,cD as Fo,cE as Mo,cF as zo,cG as Bo,cH as Xo,cI as Uo,cJ as Vo,cK as Ho,cL as jo,cM as Go,ao as Wo,cN as Ko,cO as Yo,cP as qo,cQ as Jo,cR as Zo,cS as Qo,cT as en,cU as tn,cV as on,cW as nn,cX as an,cY as ln,cZ as rn,c_ as sn,c$ as cn,a7 as dn,d0 as pn,d1 as un,a$ as hn,d2 as mn,d3 as gn,d4 as fn,d5 as bn,d6 as vn,d7 as yn,d8 as Cn,d9 as Sn,da as xn,db as wn,dc as Tn,dd as kn,de as In,df as En,dg as Nn,dh as $n,di as On,dj as An,dk as Rn,dl as Dn,dm as _n,dn as Pn,dp as Ln,dq as Fn,dr as Mn,ds as zn,dt as Bn,du as Xn,dv as Un,dw as Vn,dx as Hn,dy as jn,dz as Gn,dA as Wn,dB as Kn,dC as Yn,dD as qn,dE as Jn,dF as Zn,dG as Qn,dH as ei,dI as ti,dJ as oi,dK as ni,dL as ii,dM as ai,dN as li,dO as ri,dP as si,dQ as ci,dR as di,dS as pi,dT as ui,dU as hi,dV as mi,dW as gi,dX as fi,dY as bi,dZ as vi,d_ as yi,d$ as Ci,e0 as Si,e1 as xi,e2 as wi,e3 as Ti,e4 as ki,e5 as Ii,e6 as Ei,e7 as Ni,e8 as $i,e9 as Oi,ea as Ai,eb as Ri,ec as Di,ed as _i,ee as Pi,ef as Li,P as Fi,eg as Mi,eh as zi,ei as Bi,ej as Xi,ek as Ui,el as Vi,em as Hi,aS as ji,en as Gi,aN as Wi,eo as Ki,ep as Yi,eq as qi,er as Ji,es as Zi,et as Qi,eu as ea,ev as ta,ew as oa,ex as na,ey as ia,b8 as aa,ez as la,R as ra,a as sa,eA as ca,eB as da,eC as pa,eD as ua,eE as ha,eF as ma,eG as ga,eH as fa,eI as ba,eJ as va,eK as ya,eL as Ca,eM as Sa,eN as xa,eO as wa,eP as Ta,eQ as ka,eR as Ia,eS as Ea,eT as Na,eU as $a,eV as Oa}from"./chunks/ui-components--pbkVlso.js";import{TrashIcon as Aa,PlusIcon as Ra,ArrowRightIcon as Da,VSquareIcon as _a,XSquareIcon as Pa,BookIcon as La,DeleteIcon as Fa,EditIcon as Ma,GoLogo as za,JavaLogo as Ba,ChevronRightIcon as Xa,ActionIcon as Ua,DestinationIcon as Va,ChevronUpIcon as Ha,ChevronDownIcon as ja,VIcon as Ga,XIcon as Wa,InstrumentationRuleIcon as Ka,SourceIcon as Ya,NamespacesIcon as qa,AwsLogo as Ja,CloudConnectorIcon as Za,EyeOpenIcon as Qa,CloudConnectorPolicyIcon as el,ArrowLeftIcon as tl,ISquareIcon as ol,RefreshIcon as nl,SettingsIcon as il,PodIcon as al,OdigosLogo as ll,K8sLogo as rl,ExclamationCircleIcon as sl,QuestionCircleIcon as cl,InboundIcon as dl,OutboundIcon as pl,UserIcon as ul,TerminalIcon as hl,RefreshLeftArrowIcon as ml,MinusIcon as gl,SearchIcon as fl,ExpandIcon as bl,CopyIcon as vl,DotIcon as yl,ArrowDownIcon as Cl,DownloadIcon as Sl,VmLogo as xl,SamplingIcon as wl,ExclamationTriangleIcon as Tl,KeyIcon as kl,DiagnoseIcon as Il,StarIcon as El,ArrowIcon as Nl,ConnectionsIcon as $l,FilterIcon as Ol,DataStreamIcon as Al,PipelineCollectorIcon as Rl,ArrowDownSquareIcon as Dl,ArrowUpSquareIcon as _l,GatewayIcon as Pl,YamlIcon as Ll,ImageErrorIcon as Fl,LockIcon as Ml}from"./icons.js";import{h as zl,o as Bl,n as Xl,q as Ul,m as Vl,t as Hl,s as jl,S as Gl,w as Wl,E as Kl,x as Yl,y as ql,v as Jl,l as Zl,d as Ql,O as er,f as tr,b as or,A as nr,R as ir,C as ar,e as lr,D as rr}from"./chunks/source-instrument-form-context-Bryjhxz4.js";import{d as sr,i as cr,I as dr,j as pr,A as ur,g as hr,P as mr,S as gr,R as fr,e as br,h as vr,c as yr,f as Cr,k as Sr,W as xr,C as wr,b as Tr,Y as kr,O as Ir,a as Er,U as Nr}from"./chunks/index-C4ggK_Tz.js";import{createPortal as $r}from"react-dom";import{MarkerType as Or,useNodesState as Ar,useEdgesState as Rr,Handle as Dr,Position as _r,getSmoothStepPath as Pr,BaseEdge as Lr,EdgeLabelRenderer as Fr,ReactFlowProvider as Mr,ReactFlow as zr,Background as Br,Controls as Xr,ControlButton as Ur,useReactFlow as Vr}from"@xyflow/react";import Hr from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const jr=[{id:"CREDIT_CARD",label:"Credit card"}],Gr=[{id:Q.CollectContainerAttributes,label:"Collect container attributes"},{id:Q.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:Q.CollectWorkloadId,label:"Collect workload ID"},{id:Q.CollectClusterId,label:"Collect cluster ID"}],Wr=[{id:ae.Pod,label:ae.Pod},{id:ae.Namespace,label:ae.Namespace},{id:ae.Node,label:ae.Node}],Kr=[{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:Wr}],Yr=[{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:Wr}],qr=/^[a-zA-Z]$/,Jr=new Set(["*","+","?"]),Zr=new Set(["^","$"]),Qr={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"},es=b.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 n,{useEff
|
|
|
18
18
|
box-decoration-break: clone;
|
|
19
19
|
-webkit-box-decoration-break: clone;
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
22
|
-
background: ${({$kind:e})=>
|
|
23
|
-
`,
|
|
21
|
+
`,ts=b.span`
|
|
22
|
+
background: ${({$kind:e})=>Qr[e]};
|
|
23
|
+
`,os=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const i=(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){i("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){i(e.slice(o,o+2),"class-content"),o+=2;continue}i(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)}}i(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Jr.has(t)||Zr.has(t))i(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){i(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];qr.test(t)?i(e.slice(o,o+2),"anchor-quantifier"):i(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(i(t,"literal"),o++):(i("|","alternation"),o++)}else"^"===e[o+1]?(i("[^","class-bracket"),o+=2):(i("[","class-bracket"),o++),n=!0;else i(t,"group"),o++}}return t})(e),[e]);return t(es,e?{"data-id":o,children:n.map((e,o)=>t(ts,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},ns="rgba(102, 191, 255, 0.5)",is=y`
|
|
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 n,{useEff
|
|
|
33
33
|
-moz-tab-size: 4;
|
|
34
34
|
tab-size: 4;
|
|
35
35
|
margin: 0;
|
|
36
|
-
`,
|
|
36
|
+
`,as=b.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 n,{useEff
|
|
|
45
45
|
&:focus-within {
|
|
46
46
|
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
47
47
|
}
|
|
48
|
-
`,
|
|
49
|
-
${
|
|
48
|
+
`,ls=b.div`
|
|
49
|
+
${is}
|
|
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 n,{useEff
|
|
|
59
59
|
box-decoration-break: clone;
|
|
60
60
|
-webkit-box-decoration-break: clone;
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
63
|
-
${
|
|
62
|
+
`,rs=b.textarea`
|
|
63
|
+
${is}
|
|
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 n,{useEff
|
|
|
78
78
|
&::placeholder {
|
|
79
79
|
color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
80
80
|
}
|
|
81
|
-
`,
|
|
81
|
+
`,ss=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),cs=({regex:o,value:n,onChange:i,minHeight:s=240,...c})=>{const d=l(null),p=l(null),u=a(()=>((e,t)=>{if(!e||!t)return ss(t);let o;try{o=new RegExp(e)}catch{return ss(t)}const n=o.exec(t);if(!n)return ss(t);const i=n.index,a=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,i),matchPre:"",capture:t.slice(i,a),matchPost:"",after:t.slice(a)};const l=n[0].indexOf(n[1]),r=l>=0?i+l:i,s=r+n[1].length;return{before:t.slice(0,i),matchPre:t.slice(i,r),capture:t.slice(r,s),matchPost:t.slice(s,a),after:t.slice(a)}})(o,n),[o,n]),h=r(()=>{d.current&&p.current&&(d.current.scrollTop=p.current.scrollTop,d.current.scrollLeft=p.current.scrollLeft)},[]);return e(as,{$minHeight:s,children:[e(ls,{ref:d,"aria-hidden":!0,children:[u.before,t("span",{style:{background:ns},children:u.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:u.capture}),t("span",{style:{background:ns},children:u.matchPost}),u.after,n.endsWith("\n")?" ":""]}),t(rs,{ref:p,$minHeight:s,value:n,onChange:e=>i(e.target.value),onScroll:h,spellCheck:!1,...c})]})},ds=b.div`
|
|
82
82
|
flex: 1;
|
|
83
83
|
min-height: 0;
|
|
84
84
|
overflow-y: auto;
|
|
85
|
-
`,
|
|
85
|
+
`,ps=b.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
|
+
`,us=b.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 n,{useEff
|
|
|
100
100
|
word-break: break-all;
|
|
101
101
|
white-space: pre-wrap;
|
|
102
102
|
user-select: text;
|
|
103
|
-
`,
|
|
103
|
+
`,hs=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[r,c]=s(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:de.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:de.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:de.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:de.RESULT_NO_MATCH}})(n,r),[n,r]),p=d.ok?d.isMatch?"match":"neutral":"error";return t(ce,{isOpen:o,header:{title:de.TITLE,onClose:()=>{c(""),i()}},children:t(ds,{children:e(ps,{children:[e(ee,{$gap:6,children:[t(te,{label:de.REGEX_LABEL}),t(os,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(pe,{size:he.XXS,color:ue.Secondary,children:de.REGEX_EMPTY_HINT})]}),e(ee,{$gap:6,children:[e(me,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:de.TEST_STRING_LABEL}),t(ge,{"data-id":"regex-tester-unescape",label:de.UNESCAPE_LABEL,tooltip:de.UNESCAPE_TOOLTIP,variant:be.Secondary,size:fe.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],i="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=i){t+=i,o++;continue}}t+=e[o]}return t})(e)),disabled:(u=r,!/\\["'\\nrt]/.test(u))})]}),t(cs,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:de.TEST_STRING_PLACEHOLDER,regex:n,value:r,onChange:c,minHeight:240}),t(ne,{helpMessage:de.TEST_STRING_HELP})]}),e(ee,{$gap:8,children:[t(te,{label:de.RESULT_LABEL}),t(us,{$tone:p,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(pe,{size:he.XXS,color:ue.Secondary,children:de.RESULT_CAPTURE_HINT})]})]})})});var u},ms=Q.ExtractAttribute;var gs;(e=>{e.Preset="preset",e.Regex="regex"})(gs||(gs={}));const fs=[Ce.JSON,Ce.SQL,Ce.ResourcePath],bs=(e=Ce.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),vs=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,ys=b.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 n,{useEff
|
|
|
108
108
|
display: flex;
|
|
109
109
|
flex-direction: column;
|
|
110
110
|
gap: 8px;
|
|
111
|
-
`,
|
|
111
|
+
`,Cs=b.div`
|
|
112
112
|
flex: 1;
|
|
113
113
|
min-width: 0;
|
|
114
|
-
`,
|
|
114
|
+
`,Ss=b.div`
|
|
115
115
|
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
116
116
|
padding-top: 24px;
|
|
117
|
-
`,vs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ys=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},Cs=Q.UrlTemplatizationRulesGroups,Ss=[{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"}],xs=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},ws=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,o,n]=e;return e=>{const i=null==e?.[t]?"":String(e[t]);switch(o){case"=":case"==":case"===":return i===n;case"!=":case"!==":return i!==n;default:return!0}}},Ts=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,componentType:t.componentType,options:xs(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:ws(t.renderCondition)}})},ks=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const t=e;return{id:String(t.id??t.keyName??t.name??""),label:t.label??t.displayName??String(t.id??""),tooltip:t.tooltip,fields:Array.isArray(t.fields)?t.fields.map(Es):void 0}})},Es=e=>{const t="string"==typeof e.componentProperties?Ne(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:xs(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:Ts(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:ks(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(Es):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},Is=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Ns=e=>Array.isArray(e)?e:[],$s=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},Os=e=>Is(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],As=({field:e,value:o,setValue:n,errorMessage:a,disabled:l})=>{const[r,c]=s(()=>Os(o));return i(()=>{const e=Is(o)?o:{};((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])})($s(r),e)||c(Os(o))},[o]),t(ie,{name:e.name,label:e.title,tooltip:e.tooltip,helpMessage:e.helpMessage,required:e.required,disabled:l,limitFieldsPerRow:2,columns:[{keyName:"key",label:e.keyLabel||"Key",placeholder:e.keyLabel||"Key"},{keyName:"value",label:e.valueLabel||"Value",placeholder:e.valueLabel||"Value"}],values:r,setValues:e=>{c(e),n($s(e))},errorMessage:a})},Rs=({field:n,value:i,setValue:a,errorMessage:l,disabled:r})=>{const{name:c,componentType:d,inputType:p,title:u,tooltip:h,placeholder:m,helpMessage:g,required:f,initialValue:b,options:v,itemWrapperKey:y,columns:C,limitFieldsPerRow:S,variant:x,wrapKey:w,checkboxOptions:T}=n,[k,E]=s({open:!1,value:""});if(d===Ee.CheckboxList&&"array"===n.valueMode){const o=Ns(i),n=(e,t)=>a(t?[...o.filter(t=>t!==e),e]:o.filter(t=>t!==e));return e(ee,{$gap:12,children:[u&&t(te,{label:u,tooltip:h,required:f}),t(ee,{$gap:8,children:(T||[]).map(e=>{const i=t(oe,{name:e.id,label:e.label,value:o.includes(e.id),disabled:r,onChange:t=>n(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:i},e.id):i})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ee.CheckboxList){const o=Is(i)?i:{},s=(e=>"emptyObject"!==e.checkedValue||{})(n),d=e=>"emptyObject"===n.checkedValue?Is(e):!!e;return e(ee,{$gap:12,children:[u&&t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:u}),t(ee,{$gap:12,children:(T||[]).map(n=>{const i=o[n.id],l=d(i),p=Is(i)?i:{},u=t(oe,{label:n.label,value:l,disabled:r,onChange:e=>a({...o,[n.id]:e?Is(i)?i:s:null})}),h=n.tooltip?t($e,{text:n.tooltip,withIcon:!0,children:u}):u,m=l&&n.fields?.length?t(ee,{$gap:12,$padding:"0 0 0 24px",children:n.fields.map(e=>t(Rs,{field:e,value:p[e.name],setValue:t=>a({...o,[n.id]:{...p,[e.name]:t}}),disabled:r},`${c}-${n.id}-${e.name}`))}):null;return e(ee,{$gap:12,children:[h,m]},n.id)})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ee.MultiTabledInput){const n=Ns(w?i?.[w]:i),s=e=>a(w?{...Is(i)?i:{},[w]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(o,{children:[t("cards"===x?Oe:ie,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,columns:C||[],limitFieldsPerRow:S,values:n,setValues:s,errorMessage:l,onTestRegex:d?e=>E({open:!0,value:e}):void 0}),d&&t(cs,{isOpen:k.open,regex:k.value,onClose:()=>E({open:!1,value:""})})]})}if(d===Ee.MultiInput&&w){const e=Ns(i?.[w]);return t(se,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a({...Is(i)?i:{},[w]:e}),errorMessage:l})}if(d===Ee.MultiInput&&y){const e=Ns(i).map(e=>String(e?.[y]??""));return t(se,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a(e.map(e=>({[y]:e}))),errorMessage:l})}return d===Ee.KeyValuePair?t(As,{field:n,value:i,setValue:a,errorMessage:l,disabled:r}):t(ir,{componentType:d,inputType:p,name:c,label:u,tooltip:h,helpMessage:g,disabled:r,required:f,placeholder:m,errorMessage:l,dropdownOptions:v,value:(null==i?b:i)??"",setValue:a})},Ds=({field:n,value:i,setValue:a,disabled:l})=>{const r=v(),s=Ns(i),d=s.length?s:[{}],p=n.fields||[],u=e=>a(e);return e(o,{children:[d.map((o,i)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`${n.itemLabel||n.title||"Item"} ${i+1}`}),t(ge,{leftIcon:()=>t(Ia,{fill:r.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=d.filter((t,o)=>o!==e);u(t)})(i),disabled:l||1===d.length})]}),p.map(e=>t(Rs,{field:e,value:o[e.name],setValue:t=>((e,t,o)=>u(d.map((n,i)=>i===e?{...n,[t]:o}:n)))(i,e.name,t),disabled:l},`${n.name}-group-${i}-${e.name}`))]})]},`${n.name}-group-${i}`)),t(ge,{variant:be.Secondary,label:n.addLabel||"Add",leftIcon:Na,onClick:()=>u([...d,{}]),disabled:l}),t(ke,{})]})},_s=({field:o,value:n,setValue:i,errorMessage:a,disabled:l})=>e(ee,{$gap:12,children:[o.title&&t(te,{label:o.title,tooltip:o.tooltip,required:o.required}),t(ee,{$gap:8,children:(o.checkboxOptions||[]).map(e=>{const o=t(oe,{name:e.id,label:e.label,value:!0===n?.[e.id],disabled:l,onChange:t=>i(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:o},e.id):o})}),t(ne,{errorMessage:a,helpMessage:o.helpMessage})]}),Ps=({signals:e,fields:n,value:a,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(n||[]).filter(e=>!!e).map(e=>Es(e));return i(()=>{if(!c)return;const e=a||{},t={};d.forEach(o=>{const n=(e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===Ee.CheckboxList?"array"===e.valueMode?Ne(t,[]):Ne(t,{}):e.componentType!==Ee.MultiInput&&e.componentType!==Ee.MultiTabledInput||!e.wrapKey?e.componentType===Ee.MultiInput||e.componentType===Ee.MultiTabledInput?Ne(t,[]):t:{[e.wrapKey]:Ne(t,[])}})(o);if(void 0===n)return;if(o.componentType===Ee.CheckboxList&&"flatFields"===o.valueMode&&Is(n))return void Object.entries(n).forEach(([o,n])=>{void 0!==e[o]&&null!==e[o]||(t[o]=n)});null==e[o.name]&&(t[o.name]=Is(n)&&Is(t[o.name])?{...t[o.name],...n}:n)}),Object.entries(t).forEach(([e,t])=>l(e,t))},[]),t(o,{children:d.map(o=>{const n=Object.entries(a||{}).map(([e,t])=>({name:e,value:t}));if(o.renderCondition&&!Ie(o.renderCondition,e,n))return null;const i=a?.[o.name];if(o.componentType===Ee.FieldGroup)return t(Ds,{field:o,value:i,setValue:e=>l(o.name,e),disabled:s},o.name);if(o.componentType===Ee.CheckboxList&&"flatFields"===o.valueMode){const e=o.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(_s,{field:o,value:a||{},setValue:l,errorMessage:e,disabled:s},o.name)}return t(Rs,{field:o,value:i,setValue:e=>l(o.name,e),errorMessage:r[o.name],disabled:s},o.name)})})},Ls={[Ae.K8sAttributes]:({value:n,setValue:a,formErrors:l})=>(i(()=>{n[Q.CollectContainerAttributes]||n[Q.CollectReplicaSetAttributes]||n[Q.CollectWorkloadId]||n[Q.CollectClusterId]||n[Q.LabelsAttributes]?.length||n[Q.AnnotationsAttributes]?.length||(a(Q.CollectContainerAttributes,!0),a(Q.CollectReplicaSetAttributes,!0),a(Q.CollectWorkloadId,!0),a(Q.CollectClusterId,!0),a(Q.LabelsAttributes,[]),a(Q.AnnotationsAttributes,[]))},[]),e(o,{children:[t(ee,{$gap:6,children:Ur.map(({id:o,label:i})=>e(ee,{children:[t(oe,{label:i,value:n[o]||!1,onChange:e=>a(o,e)}),t(ne,{errorMessage:l[o]})]},o))}),t(ie,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Hr,values:n[Q.LabelsAttributes]||[],setValues:e=>a(Q.LabelsAttributes,e),errorMessage:l[Q.LabelsAttributes]}),t(ie,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:jr,values:n[Q.AnnotationsAttributes]||[],setValues:e=>a(Q.AnnotationsAttributes,e),errorMessage:l[Q.AnnotationsAttributes]})]})),[Ae.AddClusterInfo]:({value:n,setValue:i,formErrors:a})=>{const l=v();return e(o,{children:[t(le,{label:"Overwrite existing values",labelAlign:re.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[Q.OverwriteExistingValues]||!1,onChange:e=>i(Q.OverwriteExistingValues,e)}),t(ie,{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[Q.ClusterAttributes]||[],setValues:e=>i(Q.ClusterAttributes,e),errorMessage:a[Q.ClusterAttributes]})]})},[Ae.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(se,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Q.AttributeNamesToDelete]||[],setValues:e=>o(Q.AttributeNamesToDelete,e),errorMessage:n[Q.AttributeNamesToDelete]}),[Ae.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>{const a=e[Q.Renames],[l,r]=s(()=>vs(a));return i(()=>{((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])})(ys(l),a||{})||r(vs(a))},[a]),t(ie,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));r(t),o(Q.Renames,ys(t))},errorMessage:n[Q.Renames]})},[Ae.PiiMasking]:({value:o,setValue:n,formErrors:a})=>(i(()=>{o[Q.PiiCategories]?.length||n(Q.PiiCategories,Xr.map(({id:e})=>e))},[]),e(ee,{$gap:12,children:[t(te,{label:"Attributes to mask"}),t(ee,{$gap:6,children:Xr.map(({id:e,label:i})=>t(oe,{label:i,value:o[Q.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=o[Q.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);n(Q.PiiCategories,a)}},e))}),t(ne,{errorMessage:a[Q.PiiCategories]})]})),[Ae.URLTemplatization]:({value:n,setValue:i,formErrors:a})=>{const l=v(),r=n[Cs]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],s=e=>i(Cs,e),d=(e,t)=>s(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`Rule Group ${n+1}`}),t(ge,{leftIcon:()=>t(Ia,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>{return e=n,s(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(Te,{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(ie,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Ss,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(se,{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(ne,{errorMessage:a[Cs]})]},`url-templatization-group-${n}`)),t(ge,{variant:be.Secondary,label:"Add rule group",leftIcon:Na,onClick:()=>s([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ke,{})]})},[Ae.ExtractAttribute]:({value:o,setValue:n,formErrors:a})=>{const l=v(),r=a[ds],c=o[ds]?.extractions||[],[d,p]=s(()=>(e=>e.length&&e.some(ms)?ps.Regex:ps.Preset)(c)),[u,h]=s(null),m=e=>n(ds,{extractions:e});i(()=>{0===c.length&&m([d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((o,n)=>n===e?{...o,...t}:o))},f=()=>{m([...c,d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===ps.Preset,y=c.length?c:[b?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ee,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:ps.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:ps.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ee,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const i=n===y.length-1,a=o.dataFormat||Ce.JSON,r=xe[a];return e(gs,{"data-id":`extract-row-${n}`,children:[e(me,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ee,{$gap:10,children:[t(te,{label:b?ye.PRESET_ROW_TITLE(n):ye.REGEX_ROW_TITLE(n)}),b&&t(me,{$gap:24,children:us.map(e=>t(Se,{"data-id":`extract-row-${n}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(me,{$gap:4,$alignItems:"center",children:[!b&&t(ge,{"data-id":`extract-row-${n}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:be.Secondary,size:fe.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ge,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(Ia,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);m(t.length?t:[d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(ge,{"data-id":`extract-row-${n}-add`,leftIcon:Na,variant:be.Secondary,size:fe.S,onClick:f})]})]}),b?e(me,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(fs,{children:t(Te,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(bs,{children:t($a,{size:24,fill:l.v2.colors.silver[200]})}),t(fs,{children:t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(ee,{$gap:12,$width:"100%",children:[t(Te,{name:`extract-row-${n}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(ne,{errorMessage:r})]}),t(cs,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})}},Fs=({actionType:e,value:o,setValue:n,formErrors:i,dynamicFields:a,signals:l})=>{if(!e)return null;if(a?.length)return t(Ps,{fields:a,value:o,setValue:n,formErrors:i||{},signals:l||[],seedInitialValues:!0},e);const r=Ls[e];return r?t(r,{value:o,setValue:n,formErrors:i}):null},Ms=()=>{const o=v(),{selectedOption:n,genericForm:i}=Pl();if(!i||!n)return t(Re,{title:"No active form"});const{formData:a,handleFormChange:l,formErrors:r}=i;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:n.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:a.disabled,setSelected:e=>l("disabled",e)}),t(ge,{leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(ar,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(Te,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:a.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(Fs,{actionType:n.type,dynamicFields:n.fields,signals:a.signals||[],value:a.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:a.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},zs=({signals:e,fields:o,disabled:n,formData:i,handleFormChange:a,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:p,placeholder:u,value:h,required:m,options:g})=>{if(o&&!Ie(o,e,i.fields))return null;const f=c,b=i.fields.find(e=>e.key===f),v=b?b.value:h;return t(ir,{componentType:r,inputType:s,name:f,label:d,tooltip:p,disabled:n,required:m,placeholder:u,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>a(f,e)},f)}),Bs=b(me)`
|
|
117
|
+
`,xs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ws=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},Ts=Q.UrlTemplatizationRulesGroups,ks=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Is=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},Es=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,o,n]=e;return e=>{const i=null==e?.[t]?"":String(e[t]);switch(o){case"=":case"==":case"===":return i===n;case"!=":case"!==":return i!==n;default:return!0}}},Ns=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,componentType:t.componentType,options:Is(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:Es(t.renderCondition)}})},$s=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const t=e;return{id:String(t.id??t.keyName??t.name??""),label:t.label??t.displayName??String(t.id??""),tooltip:t.tooltip,fields:Array.isArray(t.fields)?t.fields.map(Os):void 0}})},Os=e=>{const t="string"==typeof e.componentProperties?Ne(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:Is(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:Ns(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:$s(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(Os):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},As=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Rs=e=>Array.isArray(e)?e:[],Ds=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},_s=e=>As(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],Ps=({field:e,value:o,setValue:n,errorMessage:a,disabled:l})=>{const[r,c]=s(()=>_s(o));return i(()=>{const e=As(o)?o:{};((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])})(Ds(r),e)||c(_s(o))},[o]),t(ie,{name:e.name,label:e.title,tooltip:e.tooltip,helpMessage:e.helpMessage,required:e.required,disabled:l,limitFieldsPerRow:2,columns:[{keyName:"key",label:e.keyLabel||"Key",placeholder:e.keyLabel||"Key"},{keyName:"value",label:e.valueLabel||"Value",placeholder:e.valueLabel||"Value"}],values:r,setValues:e=>{c(e),n(Ds(e))},errorMessage:a})},Ls=({field:n,value:i,setValue:a,errorMessage:l,disabled:r})=>{const{name:c,componentType:d,inputType:p,title:u,tooltip:h,placeholder:m,helpMessage:g,required:f,initialValue:b,options:v,itemWrapperKey:y,columns:C,limitFieldsPerRow:S,variant:x,wrapKey:w,checkboxOptions:T}=n,[k,I]=s({open:!1,value:""});if(d===Ie.CheckboxList&&"array"===n.valueMode){const o=Rs(i),n=(e,t)=>a(t?[...o.filter(t=>t!==e),e]:o.filter(t=>t!==e));return e(ee,{$gap:12,children:[u&&t(te,{label:u,tooltip:h,required:f}),t(ee,{$gap:8,children:(T||[]).map(e=>{const i=t(oe,{name:e.id,label:e.label,value:o.includes(e.id),disabled:r,onChange:t=>n(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:i},e.id):i})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ie.CheckboxList){const o=As(i)?i:{},s=(e=>"emptyObject"!==e.checkedValue||{})(n),d=e=>"emptyObject"===n.checkedValue?As(e):!!e;return e(ee,{$gap:12,children:[u&&t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:u}),t(ee,{$gap:12,children:(T||[]).map(n=>{const i=o[n.id],l=d(i),p=As(i)?i:{},u=t(oe,{label:n.label,value:l,disabled:r,onChange:e=>a({...o,[n.id]:e?As(i)?i:s:null})}),h=n.tooltip?t($e,{text:n.tooltip,withIcon:!0,children:u}):u,m=l&&n.fields?.length?t(ee,{$gap:12,$padding:"0 0 0 24px",children:n.fields.map(e=>t(Ls,{field:e,value:p[e.name],setValue:t=>a({...o,[n.id]:{...p,[e.name]:t}}),disabled:r},`${c}-${n.id}-${e.name}`))}):null;return e(ee,{$gap:12,children:[h,m]},n.id)})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ie.MultiTabledInput){const n=Rs(w?i?.[w]:i),s=e=>a(w?{...As(i)?i:{},[w]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(o,{children:[t("cards"===x?Oe:ie,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,columns:C||[],limitFieldsPerRow:S,values:n,setValues:s,errorMessage:l,onTestRegex:d?e=>I({open:!0,value:e}):void 0}),d&&t(hs,{isOpen:k.open,regex:k.value,onClose:()=>I({open:!1,value:""})})]})}if(d===Ie.MultiInput&&w){const e=Rs(i?.[w]);return t(se,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a({...As(i)?i:{},[w]:e}),errorMessage:l})}if(d===Ie.MultiInput&&y){const e=Rs(i).map(e=>String(e?.[y]??""));return t(se,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a(e.map(e=>({[y]:e}))),errorMessage:l})}return d===Ie.KeyValuePair?t(Ps,{field:n,value:i,setValue:a,errorMessage:l,disabled:r}):t(sr,{componentType:d,inputType:p,name:c,label:u,tooltip:h,helpMessage:g,disabled:r,required:f,placeholder:m,errorMessage:l,dropdownOptions:v,value:(null==i?b:i)??"",setValue:a})},Fs=({field:n,value:i,setValue:a,disabled:l})=>{const r=v(),s=Rs(i),d=s.length?s:[{}],p=n.fields||[],u=e=>a(e);return e(o,{children:[d.map((o,i)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`${n.itemLabel||n.title||"Item"} ${i+1}`}),t(ge,{leftIcon:()=>t(Aa,{fill:r.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=d.filter((t,o)=>o!==e);u(t)})(i),disabled:l||1===d.length})]}),p.map(e=>t(Ls,{field:e,value:o[e.name],setValue:t=>((e,t,o)=>u(d.map((n,i)=>i===e?{...n,[t]:o}:n)))(i,e.name,t),disabled:l},`${n.name}-group-${i}-${e.name}`))]})]},`${n.name}-group-${i}`)),t(ge,{variant:be.Secondary,label:n.addLabel||"Add",leftIcon:Ra,onClick:()=>u([...d,{}]),disabled:l}),t(ke,{})]})},Ms=({field:o,value:n,setValue:i,errorMessage:a,disabled:l})=>e(ee,{$gap:12,children:[o.title&&t(te,{label:o.title,tooltip:o.tooltip,required:o.required}),t(ee,{$gap:8,children:(o.checkboxOptions||[]).map(e=>{const o=t(oe,{name:e.id,label:e.label,value:!0===n?.[e.id],disabled:l,onChange:t=>i(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:o},e.id):o})}),t(ne,{errorMessage:a,helpMessage:o.helpMessage})]}),zs=({signals:e,fields:n,value:a,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(n||[]).filter(e=>!!e).map(e=>Os(e));return i(()=>{if(!c)return;const e=a||{},t={};d.forEach(o=>{const n=(e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===Ie.CheckboxList?"array"===e.valueMode?Ne(t,[]):Ne(t,{}):e.componentType!==Ie.MultiInput&&e.componentType!==Ie.MultiTabledInput||!e.wrapKey?e.componentType===Ie.MultiInput||e.componentType===Ie.MultiTabledInput?Ne(t,[]):t:{[e.wrapKey]:Ne(t,[])}})(o);if(void 0===n)return;if(o.componentType===Ie.CheckboxList&&"flatFields"===o.valueMode&&As(n))return void Object.entries(n).forEach(([o,n])=>{void 0!==e[o]&&null!==e[o]||(t[o]=n)});null==e[o.name]&&(t[o.name]=As(n)&&As(t[o.name])?{...t[o.name],...n}:n)}),Object.entries(t).forEach(([e,t])=>l(e,t))},[]),t(o,{children:d.map(o=>{const n=Object.entries(a||{}).map(([e,t])=>({name:e,value:t}));if(o.renderCondition&&!Ee(o.renderCondition,e,n))return null;const i=a?.[o.name];if(o.componentType===Ie.FieldGroup)return t(Fs,{field:o,value:i,setValue:e=>l(o.name,e),disabled:s},o.name);if(o.componentType===Ie.CheckboxList&&"flatFields"===o.valueMode){const e=o.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(Ms,{field:o,value:a||{},setValue:l,errorMessage:e,disabled:s},o.name)}return t(Ls,{field:o,value:i,setValue:e=>l(o.name,e),errorMessage:r[o.name],disabled:s},o.name)})})},Bs={[Ae.K8sAttributes]:({value:n,setValue:a,formErrors:l})=>(i(()=>{n[Q.CollectContainerAttributes]||n[Q.CollectReplicaSetAttributes]||n[Q.CollectWorkloadId]||n[Q.CollectClusterId]||n[Q.LabelsAttributes]?.length||n[Q.AnnotationsAttributes]?.length||(a(Q.CollectContainerAttributes,!0),a(Q.CollectReplicaSetAttributes,!0),a(Q.CollectWorkloadId,!0),a(Q.CollectClusterId,!0),a(Q.LabelsAttributes,[]),a(Q.AnnotationsAttributes,[]))},[]),e(o,{children:[t(ee,{$gap:6,children:Gr.map(({id:o,label:i})=>e(ee,{children:[t(oe,{label:i,value:n[o]||!1,onChange:e=>a(o,e)}),t(ne,{errorMessage:l[o]})]},o))}),t(ie,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Kr,values:n[Q.LabelsAttributes]||[],setValues:e=>a(Q.LabelsAttributes,e),errorMessage:l[Q.LabelsAttributes]}),t(ie,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Yr,values:n[Q.AnnotationsAttributes]||[],setValues:e=>a(Q.AnnotationsAttributes,e),errorMessage:l[Q.AnnotationsAttributes]})]})),[Ae.AddClusterInfo]:({value:n,setValue:i,formErrors:a})=>{const l=v();return e(o,{children:[t(le,{label:"Overwrite existing values",labelAlign:re.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[Q.OverwriteExistingValues]||!1,onChange:e=>i(Q.OverwriteExistingValues,e)}),t(ie,{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[Q.ClusterAttributes]||[],setValues:e=>i(Q.ClusterAttributes,e),errorMessage:a[Q.ClusterAttributes]})]})},[Ae.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(se,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Q.AttributeNamesToDelete]||[],setValues:e=>o(Q.AttributeNamesToDelete,e),errorMessage:n[Q.AttributeNamesToDelete]}),[Ae.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>{const a=e[Q.Renames],[l,r]=s(()=>xs(a));return i(()=>{((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])})(ws(l),a||{})||r(xs(a))},[a]),t(ie,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));r(t),o(Q.Renames,ws(t))},errorMessage:n[Q.Renames]})},[Ae.PiiMasking]:({value:o,setValue:n,formErrors:a})=>(i(()=>{o[Q.PiiCategories]?.length||n(Q.PiiCategories,jr.map(({id:e})=>e))},[]),e(ee,{$gap:12,children:[t(te,{label:"Attributes to mask"}),t(ee,{$gap:6,children:jr.map(({id:e,label:i})=>t(oe,{label:i,value:o[Q.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=o[Q.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);n(Q.PiiCategories,a)}},e))}),t(ne,{errorMessage:a[Q.PiiCategories]})]})),[Ae.URLTemplatization]:({value:n,setValue:i,formErrors:a})=>{const l=v(),r=n[Ts]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],s=e=>i(Ts,e),d=(e,t)=>s(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`Rule Group ${n+1}`}),t(ge,{leftIcon:()=>t(Aa,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>{return e=n,s(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(Te,{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(ie,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ks,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(se,{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(ne,{errorMessage:a[Ts]})]},`url-templatization-group-${n}`)),t(ge,{variant:be.Secondary,label:"Add rule group",leftIcon:Ra,onClick:()=>s([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ke,{})]})},[Ae.ExtractAttribute]:({value:o,setValue:n,formErrors:a})=>{const l=v(),r=a[ms],c=o[ms]?.extractions||[],[d,p]=s(()=>(e=>e.length&&e.some(vs)?gs.Regex:gs.Preset)(c)),[u,h]=s(null),m=e=>n(ms,{extractions:e});i(()=>{0===c.length&&m([d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((o,n)=>n===e?{...o,...t}:o))},f=()=>{m([...c,d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===gs.Preset,y=c.length?c:[b?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ee,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:gs.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:gs.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ee,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const i=n===y.length-1,a=o.dataFormat||Ce.JSON,r=xe[a];return e(ys,{"data-id":`extract-row-${n}`,children:[e(me,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ee,{$gap:10,children:[t(te,{label:b?ye.PRESET_ROW_TITLE(n):ye.REGEX_ROW_TITLE(n)}),b&&t(me,{$gap:24,children:fs.map(e=>t(Se,{"data-id":`extract-row-${n}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(me,{$gap:4,$alignItems:"center",children:[!b&&t(ge,{"data-id":`extract-row-${n}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:be.Secondary,size:fe.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ge,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(Aa,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);m(t.length?t:[d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(ge,{"data-id":`extract-row-${n}-add`,leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:f})]})]}),b?e(me,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Cs,{children:t(Te,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(Ss,{children:t(Da,{size:24,fill:l.v2.colors.silver[200]})}),t(Cs,{children:t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(ee,{$gap:12,$width:"100%",children:[t(Te,{name:`extract-row-${n}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(ne,{errorMessage:r})]}),t(hs,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})}},Xs=({actionType:e,value:o,setValue:n,formErrors:i,dynamicFields:a,signals:l})=>{if(!e)return null;if(a?.length)return t(zs,{fields:a,value:o,setValue:n,formErrors:i||{},signals:l||[],seedInitialValues:!0},e);const r=Bs[e];return r?t(r,{value:o,setValue:n,formErrors:i}):null},Us=()=>{const o=v(),{selectedOption:n,genericForm:i}=zl();if(!i||!n)return t(Re,{title:"No active form"});const{formData:a,handleFormChange:l,formErrors:r}=i;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:n.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:_a,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Pa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:a.disabled,setSelected:e=>l("disabled",e)}),t(ge,{leftIcon:La,variant:be.Secondary,size:fe.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(cr,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(Te,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:a.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(Xs,{actionType:n.type,dynamicFields:n.fields,signals:a.signals||[],value:a.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:a.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Vs=({signals:e,fields:o,disabled:n,formData:i,handleFormChange:a,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:p,placeholder:u,value:h,required:m,options:g})=>{if(o&&!Ee(o,e,i.fields))return null;const f=c,b=i.fields.find(e=>e.key===f),v=b?b.value:h;return t(sr,{componentType:r,inputType:s,name:f,label:d,tooltip:p,disabled:n,required:m,placeholder:u,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>a(f,e)},f)}),Hs=b(me)`
|
|
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 n,{useEff
|
|
|
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
|
-
`,Xs=d(({isEdit:o},n)=>{const a=v(),{isVm:l}=S(),{destinationsApi:r}=Ll(),{activeForm:c,genericForm:d,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Fl(),[b,y]=s(h?.testResult),[C,x]=s(!!h);i(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!c?.option.testConnectionSupported||!d||l)return;const e=await r.testConnection(Ue(d.formData));return y(e),e};return p(n,()=>({testConnection:w,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,d,r]),d&&c?e(ee,{$gap:24,style:{minHeight:"100%"},children:[e(me,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(Le,{status:Fe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Le,{status:Fe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(me,{$gap:12,children:[!l&&t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],size:_e.S,selected:d.formData.disabled,setSelected:e=>d.handleFormChange("disabled",e),disabled:C}),t(ge,{"data-id":"dest-form-docs",leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>window.open(`${Me}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(ar,{title:"This connection will monitor:",allowedSignals:Xe(c.option.supportedSignals),selectedSignals:Be(d.formData.exportedSignals),setSelectedSignals:e=>d.handleFormChange("exportedSignals",{logs:e.includes(ze.Logs),metrics:e.includes(ze.Metrics),traces:e.includes(ze.Traces),profiles:e.includes(ze.Profiles)}),disabled:C,errorMessage:d.formErrors.exportedSignals}),t(Te,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:d.formData.name,onChange:({target:{value:e}})=>d.handleFormChange("name",e),disabled:C,errorMessage:d.formErrors.name}),t(zs,{signals:Be(d.formData.exportedSignals),fields:c.dynamicFields,disabled:C,formData:d.formData,handleFormChange:(e,t)=>{d.handleFormChange("fields",d.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&d.formErrors[e]&&d.handleErrorChange(e,void 0)},formErrors:d.formErrors}),!o&&e(Bs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Da,variant:be.Secondary,textColor:a.v2.colors.red[500],onClick:()=>f(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:be.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:_a,variant:be.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),o=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t(Re,{title:"No active form"})});Xs.displayName="AddDestinationForm";const Us=[{id:Ve.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ve.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ve.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Vs=[{id:Ve.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ve.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ve.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Hs=["*"],js=[{id:je.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:je.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:je.DbQuery,label:"Collect DB query",tooltip:""},{id:je.Messaging,label:"Collect messaging",tooltip:""}],Gs={[Ke.Java]:[new We("","")],[Ke.Golang]:[new Ge("")]},Ws={[Ye.CodeAttributes]:({value:n,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);i(()=>{if(!c.length&&!s){const e={[Ve.FilePath]:!0,[Ve.Function]:!0,[Ve.LineNumber]:!0,[Ve.Column]:null,[Ve.Namespace]:null,[Ve.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ve).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ee,{$gap:6,children:Us.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]}),e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ee,{$gap:6,children:Vs.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]})]})},[Ye.CustomInstrumentation]:({value:n,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(n?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=a(()=>(n?.customInstrumentations?.[Ke.Java]||[]).map(e=>new We(e.className,e.methodName)),[n]);return i(()=>{n?.customInstrumentations||s||l("customInstrumentations",{[Ke.Golang]:Gs[Ke.Golang],[Ke.Java]:Gs[Ke.Java]})},[]),e(o,{children:[e(ee,{children:[e(me,{$gap:8,children:[t(Pa,{}),t(te,{label:"Golang custom probes"})]}),t(ie,{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[Ke.Golang]=e.map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(ee,{children:[e(me,{$gap:8,children:[t(La,{}),t(te,{label:"Java custom probes"})]}),t(ie,{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[Ke.Golang]=c,t[Ke.Java]=e.map(e=>new We(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Ye.HeadersCollection]:({value:e,setValue:o,formErrors:n})=>{const l=n.headersCollection,r=a(()=>e?.headersCollection?.[He.HeaderKeys]||[],[e]),s=e=>{const t={[He.HeaderKeys]:e};o("headersCollection",t)};return i(()=>{r.length||l||s(Hs)},[]),t(se,{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})},[Ye.PayloadCollection]:({value:o,setValue:n,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);return i(()=>{if(!s.length&&!r){const e={[je.HttpRequest]:{},[je.HttpResponse]:{},[je.DbQuery]:{},[je.Messaging]:{}};n("payloadCollection",e)}},[]),e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ee,{$gap:6,children:js.map(({id:e,label:o,tooltip:i})=>t($e,{text:i,withIcon:!0,children:t(oe,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[je.HttpRequest]:o.includes(je.HttpRequest)?{}:null,[je.HttpResponse]:o.includes(je.HttpResponse)?{}:null,[je.DbQuery]:o.includes(je.DbQuery)?{}:null,[je.Messaging]:o.includes(je.Messaging)?{}:null};n("payloadCollection",i)})(e,t)})},e))}),t(ne,{errorMessage:r})]})},[Ye.UnknownType]:null},Ks=({ruleType:e,value:o,setValue:n,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(Ps,{fields:a,value:o,setValue:n,formErrors:i||{},signals:[],seedInitialValues:!0});const l=Ws[e];return l?t(l,{value:o,setValue:n,formErrors:i}):null},Ys=()=>{const o=v(),{isVm:n}=S(),{selectedOption:i,genericForm:a,sourceOptions:l,namespaceOptions:r}=Ml();if(!a||!i)return t(Re,{title:"No active form"});const{formData:s,handleFormChange:c,formErrors:d}=a;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:i.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:s.disabled,setSelected:e=>c("disabled",e)}),t(ge,{leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(lr,{option:i,formState:s}),e(me,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Supported Languages:"}),i.supportedLanguages.map(e=>t(qe,{label:Je[e],leftIcon:Ze(e),backgroundColor:o.v2.colors.purple[900]},e))]}),!n&&t(rr,{scopes:s.sourceScopes,onChange:e=>c("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:i.type===Ye.CustomInstrumentation?[]:i.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(Te,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>c("ruleName",e),errorMessage:d.ruleName}),t(Ks,{ruleType:i.type,dynamicFields:i.fields,value:s,setValue:(e,t)=>c(e,t),formErrors:d}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>c("notes",e),errorMessage:d.notes})]})},qs=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=zl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(Qe,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:et.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:be.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:be.Secondary,onClick:n}})},Js=({autoFocus:o})=>{const{dataStreams:n}=tt(),{genericForm:i,excludeName:l,editingName:r}=zl(),{formData:s,formErrors:c,handleFormChange:d}=i,p=s.name,u=a(()=>n.find(e=>e.name===p&&e.name!==l),[n,p,l]);return e(ee,{$width:"100%",$gap:12,children:[t(Te,{name:"data-stream-name",label:et.STREAM_NAME,placeholder:et.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:et.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(Le,{status:Fe.Warning,message:et.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Zs=()=>{const{selectedStreamName:e}=tt(),{genericForm:o}=Bl();if(!o)return t(Re,{title:"No active form"});const{formData:n,handleFormChange:i,formErrors:a}=o;return t(Te,{name:"sourceName",label:et.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}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Qs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],ec=b.div`
|
|
128
|
+
`,js=d(({isEdit:o},n)=>{const a=v(),{isVm:l}=S(),{destinationsApi:r}=Bl(),{activeForm:c,genericForm:d,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Xl(),[b,y]=s(h?.testResult),[C,x]=s(!!h);i(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!c?.option.testConnectionSupported||!d||l)return;const e=await r.testConnection(Ue(d.formData));return y(e),e};return p(n,()=>({testConnection:w,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,d,r]),d&&c?e(ee,{$gap:24,style:{minHeight:"100%"},children:[e(me,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(Le,{status:Fe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Le,{status:Fe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(me,{$gap:12,children:[!l&&t(ve,{options:[{icon:_a,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:Pa,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],size:_e.S,selected:d.formData.disabled,setSelected:e=>d.handleFormChange("disabled",e),disabled:C}),t(ge,{"data-id":"dest-form-docs",leftIcon:La,variant:be.Secondary,size:fe.S,onClick:()=>window.open(`${Me}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(cr,{title:"This connection will monitor:",allowedSignals:Xe(c.option.supportedSignals),selectedSignals:Be(d.formData.exportedSignals),setSelectedSignals:e=>d.handleFormChange("exportedSignals",{logs:e.includes(ze.Logs),metrics:e.includes(ze.Metrics),traces:e.includes(ze.Traces),profiles:e.includes(ze.Profiles)}),disabled:C,errorMessage:d.formErrors.exportedSignals}),t(Te,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:d.formData.name,onChange:({target:{value:e}})=>d.handleFormChange("name",e),disabled:C,errorMessage:d.formErrors.name}),t(Vs,{signals:Be(d.formData.exportedSignals),fields:c.dynamicFields,disabled:C,formData:d.formData,handleFormChange:(e,t)=>{d.handleFormChange("fields",d.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&d.formErrors[e]&&d.handleErrorChange(e,void 0)},formErrors:d.formErrors}),!o&&e(Hs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Fa,variant:be.Secondary,textColor:a.v2.colors.red[500],onClick:()=>f(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:be.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Ma,variant:be.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),o=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t(Re,{title:"No active form"})});js.displayName="AddDestinationForm";const Gs=[{id:Ve.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ve.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ve.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ws=[{id:Ve.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ve.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ve.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ks=["*"],Ys=[{id:je.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:je.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:je.DbQuery,label:"Collect DB query",tooltip:""},{id:je.Messaging,label:"Collect messaging",tooltip:""}],qs={[Ke.Java]:[new We("","")],[Ke.Golang]:[new Ge("")]},Js={[Ye.CodeAttributes]:({value:n,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);i(()=>{if(!c.length&&!s){const e={[Ve.FilePath]:!0,[Ve.Function]:!0,[Ve.LineNumber]:!0,[Ve.Column]:null,[Ve.Namespace]:null,[Ve.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ve).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ee,{$gap:6,children:Gs.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]}),e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ee,{$gap:6,children:Ws.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]})]})},[Ye.CustomInstrumentation]:({value:n,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(n?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=a(()=>(n?.customInstrumentations?.[Ke.Java]||[]).map(e=>new We(e.className,e.methodName)),[n]);return i(()=>{n?.customInstrumentations||s||l("customInstrumentations",{[Ke.Golang]:qs[Ke.Golang],[Ke.Java]:qs[Ke.Java]})},[]),e(o,{children:[e(ee,{children:[e(me,{$gap:8,children:[t(za,{}),t(te,{label:"Golang custom probes"})]}),t(ie,{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[Ke.Golang]=e.map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(ee,{children:[e(me,{$gap:8,children:[t(Ba,{}),t(te,{label:"Java custom probes"})]}),t(ie,{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[Ke.Golang]=c,t[Ke.Java]=e.map(e=>new We(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Ye.HeadersCollection]:({value:e,setValue:o,formErrors:n})=>{const l=n.headersCollection,r=a(()=>e?.headersCollection?.[He.HeaderKeys]||[],[e]),s=e=>{const t={[He.HeaderKeys]:e};o("headersCollection",t)};return i(()=>{r.length||l||s(Ks)},[]),t(se,{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})},[Ye.PayloadCollection]:({value:o,setValue:n,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);return i(()=>{if(!s.length&&!r){const e={[je.HttpRequest]:{},[je.HttpResponse]:{},[je.DbQuery]:{},[je.Messaging]:{}};n("payloadCollection",e)}},[]),e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ee,{$gap:6,children:Ys.map(({id:e,label:o,tooltip:i})=>t($e,{text:i,withIcon:!0,children:t(oe,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[je.HttpRequest]:o.includes(je.HttpRequest)?{}:null,[je.HttpResponse]:o.includes(je.HttpResponse)?{}:null,[je.DbQuery]:o.includes(je.DbQuery)?{}:null,[je.Messaging]:o.includes(je.Messaging)?{}:null};n("payloadCollection",i)})(e,t)})},e))}),t(ne,{errorMessage:r})]})},[Ye.UnknownType]:null},Zs=({ruleType:e,value:o,setValue:n,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(zs,{fields:a,value:o,setValue:n,formErrors:i||{},signals:[],seedInitialValues:!0});const l=Js[e];return l?t(l,{value:o,setValue:n,formErrors:i}):null},Qs=()=>{const o=v(),{isVm:n}=S(),{selectedOption:i,genericForm:l,sourceOptions:r,namespaceOptions:s}=Ul(),c=a(()=>qe(i?.supportedLanguages),[i?.supportedLanguages]),d=a(()=>{if(i)return i.type===Ye.CustomInstrumentation?[]:Je(i.supportedLanguages)},[i]);if(!l||!i)return t(Re,{title:"No active form"});const{formData:p,handleFormChange:u,formErrors:h}=l;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:i.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:_a,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Pa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:p.disabled,setSelected:e=>u("disabled",e)}),t(ge,{leftIcon:La,variant:be.Secondary,size:fe.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(dr,{option:i,formState:p}),!!c.length&&e(me,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Supported Languages:"}),c.map(e=>t(Ze,{label:et(e),leftIcon:Qe(e),backgroundColor:o.v2.colors.purple[900]},e))]}),!n&&t(pr,{scopes:p.sourceScopes,onChange:e=>u("sourceScopes",e),sourceOptions:r,namespaceOptions:s,supportedLanguages:d,dataIdPrefix:"instrumentation-rule",slim:!0}),t(Te,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:p.ruleName,onChange:({target:{value:e}})=>u("ruleName",e),errorMessage:h.ruleName}),t(Zs,{ruleType:i.type,dynamicFields:i.fields,value:p,setValue:(e,t)=>u(e,t),formErrors:h}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:p.notes,onChange:({target:{value:e}})=>u("notes",e),errorMessage:h.notes})]})},ec=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Vl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(tt,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:ot.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:be.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:be.Secondary,onClick:n}})},tc=({autoFocus:o})=>{const{dataStreams:n}=nt(),{genericForm:i,excludeName:l,editingName:r}=Vl(),{formData:s,formErrors:c,handleFormChange:d}=i,p=s.name,u=a(()=>n.find(e=>e.name===p&&e.name!==l),[n,p,l]);return e(ee,{$width:"100%",$gap:12,children:[t(Te,{name:"data-stream-name",label:ot.STREAM_NAME,placeholder:ot.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:ot.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(Le,{status:Fe.Warning,message:ot.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},oc=()=>{const{selectedStreamName:e}=nt(),{genericForm:o}=Hl();if(!o)return t(Re,{title:"No active form"});const{formData:n,handleFormChange:i,formErrors:a}=o;return t(Te,{name:"sourceName",label:ot.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},nc=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],ic=b.div`
|
|
129
129
|
display: flex;
|
|
130
130
|
flex-direction: column;
|
|
131
131
|
gap: 24px;
|
|
132
|
-
`,
|
|
132
|
+
`,ac=b.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
|
+
`,lc=({value:e})=>{const o=v();return t(Ze,e?{status:Fe.Success,label:dt,leftIcon:_a}:{label:pt,leftIcon:Pa,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},rc=({value:e,onChange:o})=>{const n=v(),i=a(()=>[{icon:_a,label:dt,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:Pa,label:pt,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ve,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},sc=()=>{const e=jl();switch(e.formType){case Gl.Create:return t(cc,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(rc,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Gl.View:return e.data?e.isEditing?t(cc,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(rc,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(dc,{data:e.data,renderAction:()=>t(lc,{value:!e.data?.rule.disabled})}):null;case Gl.EditAutoNoisy:return t(pc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ct,sectionTitle:lt,sectionSubTitle:st,presetLabel:at,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(rc,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Gl.EditAutoCostReduction:return t(pc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:lt,presetLabel:at,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(rc,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Gl.EditAutoHighlyRelevant:return t(ic,{children:t(ur,{title:e.localEnabled?void 0:it,summary:e.summary,renderAction:()=>t(rc,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},cc=({category:o,formData:n,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(ic,{children:[t(gr,{category:o,formState:n,renderAction:r}),e(ac,{$faded:!!n.disabled,children:[t(fr,{category:o,formState:n,onChange:i}),t(pr,{scopes:n.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(br,{category:o,formState:n,onChange:i}),"highlyRelevant"===o&&t(vr,{formState:n,onChange:i}),"highlyRelevant"===o&&t(yr,{ruleType:n.ruleType,formState:n,onChange:i}),t(Cr,{category:o,formState:n,onChange:i})]})]}),dc=({data:o,renderAction:n})=>e(ic,{children:[t(gr,{readOnly:!0,summary:o.summary,renderAction:n}),t(fr,{readOnly:!0,data:o}),t(pr,{readOnly:!0,scopes:x(o.rule.sourceScopes)}),t(br,{readOnly:!0,data:o}),t(Cr,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(yr,{readOnly:!0,rule:o.rule})]}),pc=({enabled:o,summary:n,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=r(e=>u(e),[u]),y=r(e=>m(e),[m]),C=r(e=>f(e.target.value),[f]),S=!d||"sample"===p;return e(ic,{children:[t(ur,{title:o?void 0:i,summary:n,renderAction:b}),t(ac,{$faded:!o,children:e(ut,{richTitle:{title:a,subTitle:l},children:[d&&t(ee,{$alignItems:"flex-start",children:t(ve,{options:nc,selected:p,setSelected:v})}),S&&t(hr,{description:s,options:mr,selected:h,onSelect:y,customName:c,customLabel:ht,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},uc=b.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 n,{useEff
|
|
|
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
|
+
`,hc=b.div`
|
|
152
152
|
display: flex;
|
|
153
153
|
align-items: center;
|
|
154
154
|
justify-content: center;
|
|
155
155
|
padding: 8px;
|
|
156
156
|
border-radius: 8px;
|
|
157
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
158
|
-
`,
|
|
157
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+mt["004"]};
|
|
158
|
+
`,mc=({dataId:o,icon:n,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:m})=>e(uc,{"data-id":o||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(ee,{$gap:4,children:[e(me,{$gap:12,children:[m&&t(oe,{partiallyChecked:h||!1,value:u||!1,onChange:e=>m(e)}),n&&t(hc,{children:t(n,{size:20})}),t(pe,{size:he.XS,children:i})]}),a&&t(pe,{size:he.XXXS,color:ue.Secondary,children:a})]}),(l||c)&&e(me,{$gap:8,children:[c,l&&t(Xa,{size:18})]})]}),gc=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{actionsApi:r}=Bl(),{platformType:c,version:d}=S(),[p,u]=s(""),h=l(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=zl(),{options:v,loading:y}=r.useActionTypes(),C=a(()=>v.length?v:gt(c,d),[v,c,d]),x=a(()=>(p?C.filter(e=>e?.label?.toLowerCase().includes(p.toLowerCase())):C).filter(e=>!!e),[C,p]),w=a(()=>y?[t(ft,{$padding:"8px 12px",children:t(bt,{size:6})},"loading")]:x.map(e=>{const o=m?.type===e.type;return t(mc,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)}),[y,m?.type,x,g]),T=a(()=>y?[t(ft,{$padding:"8px 12px",children:t(bt,{size:4})},"loading")]:m?[t(Us,{},m.type)]:[t(vt,{$height:"100%",children:t(Re,{icon:Ua,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(Sr,{ref:h,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await r.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:ot.CREATING_ACTION,subTitle:ot.CREATING_ACTION_SUBTITLE},header:{icon:Ua,title:ot.ADD_ACTION,subTitle:ot.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:p,onChange:u},leftColumn:{width:"40%",list:w},rightColumn:{width:"60%",list:T}})},fc=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(yt).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(ze).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(Ct,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ve,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},bc=b.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
|
+
`,vc=b.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
|
+
`,yc=({title:o,tooltip:n,list:i,noBgColor:a,purpleColors:l})=>{const[r,c]=s(!0);return e(bc,{"data-id":`collapse-${o}`,$noBgColor:a,$purpleColors:l,children:[e(vc,{$isOpen:r,children:[e(me,{$gap:10,children:[t(pe,{size:he.XS,children:o}),n&&t($e,{text:n,withIcon:!0}),t(Ze,{label:i.length,status:l?Fe.Default:void 0})]}),t(St,{icon:r?Ha:ja,size:xt.M,onClick:()=>c(e=>!e)})]}),r?t(ee,{children:i.length?u.toArray(i):t(vt,{$padding:"12px 0",children:t(Re,{})})}):null]})},Cc=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Xe(e.supportedSignals).includes(o.signalType))):e,Sc=({option:e,formData:o,testResult:n,isSelected:i,onSelect:a})=>t(mc,{icon:kt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:i,onClick:()=>a(),children:n&&t(Ze,{status:n.succeeded?Fe.Success:Fe.Error,leftIcon:n.succeeded?Ga:Wa})}),xc=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:i,onChangeActiveForm:a}=Xl();return o?.length?t(yc,{title:Tt[e].TITLE,tooltip:Tt[e].DESCRIPTION,list:o.map((o,n)=>t(Sc,{option:o,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=o.id&&""!==o.id?i?.option.id===o.id:i?.option.type===o.type),onSelect:()=>a({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(yc,{purpleColors:!0,title:Tt[e].TITLE,tooltip:Tt[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(Sc,{option:o,formData:n,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var wc;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(wc||(wc={}));const Tc=(e,t)=>{const o=[],n=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===wc.SELF_HOSTED?n.push(...e.items):e.name===wc.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=It(n),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const n=Ne(t.fields,{});Object.keys(n).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[i]))}}}),{[yt.DETECTED]:o,[yt.SELF_HOSTED]:n,[yt.MANAGED]:i}},kc=({onClose:e,onBack:o,onNext:n,selectedConnectionIds:l,setSelectedConnectionIds:c,initialInputs:d,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Bl(),[m,g]=s(""),[f,b]=s({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=Xl();i(()=>{d&&I(d)},[d]);const E=C||x,N=a(()=>y?.destinationCategories?.categories??[],[y]),[$,O]=s({[yt.ALL]:[],[yt.UNSAVED]:[],[yt.EXISTS]:[],[yt.DETECTED]:[],[yt.SELF_HOSTED]:[],[yt.MANAGED]:[]});i(()=>{const e=v.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=Ne(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})):[]}});O(t=>({...t,[yt.EXISTS]:e}))},[v,N]),i(()=>{(y||S)&&O(e=>({...e,...Tc(y,S)}))},[y,S]);const A=r(async()=>{for(const{option:e,formData:t}of k){const o=Ue(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])){await h.update(e.id,o);continue}}await h.create(o)}},[k,h]),R=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Xl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(xc,{listType:yt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(yt)){if(i.categoryType&&i.categoryType!==e)continue;const l=Cc(o[e],n,i);l.length&&a.push(t(xc,{listType:e,destinationOptions:l},e))}return e&&a.push(t(vt,{$height:"100%",children:t(wt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:E,destinationsByCategory:$,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Xl();return{width:"60%",list:e?[t(js,{},e.option.type)]:[t(vt,{$height:"100%",children:t(Re,{icon:Va,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Sr,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:o?()=>o(k):void 0,onNext:n?()=>n(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:E,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:ot.CREATING_DESTINATION,subTitle:ot.CREATING_DESTINATION_SUBTITLE},header:{icon:Va,title:ot.ADD_DESTINATIONS,subTitle:ot.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:l&&c?{value:l,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(fc,{destinationsByCategory:$,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},Ic=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{instrumentationRulesApi:r}=Bl(),[c,d]=s(""),p=l(null),{selectedOption:u,onSelectOption:h,genericForm:m,validateFormData:g}=Ul(),{options:f,loading:b}=r.useRuleTypes(),v=a(()=>f.length?f:Et,[f]),y=a(()=>c?v.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):v,[v,c]),C=a(()=>b?[t(ft,{$padding:"8px 12px",children:t(bt,{size:4})},"loading")]:y.map(e=>{const o=u?.type===e.type;return t(mc,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{p.current?.clearErrors(),h(e)}},e.type)}),[b,u?.type,y,h]),S=a(()=>b?[t(ft,{$padding:"8px 12px",children:t(bt,{size:4})},"loading")]:u?[t(Qs,{},u.type)]:[t(vt,{$height:"100%",children:t(Re,{icon:Ka,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[b,u]);return t(Sr,{ref:p,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await r.create(t,u?.type)},disableSave:!u||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:ot.CREATING_INSTRUMENTATION_RULE,subTitle:ot.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ka,title:ot.ADD_INSTRUMENTATION_RULE,subTitle:ot.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:S}})},Ec={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:ot.FETCHING_NAMESPACES,subTitle:ot.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:ot.SELECT_NAMESPACE,subTitle:ot.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Nc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Nt.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},$c=e=>e?Nc:Ec,Oc="No matches",Ac=e=>(e?"Unselect":"Select")+" all",Rc="Selected",Dc=b.div``,_c=b.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 n,{useEff
|
|
|
176
176
|
transition-duration: 0s;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
${
|
|
179
|
+
${Dc}:hover & {
|
|
180
180
|
visibility: visible;
|
|
181
181
|
}
|
|
182
|
-
`,
|
|
182
|
+
`,Pc=({workloadName:e,workloadKind:o,isChecked:n,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t(Dc,{children:t(mc,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:n,onCheckboxChange:a?r:i,children:a?t($e,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(Ze,{label:"Enterprise only",status:Fe.Default,textSize:he.XXXS})}):t(_c,{children:t(Ze,{label:o,status:Fe.Info,textSize:he.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},Lc=b.div``,Fc=b.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
|
+
${Lc}:hover & {
|
|
189
189
|
visibility: visible;
|
|
190
190
|
}
|
|
191
|
-
`,
|
|
191
|
+
`,Mc=({clusterId:o,namespaceName:n,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isK8s:d}=S(),p=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Lc,{children:t(mc,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>p({auto:e,all:e}),children:e(me,{$gap:12,children:[d&&t(Fc,{$visible:r||a,children:t($e,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(le,{label:"Auto",labelAlign:re.Left,size:Ot.S,value:a,onChange:e=>p({auto:e,all:e||void 0})})})}),e(me,{$gap:8,children:[t(pe,{variant:At.Span,size:he.XXXS,color:ue.Secondary,align:"right",children:Rc}),t(Ze,{label:`${l.sourced}/${l.total}`,status:r?Fe.Default:Fe.Unknown,minWidth:"42px"})]})]})})})},zc=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(Mc,{clusterId:o,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:i},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(yc,{title:n,list:c,noBgColor:!0}):c},Bc=({onClose:o,onBack:n,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isVm:u,isConnector:h}=S(),{sourcesApi:m,snapshotsApi:g,namespacesApi:f}=Bl(),{data:b,loading:v,refetch:y}=g.useSnapshots(),{items:C,loading:x,refetch:w}=f.useNamespaces(),T=$c(u||!!h),{selectedStreamName:k}=nt(),{progress:I,resetProgress:E}=Rt(),{isFetching:N,setIsFetching:$,setSnapshots:O,formData:A,handleSourceChange:R,handleSelectAll:D,formDiff:_,isFormDirty:P}=Jl();i(()=>{y(),w()},[]);const L=a(()=>{if(b)return b;const e=C;return e.length?{clusters:[{clusterId:_t,clusterName:Dt,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[b,C,k]);i(()=>{$(v||x),L&&O(L)},[L,v,x,$,O]);const[F,M]=s(""),[z,B]=s(Nt.Namespace),[X,U]=s({showOnlySelected:!1}),[V,H]=s({clusterId:"",clusterName:"",namespaceName:""}),j=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isVm:u,isConnector:h}=S(),m=$c(u||!!h),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Yl(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...ql(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,p]),f=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:b,withFilterCount:v,filteredCount:y,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(zc,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null).filter(e=>null!==e),o=g.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=n.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:o!==a,filteredCount:o,totalCount:a}},[g,n,r]);return{width:"60%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(pe,{size:he.XS,nowrap:!0,children:m.groupColumnHeader}),t($e,{text:v?ot.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ze,{label:`${v?`${y} / ${C}`:C}`,status:Fe.Unknown})})]}),t(pe,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!f,searchText:c,searchBy:d,filters:p}),disabled:!b.length,size:he.XS,children:Ac(f)})]}),list:b.length?b:o?[t(vt,{$height:"100%",children:t(wt,{title:m.fetchingGroups.title,subTitle:m.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(vt,{$height:"100%",children:t(Re,c?{icon:qa,title:Oc,subTitle:m.noGroupMatchedFilter(c)}:{icon:qa,title:m.noGroups.title,subTitle:m.noGroups.subTitle})},"no-data")]}})({isFetching:N,formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:V,setSelectedArea:H,searchText:z===Nt.Namespace?F:"",searchBy:z,filters:X}),G=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:p,isConnector:u,isK8s:h}=S(),m=$c(p||!!u),g=d===$t.Onprem,f=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]),b=a(()=>f?[...f.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Wl(e,r,c)):[],[f,r,c]),v=a(()=>!!b.length&&b.every(({selected:e})=>e),[b]),y=a(()=>{if(!f)return[];const{clusterId:e}=l.value,{name:o}=f;return b.map(({name:i,selected:a,kind:l,region:r})=>{const s=h&&!g&&Kl.has(l);return t(Pc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:i,kind:l,region:r}}),disabled:s},`${e}#${o}#${i}#${l}#${r??""}`)})},[b,f,l.value.clusterId,n,h,g]),{withFilterCount:C,filteredCount:x,totalCount:w}=a(()=>{const e=f?.workloads.length??0;return{withFilterCount:b.length!==e,filteredCount:b.length,totalCount:e}},[b,f]);return{width:"40%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(pe,{size:he.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${m.itemColumnHeader}`:m.itemColumnHeader}),t($e,{text:C?ot.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ze,{label:`${C?`${x} / ${w}`:w}`,status:Fe.Unknown})})]}),t(pe,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!v,searchText:r,searchBy:s,filters:c}),disabled:!y.length,size:he.XS,children:Ac(v)})]}),list:y.length?y:[t(vt,{$height:"100%",children:t(Re,f?r?{icon:Ya,title:Oc,subTitle:(T=r,`No sources matched the filter '${T}'`)}:{icon:Ya,title:"No sources",subTitle:m.noItemsInGroupSubTitle}:{icon:Ya,title:m.selectGroupPrompt.title,subTitle:m.selectGroupPrompt.subTitle})},"no-data")]};var T})({formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:{value:V},searchText:z===Nt.Source?F:"",searchBy:z,filters:X});return t(Sr,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:o?()=>{E(Pt.BulkInstrumenting),o()}:void 0,onBack:n?()=>n(_):void 0,onNext:l?()=>l(_):void 0,nextIsSkip:!P,onSave:()=>m.persistV2(_),header:{icon:Ya,title:ot.ADD_SOURCE,subTitle:ot.ADD_SOURCES_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:F,onChange:e=>{M(e),z===Nt.Namespace&&H({clusterId:"",clusterName:"",namespaceName:""})},placeholder:T.searchPlaceholder(z),segment:{options:[{label:T.groupSegmentLabel,value:Nt.Namespace},{label:T.itemSegmentLabel,value:Nt.Source}],selected:z,setSelected:B}},filters:e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(le,{name:"filter-selected",size:Ot.S,label:Rc,value:X.showOnlySelected,onChange:e=>U(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:N,progress:{title:ot.CREATING_SOURCES,subTitle:ot.CREATING_SOURCES_SUBTITLE,percentage:I[Pt.BulkInstrumenting]?.percentage||0},leftColumn:j,rightColumn:G})},Xc={aws:Ja},Uc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Vc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Hc=e=>e.provider.toUpperCase(),jc=b.div`
|
|
192
192
|
display: flex;
|
|
193
193
|
flex-direction: column;
|
|
194
194
|
gap: 8px;
|
|
@@ -196,7 +196,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
196
196
|
padding: 8px 12px;
|
|
197
197
|
border-radius: 16px 0 0 16px;
|
|
198
198
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
199
|
-
`,
|
|
199
|
+
`,Gc=b.button`
|
|
200
200
|
display: flex;
|
|
201
201
|
align-items: center;
|
|
202
202
|
gap: 12px;
|
|
@@ -212,7 +212,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
212
212
|
&:hover {
|
|
213
213
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
214
214
|
}
|
|
215
|
-
`,
|
|
215
|
+
`,Wc=b.div`
|
|
216
216
|
display: flex;
|
|
217
217
|
align-items: center;
|
|
218
218
|
justify-content: center;
|
|
@@ -221,13 +221,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
221
221
|
border-radius: 8px;
|
|
222
222
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
223
223
|
flex-shrink: 0;
|
|
224
|
-
`,
|
|
224
|
+
`,Kc=b.div`
|
|
225
225
|
display: flex;
|
|
226
226
|
flex-direction: column;
|
|
227
227
|
gap: 2px;
|
|
228
228
|
flex: 1;
|
|
229
229
|
min-width: 0;
|
|
230
|
-
`,
|
|
230
|
+
`,Yc=({providers:o,selectedProvider:n,onSelect:i})=>{const a=v();return o.length?t(jc,{children:o.map(o=>{const l=(e=>Xc[e.provider]??Za)(o),r=o.provider===n,s=(e=>{const t=e.features.find(e=>e.key===Lt.Discovery);if(!t)return"";const o=[],n=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=Uc[t]??Vc(t);n.has(i)||(n.add(i),o.push(i))}return o.join(", ")})(o);return e(Gc,{type:"button",$selected:r,onClick:()=>i(o.provider),"data-id":`cloud-connector-provider-${o.provider}`,children:[t(Wc,{children:t(l,{size:24})}),e(Kc,{children:[t(pe,{size:he.S,weight:400,lineHeight:"24px",color:ue.Primary,children:Hc(o)}),s&&t(pe,{size:he.XXXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:s})]}),t(Xa,{size:18,fill:a.v2.colors.silver[300]})]},o.provider)})}):t(pe,{size:he.XS,color:ue.Secondary,children:"No providers available."})},qc=b.div`
|
|
231
231
|
display: flex;
|
|
232
232
|
flex-direction: column;
|
|
233
233
|
gap: 8px;
|
|
@@ -237,15 +237,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
237
237
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
238
238
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
239
239
|
cursor: default;
|
|
240
|
-
`,
|
|
240
|
+
`,Jc=b.div`
|
|
241
241
|
display: flex;
|
|
242
242
|
align-items: center;
|
|
243
243
|
gap: 4px;
|
|
244
244
|
width: 100%;
|
|
245
|
-
`,
|
|
245
|
+
`,Zc=b.div`
|
|
246
246
|
flex: 1;
|
|
247
247
|
min-width: 0;
|
|
248
|
-
`,
|
|
248
|
+
`,Qc=b.div`
|
|
249
249
|
width: 100%;
|
|
250
250
|
max-height: 145px;
|
|
251
251
|
overflow: auto;
|
|
@@ -267,39 +267,39 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
267
267
|
transition: background-color 0.2s ease;
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
${
|
|
270
|
+
${qc}:hover & {
|
|
271
271
|
scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
${
|
|
274
|
+
${qc}:hover &::-webkit-scrollbar-thumb {
|
|
275
275
|
background-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
276
276
|
}
|
|
277
|
-
`,
|
|
277
|
+
`,ed=b.pre`
|
|
278
278
|
margin: 0;
|
|
279
279
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
280
280
|
font-size: 12px;
|
|
281
281
|
line-height: 20px;
|
|
282
282
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
283
283
|
white-space: pre;
|
|
284
|
-
`,
|
|
284
|
+
`,td=({policy:o})=>{const n=v(),{CopyButton:i}=Ft();return e(qc,{children:[e(Jc,{children:[t(Qa,{size:16,fill:n.v2.colors.silver[200]}),t(Zc,{children:t(pe,{size:he.XXS,color:ue.Primary,children:ot.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:o,size:xt.XS})]}),t(Qc,{children:t(ed,{children:o})})]})};var od;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(od||(od={}));const nd=[{id:od.DiscoveryOnly,title:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Lt.Discovery]},{id:od.DiscoveryInstrumentation,title:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Lt.Discovery,Lt.Instrumentation]},{id:od.Custom,title:ot.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:ot.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],id=(e,t)=>e.features?.find(e=>e.key===t),ad=e=>{if(!e)return[];const t=id(e,Lt.Discovery),o=id(e,Lt.Instrumentation);return t?t.types.map(e=>{const t=o?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},ld=()=>{const e=new Set,t=[];return{out:t,add:o=>o?.forEach(o=>{o&&!e.has(o)&&(e.add(o),t.push(o))})}},rd=(e,t,o)=>{const n=t===od.Custom?((e,t)=>{if(!e)return[];const o=ad(e),n=id(e,Lt.Discovery),i=o.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=ld();return l(e.auth?.permissions),i&&l(n?.permissions),o.forEach(e=>{const o=t[e.typeName];o?.discovery&&l(e.discoveryPermissions),o?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,o??{}):((e,t)=>{if(!e)return[];const o=nd.find(e=>e.id===t)?.featureKeys??[],{out:n,add:i}=ld();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&o.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),n})(e,t),i={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:n,Resource:"*"}]};return JSON.stringify(i,null,2)},sd=b.div`
|
|
285
285
|
width: 100%;
|
|
286
286
|
padding: 12px 16px;
|
|
287
287
|
border-radius: 12px;
|
|
288
288
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
289
289
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
290
|
-
`,
|
|
290
|
+
`,cd=b.div`
|
|
291
291
|
display: grid;
|
|
292
292
|
grid-template-columns: minmax(0, 1fr) 120px 150px;
|
|
293
293
|
align-items: center;
|
|
294
294
|
row-gap: 16px;
|
|
295
295
|
column-gap: 8px;
|
|
296
|
-
`,
|
|
296
|
+
`,dd=b.div`
|
|
297
297
|
display: flex;
|
|
298
298
|
align-items: center;
|
|
299
299
|
min-width: 0;
|
|
300
|
-
`,
|
|
300
|
+
`,pd=b(dd)`
|
|
301
301
|
justify-content: center;
|
|
302
|
-
`,
|
|
302
|
+
`,ud={discovery:!1,instrumentation:!1},hd=({provider:o,capabilities:i,onCapabilitiesChange:a})=>{const l=ad(o),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(sd,{children:e(cd,{children:[t(dd,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(pd,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(pd,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:ot.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(o=>{const a=i[o.typeName]??ud,l=void 0!==o.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(n.Fragment,{children:[t(dd,{children:t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Primary,children:o.displayName})}),t(pd,{children:t(le,{name:`cloud-connector-custom-${o.typeName}-discovery`,size:Ot.S,value:s,disabled:a.instrumentation,onChange:e=>r(o.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(pd,{children:t(le,{name:`cloud-connector-custom-${o.typeName}-instrumentation`,size:Ot.S,value:a.instrumentation,disabled:!l,onChange:e=>r(o.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},o.typeName)})]})}):null},md=b.div`
|
|
303
303
|
display: flex;
|
|
304
304
|
flex-direction: column;
|
|
305
305
|
gap: 8px;
|
|
@@ -308,12 +308,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
308
308
|
padding: 8px;
|
|
309
309
|
border-radius: 0 16px 16px 0;
|
|
310
310
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
311
|
-
`,
|
|
311
|
+
`,gd=b.div`
|
|
312
312
|
display: flex;
|
|
313
313
|
flex-direction: column;
|
|
314
314
|
gap: 8px;
|
|
315
315
|
width: 100%;
|
|
316
|
-
`,
|
|
316
|
+
`,fd=b.div`
|
|
317
317
|
display: flex;
|
|
318
318
|
align-items: center;
|
|
319
319
|
gap: 10px;
|
|
@@ -321,7 +321,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
321
321
|
padding: 4px 12px 4px 4px;
|
|
322
322
|
border-radius: 8px;
|
|
323
323
|
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
324
|
-
`,
|
|
324
|
+
`,bd=b.div`
|
|
325
325
|
display: flex;
|
|
326
326
|
align-items: center;
|
|
327
327
|
justify-content: center;
|
|
@@ -330,30 +330,30 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
330
330
|
border-radius: 6px;
|
|
331
331
|
flex-shrink: 0;
|
|
332
332
|
background-color: ${({theme:e})=>e.v2.colors.purple[800]};
|
|
333
|
-
`,
|
|
333
|
+
`,vd=({message:o})=>{const n=v();return e(fd,{children:[t(bd,{children:t(el,{size:24})}),t(pe,{size:he.XXS,color:n.v2.colors.purple[300],children:o})]})},yd=({provider:o,selectedPermission:n,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(md,{children:nd.map(r=>{const s=r.id===n,c=r.id===od.Custom,d=s?e(gd,{children:[c&&t(hd,{provider:o,capabilities:a,onCapabilitiesChange:l}),t(td,{policy:rd(o,r.id,a)})]}):void 0,p=s?t(vd,{message:c?ot.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:ot.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Mt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:p},r.id)})}),Cd=b.div`
|
|
334
334
|
display: flex;
|
|
335
335
|
flex-direction: column;
|
|
336
336
|
padding: 16px;
|
|
337
|
-
`,
|
|
337
|
+
`,Sd=b.div`
|
|
338
338
|
display: flex;
|
|
339
339
|
flex-direction: column;
|
|
340
340
|
gap: 16px;
|
|
341
341
|
padding: 16px;
|
|
342
342
|
border-radius: 16px;
|
|
343
343
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
344
|
-
`,
|
|
344
|
+
`,xd=b.div`
|
|
345
345
|
display: flex;
|
|
346
346
|
flex-direction: column;
|
|
347
347
|
gap: 4px;
|
|
348
|
-
`,
|
|
348
|
+
`,wd=b.div`
|
|
349
349
|
display: flex;
|
|
350
350
|
align-items: stretch;
|
|
351
351
|
width: 100%;
|
|
352
|
-
`,
|
|
352
|
+
`,Td=b.div`
|
|
353
353
|
display: flex;
|
|
354
354
|
flex: 0 0 40%;
|
|
355
355
|
min-width: 0;
|
|
356
|
-
`,
|
|
356
|
+
`,kd=()=>{const{providers:o,genericForm:n}=Zl(),[l,r]=s(!0),c=a(()=>o.find(e=>e.provider===n.formData.provider),[o,n.formData.provider]);return i(()=>{!n.formData.provider&&o.length>0&&n.handleFormChange("provider",o[0].provider)},[o,n.formData.provider,n]),i(()=>{n.formData.permission||n.handleFormChange("permission",od.DiscoveryInstrumentation)},[n.formData.permission,n]),t(Cd,{children:e(Sd,{children:[e(xd,{children:[t(pe,{size:he.S,weight:500,lineHeight:"24px",color:ue.Primary,children:ot.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:ot.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),l&&t(Le,{fullWidth:!0,smallIcon:!0,status:Fe.Info,message:ot.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:zt.CLOSE,onClick:()=>r(!1)}}),e(wd,{children:[t(Td,{children:t(Yc,{providers:o,selectedProvider:n.formData.provider,onSelect:e=>n.handleFormChange("provider",e)})}),t(yd,{provider:c,selectedPermission:n.formData.permission,onSelect:e=>n.handleFormChange("permission",e),capabilities:n.formData.customCapabilities,onCapabilitiesChange:e=>n.handleFormChange("customCapabilities",e)})]})]})})},Id=b.div`
|
|
357
357
|
display: flex;
|
|
358
358
|
flex-direction: column;
|
|
359
359
|
gap: 16px;
|
|
@@ -361,12 +361,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
361
361
|
padding: 12px;
|
|
362
362
|
border-radius: 8px;
|
|
363
363
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
364
|
-
`,
|
|
364
|
+
`,Ed=b.div`
|
|
365
365
|
display: flex;
|
|
366
366
|
align-items: center;
|
|
367
367
|
gap: 12px;
|
|
368
368
|
width: 100%;
|
|
369
|
-
`,
|
|
369
|
+
`,Nd=b.div`
|
|
370
370
|
display: flex;
|
|
371
371
|
align-items: center;
|
|
372
372
|
justify-content: center;
|
|
@@ -375,41 +375,41 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
375
375
|
height: 24px;
|
|
376
376
|
border-radius: 16px;
|
|
377
377
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
378
|
-
|
|
378
|
+
`,$d=b.div`
|
|
379
379
|
display: flex;
|
|
380
380
|
flex: 1;
|
|
381
381
|
flex-direction: column;
|
|
382
382
|
gap: 2px;
|
|
383
383
|
min-width: 0;
|
|
384
|
-
`,
|
|
384
|
+
`,Od=b.div`
|
|
385
385
|
display: flex;
|
|
386
386
|
flex-direction: column;
|
|
387
387
|
gap: 10px;
|
|
388
388
|
width: 100%;
|
|
389
389
|
padding-left: 32px;
|
|
390
|
-
`,
|
|
390
|
+
`,Ad=({"data-id":o,step:n,title:i,description:a,children:l})=>e(Id,{"data-id":o,children:[e(Ed,{children:[t(Nd,{children:t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:ue.Primary,children:n})}),e($d,{children:[t(pe,{size:he.S,weight:400,lineHeight:"24px",color:ue.Primary,children:i}),t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:a})]})]}),l&&t(Od,{children:l})]});var Rd,Dd;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(Rd||(Rd={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})(Dd||(Dd={}));const _d=[{id:Rd.AssumeRole,label:ot.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:ot.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:Rd.StaticKeys,label:ot.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:ot.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],Pd=[{id:Dd.CloudFormation,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:Dd.Terraform,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:Dd.AwsCli,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:Dd.Manual,label:ot.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],Ld={[Dd.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[Dd.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[Dd.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[Dd.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},Fd=b.div`
|
|
391
391
|
display: flex;
|
|
392
392
|
align-items: stretch;
|
|
393
393
|
gap: 10px;
|
|
394
394
|
width: 100%;
|
|
395
|
-
`,
|
|
395
|
+
`,Md=b.div`
|
|
396
396
|
display: flex;
|
|
397
397
|
flex: 2 1 0;
|
|
398
398
|
flex-direction: column;
|
|
399
399
|
gap: 12px;
|
|
400
400
|
min-width: 0;
|
|
401
401
|
padding: 12px 0;
|
|
402
|
-
`,
|
|
402
|
+
`,zd=b.div`
|
|
403
403
|
display: flex;
|
|
404
404
|
flex-direction: column;
|
|
405
405
|
gap: 8px;
|
|
406
406
|
width: 100%;
|
|
407
|
-
`,
|
|
407
|
+
`,Bd=b.div`
|
|
408
408
|
display: flex;
|
|
409
409
|
align-items: center;
|
|
410
410
|
gap: 12px;
|
|
411
411
|
width: 100%;
|
|
412
|
-
`,
|
|
412
|
+
`,Xd=b.div`
|
|
413
413
|
display: flex;
|
|
414
414
|
align-items: center;
|
|
415
415
|
justify-content: center;
|
|
@@ -418,7 +418,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
418
418
|
height: 24px;
|
|
419
419
|
border-radius: 16px;
|
|
420
420
|
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
421
|
-
`,
|
|
421
|
+
`,Ud=b.div`
|
|
422
422
|
display: flex;
|
|
423
423
|
flex: 3 1 0;
|
|
424
424
|
flex-direction: column;
|
|
@@ -427,60 +427,60 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
427
427
|
border-radius: 12px;
|
|
428
428
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
429
429
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
430
|
-
`,
|
|
430
|
+
`,Vd=b.div`
|
|
431
431
|
display: flex;
|
|
432
432
|
align-items: center;
|
|
433
433
|
justify-content: flex-end;
|
|
434
434
|
width: 100%;
|
|
435
|
-
`,
|
|
435
|
+
`,Hd=b.div`
|
|
436
436
|
flex: 1;
|
|
437
437
|
width: 100%;
|
|
438
438
|
min-height: 200px;
|
|
439
439
|
max-height: 260px;
|
|
440
440
|
overflow: auto;
|
|
441
441
|
padding: 0 12px 12px;
|
|
442
|
-
`,
|
|
442
|
+
`,jd=b.pre`
|
|
443
443
|
margin: 0;
|
|
444
444
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
445
445
|
font-size: 12px;
|
|
446
446
|
line-height: 20px;
|
|
447
447
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
448
448
|
white-space: pre;
|
|
449
|
-
`,
|
|
449
|
+
`,Gd=({step:o,setupMethod:n})=>{const i=v(),{CopyButton:a}=Ft(),{description:l,steps:r,code:s}=(e=>Ld[e]??Ld[Dd.CloudFormation])(n);return t(Ad,{"data-id":"cloud-connector-create-role",step:o,title:ot.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(Fd,{children:[e(Md,{children:[t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:ue.Primary,children:ot.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(zd,{children:r.map((o,a)=>e(Bd,{children:[t(Xd,{children:t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:ue.Primary,children:o})]},`${n}-step-${a}`))})]}),e(Ud,{children:[t(Vd,{children:t(a,{value:s,size:xt.XS})}),t(Hd,{children:t(jd,{children:s})})]})]})})},Wd=b.div`
|
|
450
450
|
display: flex;
|
|
451
451
|
flex-direction: column;
|
|
452
452
|
gap: 16px;
|
|
453
453
|
width: 100%;
|
|
454
|
-
`,
|
|
454
|
+
`,Kd=b.div`
|
|
455
455
|
display: flex;
|
|
456
456
|
flex-wrap: wrap;
|
|
457
457
|
gap: 24px;
|
|
458
458
|
width: 100%;
|
|
459
|
-
`,
|
|
459
|
+
`,Yd=b.div`
|
|
460
460
|
display: flex;
|
|
461
461
|
flex: 1 1 calc(50% - 12px);
|
|
462
462
|
min-width: 0;
|
|
463
|
-
`,
|
|
463
|
+
`,qd=b.div`
|
|
464
464
|
display: flex;
|
|
465
465
|
width: 100%;
|
|
466
466
|
max-width: 479px;
|
|
467
|
-
`,
|
|
467
|
+
`,Jd=({step:o})=>{const{genericForm:n,providers:i}=Zl(),{provider:l,authMethod:r,awsAccountId:s,credentials:c}=n.formData,d=a(()=>i.find(e=>e.provider===l),[i,l]),p=a(()=>((e,t)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return[];const n=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return o.baseMethods?.forEach(e=>l(n.get(e)?.fields)),l(o.fields),a})(d,r),[d,r]);return t(Ad,{"data-id":"cloud-connector-enter-arn",step:o,title:ot.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:ot.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(Wd,{children:[t(qd,{children:t(Te,{name:"cloud-connector-aws-account-id",width:"100%",label:ot.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:ot.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:ot.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>n.handleFormChange("awsAccountId",e.target.value)})}),p.length>0&&t(Kd,{children:p.map(e=>t(Yd,{children:t(Te,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Bt.Password:Bt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:c[e.name]??"",onChange:t=>{return o=e.name,i=t.target.value,void n.handleFormChange("credentials",{...c,[o]:i});var o,i}})},e.name))})]})})},Zd=b.div`
|
|
468
468
|
display: flex;
|
|
469
469
|
flex-direction: column;
|
|
470
470
|
padding: 16px;
|
|
471
|
-
`,
|
|
471
|
+
`,Qd=b.div`
|
|
472
472
|
display: flex;
|
|
473
473
|
flex-direction: column;
|
|
474
474
|
gap: 12px;
|
|
475
475
|
padding: 16px 16px 12px;
|
|
476
476
|
border-radius: 16px;
|
|
477
477
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
478
|
-
`,
|
|
478
|
+
`,ep=b.div`
|
|
479
479
|
display: flex;
|
|
480
480
|
align-items: center;
|
|
481
481
|
gap: 8px;
|
|
482
482
|
width: 100%;
|
|
483
|
-
`,
|
|
483
|
+
`,tp=b.button`
|
|
484
484
|
display: flex;
|
|
485
485
|
align-items: center;
|
|
486
486
|
justify-content: center;
|
|
@@ -497,24 +497,24 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
497
497
|
&:hover {
|
|
498
498
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
499
499
|
}
|
|
500
|
-
`,
|
|
500
|
+
`,op=b.div`
|
|
501
501
|
display: flex;
|
|
502
502
|
flex: 1;
|
|
503
503
|
flex-direction: column;
|
|
504
504
|
gap: 4px;
|
|
505
505
|
min-width: 0;
|
|
506
|
-
`,
|
|
506
|
+
`,np=b.div`
|
|
507
507
|
display: flex;
|
|
508
508
|
align-items: center;
|
|
509
509
|
gap: 4px;
|
|
510
510
|
padding: 8px 0 8px 2px;
|
|
511
|
-
`,
|
|
511
|
+
`,ip=({onBack:o})=>{const n=v(),{genericForm:a}=Zl(),l=a.formData.authMethod,r=a.formData.setupMethod;i(()=>{l||a.handleFormChange("authMethod",Rd.AssumeRole)},[l,a]),i(()=>{r||a.handleFormChange("setupMethod",Dd.CloudFormation)},[r,a]);const s=_d.find(e=>e.id===l)?.note;return t(Zd,{children:e(Qd,{children:[e(ep,{children:[t(tp,{"data-id":"cloud-connector-setup-back",type:"button",onClick:o,"aria-label":ot.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(tl,{size:24})}),e(op,{children:[t(pe,{size:he.S,weight:500,lineHeight:"24px",color:ue.Primary,children:ot.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:ot.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE})]})]}),e(Ad,{"data-id":"cloud-connector-auth-method",step:1,title:ot.CLOUD_CONNECTOR_AUTH_TITLE,description:ot.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:_e.S,selected:l,setSelected:e=>a.handleFormChange("authMethod",e),options:_d.map(e=>({value:e.id,label:e.label}))}),s&&e(np,{children:[t(ol,{size:16,fill:n.v2.colors.silver[200]}),t(pe,{size:he.XXXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:s})]})]}),t(Ad,{"data-id":"cloud-connector-setup-method",step:2,title:ot.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:ot.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:_e.S,selected:r,setSelected:e=>a.handleFormChange("setupMethod",e),options:Pd.map(e=>({value:e.id,label:e.label}))})}),t(Gd,{step:3,setupMethod:r}),t(Jd,{step:4})]})})},ap=b.div`
|
|
512
512
|
display: flex;
|
|
513
513
|
flex-direction: column;
|
|
514
514
|
flex: 1;
|
|
515
515
|
min-height: 0;
|
|
516
516
|
padding: 16px;
|
|
517
|
-
`,
|
|
517
|
+
`,lp=b.div`
|
|
518
518
|
display: flex;
|
|
519
519
|
flex-direction: column;
|
|
520
520
|
flex: 1;
|
|
@@ -522,13 +522,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
522
522
|
padding: 16px;
|
|
523
523
|
border-radius: 16px;
|
|
524
524
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
525
|
-
`,
|
|
525
|
+
`,rp=b.div`
|
|
526
526
|
display: flex;
|
|
527
527
|
flex: 1;
|
|
528
528
|
align-items: center;
|
|
529
529
|
justify-content: center;
|
|
530
530
|
width: 100%;
|
|
531
|
-
`,
|
|
531
|
+
`,sp=b.div`
|
|
532
532
|
display: flex;
|
|
533
533
|
flex-direction: column;
|
|
534
534
|
align-items: center;
|
|
@@ -538,7 +538,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
538
538
|
padding: 24px 8px;
|
|
539
539
|
border-radius: 8px;
|
|
540
540
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
541
|
-
`,
|
|
541
|
+
`,cp=b.div`
|
|
542
542
|
display: flex;
|
|
543
543
|
flex-direction: column;
|
|
544
544
|
align-items: center;
|
|
@@ -547,7 +547,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
547
547
|
padding: 16px;
|
|
548
548
|
border-radius: 12px;
|
|
549
549
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
550
|
-
`,
|
|
550
|
+
`,dp=b.div`
|
|
551
551
|
display: flex;
|
|
552
552
|
align-items: center;
|
|
553
553
|
justify-content: center;
|
|
@@ -556,7 +556,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
556
556
|
height: 39px;
|
|
557
557
|
border-radius: 20px;
|
|
558
558
|
background-color: ${({theme:e})=>e.v2.colors.red[500]};
|
|
559
|
-
`,
|
|
559
|
+
`,pp=b.div`
|
|
560
560
|
display: flex;
|
|
561
561
|
align-items: flex-start;
|
|
562
562
|
gap: 8px;
|
|
@@ -566,7 +566,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
566
566
|
padding: 12px;
|
|
567
567
|
border-radius: 8px;
|
|
568
568
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
569
|
-
`,
|
|
569
|
+
`,up=b.pre`
|
|
570
570
|
flex: 1;
|
|
571
571
|
min-width: 0;
|
|
572
572
|
margin: 0;
|
|
@@ -576,25 +576,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
576
576
|
color: ${({theme:e})=>e.v2.colors.silver[200]};
|
|
577
577
|
white-space: pre-wrap;
|
|
578
578
|
word-break: break-word;
|
|
579
|
-
`,
|
|
579
|
+
`,hp=b.div`
|
|
580
580
|
display: flex;
|
|
581
581
|
flex-direction: column;
|
|
582
582
|
gap: 12px;
|
|
583
583
|
width: 100%;
|
|
584
|
-
`,
|
|
584
|
+
`,mp=b.div`
|
|
585
585
|
display: flex;
|
|
586
586
|
flex-wrap: wrap;
|
|
587
587
|
gap: 24px;
|
|
588
588
|
padding: 0 2px;
|
|
589
|
-
`,
|
|
589
|
+
`,gp=b.div`
|
|
590
590
|
display: flex;
|
|
591
591
|
gap: 6px;
|
|
592
592
|
min-width: 0;
|
|
593
|
-
`,
|
|
593
|
+
`,fp=b.div`
|
|
594
594
|
display: flex;
|
|
595
595
|
flex-direction: column;
|
|
596
596
|
gap: 8px;
|
|
597
|
-
`,
|
|
597
|
+
`,bp=b.div`
|
|
598
598
|
display: flex;
|
|
599
599
|
flex-direction: column;
|
|
600
600
|
gap: 6px;
|
|
@@ -602,7 +602,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
602
602
|
border-radius: 12px;
|
|
603
603
|
border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
|
|
604
604
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
605
|
-
`,mp=({isTesting:o,error:n,result:i})=>{const l=v(),{CopyButton:r}=Pt(),s=a(()=>i?.checks.filter(e=>!e.passed)??[],[i]),c=!(o||!n&&(!i||i.success)),d=n?et.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||et.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=n||s.map(e=>e.message).filter(Boolean).join("\n");return t(tp,{children:t(op,{children:o?t(np,{children:t(ip,{children:t(St,{withVisual:!0,withGradient:!0,title:et.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:he.XS})})}):c?t(np,{children:e(ap,{children:[t(lp,{children:t(Va,{size:20,fill:l.v2.colors.black[500]})}),t(pe,{size:he.XS,weight:400,lineHeight:"20px",color:ue.Primary,children:et.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(pe,{align:"center",size:he.XXXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:d}),p&&e(rp,{children:[t(sp,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):i?e(cp,{children:[t(qe,{status:Fe.Success,label:et.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Ua,fullWidth:!0}),(i.accountId||i.identity)&&e(dp,{children:[i.accountId&&e(pp,{children:[e(pe,{size:he.XXS,weight:500,color:ue.Secondary,children:[et.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(pe,{size:he.XXS,weight:400,color:ue.Primary,children:i.accountId})]}),i.identity&&e(pp,{children:[e(pe,{size:he.XXS,weight:500,color:ue.Secondary,children:[et.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(pe,{size:he.XXS,weight:400,color:ue.Primary,children:i.identity})]})]}),i.checks.length>0&&t(up,{children:i.checks.map(o=>e(hp,{$passed:o.passed,children:[t(qe,{status:o.passed?Fe.Success:Fe.Error,label:o.displayName,leftIcon:o.passed?Ua:Va}),o.message&&t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:o.message}),!o.passed&&o.remediation&&t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Primary,children:o.remediation})]},o.name))})]}):t(np,{children:t(pe,{size:he.XXS,weight:400,color:ue.Secondary,children:et.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var gp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(gp||(gp={}));const fp=gp.SelectProvider,bp=gp.Validate,vp=({onClose:o,withOverlay:n,onCreateCloudConnector:i,onCreated:l})=>{const{providers:c,genericForm:d}=Kl(),[p,u]=s(fp),[h,m]=s(!1),[g,f]=s(!1),[b,v]=s(void 0),[y,C]=s(void 0),[S,x]=s(void 0),w=d.isFormDirty,T=p===fp,k=p===bp,E=r(()=>{w&&!h?m(!0):(m(!1),o?.())},[w,h,o]),I=r(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>fp?e-1:e)},[]),N=r(()=>{if(x(void 0),p===gp.SelectProvider){if(!d.formData.provider)return void x("Please select a cloud provider");if(!d.formData.permission)return void x("Please select a permission level")}u(e=>e<bp?e+1:e)},[p,d.formData.provider,d.formData.permission]),$=r(async()=>{if(x(void 0),C(void 0),v(void 0),u(gp.Validate),!i)return;const{provider:e,permission:t,customCapabilities:o,awsAccountId:n,credentials:a,name:r}=d.formData,s=((e,t,o)=>{const n=td(e),i=[];return n.forEach(e=>{const n=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Zc.DiscoveryOnly:a=!0;break;case Zc.DiscoveryInstrumentation:a=!0,l=n;break;case Zc.Custom:{const t=o[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(c.find(t=>t.provider===e),t,o);f(!0);try{const t=await i({provider:e,displayName:r,credentials:a,expectedAccountId:n,capabilities:s});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[i,l,d.formData,c]),O=g,A=k&&!g&&(!!y||!!b&&!b.success),R=a(()=>S?{status:Fe.Error,message:S}:void 0,[S]),D=a(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:E,disabled:O}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:be.Text,leftIcon:Ja,onClick:I,disabled:O},[T,E,I,O]),_=a(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:be.Primary,rightIcon:Qa,onClick:$}:void 0}return p===gp.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:be.Primary,onClick:$,disabled:O}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:be.Primary,onClick:N,disabled:O}},[k,g,A,p,$,N,O]),P=a(()=>[D,_].filter(Boolean),[D,_]);return e(ce,{width:vr,isOpen:!0,hideOverlay:!O&&!n,header:{icon:Ka,title:et.CREATE_CLOUD_CONNECTOR,onClose:o?E:void 0,onCloseDisabled:O},footer:{note:R,actions:P},children:[p===gp.SelectProvider&&t(Sd,{}),p===gp.Config&&t(ep,{onBack:I}),p===gp.Validate&&t(mp,{isTesting:g,error:y,result:b}),t(yr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>o?.()})]})},yp=(e,t)=>{const o=[{id:"type",title:et.TYPE,label:t.label},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.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:et.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:et.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:et.NOTES,label:e.notes}),o},Cp=({onClose:n,actionId:l})=>{const c=v(),{isVm:d}=S(),{actionsApi:p}=Ll(),{items:u,refetch:h}=p.useActions(),{options:m}=p.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:b,genericForm:y}=Pl();i(()=>{h()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=C&&!!y?.isFormDirty,N=a(()=>u?.find(e=>zt(e)===l),[l,u]),$=a(()=>m.find(({type:e})=>e===N?.type)??Bt.find(({type:e})=>e===N?.type)??null,[m,N?.type]);i(()=>{N&&f(N,$)},[N,$]);const O=r(()=>{N&&x(!0)},[N]),A=r(()=>{N&&(f(N,$),x(!1))},[N,$,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await p.update(N.id,t),x(!1))}},[N,b,p]),L=r(()=>{N&&T(!0)},[N]),F=r(async()=>{N&&(await p.remove(N.id,N.type),n())},[N,p,n]);if(!N||!$)return null;const M=(e=>{const t=[],{type:o,fields:n}=e,i=e=>({status:e?Fe.Success:Fe.Unknown,label:e?"True":"False",invertColors:!0});if(o===Ae.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:i(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:i(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:i(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:i(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.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:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.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===Ae.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:i(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===Ae.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===Ae.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:i,regex:a},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}),i&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:i}),a&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:a})})}return o===Ae.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const i=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${i}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,a)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${a}`,title:`${i}Workload${(e.workloadFilters?.length??0)>1?` #${a+1}`:""}`,label:l})});const a=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");a&&t.push({id:`group-${o}-templates`,title:`${i}Templates`,label:a}),e.notes&&t.push({id:`group-${o}-notes`,title:`${i}Notes`,label:e.notes})}),t})(N);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:Vt(N.type),title:$.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:_a,active:C,onClick:O},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ia,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:P}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:C&&g?t(Ms,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!d&&t(Ut,{conditions:N.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:yp(N,$)})]}),!!M?.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",cellsPerRow:2,items:M})})]})})})}),t(Cr,{target:"action",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(yr,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})},Sp=({onClose:o,connections:n,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=Ll(),[p,u]=s(""),[h,m]=s({showOnlySelected:!1}),g=a(()=>n.filter(e=>{const t=!p||e.name.toLowerCase().includes(p.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&o}),[n.length,r.length,p,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Ht(C||{rollout:{automaticRolloutDisabled:!1}}),k=l(T);k.current=T,i(()=>{C&&k.current(C)},[C]);const E=a(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(br,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:el,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:p,onChange:u},filters:e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(le,{size:Nt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:y,leftColumn:{width:"35%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(pe,{size:he.XS,children:"Clusters"}),t(qe,{label:g.length,status:Fe.Unknown})]}),e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,align:"right",children:"Selected clusters"}),t(qe,{label:`${r.length}/${g.length}`,status:Fe.Unknown})]})]}),list:g.map(e=>t(dc,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(pe,{size:he.XS,children:"Configurations"}),list:[t(le,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},xp=e=>{const t=[{id:"type",title:et.TYPE,label:e.destinationType.displayName},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}],o=Be(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:et.MONITORS,label:o}),e.name&&t.push({id:"name",title:et.NAME,label:e.name}),t},wp=({onClose:n,destinationId:c})=>{const d=v(),{isVm:p}=S(),{destinationsApi:u}=Ll(),{selectedStreamName:h}=tt(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Fl();i(()=>{g()},[]);const T=l(null),[k,E]=s(!1),[I,N]=s(!1),[$,O]=s(null),A=k&&!!w?.isFormDirty,R=a(()=>Gt(m,h),[m,h]),D=a(()=>R?.find(e=>zt(e)===c),[c,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&C(D,_)},[D,_]);const P=a(()=>D&&_?Wt(_,D):[],[D,_]),L=r(()=>{D&&E(!0)},[D]),F=r(()=>{D&&_&&(C(D,_),E(!1))},[D,_,C]),M=r(()=>{A?O("close"):n()},[A,n]),z=r(()=>{A?O("cancel"):F()},[A,F]),B=r(()=>{const e=$;O(null),"close"===e?(F(),n()):F()},[$,F,n]),X=r(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Ue(t)),E(!1))}},[D,x,u]),U=r(()=>{D&&N(!0)},[D]),V=r(async()=>{D&&(await u.remove(D.id),n())},[D,u,n]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const o=[],n=jt(e,t),i=n.map(e=>({name:e.key,value:e.value})),a=Be(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:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Ie(h,a,i))return;const{type:g}=Ne(u,{type:""}),f=d||"password"===g;if(m?.length)m.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(p===Ee.MultiInput){const t=Ne(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(p===Ee.KeyValuePair){const t=Ne(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})(D,P);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:_a,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ia,color:d.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:z},...y?.option.testConnectionSupported&&!p?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:be.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:X}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t(Xs,{ref:T,isEdit:!0}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!p&&t(Ut,{conditions:D.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:xp(D)})]}),!!G.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.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(Cr,{target:"destination",isOpen:I,onClose:()=>N(!1),onApprove:V}),t(yr,{isOpen:null!==$,onClose:()=>O(null),onApprove:B})]})},Tp=(e,t)=>{const o=[{id:"type",title:et.TYPE,label:t.label},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}];return e.ruleName&&o.push({id:"name",title:et.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:et.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:et.NOTES,label:e.notes}),o},kp=({onClose:n,ruleId:l})=>{const c=v(),{addNotification:d}=Yt(),{isVm:p}=S(),{instrumentationRulesApi:u}=Ll(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Ml();i(()=>{m()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=C&&!!y?.isFormDirty,N=a(()=>h?.find(e=>zt(e)===l),[l,h]),$=a(()=>kt.find(({type:e})=>e===N?.type)??null,[N?.type]);i(()=>{N&&f(N)},[N]);const O=r(()=>{if(N){if(!N.mutable)return void d({type:Fe.Warning,title:qt.FORBIDDEN,message:qt.CANNOT_EDIT_RULE,crdType:Et.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});x(!0)}},[N,d]),A=r(()=>{N&&(f(N),x(!1))},[N,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update(N.ruleId,t,N.type),x(!1))}},[N,b,u]),L=r(()=>{if(N){if(!N.mutable)return void d({type:Fe.Warning,title:qt.FORBIDDEN,message:qt.CANNOT_DELETE_RULE,crdType:Et.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});T(!0)}},[N,d]),F=r(async()=>{N&&(await u.remove(N.ruleId,N.type),n())},[N,u,n]);if(!N||!$)return null;const M=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(pe,{size:he.XS,children:`• ${Kt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(pe,{size:he.XS,children:`• ${Kt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[He.HeaderKeys]?.length&&e.headersCollection[He.HeaderKeys].forEach((e,o)=>{e&&n.push(t(pe,{size:he.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ke.Java]?.forEach((e,i)=>{const a=new We(e.className,e.methodName);if(a.Verify()){0===i&&n.push(t(pe,{size:he.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=a.toString();n.push(t(pe,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${i}-${e}`))}}),e.customInstrumentations[Ke.Golang]?.forEach((e,i)=>{const a=new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(a.Verify()){0===i&&n.push(t(pe,{size:he.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=a.toString();n.push(t(pe,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${i}-${e}`))}})),n})(N,c);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:Zt(N.type),title:$.label,onClose:R,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:_a,active:C,onClick:O},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ia,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:P}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:C&&g?t(Ys,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!p&&t(Ut,{conditions:N.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:Tp(N,$)})]}),!p&&t(rr,{readOnly:!0,scopes:N.sourceScopes??null}),!!M.length&&t(Xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:M})}),!!$.supportedLanguages.length&&t(Xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:t(me,{$gap:12,$wrap:"wrap",children:$.supportedLanguages.map(e=>t(Jt,{label:Je[e],leftIcon:Ze(e),flex:"0.5"},e))})})})]})})})}),t(Cr,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(yr,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})};var Ep;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Ep||(Ep={}));const Ip=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=Qt(),m=eo(!!o),g=a(()=>({title:l,icon:tl,withCopy:!0}),[l]),f=a(()=>{const e=[],t=to(c);t&&e.push(t);const o=to(d,ol,"health");o&&e.push(o);const n=to(p,nl,"health");return n&&e.push(n),e},[c,d,p]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Qa,label:Ft.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:et.NODE,label:r,withCopy:!0},{id:"age",title:et.AGE,label:s?h(s,{style:"short"}):et.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Xt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Np=b.div`
|
|
605
|
+
`,vp=({isTesting:o,error:n,result:i})=>{const l=v(),{CopyButton:r}=Ft(),s=a(()=>i?.checks.filter(e=>!e.passed)??[],[i]),c=!(o||!n&&(!i||i.success)),d=n?ot.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||ot.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=n||s.map(e=>e.message).filter(Boolean).join("\n");return t(ap,{children:t(lp,{children:o?t(rp,{children:t(sp,{children:t(wt,{withVisual:!0,withGradient:!0,title:ot.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:he.XS})})}):c?t(rp,{children:e(cp,{children:[t(dp,{children:t(Wa,{size:20,fill:l.v2.colors.black[500]})}),t(pe,{size:he.XS,weight:400,lineHeight:"20px",color:ue.Primary,children:ot.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(pe,{align:"center",size:he.XXXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:d}),p&&e(pp,{children:[t(up,{children:p}),t(r,{value:p,size:xt.XS})]})]})}):i?e(hp,{children:[t(Ze,{status:Fe.Success,label:ot.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Ga,fullWidth:!0}),(i.accountId||i.identity)&&e(mp,{children:[i.accountId&&e(gp,{children:[e(pe,{size:he.XXS,weight:500,color:ue.Secondary,children:[ot.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(pe,{size:he.XXS,weight:400,color:ue.Primary,children:i.accountId})]}),i.identity&&e(gp,{children:[e(pe,{size:he.XXS,weight:500,color:ue.Secondary,children:[ot.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(pe,{size:he.XXS,weight:400,color:ue.Primary,children:i.identity})]})]}),i.checks.length>0&&t(fp,{children:i.checks.map(o=>e(bp,{$passed:o.passed,children:[t(Ze,{status:o.passed?Fe.Success:Fe.Error,label:o.displayName,leftIcon:o.passed?Ga:Wa}),o.message&&t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:o.message}),!o.passed&&o.remediation&&t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Primary,children:o.remediation})]},o.name))})]}):t(rp,{children:t(pe,{size:he.XXS,weight:400,color:ue.Secondary,children:ot.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var yp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(yp||(yp={}));const Cp=yp.SelectProvider,Sp=yp.Validate,xp=({onClose:o,withOverlay:n,onCreateCloudConnector:i,onCreated:l})=>{const{providers:c,genericForm:d}=Zl(),[p,u]=s(Cp),[h,m]=s(!1),[g,f]=s(!1),[b,v]=s(void 0),[y,C]=s(void 0),[S,x]=s(void 0),w=d.isFormDirty,T=p===Cp,k=p===Sp,I=r(()=>{w&&!h?m(!0):(m(!1),o?.())},[w,h,o]),E=r(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>Cp?e-1:e)},[]),N=r(()=>{if(x(void 0),p===yp.SelectProvider){if(!d.formData.provider)return void x("Please select a cloud provider");if(!d.formData.permission)return void x("Please select a permission level")}u(e=>e<Sp?e+1:e)},[p,d.formData.provider,d.formData.permission]),$=r(async()=>{if(x(void 0),C(void 0),v(void 0),u(yp.Validate),!i)return;const{provider:e,permission:t,customCapabilities:o,awsAccountId:n,credentials:a,name:r}=d.formData,s=((e,t,o)=>{const n=ad(e),i=[];return n.forEach(e=>{const n=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case od.DiscoveryOnly:a=!0;break;case od.DiscoveryInstrumentation:a=!0,l=n;break;case od.Custom:{const t=o[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(c.find(t=>t.provider===e),t,o);f(!0);try{const t=await i({provider:e,displayName:r,credentials:a,expectedAccountId:n,capabilities:s});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[i,l,d.formData,c]),O=g,A=k&&!g&&(!!y||!!b&&!b.success),R=a(()=>S?{status:Fe.Error,message:S}:void 0,[S]),D=a(()=>T?{"data-id":"cloud-connector-cancel",label:zt.CANCEL,variant:be.Secondary,onClick:I,disabled:O}:{"data-id":"cloud-connector-back",label:zt.BACK,variant:be.Text,leftIcon:tl,onClick:E,disabled:O},[T,I,E,O]),_=a(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:zt.RETRY,variant:be.Primary,rightIcon:nl,onClick:$}:void 0}return p===yp.Config?{"data-id":"cloud-connector-verify",label:zt.VERIFY_AND_CREATE_CONNECTOR,variant:be.Primary,onClick:$,disabled:O}:{"data-id":"cloud-connector-next",label:zt.NEXT,variant:be.Primary,onClick:N,disabled:O}},[k,g,A,p,$,N,O]),P=a(()=>[D,_].filter(Boolean),[D,_]);return e(ce,{width:xr,isOpen:!0,hideOverlay:!O&&!n,header:{icon:Za,title:ot.CREATE_CLOUD_CONNECTOR,onClose:o?I:void 0,onCloseDisabled:O},footer:{note:R,actions:P},children:[p===yp.SelectProvider&&t(kd,{}),p===yp.Config&&t(ip,{onBack:E}),p===yp.Validate&&t(vp,{isTesting:g,error:y,result:b}),t(wr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>o?.()})]})},wp=(e,t)=>{const o=[{id:"type",title:ot.TYPE,label:t.label},{id:"status",title:ot.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?ot.DISABLED:ot.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:ot.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:ot.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:ot.NOTES,label:e.notes}),o},Tp=({onClose:n,actionId:l})=>{const c=v(),{isVm:d}=S(),{actionsApi:p}=Bl(),{items:u,refetch:h}=p.useActions(),{options:m}=p.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:b,genericForm:y}=zl();i(()=>{h()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,I]=s(null),E=C&&!!y?.isFormDirty,N=a(()=>u?.find(e=>Xt(e)===l),[l,u]),$=a(()=>m.find(({type:e})=>e===N?.type)??Ut.find(({type:e})=>e===N?.type)??null,[m,N?.type]);i(()=>{N&&f(N,$)},[N,$]);const O=r(()=>{N&&x(!0)},[N]),A=r(()=>{N&&(f(N,$),x(!1))},[N,$,f]),R=r(()=>{E?I("close"):n()},[E,n]),D=r(()=>{E?I("cancel"):A()},[E,A]),_=r(()=>{const e=k;I(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await p.update(N.id,t),x(!1))}},[N,b,p]),L=r(()=>{N&&T(!0)},[N]),F=r(async()=>{N&&(await p.remove(N.id,N.type),n())},[N,p,n]);if(!N||!$)return null;const M=(e=>{const t=[],{type:o,fields:n}=e,i=e=>({status:e?Fe.Success:Fe.Unknown,label:e?"True":"False",invertColors:!0});if(o===Ae.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:i(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:i(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:i(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:i(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.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:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.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===Ae.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:i(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===Ae.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===Ae.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:i,regex:a},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}),i&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:i}),a&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:a})})}return o===Ae.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const i=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${i}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,a)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${a}`,title:`${i}Workload${(e.workloadFilters?.length??0)>1?` #${a+1}`:""}`,label:l})});const a=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");a&&t.push({id:`group-${o}-templates`,title:`${i}Templates`,label:a}),e.notes&&t.push({id:`group-${o}-notes`,title:`${i}Notes`,label:e.notes})}),t})(N);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:jt(N.type),title:$.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:zt.EDIT,icon:Ma,active:C,onClick:O},{id:"edit-action-btn-delete",label:zt.DELETE,icon:Aa,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-action-btn-cancel",label:zt.CANCEL,variant:be.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:zt.SAVE,variant:be.Primary,onClick:P}]:[]},children:t(ft,{$padding:"4px 12px 12px",children:C&&g?t(Us,{}):t(ee,{$gap:16,children:e(Vt,{bgTint:"1000",children:[e(Vt,{bgTint:"900",children:[!d&&t(Ht,{conditions:N.conditions||[]}),t(Vt,{bgTint:"800",cellsPerRow:2,items:wp(N,$)})]}),!!M?.length&&t(Vt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Vt,{bgTint:"800",cellsPerRow:2,items:M})})]})})})}),t(Tr,{target:"action",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(wr,{isOpen:null!==k,onClose:()=>I(null),onApprove:_})]})},kp=({onClose:o,connections:n,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=Bl(),[p,u]=s(""),[h,m]=s({showOnlySelected:!1}),g=a(()=>n.filter(e=>{const t=!p||e.name.toLowerCase().includes(p.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&o}),[n.length,r.length,p,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Gt(C||{rollout:{automaticRolloutDisabled:!1}}),k=l(T);k.current=T,i(()=>{C&&k.current(C)},[C]);const I=a(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(Sr,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:il,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:p,onChange:u},filters:e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(le,{size:Ot.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(pe,{size:he.XS,children:"Clusters"}),t(Ze,{label:g.length,status:Fe.Unknown})]}),e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,align:"right",children:"Selected clusters"}),t(Ze,{label:`${r.length}/${g.length}`,status:Fe.Unknown})]})]}),list:g.map(e=>t(mc,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(pe,{size:he.XS,children:"Configurations"}),list:[t(le,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Ip=e=>{const t=[{id:"type",title:ot.TYPE,label:e.destinationType.displayName},{id:"status",title:ot.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?ot.DISABLED:ot.ENABLED}}],o=Be(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:ot.MONITORS,label:o}),e.name&&t.push({id:"name",title:ot.NAME,label:e.name}),t},Ep=({onClose:n,destinationId:c})=>{const d=v(),{isVm:p}=S(),{destinationsApi:u}=Bl(),{selectedStreamName:h}=nt(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Xl();i(()=>{g()},[]);const T=l(null),[k,I]=s(!1),[E,N]=s(!1),[$,O]=s(null),A=k&&!!w?.isFormDirty,R=a(()=>Kt(m,h),[m,h]),D=a(()=>R?.find(e=>Xt(e)===c),[c,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&C(D,_)},[D,_]);const P=a(()=>D&&_?Yt(_,D):[],[D,_]),L=r(()=>{D&&I(!0)},[D]),F=r(()=>{D&&_&&(C(D,_),I(!1))},[D,_,C]),M=r(()=>{A?O("close"):n()},[A,n]),z=r(()=>{A?O("cancel"):F()},[A,F]),B=r(()=>{const e=$;O(null),"close"===e?(F(),n()):F()},[$,F,n]),X=r(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Ue(t)),I(!1))}},[D,x,u]),U=r(()=>{D&&N(!0)},[D]),V=r(async()=>{D&&(await u.remove(D.id),n())},[D,u,n]);if(!D)return null;const{icon:H,iconSrc:j}=kt(D.destinationType.type),G=((e,t)=>{const o=[],n=Wt(e,t),i=n.map(e=>({name:e.key,value:e.value})),a=Be(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:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Ee(h,a,i))return;const{type:g}=Ne(u,{type:""}),f=d||"password"===g;if(m?.length)m.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(p===Ie.MultiInput){const t=Ne(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(p===Ie.KeyValuePair){const t=Ne(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})(D,P);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:zt.EDIT,icon:Ma,active:k,onClick:L},{id:"edit-destination-btn-delete",label:zt.DELETE,icon:Aa,color:d.v2.colors.red[500],active:E,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:zt.CANCEL,variant:be.Secondary,onClick:z},...y?.option.testConnectionSupported&&!p?[{"data-id":"edit-destination-btn-test-connection",label:zt.TEST_CONNECTION,variant:be.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:zt.SAVE,variant:be.Primary,onClick:X}]:[]},children:t(ft,{$padding:"4px 12px 12px",children:b?t(vt,{$height:"50vh",children:t(wt,{withSpinner:!0})}):k&&y?t(js,{ref:T,isEdit:!0}):t(ee,{$gap:16,children:e(Vt,{bgTint:"1000",children:[e(Vt,{bgTint:"900",children:[!p&&t(Ht,{conditions:D.conditions||[]}),t(Vt,{bgTint:"800",cellsPerRow:2,items:Ip(D)})]}),!!G.length&&t(Vt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Vt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Vt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Tr,{target:"destination",isOpen:E,onClose:()=>N(!1),onApprove:V}),t(wr,{isOpen:null!==$,onClose:()=>O(null),onApprove:B})]})},Np=(e,t)=>{const o=[{id:"type",title:ot.TYPE,label:t.label},{id:"status",title:ot.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?ot.DISABLED:ot.ENABLED}}];return e.ruleName&&o.push({id:"name",title:ot.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:ot.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:ot.NOTES,label:e.notes}),o},$p=({onClose:n,ruleId:l})=>{const c=v(),{addNotification:d}=Jt(),{isVm:p}=S(),{instrumentationRulesApi:u}=Bl(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Ul();i(()=>{m()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,I]=s(null),E=C&&!!y?.isFormDirty,{options:N}=u.useRuleTypes(),$=a(()=>N.length?N:Et,[N]),O=a(()=>h?.find(e=>Xt(e)===l),[l,h]),A=a(()=>$.find(({type:e})=>e===O?.type)??null,[$,O?.type]),R=a(()=>qe(A?.supportedLanguages),[A?.supportedLanguages]);i(()=>{O&&A&&f(O,A)},[O,A]);const D=r(()=>{if(O){if(!O.mutable)return void d({type:Fe.Warning,title:Zt.FORBIDDEN,message:Zt.CANNOT_EDIT_RULE,crdType:Nt.InstrumentationRule,target:O.ruleId,hideFromHistory:!0});x(!0)}},[O,d]),_=r(()=>{O&&A&&(f(O,A),x(!1))},[O,A,f]),P=r(()=>{E?I("close"):n()},[E,n]),L=r(()=>{E?I("cancel"):_()},[E,_]),F=r(()=>{const e=k;I(null),"close"===e?(_(),n()):_()},[k,_,n]),M=r(async()=>{if(O){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update(O.ruleId,t,O.type),x(!1))}},[O,b,u]),z=r(()=>{if(O){if(!O.mutable)return void d({type:Fe.Warning,title:Zt.FORBIDDEN,message:Zt.CANNOT_DELETE_RULE,crdType:Nt.InstrumentationRule,target:O.ruleId,hideFromHistory:!0});T(!0)}},[O,d]),B=r(async()=>{O&&(await u.remove(O.ruleId,O.type),n())},[O,u,n]);if(!O||!A)return null;const X=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(pe,{size:he.XS,children:`• ${qt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(pe,{size:he.XS,children:`• ${qt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[He.HeaderKeys]?.length&&e.headersCollection[He.HeaderKeys].forEach((e,o)=>{e&&n.push(t(pe,{size:he.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ke.Java]?.forEach((e,i)=>{const a=new We(e.className,e.methodName);if(a.Verify()){0===i&&n.push(t(pe,{size:he.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=a.toString();n.push(t(pe,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${i}-${e}`))}}),e.customInstrumentations[Ke.Golang]?.forEach((e,i)=>{const a=new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(a.Verify()){0===i&&n.push(t(pe,{size:he.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=a.toString();n.push(t(pe,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${i}-${e}`))}})),n})(O,c);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:eo(O.type),title:A.label,onClose:P,actions:[{id:"edit-rule-btn-edit",label:zt.EDIT,icon:Ma,active:C,onClick:D},{id:"edit-rule-btn-delete",label:zt.DELETE,icon:Aa,color:c.v2.colors.red[500],active:w,onClick:z}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:zt.CANCEL,variant:be.Secondary,onClick:L},{"data-id":"edit-rule-btn-save",label:zt.SAVE,variant:be.Primary,onClick:M}]:[]},children:t(ft,{$padding:"4px 12px 12px",children:C&&g?t(Qs,{}):t(ee,{$gap:16,children:e(Vt,{bgTint:"1000",children:[e(Vt,{bgTint:"900",children:[!p&&t(Ht,{conditions:O.conditions||[]}),t(Vt,{bgTint:"800",cellsPerRow:2,items:Np(O,A)})]}),!p&&t(pr,{readOnly:!0,scopes:O.sourceScopes??null}),!!X.length&&t(Vt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Vt,{bgTint:"800",children:X})}),!!R.length&&t(Vt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Vt,{bgTint:"800",children:t(me,{$gap:12,$wrap:"wrap",children:R.map(e=>t(Qt,{label:et(e),leftIcon:Qe(e),flex:R.length>1?"0.5":"1"},e))})})})]})})})}),t(Tr,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:B}),t(wr,{isOpen:null!==k,onClose:()=>I(null),onApprove:F})]})};var Op;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Op||(Op={}));const Ap=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=to(),m=oo(!!o),g=a(()=>({title:l,icon:al,withCopy:!0}),[l]),f=a(()=>{const e=[],t=no(c);t&&e.push(t);const o=no(d,ll,"health");o&&e.push(o);const n=no(p,rl,"health");return n&&e.push(n),e},[c,d,p]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:nl,label:zt.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:ot.NODE,label:r,withCopy:!0},{id:"age",title:ot.AGE,label:s?h(s,{style:"short"}):ot.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Vt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Rp=b.div`
|
|
606
606
|
display: flex;
|
|
607
607
|
align-items: center;
|
|
608
608
|
justify-content: space-between;
|
|
@@ -610,7 +610,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
610
610
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
611
611
|
border-radius: 12px;
|
|
612
612
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
613
|
-
|
|
613
|
+
`,Dp=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=lo(o?.status),r=qt(o?.name),s=o?.message,{totalPodsCount:c,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===io.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===io.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Rp,{$noPadding:i,children:[t(ao,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(me,{$gap:8,children:[t(Pp,{label:ot.PODS,count:c}),t(Pp,{label:ot.ODIGOS_HEALTHY,icon:ll,count:d,total:c}),t(Pp,{label:ot.KUBERNETES_HEALTHY,icon:rl,count:p,total:c})]})]}):null},_p=b.div`
|
|
614
614
|
display: flex;
|
|
615
615
|
flex-direction: column;
|
|
616
616
|
justify-content: center;
|
|
@@ -621,7 +621,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
621
621
|
width: fit-content;
|
|
622
622
|
border-radius: 8px;
|
|
623
623
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
624
|
-
`,
|
|
624
|
+
`,Pp=({count:o,total:n,label:i,icon:a})=>{const l=v(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(_p,{children:[e(me,{$gap:0,$alignItems:"flex-end",children:[t(pe,{size:he.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(pe,{size:he.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(me,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(pe,{size:he.XXXS,nowrap:!0,children:i})]})]})},Lp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===ro.PID)??e.identifyingAttributes?.find(({name:e})=>e===ro.VPID);return t?.value??null};var Fp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Fp||(Fp={}));const Mp=({overrideProcessNum:o,healthy:n,healthStatus:l,identifyingAttributes:r,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=s(Fp.IdentifyingAttributes),m=oo(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Fp.IdentifyingAttributes,label:ot.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:p.v2.colors.purple[500]},{value:Fp.InstrumentationLibraries,label:ot.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(sl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[r,c]);i(()=>{f&&h(f)},[f]);const y=a(()=>{switch(u){case Fp.IdentifyingAttributes:return t(ee,{children:r?.map((e,o)=>t(Vp,{label:e.name,value:e.value},`attr-${o}-${e.name}`))});case Fp.InstrumentationLibraries:return t(ee,{children:c?.map((e,o)=>t(Vp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))});default:return null}},[u,r,c]),C=a(()=>Lp({overrideProcessNum:o,identifyingAttributes:r}),[o,r]);return t("div",{ref:m,children:e(Vt,{bgTint:"800",richTitle:{title:C?`${ot.PROCESS} ${ot.PID(C)}`:ot.PROCESS_FALLBACK_NAME},renderOnRightSide:t(pe,{color:n?ue.Success:ue.Error,size:he.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:n?Fe.Success:Fe.Error,leftIcon:ll,label:n?ot.HEALTHY:ot.NOT_HEALTHY,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ve,{options:g,selected:u,setSelected:h}),!b&&y]})})},zp=b.div`
|
|
625
625
|
display: flex;
|
|
626
626
|
align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
|
|
627
627
|
gap: 8px;
|
|
@@ -630,23 +630,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
630
630
|
&:hover {
|
|
631
631
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
632
632
|
}
|
|
633
|
-
`,
|
|
633
|
+
`,Bp=b(pe)`
|
|
634
634
|
flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
|
|
635
|
-
`,
|
|
635
|
+
`,Xp=b(pe)`
|
|
636
636
|
flex: 1 1 auto;
|
|
637
637
|
min-width: 0;
|
|
638
|
-
`,
|
|
638
|
+
`,Up=b(me)`
|
|
639
639
|
flex: 1 1 auto;
|
|
640
640
|
justify-content: flex-end;
|
|
641
641
|
min-width: 0;
|
|
642
|
-
`,
|
|
642
|
+
`,Vp=({label:o,value:n,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(zp,{$withHealthBadge:r,children:[t(Bp,{size:he.XXS,color:ue.Secondary,$withHealthBadge:r,children:o}),n&&t(Xp,{size:he.XXS,color:ue.Primary,align:"right",children:n}),(i||r)&&e(Up,{children:[i&&t(Ze,{status:Fe.Info,label:ot.STANDARD,textSize:he.XXXS,invertColors:!0}),r&&e(me,{$gap:4,children:[l&&t(Xp,{size:he.XXXS,color:ue.Error,align:"right",children:l}),t(Ze,{status:a?Fe.Success:Fe.Error,label:a?ot.HEALTHY:ot.NOT_HEALTHY,leftIcon:ll,textSize:he.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},Hp=h(null),jp=({value:e,children:o})=>t(Hp.Provider,{value:e,children:o}),Gp=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:ot.CONTAINERS,titleSize:he.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(Vt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(Kp,{...e,language:so(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},Wp=b.div`
|
|
643
643
|
display: flex;
|
|
644
644
|
flex-direction: column;
|
|
645
645
|
gap: 12px;
|
|
646
646
|
padding: 8px 12px;
|
|
647
647
|
border-radius: 8px;
|
|
648
648
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
649
|
-
`,
|
|
649
|
+
`,Kp=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=to(),C=oo(v),S=a(()=>({title:n,icon:o?co(o):cl,iconWithWrapper:!0}),[n,o]),x=a(()=>{const e=[],t=no({status:i?io.Success:io.Disabled,reasonEnum:i?ot.INSTRUMENTED_WITH_DISTRO(i):ot.UNINSTRUMENTED,message:""});t&&e.push(t);const o=no(h,ll,"health");o&&e.push(o);const n=no(m,rl,"health");return n&&e.push(n),e},[m,h,i]),w=a(()=>[{id:"runningTime",title:ot.RUNNING_TIME,label:l?y(l,{style:"short"}):ot.NOT_RUNNING,labelTooltip:`${ot.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Fe.Success:Fe.Disabled,leftIcon:r?_a:Pa,label:r?ot.STARTED:ot.NOT_STARTED,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Fe.Success:Fe.Disabled,leftIcon:s?_a:Pa,label:s?ot.READY:ot.NOT_READY,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Fe.Error:Fe.Success,leftIcon:d?Pa:_a,label:d?ot.CRASHLOOP:ot.NO_CRASHLOOP,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:ot.RESTARTS,badge:{status:c?Fe.Error:void 0,label:c||0,textSize:he.XXXS}}],[l,y,r,s,d,c]),T=a(()=>u?qt(p):"",[u,p]);return t("div",{ref:C,children:e(Vt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Wp,{children:e(me,{$gap:10,$alignItems:"center",children:[t(Qt,{variant:po.Pink,leftIcon:rl,label:T}),t(pe,{size:he.XXXS,color:ue.Error,children:u})]})}),(g??[]).map((e,o)=>{const i=o+1,a=b&&(l=f,r=e,!!l?.processPid&&Lp({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Mp,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${n}-process-${i}`)})]})})},Yp=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:ot.DEBUG_COMMANDS,titleSize:he.XS}),[]),l=a(()=>[{label:ot.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:ot.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:ot.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(Vt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(uo,{bgTint:"700",label:e,value:o},e))})},qp=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=m(Hp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===Op.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]),p=a(()=>({title:ot.PODS,badge:{label:s.length}}),[s.length]);return t(ee,{$gap:12,children:c?e(o,{children:[t(Dp,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(Vt,{bgTint:"1000",richTitle:p,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(Ap,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(Yp,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(Gp,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(vt,{$height:"70vh",children:t(Re,{title:ot.NO_RUNNING_PODS,subTitle:ot.NO_RUNNING_PODS_SUBTITLE})})})},Jp="user",Zp=({source:o})=>{const n=a(()=>o.serviceName||o.id.name,[o]),{sourcesApi:i}=Bl(),{data:l,loading:r,refetch:s}=i.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(vt,r?{$height:"70vh",children:t(wt,{withSpinner:!0})}:{$height:"70vh",children:t(Re,{subTitle:ot.COULD_NOT_FETCH_PEER_SOURCES})}):e(me,{$gap:16,$alignItems:"flex-start",children:[t(Qp,{icon:dl,title:ot.INBOUND,subTitle:ot.INBOUND_DESCRIPTION(n),onRefresh:s,items:c?.inbound??[]}),t(Qp,{icon:pl,title:ot.OUTBOUND,subTitle:ot.OUTBOUND_DESCRIPTION(n),onRefresh:s,items:c?.outbound??[]})]})},Qp=({icon:o,title:n,subTitle:i,onRefresh:l,items:r})=>{const[c,d]=s(""),p=a(()=>r.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[r,c]);return e(Vt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:he.XS,subTitle:i,subTitleSize:he.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:ho.Button,buttonProps:{variant:be.Secondary,size:fe.S,leftIcon:nl,onClick:l}}],children:[t(mo,{value:c,onChange:d,width:"100%"}),t(go,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(vt,{$height:"50vh",children:t(Re,{icon:o,title:ot.NO_RESULTS,subTitle:ot.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(tu,{...e},`${n}-${e.serviceName}`)):[t(vt,{$height:"50vh",children:t(Re,{icon:o,title:`No ${n} connections yet`,subTitle:n===ot.INBOUND?ot.NO_INBOUND_CONNECTIONS_DESCRIPTION:ot.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},eu=b.div`
|
|
650
650
|
display: flex;
|
|
651
651
|
align-items: center;
|
|
652
652
|
justify-content: space-between;
|
|
@@ -660,9 +660,22 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
660
660
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
661
661
|
}
|
|
662
662
|
`}
|
|
663
|
-
`,
|
|
663
|
+
`,tu=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=fo(e=>e.drawerEntityId),{items:r}=Bl().sourcesApi.useSources(),s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(bo(s))!==JSON.stringify(bo(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[vo({serviceName:o,attributes:e})]}if(o?.toLowerCase()===Jp)return[ul];const e=s?yo(s):void 0;return e?.length?e:[cl]},[n,i,o,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=fo.getState();e(So(Nt.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(eu,{onClick:p,$withClick:!!p,children:[e(me,{$gap:8,children:[t(Co,{icons:d}),t(pe,{size:he.XXS,children:o})]}),n&&t(Ze,{status:Fe.Info,label:ot.VIRTUAL,textSize:he.XXXS,invertColors:!0,tooltip:ot.VIRTUAL_TOOLTIP})]})},ou=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},nu=({source:o})=>{const n=v(),{k8sManifestApi:l}=Bl(),[r,c]=s(!0),[d,p]=s(void 0),[u,h]=s(!0),[m,g]=s(void 0);i(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>p(ou(e))).finally(()=>c(!1)),l.fetch({namespace:o.id.namespace,kind:xo.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>g(ou(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const f=a(()=>[{label:ot.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:ot.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:ot.GET_POD_YAML,value:`kubectl get ${xo.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(Vt,{bgTint:"1000",children:[t(Vt,{bgTint:"900",richTitle:{icon:hl,title:ot.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:f.map(({label:e,value:o},n)=>t(uo,{label:e,value:o},`debug-cmd-${n}-${e}`))}),r?t(bt,{size:1}):t(kr,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),u?t(bt,{size:1}):t(kr,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},iu=({title:o,children:n})=>e(ee,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,children:o}),n]}),au=({source:o})=>{const n=a(()=>{const[e,t]=To(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(iu,{title:ot.THROUGHPUT_LAST_10_SECONDS,children:e(me,{$alignItems:"flex-end",$gap:4,children:[t(pe,{size:he.L,children:n.value}),t(pe,{size:he.XS,variant:At.Span,children:n.units})]})})},lu=({source:o})=>{const{CopyButton:n}=Ft();return t(iu,{title:ot.NAMESPACE,children:e(me,{children:[t(Qt,{variant:po.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:xt.XS})]})})},ru=({source:o})=>{const{CopyButton:n}=Ft(),i=o.id.region;return i?t(iu,{title:ot.REGION,children:e(me,{children:[t(Qt,{variant:po.Blue,label:i}),t(n,{value:i,size:xt.XS})]})}):null},su=({source:e})=>{const o=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(iu,{title:ot.ENABLED,children:t(me,{children:t(Qt,{variant:o?po.Green:po.Default,label:o?ot.ENABLED:ot.DISABLED})})})},cu=({source:e,label:o})=>t(iu,{title:ot.KIND,children:t(me,{children:t(Qt,{variant:po.Blue,label:o||e.id.kind})})}),du=({source:o})=>{const{CopyButton:n}=Ft();return t(iu,{title:ot.NAME,children:e(me,{children:[t(Qt,{variant:po.Blue,label:o.id.name}),t(n,{value:o.id.name,size:xt.XS})]})})},pu=({source:o})=>{const{CopyButton:n}=Ft(),i=o.serviceName||o.id.name;return t(iu,{title:ot.SERVICE_NAME,children:e(me,{children:[t(Qt,{variant:po.Blue,label:i}),t(n,{value:i,size:xt.XS})]})})},uu=({source:o})=>{const{isVm:n,isConnector:i,isK8s:l}=S(),r=a(()=>wo(o.id.kind),[o.id.kind]);return t(Vt,{children:e(me,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[l&&t(au,{source:o}),l&&t(lu,{source:o}),i&&t(ru,{source:o}),i&&t(su,{source:o}),t(cu,{source:o,label:r}),t(du,{source:o}),(i||n)&&t(pu,{source:o})]})})},hu=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Vt,{bgTint:"900",children:t(Dp,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,mu=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?ko(e.workloadOdigosHealthStatus.status):Fe.Unknown,title:qt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(ao,{...o,width:"100%"}):null},gu="100%",fu=b(me)`
|
|
664
|
+
@media (max-width: 1099px) {
|
|
665
|
+
flex-direction: column;
|
|
666
|
+
|
|
667
|
+
& > * {
|
|
668
|
+
width: 100%;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
`,bu=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?qt(e):`${t} ${qt(e)}`:t,vu=b(me)`
|
|
672
|
+
width: fit-content;
|
|
673
|
+
padding: 2px 6px;
|
|
674
|
+
border-radius: 8px;
|
|
675
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
676
|
+
`,yu=({overview:o,status:n})=>{const i=v(),a=o?[{id:"applied",count:o.totalAgentAppliedPods,ok:o.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:o.totalAgentOutOfDatePods,ok:o.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:o.totalAgentNotAppliedPods,ok:o.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return a.length?t(vu,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Fe.Success:n,d=Eo(c,i);return e(me,{$gap:2,children:[t(d,{size:16,fill:Io(i,c,"300")}),t(pe,{size:he.XXXS,color:ue.Secondary,children:`${l}/${o?.totalPods??0} ${s}`})]},a)})}):null},Cu=({changedTime:e})=>{const{formatTimeAgo:o}=to();return t(pe,{size:he.XXXS,color:ue.Disable,nowrap:!0,children:`Agent Assignment Updated · ${o(e)}`})},Su=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=o.rollout?.podsManifestInjectionStatus??o.conditions?.rollout,r=a(()=>{const{status:e,reasonEnum:i,message:a,actionItems:r}=l||{},s=lo(e);if(!s)return null;const c=bu(i,ot.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:ml,onClick:n}]);return{status:s,title:c,subTitle:d,details:t(yu,{overview:o.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:o.rollout?.agentsMetaHashChangedTime?t(Cu,{changedTime:o.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[o.rollout,l,n]),s=a(()=>{const{status:e,reasonEnum:t,message:n,actionItems:a}=o.autoRollback?.autoRollbackStatus||{},l=lo(e);if(!l)return null;const r=bu(t,ot.ROLLBACK),s=n,c=(a??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:nl,onClick:i}]);return c.length||l===Fe.Success||c.push({"data-id":"rollback-action",label:ot.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:nl,onClick:i}),{status:l,title:r,subTitle:s,actionButtons:c}},[o,i]);return r||s?e(fu,{$gap:12,$alignItems:"stretch",children:[r&&t(ao,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":gu,...r}),s&&t(ao,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":gu,...s})]}):null},xu=h(null),wu=b.div`
|
|
664
677
|
position: relative;
|
|
665
|
-
`,
|
|
678
|
+
`,Tu=({children:e})=>{const o=l(null);return t(wu,{ref:o,children:t(xu.Provider,{value:o,children:e})})},ku=b.div`
|
|
666
679
|
position: fixed;
|
|
667
680
|
top: ${({$coords:e})=>e.top}px;
|
|
668
681
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -676,14 +689,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
676
689
|
padding: 12px 16px;
|
|
677
690
|
border-radius: 12px;
|
|
678
691
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
679
|
-
`,
|
|
692
|
+
`,Iu=b.div`
|
|
680
693
|
display: flex;
|
|
681
694
|
align-items: flex-end;
|
|
682
695
|
justify-content: space-between;
|
|
683
696
|
gap: 8px;
|
|
684
|
-
`,
|
|
697
|
+
`,Eu=b.div`
|
|
685
698
|
flex: 1;
|
|
686
|
-
`,
|
|
699
|
+
`,Nu=({width:o,onClose:n,onSave:i,saveTooltip:a,onDelete:l,deleteTooltip:r,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(xu),[y,C]=s(null);return No(b??{current:null},n),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?$r(e(ku,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(ee,{$gap:4,children:[t(pe,{size:he.XXS,children:c}),t(pe,{size:he.XXXS,color:ue.Secondary,children:d})]}),e(Iu,{children:[t(Eu,{children:u}),e(me,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(ge,{variant:be.Secondary,onClick:l,leftIcon:Aa,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:fe.S,textColor:f.v2.colors.red[500]}),t(ge,{variant:be.Primary,onClick:i,leftIcon:Ga,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:fe.S})]})]}),t("div",{children:t(Le,{status:Fe.Warning,message:p})})]}),document.body):null},$u=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:r}=S(),{formData:c,handleFormChange:d,resetFormData:p}=Gt(l),u=a(()=>{if(!o)return[];const e=$o[o].community,t=r===$t.Onprem?$o[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,r]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(me,{$gap:4,$alignItems:"center",children:[n?t(Ze,{status:Fe.Info,invertColors:!0,label:ot.OVERIDDEN}):null,e(Tu,{children:[t($e,{text:ot.OVERRIDE_OTEL_DISTRO_NAME,children:t(St,{icon:Ma,onClick:b})}),g&&t(Nu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(c),m(!1),b()},saveTooltip:ot.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:ot.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:ot.OVERRIDE_OTEL_DISTRO_NAME,subTitle:ot.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:ot.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(Ct,{label:ot.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Ou=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:r}=Jt(),{formData:c,handleFormChange:d,resetFormData:p}=Gt(i),u=a(()=>Oo.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(me,{children:[o?t(Ze,{status:Fe.Info,invertColors:!0,label:ot.OVERIDDEN}):null,e(Tu,{children:[t($e,{text:ot.OVERRIDE_RUNTIME_DETAILS,children:t(St,{icon:Ma,onClick:b})}),g&&t(Nu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Ao(c.version)?(m(!0),await n(c),m(!1),b()):r({type:Fe.Warning,message:Zt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:ot.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:ot.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:ot.OVERRIDE_RUNTIME_DETAILS,subTitle:ot.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:ot.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(me,{$gap:8,children:[t(Ct,{label:ot.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(Te,{label:ot.RUNTIME_VERSION,placeholder:ot.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Au=({source:e})=>{const{isVm:o}=S(),{containers:n,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?ot.DETECTED_PROCESSES:`${e.id.kind} ${ot.CONTAINERS}`,tooltip:t?.message||(o?ot.DETECTED_PROCESSES_DESCRIPTION:ot.DETECTED_CONTAINERS_DESCRIPTION),badge:lo(t?.status)===Fe.Loading?{status:Fe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(Vt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:n.map(o=>o&&t(Pu,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},Ru=b.div`
|
|
687
700
|
display: flex;
|
|
688
701
|
flex-direction: column;
|
|
689
702
|
align-self: stretch;
|
|
@@ -691,32 +704,32 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
691
704
|
padding: 8px 12px;
|
|
692
705
|
border-radius: 8px;
|
|
693
706
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
694
|
-
`,
|
|
707
|
+
`,Du=b.div`
|
|
695
708
|
display: flex;
|
|
696
709
|
align-items: center;
|
|
697
710
|
justify-content: center;
|
|
698
711
|
padding: 8px;
|
|
699
712
|
border-radius: 10px;
|
|
700
713
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
701
|
-
`,
|
|
714
|
+
`,_u=b.div`
|
|
702
715
|
display: flex;
|
|
703
716
|
flex-direction: column;
|
|
704
717
|
gap: 12px;
|
|
705
718
|
padding: 8px 12px;
|
|
706
719
|
border-radius: 8px;
|
|
707
720
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
708
|
-
`,
|
|
721
|
+
`,Pu=({sourceId:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=v(),{sourcesApi:d}=Bl(),p=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=a(()=>({language:so(n),version:Ro(n)||void 0}),[n]),h=a(()=>!!s?.otelDistroName,[s]),m=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!p,[l,p]),f=a(()=>g?cl:co(u.language),[g,u]),b=a(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),y=a(()=>g?{status:Fe.Loading,label:ot.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Fe.Success:Fe.Disabled,leftIcon:r?.otelDistroName?_a:Pa,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(o,{containerName:i,...h?m:{},...p?u:{},...e}),S=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(ot.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(ot.TAIL_SAMPLING),e},[n]);return e(Ru,{children:[e(me,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(me,{$gap:8,$alignItems:"center",children:[t(Du,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(pe,{children:i}),t(Qt,b?{variant:po.Blue,label:b}:{variant:po.Loader,label:ot.DETECTING_RUNTIME_INFO}),t(Ou,{overridden:p,onOverride:C,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(me,{$gap:8,$alignItems:"center",children:[t(Ze,{...y,textSize:he.XXXS}),t($u,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(_u,{children:e(me,{$gap:10,$alignItems:"center",children:[t(Qt,{variant:po.Pink,label:qt(r.agentEnabledStatus?.reasonEnum)||ot.NO_AVAILABLE_AGENT}),t(pe,{size:he.XXXS,color:ue.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(_u,{children:t(me,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(Ze,{label:e,leftIcon:_a,status:Fe.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${o}`))})})]})},Lu=b.div`
|
|
709
722
|
display: flex;
|
|
710
723
|
flex-direction: column;
|
|
711
724
|
gap: 10px;
|
|
712
725
|
padding: 10px 12px 10px 20px;
|
|
713
726
|
border-radius: 8px;
|
|
714
727
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
715
|
-
|
|
728
|
+
`,Fu=b.div`
|
|
716
729
|
display: flex;
|
|
717
730
|
flex-wrap: wrap;
|
|
718
731
|
gap: 12px 24px;
|
|
719
|
-
`,
|
|
732
|
+
`,Mu=({title:o,children:n})=>e(ee,{$gap:4,children:[t(pe,{size:he.XXXS,color:ue.Secondary,children:o}),n]}),zu=({processes:o})=>{const n=a(()=>[...o].sort((e,t)=>e.pid-t.pid),[o]);return n.length?e(ee,{$gap:6,children:[t(pe,{size:he.XXXS,color:ue.Secondary,children:`${ot.PROCESSES} (${n.length})`}),n.map(o=>{const n=o.exe?.trim()||null,i=o.cmdline?.trim()||null;return e(Lu,{children:[t(Fu,{children:t(Mu,{title:ot.PROCESS_PID,children:t(pe,{size:he.XS,children:String(o.pid)})})}),n?t(uo,{label:ot.EXECUTABLE,value:n,bgTint:"900"}):null,i&&i!==n?t(uo,{label:ot.COMMAND,value:i,bgTint:"900"}):null]},o.pid)})]}):null},Bu=b.div`
|
|
720
733
|
display: flex;
|
|
721
734
|
flex-direction: column;
|
|
722
735
|
align-self: stretch;
|
|
@@ -724,19 +737,19 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
724
737
|
padding: 8px 12px;
|
|
725
738
|
border-radius: 8px;
|
|
726
739
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
727
|
-
`,
|
|
740
|
+
`,Xu=b.div`
|
|
728
741
|
display: flex;
|
|
729
742
|
align-items: center;
|
|
730
743
|
justify-content: center;
|
|
731
744
|
padding: 8px;
|
|
732
745
|
border-radius: 10px;
|
|
733
746
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
734
|
-
`,
|
|
747
|
+
`,Uu=e=>{if(!e)return Do.Unknown;const t=e.trim().toLowerCase();return{go:Do.Go,golang:Do.Go,javascript:Do.JavaScript,js:Do.JavaScript,node:Do.JavaScript,nodejs:Do.JavaScript,typescript:Do.JavaScript,python:Do.Python,java:Do.Java,dotnet:Do.DotNet,csharp:Do.CSharp,php:Do.Php,ruby:Do.Ruby,rust:Do.Rust,swift:Do.Swift,elixir:Do.Elixir}[t]??Do.Unknown},Vu=({source:o})=>{const n=v(),{isConnector:i,isVm:l}=S(),{sourcesApi:r}=Bl(),s=o.instrumentationReport,c=o.sourceConfig,d=l?s?.processes:null,p=a(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=a(()=>{const e=Uu(s?.runtimeLanguage);return e!==Do.Unknown?e:o.runtimeInfo?.detectedLanguages?.[0]??Do.Unknown},[s?.runtimeLanguage,o.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",m=a(()=>{const e=Uu(c?.runtimeOverride?.language);return{language:e!==Do.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||h||void 0}},[c,u,h]),g=a(()=>!!c?.distroOverride?.otelDistroName,[c]),f=a(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),b=a(()=>{const{language:e,version:t}=m;return e!==Do.Unknown||t?e!==Do.Unknown&&t?`${e} • ${t}`:e!==Do.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===s?.state,C=a(()=>y||m.language===Do.Unknown?cl:co(m.language),[y,m.language]),x=a(()=>{const e=s?.state??"",t=s?.instrumented||"Instrumented"===e,o=c?.distroOverride?.otelDistroName?.trim()||s?.sdkType?.trim();return"Instrumenting"===e?{status:Fe.Loading,label:qt(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Fe.Disabled,leftIcon:Pa,label:qt(e)||e}:"Error"===e?{status:Fe.Error,leftIcon:Pa,label:"Error"}:t?{status:Fe.Success,leftIcon:_a,label:o?`Instrumented | ${o}`:"Instrumented"}:{status:Fe.Disabled,leftIcon:Pa,label:ot.UNINSTRUMENTED}},[s,c]),w=e=>r.update(o.id,{...g?f:{},...p?{language:m.language!==Do.Unknown?m.language:void 0,version:m.version}:{},...e});return(i||l)&&s?t(Vt,{bgTint:"1000",richTitle:{title:ot.INSTRUMENTATION,tooltip:ot.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:e(Bu,{children:[e(me,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(me,{$gap:8,$alignItems:"center",children:[t(Xu,{children:t(C,{size:24,fill:y||m.language===Do.Unknown?n.v2.colors.grey[400]:void 0})}),t(pe,{children:o.id.name}),y?t(Qt,{variant:po.Loader,label:ot.DETECTING_RUNTIME_INFO}):b?t(Qt,{variant:po.Blue,label:b}):null,t(Ou,{overridden:p,onOverride:w,defaultValues:{language:m.language!==Do.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==Do.Unknown?u:void 0,version:h}})]}),e(me,{$gap:8,$alignItems:"center",children:[t(Ze,{...x,textSize:he.XXXS}),t($u,{language:m.language!==Do.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(zu,{processes:d}):null]})})}):null},Hu=({source:o,onClickRollout:n,onClickRollback:i})=>{const{isK8s:a,isConnector:l,isVm:r}=S();return e(ee,{$gap:12,children:[t(uu,{source:o}),t(mu,{source:o}),a&&t(Su,{source:o,onClickRollout:n,onClickRollback:i}),a&&t(Au,{source:o}),(l||r)&&t(Vu,{source:o}),a&&t(hu,{source:o})]})},ju=({source:e})=>{const o=e.containers||[];return t(Vt,{bgTint:"1000",richTitle:{title:ot.INSTRUMENTED_LIBRARIES},children:o.length?o.map(e=>{const o=e.instrumentations||[];return t(Vt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:o.length}},withCollapse:!0,collapseIsDefaultOpen:!!o?.length,children:o?.length?t(ee,{children:o.map((e,o)=>t(Vp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))}):t(Re,{title:"No libraries found"})},e.containerName)}):t(Re,{title:"No containers found"})})},Gu=b(ee)`
|
|
735
748
|
width: 100%;
|
|
736
749
|
max-height: 320px;
|
|
737
750
|
overflow-y: auto;
|
|
738
751
|
gap: 8px;
|
|
739
|
-
`,
|
|
752
|
+
`,Wu=b(me)`
|
|
740
753
|
width: 100%;
|
|
741
754
|
align-items: center;
|
|
742
755
|
gap: 8px;
|
|
@@ -746,14 +759,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
746
759
|
& > * {
|
|
747
760
|
font-family: monospace !important;
|
|
748
761
|
}
|
|
749
|
-
`,Bu=({pendingModify:o,onClose:n,onConfirm:i})=>{const a=v();return t(Qe,{isOpen:!!o,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:n,denyButton:{variant:be.Secondary,label:"Cancel",onClick:n},approveButton:{variant:be.Primary,label:"Confirm",onClick:i},children:o&&e(Mu,{children:[o.add.map(o=>e(zu,{children:[t(qe,{leftIcon:Na,status:Fe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(pe,{size:he.XS,color:ue.Primary,children:o})]},`add-${o}`)),o.remove.map(o=>e(zu,{children:[t(qe,{leftIcon:pl,status:Fe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(pe,{size:he.XS,color:ue.Primary,children:o})]},`remove-${o}`))]})})};function Xu(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 Uu(e){const t=Math.abs(e);return t>=1e9?`${Vu(e/1e9)}s`:t>=1e6?`${Vu(e/1e6)}ms`:t>=1e3?`${Vu(e/1e3)}μs`:String(Math.round(e))}function Vu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Hu(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let i=0;for(let e=0;e+3<n.length;e+=4){const a=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=i+a;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function ju(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Gu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Wu(e,t,o){return((e,t)=>{const o=[];for(let n=0;n<=t.level;n++){let i;for(const o of e)if(o.level===n&&t.offset>=o.offset&&t.offset+t.size<=o.offset+o.size){i=o;break}if(!i)return o;o.push(i)}return o})(t,o).map(t=>Xu(e,t.nameIndex))}function Ku(e,t,o){if(0===o.length)return null;let n=null,i=null;for(let a=0;a<o.length;a++){const l=o[a];let r=null;for(const o of t)o.level===a&&Xu(e,o.nameIndex)===l&&(n&&(o.offset<n.offset||o.offset+o.size>n.offset+n.size)||(!r||o.size>r.size)&&(r=o));if(!r)return null;n=r,i=r}return i}function Yu(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 i=[t];for(let e=t.level+1;e<=o;e++){const t=i.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){i.push(e);break}}return i}function qu(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Ju(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],i=[{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 i[o%i.length]}var Zu,Qu;function eh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function th(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 oh(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Zu||(Zu={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Qu||(Qu={}));const nh=({flamebearer:o,maxRowPx:n,searchQuery:c="",shouldKeepName:d,minHostHeight:p=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=l(null),S=l(null),x=l({x:0,y:0}),[w,T]=s({w:0,h:0}),[k,E]=s(""),[I,N]=s(null),[$,O]=s([]),[A,R]=s(!1),[D,_]=s(Zu.Fit),[P,L]=s(Qu.Fit),[F,M]=s(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=$.length>0?$[$.length-1]:null,U=X?.size??o.numTicks,V=a(()=>Hu(o),[o]),H=l({fb:o,rects:V});i(()=>{const e=H.current;e.fb!==o&&(H.current={fb:o,rects:V},O(t=>{if(0===t.length)return t;const n=((e,t,o,n,i)=>{const a=[];for(const l of i){const i=Wu(e,t,l);if(0===i.length)break;const r=Ku(o,n,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,o,V,t);return n.length===t.length&&n.every((e,o)=>Gu(e,t[o]))?t:n}))},[o,V]),i(()=>{if(!f)return;if(!X)return void f(null);const e=Yu(V,X),t=new Set;for(const n of e){const e=Xu(o,n.nameIndex);e&&t.add(e)}f([...t])},[X,o,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),i(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),i(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=a(()=>function(e,t,o,n,i,a={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Hu(e);let p=l?Yu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Xu(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((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 i=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const a=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&Xu(e,l.nameIndex)===Xu(e,t.nameIndex)&&i.add(ju(l))}if(0===i.size)return o;const a=[];for(const e of o){if(i.has(ju(e)))continue;let t=0;for(let o=0;o<e.level;o++){const a=n.get(o);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(ju(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=n??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(o/g,f)),v=i.trim(),y=b>8?1:0;return p.map(o=>{const n=o.level-u,i=(o.offset-h)/m*t,a=Math.max(o.size/m*t,1),l=n*b,r=Math.max(b-y,1),s=Xu(e,o.nameIndex);return{...o,x:i,y:l,w:a,h:r,name:s,matchesSearch:qu(s,v)}})}(o,z,B,n,c,{zoomRoot:X,shouldKeepName:d,collapseRecursive:F,allRects:V}),[o,n,c,B,z,X,d,F,V]),G=a(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?c.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,c]),W=r(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=th((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(n){const e=ju(n);N(e);const t=U>0?(100*n.size/U).toFixed(1):"0",i=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";E(`${n.name}\ntotal ${Uu(n.size)} (${t}% of view, ${i}% of profile) · self ${Uu(n.self)}`)}else N(null),E("")},[G,o.numTicks,B,z,U]),K=r(e=>{W(e)},[W]),Y=r(()=>{N(null),E("")},[]),q=r(e=>{x.current={x:e.clientX,y:e.clientY}},[]),J=r(e=>{const{x:t,y:o}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(z<2||B<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=th((e.clientX-n.left)/n.width*z,(e.clientY-n.top)/n.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Gu(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(z,B),i=Math.min(t,16384/n);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,o,n,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Ju(s,a);e.fillStyle=u,e.fillRect(o,n,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+i-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(i-1,0),Math.max(l-1,0));const m=eh(d,r),g=`${s} (${Uu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(ju(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,c,y,I,o.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,o.numTicks,I,c,B,z,y]);const Z=r(()=>R(e=>!e),[]),Q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(U/o.numTicks*100))):100,ee=a(()=>((e,t,o)=>{const n=o??Hu(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(o,X,V),[o,X,V]),te=null!==ee,oe=$.length>0,ne=X?Xu(o,X.nameIndex):"",ie=r(()=>{O([]),b?.()},[b]),ae=r(()=>O(e=>e.slice(0,-1)),[]),se=r(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:p,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(me,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(le,{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:re.Left,size:Nt.S,value:F,onChange:M}),e(me,{$gap:8,children:[e(me,{children:[t(ge,{variant:be.Secondary,size:fe.S,label:"Reset zoom",leftIcon:ul,onClick:ie,disabled:!$.length}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:pl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!oe,onClick:ae}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(pe,{size:he.XXS,color:ue.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:Na,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(me,{children:[t($e,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Oo.Filled,options:[{value:Zu.Fit,label:"W: Fit"},{value:Zu.X10,label:"10x"}],selected:D,setSelected:_})}),t($e,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Oo.Filled,options:[{value:Qu.Fit,label:"H: Fit"},{value:Qu.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:24,leftIcon:A?Va:hl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t($e,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:I?"pointer":"default"},onPointerDown:q,onPointerMove:K,onPointerLeave:Y,onClick:J})})})})}),e(me,{$justifyContent:"space-between",children:[t(pe,X?{size:he.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ne} • ${Uu(U)} samples in view`}:{size:he.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(pe,{size:he.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${oh(h.totalBytesUsed)} / ${oh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},ih=[$o.Go,$o.Java],ah="Profiling Symbols";function lh(e,t){if(0===t.length)return null;const o=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?$o.Go:e.includes(" ")||e.includes("(")?$o.Java:$o.Go)(e);if(o===$o.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const o=t.lastIndexOf("/"),n=t.indexOf(".",o+1);if(-1===n)return null;const i=t.slice(0,n),a=t.slice(n+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Ge(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new Ge(i,a);return r.Verify()?r:null})(e);return t?{language:o,golang:t}:null}if(o===$o.Java){const t=(e=>{let t=e.trim();if(!t)return null;const o=t.indexOf("(");-1!==o&&(t=t.slice(0,o).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new We(a,l);return r.Verify()?r:null})(e);return t?{language:o,java:t}:null}return null}function rh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function sh(e,t,o){if(!e)return!0;const{sources:n=[],namespaces:i=[],languages:a=[]}=e,l=!n.length||n.some(e=>rh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==o||a.includes(o);return l&&r&&s}function ch(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function dh(e,t){return e.className===t.className&&e.methodName===t.methodName}function ph(e,t,o,n){const i=lh(e,o);if(!i)return[];const a=[];for(const e of n){const o=e.customInstrumentations;if(!o)continue;if(!sh(e.sourceScopes,t,i.language))continue;const n=!!i.golang&&!!o[Ke.Golang]?.some(e=>ch(e,i.golang)),l=!!i.java&&!!o[Ke.Java]?.some(e=>dh(e,i.java));(n||l)&&a.push({rule:e,resolved:i})}return a}var uh,hh,mh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(uh||(uh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(hh||(hh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(mh||(mh={}));const gh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function fh(e,t){const o=(e=>e.split(" ")[0]??"")(e);return(!t.includes(mh.FilterOutVoid)||"void"!==o)&&!!(!t.includes(mh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==o&&gh.test(o))}const bh=({rows:e,languages:o,instrumentation:n,searchQuery:i,filters:l,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:p})=>{const u=!!o?.includes($o.Java),h=a(()=>{const t=c?new Set(c):null,o=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!o||e.name.toLowerCase().includes(o)))},[e,i,c]),m=a(()=>{const e=[];if(n.selectionEnabled&&e.push({id:hh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:mh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:mh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const o=e.cells.find(e=>e.key===uh.Symbol)?.rawValue?.toString()??"";return!(t.includes(hh.OnlyInstrumentable)&&!n.getSymbolState(o).showCheckbox)&&fh(o,t)}}},[n,u]),g=a(()=>[{key:uh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:uh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:uh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=n.getSymbolState(e.name),o=t.showCheckbox;return{id:e.name,cells:[{key:uh.Symbol,rawValue:e.name},{key:uh.Self,rawValue:Uu(e.self)},{key:uh.Total,rawValue:Uu(e.total)}],isSelected:o?n.isSelected(e.name):void 0,onSelect:o?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:o?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!o,checkboxDisabled:o?t.checkboxDisabled:void 0,checkboxTooltip:o?t.checkboxTooltip:void 0}}),[h,n]),b=r(e=>{const t=e.cells[0].rawValue,o=n.getSymbolState(t),i=[];return o.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ia,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Na,tooltip:o.addTooltip,disabled:!o.addEnabled,onClick:()=>n.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:ml,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[n]);return t(Ao,{variant:Ro.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:n.selectionEnabled,filters:l,onFiltersChange:s,activeRowId:d,scrollSignal:p,getRowActions:b})};var vh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(vh||(vh={}));const yh=b(ee)`
|
|
762
|
+
`,Ku=({pendingModify:o,onClose:n,onConfirm:i})=>{const a=v();return t(tt,{isOpen:!!o,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:n,denyButton:{variant:be.Secondary,label:"Cancel",onClick:n},approveButton:{variant:be.Primary,label:"Confirm",onClick:i},children:o&&e(Gu,{children:[o.add.map(o=>e(Wu,{children:[t(Ze,{leftIcon:Ra,status:Fe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(pe,{size:he.XS,color:ue.Primary,children:o})]},`add-${o}`)),o.remove.map(o=>e(Wu,{children:[t(Ze,{leftIcon:gl,status:Fe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(pe,{size:he.XS,color:ue.Primary,children:o})]},`remove-${o}`))]})})};function Yu(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 qu(e){const t=Math.abs(e);return t>=1e9?`${Ju(e/1e9)}s`:t>=1e6?`${Ju(e/1e6)}ms`:t>=1e3?`${Ju(e/1e3)}μs`:String(Math.round(e))}function Ju(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Zu(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let i=0;for(let e=0;e+3<n.length;e+=4){const a=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=i+a;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Qu(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function eh(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function th(e,t,o){return((e,t)=>{const o=[];for(let n=0;n<=t.level;n++){let i;for(const o of e)if(o.level===n&&t.offset>=o.offset&&t.offset+t.size<=o.offset+o.size){i=o;break}if(!i)return o;o.push(i)}return o})(t,o).map(t=>Yu(e,t.nameIndex))}function oh(e,t,o){if(0===o.length)return null;let n=null,i=null;for(let a=0;a<o.length;a++){const l=o[a];let r=null;for(const o of t)o.level===a&&Yu(e,o.nameIndex)===l&&(n&&(o.offset<n.offset||o.offset+o.size>n.offset+n.size)||(!r||o.size>r.size)&&(r=o));if(!r)return null;n=r,i=r}return i}function nh(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 i=[t];for(let e=t.level+1;e<=o;e++){const t=i.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){i.push(e);break}}return i}function ih(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function ah(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],i=[{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 i[o%i.length]}var lh,rh;function sh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ch(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 dh(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(lh||(lh={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(rh||(rh={}));const ph=({flamebearer:o,maxRowPx:n,searchQuery:c="",shouldKeepName:d,minHostHeight:p=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=l(null),S=l(null),x=l({x:0,y:0}),[w,T]=s({w:0,h:0}),[k,I]=s(""),[E,N]=s(null),[$,O]=s([]),[A,R]=s(!1),[D,_]=s(lh.Fit),[P,L]=s(rh.Fit),[F,M]=s(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=$.length>0?$[$.length-1]:null,U=X?.size??o.numTicks,V=a(()=>Zu(o),[o]),H=l({fb:o,rects:V});i(()=>{const e=H.current;e.fb!==o&&(H.current={fb:o,rects:V},O(t=>{if(0===t.length)return t;const n=((e,t,o,n,i)=>{const a=[];for(const l of i){const i=th(e,t,l);if(0===i.length)break;const r=oh(o,n,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,o,V,t);return n.length===t.length&&n.every((e,o)=>eh(e,t[o]))?t:n}))},[o,V]),i(()=>{if(!f)return;if(!X)return void f(null);const e=nh(V,X),t=new Set;for(const n of e){const e=Yu(o,n.nameIndex);e&&t.add(e)}f([...t])},[X,o,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),i(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),i(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=a(()=>function(e,t,o,n,i,a={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Zu(e);let p=l?nh(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Yu(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((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 i=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const a=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&Yu(e,l.nameIndex)===Yu(e,t.nameIndex)&&i.add(Qu(l))}if(0===i.size)return o;const a=[];for(const e of o){if(i.has(Qu(e)))continue;let t=0;for(let o=0;o<e.level;o++){const a=n.get(o);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Qu(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=n??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(o/g,f)),v=i.trim(),y=b>8?1:0;return p.map(o=>{const n=o.level-u,i=(o.offset-h)/m*t,a=Math.max(o.size/m*t,1),l=n*b,r=Math.max(b-y,1),s=Yu(e,o.nameIndex);return{...o,x:i,y:l,w:a,h:r,name:s,matchesSearch:ih(s,v)}})}(o,z,B,n,c,{zoomRoot:X,shouldKeepName:d,collapseRecursive:F,allRects:V}),[o,n,c,B,z,X,d,F,V]),G=a(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?c.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,c]),W=r(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=ch((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(n){const e=Qu(n);N(e);const t=U>0?(100*n.size/U).toFixed(1):"0",i=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";I(`${n.name}\ntotal ${qu(n.size)} (${t}% of view, ${i}% of profile) · self ${qu(n.self)}`)}else N(null),I("")},[G,o.numTicks,B,z,U]),K=r(e=>{W(e)},[W]),Y=r(()=>{N(null),I("")},[]),q=r(e=>{x.current={x:e.clientX,y:e.clientY}},[]),J=r(e=>{const{x:t,y:o}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(z<2||B<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=ch((e.clientX-n.left)/n.width*z,(e.clientY-n.top)/n.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&eh(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(z,B),i=Math.min(t,16384/n);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,o,n,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=ah(s,a);e.fillStyle=u,e.fillRect(o,n,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+i-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(i-1,0),Math.max(l-1,0));const m=sh(d,r),g=`${s} (${qu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(Qu(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,c,y,E,o.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,o.numTicks,E,c,B,z,y]);const Z=r(()=>R(e=>!e),[]),Q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(U/o.numTicks*100))):100,ee=a(()=>((e,t,o)=>{const n=o??Zu(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(o,X,V),[o,X,V]),te=null!==ee,oe=$.length>0,ne=X?Yu(o,X.nameIndex):"",ie=r(()=>{O([]),b?.()},[b]),ae=r(()=>O(e=>e.slice(0,-1)),[]),se=r(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:p,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(me,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(le,{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:re.Left,size:Ot.S,value:F,onChange:M}),e(me,{$gap:8,children:[e(me,{children:[t(ge,{variant:be.Secondary,size:fe.S,label:"Reset zoom",leftIcon:fl,onClick:ie,disabled:!$.length}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:gl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!oe,onClick:ae}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(pe,{size:he.XXS,color:ue.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:Ra,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(me,{children:[t($e,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:_o.Filled,options:[{value:lh.Fit,label:"W: Fit"},{value:lh.X10,label:"10x"}],selected:D,setSelected:_})}),t($e,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:_o.Filled,options:[{value:rh.Fit,label:"H: Fit"},{value:rh.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:24,leftIcon:A?Wa:bl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t($e,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:q,onPointerMove:K,onPointerLeave:Y,onClick:J})})})})}),e(me,{$justifyContent:"space-between",children:[t(pe,X?{size:he.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ne} • ${qu(U)} samples in view`}:{size:he.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(pe,{size:he.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${dh(h.totalBytesUsed)} / ${dh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},uh=[Do.Go,Do.Java],hh="Profiling Symbols";function mh(e,t){if(0===t.length)return null;const o=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Do.Go:e.includes(" ")||e.includes("(")?Do.Java:Do.Go)(e);if(o===Do.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const o=t.lastIndexOf("/"),n=t.indexOf(".",o+1);if(-1===n)return null;const i=t.slice(0,n),a=t.slice(n+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Ge(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new Ge(i,a);return r.Verify()?r:null})(e);return t?{language:o,golang:t}:null}if(o===Do.Java){const t=(e=>{let t=e.trim();if(!t)return null;const o=t.indexOf("(");-1!==o&&(t=t.slice(0,o).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new We(a,l);return r.Verify()?r:null})(e);return t?{language:o,java:t}:null}return null}function gh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function fh(e,t,o){if(!e)return!0;const{sources:n=[],namespaces:i=[],languages:a=[]}=e,l=!n.length||n.some(e=>gh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==o||a.includes(o);return l&&r&&s}function bh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function vh(e,t){return e.className===t.className&&e.methodName===t.methodName}function yh(e,t,o,n){const i=mh(e,o);if(!i)return[];const a=[];for(const e of n){const o=e.customInstrumentations;if(!o)continue;if(!fh(e.sourceScopes,t,i.language))continue;const n=!!i.golang&&!!o[Ke.Golang]?.some(e=>bh(e,i.golang)),l=!!i.java&&!!o[Ke.Java]?.some(e=>vh(e,i.java));(n||l)&&a.push({rule:e,resolved:i})}return a}var Ch,Sh,xh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(Ch||(Ch={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(Sh||(Sh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(xh||(xh={}));const wh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Th(e,t){const o=(e=>e.split(" ")[0]??"")(e);return(!t.includes(xh.FilterOutVoid)||"void"!==o)&&!!(!t.includes(xh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==o&&wh.test(o))}const kh=({rows:e,languages:o,instrumentation:n,searchQuery:i,filters:l,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:p})=>{const u=!!o?.includes(Do.Java),h=a(()=>{const t=c?new Set(c):null,o=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!o||e.name.toLowerCase().includes(o)))},[e,i,c]),m=a(()=>{const e=[];if(n.selectionEnabled&&e.push({id:Sh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:xh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:xh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const o=e.cells.find(e=>e.key===Ch.Symbol)?.rawValue?.toString()??"";return!(t.includes(Sh.OnlyInstrumentable)&&!n.getSymbolState(o).showCheckbox)&&Th(o,t)}}},[n,u]),g=a(()=>[{key:Ch.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Ch.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Ch.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=n.getSymbolState(e.name),o=t.showCheckbox;return{id:e.name,cells:[{key:Ch.Symbol,rawValue:e.name},{key:Ch.Self,rawValue:qu(e.self)},{key:Ch.Total,rawValue:qu(e.total)}],isSelected:o?n.isSelected(e.name):void 0,onSelect:o?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:o?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!o,checkboxDisabled:o?t.checkboxDisabled:void 0,checkboxTooltip:o?t.checkboxTooltip:void 0}}),[h,n]),b=r(e=>{const t=e.cells[0].rawValue,o=n.getSymbolState(t),i=[];return o.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Aa,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Ra,tooltip:o.addTooltip,disabled:!o.addEnabled,onClick:()=>n.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:vl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[n]);return t(Po,{variant:Lo.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:n.selectionEnabled,filters:l,onFiltersChange:s,activeRowId:d,scrollSignal:p,getRowActions:b})};var Ih;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(Ih||(Ih={}));const Eh=b(ee)`
|
|
750
763
|
width: 100%;
|
|
751
764
|
flex: 1;
|
|
752
765
|
border-radius: 16px;
|
|
753
766
|
overflow: hidden;
|
|
754
767
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
755
768
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
756
|
-
`,
|
|
769
|
+
`,Nh=b.div`
|
|
757
770
|
display: flex;
|
|
758
771
|
align-items: center;
|
|
759
772
|
gap: 10px;
|
|
@@ -761,11 +774,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
761
774
|
padding: 12px 12px 8px;
|
|
762
775
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
763
776
|
border-radius: 16px 16px 0 0;
|
|
764
|
-
|
|
777
|
+
`,$h=b(me)`
|
|
765
778
|
flex-shrink: 0;
|
|
766
779
|
align-items: center;
|
|
767
780
|
gap: 4px;
|
|
768
|
-
`,
|
|
781
|
+
`,Oh=b.div`
|
|
769
782
|
flex: 1;
|
|
770
783
|
display: flex;
|
|
771
784
|
align-items: stretch;
|
|
@@ -773,20 +786,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
773
786
|
padding: 16px;
|
|
774
787
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
775
788
|
border-radius: 0 0 16px 16px;
|
|
776
|
-
`,
|
|
789
|
+
`,Ah=b(ee)`
|
|
777
790
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
778
791
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
779
792
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
780
793
|
gap: 10px;
|
|
781
|
-
`,
|
|
794
|
+
`,Rh=b(ee)`
|
|
782
795
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
783
796
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
784
797
|
gap: 10px;
|
|
785
|
-
`,
|
|
798
|
+
`,Dh=b(me)`
|
|
786
799
|
width: 100%;
|
|
787
800
|
min-height: 32px;
|
|
788
801
|
flex-shrink: 0;
|
|
789
|
-
`,
|
|
802
|
+
`,_h=({source:o,onFlameFullscreenChange:n})=>{const d=v(),p=o.id,{profilingApi:u}=Bl(),[h,m]=s(!0),[g,f]=s(Ih.Both),[b,y]=s(""),[C,S]=s({}),[x,w]=s(!1),T=l(!1);i(()=>{T.current||(T.current=!0,u.enableProfiling?.(p),w(!0))},[u,p]);const{data:k}=u.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:E,refetch:N}=u.useSourceProfiling(p,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),$=I?.profileJson??null,O=a(()=>(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}})($),[$]),A=a(()=>O?(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 i=n[o+1],a=n[o+2],l=Yu(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})(O.flamebearer):[],[O]),R=g===Ih.Table||g===Ih.Both,D=g===Ih.Flame||g===Ih.Both,_=R&&D,P=o.runtimeInfo?.detectedLanguages?.join("\0")??"",L=o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=a(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=a(()=>((e,t)=>{if(!t?.includes(Do.Java))return;const o=(e?.[Ch.Symbol]?.filter(Boolean)??[]).filter(e=>e===xh.FilterOutVoid||e===xh.OnlyWithReturnValues);return 0!==o.length?e=>Th(e,o):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:o}){const{instrumentationRulesApi:n,capabilities:i}=Bl(),{items:l}=n.useRules(),[c,d]=s(new Set),[p,u]=s(new Set),[h,m]=s(null),g=a(()=>(e=>{const t=new Set(e??[]);return uh.filter(e=>t.has(e))})(t),[t]),f=i.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=a(()=>((e,t)=>{const o=e.filter(e=>e.type===Ye.CustomInstrumentation&&e.ruleName===hh&&fh(e.sourceScopes,t));return o.find(e=>e.sourceScopes?.sources?.some(e=>gh(e,t.id)))??o[0]??null})(l,e),[l,b]),y=f&&g.length>0,C=a(()=>{const t=new Map;for(const n of o){const o=!!mh(n.name,g),i=yh(n.name,e,g,l),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),r=i.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&r.length>0,c=y&&o,d=s;let p;if(s){const e=[...new Set(r.map(e=>e.rule.ruleName))];p=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?o?u=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(n.name,{parsable:o,inManagedRule:a,otherRules:r,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[o,l,b,g,f,y,v]),S=a(()=>{const e=new Set;return C.forEach((t,o)=>{t.inManagedRule&&e.add(o)}),e},[C]),x=a(()=>[...c].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[c,C,S]),w=a(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=r(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[C,p,c]),I=r((e,t)=>{const o=C.get(e);o&&!o.checkboxDisabled&&(o.inManagedRule?u(o=>{const n=new Set(o);return t?n.delete(e):n.add(e),n}):d(o=>{const n=new Set(o);return t?n.add(e):n.delete(e),n}))},[C]),E=r(()=>{d(new Set),u(new Set)},[]),N=r(t=>{(async()=>{const o=t.add.map(e=>mh(e,g)).filter(e=>!!e),i=t.remove.map(e=>mh(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,o)=>{const n=e.customInstrumentations??{};let i=[...n[Ke.Golang]??[]],a=[...n[Ke.Java]??[]];for(const e of o)e.golang&&(i=i.filter(t=>!bh(t,e.golang))),e.java&&(a=a.filter(t=>!vh(t,e.java)));for(const e of t)e.golang&&!i.some(t=>bh(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>vh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ke.Golang]:i,[Ke.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,o,i);t?await n.remove(v.ruleId,Ye.CustomInstrumentation):await n.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),Ye.CustomInstrumentation)}else o.length>0&&await n.create(((e,t)=>{const o=e.map(e=>e.golang).filter(e=>!!e),n=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:hh,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ke.Golang]:o,[Ke.Java]:n}}})(o,e),Ye.CustomInstrumentation)})()},[v,g,e,n]),$=r(()=>{T&&m({add:x,remove:w})},[T,x,w]),O=r(e=>m({add:[e],remove:[]}),[]),A=r(e=>m({add:[],remove:[e]}),[]),R=r(()=>m(null),[]),D=r(()=>{h&&(N(h),m(null),E())},[h,N,E]),_=r(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:a(()=>({getSymbolState:_,onAdd:O,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[_,O,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:$,resetSelection:E,confirmModify:D}}({source:o,languages:F,rows:A}),[G,W]=s(null),[K,Y]=s(0),[q,J]=s(null),Z=r(e=>{W(e),Y(e=>e+1),f(e=>e===Ih.Flame?Ih.Both:e)},[]),Q=r(e=>{J(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const o=new Set(t);if(e.every(e=>o.has(e)))return t}return e})},[]),te=r(()=>W(null),[]);return!$&&E?t(vt,{$height:"70vh",children:t(wt,{withSpinner:!0})}):e(Eh,{$gap:0,$width:"100%",children:[e(Nh,{children:[t($e,{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($h,{children:t(pe,{size:he.S,weight:500,color:ue.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(me,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(mo,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(ve,{variant:_o.Filled,options:[{value:Ih.Table,label:"Top table"},{value:Ih.Flame,label:"Flame graph"},{value:Ih.Both,label:"Both"}],selected:g,setSelected:f}),t(ge,h?{variant:be.Secondary,size:fe.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(yl,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:be.Secondary,size:fe.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(yl,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(Oh,{$gap:R&&D?16:0,children:O?e(c,{children:[R&&e(Ah,{$splitWithFlame:_,children:[e(Dh,{$justifyContent:"space-between",children:[e(ee,{$margin:"0 0 0 20px",children:[t(pe,{size:he.XXXS,nowrap:!0,children:"Please select symbols to"}),e(me,{$gap:8,children:[e(me,{children:[t(Cl,{size:24}),t(pe,{size:he.S,color:ue.Success,nowrap:!0,children:"Custom Instrument"})]}),t(ge,{leftIcon:La,variant:be.Secondary,size:fe.S,onClick:()=>window.open(`${Me}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(me,{$gap:8,children:[q&&t($e,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(Ze,{label:`Zoomed: ${q.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:he.XXS})}),t(ge,{variant:be.Secondary,size:fe.S,label:"Download snapshot",rightIcon:Sl,onClick:()=>{if(!$)return;const e=new Blob([$],{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:!$})]})]}),t(kh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:q,highlightSymbol:G,scrollSignal:K})]}),D&&e(Rh,{$splitWithTable:_,children:[e(Dh,{$justifyContent:"space-between",children:[t(Ze,{label:O?`Total in view ${qu(O.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:he.XXS}),e(me,{$gap:12,children:[!h&&t(ge,{variant:be.Secondary,size:fe.S,label:"Refresh",leftIcon:nl,onClick:N}),t(le,{label:"Auto refresh",labelAlign:re.Left,size:Ot.S,value:h,onChange:m})]})]}),t(ph,{flamebearer:O.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:n,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:te})]})]}):t(vt,{children:t(Re,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Ku,{pendingModify:X,onClose:U,onConfirm:j}),t(Fo,{isOpen:B>0,richTitle:{icon:Ka,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:ho.Button,buttonProps:{variant:be.Secondary,size:fe.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:ho.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Modify Rule",leftIcon:Ma,onClick:V}}]})]})},Ph=b.div`
|
|
790
803
|
position: relative;
|
|
791
804
|
display: flex;
|
|
792
805
|
align-items: center;
|
|
@@ -794,23 +807,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
794
807
|
padding: 8px 16px;
|
|
795
808
|
border-radius: 12px;
|
|
796
809
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
797
|
-
`,
|
|
810
|
+
`,Lh=b.div`
|
|
798
811
|
display: flex;
|
|
799
812
|
flex-direction: column;
|
|
800
813
|
gap: 4px;
|
|
801
814
|
flex: 1;
|
|
802
815
|
min-width: 0;
|
|
803
816
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
804
|
-
|
|
817
|
+
`,Fh=b.div`
|
|
805
818
|
flex-shrink: 0;
|
|
806
819
|
display: flex;
|
|
807
820
|
align-items: center;
|
|
808
821
|
margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
|
|
809
|
-
`,
|
|
822
|
+
`,Mh=b.div`
|
|
810
823
|
min-width: 0;
|
|
811
824
|
white-space: pre;
|
|
812
825
|
overflow-x: auto;
|
|
813
|
-
`,
|
|
826
|
+
`,zh=b.div`
|
|
814
827
|
position: absolute;
|
|
815
828
|
top: 50%;
|
|
816
829
|
right: 8px;
|
|
@@ -819,24 +832,24 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
819
832
|
pointer-events: none;
|
|
820
833
|
transition: opacity 0.15s ease;
|
|
821
834
|
|
|
822
|
-
${
|
|
835
|
+
${Ph}:hover & {
|
|
823
836
|
opacity: 1;
|
|
824
837
|
pointer-events: auto;
|
|
825
838
|
}
|
|
826
|
-
`,
|
|
839
|
+
`,Bh=({name:o,summary:n,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(Ph,{children:[e(Lh,{$disabled:i,children:[o&&t(pe,{size:he.XXXS,color:ue.Secondary,nowrap:!0,children:o}),t(Mh,{children:t(w,{parts:n})})]}),i&&t(Fh,{$reserveJumpSpace:!!a,children:t(Ze,{label:Mo,textSize:he.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(zh,{children:t($e,{text:ot.OPEN_IN_SAMPLING_PAGE,children:t(ge,{"data-id":"sampling-rule-jump",variant:be.Primary,size:fe.S,leftIcon:bl,onClick:a})})})]})},Xh=b.div`
|
|
827
840
|
opacity: 0;
|
|
828
841
|
pointer-events: none;
|
|
829
842
|
transition: opacity 0.15s ease;
|
|
830
|
-
`,
|
|
831
|
-
&:hover ${
|
|
843
|
+
`,Uh=b.div`
|
|
844
|
+
&:hover ${Xh} {
|
|
832
845
|
opacity: 1;
|
|
833
846
|
pointer-events: auto;
|
|
834
847
|
}
|
|
835
|
-
`,
|
|
848
|
+
`,Vh=b.div`
|
|
836
849
|
display: flex;
|
|
837
850
|
align-items: center;
|
|
838
851
|
padding: 4px 12px;
|
|
839
|
-
`,
|
|
852
|
+
`,Hh=({source:e,onRedirectToSampling:o})=>t(Vt,{bgTint:"1000",richTitle:{title:ot.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Wh,{container:e,onRedirectToSampling:o},e.containerName))});var jh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(jh||(jh={}));const Gh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Wh=({container:o,onRedirectToSampling:n})=>{const[i,l]=s(jh.All),r=fo(e=>e.setPendingViewSamplingRule),c=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),p=a(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=a(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===jh.Noisy?d:i===jh.HighlyRelevant?p:i===jh.CostReduction?u:[...d,...p,...u],[i,p,u]),m=d.length+p.length+u.length,g=a(()=>(e,t)=>{r({ruleId:e,category:t}),n()},[n,r]),f=t(Xh,{children:t(ge,{"data-id":"sampling-container-create-rule",variant:be.Secondary,size:fe.S,label:zo,rightIcon:Ra,onClick:e=>{e.stopPropagation(),n()}})});return t(Uh,{children:e(Vt,{bgTint:"900",richTitle:{title:o.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Vt,{bgTint:"800",richTitle:{title:ot.HEAD_SAMPLING,badge:{label:c.length}},children:[t(pe,{size:he.XXS,children:ot.NOISY_OPERATIONS}),t(ee,{$gap:4,children:c.map(e=>t(Bh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Vh,{children:t(pe,{size:he.XS,color:ue.Secondary,children:ot.HEAD_SAMPLING})}),m?e(Vt,{bgTint:"800",richTitle:{title:ot.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:jh.All,label:"All",badge:{label:b+v+y,textSize:he.XXXS}},{value:jh.Noisy,label:ot.NOISY_OPERATIONS,badge:{label:b,textSize:he.XXXS}},{value:jh.HighlyRelevant,label:ot.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:he.XXXS}},{value:jh.CostReduction,label:ot.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:he.XXXS}}]),selected:i,setSelected:l}),t(ee,{$gap:4,children:h.length?h.map(e=>t(Bh,{name:e.rule.name,summary:Gh(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Re,{title:`No ${i===jh.All?`${jh.Noisy}, ${jh.HighlyRelevant} and ${jh.CostReduction}`:i} operations`})})]}):t(Vh,{children:t(pe,{size:he.XS,color:ue.Secondary,children:ot.TAIL_SAMPLING})})]})});var b,v,y},Kh=[xo.Deployment,xo.StatefulSet,xo.DaemonSet,xo.DeploymentConfig,xo.Rollout,xo.Pod];var Yh;(e=>{e.Workload="Workload",e.Pod="Pod"})(Yh||(Yh={}));const qh=e=>!!e&&lo(e.status)===Fe.Error,Jh=e=>qh(e.healthStatus),Zh=e=>qh(e.odigosHealthStatus)||(e.processes??[]).some(Jh),Qh=e=>qh(e.agentInjectedStatus)||qh(e.odigosHealthStatus)||(e.containers??[]).some(Zh),em=({onClose:o,sourceId:n,onRedirectToSampling:c})=>{const d=v(),{isVm:p,isConnector:u,isK8s:h}=S(),{sourcesApi:m,configApi:g}=Bl(),{selectedStreamName:f}=nt(),{genericForm:b,loadSource:y,validateFormData:C}=Hl(),{data:x}=g.useEffectiveConfig(),[w,T]=s(!1),[k,I]=s(!1),[E,N]=s(!1),[$,O]=s(Op.Overview),[A,R]=s(null),[D,_]=s({openFor:null}),P=(()=>{const[e,t]=s(null),o=r(e=>{t({tab:Op.Pods,podName:e.podName})},[]),n=r((e,o)=>{t({tab:Op.Pods,podName:e.podName,containerName:o.containerName})},[]),i=r((e,o,n)=>{const i=Lp({identifyingAttributes:n.identifyingAttributes});t({tab:Op.Pods,podName:e.podName,containerName:o.containerName,processPid:i})},[]),l=r(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:l}),[e,o,n,i,l])})();i(()=>{P.jumpToTarget&&O(P.jumpToTarget.tab)},[P.jumpToTarget]),i(()=>{A&&JSON.stringify(bo(n))!==JSON.stringify(bo(A))&&R(null)},[n,A]);const L=l(!1),F=r(async()=>R(await m.fetchById(n)||null),[n,m]);i(()=>{if(L.current||(F(),L.current=!0),!w){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,w]),i(()=>{A&&y(A)},[A]);const M=A&&Kh.includes(A.id.kind),z=a(()=>{const e=[],o=(A?.pods??[]).some(Qh),n=(i=A,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(sl,{...e,fill:d.v2.colors.red[500]});return e.push({value:Op.Overview,label:ot.OVERVIEW}),h?(e.push({value:Op.Pods,label:ot.PODS,icon:o?a:void 0}),e.push({value:Op.Libraries,label:ot.LIBRARIES,icon:n?a:void 0}),e.push({value:Op.PeerSources,label:ot.PEER_SOURCES}),x?.profiling?.enabled&&e.push({value:Op.Profiling,label:ot.PROFILING}),e.push({value:Op.Sampling,label:ot.SAMPLING}),e.push({value:Op.Debug,label:ot.DEBUG}),e):e},[h,x,A?.pods,d]),B=r(()=>T(!0),[]),X=a(()=>()=>{o(),c()},[o,c]),U=r(()=>{A&&y(A),T(!1)},[A]),V=r(async()=>{if(!A||!b)return;const{errorMessage:e,preparedFormData:t}=C();if(e)return;const o=t.otelServiceName!==A.id.name?t.otelServiceName:"";await m.update(n,{...t,otelServiceName:o}),T(!1)},[A,b,C,n,m]),H=r(()=>I(!0),[]),j=r(async()=>{A&&(await m.persistV2({[_t]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,region:A.id.region??"",selected:!1,currentStreamName:f}]}),I(!1),o())},[A,m,f,o]),G=r(()=>{_({openFor:Yh.Workload})},[]),W=r(e=>{O(e),P.clearJumpToTarget()},[P]),K=r(async()=>{await m.recoverFromRollback(n)},[m,n]),Y=r(()=>_({openFor:null}),[]),q=r(async()=>{D.openFor===Yh.Workload?await m.restartWorkloads([n]):D.openFor===Yh.Pod&&D.podNamespace&&D.podName&&await m.restartPod(D.podNamespace,D.podName),Y()},[D,m,n,Y]),J=a(()=>{const{kind:e,name:t}=n;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[n]),Z=a(()=>{const e=[];return w||$===Op.Overview&&(e.push({id:"edit-source-btn-edit",label:zt.EDIT,icon:Ma,active:w,onClick:B}),e.push({id:"edit-source-btn-delete",label:zt.UNINSTRUMENT,icon:Aa,color:d.v2.colors.red[500],active:k,onClick:H})),e},[$,w,k,B,H,d]),Q=a(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:he.S};return e.push({...t,label:A.id.name,leftIcon:h?rl:void 0}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:ll,textColor:d.v2.colors.silver[200]}),e},[A,d,h]);if(!A)return t(ce,{isOpen:!0,children:t(vt,{$height:"80vh",children:t(wt,{withSpinner:!0})})});const te=$===Op.Profiling?E?"95vw":"fit-content":w?void 0:"60vw",oe=p?xl:u?Za:Bo(A.containers)[0];return e(jp,{value:P,children:[t(ce,{isOpen:!0,width:te,minWidth:"min(1100px, 100vw)",header:{icon:oe,titleBadges:Q,onClose:()=>{W(Op.Overview),R(null),N(!1),o()},actions:Z},footer:{actions:w?[{"data-id":"edit-source-btn-cancel",label:zt.CANCEL,variant:be.Secondary,onClick:U},{"data-id":"edit-source-btn-save",label:zt.SAVE,variant:be.Primary,onClick:V}]:[]},children:t(ft,{$padding:"4px 12px 12px",children:e(ee,{$gap:16,children:[!w&&z.length>1&&t(ve,{options:z,selected:$,setSelected:W}),(()=>{switch($){case Op.Overview:return w?t(oc,{}):t(Hu,{source:A,onClickRollout:G,onClickRollback:K});case Op.Pods:return t(qp,{source:A,onClickRestartPod:M?(e,t)=>_({openFor:Yh.Pod,podNamespace:e,podName:t}):void 0});case Op.Libraries:return t(ju,{source:A});case Op.PeerSources:return t(Zp,{source:A});case Op.Profiling:return t(_h,{source:A,onFlameFullscreenChange:N});case Op.Sampling:return t(Hh,{source:A,onRedirectToSampling:X});case Op.Debug:return t(nu,{source:A});default:return null}})()]})})}),t(Tr,{target:"source",action:"uninstrument",isOpen:k,onClose:()=>I(!1),onApprove:j}),t(tt,{isOpen:D.openFor===Yh.Workload,title:J.title,description:J.description,onClose:Y,denyButton:{label:"Go back",variant:be.Secondary,onClick:Y},approveButton:{label:zt.CONFIRM,variant:be.Primary,onClick:q}}),t(Tr,{target:"pod",action:"restart",description:ot.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:D.openFor===Yh.Pod,onClose:Y,onApprove:q,overrideApproveButtonLabel:ot.DELETE_POD_TO_RESTART})]})},tm=b.div`
|
|
840
853
|
display: flex;
|
|
841
854
|
align-items: center;
|
|
842
855
|
gap: 8px;
|
|
@@ -846,9 +859,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
846
859
|
&:hover {
|
|
847
860
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
848
861
|
}
|
|
849
|
-
`,
|
|
862
|
+
`,om=b.div`
|
|
850
863
|
flex: 1;
|
|
851
|
-
`,
|
|
864
|
+
`,nm=({onClick:o})=>{const n=v().v2.colors.red[500];return e(tm,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(pe,{size:he.XS,weight:500,color:n,children:Ho}),t(Aa,{size:16,fill:n})]})};const im={[Gl.EditAutoNoisy]:{title:an,subTitle:nn,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Gl.EditAutoCostReduction]:{title:on,subTitle:tn,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Gl.EditAutoHighlyRelevant]:{title:en,subTitle:Qo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},am=({isOpen:e,title:o,subTitle:n,onClose:i,footer:a,renderBody:l})=>t(ce,{isOpen:e,width:rn,header:{icon:wl,title:o,subTitle:n,onClose:i},footer:a,children:l?l():t(ft,{$padding:"12px",children:t(sc,{})})}),lm=({isOpen:n,onClose:l,onSubmit:c,validateForm:d,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=jl(Gl.Create),[b,v]=s(!1);i(()=>{n&&(m(),v(!1))},[n]);const y=r(()=>{v(!1),c(h)},[h,c]),C=r(()=>{if(d){const e=d(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(E(t)))(h,u)?v(!0):y()},[h,u,d,f,y]),S=a(()=>b?((e,t)=>{switch(e){case"noisy":return T(O(t));case"highlyRelevant":return k($(t));case"costReduction":return I(N(t))}})(u,h):[],[b,u,h]),x={note:g?{status:Fe.Warning,message:g.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Xo,variant:be.Secondary,size:fe.S,onClick:l},{"data-id":"sampling-create-btn-submit",label:zo,variant:be.Primary,size:fe.S,onClick:C,disabled:!!g}]};return e(o,{children:[t(am,{isOpen:n,title:Ko[u],subTitle:jo[u],onClose:l,footer:x}),t(tt,{isOpen:b,title:Jo,description:qo,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Yo,variant:be.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:zo,variant:be.Primary,onClick:y},children:e(ee,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(pe,{size:he.XS,weight:500,color:ue.Secondary,children:Zo}),t("div",{style:{width:"100%"},children:t(ur,{summary:S})})]})})]})},rm=({onClose:n,onDelete:i,onSaveEdit:l,validateForm:s,onNavigateToDuplicate:c})=>{const{data:d,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=jl(Gl.View),b=d?.rule.name||Wo,v=p&&d?Go[d.category]:`${b} preview`,y=r(()=>{if(d&&p){if(s){const e=s(u);if(e)return void f(e)}l(u,d.rule.ruleId,d.samplingId),m()}},[d,p,u,l,s,f,m]),C=r(()=>{d&&i(d.rule.ruleId,d.samplingId)},[d,i]),S=a(()=>{if(!d)return;const i=g?{message:g.message,onViewRule:c?()=>c(g.ruleId):void 0}:null;return function(n){if(n.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(nm,{onClick:l}),r&&t(Le,{status:Fe.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(om,{}),t(ge,{"data-id":"sampling-view-edit-btn-cancel",label:Xo,variant:be.Secondary,size:fe.S,onClick:i}),t(ge,{"data-id":"sampling-view-edit-btn-save",label:Uo,variant:be.Primary,size:fe.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=n;return{children:e(o,{children:[t(nm,{onClick:i}),t(om,{}),t(ge,{"data-id":"sampling-view-btn-cancel",label:Xo,variant:be.Secondary,size:fe.S,onClick:a}),t(ge,{"data-id":"sampling-view-btn-edit",label:Vo,variant:be.Primary,size:fe.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:n,onEdit:h})},[d,p,g,m,y,C,h,n,c]);return t(am,{isOpen:!!d,title:v,subTitle:d?jo[d.category]:"",onClose:n,footer:S})},sm=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=jl(Gl.EditAutoNoisy),l=r(()=>n(i,a),[n,i,a]);return t(pm,{formType:Gl.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},cm=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=jl(Gl.EditAutoCostReduction),l=r(()=>n(i,a),[n,i,a]);return t(pm,{formType:Gl.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},dm=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i}=jl(Gl.EditAutoHighlyRelevant),a=r(()=>n(i),[n,i]);return t(pm,{formType:Gl.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:a})},pm=({formType:e,isOpen:o,onClose:n,onSave:i})=>{const a=im[e];return t(am,{isOpen:o,title:a.title,subTitle:a.subTitle,onClose:n,footer:{actions:[{"data-id":a.cancelId,label:Xo,variant:be.Secondary,size:fe.S,onClick:n},{"data-id":a.saveId,label:ln,variant:be.Primary,size:fe.S,onClick:i}]}})},um=e=>{switch(e.formType){case Gl.Create:return t(Ql,{formType:Gl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(lm,{...e})});case Gl.View:return t(Ql,{formType:Gl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(rm,{...e})});case Gl.EditAutoNoisy:return t(Ql,{formType:Gl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(sm,{...e})});case Gl.EditAutoCostReduction:return t(Ql,{formType:Gl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(cm,{...e})});case Gl.EditAutoHighlyRelevant:return t(Ql,{formType:Gl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(dm,{...e})})}},hm=({token:n,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=Ft(),m=!a||i||!c.newToken;return sn({key:"Enter",active:!m},s),e(me,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Te,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(me,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(wt,{title:"Saving...",withGradient:!0}):e(o,{children:[t(ge,{variant:be.Secondary,size:fe.S,leftIcon:Wa,onClick:r,disabled:i}),t(ge,{variant:be.Primary,size:fe.S,leftIcon:Ga,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(pe,{size:he.XS,children:new Array(55).fill("•").join("")}),e(me,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(St,{icon:Ma,onClick:l})]})]})},mm=({expiresAt:e,callbackValid:o,callbackExpired:n})=>{const{formatTimeAgo:l}=to(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>cn(e,0)?Fe.Error:cn(e,2592e6)?Fe.Warning:Fe.Success,[e]),d=a(()=>c===Fe.Success?Ga:c===Fe.Warning?Tl:sl,[c]);return i(()=>{c===Fe.Success?o():c===Fe.Error&&n()},[c]),t($e,{text:s,children:t(Ze,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},gm=b.div`
|
|
852
865
|
display: flex;
|
|
853
866
|
flex-direction: column;
|
|
854
867
|
gap: 12px;
|
|
@@ -856,7 +869,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
856
869
|
border-radius: 12px;
|
|
857
870
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
858
871
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
859
|
-
`,
|
|
872
|
+
`,fm=({children:e})=>{const o=v();return t(pe,{size:he.XXXS,color:o.v2.colors.grey[150],children:e})},bm=({token:o})=>{const{tokensApi:n}=Bl(),[i,a]=s(!1),[l,r]=s(!1),[c,d]=s(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=Gt({newToken:""});return t(ut,{richTitle:{icon:kl,title:"Odigos Pro Token"},children:e(gm,{$isExpired:c,children:[e(me,{$justifyContent:"space-between",children:[e(ee,{$gap:4,children:[t(fm,{children:"Issued for"}),t(pe,{size:he.XS,children:o.name||"N/A"})]}),e(ee,{$gap:4,children:[t(fm,{children:"Expiration"}),t(mm,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ee,{})]}),t(me,{children:e(ee,{children:[t(fm,{children:"Token"}),t(hm,{token:o.token,newToken:p.newToken,isLoading:i,isEditing:l,onEdit:()=>r(!0),onCancel:()=>(r(!1),void u("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;a(!0);const e=await n.updateToken(p.newToken.trim());a(!1),e?.error?m("newToken",e.error):(r(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},vm=b.div`
|
|
860
873
|
display: flex;
|
|
861
874
|
flex-direction: column;
|
|
862
875
|
align-items: center;
|
|
@@ -865,23 +878,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
865
878
|
padding: 12px 24px;
|
|
866
879
|
border-radius: 8px;
|
|
867
880
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
868
|
-
`,pm=()=>{const{progress:o}=Ot(),{describeApi:n,namespacesApi:i}=Ll(),{items:a}=i.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:p}=Ht({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(dt,{richTitle:{icon:xl,title:"Diagnose"},children:l?e(dm,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[Dt.DownloadingDiagnose]?.percentage,percentage:o[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[Dt.DownloadingDiagnose]?.percentage,visualIcon:bl,startedAt:l}),o[Dt.DownloadingDiagnose]?.list?.length&&t(ee,{$width:"100%",children:o[Dt.DownloadingDiagnose].list.map((o,n)=>e(me,{$gap:4,$alignItems:"center",children:[o.status===Fe.Success?t(Ua,{size:16}):o.status===Fe.Error?t(Va,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(pe,{size:he.XXXS,color:ue.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(ee,{$gap:24,children:[t(pe,{size:he.XXS,color:ue.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(ee,{$gap:16,children:[e(me,{$gap:8,children:[t(oe,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include pprof profiles"})]}),e(me,{$gap:8,children:[t(oe,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include Prometheus metrics"})]}),e(me,{$gap:8,children:[t(oe,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(ln,{alignX:sn.Left,alignY:rn.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:be.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(qe,{label:c.sourceWorkloadNamespaces.length,status:Fe.Default}):void 0}}),t(me,{$justifyContent:"flex-end",children:t(ge,{label:"Download Diagnose",rightIcon:bl,variant:be.Primary,onClick:async()=>{n.downloadDiagnose&&(r(Date.now()),await n.downloadDiagnose(c),r(null),p())},disabled:null!==l})})]})})},um=()=>{const{platformType:e,version:o,tier:n}=S(),{describeApi:a}=Ll(),[l,r]=s(null);return i(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(dt,{richTitle:{icon:cl,title:"General Information"},children:t(Xt,{cellsPerRow:2,items:[{id:cn(),title:"Odigos Version",label:o},{id:cn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:cn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:cn(),title:"Tier",label:n}]})})},hm=({isOpen:o,onClose:n})=>{const{describeApi:i,tokensApi:a}=Ll(),l=a.useTokens().items[0];return e(ce,{isOpen:o,header:{icon:cl,title:"System Overview",onClose:n},children:[i.fetchDescribeOdigos&&t(um,{}),a.updateToken&&l&&t(cm,{token:l}),i.downloadDiagnose&&t(pm,{})]})},mm=({isOpen:n,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:s}=tt(),{dataStreamsApi:c}=Ll(),{requestSubmit:d}=zl(),p=r(async e=>{c.create?await c.create(e):(l([e]),s(e.name)),i()},[c,l,s,i]),u=r(()=>d(p),[d,p]);return nn({key:"Enter",active:n},u),e(o,{children:[t(Qe,{isOpen:n,onClose:i,onCloseEnd:a,title:et.NAME_YOUR_STREAM,description:et.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:be.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:i},children:t(Js,{autoFocus:!0})}),t(qs,{})]})},gm=({isOpen:n,onClose:a,onCloseEnd:l,dataStreamName:s})=>{const{dataStreamsApi:c}=Ll(),{genericForm:d,loadDataStream:p,requestSubmit:u}=zl();i(()=>{n&&s&&p(s)},[n,s]);const h=!!d?.isFormDirty,m=r(async e=>{await c.update(s,e),a()},[c,s,a]),g=r(()=>u(m),[u,m]);return nn({key:"Enter",active:n},g),e(o,{children:[t(Qe,{isOpen:n,onClose:a,onCloseEnd:l,title:et.RENAME_STREAM(s),description:et.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:a},children:t(Js,{autoFocus:!0})}),t(qs,{})]})},fm=({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)"})})]})]}),bm=b.div`
|
|
881
|
+
`,ym=()=>{const{progress:o}=Rt(),{describeApi:n,namespacesApi:i}=Bl(),{items:a}=i.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:p}=Gt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:Il,title:"Diagnose"},children:l?e(vm,{children:[t(wt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[Pt.DownloadingDiagnose]?.percentage,percentage:o[Pt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[Pt.DownloadingDiagnose]?.percentage,visualIcon:Sl,startedAt:l}),o[Pt.DownloadingDiagnose]?.list?.length&&t(ee,{$width:"100%",children:o[Pt.DownloadingDiagnose].list.map((o,n)=>e(me,{$gap:4,$alignItems:"center",children:[o.status===Fe.Success?t(Ga,{size:16}):o.status===Fe.Error?t(Wa,{size:16}):t(wt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(pe,{size:he.XXXS,color:ue.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(ee,{$gap:24,children:[t(pe,{size:he.XXS,color:ue.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(ee,{$gap:16,children:[e(me,{$gap:8,children:[t(oe,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include pprof profiles"})]}),e(me,{$gap:8,children:[t(oe,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include Prometheus metrics"})]}),e(me,{$gap:8,children:[t(oe,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(dn,{alignX:un.Left,alignY:pn.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:be.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Ze,{label:c.sourceWorkloadNamespaces.length,status:Fe.Default}):void 0}}),t(me,{$justifyContent:"flex-end",children:t(ge,{label:"Download Diagnose",rightIcon:Sl,variant:be.Primary,onClick:async()=>{n.downloadDiagnose&&(r(Date.now()),await n.downloadDiagnose(c),r(null),p())},disabled:null!==l})})]})})},Cm=()=>{const{platformType:e,version:o,tier:n}=S(),{describeApi:a}=Bl(),[l,r]=s(null);return i(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:hl,title:"General Information"},children:t(Vt,{cellsPerRow:2,items:[{id:hn(),title:"Odigos Version",label:o},{id:hn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:hn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:hn(),title:"Tier",label:n}]})})},Sm=({isOpen:o,onClose:n})=>{const{describeApi:i,tokensApi:a}=Bl(),l=a.useTokens().items[0];return e(ce,{isOpen:o,header:{icon:hl,title:"System Overview",onClose:n},children:[i.fetchDescribeOdigos&&t(Cm,{}),a.updateToken&&l&&t(bm,{token:l}),i.downloadDiagnose&&t(ym,{})]})},xm=({isOpen:n,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:s}=nt(),{dataStreamsApi:c}=Bl(),{requestSubmit:d}=Vl(),p=r(async e=>{c.create?await c.create(e):(l([e]),s(e.name)),i()},[c,l,s,i]),u=r(()=>d(p),[d,p]);return sn({key:"Enter",active:n},u),e(o,{children:[t(tt,{isOpen:n,onClose:i,onCloseEnd:a,title:ot.NAME_YOUR_STREAM,description:ot.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:zt.DONE,variant:be.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:zt.CANCEL,variant:be.Secondary,onClick:i},children:t(tc,{autoFocus:!0})}),t(ec,{})]})},wm=({isOpen:n,onClose:a,onCloseEnd:l,dataStreamName:s})=>{const{dataStreamsApi:c}=Bl(),{genericForm:d,loadDataStream:p,requestSubmit:u}=Vl();i(()=>{n&&s&&p(s)},[n,s]);const h=!!d?.isFormDirty,m=r(async e=>{await c.update(s,e),a()},[c,s,a]),g=r(()=>u(m),[u,m]);return sn({key:"Enter",active:n},g),e(o,{children:[t(tt,{isOpen:n,onClose:a,onCloseEnd:l,title:ot.RENAME_STREAM(s),description:ot.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:zt.SAVE,variant:be.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:zt.CANCEL,variant:be.Secondary,onClick:a},children:t(tc,{autoFocus:!0})}),t(ec,{})]})},Tm=({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)"})})]})]}),km=b.div`
|
|
869
882
|
position: absolute;
|
|
870
883
|
top: 50%;
|
|
871
884
|
left: 50%;
|
|
872
885
|
transform: translate(-50%, -50%);
|
|
873
886
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
874
|
-
`,
|
|
887
|
+
`,Im=()=>{const{drawerType:o,setDrawerType:n}=fo(),i=o===gn.OnboardingDone,a=()=>n(null);return e(mn,{isOpen:i,onClose:a,children:[t(Tm,{}),t(km,{children:e(ee,{$gap:32,$alignItems:"center",children:[e(ee,{$gap:24,$alignItems:"center",children:[t(pe,{size:he.L,weight:500,children:"Welcome to"}),t(Ir,{size:260}),t(pe,{size:he.S,weight:400,children:"Your observability control plane is ready."})]}),t(ge,{label:"Get Started",rightIcon:Da,onClick:a})]})})]})},Em=b.div`
|
|
875
888
|
display: flex;
|
|
876
889
|
flex-direction: column;
|
|
877
890
|
gap: 8px;
|
|
878
891
|
padding: 4px 8px;
|
|
879
892
|
border-radius: 8px;
|
|
880
893
|
width: 100%;
|
|
881
|
-
`,
|
|
894
|
+
`,Nm=b.div`
|
|
882
895
|
white-space: pre;
|
|
883
896
|
overflow-x: auto;
|
|
884
|
-
|
|
897
|
+
`,$m=({name:o,recommended:n,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(Em,{children:[e(me,{$gap:8,$justifyContent:"space-between",children:[e(me,{$gap:4,children:[t(pe,{size:he.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Ze,{label:fn,leftIcon:El,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:he.XXXS})]}),t(le,{name:s??`sampling-onboarding-toggle-${o}`,label:i,labelAlign:re.Left,value:a,onChange:l,size:Ot.S})]}),t(Nm,{children:t(w,{parts:r})})]})},Om=b.div`
|
|
885
898
|
position: relative;
|
|
886
899
|
display: flex;
|
|
887
900
|
align-items: center;
|
|
@@ -891,18 +904,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
891
904
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
892
905
|
border-top-left-radius: 18px;
|
|
893
906
|
border-top-right-radius: 18px;
|
|
894
|
-
`,
|
|
907
|
+
`,Am=b.div`
|
|
895
908
|
position: absolute;
|
|
896
909
|
left: 16px;
|
|
897
910
|
top: 50%;
|
|
898
911
|
transform: translateY(-50%);
|
|
899
|
-
`,
|
|
912
|
+
`,Rm=b.div`
|
|
900
913
|
height: 16px;
|
|
901
914
|
width: 100%;
|
|
902
915
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
903
916
|
border-top-left-radius: 18px;
|
|
904
917
|
border-top-right-radius: 18px;
|
|
905
|
-
`,
|
|
918
|
+
`,Dm=b.div`
|
|
906
919
|
width: ${({$width:e})=>e}px;
|
|
907
920
|
display: flex;
|
|
908
921
|
flex-direction: column;
|
|
@@ -910,7 +923,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
910
923
|
gap: 22px;
|
|
911
924
|
padding: 8px 32px 32px 32px;
|
|
912
925
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
913
|
-
`,
|
|
926
|
+
`,_m=e=>t(Nl,{rotate:90,...e}),Pm=({children:o,center:n,onNext:i,nextLabel:a=bn,nextLoading:l})=>e(me,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,i&&t(ge,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:_m,variant:be.Primary,size:fe.M,onClick:i,loading:l})]}),Lm=e=>t(Nl,{rotate:-90,...e}),Fm=({title:o,onBack:n})=>{const i=v();return e(Om,{$hasBack:!!n,children:[n&&t(Am,{children:t(St,{"data-id":"sampling-onboarding-back",icon:Lm,size:xt.M,onClick:n})}),t(pe,{size:he.M,weight:500,color:i.v2.colors.white[500],align:"center",children:o})]})},Mm=b.div`
|
|
914
927
|
box-sizing: border-box;
|
|
915
928
|
width: ${({$width:e})=>e??"100%"};
|
|
916
929
|
${({$fillHeight:e})=>e&&y`
|
|
@@ -923,16 +936,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
923
936
|
padding: 16px;
|
|
924
937
|
border-radius: 16px;
|
|
925
938
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
926
|
-
`,
|
|
939
|
+
`,zm=({children:e,fillHeight:o,width:n})=>t(Mm,{$fillHeight:o,$width:n,children:e}),Bm=b.ul`
|
|
927
940
|
margin: 0;
|
|
928
941
|
padding: 0;
|
|
929
942
|
list-style: disc;
|
|
930
|
-
`,
|
|
943
|
+
`,Xm=b.li`
|
|
931
944
|
margin-left: 18px;
|
|
932
945
|
& + & {
|
|
933
946
|
margin-top: 6px;
|
|
934
947
|
}
|
|
935
|
-
`,
|
|
948
|
+
`,Um=({items:e,color:o})=>{const n=v(),i=o||n.v2.colors.silver[200];return t(Bm,{children:e.map((e,o)=>t(Xm,{style:{color:i},children:t(pe,{size:he.XXS,color:i,children:e})},o))})},Vm=({items:o})=>{const n=v();return t(ee,{$gap:16,children:o.map((o,i)=>e(me,{$gap:8,$alignItems:"flex-start",children:[e(pe,{size:he.XS,color:n.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ee,{$gap:2,children:[t(pe,{size:he.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(pe,{size:he.XS,color:n.v2.colors.silver[200],children:o.description})]})]},i))})},Hm=({message:e})=>t(Le,{status:Fe.Default,message:e,fullWidth:!0,smallIcon:!0}),jm=b.div`
|
|
936
949
|
width: 100%;
|
|
937
950
|
padding: 8px;
|
|
938
951
|
display: flex;
|
|
@@ -940,12 +953,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
940
953
|
gap: 4px;
|
|
941
954
|
border-radius: 16px;
|
|
942
955
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
943
|
-
`,
|
|
956
|
+
`,Gm=b.div`
|
|
944
957
|
display: flex;
|
|
945
958
|
align-items: center;
|
|
946
959
|
gap: 8px;
|
|
947
960
|
padding: 4px 8px 12px 8px;
|
|
948
|
-
`,
|
|
961
|
+
`,Wm=b.div`
|
|
949
962
|
width: 100%;
|
|
950
963
|
display: flex;
|
|
951
964
|
flex-direction: column;
|
|
@@ -953,20 +966,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
953
966
|
padding: 8px;
|
|
954
967
|
border-radius: 12px;
|
|
955
968
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
956
|
-
`,
|
|
969
|
+
`,Km=({children:e})=>{const o=v();return t(pe,{size:he.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Ym=b.div`
|
|
957
970
|
white-space: pre-line;
|
|
958
|
-
`,
|
|
971
|
+
`,qm=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=v(),c=a(()=>A({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(Fm,{title:vn,onBack:l}),e(Dm,{$width:854,children:[t(Km,{children:yn}),e(ee,{$gap:8,$width:"100%",children:[t(zm,{children:t(Ym,{children:t(pe,{size:he.XXS,color:s.v2.colors.silver[200],children:Cn})})}),e(ee,{$gap:8,$width:"100%",children:[e(jm,{children:[t(Gm,{children:t(pe,{size:he.S,weight:500,color:s.v2.colors.white[500],children:Sn})}),t(Wm,{children:t($m,{name:wn,recommended:!0,toggleLabel:xn,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Hm,{message:Tn})]})]})]}),t(Pm,{onNext:r})]})},Jm=e=>t(Nl,{rotate:90,...e}),Zm=({onClose:n})=>{const i=v();return e(o,{children:[t(Rm,{}),e(Dm,{$width:732,children:[t(kn,{icon:wl}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[t(pe,{size:he.M,weight:500,color:i.v2.colors.white[500],children:In}),En.split("\n").map((e,o)=>t(Km,{children:e},`subtitle-${o}-${e}`)),e(zm,{children:[t(pe,{size:he.XS,color:i.v2.colors.silver[200],children:Nn}),t(Um,{color:i.v2.colors.white[500],items:[$n,On,An]})]})]})]}),t(Pm,{center:!0,children:t(ge,{"data-id":"sampling-onboarding-btn-go-to",label:Rn,rightIcon:Jm,variant:be.Primary,size:fe.M,onClick:n})})]})},Qm=e=>t(Nl,{rotate:90,...e}),eg=b.div`
|
|
959
972
|
display: flex;
|
|
960
973
|
flex-direction: column;
|
|
961
974
|
align-items: center;
|
|
962
975
|
gap: 8px;
|
|
963
976
|
width: 100%;
|
|
964
|
-
`,
|
|
977
|
+
`,tg=({onSkip:n,onNext:i})=>{const a=v();return e(o,{children:[t(Rm,{}),e(Dm,{$width:732,children:[t(kn,{icon:wl}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[e(eg,{children:[t(pe,{size:he.M,weight:500,color:a.v2.colors.white[500],children:Dn}),t(Km,{children:_n})]}),e(zm,{children:[t(pe,{size:he.XS,color:a.v2.colors.silver[200],children:Pn}),t(Vm,{items:[{title:Fn,description:Ln},{title:zn,description:Mn},{title:Xn,description:Bn}]}),t(Hm,{message:Un})]})]})]}),e(Pm,{center:!0,children:[t(ge,{"data-id":"sampling-onboarding-btn-skip",label:Vn,variant:be.Secondary,onClick:n}),t(ge,{"data-id":"sampling-onboarding-btn-start",label:Hn,rightIcon:Qm,variant:be.Primary,onClick:i})]})]})},og=b.div`
|
|
965
978
|
display: flex;
|
|
966
979
|
align-items: stretch;
|
|
967
980
|
gap: 16px;
|
|
968
981
|
width: 100%;
|
|
969
|
-
`,
|
|
982
|
+
`,ng=b.div`
|
|
970
983
|
flex: 1;
|
|
971
984
|
display: flex;
|
|
972
985
|
flex-direction: column;
|
|
@@ -986,18 +999,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
986
999
|
background-color: ${t.v2.colors.silver[700]};
|
|
987
1000
|
}
|
|
988
1001
|
`}
|
|
989
|
-
`,
|
|
1002
|
+
`,ig=b.div`
|
|
990
1003
|
display: flex;
|
|
991
1004
|
align-items: center;
|
|
992
1005
|
gap: 8px;
|
|
993
1006
|
padding: 12px 16px;
|
|
994
|
-
`,
|
|
1007
|
+
`,ag=b.div`
|
|
995
1008
|
flex: 1;
|
|
996
1009
|
padding: 8px;
|
|
997
1010
|
display: flex;
|
|
998
1011
|
flex-direction: column;
|
|
999
1012
|
gap: 8px;
|
|
1000
|
-
`,
|
|
1013
|
+
`,lg=b.div`
|
|
1001
1014
|
flex: 1;
|
|
1002
1015
|
display: flex;
|
|
1003
1016
|
flex-direction: column;
|
|
@@ -1005,17 +1018,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1005
1018
|
padding: 12px;
|
|
1006
1019
|
border-radius: 12px;
|
|
1007
1020
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
1008
|
-
`,
|
|
1021
|
+
`,rg=b.div`
|
|
1009
1022
|
display: flex;
|
|
1010
1023
|
justify-content: flex-end;
|
|
1011
|
-
`,
|
|
1024
|
+
`,sg=b.div`
|
|
1012
1025
|
display: flex;
|
|
1013
1026
|
align-items: center;
|
|
1014
1027
|
gap: 8px;
|
|
1015
1028
|
padding: 4px 12px 4px 4px;
|
|
1016
1029
|
border-radius: 8px;
|
|
1017
1030
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
1018
|
-
`,
|
|
1031
|
+
`,cg=b.div`
|
|
1019
1032
|
display: flex;
|
|
1020
1033
|
align-items: center;
|
|
1021
1034
|
justify-content: center;
|
|
@@ -1023,13 +1036,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1023
1036
|
height: 24px;
|
|
1024
1037
|
border-radius: 6px;
|
|
1025
1038
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
1026
|
-
`,
|
|
1039
|
+
`,dg=({selected:o,onSelect:n,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),p=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(ng,{$selected:o,onClick:n,children:[e(ig,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${i}`,value:o,onChange:n,size:we.L}),t(wl,{size:24,fill:d.v2.colors.white[500]}),t(pe,{size:he.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(ag,{children:[e(lg,{$selected:o,children:[e(ee,{$gap:8,children:[t(Ze,{...l,textSize:he.XXXS}),t(pe,{size:he.XXS,color:p,children:a})]}),r&&r.length>0&&t(Um,{color:p,items:r}),s&&e(sg,{children:[t(cg,{children:t(Tl,{size:18,fill:d.v2.colors.yellow[500]})}),t(pe,{size:he.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(rg,{children:t(ge,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:ri,rightIcon:La,variant:be.Text,size:fe.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},pg=({strategy:n,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(Fm,{title:jn,onBack:a}),e(Dm,{$width:854,children:[t(Km,{children:Gn}),e(og,{children:[t(dg,{selected:"keep-list"===n,onSelect:()=>i("keep-list"),name:Zn,description:Jn,badgeProps:{label:qn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Kn,Yn],warning:Wn,onReadMore:c}),t(dg,{selected:"drop-list"===n,onSelect:()=>i("drop-list"),name:ni,description:oi,badgeProps:{label:ti,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Qn,ei],onReadMore:c}),t(dg,{selected:"advanced"===n,onSelect:()=>i("advanced"),name:li,description:ai,badgeProps:{label:ii,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Pm,{onNext:l})]})},ug=({onBack:n,onNext:i,submitting:l})=>{const r=v(),s=a(()=>[{title:pi,bullets:[si,ci,di]},{title:bi,bullets:[ui,hi,mi,gi,fi]}],[]);return e(o,{children:[t(Fm,{title:vi,onBack:n}),e(Dm,{$width:854,children:[t(Km,{children:yi}),t(me,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(zm,{fillHeight:!0,width:"50%",children:[t(pe,{size:he.XS,color:r.v2.colors.white[500],children:o.title}),t(Um,{items:o.bullets})]},n))}),t(Hm,{message:Ci})]}),t(Pm,{onNext:i,nextLoading:l})]})},hg=b.div`
|
|
1027
1040
|
white-space: pre-line;
|
|
1028
|
-
`,
|
|
1041
|
+
`,mg=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=a(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t(Fm,{title:Si,onBack:l}),e(Dm,{$width:854,children:[t(Km,{children:xi}),e(ee,{$gap:8,$width:"100%",children:[e(zm,{children:[t(hg,{children:t(pe,{size:he.XXS,color:c.v2.colors.silver[200],children:wi})}),t(Hm,{message:Ci})]}),e(jm,{children:[e(Gm,{children:[t(pe,{size:he.S,weight:500,color:c.v2.colors.white[500],children:Ti}),t(cl,{size:16,fill:c.v2.colors.silver[200]})]}),t(Wm,{children:t($m,{name:Ii,recommended:!0,toggleLabel:ki,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Pm,{onNext:r,nextLoading:s})]})},gg=b.div`
|
|
1029
1042
|
white-space: pre-line;
|
|
1030
|
-
`,
|
|
1043
|
+
`,fg=b.div`
|
|
1031
1044
|
width: fit-content;
|
|
1032
|
-
`,cg=["50","25","10","1","0.1"],dg=({value:o,onChange:n,label:i})=>{const l=v(),r=a(()=>cg.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ee,{$gap:8,children:[t(pe,{size:he.XS,color:l.v2.colors.white[500],children:i}),t(sg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},pg=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=a(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t($m,{title:wi,onBack:s}),e(km,{$width:854,children:[t(Bm,{children:Ti}),e(ee,{$gap:8,$width:"100%",children:[e(Am,{children:[t(rg,{children:t(pe,{size:he.XXS,color:p.v2.colors.silver[200],children:ki})}),t(_m,{items:[Ei,Ii,Ni,$i,Oi]}),t(Lm,{message:fi})]}),e(Fm,{children:[e(Mm,{children:[t(pe,{size:he.S,weight:500,color:p.v2.colors.white[500],children:Ai}),t(al,{size:16,fill:p.v2.colors.silver[200]})]}),t(zm,{children:t(Sm,{name:xi,recommended:!0,toggleLabel:Si,enabled:n,onEnabledChange:i,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(zm,{children:t(dg,{value:l,onChange:r,label:Ri})})]})]})]}),t(Im,{onNext:c,nextLoading:d})]})},ug=({isOpen:e,onClose:o,k8sHealthProbesConfig:n,samplingId:a,docsUrl:l})=>{const{samplingApi:c}=Ll(),[d,p]=s("welcome"),[u,h]=s(!0),[m,g]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);i(()=>{e&&(p("welcome"),h(n?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,n?.enabled]);const x=r(async()=>{const e=a??"default",t=[];if(u!==(n?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:n?.keepPercentage??0}))}if("advanced"!==m&&f){const o=c.createHighlyRelevant;o&&t.push(o({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const o=c.createCostReduction;o&&t.push(o({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),p("success")}catch{}finally{S(!1)}},[a,c,u,n?.enabled,n?.keepPercentage,m,f,v]);let w=null;switch(d){case"welcome":w=t(Wm,{onSkip:o,onNext:()=>p("noisy")});break;case"noisy":w=t(Um,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(ng,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:l});break;case"keep-list":w=t(pg,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(lg,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(ig,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Hm,{onClose:o})}return t(dn,{isOpen:e,onClose:o,children:w})};var hg,mg;(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"})(hg||(hg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"})(mg||(mg={}));const gg=[{id:mg.CloudConnector,label:"Cloud Connector"}];var fg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(fg||(fg={}));const bg=[{key:fg.Name,label:"Name"},{key:fg.Type,label:"Type"},{key:fg.Status,label:"Status"},{key:fg.OdigosVersion,label:"Odigos Version"},{key:fg.ConnectedSince,label:"Connected Since"},{key:fg.LastActivity,label:"Last Activity"}],vg=(e,t)=>{const o=e.find(e=>e.key===fg.Id)?.rawValue;return t(o?.toString()||"")},yg={[Fe.Success]:"Connected",[Fe.Warning]:"Degraded",[Fe.Error]:"Error",[Fe.Disabled]:"Disabled",[Fe.Info]:"Pending"},Cg={[Di.K8s]:ro.Purple,[Di.Vm]:ro.Blue,[Di.Connector]:ro.Green},Sg=({connections:o,getConnections:n,onClickConnection:l,deleteConnection:c,onCreateNew:d,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=Qt(),{capabilities:b}=Ll(),[y,C]=s(!1),[S,x]=s(o||[]),w=r(async()=>{try{C(!0),x(await n()??[])}catch(e){}finally{C(!1)}},[]);i(()=>{S.length||w()},[]);const[T,k]=s(""),[E,I]=s(null),[N,$]=s([]),[O,A]=s(!1),[R,P]=s(!1),L=r(()=>{A(!1),P(!0),w()},[w]),F=r(e=>{e===mg.CloudConnector?A(!0):d?.(e)},[d]),M=a(()=>E===hg.BulkConfig?h:E===hg.BulkSource?m:0,[E,h,m]),{supportedConnections:z,supportedConnectionIds:B}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Fe.Success,n=D(e.odigosVersion,t,e.type);return o&&n}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);i(()=>{if(!E||E===hg.Delete)return;const e=N.filter(e=>!B.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[E,N.length,B.length]);const X=a(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:fg.Id,rawValue:e.id},{key:fg.Name,rawValue:e.name},{key:fg.Type,rawValue:e.type,component:()=>t(Jt,{variant:Cg[e.type]??ro.Default,label:_i(e.type)})},{key:fg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Di.Connector){const o=yg[e.status]??"Pending",n=e.status===Fe.Success?Ua:e.status===Fe.Error?Va:void 0;return t(qe,{status:e.status,label:o,leftIcon:n})}const o=e.status===Fe.Success?"Connection live":"Connection lost",n=e.status===Fe.Success?Ua:Va;return t(qe,{status:e.status,label:o,leftIcon:n})})(e)},{key:fg.OdigosVersion,rawValue:e.odigosVersion},{key:fg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:fg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Fe.Success||E?void 0:()=>l(e),isSelected:N.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Fe.Success||E===hg.BulkConfig&&!D(e.odigosVersion,h,e.type)||E===hg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,N,T,E,h,m,f,l]),U=a(()=>S.length>0&&S.every(e=>e.type===Di.K8s),[S]),V=a(()=>{const e=(e,t)=>{$([e]),I(t)};return(e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===fg.Status)?.rawValue===Fe.Success)(e))return[{id:cn(),label:"Delete Connection",rightIcon:Da,onClick:()=>vg(e,i)}];const d=vg(e,e=>t.find(t=>t.id===e));if(d?.type!==Di.K8s)return[];const p=!!d&&D(d.odigosVersion,o,d.type),u=!!d&&D(d.odigosVersion,n,d.type),h=_(o,d?.type),m=_(n,d?.type),g=[];return a&&g.push({id:cn(),tooltip:u?et.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:ja,disabled:!u,onClick:()=>vg(e,a)}),l&&g.push({id:cn(),tooltip:et.ADD_DESTINATION,rightIcon:za,onClick:()=>vg(e,l)}),r&&g.push({id:cn(),tooltip:et.ADD_ACTION,rightIcon:Ma,onClick:()=>vg(e,r)}),s&&g.push({id:cn(),tooltip:et.ADD_INSTRUMENTATION_RULE,rightIcon:Ha,onClick:()=>vg(e,s)}),c&&g.push({id:cn(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:el,disabled:!p,onClick:()=>vg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,hg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,hg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,hg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,hg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,hg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,hg.BulkConfig):void 0})},[S,h,m,b]),H=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];o&&r.push({id:cn(),type:co.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Add Sources",rightIcon:ja,onClick:o}});const s=[n?{id:hg.BulkDestination,label:et.ADD_DESTINATION,icon:za}:null,i?{id:hg.BulkAction,label:et.ADD_ACTION,icon:Ma}:null,a?{id:hg.BulkInstrumentationRule,label:et.ADD_INSTRUMENTATION_RULE,icon:Ha}:null,l?{id:hg.BulkConfig,label:"Manage Configurations",icon:el}:null];return s.some(Boolean)&&r.push({id:cn(),type:co.ButtonDropData,buttonProps:{variant:be.Secondary,size:fe.S,label:"Bulk Operations",onClick:e=>{e===hg.BulkSource?o?.():e===hg.BulkDestination?n?.():e===hg.BulkAction?i?.():e===hg.BulkInstrumentationRule?a?.():e===hg.BulkConfig&&l?.()}},dropDataProps:{alignX:sn.Left,items:s}}),r.push({id:cn(),type:co.Button,buttonProps:{variant:be.Text,size:fe.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>I(hg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>I(hg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>I(hg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>I(hg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>I(hg.BulkConfig):void 0}),[b]);return t(Pi,{children:e(dt,{fullHeight:!0,richTitle:{icon:kl,title:et.CONNECTIONS,badge:{label:S.length.toString(),status:Fe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,leftIcon:Qa,onClick:w,disabled:y}},{id:"connections-create-new",type:co.ButtonDropData,buttonProps:{variant:be.Primary,size:fe.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:sn.Right,items:gg}}],children:[t(Ao,{variant:Ro.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:bg,rows:X,rowActionsPushRightPosition:E?`calc(${vr} - 24px)`:void 0,getRowActions:V}),E===hg.BulkConfig&&b.canApplyEffectiveConfig&&t(ql,{connectionIds:N,children:t(Sp,{onClose:()=>I(null),connections:z,selectedConnectionIds:N,setSelectedConnectionIds:$})}),E===hg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(ql,{connectionIds:N,children:t(Jl,{selectedConnectionIds:N,children:t(Lc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(ql,{connectionIds:N,children:t(Zl,{children:t(Sc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkAction&&b.canCreateAction&&t(ql,{connectionIds:N,children:t(Ql,{children:t(pc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(ql,{connectionIds:N,children:t(er,{children:t(xc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),O&&t(tr,{providers:p,children:t(vp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(wr,{isOpen:R,onClose:()=>P(!1)}),t(Cr,{target:"connection",isOpen:E===hg.Delete,onClose:()=>{$([]),I(null)},onApprove:async()=>{const e=N[0];e&&(await c(e),await w())}}),t(Do,{isOpen:!!N.length&&!E,richTitle:{icon:Oa,title:"Selected Clusters",badge:{label:N.length}},actions:H})]})})},xg=b.div`
|
|
1045
|
+
`,bg=["50","25","10","1","0.1"],vg=({value:o,onChange:n,label:i})=>{const l=v(),r=a(()=>bg.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ee,{$gap:8,children:[t(pe,{size:he.XS,color:l.v2.colors.white[500],children:i}),t(fg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},yg=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=a(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t(Fm,{title:Ei,onBack:s}),e(Dm,{$width:854,children:[t(Km,{children:Ni}),e(ee,{$gap:8,$width:"100%",children:[e(zm,{children:[t(gg,{children:t(pe,{size:he.XXS,color:p.v2.colors.silver[200],children:$i})}),t(Um,{items:[Oi,Ai,Ri,Di,_i]}),t(Hm,{message:Ci})]}),e(jm,{children:[e(Gm,{children:[t(pe,{size:he.S,weight:500,color:p.v2.colors.white[500],children:Pi}),t(cl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Wm,{children:t($m,{name:Ii,recommended:!0,toggleLabel:ki,enabled:n,onEnabledChange:i,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Wm,{children:t(vg,{value:l,onChange:r,label:Li})})]})]})]}),t(Pm,{onNext:c,nextLoading:d})]})},Cg=({isOpen:e,onClose:o,k8sHealthProbesConfig:n,samplingId:a,docsUrl:l})=>{const{samplingApi:c}=Bl(),[d,p]=s("welcome"),[u,h]=s(!0),[m,g]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);i(()=>{e&&(p("welcome"),h(n?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,n?.enabled]);const x=r(async()=>{const e=a??"default",t=[];if(u!==(n?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:n?.keepPercentage??0}))}if("advanced"!==m&&f){const o=c.createHighlyRelevant;o&&t.push(o({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const o=c.createCostReduction;o&&t.push(o({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),p("success")}catch{}finally{S(!1)}},[a,c,u,n?.enabled,n?.keepPercentage,m,f,v]);let w=null;switch(d){case"welcome":w=t(tg,{onSkip:o,onNext:()=>p("noisy")});break;case"noisy":w=t(qm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(pg,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:l});break;case"keep-list":w=t(yg,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(mg,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(ug,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Zm,{onClose:o})}return t(mn,{isOpen:e,onClose:o,children:w})};var Sg,xg;(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"})(Sg||(Sg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"})(xg||(xg={}));const wg=[{id:xg.CloudConnector,label:"Cloud Connector"}];var Tg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(Tg||(Tg={}));const kg=[{key:Tg.Name,label:"Name"},{key:Tg.Type,label:"Type"},{key:Tg.Status,label:"Status"},{key:Tg.OdigosVersion,label:"Odigos Version"},{key:Tg.ConnectedSince,label:"Connected Since"},{key:Tg.LastActivity,label:"Last Activity"}],Ig=(e,t)=>{const o=e.find(e=>e.key===Tg.Id)?.rawValue;return t(o?.toString()||"")},Eg={[Fe.Success]:"Connected",[Fe.Warning]:"Degraded",[Fe.Error]:"Error",[Fe.Disabled]:"Disabled",[Fe.Info]:"Pending"},Ng={[Fi.K8s]:po.Purple,[Fi.Vm]:po.Blue,[Fi.Connector]:po.Green},$g=({connections:o,getConnections:n,onClickConnection:l,deleteConnection:c,onCreateNew:d,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=to(),{capabilities:b}=Bl(),[y,C]=s(!1),[S,x]=s(o||[]),w=r(async()=>{try{C(!0),x(await n()??[])}catch(e){}finally{C(!1)}},[]);i(()=>{S.length||w()},[]);const[T,k]=s(""),[I,E]=s(null),[N,$]=s([]),[O,A]=s(!1),[R,P]=s(!1),L=r(()=>{A(!1),P(!0),w()},[w]),F=r(e=>{e===xg.CloudConnector?A(!0):d?.(e)},[d]),M=a(()=>I===Sg.BulkConfig?h:I===Sg.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Fe.Success,n=D(e.odigosVersion,t,e.type);return o&&n}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);i(()=>{if(!I||I===Sg.Delete)return;const e=N.filter(e=>!B.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[I,N.length,B.length]);const X=a(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:Tg.Id,rawValue:e.id},{key:Tg.Name,rawValue:e.name},{key:Tg.Type,rawValue:e.type,component:()=>t(Qt,{variant:Ng[e.type]??po.Default,label:Mi(e.type)})},{key:Tg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Fi.Connector){const o=Eg[e.status]??"Pending",n=e.status===Fe.Success?Ga:e.status===Fe.Error?Wa:void 0;return t(Ze,{status:e.status,label:o,leftIcon:n})}const o=e.status===Fe.Success?"Connection live":"Connection lost",n=e.status===Fe.Success?Ga:Wa;return t(Ze,{status:e.status,label:o,leftIcon:n})})(e)},{key:Tg.OdigosVersion,rawValue:e.odigosVersion},{key:Tg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:Tg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Fe.Success||I?void 0:()=>l(e),isSelected:N.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Fe.Success||I===Sg.BulkConfig&&!D(e.odigosVersion,h,e.type)||I===Sg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,N,T,I,h,m,f,l]),U=a(()=>S.length>0&&S.every(e=>e.type===Fi.K8s),[S]),V=a(()=>{const e=(e,t)=>{$([e]),E(t)};return(e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Tg.Status)?.rawValue===Fe.Success)(e))return[{id:hn(),label:"Delete Connection",rightIcon:Fa,onClick:()=>Ig(e,i)}];const d=Ig(e,e=>t.find(t=>t.id===e));if(d?.type!==Fi.K8s)return[];const p=!!d&&D(d.odigosVersion,o,d.type),u=!!d&&D(d.odigosVersion,n,d.type),h=_(o,d?.type),m=_(n,d?.type),g=[];return a&&g.push({id:hn(),tooltip:u?ot.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:Ya,disabled:!u,onClick:()=>Ig(e,a)}),l&&g.push({id:hn(),tooltip:ot.ADD_DESTINATION,rightIcon:Va,onClick:()=>Ig(e,l)}),r&&g.push({id:hn(),tooltip:ot.ADD_ACTION,rightIcon:Ua,onClick:()=>Ig(e,r)}),s&&g.push({id:hn(),tooltip:ot.ADD_INSTRUMENTATION_RULE,rightIcon:Ka,onClick:()=>Ig(e,s)}),c&&g.push({id:hn(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:il,disabled:!p,onClick:()=>Ig(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,Sg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,Sg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,Sg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,Sg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,Sg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,Sg.BulkConfig):void 0})},[S,h,m,b]),H=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];o&&r.push({id:hn(),type:ho.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Add Sources",rightIcon:Ya,onClick:o}});const s=[n?{id:Sg.BulkDestination,label:ot.ADD_DESTINATION,icon:Va}:null,i?{id:Sg.BulkAction,label:ot.ADD_ACTION,icon:Ua}:null,a?{id:Sg.BulkInstrumentationRule,label:ot.ADD_INSTRUMENTATION_RULE,icon:Ka}:null,l?{id:Sg.BulkConfig,label:"Manage Configurations",icon:il}:null];return s.some(Boolean)&&r.push({id:hn(),type:ho.ButtonDropData,buttonProps:{variant:be.Secondary,size:fe.S,label:"Bulk Operations",onClick:e=>{e===Sg.BulkSource?o?.():e===Sg.BulkDestination?n?.():e===Sg.BulkAction?i?.():e===Sg.BulkInstrumentationRule?a?.():e===Sg.BulkConfig&&l?.()}},dropDataProps:{alignX:un.Left,items:s}}),r.push({id:hn(),type:ho.Button,buttonProps:{variant:be.Text,size:fe.S,label:zt.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>E(Sg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>E(Sg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>E(Sg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>E(Sg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>E(Sg.BulkConfig):void 0}),[b]);return t(zi,{children:e(ut,{fullHeight:!0,richTitle:{icon:$l,title:ot.CONNECTIONS,badge:{label:S.length.toString(),status:Fe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:ho.Button,buttonProps:{variant:be.Secondary,size:fe.S,leftIcon:nl,onClick:w,disabled:y}},{id:"connections-create-new",type:ho.ButtonDropData,buttonProps:{variant:be.Primary,size:fe.S,label:zt.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:un.Right,items:wg}}],children:[t(Po,{variant:Lo.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:kg,rows:X,rowActionsPushRightPosition:I?`calc(${xr} - 24px)`:void 0,getRowActions:V}),I===Sg.BulkConfig&&b.canApplyEffectiveConfig&&t(er,{connectionIds:N,children:t(kp,{onClose:()=>E(null),connections:z,selectedConnectionIds:N,setSelectedConnectionIds:$})}),I===Sg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(er,{connectionIds:N,children:t(tr,{selectedConnectionIds:N,children:t(Bc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),I===Sg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(er,{connectionIds:N,children:t(or,{children:t(kc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),I===Sg.BulkAction&&b.canCreateAction&&t(er,{connectionIds:N,children:t(nr,{children:t(gc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),I===Sg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(er,{connectionIds:N,children:t(ir,{children:t(Ic,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),O&&t(ar,{providers:p,children:t(xp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(Er,{isOpen:R,onClose:()=>P(!1)}),t(Tr,{target:"connection",isOpen:I===Sg.Delete,onClose:()=>{$([]),E(null)},onApprove:async()=>{const e=N[0];e&&(await c(e),await w())}}),t(Fo,{isOpen:!!N.length&&!I,richTitle:{icon:_a,title:"Selected Clusters",badge:{label:N.length}},actions:H})]})})},Og=b.div`
|
|
1033
1046
|
display: flex;
|
|
1034
1047
|
align-items: center;
|
|
1035
1048
|
justify-content: space-between;
|
|
@@ -1038,26 +1051,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1038
1051
|
width: 100%;
|
|
1039
1052
|
border-radius: 16px;
|
|
1040
1053
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1041
|
-
`,
|
|
1054
|
+
`,Ag=b.div`
|
|
1042
1055
|
display: flex;
|
|
1043
1056
|
align-items: center;
|
|
1044
1057
|
justify-content: center;
|
|
1045
1058
|
padding: 8px;
|
|
1046
1059
|
border-radius: 8px;
|
|
1047
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
1048
|
-
`,
|
|
1060
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+mt["004"]};
|
|
1061
|
+
`,Rg=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>o(2),d=()=>o(3),p=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,i)=>{if(!o.selected)return null;const a=o.kind||Nt.Namespace,l=a===Nt.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(Og,{children:[t(pe,{nowrap:!0,children:l}),t(Ze,{label:a,status:Fe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${i}`)})).filter(Boolean),[i]),u=a(()=>l?.map((o,n)=>{const i=kt(o.option.type).icon;return e(Og,{children:[e(me,{$gap:8,children:[i&&t(Ag,{children:t(i,{size:24})}),t(pe,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Ze,{status:o.testResult.succeeded?Fe.Success:Fe.Error,leftIcon:o.testResult.succeeded?Ga:Wa})]},`destination-${n}`)})||[],[l]);return t(Sr,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:ll,title:ot.SUMMARY,subTitle:ot.REVIEW_SETUP},leftColumn:{width:"50%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(Ya,{size:24}),t(pe,{nowrap:!0,children:ot.SELECTED_SOURCES}),t(Ze,{label:p.length})]}),t(ge,{"data-id":"summary-edit-sources",leftIcon:Ma,variant:be.Secondary,size:fe.S,onClick:c})]}),list:p.length?p:[t(vt,{$height:"100%",children:t(Re,{icon:Ya,title:ot.NO_SOURCES_SELECTED,subTitle:ot.ADD_SOURCE_PROMPT,button:{leftIcon:Ra,label:ot.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(Va,{size:24}),t(pe,{nowrap:!0,children:ot.SELECTED_DESTINATIONS}),t(Ze,{label:u.length})]}),t(ge,{"data-id":"summary-edit-destinations",leftIcon:Ma,variant:be.Secondary,size:fe.S,onClick:d})]}),list:u.length?u:[t(vt,{"data-id":"summary-no-destinations",$height:"100%",children:t(Re,{icon:Va,title:ot.NO_DESTINATIONS_SELECTED,subTitle:ot.ADD_DESTINATION_PROMPT,button:{leftIcon:Ra,label:ot.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Dg=b.div`
|
|
1049
1062
|
position: relative;
|
|
1050
1063
|
overflow: hidden;
|
|
1051
1064
|
width: 100vw;
|
|
1052
1065
|
height: 100vh;
|
|
1053
1066
|
box-sizing: border-box;
|
|
1054
|
-
`,
|
|
1067
|
+
`,_g=b.svg`
|
|
1055
1068
|
position: absolute;
|
|
1056
1069
|
top: 50%;
|
|
1057
1070
|
left: 50%;
|
|
1058
1071
|
transform: translate(-50%, -50%);
|
|
1059
1072
|
z-index: -1;
|
|
1060
|
-
`,
|
|
1073
|
+
`,Pg=[{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"}],Lg=[{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:Pg},{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:Pg},{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:Pg}],Fg=({paddingXAxis:o="0px",paddingYAxis:n="0px",children:l})=>{const[r,c]=s(window.innerWidth),d=a(()=>r/Lg[0].width,[r]);return i(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Dg,{$paddingXAxis:o,$paddingYAxis:n,children:[Lg.map(({width:o,height:n,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(_g,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:i,d:a,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},Mg=b.div`
|
|
1061
1074
|
display: flex;
|
|
1062
1075
|
flex-direction: column;
|
|
1063
1076
|
align-items: center;
|
|
@@ -1068,7 +1081,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1068
1081
|
width: 50vw;
|
|
1069
1082
|
border-radius: 16px;
|
|
1070
1083
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1071
|
-
`,
|
|
1084
|
+
`,zg=b.div`
|
|
1072
1085
|
display: flex;
|
|
1073
1086
|
flex-direction: column;
|
|
1074
1087
|
align-items: center;
|
|
@@ -1078,15 +1091,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1078
1091
|
& * {
|
|
1079
1092
|
text-align: center;
|
|
1080
1093
|
}
|
|
1081
|
-
`,
|
|
1094
|
+
`,Bg=({onStart:o})=>t(ce,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(vt,{$height:"100%",children:e(Mg,{children:[e(zg,{children:[t(pe,{size:he.L,weight:500,children:ot.GET_STARTED_WITH}),t(Ir,{size:260}),t(pe,{size:he.S,weight:400,children:ot.GET_STARTED_DESCRIPTION})]}),t(ge,{"data-id":"onboarding-get-started",label:zt.GET_STARTED,rightIcon:Da,size:fe.L,onClick:o})]})})}),Xg=[{step:1,label:ot.INSTALLATION,forceDoneBadge:!0},{step:2,label:ot.SOURCES_SETUP},{step:3,label:ot.DESTINATIONS_SETUP},{step:4,label:ot.SUMMARY}],Ug=b.div`
|
|
1082
1095
|
display: flex;
|
|
1083
1096
|
flex-direction: column;
|
|
1084
1097
|
gap: 32px;
|
|
1085
1098
|
padding: 64px;
|
|
1086
|
-
`,
|
|
1099
|
+
`,Vg=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:i})=>{const{setDrawerType:a}=fo(),{sourcesApi:l,destinationsApi:r}=Bl(),[c,d]=s(1),[p,u]=s(!1),[h,m]=s(null),[g,f]=s(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(Fg,{paddingXAxis:o,paddingYAxis:n,children:[e(Ug,{children:[t(Ir,{useInline:!0}),t(Bi,{currentStep:c,data:Xg,gap:32})]}),t(tr,{initialInputs:h,children:e(or,{children:[1===c&&t(Bg,{onStart:b}),2===c&&t(Bc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(kc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Rg,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.map(e=>r.create(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&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};a(gn.OnboardingDone),i()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Hg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),jg=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Gg=b.div`
|
|
1087
1100
|
position: relative;
|
|
1088
1101
|
display: inline-flex;
|
|
1089
|
-
`,
|
|
1102
|
+
`,Wg=b.button`
|
|
1090
1103
|
display: inline-flex;
|
|
1091
1104
|
align-items: center;
|
|
1092
1105
|
gap: 8px;
|
|
@@ -1099,7 +1112,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1099
1112
|
&:hover {
|
|
1100
1113
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1101
1114
|
}
|
|
1102
|
-
`,
|
|
1115
|
+
`,Kg=b.div`
|
|
1103
1116
|
position: absolute;
|
|
1104
1117
|
top: calc(100% + 8px);
|
|
1105
1118
|
right: 0;
|
|
@@ -1112,25 +1125,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1112
1125
|
border-radius: 12px;
|
|
1113
1126
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1114
1127
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1115
|
-
`,
|
|
1128
|
+
`,Yg=b.div`
|
|
1116
1129
|
display: flex;
|
|
1117
1130
|
flex-direction: column;
|
|
1118
1131
|
gap: 12px;
|
|
1119
1132
|
padding: 16px;
|
|
1120
1133
|
max-height: 60vh;
|
|
1121
1134
|
overflow-y: auto;
|
|
1122
|
-
`,
|
|
1135
|
+
`,qg=b.div`
|
|
1123
1136
|
display: flex;
|
|
1124
1137
|
align-items: center;
|
|
1125
1138
|
gap: 8px;
|
|
1126
1139
|
padding: 12px 16px;
|
|
1127
1140
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1128
|
-
`,
|
|
1141
|
+
`,Jg=b.div`
|
|
1129
1142
|
display: flex;
|
|
1130
1143
|
align-items: center;
|
|
1131
1144
|
gap: 8px;
|
|
1132
1145
|
margin-left: auto;
|
|
1133
|
-
`,
|
|
1146
|
+
`,Zg=()=>{const o=v(),{sourcesApi:n,namespacesApi:r}=Bl(),c=n.useSources().items,d=r.useNamespaces().items,{selectedStreamName:p}=nt(),{getItemSS:u,setItemSS:h,removeItemSS:m}=Gi(),{namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:x,clearAll:w,getEmptyState:T}=Xi(),k=a(()=>Ui(c,p),[c,p]);i(()=>{const e=u(Vi.OVERVIEW_FILTERS,T());x(e)},[]);const[I,E]=s({namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[N,$]=s(jg(I)),[O,A]=s(!1);i(()=>{if(!O){const e={namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};E(e),$(jg(e))}},[O,g,f,b,y,C,S]);const R=l(null);No(R,()=>A(!1)),sn({key:"Escape",active:O},()=>A(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[d]),_=a(()=>{const e=new Set,t=[];return k.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[k]),P=a(()=>{const e=new Set,t=[];return k.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Hi[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[k]),L=a(()=>ji.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=a(()=>{const e=new Set,t=[];return k.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:i}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:qt(n)})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[k]),M=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));E(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},z=O?Ha:ja,B=a(()=>Hg(I.languages),[I.languages]);return e(Gg,{ref:R,children:[e(Wg,{"data-id":"filters-trigger",$isOpen:O,type:"button",onClick:()=>A(e=>!e),children:[t(Ol,{size:16,fill:o.v2.colors.white[500]}),t(pe,{size:he.XS,weight:500,nowrap:!0,children:"Filters"}),N>0&&t(Ze,{label:N,status:Fe.Unknown,textSize:he.XXXS}),t(z,{size:16,fill:o.v2.colors.silver[200]})]}),O&&e(Kg,{children:[e(Yg,{children:[t(Ct,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Hg(I.namespaces),setValues:e=>M("namespaces",D,e)}),t(Ct,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:Hg(I.kinds),setValues:e=>M("kinds",_,e)}),t(Ct,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:B,setValues:e=>M("languages",P,e)}),t(Ct,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:Hg(I.monitors),setValues:e=>M("monitors",L,e)}),t(Ct,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:Hg(I.podsAgentInjectionStatus),setValues:e=>M("podsAgentInjectionStatus",F,e)}),t(le,{label:"Show only sources with errors",size:Ot.L,value:!!I.onlyErrors,onChange:e=>E(t=>({...t,onlyErrors:e}))})]}),e(qg,{children:[t(ge,{"data-id":"filters-reset",size:fe.S,variant:be.Text,label:"Reset",onClick:()=>{m(Vi.OVERVIEW_FILTERS),w(),E(T()),$(0),A(!1)},textColor:o.v2.colors.red[500]}),e(Jg,{children:[t(ge,{"data-id":"filters-cancel",size:fe.S,variant:be.Secondary,label:"Cancel",onClick:()=>A(!1)}),t(ge,{"data-id":"filters-apply",size:fe.S,variant:be.Primary,label:"Apply",onClick:()=>{h(Vi.OVERVIEW_FILTERS,I),x(I),$(jg(I)),A(!1)}})]})]})]})]})},Qg=b.div`
|
|
1134
1147
|
position: relative;
|
|
1135
1148
|
display: flex;
|
|
1136
1149
|
align-items: center;
|
|
@@ -1141,7 +1154,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1141
1154
|
box-sizing: border-box;
|
|
1142
1155
|
border-radius: 16px 16px 0 0;
|
|
1143
1156
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1144
|
-
`,
|
|
1157
|
+
`,ef=b.div`
|
|
1145
1158
|
position: absolute;
|
|
1146
1159
|
bottom: 0;
|
|
1147
1160
|
left: 0;
|
|
@@ -1150,7 +1163,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1150
1163
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
1151
1164
|
border-radius: 32px;
|
|
1152
1165
|
transition: width 0.3s;
|
|
1153
|
-
`,
|
|
1166
|
+
`,tf=({entityType:o,badge:n,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=fo();return e(Qg,{children:[e(me,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(oe,{size:Wi.S,partiallyChecked:r,value:!!s,onChange:c}),t(pe,{size:he.S,nowrap:!0,children:`${qt(o)}s`}),t(Ze,{label:n,tooltip:i,status:Fe.Unknown,textSize:he.XXXS})]}),e(me,{children:[t(St,{"data-id":`add-${o}`,icon:Ra,onClick:()=>p(Ki(o))}),t(St,{"data-id":`refresh-${o}`,icon:nl,onClick:l,disabled:a})]}),"number"==typeof d&&t(ef,{$percent:d})]})},of=b(ee)`
|
|
1154
1167
|
align-items: center !important;
|
|
1155
1168
|
justify-content: center !important;
|
|
1156
1169
|
align-self: stretch;
|
|
@@ -1165,7 +1178,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1165
1178
|
&:hover {
|
|
1166
1179
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1167
1180
|
}
|
|
1168
|
-
`,
|
|
1181
|
+
`,nf=({entityType:o,description:n})=>{const{setDrawerType:i}=fo();return e(of,{onClick:()=>i(Ki(o)),children:[e(me,{$gap:4,children:[t(Ra,{size:16}),t(pe,{size:he.S,children:`Add ${qt(o)}`})]}),t(pe,{size:he.XXS,align:"center",children:n})]})},af=b.div`
|
|
1169
1182
|
display: flex;
|
|
1170
1183
|
align-items: center;
|
|
1171
1184
|
gap: 12px;
|
|
@@ -1180,10 +1193,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1180
1193
|
&:hover {
|
|
1181
1194
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1182
1195
|
}
|
|
1183
|
-
`,
|
|
1196
|
+
`,lf=b(me)`
|
|
1184
1197
|
flex: 1;
|
|
1185
1198
|
min-width: 0;
|
|
1186
|
-
`,
|
|
1199
|
+
`,rf=({entityId:o,entityType:n,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=n===Nt.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=fo(),{selectedSources:x,setSelectedSources:w}=Yi(),T=m,k=f?T.id.namespace:"",I=a(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),E=b&&!h?Eo(Fe.Info,g):l?Eo(l,g):void 0,N=f&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}${o.region?`-${o.region}`:""}`:o;return e(af,{"data-id":N,$faded:y,onClick:()=>{C(So(n)),S(o)},children:[f&&t(oe,{size:Wi.S,value:-1!==I,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===I?e[k].push(T):e[k].splice(I,1),w(e)}}),t(Co,{icons:p,icon:d,iconSrc:u}),e(lf,{$gap:4,children:[t(De,{size:he.XS,nowrap:!0,children:i}),t(me,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t($e,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ze,{label:c,status:l&&[Fe.Error,Fe.Warning].includes(l)?l:Fe.Unknown,leftIcon:E,textSize:he.XXXS})})})]})]})};function sf(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Fe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:io.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function cf(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Fe.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const df=b.div`
|
|
1187
1200
|
position: absolute;
|
|
1188
1201
|
top: 0;
|
|
1189
1202
|
left: 0;
|
|
@@ -1194,21 +1207,21 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1194
1207
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1195
1208
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1196
1209
|
pointer-events: none;
|
|
1197
|
-
`,
|
|
1210
|
+
`,pf=b.div`
|
|
1198
1211
|
display: flex;
|
|
1199
1212
|
align-items: center;
|
|
1200
1213
|
gap: 8px;
|
|
1201
1214
|
padding: 4px 8px 0;
|
|
1202
|
-
`,
|
|
1215
|
+
`,uf=b.div`
|
|
1203
1216
|
flex: 1;
|
|
1204
1217
|
height: 1px;
|
|
1205
1218
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1206
|
-
`,
|
|
1219
|
+
`,hf=({namespace:e})=>{const o=v();return t(df,{children:t(pe,{size:he.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},mf=({namespace:o})=>{const n=v();return e(pf,{children:[t(uf,{}),t(pe,{size:he.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(uf,{})]})},gf={[Nt.InstrumentationRule]:ot.NO_DATA_INSTRUMENTATION_RULES,[Nt.Source]:ot.NO_DATA_SOURCES,[Nt.Action]:ot.NO_DATA_ACTIONS,[Nt.Destination]:ot.NO_DATA_DESTINATIONS},ff=b.div`
|
|
1207
1220
|
display: flex;
|
|
1208
1221
|
flex-direction: column;
|
|
1209
1222
|
flex: 1 0 0;
|
|
1210
1223
|
min-width: 0;
|
|
1211
|
-
`,
|
|
1224
|
+
`,bf=b.div`
|
|
1212
1225
|
display: flex;
|
|
1213
1226
|
flex-direction: column;
|
|
1214
1227
|
align-items: stretch;
|
|
@@ -1218,7 +1231,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1218
1231
|
border-radius: 0 0 16px 16px;
|
|
1219
1232
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1220
1233
|
overflow: hidden;
|
|
1221
|
-
`,
|
|
1234
|
+
`,vf=b.div`
|
|
1222
1235
|
position: relative;
|
|
1223
1236
|
display: flex;
|
|
1224
1237
|
flex-direction: column;
|
|
@@ -1230,7 +1243,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1230
1243
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1231
1244
|
height: ${({$height:e})=>e}px;
|
|
1232
1245
|
overflow: hidden;
|
|
1233
|
-
`,
|
|
1246
|
+
`,yf=({entityType:o,entities:n,unfilteredCount:l,metrics:c,loading:d,maxHeight:p,refetch:u})=>{const h=o===Nt.Source,m=n.length!==l,g=Rt(e=>h?e.progress[Pt.Instrumenting]?.percentage:void 0),f=Rt(e=>h?e.progress[Pt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Yi(),C=a(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=a(()=>{if(!c)return;const e=new Map,t=o===Nt.Source?c.sources:o===Nt.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(qi(o),o.throughput);return e},[c,o]),x=a(()=>n.map(e=>((e,t,o)=>{const n=Xt(e);if(!n)return null;const i=t===Nt.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status;switch(t){case io.Failure:return{status:Fe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case io.Notice:return{status:Fe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case io.Pending:case io.Waiting:return{status:void 0,faded:!1,displaySource:sf(e)};case io.Unsupported:case io.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:cf(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=Ji(e.conditions);a=t,r=o}const c=Zi(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case Nt.Source:{d=yo(e),p=ea(Nt.Source);const t=o?.get(Qi(n));h=To(t);break}case Nt.Destination:{const t=kt(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=o?.get(Qi(n));h=To(i),m=!e.disabled;break}case Nt.Action:p=jt(e.type),m=!e.disabled;break;case Nt.InstrumentationRule:p=eo(e.type),m=!e.disabled}return{key:Qi(n),entityId:n,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:n,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:p,icons:d,iconSrc:u,isActive:m,raw:s}}})(e,o,S)).filter(Boolean),[n,o,S]),[w,T]=s(""),{elements:k,indexToNamespace:I,multipleNs:E,dividerCount:N}=a(()=>{const e=[],o=[],n=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const n of x)h&&n.namespace&&n.namespace!==a&&(""!==a&&(o.push(n.namespace),e.push(t(mf,{namespace:n.namespace},`ns-divider-${n.namespace}`)),i+=1),a=n.namespace),o.push(n.namespace||""),e.push(t(rf,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:i}},[x,h]);i(()=>{if(h&&I.length&&!w){const e=I.find(Boolean);e&&T(e)}},[h,I]);const $=r(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==w&&T(t)},[I,w]),O=58*x.length+(E?28:0)+32*N,A=Math.max(0,p-52-16),R=Math.min(A,O)+8,D="number"==typeof b?`${b}%`:m?`${n.length}/${l}`:l;return e(ff,{children:[t(tf,{entityType:o,badge:D,badgeTooltip:m?ot.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:u,partiallySelected:C>0&&n?.length!==C,allSelected:C>0&&n?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(bf,{children:n.length?e(vf,{$height:R,children:[E&&w&&t(hf,{namespace:w}),t(go,{gap:4,elements:k,onTopIndexChange:E?$:void 0})]}):d?t(bt,{size:3}):t(nf,{entityType:o,description:gf[o]??ot.TO_COLLECT_OTEL_DATA})})]})},Cf=b.div`
|
|
1234
1247
|
width: 100%;
|
|
1235
1248
|
flex: 1;
|
|
1236
1249
|
min-height: 0;
|
|
@@ -1238,10 +1251,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1238
1251
|
display: flex;
|
|
1239
1252
|
align-items: stretch;
|
|
1240
1253
|
gap: 16px;
|
|
1241
|
-
`,
|
|
1254
|
+
`,Sf={sources:[],destinations:[]},xf=()=>{const o=Xi(),{selectedStreamName:n}=nt(),{containerRef:i,containerHeight:l}=ta(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=Bl(),{items:u,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=fo(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??Sf,w=a(()=>Ui(u,n),[u,n]),T=a(()=>Kt(m,n),[m,n]),k=a(()=>oa(w,o),[w,o]),I=a(()=>na(T,o),[T,o]),E=a(()=>ia(f,o),[f,o]);return e(Cf,{ref:i,children:[t(yf,{entityType:Nt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(yf,{entityType:Nt.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(yf,{entityType:Nt.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(yf,{entityType:Nt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},wf="40vw",Tf=b.div`
|
|
1242
1255
|
position: relative;
|
|
1243
|
-
width: ${
|
|
1244
|
-
`,
|
|
1256
|
+
width: ${wf};
|
|
1257
|
+
`,kf=b.div`
|
|
1245
1258
|
position: absolute;
|
|
1246
1259
|
top: calc(100% + 8px);
|
|
1247
1260
|
left: 0;
|
|
@@ -1250,23 +1263,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1250
1263
|
flex-direction: column;
|
|
1251
1264
|
gap: 8px;
|
|
1252
1265
|
padding: 8px;
|
|
1253
|
-
width: calc(${
|
|
1266
|
+
width: calc(${wf} - 16px);
|
|
1254
1267
|
border-radius: 12px;
|
|
1255
1268
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1256
1269
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
1257
|
-
`,
|
|
1270
|
+
`,If=b.div`
|
|
1258
1271
|
display: flex;
|
|
1259
1272
|
align-items: center;
|
|
1260
1273
|
overflow-x: auto;
|
|
1261
|
-
`,
|
|
1274
|
+
`,Ef=b.div`
|
|
1262
1275
|
display: flex;
|
|
1263
1276
|
flex-direction: column;
|
|
1264
1277
|
gap: 0;
|
|
1265
1278
|
max-height: 60vh;
|
|
1266
1279
|
overflow-y: auto;
|
|
1267
|
-
`,
|
|
1280
|
+
`,Nf=b.div`
|
|
1268
1281
|
padding: 8px 12px 4px 12px;
|
|
1269
|
-
|
|
1282
|
+
`,$f=b.div`
|
|
1270
1283
|
display: flex;
|
|
1271
1284
|
align-items: center;
|
|
1272
1285
|
gap: 8px;
|
|
@@ -1276,12 +1289,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1276
1289
|
&:hover {
|
|
1277
1290
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1278
1291
|
}
|
|
1279
|
-
`,
|
|
1292
|
+
`,Of=b.div`
|
|
1280
1293
|
padding: 16px 8px;
|
|
1281
|
-
`,
|
|
1294
|
+
`,Af=({preventPopup:o=!1})=>{const n=v(),{selectedStreamName:i}=nt(),{searchText:r,setSearchText:d}=Xi(),{setDrawerType:p,setDrawerEntityId:u}=fo(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Bl(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=l(null),[w,T]=s(!1),[k,I]=s("all"),E=!o&&(!!r||w),N=()=>{d(""),T(!1),I("all")};No(x,()=>N()),sn({key:"Escape",active:E},N);const{categories:$,searchResults:O}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?o.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,c=i?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,d=[{category:Nt.Source,label:"Sources",count:r.length,entities:[]},{category:Nt.Action,label:"Actions",count:s.length,entities:[]},{category:Nt.Destination,label:"Destinations",count:c.length,entities:[]},{category:Nt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const p=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Nt.InstrumentationRule?l:e.category===Nt.Source?r:e.category===Nt.Action?s:e.category===Nt.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:Ui(b,i),actions:C,destinations:Kt(y,i),searchText:r,selectedCategory:k}),[S,b,C,y,i,r,k]),A=a(()=>$.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[$]),R=O.some(({entities:e})=>e.length>0);return e(Tf,{ref:x,children:[t(mo,{value:r,onChange:e=>d(e.toLowerCase()),onFocus:()=>T(!0),width:wf}),E&&e(kf,{children:[A.length>1&&t(If,{children:t(ve,{options:A,selected:k,setSelected:I})}),R?t(Ef,{children:O.map(({category:o,label:i,entities:a},l)=>{if(!a.length)return null;const r=ea(o);return e(c,{children:[t(Nf,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:i})}),a.map((i,a)=>e($f,{onClick:()=>{const e=Xt(i);e&&(p(So(o)),u(e),N())},children:[r&&t(r,{size:16,fill:n.v2.colors.white[500]}),t(pe,{size:he.XS,nowrap:!0,children:Zi(i,o,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${o}`)})}):t(Of,{children:t(Re,{hideIcon:!0,title:"No results",subTitle:r?`No matches for "${r}"`:"Start typing to search"})})]})]})},Rf=({onRedirectToSampling:n})=>{const{sourcesApi:i}=Bl(),{items:l}=i.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=fo(),p=()=>{c(null),d(null)},u=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(o,{children:[t(Im,{}),r===gn.AddSource&&t(tr,{children:t(Bc,{onClose:p,withOverlay:!0})}),r===gn.AddDestination&&t(or,{children:t(kc,{onClose:p,withOverlay:!0})}),r===gn.AddInstrumentationRule&&t(ir,{sourceOptions:u,namespaceOptions:h,children:t(Ic,{onClose:p,withOverlay:!0})}),r===gn.AddAction&&t(nr,{children:t(gc,{onClose:p,withOverlay:!0})}),r===gn.EditSource&&t(lr,{children:t(em,{onClose:p,sourceId:s,onRedirectToSampling:n})}),r===gn.EditDestination&&t(or,{children:t(Ep,{onClose:p,destinationId:s})}),r===gn.EditInstrumentationRule&&t(ir,{sourceOptions:u,namespaceOptions:h,children:t($p,{onClose:p,ruleId:s})}),r===gn.EditAction&&t(nr,{children:t(Tp,{onClose:p,actionId:s})})]})},Df=b.div`
|
|
1282
1295
|
position: relative;
|
|
1283
1296
|
display: inline-flex;
|
|
1284
|
-
`,
|
|
1297
|
+
`,_f=b.div`
|
|
1285
1298
|
display: inline-flex;
|
|
1286
1299
|
align-items: center;
|
|
1287
1300
|
gap: 6px;
|
|
@@ -1292,7 +1305,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1292
1305
|
&:hover {
|
|
1293
1306
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1294
1307
|
}
|
|
1295
|
-
`,
|
|
1308
|
+
`,Pf=b.div`
|
|
1296
1309
|
position: absolute;
|
|
1297
1310
|
top: calc(100% + 8px);
|
|
1298
1311
|
left: 0;
|
|
@@ -1306,18 +1319,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1306
1319
|
border-radius: 12px;
|
|
1307
1320
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1308
1321
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1309
|
-
`,
|
|
1322
|
+
`,Lf=b.div`
|
|
1310
1323
|
display: flex;
|
|
1311
1324
|
align-items: center;
|
|
1312
1325
|
gap: 8px;
|
|
1313
1326
|
width: 100%;
|
|
1314
|
-
|
|
1327
|
+
`,Ff=b.div`
|
|
1315
1328
|
display: flex;
|
|
1316
1329
|
flex-direction: column;
|
|
1317
1330
|
gap: 0;
|
|
1318
1331
|
max-height: 240px;
|
|
1319
1332
|
overflow-y: auto;
|
|
1320
|
-
`,
|
|
1333
|
+
`,Mf=b.div`
|
|
1321
1334
|
display: flex;
|
|
1322
1335
|
align-items: center;
|
|
1323
1336
|
gap: 8px;
|
|
@@ -1328,29 +1341,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1328
1341
|
&:hover {
|
|
1329
1342
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
1330
1343
|
}
|
|
1331
|
-
`,
|
|
1344
|
+
`,zf=b.div`
|
|
1332
1345
|
flex: 1;
|
|
1333
1346
|
min-width: 0;
|
|
1334
1347
|
overflow: hidden;
|
|
1335
1348
|
text-overflow: ellipsis;
|
|
1336
1349
|
white-space: nowrap;
|
|
1337
|
-
`,
|
|
1350
|
+
`,Bf=b.div`
|
|
1338
1351
|
display: flex;
|
|
1339
1352
|
align-items: center;
|
|
1340
1353
|
gap: 2px;
|
|
1341
1354
|
flex-shrink: 0;
|
|
1342
|
-
`,
|
|
1355
|
+
`,Xf=b.div`
|
|
1343
1356
|
display: flex;
|
|
1344
1357
|
padding-top: 4px;
|
|
1345
1358
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1346
|
-
`,
|
|
1359
|
+
`,Uf=()=>{const n=v(),{isVm:r}=S(),{clearStore:c}=aa(),{dataStreamsApi:d}=Bl();d.useDataStreams();const{dataStreams:p,selectedStreamName:u,setSelectedStreamName:h}=nt(),m=l(null),[g,f]=s(!1),[b,y]=s(""),[C,x]=s(""),[w,T]=s(!1),[k,I]=s(!1),[E,N]=s(!1),[$,O]=s(""),[A,R]=s(!1);No(m,()=>f(!1)),i(()=>{g||y("")},[g]);const D=a(()=>{if(!b)return p;const e=b.toLowerCase();return p.filter(({name:t})=>t.toLowerCase().includes(e))},[p,b]),_=g?Ha:ja;return r?null:e(o,{children:[e(Df,{ref:m,children:[e(_f,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Al,{size:24}),t(pe,{size:he.S,weight:500,nowrap:!0,children:(P=u,`Data Stream: ${P}`)}),t(Ze,{label:p.length,status:Fe.Unknown,textSize:he.XXXS}),t(_,{size:20,fill:n.v2.colors.silver[200]})]}),g&&e(Pf,{children:[t(Lf,{children:t(mo,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(Ff,{children:0===D.length?t(Mf,{children:t(pe,{size:he.XS,color:ue.Secondary,children:"No streams match"})}):D.map(({name:o})=>{const n=o===la;return e(Mf,{"data-id":`stream-row-${o}`,$selected:o===u,onClick:()=>(e=>{e!==u&&(c(),h(e)),f(!1)})(o),children:[t(zf,{children:t(pe,{size:he.XS,nowrap:!0,children:o})}),e(Bf,{children:[t(St,{"data-id":`stream-edit-${o}`,icon:Ma,size:xt.XS,onClick:e=>{e.stopPropagation(),f(!1),x(o),T(!0)}}),!n&&t(St,{"data-id":`stream-delete-${o}`,icon:Aa,size:xt.XS,onClick:e=>{e.stopPropagation(),f(!1),O(o),R(!0)}})]})]},`stream-${o}`)})}),t(Xf,{children:t(ge,{"data-id":"add-stream-trigger",variant:be.Secondary,size:fe.S,leftIcon:Ra,label:`${zt.NEW} ${ot.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),c(),N(!0),I(!0)}})})]})]}),E&&t(rr,{defaultExcludeName:u,children:t(xm,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>N(!1)})}),C&&t(rr,{children:t(wm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Tr,{target:`${ot.STREAM_NAME.toLowerCase()} "${$}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{$&&await d.remove($)}})]});var P},Vf=()=>{const{selectedStreamName:n}=nt(),{selectedSources:l,setSelectedSources:c}=Yi(),{sourcesApi:d}=Bl(),[p,u]=s(!1),[h,m]=s(!1),g=a(()=>Object.values(l).reduce((e,t)=>e+t.length,0),[l]),f=r(()=>{c({})},[c]),b=r(()=>u(!1),[]),v=r(()=>m(!1),[]);i(()=>{f()},[n,f]);const y=r(()=>{d.restartWorkloads(Object.values(l).flat().filter(e=>e.id.kind!==xo.StaticPod).map(bo)),f()},[d,l,f]),C=r(()=>{d.persistV2(Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,region:e.region,selected:!1,currentStreamName:n}))]))),f()},[d,l,n,f]),S=a(()=>[{id:"multi-source-deselect",type:ho.Button,buttonProps:{variant:be.Text,size:fe.S,label:"Deselect",onClick:f}},{id:"multi-source-restart",type:ho.Button,buttonProps:{variant:be.Secondary,size:fe.S,label:"Restart",leftIcon:ml,onClick:()=>u(!0)}},{id:"multi-source-uninstrument",type:ho.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Uninstrument",leftIcon:Aa,onClick:()=>m(!0)}}],[f]);return e(o,{children:[t(Fo,{isOpen:g>0,richTitle:{icon:Ya,title:"Selected sources",badge:{label:g}},actions:S}),t(tt,{isOpen:p,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:b,denyButton:{label:"Go Back",variant:be.Secondary,onClick:b},approveButton:{label:"Confirm",variant:be.Primary,onClick:()=>{y(),b()}}}),t(Tr,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},Hf=C`
|
|
1347
1360
|
0% {
|
|
1348
1361
|
background-position: 200% 50%;
|
|
1349
1362
|
}
|
|
1350
1363
|
100% {
|
|
1351
1364
|
background-position: 0% 50%;
|
|
1352
1365
|
}
|
|
1353
|
-
`,
|
|
1366
|
+
`,jf=b.div`
|
|
1354
1367
|
display: flex;
|
|
1355
1368
|
align-items: center;
|
|
1356
1369
|
justify-content: space-evenly;
|
|
@@ -1361,43 +1374,43 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1361
1374
|
|
|
1362
1375
|
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%)`};
|
|
1363
1376
|
background-size: 200% 100%;
|
|
1364
|
-
animation: ${
|
|
1365
|
-
`,
|
|
1377
|
+
animation: ${Hf} 15s linear infinite;
|
|
1378
|
+
`,Gf=[Ka,Ya,Ua,Va],Wf=({onRedirectToSampling:o})=>{const n=v();return e(zi,{children:[e(ut,{fullHeight:!0,customTitle:t(Uf,{}),customSearch:t(Af,{}),filters:t(Zg,{}),children:[t(jf,{children:Gf.map((o,i)=>e(c,{children:[t(o,{size:24}),i<Gf.length-1&&t(Xa,{fill:n.v2.colors.white[500]+mt["020"],size:24})]},o.name))}),t(xf,{})]}),t(Rf,{onRedirectToSampling:o}),t(Vf,{})]})};var Kf;(e=>{e.Gateway="gateway",e.Node="node"})(Kf||(Kf={}));const Yf=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:hn(),type:ho.Button,buttonProps:{label:"Download Diagnose",leftIcon:Sl,size:fe.S,variant:be.Text,onClick:o,disabled:l}}),n&&e.push({id:hn(),type:ho.Button,buttonProps:{label:"Refresh",leftIcon:nl,size:fe.S,variant:be.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(me,{$alignItems:"center",$justifyContent:"space-between",children:[t(ra,{icon:Rl,title:"Collectors Pipeline"}),t(sa,{actions:r})]})},qf=({pod:o,onClose:n})=>{const{formatTimeAgo:i}=to(),{collectorsApi:l}=Bl(),{data:r}=l.usePodInfo(o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),s=a(()=>[{id:hn(),title:"Node",label:r?.node??"-",withCopy:!0},{id:hn(),title:"Status",badge:{status:ca(r?.status),label:r?.status??"-"}}],[r]),c=a(()=>r?.containers?.map(e=>({id:hn(),items:[{id:hn(),title:"Container",label:e.name??"-"},{id:hn(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:hn(),title:"Ready",badge:{status:e.ready?Fe.Success:Fe.Error,leftIcon:e.ready?_a:Pa,label:e.ready?"True":"False",invertColors:!0}},{id:hn(),title:"Started",badge:{status:e.started?Fe.Success:Fe.Error,leftIcon:e.started?_a:Pa,label:e.started?"True":"False",invertColors:!0}},{id:hn(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:hn(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:hn(),title:ot.RESTARTS,label:e.restarts.toString()},{id:hn(),title:"State Reason",label:e.stateReason??"-"},{id:hn(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:hn(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(ce,{isOpen:!!o,header:{icon:al,title:"Pod Information",onClose:n},children:r?e(Vt,{bgTint:"1000",richTitle:{icon:al,title:r.name,withCopy:!0},children:[t(Vt,{bgTint:"900",cellsPerRow:2,items:s}),e(Vt,{bgTint:"900",richTitle:{icon:hl,title:ot.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(uo,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(uo,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(uo,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Vt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:o})=>t(Vt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(Re,{title:"No containers",subTitle:"Pod has no containers"})}),t(kr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(vt,{$height:"50vh",children:t(wt,{withSpinner:!0})})})};var Jf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Jf||(Jf={}));const Zf=e=>{const t=[{key:Jf.PodName,label:"Pod Name"},{key:Jf.Status,label:"Status"},{key:Jf.Restarts,label:ot.RESTARTS},{key:Jf.NodeName,label:"Node Name"},{key:Jf.Age,label:"Age"},{key:Jf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Jf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Qf=({isLoading:o,pods:n,withSpanDropRate:i})=>{const l=v(),{formatTimeAgo:r}=to(),[c,d]=s(null),p=a(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:Jf.PodName,rawValue:o.name},{key:Jf.Status,rawValue:o.status,component:()=>{return e=o.status,t(Ze,{status:ca(e),label:e});var e}},{key:Jf.Restarts,rawValue:o.restartsCount.toString()},{key:Jf.NodeName,rawValue:o.nodeName},{key:Jf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(pe,{children:"-"});const i=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),a=i>0?Math.round((n?.metricsDroppedRps??0)/i*100):0,l=a>0?Fe.Error:Fe.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?Fe.Error:Fe.Success;return e(me,{$gap:4,children:[t($e,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Ze,{status:l,label:`Receiver ${a}%`,leftIcon:l===Fe.Error?Dl:_l,useSecondaryTone:!0,invertColors:!0})}),t($e,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Ze,{status:c,label:`Exporter ${s}%`,leftIcon:c===Fe.Error?Dl:_l,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Jf.Age,rawValue:r(o.creationTimestamp)},{key:Jf.DockerImage,rawValue:o.image}]})),[n,l]);return e(Vt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:al,title:"Pods"},children:[t(Po,{variant:Lo.Data,isLoading:o,columns:Zf(i),rows:p}),t(qf,{pod:c,onClose:()=>d(null)})]})},eb=({isOpen:e,onClose:o,title:n,yaml:i})=>t(ce,{isOpen:e,header:{icon:Pl,title:n,onClose:o},children:t(kr,{yaml:i,defaultOpen:!0})}),tb=e=>{switch(e){case da.Healthy:return"All desired replicas are updated, available, and ready";case da.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case da.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case da.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case da.Down:return"No available replicas";case da.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var ob;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(ob||(ob={}));const nb=b.div`
|
|
1366
1379
|
flex: 0.5;
|
|
1367
1380
|
padding: 12px;
|
|
1368
1381
|
border-radius: 12px;
|
|
1369
1382
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1370
|
-
`,
|
|
1383
|
+
`,ib=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=to(),[c,d]=s(null),p=a(()=>(e=>{switch(e){case Kf.Gateway:return"Deployment";case Kf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),u=a(()=>((e,t,o,n)=>{const i={status:Fe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Kf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Kf.Node:a=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return i}return a?{status:Fe.Info,label:"Rollout in progress",rightIcon:nl,useSecondaryTone:!0}:l?{status:Fe.Disabled,label:`Last Rollout: ${n(l)}`}:i})(o,n,i,r),[n,i,o,r]),h=a(()=>((e,t,o,n)=>{let i=n?Fe.Info:Fe.Unknown,a=n?"Loading":da.Unknown,l=n?"Fetching data...":tb(da.Unknown);switch(e){case Kf.Gateway:i=t?.status?ca(t?.status):i,a=t?.status??a,l=t?.status?tb(t.status):l;break;case Kf.Node:i=o?.status?ca(o?.status):i,a=o?.status??a,l=o?.status?tb(o.status):l}return{status:i,title:a,description:l}})(o,n,i,l),[n,i,o,l]),m=a(()=>((e,t,o)=>{switch(e){case Kf.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 Kf.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]),g=a(()=>((e,t,o,n)=>{switch(e){case Kf.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 Kf.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===Kf.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Kf.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(Vt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Pl,title:p,badge:u},actions:[{id:hn(),type:ho.ButtonDropData,buttonProps:{variant:be.Secondary,size:fe.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:ob.ManifestYaml,label:p,icon:Ll},{id:ob.ConfigMapYaml,label:"ConfigMap",icon:Ll}]}}],children:[e(me,{$gap:16,children:[t("div",{children:t(pa,{...h})}),m.map(e=>t(nb,{children:t("div",{children:t(ua,{...e})})},e.title)),g.map(e=>t(ha,{...e},e.title))]}),t(eb,{isOpen:c===ob.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(eb,{isOpen:c===ob.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},ab=[{value:Kf.Gateway,label:"Gateway"},{value:Kf.Node,label:"Node Collector"}],lb=({minSupportedVersion:o})=>{const{isVersionSupported:n,version:i,minSupportedVersion:l}=S(o),[c,d]=s(Kf.Gateway),p=c===Kf.Gateway,u=c===Kf.Node,{collectorsApi:h,configApi:m}=Bl(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!p}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!u}),{data:I=[],loading:E,refetch:N}=h.useNodeCollectorPods({skip:!u}),$=p&&(b||C)||u&&(T||E),O=r(()=>{p?(v(),x()):u&&(k(),N())},[p,u,v,x,k,N]),A=a(()=>p?y:I,[y,I,p]);return e(zi,{children:[t(Yf,{disabled:!n,loading:$,onClickDownloadDiagnose:void 0,onClickRefresh:O}),e(ma,{children:[e(ee,{children:[t(ve,{variant:_o.Underline,size:_e.L,options:ab,selected:c,setSelected:d}),t(ib,{selectedTab:c,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:$})]}),t(Qf,{isLoading:$,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(Nr,{minSupportedVersion:l,currentVersion:i||""})]})]})},rb=b.div`
|
|
1371
1384
|
display: inline-flex;
|
|
1372
1385
|
align-items: center;
|
|
1373
1386
|
min-width: 0;
|
|
1374
1387
|
overflow: hidden;
|
|
1375
1388
|
white-space: pre;
|
|
1376
1389
|
text-overflow: ellipsis;
|
|
1377
|
-
`,
|
|
1390
|
+
`,sb=b.div`
|
|
1378
1391
|
display: flex;
|
|
1379
1392
|
flex-direction: column;
|
|
1380
1393
|
gap: 4px;
|
|
1381
1394
|
min-width: 0;
|
|
1382
1395
|
flex: 1;
|
|
1383
1396
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
1384
|
-
`,
|
|
1397
|
+
`,cb=b(me)`
|
|
1385
1398
|
flex-shrink: 0;
|
|
1386
1399
|
gap: 6px;
|
|
1387
1400
|
align-items: center;
|
|
1388
1401
|
min-height: 22px;
|
|
1389
|
-
`,
|
|
1402
|
+
`,db=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],pb=[{value:"all",label:ga},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],ub=({title:o,items:n,isLoading:i,showTypeFilter:l,onRuleClick:c,onCreateRule:d,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=s(""),[f,b]=s("all"),y=a(()=>{let e=((e,t,o)=>o&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(n,f,l);return e=((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,m),e},[n,f,l,m]),C=a(()=>y.map(o=>{const n=o.typeBadge?((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(sb,{$disabled:o.disabled,children:[t(rb,{children:t(w,{parts:o.summary})}),o.name&&t(pe,{size:he.XXS,color:ue.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(cb,{children:[o.disabled&&t(Ze,{label:Mo,textSize:he.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Ze,{label:o.typeBadge,textSize:he.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),S=a(()=>{const e=e=>t(Fa,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=r(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:Vo,leftIcon:Ma,onClick:()=>p(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>u(o.ruleId,o.samplingId)}]:[]},[C,y,p,u,S]);return t(ut,{fullHeight:!0,richTitle:{icon:wl,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:m,onChange:g,placeholder:"Search..",width:"500px",...l?{segment:{"data-id":"sampling-segment-type-filter",options:pb,selected:f,setSelected:b}}:{}},children:t(Po,{variant:Lo.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:fa,subTitle:ya(m)}:{hideIcon:!0,title:va,button:{label:ba,onClick:d}},columns:db,rows:C,getRowActions:x})})},hb=({docsUrl:o})=>{const{samplingApi:n,sourcesApi:c}=Bl(),{items:d}=c.useSources(),p=a(()=>d.map(e=>({id:e.id})),[d]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=n.useSamplingRules(),f=r((e,t)=>n.createNoisy?.({samplingId:e,rule:t}),[n]),b=r((e,t,o)=>n.updateNoisy?.(t,{samplingId:e,rule:o}),[n]),v=r((e,t)=>n.createHighlyRelevant?.({samplingId:e,rule:t}),[n]),y=r((e,t,o)=>n.updateHighlyRelevant?.(t,{samplingId:e,rule:o}),[n]),C=r((e,t)=>n.createCostReduction?.({samplingId:e,rule:t}),[n]),S=r((e,t,o)=>n.updateCostReduction?.(t,{samplingId:e,rule:o}),[n]),x=r((e,t,o)=>"noisy"===o?n.deleteNoisy?.(t,e):"highlyRelevant"===o?n.deleteHighlyRelevant?.(t,e):"costReduction"===o?n.deleteCostReduction?.(t,e):void 0,[n]),w=r((e,t)=>n.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[n]),T=a(()=>p.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[p]),k=a(()=>Array.from(new Set(p.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[p]),[I,E]=s(P.Noisy),[N,$]=s(null),[O,D]=s(!1),[_,Q]=s(!1),[te,oe]=s(null),[ne,ie]=s(!1),[ae,le]=s(!1),[re,se]=s(!1),[ce,de]=s(!1);l(!1),i(()=>{},[h,u]);const{pendingViewSamplingRule:pe,setPendingViewSamplingRule:ue}=fo();i(()=>{if(!pe)return;if(h||0===u.length)return;ue(null);const e=L(u,pe.ruleId,pe.category);e&&(E(F[pe.category]),D(!1),$(e))},[h,u,pe,ue]);const he=a(()=>A(m),[m]),ye=a(()=>M(u),[u]),Ce=a(()=>R(ye?.rule??null),[ye]),Se=a(()=>z(u),[u]),xe=a(()=>B(Se?.rule??null),[Se]),we=l(N);we.current=N,i(()=>{const e=we.current;if(!e)return;const t=X(u,e);t?$(t):($(null),D(!1))},[u]);const Te=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),ke=a(()=>U(u,I,Te),[u,I,Te]),Ie=r(()=>Q(!0),[]),Ee=r(()=>Q(!1),[]);r(()=>de(!1),[]);const Ne=r(async e=>{const t=u[0]?.id??"default";switch(K[I]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[u,I,f,v,C]),$e=r(e=>{const t=G(u,e);t&&(D(!1),$(t))},[u]),Oe=r(()=>{$(null),D(!1)},[]),Ae=r((e,t)=>{const o=N;if(o&&o.rule.ruleId===e&&o.samplingId===t)D(!0),$({...o});else for(const o of u){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 D(!0),void $({category:n.category,rule:n.rule,samplingId:t,summary:W(n.category,n.rule)})}},[N,u]),Re=r(async(e,t,o)=>{const n=N?.category;if(n){switch(n){case"noisy":await b(o,t,j(e));break;case"highlyRelevant":await y(o,t,H(e));break;case"costReduction":await S(o,t,V(e))}D(!1)}},[N,b,y,S]),De=r((e,t)=>{oe({ruleId:e,samplingId:t})},[]),Pe=r(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=N?.category||K[I];await x(t,e,o),$(null),D(!1),oe(null)},[te,N,I,x]),Me=r(()=>oe(null),[]),ze=r(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=r(async e=>{const t=u[0]?.id??"default",o=ye;o?await y(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 v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[u,ye,v,y]),Xe=r(async(e,t)=>{const o=u[0]?.id??"default",n=Se;n?await S(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await C(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[u,Se,C,S]),Ue=r(e=>{const t=K[I];let o=null;switch(t){case"noisy":{const n=j(e);o=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=H(e);o=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=V(e);o=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:Ca,ruleId:o}:null},[u,I]),Ve=r(e=>{const t=N?.category,o=N?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=j(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=H(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=V(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:Ca,ruleId:n}:null},[u,N]),He=r(e=>{Q(!1);for(const t of u){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 D(!0),void $({category:o.category,rule:o.rule,samplingId:t.id,summary:W(o.category,o.rule)})}},[u]),je=a(()=>{const e=[];return o&&e.push({id:hn(),type:ho.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Sa,leftIcon:La,size:fe.S,variant:be.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:hn(),type:ho.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:xa,leftIcon:nl,size:fe.S,variant:be.Text,onClick:g,loading:h}}),e.push({id:hn(),type:ho.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:wa,rightIcon:Ra,size:fe.S,variant:be.Primary,onClick:Ie}}),e},[o,g,h,Ie]);return e(zi,{children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(ra,{icon:wl,title:ka,subTitle:Ta}),t(sa,{actions:je})]}),e(ee,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:_o.Underline,size:_e.L,options:q,selected:I,setSelected:E}),e(me,{$justifyContent:"space-between",children:[t(Le,{status:Fe.Default,message:J[I]}),o&&t(ge,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:La,size:fe.S,variant:be.Text,onClick:()=>window.open(o,"_blank")})]}),I===P.Noisy?t(ur,{title:ct,summary:he,onEdit:()=>ie(!0)}):I===P.HighlyRelevant?t(ur,{title:it,summary:Ce,onEdit:()=>le(!0)}):I===P.CostReduction?t(ur,{title:rt,summary:xe,onEdit:()=>se(!0)}):null,t(ub,{title:Z[I],items:ke,isLoading:h,showTypeFilter:I===P.HighlyRelevant,onRuleClick:$e,onCreateRule:Ie,onEditRule:Ae,onDeleteRule:De})]}),t(um,{formType:Gl.View,data:N,defaultEditMode:O,onClose:Oe,onDelete:De,onSaveEdit:Re,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(um,{formType:Gl.Create,isOpen:_,category:K[I],onClose:Ee,onSubmit:Ne,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(um,{formType:Gl.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(um,{formType:Gl.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(um,{formType:Gl.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(tt,{title:$a,description:Na,isOpen:!!te,onClose:Me,denyButton:{label:Ea,variant:be.Secondary,onClick:Me},approveButton:{label:Ia,variant:be.Primary,onClick:()=>{Pe(),Me()}}}),!1]})},mb=b.div`
|
|
1390
1403
|
padding: 12px;
|
|
1391
1404
|
border-radius: 12px;
|
|
1392
1405
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
1393
|
-
`,
|
|
1406
|
+
`,gb=f(({id:e,data:o})=>t(mb,{"data-id":e,children:t(Re,{...o})}));var fb,bb;gb.displayName=gb.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(fb||(fb={})),(e=>{e.AnimatedTraffic="animated-traffic"})(bb||(bb={}));const vb=(e,t,o)=>{if(o)return{icons:[ul],aggService:e,selected:!0};const n=e.isVirtual,i=n?[vo(e)]:t?yo(t):[Fl],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:Ji(t?.conditions||[]);return{icons:i,status:a,isVirtual:n,aggService:e,selected:!0}},yb=e=>!(!e||e.serviceName!==Jp||e.id.namespace||e.id.name||e.id.kind),Cb=new Hr,Sb={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},xb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},wb={id:{namespace:"",name:"",kind:""},serviceName:Jp,markedForInstrumentation:{markedForInstrumentation:!0}},Tb=h(null),kb=()=>{const e=m(Tb);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},Ib=({serviceMap:e,children:o})=>{const n=v(),{sourcesApi:l}=Bl(),{items:c}=l.useSources(),[d,p,u]=Ar([]),[h,m,g]=Rr([]),[f,b]=s(0),y=r(()=>b(e=>e+1),[]),[C,S]=s(""),[x,w]=s(null),[T,k]=s(null),I=r(e=>k(t=>t===e?null:e),[]),E=r(()=>k(null),[]),N=r((e,t)=>{const o=new Set(e);p(e=>e.map(e=>e.type===fb.MapItem&&o.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);i(()=>{let t=!1;const o=(e=>{const t=new Map,o=new Set,n=(e,o,n=!1)=>{let i=t.get(e);return i||(i={serviceName:o,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:o,value:n}of t)o in e||(e[o]=n)};for(const t of e){const{graphKey:e}=xb(t.nodeId),a=n(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=xb(e?.nodeId??"");e.isVirtual&&(o.add(t),i(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||n(i,a.targetServiceName,o.has(i));const l=[];for(const[e,{serviceName:o,isVirtual:n,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:o,isVirtual:n,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const o=[],n={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=yb(t);o.push({id:i.graphKey,type:fb.MapItem,position:n,data:vb(i,t,a),measured:{width:80,height:80}})}else o.push({id:fb.NoData,type:fb.NoData,position:n,data:{subTitle:ot.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return o})({aggregatedServiceMap:o,sources:[wb].concat(c)});if(1===i.length&&i[0].id===fb.NoData)return p(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:o})=>{const n=[],i=new Map(t.map(e=>[e.id,e]));for(const t of o){const o=t.graphKey,a=i.get(o);if(!a)continue;const l=a.data?.status===Fe.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&n.push({id:`${o}-to-${r}`,type:"smoothstep",source:o,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Or.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return n})({theme:n,nodes:i,aggregatedServiceMap:o});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,o={})=>{const n={id:"root",layoutOptions:{...Sb,...o},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Jp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await Cb.layout(n),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(i,a).then(({nodes:e})=>{t||(p(e),S(l),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return i.map(e=>{const o=t.get(e.id);return o?e.type===fb.MapItem&&o.type===fb.MapItem?{...e,position:o.position,data:{...e.data,selected:o.data.selected}}:{...e,position:o.position}:e})})},[n,e,c,C]);const $=a(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:bb.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),O=a(()=>({nodes:d,edges:$,onNodesChange:u,onEdgesChange:g,setNodesSelected:N,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:E}),[d,$,u,g,N,f,x,T,I,E]);return t(Tb.Provider,{value:O,children:o})},Eb=b.div`
|
|
1394
1407
|
border: 1px ${({theme:e,$isSelected:t,$isVirtual:o})=>t?`solid ${e.v2.colors.blue[300]}`:o?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
|
|
1395
1408
|
border-radius: 8px;
|
|
1396
1409
|
cursor: pointer;
|
|
1397
1410
|
opacity: ${({$isVirtual:e})=>e?.8:1};
|
|
1398
|
-
`,
|
|
1411
|
+
`,Nb=b.div`
|
|
1399
1412
|
position: relative;
|
|
1400
|
-
|
|
1413
|
+
`,$b=b.div`
|
|
1401
1414
|
position: absolute;
|
|
1402
1415
|
top: 100%;
|
|
1403
1416
|
left: 50%;
|
|
@@ -1406,7 +1419,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1406
1419
|
align-items: center;
|
|
1407
1420
|
gap: 4px;
|
|
1408
1421
|
margin-top: 4px;
|
|
1409
|
-
`,
|
|
1422
|
+
`,Ob=f(({id:n,data:i})=>{const{icons:l,status:r,isVirtual:s}=i,c=v(),{activeNodeId:d,hoveredNodeId:p}=kb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=a(()=>({isUserSource:n===Jp,isNodeSelected:d===n,isHovered:p===n}),[n,d,p,n]),{isSelected:g,isHighlighted:f}=a(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=r?Eo(r,c):null;return e(o,{children:[t(Dr,{type:"source",position:_r.Right,style:{visibility:"hidden"}}),t(Dr,{type:"target",position:_r.Left,style:{visibility:"hidden"}}),e(Nb,{"data-id":n,children:[t(Eb,{$isSelected:g,$isVirtual:s,children:t(Co,{padding:12,icons:l,status:f?Fe.Info:r})}),e($b,{children:[b&&t(b,{}),t(pe,{size:he.XXS,nowrap:!0,children:n})]})]})]})});Ob.displayName=Ob.name;const Ab=b.div`
|
|
1410
1423
|
display: flex;
|
|
1411
1424
|
flex-direction: column;
|
|
1412
1425
|
gap: 12px;
|
|
@@ -1419,10 +1432,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1419
1432
|
top: 16px;
|
|
1420
1433
|
left: 8px;
|
|
1421
1434
|
z-index: ${({theme:e})=>e.v2.zIndex.drawer};
|
|
1422
|
-
`,
|
|
1435
|
+
`,Rb=({children:e})=>t(Ab,{children:e});var Db,_b;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(Db||(Db={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(_b||(_b={}));const Pb=b.div`
|
|
1423
1436
|
flex: 1 1 auto;
|
|
1424
1437
|
min-height: 0;
|
|
1425
|
-
`,
|
|
1438
|
+
`,Lb=()=>{const{nodes:o,activeNodeId:n,resetActiveNode:i}=kb(),[l,r]=s(Db.All),c=a(()=>{const e=new Map;for(const t of o)t.type===fb.MapItem&&e.set(t.id,t);return e},[o]),d=a(()=>c.get(n??""),[c,n]),{inbound:p,outbound:u}=a(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:_b.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const o of t.data.aggService?.connections??[])o.targetGraphKey===d.id&&e.push({peerId:t.id,direction:_b.Inbound,totalRequests:o.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[Db.All,Db.Inbound].includes(l)&&p.length>0,m=[Db.All,Db.Outbound].includes(l)&&u.length>0;return e(Rb,{children:[e(me,{$width:"100%",$gap:8,children:[t(ge,{variant:be.Text,size:fe.S,leftIcon:tl,onClick:i}),t(Co,{icons:d.data.icons}),t(pe,{size:he.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${Db.All}`,value:Db.All,badge:{label:`${p.length+u.length}`}},{label:`${Db.Inbound}`,value:Db.Inbound,badge:{label:`${p.length}`}},{label:`${Db.Outbound}`,value:Db.Outbound,badge:{label:`${u.length}`}}],selected:l,setSelected:r}),h&&t(Mb,{halfHeight:m,title:"Inbound",icon:dl,connections:p,mapNodesById:c}),m&&t(Mb,{halfHeight:h,title:"Outbound",icon:pl,connections:u,mapNodesById:c})]})},Fb=b.div`
|
|
1426
1439
|
display: flex;
|
|
1427
1440
|
flex-direction: column;
|
|
1428
1441
|
gap: 8px;
|
|
@@ -1430,17 +1443,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1430
1443
|
border-radius: 12px;
|
|
1431
1444
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1432
1445
|
height: ${({$halfHeight:e})=>e?"48%":"100%"};
|
|
1433
|
-
`,
|
|
1446
|
+
`,Mb=({halfHeight:o,title:n,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(Fb,{$halfHeight:o,children:[e(me,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(pe,{size:he.XXS,color:ue.Secondary,children:n})]}),t(Pb,{children:t(go,{gap:4,elements:a.map(e=>t(Bb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},zb=b.div`
|
|
1434
1447
|
display: flex;
|
|
1435
1448
|
align-items: center;
|
|
1436
1449
|
gap: 8px;
|
|
1437
1450
|
padding: 8px;
|
|
1438
1451
|
border-radius: 8px;
|
|
1439
1452
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1440
|
-
`,
|
|
1453
|
+
`,Bb=({connection:o,peerNode:n})=>e(zb,{children:[n&&t(Co,{icons:n.data.icons}),e(me,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(pe,{size:he.XXS,children:o.peerId}),t(Ze,{label:o.totalRequests,tooltip:"Total requests"})]})]}),Xb="0;0.5;1",Ub=f(({id:n,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Pr({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${n}__animated-traffic-motion`,m=p.v2.colors.blue[700],g=p.v2.colors.blue[900],f=p.v2.colors.blue[500],b="4s";return e(o,{children:[t(Lr,{id:n,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Fr,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:u,fill:"none",stroke:"none"}),Array.from({length:5}).map((o,n)=>{const i=`-${(.8*n).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Xb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Xb,values:`${g};${f};${f}`})]},n)})]})})]})});Ub.displayName=Ub.name;const Vb=b.div`
|
|
1441
1454
|
flex: 1 1 auto;
|
|
1442
1455
|
min-height: 0;
|
|
1443
|
-
`,
|
|
1456
|
+
`,Hb=({})=>{const{nodes:o,setNodesSelected:n,resetActiveNode:i}=kb(),[l,c]=s(""),d=a(()=>o.filter(e=>e.type===fb.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[o]),p=a(()=>d.filter(e=>e.data.selected),[d]),u=a(()=>d.filter(e=>e.id.toLowerCase().includes(l.toLowerCase())),[d,l]),h=a(()=>u.every(e=>e.data.selected),[u]),m=r(()=>{const e=!h;n(u.map(e=>e.id),e),e||i()},[u,h,n,i]);return d.length?e(Rb,{children:[e(me,{$width:"100%",$gap:8,children:[t(pe,{size:he.XS,children:"Services"}),t(Ze,{label:d.length})]}),t(mo,{width:"100%",value:l,onChange:c}),e(me,{$width:"100%",$justifyContent:"space-between",children:[t(pe,{size:he.XXXS,children:`Showing ${p.length} out of ${d.length}`}),t(pe,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:he.XS,children:h?ot.UNSELECT_ALL:ot.SELECT_ALL})]}),t(Vb,{children:t(go,{gap:4,elements:u.map(e=>t(Gb,{node:e},e.id))})})]}):null},jb=b.div`
|
|
1444
1457
|
display: flex;
|
|
1445
1458
|
align-items: center;
|
|
1446
1459
|
gap: 8px;
|
|
@@ -1448,7 +1461,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1448
1461
|
border-radius: 8px;
|
|
1449
1462
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1450
1463
|
cursor: pointer;
|
|
1451
|
-
`,
|
|
1464
|
+
`,Gb=({node:o})=>{const{setNodesSelected:n,activeNodeId:i,resetActiveNode:a}=kb(),l=r(()=>{const e=!o.data.selected,t=i===o.id;n([o.id],e),!e&&t&&a()},[o,i,n,a]);return e(jb,{onClick:l,children:[t(oe,{value:o.data.selected||!1,onChange:l}),t(Co,{icons:o.data.icons}),t(pe,{size:he.XXS,children:o.id})]},o.id)},Wb=b.div`
|
|
1452
1465
|
position: relative;
|
|
1453
1466
|
height: 100%;
|
|
1454
1467
|
.react-flow__attribution {
|
|
@@ -1457,7 +1470,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1457
1470
|
* {
|
|
1458
1471
|
transition: none;
|
|
1459
1472
|
}
|
|
1460
|
-
`,
|
|
1473
|
+
`,Kb=b.div`
|
|
1461
1474
|
.react-flow__controls {
|
|
1462
1475
|
display: flex;
|
|
1463
1476
|
align-items: center;
|
|
@@ -1483,33 +1496,33 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1483
1496
|
}
|
|
1484
1497
|
}
|
|
1485
1498
|
}
|
|
1486
|
-
`,
|
|
1499
|
+
`,Yb={[fb.MapItem]:Ob,[fb.NoData]:gb},qb={[bb.AnimatedTraffic]:Ub},Jb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Zb=({trigger:e})=>{const{fitView:t}=Vr(),o=l(!0);return i(()=>{o.current?o.current=!1:e>0&&requestAnimationFrame(()=>t(Jb))},[e,t]),null},Qb=({onRefresh:o})=>{const{nodes:n,edges:i,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=kb(),p=a(()=>{const e=new Set(n.filter(e=>e.type===fb.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const o of i)e.has(o.source)&&t.add(o.target),e.has(o.target)&&t.add(o.source);return n.filter(e=>e.type!==fb.MapItem||e.data.selected||t.has(e.id))},[n,i]);return e(zr,{zoomOnScroll:!0,nodes:p,nodeTypes:Yb,edges:i,edgeTypes:qb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Br,{}),t(Zb,{trigger:l}),t(Kb,{children:t(Xr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Jb,children:t(Ur,{onClick:o,children:t(nl,{})})})})]})},ev=o=>t(Mr,{children:e(Wb,{children:[t(Qb,{...o}),t(Hb,{}),t(Lb,{})]})}),tv=b.div`
|
|
1487
1500
|
width: 100%;
|
|
1488
1501
|
flex: 1;
|
|
1489
1502
|
align-self: stretch;
|
|
1490
1503
|
min-height: 0;
|
|
1491
1504
|
height: 100%;
|
|
1492
1505
|
position: relative;
|
|
1493
|
-
`,
|
|
1506
|
+
`,ov=()=>{const{serviceMapApi:e}=Bl(),{data:o,refetch:n}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(Ib,{serviceMap:o?.serviceMap??[],children:t(tv,{children:t(ev,{onRefresh:n})})})},nv=b.div`
|
|
1494
1507
|
display: flex;
|
|
1495
1508
|
align-items: center;
|
|
1496
1509
|
justify-content: space-between;
|
|
1497
1510
|
padding: 0 12px;
|
|
1498
|
-
`,
|
|
1511
|
+
`,iv=b.div`
|
|
1499
1512
|
display: flex;
|
|
1500
1513
|
align-items: center;
|
|
1501
1514
|
gap: 8px;
|
|
1502
|
-
`,
|
|
1515
|
+
`,av=b.div`
|
|
1503
1516
|
width: 1px;
|
|
1504
1517
|
height: 20px;
|
|
1505
1518
|
background-color: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1506
|
-
`,
|
|
1519
|
+
`,lv=({disabled:o,loading:n,onClickShowYaml:i,onClickReset:l,onClickRefresh:r})=>{const c=v(),[d,p]=s(!1),u=a(()=>i?[{id:hn(),type:ho.Button,buttonProps:{label:"Show Config YAML",leftIcon:Ll,size:fe.S,variant:be.Secondary,onClick:i,disabled:o}}]:[],[i,o]),h=a(()=>{const e=[];return r&&e.push({id:hn(),type:ho.Button,buttonProps:{leftIcon:nl,tooltip:"Refresh",hideTooltipIcon:!0,size:fe.S,variant:be.Text,onClick:r,disabled:o,loading:n}}),l&&e.push({id:hn(),type:ho.Button,buttonProps:{leftIcon:Aa,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:fe.S,variant:be.Text,textColor:c.v2.colors.red[500],onClick:()=>p(!0),disabled:o}}),e},[o,n,l,r,c]),m=u.length>0,g=h.length>0;return e(nv,{children:[t(ra,{icon:il,title:"Odigos Settings"}),e(iv,{children:[m&&t(sa,{actions:u}),m&&g&&t(av,{}),g&&t(sa,{actions:h})]}),t(tt,{isOpen:d,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:be.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:be.Primary,onClick:()=>{l?.(),p(!1)}}})]})},rv=b(ee)`
|
|
1507
1520
|
width: 220px;
|
|
1508
1521
|
flex-shrink: 0;
|
|
1509
1522
|
height: 100%;
|
|
1510
1523
|
gap: 4px;
|
|
1511
1524
|
overflow-y: auto;
|
|
1512
|
-
`,
|
|
1525
|
+
`,sv=({options:e,selected:o,setSelected:n,disabled:i})=>t(rv,{children:e.map(e=>t(mc,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:o===e.id,disabled:i,onClick:()=>n(e.id)},e.id))}),cv=b(ee)`
|
|
1513
1526
|
width: 100%;
|
|
1514
1527
|
/* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
|
|
1515
1528
|
max-width: 844px;
|
|
@@ -1519,25 +1532,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1519
1532
|
gap: 24px;
|
|
1520
1533
|
flex: 1;
|
|
1521
1534
|
min-height: 0;
|
|
1522
|
-
`,
|
|
1535
|
+
`,dv=b(me)`
|
|
1523
1536
|
flex: 1;
|
|
1524
1537
|
min-height: 0;
|
|
1525
1538
|
width: 100%;
|
|
1526
1539
|
align-self: stretch;
|
|
1527
|
-
`,
|
|
1540
|
+
`,pv=b(ee)`
|
|
1528
1541
|
flex: 1;
|
|
1529
1542
|
min-height: 0;
|
|
1530
1543
|
height: 100%;
|
|
1531
1544
|
max-width: 600px;
|
|
1532
1545
|
overflow-y: auto;
|
|
1533
|
-
`,
|
|
1546
|
+
`,uv=b(me)`
|
|
1534
1547
|
gap: 8px;
|
|
1535
1548
|
width: 100%;
|
|
1536
1549
|
align-items: center;
|
|
1537
|
-
`,
|
|
1550
|
+
`,hv=b.div`
|
|
1538
1551
|
flex: 1;
|
|
1539
1552
|
min-width: 0;
|
|
1540
|
-
`,
|
|
1553
|
+
`,mv=e=>"general"===e.name?0:"advanced"===e.name?2:1,gv=({minSupportedVersion:n})=>{const{isVersionSupported:l,version:r,isEnterprise:c,minSupportedVersion:d}=S(n),{configApi:p}=Bl(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=s(!1),C=a(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...o}=m;return o},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=Gt(C);i(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const E=a(()=>[...b].sort((e,t)=>mv(e)-mv(t)),[b]),N=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(m?.provenance),[m?.provenance]),$=a(()=>{const e=new Set;for(const t of b)for(const o of t.fields)o.componentType===Ie.Dropdown&&e.add(o.helmValuePath);return e},[b]),O=a(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=s(!1),[D,_]=s(!1),P=a(()=>[{id:hn(),type:ho.Button,buttonProps:{"data-id":"settings-save",variant:be.Primary,size:fe.S,label:"Save Changes",leftIcon:Ga,loading:v,onClick:()=>R(!0)}},{id:hn(),type:ho.Button,buttonProps:{"data-id":"settings-cancel",variant:be.Secondary,size:fe.S,label:"Cancel",leftIcon:Wa,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=a(()=>E.map(e=>({id:e.name,label:e.displayName})),[E]),F=a(()=>E.map(e=>e.name),[E]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=Oa({sectionNames:F});return t(zi,{$gap:24,children:e(cv,{children:[t(lv,{disabled:!l,loading:h||g,onClickShowYaml:()=>_(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(ma,{children:[!l&&t(Nr,{minSupportedVersion:d,currentVersion:r||""}),t(Fo,{isOpen:I,richTitle:{icon:il,title:"Config Settings"},actions:P}),t(tt,{isOpen:A,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>R(!1),denyButton:{label:"Keep editing",variant:be.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:be.Primary,onClick:()=>{(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 i=n;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&o(n,t,i.replaceAll("-","_"))}return n})(k(C,x),$);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),R(!1)}}}),e(dv,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(sv,{options:L,selected:M,setSelected:z,disabled:!l}),t(pv,{ref:X,$gap:24,$width:"100%",children:b.length?E.map(n=>t(ut,{id:n.name,bordered:!0,ref:e=>B(n.name,e),customTitle:t(pe,{size:he.M,weight:500,color:ue.Primary,children:n.displayName}),children:t(ee,{$gap:24,children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!c)return null;if(n.renderCondition&&!Ee(n.renderCondition,[],O))return null;const i=Ne(n.componentProps||"{}",{}),a=N[n.helmValuePath],l=n.componentType===Ie.Toggle,r=t(pe,{size:he.XS,weight:500,color:ue.Primary,children:n.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Fe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Fe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Fe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(Ze,{...s}):null,p=n.description?t(pe,{size:he.XXS,color:ue.Secondary,children:n.description}):null,u=e(ee,{$gap:4,children:[e(me,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(sr,{componentType:n.componentType,inputType:i.type,name:n.helmValuePath,disabled:n.isHelmOnly||v,value:T("formData",n.helmValuePath),setValue:e=>w(n.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Ot.S},n.helmValuePath),m=n.isHelmOnly?t($e,{text:"This field can only be updated via the Helm values.yaml file",children:t(Ml,{})}):null;return t(ee,{$gap:8,children:l?e(me,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(me,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(o,{children:[u,e(uv,{children:[t(hv,{children:h}),m]})]})},n.helmValuePath)})})},n.name)):h?t(vt,{$height:"30vh",children:t(wt,{withSpinner:!0})}):t(ut,{richTitle:{icon:il,title:"Config Settings"},children:t(Re,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(ce,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:Ll,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(vt,{$height:"30vh",children:t(wt,{withSpinner:!0})}):t(kr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},fv=b.div`
|
|
1541
1554
|
position: fixed;
|
|
1542
1555
|
bottom: 12px;
|
|
1543
1556
|
left: 12px;
|
|
@@ -1546,4 +1559,4 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1546
1559
|
flex-direction: column-reverse;
|
|
1547
1560
|
gap: 6px;
|
|
1548
1561
|
max-width: 600px;
|
|
1549
|
-
`,
|
|
1562
|
+
`,bv=()=>{const{notifications:e,markAsDismissed:o,markAsSeen:n}=Jt(),i=e.filter(({dismissed:e})=>!e);return t(fv,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(Le,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{o(e),t&&n(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{gc as AddActionDrawer,Us as AddActionForm,xm as AddDataStreamModal,kc as AddDestinationDrawer,js as AddDestinationForm,Ic as AddRuleDrawer,Qs as AddRuleForm,Bc as AddSourceDrawer,$g as CentralConnections,yp as CloudConnectorStep,xp as CreateCloudConnectorDrawer,xg as CreateNewType,tc as DataStreamForm,ec as DataStreamMergeWarning,Tp as EditActionDrawer,kp as EditConfigDrawer,wm as EditDataStreamModal,Ep as EditDestinationDrawer,$p as EditRuleDrawer,em as EditSourceDrawer,oc as EditSourceForm,Vg as Onboarding,Im as OnboardingDone,Wf as Overview,lb as PipelineCollectors,hs as RegexTesterDrawer,Cg as SamplingOnboardingModal,um as SamplingRuleDrawer,sc as SamplingRuleForm,hb as SamplingRules,ov as ServiceMap,gv as Settings,Sm as SystemDrawer,ab as TABS,bv as ToastList};
|