@odigos/ui-kit 0.0.252 → 0.0.253
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/docs/api-context.md +44 -38
- package/lib/chunks/connections-scope-h3bbPbRd.js +1 -0
- package/lib/chunks/{flow-CAOY59Tu.js → flow-BnkrFBJL.js} +1 -1
- package/lib/chunks/{helpers-CXxRJd5C.js → helpers-BEkhis3j.js} +1 -1
- package/lib/chunks/{index-BgflYoEI.js → index-DIVbcB6F.js} +1 -1
- package/lib/chunks/source-instrument-form-context-6ViZM1Z_.js +1 -0
- package/lib/chunks/{ui-components-Dc15jc-B.js → ui-components-TeG65JGy.js} +1 -1
- package/lib/chunks/use-odigos-api-li2VrVHH.js +5 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/v2.js +138 -138
- package/lib/containers.js +7 -7
- package/lib/contexts/odigos-api/hooks/use-actions-api.d.ts +16 -8
- package/lib/contexts/odigos-api/hooks/use-collectors-api.d.ts +12 -1
- package/lib/contexts/odigos-api/hooks/use-config-api.d.ts +10 -1
- package/lib/contexts/odigos-api/hooks/use-data-streams-api.d.ts +19 -13
- package/lib/contexts/odigos-api/hooks/use-destinations-api.d.ts +30 -21
- package/lib/contexts/odigos-api/hooks/use-instrumentation-rules-api.d.ts +12 -4
- package/lib/contexts/odigos-api/hooks/use-metrics-api.d.ts +9 -3
- package/lib/contexts/odigos-api/hooks/use-namespace-api.d.ts +14 -4
- package/lib/contexts/odigos-api/hooks/use-profiling-api.d.ts +5 -0
- package/lib/contexts/odigos-api/hooks/use-sampling-api.d.ts +18 -1
- package/lib/contexts/odigos-api/hooks/use-service-map-api.d.ts +8 -1
- package/lib/contexts/odigos-api/hooks/use-snapshots-api.d.ts +24 -0
- package/lib/contexts/odigos-api/hooks/use-sources-api.d.ts +24 -6
- package/lib/contexts/odigos-api/hooks/use-tokens-api.d.ts +11 -4
- package/lib/contexts/odigos-api/index.d.ts +3 -3
- package/lib/contexts/odigos-api/types.d.ts +26 -27
- package/lib/contexts/odigos-api/use-odigos-api.d.ts +21 -36
- package/lib/contexts/odigos-api.js +1 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/connections-scope-Cb3gZ8MW.js +0 -1
- package/lib/chunks/source-instrument-form-context-Rk2YlyRb.js +0 -1
- package/lib/chunks/use-odigos-api-qSWLSy9S.js +0 -5
package/lib/containers/v2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as a,useRef as i,useCallback as l,useState as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as a,useRef as i,useCallback as l,useState as s,Fragment as r,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,e as w,f as x,h as T,d as k,b as $,c as E,S as I,j as A,R as N,k as O,l as R,a as D,r as P,o as F,p as L,q as _,s as z,t as M,w as B,x as X,y as V,z as U,A as H,B as G}from"../chunks/helpers-BEkhis3j.js";import{v as j,F as W,a4 as K,a5 as Y,a6 as J,a7 as q,a8 as Z,a9 as Q,aa as ee,ab as te,l as oe,ac as ne,f as ae,ad as ie,h as le,n as se,ae as re,af as ce,ag as de,ah as ue,ai as pe,aj as he,ak as ge,al as me,am as fe,an as be,m as ve,w as ye,N as Ce,ao as Se,ap as we,aq as xe,ar as Te,as as ke,q as $e,S as Ee,H as Ie,K as Ae,G as Ne,at as Oe,au as Re,av as De,O as Pe,aw as Fe,R as Le,U as _e,Q as ze,V as Me,ax as Be,ay as Xe,az as Ve,aA as Ue,D as He,z as Ge,aB as je,aC as We,aD as Ke,aE as Ye,aF as Je,aG as qe,aH as Ze,aI as Qe,aJ as et,aK as tt,aL as ot,A as nt,aM as at,C as it,aN as lt,aO as st,aP as rt,aQ as ct,aR as dt,aS as ut,s as pt,J as ht,M as gt,E as mt,aT as ft,c as bt,aU as vt,aV as yt,Z as Ct,aW as St,aX as wt,$ as xt,a1 as Tt,aY as kt,aZ as $t,a_ as Et,a$ as It,b0 as At,r as Nt,b1 as Ot,L as Rt,b2 as Dt,b3 as Pt,b4 as Ft,o as Lt,y as _t,b5 as zt,b6 as Mt,b7 as Bt,b8 as Xt,b9 as Vt,ba as Ut,bb as Ht,bc as Gt,bd as jt,be as Wt,bf as Kt,bg as Yt,bh as Jt,bi as qt,bj as Zt,bk as Qt,bl as eo,bm as to,i as oo,j as no,bn as ao,W as io,bo as lo,bp as so,bq as ro,br as co,bs as uo,bt as po,bu as ho,bv as go,bw as mo,bx as fo,by as bo,bz as vo,bA as yo,bB as Co,bC as So,bD as wo,bE as xo,bF as To,bG as ko,bH as $o,bI as Eo,bJ as Io,bK as Ao,bL as No,bM as Oo,bN as Ro,bO as Do,bP as Po,bQ as Fo,bR as Lo,bS as _o,bT as zo,bU as Mo,bV as Bo,bW as Xo,bX as Vo,bY as Uo,bZ as Ho,b_ as Go,b$ as jo,c0 as Wo,c1 as Ko,c2 as Yo,c3 as Jo,c4 as qo,c5 as Zo,c6 as Qo,c7 as en,c8 as tn,c9 as on,ca as nn,cb as an,cc as ln,cd as sn,ce as rn,cf as cn,cg as dn,ch as un,ci as pn,cj as hn,ck as gn,cl as mn,cm as fn,cn as bn,co as vn,cp as yn,cq as Cn,cr as Sn,cs as wn,ct as xn,cu as Tn,cv as kn,cw as $n,cx as En,cy as In,cz as An,cA as Nn,cB as On,cC as Rn,cD as Dn,cE as Pn,cF as Fn,cG as Ln,cH as _n,cI as zn,cJ as Mn,cK as Bn,cL as Xn,cM as Vn,cN as Un,cO as Hn,cP as Gn,cQ as jn,cR as Wn,cS as Kn,cT as Yn,cU as Jn,cV as qn,cW as Zn,cX as Qn,cY as ea,cZ as ta,c_ as oa,c$ as na,d0 as aa,d1 as ia,d2 as la,d3 as sa,d4 as ra,d5 as ca,d6 as da,d7 as ua,d8 as pa,d9 as ha,da as ga,db as ma,dc as fa,dd as ba,de as va,df as ya,dg as Ca,dh as Sa,di as wa,dj as xa,g as Ta,dk as ka,k as $a,dl as Ea,dm as Ia,dn as Aa,dp as Na,dq as Oa,dr as Ra,ds as Da,u as Pa,_ as Fa,dt as La,du as _a,dv as za,dw as Ma,dx as Ba,dy as Xa,dz as Va,dA as Ua,dB as Ha,dC as Ga,dD as ja,dE as Wa,dF as Ka,dG as Ya,dH as Ja,dI as qa,dJ as Za,dK as Qa,dL as ei,dM as ti,dN as oi,dO as ni,dP as ai,dQ as ii,dR as li,dS as si}from"../chunks/ui-components-TeG65JGy.js";import{TrashIcon as ri,PlusIcon as ci,ArrowRightIcon as di,VSquareIcon as ui,XSquareIcon as pi,BookIcon as hi,DeleteIcon as gi,EditIcon as mi,GoLogo as fi,JavaLogo as bi,ChevronRightIcon as vi,ActionIcon as yi,DestinationIcon as Ci,ChevronUpIcon as Si,ChevronDownIcon as wi,VIcon as xi,XIcon as Ti,InstrumentationRuleIcon as ki,SourceIcon as $i,NamespacesIcon as Ei,SettingsIcon as Ii,PodIcon as Ai,OdigosLogo as Ni,K8sLogo as Oi,RefreshIcon as Ri,ExclamationCircleIcon as Di,QuestionCircleIcon as Pi,InboundIcon as Fi,OutboundIcon as Li,UserIcon as _i,TerminalIcon as zi,SearchIcon as Mi,MinusIcon as Bi,ExpandIcon as Xi,CopyIcon as Vi,DotIcon as Ui,DownloadIcon as Hi,RefreshLeftArrowIcon as Gi,VmLogo as ji,SamplingIcon as Wi,ExclamationTriangleIcon as Ki,KeyIcon as Yi,DiagnoseIcon as Ji,StarIcon as qi,ArrowIcon as Zi,ConnectionsIcon as Qi,FilterIcon as el,DataStreamIcon as tl,PipelineCollectorIcon as ol,ArrowDownSquareIcon as nl,ArrowUpSquareIcon as al,GatewayIcon as il,YamlIcon as ll}from"../icons.js";import{u as sl}from"../chunks/use-odigos-api-li2VrVHH.js";import{S as rl,D as cl,I as dl,a as ul,A as pl,P as hl,b as gl,c as ml,R as fl,O as bl,d as vl,e as yl,f as Cl,W as Sl,g as wl,C as xl,Y as Tl,h as kl,i as $l,U as El}from"../chunks/index-DIVbcB6F.js";import{O as Il}from"../chunks/connections-scope-h3bbPbRd.js";import{u as Al,f as Nl,g as Ol,e as Rl,i as Dl,h as Pl,S as Fl,k as Ll,E as _l,l as zl,m as Ml,j as Bl,b as Xl,d as Vl,a as Ul,A as Hl,R as Gl,c as jl,D as Wl}from"../chunks/source-instrument-form-context-6ViZM1Z_.js";import{createPortal as Kl}from"react-dom";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const Yl=[{id:"CREDIT_CARD",label:"Credit card"}],Jl=[{id:j.CollectContainerAttributes,label:"Collect container attributes"},{id:j.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:j.CollectWorkloadId,label:"Collect workload ID"},{id:j.CollectClusterId,label:"Collect cluster ID"}],ql=[{id:Z.Pod,label:Z.Pod},{id:Z.Namespace,label:Z.Namespace},{id:Z.Node,label:Z.Node}],Zl=[{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:ql}],Ql=[{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:ql}],es=/^[a-zA-Z]$/,ts=new Set(["*","+","?"]),os=new Set(["^","$"]),ns={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"},as=m.div`
|
|
2
2
|
padding: 8px 16px;
|
|
3
3
|
border-radius: 6px;
|
|
4
4
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
@@ -18,9 +18,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
18
18
|
box-decoration-break: clone;
|
|
19
19
|
-webkit-box-decoration-break: clone;
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
22
|
-
background: ${({$kind:e})=>
|
|
23
|
-
`,
|
|
21
|
+
`,is=m.span`
|
|
22
|
+
background: ${({$kind:e})=>ns[e]};
|
|
23
|
+
`,ls=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const a=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){a("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){a(e.slice(o,o+2),"class-content"),o+=2;continue}a(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}a(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(ts.has(t)||os.has(t))a(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){a(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];es.test(t)?a(e.slice(o,o+2),"anchor-quantifier"):a(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(a(t,"literal"),o++):(a("|","alternation"),o++)}else"^"===e[o+1]?(a("[^","class-bracket"),o+=2):(a("[","class-bracket"),o++),n=!0;else a(t,"group"),o++}}return t})(e),[e]);return t(as,e?{"data-id":o,children:n.map((e,o)=>t(is,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},ss="rgba(102, 191, 255, 0.5)",rs=b`
|
|
24
24
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
25
25
|
font-size: 12px;
|
|
26
26
|
line-height: 20px;
|
|
@@ -33,7 +33,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
33
33
|
-moz-tab-size: 4;
|
|
34
34
|
tab-size: 4;
|
|
35
35
|
margin: 0;
|
|
36
|
-
`,
|
|
36
|
+
`,cs=m.div`
|
|
37
37
|
position: relative;
|
|
38
38
|
width: 100%;
|
|
39
39
|
min-height: ${({$minHeight:e})=>e}px;
|
|
@@ -45,8 +45,8 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
45
45
|
&:focus-within {
|
|
46
46
|
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
47
47
|
}
|
|
48
|
-
`,
|
|
49
|
-
${
|
|
48
|
+
`,ds=m.div`
|
|
49
|
+
${rs}
|
|
50
50
|
position: absolute;
|
|
51
51
|
inset: 0;
|
|
52
52
|
padding: 12px;
|
|
@@ -59,8 +59,8 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
59
59
|
box-decoration-break: clone;
|
|
60
60
|
-webkit-box-decoration-break: clone;
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
63
|
-
${
|
|
62
|
+
`,us=m.textarea`
|
|
63
|
+
${rs}
|
|
64
64
|
position: relative;
|
|
65
65
|
z-index: 1;
|
|
66
66
|
display: block;
|
|
@@ -78,18 +78,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
78
78
|
&::placeholder {
|
|
79
79
|
color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
80
80
|
}
|
|
81
|
-
`,
|
|
81
|
+
`,ps=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),hs=({regex:o,value:n,onChange:s,minHeight:r=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return ps(t);let o;try{o=new RegExp(e)}catch{return ps(t)}const n=o.exec(t);if(!n)return ps(t);const a=n.index,i=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=n[0].indexOf(n[1]),s=l>=0?a+l:a,r=s+n[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,s),capture:t.slice(s,r),matchPost:t.slice(r,i),after:t.slice(i)}})(o,n),[o,n]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(cs,{$minHeight:r,children:[e(ds,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:ss},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:ss},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(us,{ref:u,$minHeight:r,value:n,onChange:e=>s(e.target.value),onScroll:h,spellCheck:!1,...c})]})},gs=m.div`
|
|
82
82
|
flex: 1;
|
|
83
83
|
min-height: 0;
|
|
84
84
|
overflow-y: auto;
|
|
85
|
-
`,
|
|
85
|
+
`,ms=m.div`
|
|
86
86
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
87
87
|
border-radius: 8px;
|
|
88
88
|
padding: 8px;
|
|
89
89
|
display: flex;
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
gap: 12px;
|
|
92
|
-
`,
|
|
92
|
+
`,fs=m.div`
|
|
93
93
|
padding: 8px 16px;
|
|
94
94
|
border-radius: 8px;
|
|
95
95
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
@@ -100,7 +100,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
100
100
|
word-break: break-all;
|
|
101
101
|
white-space: pre-wrap;
|
|
102
102
|
user-select: text;
|
|
103
|
-
`,
|
|
103
|
+
`,bs=({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:ne.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:ne.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:ne.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:ne.RESULT_NO_MATCH}})(n,r),[n,r]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(oe,{isOpen:o,header:{title:ne.TITLE,onClose:()=>{c(""),i()}},children:t(gs,{children:e(ms,{children:[e(W,{$gap:6,children:[t(K,{label:ne.REGEX_LABEL}),t(ls,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(ae,{size:le.XXS,color:ie.Secondary,children:ne.REGEX_EMPTY_HINT})]}),e(W,{$gap:6,children:[e(se,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:ne.TEST_STRING_LABEL}),t(re,{"data-id":"regex-tester-unescape",label:ne.UNESCAPE_LABEL,tooltip:ne.UNESCAPE_TOOLTIP,variant:de.Secondary,size:ce.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],a="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=a){t+=a,o++;continue}}t+=e[o]}return t})(e)),disabled:(p=r,!/\\["'\\nrt]/.test(p))})]}),t(hs,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:ne.TEST_STRING_PLACEHOLDER,regex:n,value:r,onChange:c,minHeight:240}),t(J,{helpMessage:ne.TEST_STRING_HELP})]}),e(W,{$gap:8,children:[t(K,{label:ne.RESULT_LABEL}),t(fs,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(ae,{size:le.XXS,color:ie.Secondary,children:ne.RESULT_CAPTURE_HINT})]})]})})});var p},vs=j.ExtractAttribute;var ys;!function(e){e.Preset="preset",e.Regex="regex"}(ys||(ys={}));const Cs=[he.JSON,he.SQL,he.ResourcePath],Ss=(e=he.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),ws=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,xs=m.div`
|
|
104
104
|
width: 100%;
|
|
105
105
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
106
106
|
border-radius: 8px;
|
|
@@ -108,13 +108,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
108
108
|
display: flex;
|
|
109
109
|
flex-direction: column;
|
|
110
110
|
gap: 8px;
|
|
111
|
-
`,
|
|
111
|
+
`,Ts=m.div`
|
|
112
112
|
flex: 1;
|
|
113
113
|
min-width: 0;
|
|
114
|
-
`,
|
|
114
|
+
`,ks=m.div`
|
|
115
115
|
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
116
116
|
padding-top: 24px;
|
|
117
|
-
`,$r=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Ar=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},Nr=j.UrlTemplatizationRulesGroups,Or=[{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"}],Rr={[ye.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[j.CollectContainerAttributes]||a[j.CollectReplicaSetAttributes]||a[j.CollectWorkloadId]||a[j.CollectClusterId]||a[j.LabelsAttributes]?.length||a[j.AnnotationsAttributes]?.length||(i(j.CollectContainerAttributes,!0),i(j.CollectReplicaSetAttributes,!0),i(j.CollectWorkloadId,!0),i(j.CollectClusterId,!0),i(j.LabelsAttributes,[]),i(j.AnnotationsAttributes,[]))},[]),e(o,{children:[t(W,{$gap:6,children:Zl.map(({id:o,label:n})=>e(W,{children:[t(Y,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(J,{errorMessage:l[o]})]},o))}),t(q,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:er,values:a[j.LabelsAttributes]||[],setValues:e=>i(j.LabelsAttributes,e),errorMessage:l[j.LabelsAttributes]}),t(q,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:tr,values:a[j.AnnotationsAttributes]||[],setValues:e=>i(j.AnnotationsAttributes,e),errorMessage:l[j.AnnotationsAttributes]})]})),[ye.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(Q,{label:"Overwrite existing values",labelAlign:ee.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[j.OverwriteExistingValues]||!1,onChange:e=>a(j.OverwriteExistingValues,e)}),t(q,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[j.ClusterAttributes]||[],setValues:e=>a(j.ClusterAttributes,e),errorMessage:i[j.ClusterAttributes]})]})},[ye.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(te,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[j.AttributeNamesToDelete]||[],setValues:e=>o(j.AttributeNamesToDelete,e),errorMessage:n[j.AttributeNamesToDelete]}),[ye.RenameAttributes]:({value:e,setValue:o,formErrors:a})=>{const i=e[j.Renames],[l,s]=r(()=>$r(i));return n(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(Ar(l),i||{})||s($r(i))},[i]),t(q,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),o(j.Renames,Ar(t))},errorMessage:a[j.Renames]})},[ye.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[j.PiiCategories]?.length||a(j.PiiCategories,ql.map(({id:e})=>e))},[]),e(W,{$gap:12,children:[t(K,{label:"Attributes to mask"}),t(W,{$gap:6,children:ql.map(({id:e,label:n})=>t(Y,{label:n,value:o[j.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[j.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(j.PiiCategories,i)}},e))}),t(J,{errorMessage:i[j.PiiCategories]})]})),[ye.URLTemplatization]:({value:n,setValue:a,formErrors:i})=>{const l=f(),r=n[Nr]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(Nr,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(s,{children:[t(ve,{}),e(W,{$gap:12,children:[e(re,{$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:`Rule Group ${n+1}`}),t(se,{leftIcon:()=>t(si,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(be,{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(q,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Or,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(te,{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(J,{errorMessage:i[Nr]})]},`url-templatization-group-${n}`)),t(se,{variant:de.Secondary,label:"Add rule group",leftIcon:ci,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ve,{})]})},[ye.ExtractAttribute]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=i[Cr],c=o[Cr]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(xr)?Sr.Regex:Sr.Preset)(c)),[p,h]=r(null),g=e=>a(Cr,{extractions:e});n(()=>{0===c.length&&g([d===Sr.Preset?Tr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const m=(e,t)=>{g(c.map((o,n)=>n===e?{...o,...t}:o))},b=()=>{g([...c,d===Sr.Preset?Tr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===Sr.Preset,y=c.length?c:[v?Tr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(W,{$gap:16,$width:"100%",children:[t(ue,{options:[{value:Sr.Preset,label:pe.SEGMENT_PRESET_LABEL,tooltip:pe.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:Sr.Regex,label:pe.SEGMENT_REGEX_LABEL,tooltip:pe.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),g([e===Sr.Preset?Tr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(W,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const a=n===y.length-1,i=o.dataFormat||he.JSON,r=me[i];return e(kr,{"data-id":`extract-row-${n}`,children:[e(re,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(W,{$gap:10,children:[t(K,{label:v?pe.PRESET_ROW_TITLE(n):pe.REGEX_ROW_TITLE(n)}),v&&t(re,{$gap:24,children:wr.map(e=>t(ge,{"data-id":`extract-row-${n}-fmt-${e}`,size:fe.L,label:me[e].label,value:i===e,onChange:t=>t&&m(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(re,{$gap:4,$alignItems:"center",children:[!v&&t(se,{"data-id":`extract-row-${n}-test-regex`,label:pe.TEST_REGEX_LABEL,variant:de.Secondary,size:ce.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(se,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(si,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);g(t.length?t:[d===Sr.Preset?Tr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),a&&t(se,{"data-id":`extract-row-${n}-add`,leftIcon:ci,variant:de.Secondary,size:ce.S,onClick:b})]})]}),v?e(re,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Er,{children:t(be,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>m(n,{lookupKey:e.target.value})})}),t(Ir,{children:t(di,{size:24,fill:l.v2.colors.silver[200]})}),t(Er,{children:t(be,{name:`extract-row-${n}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})})]}):e(W,{$gap:12,$width:"100%",children:[t(be,{name:`extract-row-${n}-regex`,label:pe.REGEX_LABEL,placeholder:pe.REGEX_PLACEHOLDER,helpMessage:pe.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>m(n,{regex:e.target.value})}),t(be,{name:`extract-row-${n}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(J,{errorMessage:s})]}),t(yr,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},Dr=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Rr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Fr=()=>{const o=f(),{selectedOption:n,genericForm:a}=Ol();if(!a||!n)return t(Ce,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(W,{$gap:24,children:[e(re,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:n.docsDescription}),e(re,{$gap:12,children:[t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:we.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(se,{leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${Te}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(dl,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(be,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(Dr,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(xe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Pr=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:g,options:m})=>{if(!(!o||ke(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(ul,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:g,placeholder:p,errorMessage:l[f],dropdownOptions:m,value:v||"",setValue:e=>i(f,e)},f)}),_r=m(re)`
|
|
117
|
+
`,$s=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Es=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},Is=j.UrlTemplatizationRulesGroups,As=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Ns={[ye.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[j.CollectContainerAttributes]||a[j.CollectReplicaSetAttributes]||a[j.CollectWorkloadId]||a[j.CollectClusterId]||a[j.LabelsAttributes]?.length||a[j.AnnotationsAttributes]?.length||(i(j.CollectContainerAttributes,!0),i(j.CollectReplicaSetAttributes,!0),i(j.CollectWorkloadId,!0),i(j.CollectClusterId,!0),i(j.LabelsAttributes,[]),i(j.AnnotationsAttributes,[]))},[]),e(o,{children:[t(W,{$gap:6,children:Jl.map(({id:o,label:n})=>e(W,{children:[t(Y,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(J,{errorMessage:l[o]})]},o))}),t(q,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Zl,values:a[j.LabelsAttributes]||[],setValues:e=>i(j.LabelsAttributes,e),errorMessage:l[j.LabelsAttributes]}),t(q,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Ql,values:a[j.AnnotationsAttributes]||[],setValues:e=>i(j.AnnotationsAttributes,e),errorMessage:l[j.AnnotationsAttributes]})]})),[ye.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(Q,{label:"Overwrite existing values",labelAlign:ee.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[j.OverwriteExistingValues]||!1,onChange:e=>a(j.OverwriteExistingValues,e)}),t(q,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[j.ClusterAttributes]||[],setValues:e=>a(j.ClusterAttributes,e),errorMessage:i[j.ClusterAttributes]})]})},[ye.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(te,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[j.AttributeNamesToDelete]||[],setValues:e=>o(j.AttributeNamesToDelete,e),errorMessage:n[j.AttributeNamesToDelete]}),[ye.RenameAttributes]:({value:e,setValue:o,formErrors:a})=>{const i=e[j.Renames],[l,r]=s(()=>$s(i));return n(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(Es(l),i||{})||r($s(i))},[i]),t(q,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));r(t),o(j.Renames,Es(t))},errorMessage:a[j.Renames]})},[ye.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[j.PiiCategories]?.length||a(j.PiiCategories,Yl.map(({id:e})=>e))},[]),e(W,{$gap:12,children:[t(K,{label:"Attributes to mask"}),t(W,{$gap:6,children:Yl.map(({id:e,label:n})=>t(Y,{label:n,value:o[j.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[j.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(j.PiiCategories,i)}},e))}),t(J,{errorMessage:i[j.PiiCategories]})]})),[ye.URLTemplatization]:({value:n,setValue:a,formErrors:i})=>{const l=f(),s=n[Is]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(Is,e),d=(e,t)=>c(s.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[s.map((o,n)=>e(r,{children:[t(ve,{}),e(W,{$gap:12,children:[e(se,{$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:`Rule Group ${n+1}`}),t(re,{leftIcon:()=>t(ri,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>{return e=n,c(s.filter((t,o)=>o!==e));var e},disabled:1===s.length})]}),t(be,{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(q,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:As,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(te,{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(J,{errorMessage:i[Is]})]},`url-templatization-group-${n}`)),t(re,{variant:de.Secondary,label:"Add rule group",leftIcon:ci,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ve,{})]})},[ye.ExtractAttribute]:({value:o,setValue:a,formErrors:i})=>{const l=f(),r=i[vs],c=o[vs]?.extractions||[],[d,u]=s(()=>(e=>e.length&&e.some(ws)?ys.Regex:ys.Preset)(c)),[p,h]=s(null),g=e=>a(vs,{extractions:e});n(()=>{0===c.length&&g([d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const m=(e,t)=>{g(c.map((o,n)=>n===e?{...o,...t}:o))},b=()=>{g([...c,d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===ys.Preset,y=c.length?c:[v?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(W,{$gap:16,$width:"100%",children:[t(ue,{options:[{value:ys.Preset,label:pe.SEGMENT_PRESET_LABEL,tooltip:pe.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:ys.Regex,label:pe.SEGMENT_REGEX_LABEL,tooltip:pe.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),g([e===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(W,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const a=n===y.length-1,i=o.dataFormat||he.JSON,s=me[i];return e(xs,{"data-id":`extract-row-${n}`,children:[e(se,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(W,{$gap:10,children:[t(K,{label:v?pe.PRESET_ROW_TITLE(n):pe.REGEX_ROW_TITLE(n)}),v&&t(se,{$gap:24,children:Cs.map(e=>t(ge,{"data-id":`extract-row-${n}-fmt-${e}`,size:fe.L,label:me[e].label,value:i===e,onChange:t=>t&&m(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(se,{$gap:4,$alignItems:"center",children:[!v&&t(re,{"data-id":`extract-row-${n}-test-regex`,label:pe.TEST_REGEX_LABEL,variant:de.Secondary,size:ce.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(re,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(ri,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);g(t.length?t:[d===ys.Preset?Ss():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),a&&t(re,{"data-id":`extract-row-${n}-add`,leftIcon:ci,variant:de.Secondary,size:ce.S,onClick:b})]})]}),v?e(se,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Ts,{children:t(be,{name:`extract-row-${n}-lookupKey`,label:s.keyLabel,placeholder:s.placeholder,helpMessage:s.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>m(n,{lookupKey:e.target.value})})}),t(ks,{children:t(di,{size:24,fill:l.v2.colors.silver[200]})}),t(Ts,{children:t(be,{name:`extract-row-${n}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})})]}):e(W,{$gap:12,$width:"100%",children:[t(be,{name:`extract-row-${n}-regex`,label:pe.REGEX_LABEL,placeholder:pe.REGEX_PLACEHOLDER,helpMessage:pe.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>m(n,{regex:e.target.value})}),t(be,{name:`extract-row-${n}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(J,{errorMessage:r})]}),t(bs,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},Os=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Ns[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Rs=()=>{const o=f(),{selectedOption:n,genericForm:a}=Al();if(!a||!n)return t(Ce,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(W,{$gap:24,children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:n.docsDescription}),e(se,{$gap:12,children:[t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:we.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(re,{leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(rl,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(be,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Os,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(Te,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},Ds=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:g,options:m})=>{if(!(!o||ke(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(cl,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:n,required:g,placeholder:p,errorMessage:l[f],dropdownOptions:m,value:v||"",setValue:e=>i(f,e)},f)}),Ps=m(se)`
|
|
118
118
|
position: sticky;
|
|
119
119
|
bottom: 4px;
|
|
120
120
|
align-self: center;
|
|
@@ -125,17 +125,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
125
125
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
126
126
|
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
127
127
|
z-index: 1;
|
|
128
|
-
`,Lr=c(({isEdit:o},a)=>{const i=f(),{isVm:l}=y(),{destinationsApi:s}=rl(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=Rl(),[v,C]=r(h?.testResult),[S,w]=r(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const T=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await s.testConnection(Oe(u.formData));return C(e),e};return d(a,()=>({testConnection:T,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,s]),u&&c?e(W,{$gap:24,style:{minHeight:"100%"},children:[e(re,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Ee,{status:Ie.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Ee,{status:Ie.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(re,{$gap:12,children:[!l&&t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:we.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(se,{"data-id":"dest-form-docs",leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${Te}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(dl,{title:"This connection will monitor:",allowedSignals:Ne(c.option.supportedSignals),selectedSignals:Ae(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes($e.Logs),metrics:e.includes($e.Metrics),traces:e.includes($e.Traces),profiles:e.includes($e.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(be,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Pr,{signals:Ae(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!o&&e(_r,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(se,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:gi,variant:de.Secondary,textColor:i.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(se,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:de.Secondary,onClick:T})}),h&&t("div",S?{style:{width:"150px"},children:t(se,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:mi,variant:de.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(se,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await T(),o=!!e&&!e.succeeded;m(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(se,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await T(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(Ce,{title:"No active form"})});Lr.displayName="AddDestinationForm";const zr=[{id:Re.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Re.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Re.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Mr=[{id:Re.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Re.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Re.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Br=["*"],Xr=[{id:Pe.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Pe.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Pe.DbQuery,label:"Collect DB query",tooltip:""},{id:Pe.Messaging,label:"Collect messaging",tooltip:""}],Vr={[ze.Java]:[new Le("","")],[ze.Golang]:[new _e("")]},Ur={[Me.CodeAttributes]:({value:i,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);n(()=>{if(!c.length&&!s){const e={[Re.FilePath]:!0,[Re.Function]:!0,[Re.LineNumber]:!0,[Re.Column]:null,[Re.Namespace]:null,[Re.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Re).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(W,{$gap:6,children:zr.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:s})]}),e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(W,{$gap:6,children:Mr.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:s})]})]})},[Me.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[ze.Golang]||[]).map(e=>new _e(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[ze.Java]||[]).map(e=>new Le(e.className,e.methodName)),[i]);return n(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[ze.Golang]:Vr[ze.Golang],[ze.Java]:Vr[ze.Java]})},[]),e(o,{children:[e(W,{children:[e(re,{$gap:8,children:[t(fi,{}),t(K,{label:"Golang custom probes"})]}),t(q,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[ze.Golang]=e.map(e=>new _e(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[ze.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(W,{children:[e(re,{$gap:8,children:[t(bi,{}),t(K,{label:"Java custom probes"})]}),t(q,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[ze.Golang]=c,t[ze.Java]=e.map(e=>new Le(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Me.HeadersCollection]:({value:e,setValue:o,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Fe.HeaderKeys]||[],[e]),s=e=>{const t={[Fe.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{r.length||l||s(Br)},[]),t(te,{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})},[Me.PayloadCollection]:({value:o,setValue:i,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!r){const e={[Pe.HttpRequest]:{},[Pe.HttpResponse]:{},[Pe.DbQuery]:{},[Pe.Messaging]:{}};i("payloadCollection",e)}},[]);return e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Type of data to collect"}),t(W,{$gap:6,children:Xr.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Pe.HttpRequest]:o.includes(Pe.HttpRequest)?{}:null,[Pe.HttpResponse]:o.includes(Pe.HttpResponse)?{}:null,[Pe.DbQuery]:o.includes(Pe.DbQuery)?{}:null,[Pe.Messaging]:o.includes(Pe.Messaging)?{}:null};i("payloadCollection",n)})(e,t)})},e))}),t(J,{errorMessage:r})]})},[Me.UnknownType]:null},Gr=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Ur[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Hr=()=>{const o=f(),{selectedOption:n,genericForm:a,sourceOptions:i,namespaceOptions:l}=Dl();if(!a||!n)return t(Ce,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=a;return e(W,{$gap:24,children:[e(re,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:n.docsDescription}),e(re,{$gap:12,children:[t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:we.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(se,{leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${Te}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(pl,{option:n,formState:r}),e(re,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Be,{label:Xe[e],leftIcon:Ve(e),backgroundColor:o.v2.colors.purple[900]},e))]}),t(hl,{scopes:r.sourceScopes,onChange:e=>s("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:n.type===Me.CustomInstrumentation?[]:n.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(be,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:r.ruleName,onChange:({target:{value:e}})=>s("ruleName",e),errorMessage:c.ruleName}),t(Gr,{ruleType:n.type,value:r,setValue:(e,t)=>s(e,t),formErrors:c}),t(xe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes,onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},jr=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Fl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Ue,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Ge.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:de.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:de.Secondary,onClick:n}})},Wr=({autoFocus:o})=>{const{dataStreams:n}=He(),{genericForm:i,excludeName:l,editingName:r}=Fl(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(W,{$width:"100%",$gap:12,children:[t(be,{name:"data-stream-name",label:Ge.STREAM_NAME,placeholder:Ge.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Ge.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Ee,{status:Ie.Warning,message:Ge.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Kr=()=>{const{selectedStreamName:e}=He(),{genericForm:o}=Pl();if(!o)return t(Ce,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(be,{name:"sourceName",label:Ge.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Yr=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Jr=m.div`
|
|
128
|
+
`,Fs=c(({isEdit:o},a)=>{const i=f(),{isVm:l}=y(),{destinationsApi:r}=sl(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=Nl(),[v,C]=s(h?.testResult),[S,w]=s(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await r.testConnection(Oe(u.formData));return C(e),e};return d(a,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,r]),u&&c?e(W,{$gap:24,style:{minHeight:"100%"},children:[e(se,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t($e,{status:Ee.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t($e,{status:Ee.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(se,{$gap:12,children:[!l&&t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:we.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(re,{"data-id":"dest-form-docs",leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(rl,{title:"This connection will monitor:",allowedSignals:Ne(c.option.supportedSignals),selectedSignals:Ae(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(Ie.Logs),metrics:e.includes(Ie.Metrics),traces:e.includes(Ie.Traces),profiles:e.includes(Ie.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(be,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Ds,{signals:Ae(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!o&&e(Ps,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:gi,variant:de.Secondary,textColor:i.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:de.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(re,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:mi,variant:de.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(re,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(re,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(Ce,{title:"No active form"})});Fs.displayName="AddDestinationForm";const Ls=[{id:Re.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Re.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Re.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],_s=[{id:Re.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Re.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Re.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],zs=["*"],Ms=[{id:Fe.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Fe.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Fe.DbQuery,label:"Collect DB query",tooltip:""},{id:Fe.Messaging,label:"Collect messaging",tooltip:""}],Bs={[ze.Java]:[new _e("","")],[ze.Golang]:[new Le("")]},Xs={[Me.CodeAttributes]:({value:i,setValue:l,formErrors:s})=>{const r=s.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);n(()=>{if(!c.length&&!r){const e={[Re.FilePath]:!0,[Re.Function]:!0,[Re.LineNumber]:!0,[Re.Column]:null,[Re.Namespace]:null,[Re.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Re).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(W,{$gap:6,children:Ls.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:r})]}),e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(W,{$gap:6,children:_s.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:r})]})]})},[Me.CustomInstrumentation]:({value:i,setValue:l,formErrors:s})=>{const r=s.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[ze.Golang]||[]).map(e=>new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[ze.Java]||[]).map(e=>new _e(e.className,e.methodName)),[i]);return n(()=>{i?.customInstrumentations||r||l("customInstrumentations",{[ze.Golang]:Bs[ze.Golang],[ze.Java]:Bs[ze.Java]})},[]),e(o,{children:[e(W,{children:[e(se,{$gap:8,children:[t(fi,{}),t(K,{label:"Golang custom probes"})]}),t(q,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[ze.Golang]=e.map(e=>new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[ze.Java]=d,l("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]}),e(W,{children:[e(se,{$gap:8,children:[t(bi,{}),t(K,{label:"Java custom probes"})]}),t(q,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[ze.Golang]=c,t[ze.Java]=e.map(e=>new _e(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]})]})},[Me.HeadersCollection]:({value:e,setValue:o,formErrors:i})=>{const l=i.headersCollection,s=a(()=>e?.headersCollection?.[Pe.HeaderKeys]||[],[e]),r=e=>{const t={[Pe.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{s.length||l||r(zs)},[]),t(te,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:r,errorMessage:l})},[Me.PayloadCollection]:({value:o,setValue:i,formErrors:l})=>{const s=l.payloadCollection,r=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!r.length&&!s){const e={[Fe.HttpRequest]:{},[Fe.HttpResponse]:{},[Fe.DbQuery]:{},[Fe.Messaging]:{}};i("payloadCollection",e)}},[]);return e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Type of data to collect"}),t(W,{$gap:6,children:Ms.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:r.includes(e),onChange:t=>((e,t)=>{const o=t?[...r,e]:r.filter(t=>t!==e),n={[Fe.HttpRequest]:o.includes(Fe.HttpRequest)?{}:null,[Fe.HttpResponse]:o.includes(Fe.HttpResponse)?{}:null,[Fe.DbQuery]:o.includes(Fe.DbQuery)?{}:null,[Fe.Messaging]:o.includes(Fe.Messaging)?{}:null};i("payloadCollection",n)})(e,t)})},e))}),t(J,{errorMessage:s})]})},[Me.UnknownType]:null},Vs=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Xs[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Us=()=>{const o=f(),{selectedOption:n,genericForm:a,sourceOptions:i,namespaceOptions:l}=Ol();if(!a||!n)return t(Ce,{title:"No active form"});const{formData:s,handleFormChange:r,formErrors:c}=a;return e(W,{$gap:24,children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:n.docsDescription}),e(se,{$gap:12,children:[t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:we.S,selected:s.disabled,setSelected:e=>r("disabled",e)}),t(re,{leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${xe}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(dl,{option:n,formState:s}),e(se,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Be,{label:Xe[e],leftIcon:Ve(e),backgroundColor:o.v2.colors.purple[900]},e))]}),t(ul,{scopes:s.sourceScopes,onChange:e=>r("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:n.type===Me.CustomInstrumentation?[]:n.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(be,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>r("ruleName",e),errorMessage:c.ruleName}),t(Vs,{ruleType:n.type,value:s,setValue:(e,t)=>r(e,t),formErrors:c}),t(Te,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>r("notes",e),errorMessage:c.notes})]})},Hs=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Rl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Ue,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:He.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:de.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:de.Secondary,onClick:n}})},Gs=({autoFocus:o})=>{const{dataStreams:n}=Ge(),{genericForm:i,excludeName:l,editingName:s}=Rl(),{formData:r,formErrors:c,handleFormChange:d}=i,u=r.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(W,{$width:"100%",$gap:12,children:[t(be,{name:"data-stream-name",label:He.STREAM_NAME,placeholder:He.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:He.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t($e,{status:Ee.Warning,message:He.DATA_STREAM_MERGE_WARNING(s,p.name),fullWidth:!0})]})},js=()=>{const{selectedStreamName:e}=Ge(),{genericForm:o}=Dl();if(!o)return t(Ce,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(be,{name:"sourceName",label:He.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Ws=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ks=m.div`
|
|
129
129
|
display: flex;
|
|
130
130
|
flex-direction: column;
|
|
131
131
|
gap: 24px;
|
|
132
|
-
`,
|
|
132
|
+
`,Ys=m.div`
|
|
133
133
|
display: contents;
|
|
134
134
|
& > * {
|
|
135
135
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
136
136
|
transition: opacity 0.2s ease;
|
|
137
137
|
}
|
|
138
|
-
`,
|
|
138
|
+
`,Js=({value:e})=>{const o=f();return t(Be,e?{status:Ee.Success,label:Ze,leftIcon:ui}:{label:Qe,leftIcon:pi,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},qs=({value:e,onChange:o})=>{const n=f(),i=a(()=>[{icon:ui,label:Ze,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:pi,label:Qe,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ue,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},Zs=()=>{const e=Pl();switch(e.formType){case Fl.Create:return t(Qs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(qs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Fl.View:return e.data?e.isEditing?t(Qs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(qs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(er,{data:e.data,renderAction:()=>t(Js,{value:!e.data?.rule.disabled})}):null;case Fl.EditAutoNoisy:return t(tr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:qe,sectionTitle:Ke,sectionSubTitle:Je,presetLabel:We,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(qs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Fl.EditAutoCostReduction:return t(tr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ye,sectionTitle:Ke,presetLabel:We,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(qs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Fl.EditAutoHighlyRelevant:return t(Ks,{children:t(pl,{title:e.localEnabled?void 0:je,summary:e.summary,renderAction:()=>t(qs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Qs=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:s})=>e(Ks,{children:[t(ml,{category:o,formState:n,renderAction:s}),e(Ys,{$faded:!!n.disabled,children:[t(fl,{category:o,formState:n,onChange:a}),t(ul,{scopes:n.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(bl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(vl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(yl,{ruleType:n.ruleType,formState:n,onChange:a}),t(Cl,{category:o,formState:n,onChange:a})]})]}),er=({data:o,renderAction:n})=>e(Ks,{children:[t(ml,{readOnly:!0,summary:o.summary,renderAction:n}),t(fl,{readOnly:!0,data:o}),t(ul,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(bl,{readOnly:!0,data:o}),t(Cl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(yl,{readOnly:!0,rule:o.rule})]}),tr=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:s,presetLabel:r,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:g,customPercentage:m,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>g(e),[g]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(Ks,{children:[t(pl,{title:o?void 0:a,summary:n,renderAction:b}),t(Ys,{$faded:!o,children:e(et,{richTitle:{title:i,subTitle:s},children:[d&&t(W,{$alignItems:"flex-start",children:t(ue,{options:Ws,selected:u,setSelected:v})}),S&&t(hl,{description:r,options:gl,selected:h,onSelect:y,customName:c,customLabel:tt,customPlaceholder:"5%",customValue:m,onCustomChange:C})]})})]})},or=m.div`
|
|
139
139
|
display: flex;
|
|
140
140
|
align-items: center;
|
|
141
141
|
justify-content: space-between;
|
|
@@ -148,27 +148,27 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
148
148
|
&:hover {
|
|
149
149
|
background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>o.v2.colors[t?"purple":"silver"][e?"700":"800"]};
|
|
150
150
|
}
|
|
151
|
-
`,
|
|
151
|
+
`,nr=m.div`
|
|
152
152
|
display: flex;
|
|
153
153
|
align-items: center;
|
|
154
154
|
justify-content: center;
|
|
155
155
|
padding: 8px;
|
|
156
156
|
border-radius: 8px;
|
|
157
157
|
background-color: ${({theme:e})=>e.v2.colors.white[500]+ot["004"]};
|
|
158
|
-
`,
|
|
158
|
+
`,ar=({dataId:o,icon:n,title:a,description:i,withCarret:l,purpleColors:s,disabled:r,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:g})=>e(or,{"data-id":o||`list-item-${a}`,$isSelected:d,$purpleColors:s,$disabled:r,onClick:()=>!d&&!r&&u(),children:[e(W,{$gap:4,children:[e(se,{$gap:12,children:[g&&t(Y,{partiallyChecked:h||!1,value:p||!1,onChange:e=>g(e)}),n&&t(nr,{children:t(n,{size:20})}),t(ae,{size:le.XS,children:a})]}),i&&t(ae,{size:le.XXXS,color:ie.Secondary,children:i})]}),(l||c)&&e(se,{$gap:8,children:[c,l&&t(vi,{size:18})]})]}),ir=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{actionsApi:r}=sl(),[c,d]=s(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=Al(),f=a(()=>(c?nt.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):nt).filter(e=>!!e),[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(ar,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p?.type,f.length,h]),v=a(()=>p?[t(Rs,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:yi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(Sl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();if(e)return!1;await r.create(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:He.CREATING_ACTION,subTitle:He.CREATING_ACTION_SUBTITLE},header:{icon:yi,title:He.ADD_ACTION,subTitle:He.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},lr=({destinationsByCategory:n,filters:i,setFilters:l})=>{const s=a(()=>Object.values(it).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),r=a(()=>{const e=Object.values(Ie).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(lt,{placeholder:"Select category",options:s,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ue,{options:r,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},sr=m.div`
|
|
159
159
|
display: flex;
|
|
160
160
|
flex-direction: column;
|
|
161
161
|
padding: 8px;
|
|
162
162
|
border-radius: 16px;
|
|
163
163
|
border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
|
|
164
164
|
background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
|
|
165
|
-
`,
|
|
165
|
+
`,rr=m.div`
|
|
166
166
|
display: flex;
|
|
167
167
|
align-items: center;
|
|
168
168
|
justify-content: space-between;
|
|
169
169
|
gap: 12px;
|
|
170
170
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
171
|
-
`,
|
|
171
|
+
`,cr=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:l})=>{const[r,c]=s(!0);return e(sr,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:l,children:[e(rr,{$isOpen:r,children:[e(se,{$gap:10,children:[t(ae,{size:le.XS,children:o}),n&&t(De,{text:n,withIcon:!0}),t(Be,{label:a.length,status:l?Ee.Default:void 0})]}),t(st,{icon:r?Si:wi,size:rt.M,onClick:()=>c(e=>!e)})]}),r?t(W,{children:a.length?u.toArray(a):t(at,{$padding:"12px 0",children:t(Ce,{})})}):null]})},dr=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Ne(e.supportedSignals).includes(o.signalType))):e,ur=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(ar,{icon:ut(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Be,{status:n.succeeded?Ee.Success:Ee.Error,leftIcon:n.succeeded?xi:Ti})}),pr=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=Nl();return o?.length?t(cr,{title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:o.map((o,n)=>t(ur,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(cr,{purpleColors:!0,title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},s)=>t(ur,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===s&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:s})},`${e}-${s}`))},e):void 0};var hr;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(hr||(hr={}));const gr=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===hr.SELF_HOSTED?n.push(...e.items):e.name===hr.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=pt(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=ht(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[it.DETECTED]:o,[it.SELF_HOSTED]:n,[it.MANAGED]:a}},mr=({onClose:e,onBack:o,onNext:i,selectedConnectionIds:r,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=sl(),[g,m]=s(""),[f,b]=s({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:w}=h.usePotentialDestinations(),{activeForm:x,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:$}=Nl();n(()=>{d&&$(d)},[d]);const E=C||w,I=a(()=>y?.destinationCategories?.categories??[],[y]),[A,N]=s({[it.ALL]:[],[it.UNSAVED]:[],[it.EXISTS]:[],[it.DETECTED]:[],[it.SELF_HOSTED]:[],[it.MANAGED]:[]});n(()=>{const e=v.map(e=>{let t;for(const o of I){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=ht(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})):[]}});N(t=>({...t,[it.EXISTS]:e}))},[v,I]),n(()=>{(y||S)&&N(e=>({...e,...gr(y,S)}))},[y,S]);const O=l(async()=>{for(const{option:e,formData:t}of k){const o=Oe(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}=Nl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(pr,{listType:it.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(it)){if(i.categoryType&&i.categoryType!==e)continue;const l=dr(o[e],n,i);l.length&&a.push(t(pr,{listType:e,destinationOptions:l},e))}return e&&a.push(t(at,{$height:"100%",children:t(ct,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:E,destinationsByCategory:A,searchText:g,filters:f}),D=(()=>{const{activeForm:e}=Nl();return{width:"60%",list:e?[t(Fs,{},e.option.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:Ci,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Sl,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:o?()=>o(k):void 0,onNext:i?()=>i(k):void 0,nextIsSkip:!k.length,onSave:O,disableSave:!x&&!k.length,isFetching:E,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:He.CREATING_DESTINATION,subTitle:He.CREATING_DESTINATION_SUBTITLE},header:{icon:Ci,title:He.ADD_DESTINATIONS,subTitle:He.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:g,onChange:m},filters:t(lr,{destinationsByCategory:A,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},fr=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{instrumentationRulesApi:r}=sl(),[c,d]=s(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=Ol(),f=a(()=>c?gt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):gt,[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(ar,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(Us,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:ki,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(Sl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();if(e)return!1;await r.create(t,p?.type)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:He.CREATING_INSTRUMENTATION_RULE,subTitle:He.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:ki,title:He.ADD_INSTRUMENTATION_RULE,subTitle:He.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},br={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:He.FETCHING_NAMESPACES,subTitle:He.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:He.SELECT_NAMESPACE,subTitle:He.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},vr={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===mt.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"},yr=e=>e?vr:br,Cr="No matches",Sr="No sources",wr=e=>`No sources matched the filter '${e}'`,xr=e=>(e?"Unselect":"Select")+" all",Tr="Show only:",kr="Selected",$r="Auto",Er="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Ir="Enterprise only",Ar=m.div``,Nr=m.div`
|
|
172
172
|
visibility: hidden;
|
|
173
173
|
|
|
174
174
|
transition: visibility 0s;
|
|
@@ -176,19 +176,19 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
176
176
|
transition-duration: 0s;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
${
|
|
179
|
+
${Ar}:hover & {
|
|
180
180
|
visibility: visible;
|
|
181
181
|
}
|
|
182
|
-
`,
|
|
182
|
+
`,Or=({workloadName:e,workloadKind:o,isChecked:n,onToggle:a,disabled:i,disabledReason:l})=>{const s=f(),r=()=>{};return t(Ar,{children:t(ar,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?r:a,isChecked:n,onCheckboxChange:i?r:a,children:i&&l?t(Be,{label:l,status:Ee.Default,textSize:le.XXXS}):t(Nr,{children:t(Be,{label:o,status:Ee.Info,textSize:le.XXXS,backgroundColor:s.v2.colors.blue[900]})})})})},Rr=m.div``,Dr=m.div`
|
|
183
183
|
visibility: ${({$visible:e})=>e?"visible":"hidden"};
|
|
184
184
|
|
|
185
185
|
transition: visibility 0s;
|
|
186
186
|
${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
|
|
187
187
|
|
|
188
|
-
${
|
|
188
|
+
${Rr}:hover & {
|
|
189
189
|
visibility: visible;
|
|
190
190
|
}
|
|
191
|
-
`,Ls=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Ps,{children:t(ls,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(re,{$gap:12,children:[!d&&t(_s,{$visible:r||i,children:t(De,{text:Ns,children:t(Q,{label:As,labelAlign:ee.Left,size:vt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(re,{$gap:8,children:[t(ae,{variant:yt.Span,size:le.XXXS,color:ie.Secondary,align:"right",children:$s}),t(Be,{label:`${l.sourced}/${l.total}`,status:r?Ie.Default:ft.Unknown,minWidth:"42px"})]})]})})})},zs=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Ls,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(us,{title:n,list:c,noBgColor:!0}):c},Ms=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=y(),{sourcesApi:h,capabilities:g}=rl(),m=ws(p),{selectedStreamName:f}=He(),{progress:b,resetProgress:v}=Ct(),{isFetching:C,setIsFetching:S,setSnapshots:w,formData:T,handleSourceChange:x,handleSelectAll:k,formDiff:E,isFormDirty:I}=Vl(),$=g.canFetchSnapshots,{data:A,loading:N}=sl("GET_ALL_CLUSTER_SNAPSHOTS",void 0,{skip:!$}),{data:O,loading:R}=sl("GET_NAMESPACES_WITH_WORKLOADS",void 0,{skip:$}),D=a(()=>{if($)return A??null;const e=O?.namespaces;return e?.length?{clusters:[{clusterId:wt,clusterName:St,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(f),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(f)??!1)}))||[]}))}]}:null},[$,A,O,f]);n(()=>{S(N||R),D&&w(D)},[D,N,R,S,w]);const[F,P]=r(""),[_,L]=r(mt.Namespace),[z,M]=r({showOnlySelected:!1}),[B,X]=r({clusterId:"",clusterName:"",namespaceName:""}),V=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=ws(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Bl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Xl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(zs,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,r]);return{width:"60%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:h.groupColumnHeader}),t(De,{text:b?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${b?`${v} / ${C}`:C}`,status:ft.Unknown})})]}),t(ae,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:le.XS,children:Es(m)})]}),list:f.length?f:o?[t(at,{$height:"100%",children:t(ct,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(at,{$height:"100%",children:t(Ce,c?{icon:Ii,title:Ts,subTitle:h.noGroupMatchedFilter(c)}:{icon:Ii,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:C,formData:T,handleSourceChange:x,handleSelectAll:k,selectedArea:B,setSelectedArea:X,searchText:_===mt.Namespace?F:"",searchBy:_,filters:z}),U=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=ws(u),h=d===bt.Onprem,g=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),m=a(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>zl(e,r,c)):[],[g,r,c]),f=a(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=a(()=>{if(!g)return[];const{clusterId:e}=l.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Ml.has(l);return t(Fs,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:r,disabledReason:Os},`${e}#${o}#${a}#${l}`)})},[m,g,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(De,{text:v?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${v?`${C} / ${S}`:S}`,status:ft.Unknown})})]}),t(ae,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:le.XS,children:Es(f)})]}),list:b.length?b:[t(at,{$height:"100%",children:t(Ce,g?r?{icon:Ei,title:Ts,subTitle:ks(r)}:{icon:Ei,title:xs,subTitle:p.noItemsInGroupSubTitle}:{icon:Ei,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:T,handleSourceChange:x,handleSelectAll:k,selectedArea:{value:B},searchText:_===mt.Source?F:"",searchBy:_,filters:z});return t(Tl,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{v(Tt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(E):void 0,onNext:l?()=>l(E):void 0,nextIsSkip:!I,onSave:()=>h.persistV2(E),header:{icon:Ei,title:Ge.ADD_SOURCE,subTitle:Ge.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:F,onChange:e=>{P(e),_===mt.Namespace&&X({clusterId:"",clusterName:"",namespaceName:""})},placeholder:m.searchPlaceholder(_),segment:{options:[{label:m.groupSegmentLabel,value:mt.Namespace},{label:m.itemSegmentLabel,value:mt.Source}],selected:_,setSelected:L}},filters:e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:Is}),t(Q,{name:"filter-selected",size:vt.S,label:$s,value:z.showOnlySelected,onChange:e=>M(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:C,progress:{title:Ge.CREATING_SOURCES,subTitle:Ge.CREATING_SOURCES_SUBTITLE,percentage:b[Tt.BulkInstrumenting]?.percentage||0},leftColumn:V,rightColumn:U})},Bs=(e,t)=>{const o=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.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:Ge.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Ge.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Ge.NOTES,label:e.notes}),o},Xs=["actions"],Vs=({onClose:i,actionId:s})=>{const c=f(),{actionsApi:d}=rl({subscribe:Xs}),{items:u}=d,{selectedOption:p,loadAction:h,validateFormData:g,genericForm:m}=Ol(),[b,v]=r(!1),[y,C]=r(!1),[S,w]=r(null),T=b&&!!m?.isFormDirty,x=a(()=>u?.find(e=>xt(e)===s),[s,u]),k=a(()=>nt.find(({type:e})=>e===x?.type)??null,[x?.type]);n(()=>{x&&h(x)},[x]);const E=l(()=>{x&&v(!0)},[x]),I=l(()=>{x&&(h(x),v(!1))},[x,h]),$=l(()=>{T?w("close"):i()},[T,i]),A=l(()=>{T?w("cancel"):I()},[T,I]),N=l(()=>{const e=S;w(null),"close"===e?(I(),i()):I()},[S,I,i]),O=l(async()=>{if(x){const{errorMessage:e,preparedFormData:t}=g();e||(await d.update(x.id,t),v(!1))}},[x,g,d]),R=l(()=>{x&&C(!0)},[x]),D=l(async()=>{x&&(await d.remove(x.id,x.type),i())},[x,d,i]);if(!x||!k)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?Ie.Success:ft.Unknown,label:e?"True":"False",invertColors:!0});if(o===ye.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||Z.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||Z.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===ye.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ye.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ye.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:a,regex:i},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})})}return o===ye.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(x);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:At(x.type),title:k.label,onClose:$,actions:[{id:"edit-action-btn-edit",label:kt.EDIT,icon:mi,active:b,onClick:E},{id:"edit-action-btn-delete",label:kt.DELETE,icon:si,color:c.v2.colors.red[500],active:y,onClick:R}]},footer:{actions:b?[{"data-id":"edit-action-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:kt.SAVE,variant:de.Primary,onClick:O}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:b&&p?t(Fr,{}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[t($t,{conditions:x.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Bs(x,k)})]}),!!F?.length&&t(It,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(xl,{target:"action",isOpen:y,onClose:()=>C(!1),onApprove:D}),t(kl,{isOpen:null!==S,onClose:()=>w(null),onApprove:N})]})},Us=({onClose:o,connections:l,selectedConnectionIds:s,setSelectedConnectionIds:c})=>{const{configApi:d}=rl(),[u,p]=r(""),[h,g]=r({showOnlySelected:!1}),m=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&s.includes(e.id);return t&&o}),[l.length,s.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===s.length?s[0]:void 0,{data:v,loading:y}=sl("GET_EFFECTIVE_CONFIG",b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:T,resetFormData:x}=Nt(C||{rollout:{automaticRolloutDisabled:!1}}),k=i(x);k.current=x,n(()=>{C&&k.current(C)},[C]);const E=a(()=>s.length>1||void 0!==C&&!T(C,S),[s.length,C,S]);return t(Tl,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,s))??void 0,header:{icon:$i,title:"Cluster Configuration"},connectionIds:{value:s,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:"Show only:"}),t(Q,{size:vt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:y,leftColumn:{width:"35%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,children:"Clusters"}),t(Be,{label:m.length,status:ft.Unknown})]}),e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,align:"right",children:"Selected clusters"}),t(Be,{label:`${s.length}/${m.length}`,status:ft.Unknown})]})]}),list:m.map(e=>t(ls,{title:e.name,isChecked:s.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ae,{size:le.XS,children:"Configurations"}),list:[t(Q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Gs=e=>{const t=[{id:"type",title:Ge.TYPE,label:e.destinationType.displayName},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}],o=Ae(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:Ge.MONITORS,label:o}),e.name&&t.push({id:"name",title:Ge.NAME,label:e.name}),t},Hs=["destinations","destinationCategories"],js=({onClose:s,destinationId:c})=>{const d=f(),{isVm:u}=y(),{destinationsApi:p}=rl({subscribe:Hs}),{items:h,categoriesResult:g,categoriesLoading:m}=p,{selectedStreamName:b}=He(),{activeForm:v,loadDestination:C,validateFormData:S,genericForm:w}=Rl(),T=i(null),[x,k]=r(!1),[E,I]=r(!1),[$,A]=r(null),N=x&&!!w?.isFormDirty,O=a(()=>Dt(h,b),[h,b]),R=a(()=>O?.find(e=>xt(e)===c),[c,O]),D=g?.destinationCategories?.categories??null;n(()=>{R&&D&&C(R,D)},[R,D]);const F=a(()=>R&&D?Ft(D,R):[],[R,D]),P=l(()=>{R&&k(!0)},[R]),_=l(()=>{R&&D&&(C(R,D),k(!1))},[R,D,C]),L=l(()=>{N?A("close"):s()},[N,s]),z=l(()=>{N?A("cancel"):_()},[N,_]),M=l(()=>{const e=$;A(null),"close"===e?(_(),s()):_()},[$,_,s]),B=l(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=S();e||(await p.update(R.id,Oe(t)),k(!1))}},[R,S,p]),X=l(()=>{R&&I(!0)},[R]),V=l(async()=>{R&&(await p.remove(R.id),s())},[R,p,s]);if(!R)return null;const{icon:U,iconSrc:G}=ut(R.destinationType.type),H=((e,t)=>{const o=[],n=Ot(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=Ae(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&ke(h,i,a))return;const{type:m}=ht(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===Rt.MultiInput){const t=ht(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===Rt.KeyValuePair){const t=ht(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})(R,F);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:U,iconSrc:G,title:R.name||R.destinationType.displayName,onClose:L,actions:[{id:"edit-destination-btn-edit",label:kt.EDIT,icon:mi,active:x,onClick:P},{id:"edit-destination-btn-delete",label:kt.DELETE,icon:si,color:d.v2.colors.red[500],active:E,onClick:X}]},footer:{actions:x?[{"data-id":"edit-destination-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:z},...v?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:kt.TEST_CONNECTION,variant:de.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:kt.SAVE,variant:de.Primary,onClick:B}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:m?t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})}):x&&v?t(Lr,{ref:T,isEdit:!0}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[!u&&t($t,{conditions:R.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Gs(R)})]}),!!H.length&&t(It,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:H.map(e=>"cells"===e.kind?t(It,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(It,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(xl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:V}),t(kl,{isOpen:null!==$,onClose:()=>A(null),onApprove:M})]})},Ws=(e,t)=>{const o=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Ge.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Ge.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Ge.NOTES,label:e.notes}),o},Ks=["rules"],Ys=({onClose:i,ruleId:s})=>{const c=f(),{instrumentationRulesApi:d}=rl({subscribe:Ks}),{items:u}=d,{addNotification:p}=_t(),{selectedOption:h,loadRule:g,validateFormData:m,genericForm:b}=Dl(),[v,y]=r(!1),[C,S]=r(!1),[w,T]=r(null),x=v&&!!b?.isFormDirty,k=a(()=>u?.find(e=>xt(e)===s),[s,u]),E=a(()=>gt.find(({type:e})=>e===k?.type)??null,[k?.type]);n(()=>{k&&g(k)},[k]);const I=l(()=>{if(k){if(!k.mutable)return void p({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_EDIT_RULE,crdType:mt.InstrumentationRule,target:k.ruleId,hideFromHistory:!0});y(!0)}},[k,p]),$=l(()=>{k&&(g(k),y(!1))},[k,g]),A=l(()=>{x?T("close"):i()},[x,i]),N=l(()=>{x?T("cancel"):$()},[x,$]),O=l(()=>{const e=w;T(null),"close"===e?($(),i()):$()},[w,$,i]),R=l(async()=>{if(k){const{errorMessage:e,preparedFormData:t}=m();e||(await d.update(k.ruleId,t,k.type),y(!1))}},[k,m,d]),D=l(()=>{if(k){if(!k.mutable)return void p({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_DELETE_RULE,crdType:mt.InstrumentationRule,target:k.ruleId,hideFromHistory:!0});S(!0)}},[k,p]),F=l(async()=>{k&&(await d.remove(k.ruleId,k.type),i())},[k,d,i]);if(!k||!E)return null;const P=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},e))}),e.headersCollection?.[Fe.HeaderKeys]?.length&&e.headersCollection[Fe.HeaderKeys].forEach(e=>{e&&n.push(t(ae,{size:le.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[ze.Java]?.forEach((e,a)=>{const i=new Le(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[ze.Golang]?.forEach((e,a)=>{const i=new _e(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})(k,c);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:Mt(k.type),title:E.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:kt.EDIT,icon:mi,active:v,onClick:I},{id:"edit-rule-btn-delete",label:kt.DELETE,icon:si,color:c.v2.colors.red[500],active:C,onClick:D}]},footer:{actions:v?[{"data-id":"edit-rule-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:N},{"data-id":"edit-rule-btn-save",label:kt.SAVE,variant:de.Primary,onClick:R}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:v&&h?t(Hr,{}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[t($t,{conditions:k.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Ws(k,E)})]}),t(hl,{readOnly:!0,scopes:k.sourceScopes??null}),!!P.length&&t(It,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",children:P})}),!!E.supportedLanguages.length&&t(It,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",children:t(re,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(zt,{label:Xe[e],leftIcon:Ve(e),flex:"0.5"},e))})})})]})})})}),t(xl,{target:"instrumentation rule",isOpen:C,onClose:()=>S(!1),onApprove:F}),t(kl,{isOpen:null!==w,onClose:()=>T(null),onApprove:O})]})};var Js;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(Js||(Js={}));const qs=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Bt(),g=Xt(!!o),m=a(()=>({title:l,icon:Ai,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Vt(c);t&&e.push(t);const o=Vt(d,Ni,"health");o&&e.push(o);const n=Vt(u,Oi,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ri,label:kt.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Ge.NODE,label:r,withCopy:!0},{id:"age",title:Ge.AGE,label:s?h(s,{style:"short"}):Ge.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:g,children:t(It,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Zs=m.div`
|
|
191
|
+
`,Pr=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Rr,{children:t(ar,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(se,{$gap:12,children:[!d&&t(Dr,{$visible:s||i,children:t(De,{text:Er,children:t(Q,{label:$r,labelAlign:ee.Left,size:vt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(se,{$gap:8,children:[t(ae,{variant:yt.Span,size:le.XXXS,color:ie.Secondary,align:"right",children:kr}),t(Be,{label:`${l.sourced}/${l.total}`,status:s?Ee.Default:ft.Unknown,minWidth:"42px"})]})]})})})},Fr=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:s,handleSourceChange:r})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Pr,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>s({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:r},`${o}#${e}`)),[o,n,i,l]);return e?t(cr,{title:n,list:c,noBgColor:!0}):c},Lr=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=y(),{sourcesApi:h,snapshotsApi:g,namespacesApi:m}=sl(),{data:f,loading:b}=g.useSnapshots(),{items:v,loading:C}=m.useNamespaces(),S=yr(p),{selectedStreamName:w}=Ge(),{progress:x,resetProgress:T}=Ct(),{isFetching:k,setIsFetching:$,setSnapshots:E,formData:I,handleSourceChange:A,handleSelectAll:N,formDiff:O,isFormDirty:R}=Bl(),D=a(()=>{if(f)return f;const e=v;return e.length?{clusters:[{clusterId:wt,clusterName:St,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(w),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(w)??!1)}))||[]}))}]}:null},[f,v,w]);n(()=>{$(b||C),D&&E(D)},[D,b,C,$,E]);const[P,F]=s(""),[L,_]=s(mt.Namespace),[z,M]=s({showOnlySelected:!1}),[B,X]=s({clusterId:"",clusterName:"",namespaceName:""}),V=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:s,setSelectedArea:r,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=yr(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>zl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Ml(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(Fr,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:s,setSelectedArea:r,handleSourceChange:i},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,s]);return{width:"60%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:h.groupColumnHeader}),t(De,{text:b?He.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${b?`${v} / ${C}`:C}`,status:ft.Unknown})})]}),t(ae,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:le.XS,children:xr(m)})]}),list:f.length?f:o?[t(at,{$height:"100%",children:t(ct,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(at,{$height:"100%",children:t(Ce,c?{icon:Ei,title:Cr,subTitle:h.noGroupMatchedFilter(c)}:{icon:Ei,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:k,formData:I,handleSourceChange:A,handleSelectAll:N,selectedArea:B,setSelectedArea:X,searchText:L===mt.Namespace?P:"",searchBy:L,filters:z}),U=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:s,searchBy:r,filters:c})=>{const{tier:d,isVm:u}=y(),p=yr(u),h=d===bt.Onprem,g=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),m=a(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ll(e,s,c)):[],[g,s,c]),f=a(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=a(()=>{if(!g)return[];const{clusterId:e}=l.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&_l.has(l);return t(Or,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:s,disabledReason:Ir},`${e}#${o}#${a}#${l}`)})},[m,g,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(De,{text:v?He.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${v?`${C} / ${S}`:S}`,status:ft.Unknown})})]}),t(ae,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:s,searchBy:r,filters:c}),disabled:!b.length,size:le.XS,children:xr(f)})]}),list:b.length?b:[t(at,{$height:"100%",children:t(Ce,g?s?{icon:$i,title:Cr,subTitle:wr(s)}:{icon:$i,title:Sr,subTitle:p.noItemsInGroupSubTitle}:{icon:$i,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:I,handleSourceChange:A,handleSelectAll:N,selectedArea:{value:B},searchText:L===mt.Source?P:"",searchBy:L,filters:z});return t(Sl,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{T(xt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(O):void 0,onNext:l?()=>l(O):void 0,nextIsSkip:!R,onSave:()=>h.persistV2(O),header:{icon:$i,title:He.ADD_SOURCE,subTitle:He.ADD_SOURCES_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:P,onChange:e=>{F(e),L===mt.Namespace&&X({clusterId:"",clusterName:"",namespaceName:""})},placeholder:S.searchPlaceholder(L),segment:{options:[{label:S.groupSegmentLabel,value:mt.Namespace},{label:S.itemSegmentLabel,value:mt.Source}],selected:L,setSelected:_}},filters:e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:Tr}),t(Q,{name:"filter-selected",size:vt.S,label:kr,value:z.showOnlySelected,onChange:e=>M(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:R,isFetching:k,progress:{title:He.CREATING_SOURCES,subTitle:He.CREATING_SOURCES_SUBTITLE,percentage:x[xt.BulkInstrumenting]?.percentage||0},leftColumn:V,rightColumn:U})},_r=(e,t)=>{const o=[{id:"type",title:He.TYPE,label:t.label},{id:"status",title:He.STATUS,badge:{status:e.disabled?ft.Unknown:Ee.Success,label:e.disabled?He.DISABLED:He.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:He.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:He.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:He.NOTES,label:e.notes}),o},zr=({onClose:i,actionId:r})=>{const c=f(),{actionsApi:d}=sl(),{items:u}=d.useActions(),{selectedOption:p,loadAction:h,validateFormData:g,genericForm:m}=Al(),[b,v]=s(!1),[y,C]=s(!1),[S,w]=s(null),x=b&&!!m?.isFormDirty,T=a(()=>u?.find(e=>Tt(e)===r),[r,u]),k=a(()=>nt.find(({type:e})=>e===T?.type)??null,[T?.type]);n(()=>{T&&h(T)},[T]);const $=l(()=>{T&&v(!0)},[T]),E=l(()=>{T&&(h(T),v(!1))},[T,h]),I=l(()=>{x?w("close"):i()},[x,i]),A=l(()=>{x?w("cancel"):E()},[x,E]),N=l(()=>{const e=S;w(null),"close"===e?(E(),i()):E()},[S,E,i]),O=l(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=g();e||(await d.update(T.id,t),v(!1))}},[T,g,d]),R=l(()=>{T&&C(!0)},[T]),D=l(async()=>{T&&(await d.remove(T.id,T.type),i())},[T,d,i]);if(!T||!k)return null;const P=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?Ee.Success:ft.Unknown,label:e?"True":"False",invertColors:!0});if(o===ye.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||Z.Pod,r=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||Z.Pod,r=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),o===ye.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ye.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ye.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:a,regex:i},l)=>{const s=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${s}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${s}Lookup Key`,label:n}),a&&t.push({id:`extract-${l}-format`,title:`${s}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${s}Regex`,label:i})})}return o===ye.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:At(T.type),title:k.label,onClose:I,actions:[{id:"edit-action-btn-edit",label:kt.EDIT,icon:mi,active:b,onClick:$},{id:"edit-action-btn-delete",label:kt.DELETE,icon:ri,color:c.v2.colors.red[500],active:y,onClick:R}]},footer:{actions:b?[{"data-id":"edit-action-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:kt.SAVE,variant:de.Primary,onClick:O}]:[]},children:t($t,{$padding:"4px 12px 12px",children:b&&p?t(Rs,{}):t(W,{$gap:16,children:e(Et,{bgTint:"1000",children:[e(Et,{bgTint:"900",children:[t(It,{conditions:T.conditions||[]}),t(Et,{bgTint:"800",cellsPerRow:2,items:_r(T,k)})]}),!!P?.length&&t(Et,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Et,{bgTint:"800",cellsPerRow:2,items:P})})]})})})}),t(wl,{target:"action",isOpen:y,onClose:()=>C(!1),onApprove:D}),t(xl,{isOpen:null!==S,onClose:()=>w(null),onApprove:N})]})},Mr=({onClose:o,connections:l,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=sl(),[u,p]=s(""),[h,g]=s({showOnlySelected:!1}),m=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&o}),[l.length,r.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:T}=Nt(C||{rollout:{automaticRolloutDisabled:!1}}),k=i(T);k.current=T,n(()=>{C&&k.current(C)},[C]);const $=a(()=>r.length>1||void 0!==C&&!x(C,S),[r.length,C,S]);return t(Sl,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:Ii,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:"Show only:"}),t(Q,{size:vt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:$,isFetching:y,leftColumn:{width:"35%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(ae,{size:le.XS,children:"Clusters"}),t(Be,{label:m.length,status:ft.Unknown})]}),e(se,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,align:"right",children:"Selected clusters"}),t(Be,{label:`${r.length}/${m.length}`,status:ft.Unknown})]})]}),list:m.map(e=>t(ar,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ae,{size:le.XS,children:"Configurations"}),list:[t(Q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Br=e=>{const t=[{id:"type",title:He.TYPE,label:e.destinationType.displayName},{id:"status",title:He.STATUS,badge:{status:e.disabled?ft.Unknown:Ee.Success,label:e.disabled?He.DISABLED:He.ENABLED}}],o=Ae(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:He.MONITORS,label:o}),e.name&&t.push({id:"name",title:He.NAME,label:e.name}),t},Xr=({onClose:r,destinationId:c})=>{const d=f(),{isVm:u}=y(),{destinationsApi:p}=sl(),{items:h}=p.useDestinations(),{data:g,loading:m}=p.useDestinationCategories(),{selectedStreamName:b}=Ge(),{activeForm:v,loadDestination:C,validateFormData:S,genericForm:w}=Nl(),x=i(null),[T,k]=s(!1),[$,E]=s(!1),[I,A]=s(null),N=T&&!!w?.isFormDirty,O=a(()=>Dt(h,b),[h,b]),R=a(()=>O?.find(e=>Tt(e)===c),[c,O]),D=g?.destinationCategories?.categories??null;n(()=>{R&&D&&C(R,D)},[R,D]);const P=a(()=>R&&D?Pt(D,R):[],[R,D]),F=l(()=>{R&&k(!0)},[R]),L=l(()=>{R&&D&&(C(R,D),k(!1))},[R,D,C]),_=l(()=>{N?A("close"):r()},[N,r]),z=l(()=>{N?A("cancel"):L()},[N,L]),M=l(()=>{const e=I;A(null),"close"===e?(L(),r()):L()},[I,L,r]),B=l(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=S();e||(await p.update(R.id,Oe(t)),k(!1))}},[R,S,p]),X=l(()=>{R&&E(!0)},[R]),V=l(async()=>{R&&(await p.remove(R.id),r())},[R,p,r]);if(!R)return null;const{icon:U,iconSrc:H}=ut(R.destinationType.type),G=((e,t)=>{const o=[],n=Ot(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=Ae(e.exportedSignals);let l=[];const s=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&ke(h,i,a))return;const{type:m}=ht(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==r&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(r)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===Rt.MultiInput){const t=ht(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===Rt.KeyValuePair){const t=ht(r,null);if(Array.isArray(t)&&t.length)return s(),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:r})}else l.push({id:e,title:n,label:"-"})}),s(),o})(R,P);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:U,iconSrc:H,title:R.name||R.destinationType.displayName,onClose:_,actions:[{id:"edit-destination-btn-edit",label:kt.EDIT,icon:mi,active:T,onClick:F},{id:"edit-destination-btn-delete",label:kt.DELETE,icon:ri,color:d.v2.colors.red[500],active:$,onClick:X}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:z},...v?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:kt.TEST_CONNECTION,variant:de.Secondary,onClick:()=>x.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:kt.SAVE,variant:de.Primary,onClick:B}]:[]},children:t($t,{$padding:"4px 12px 12px",children:m?t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})}):T&&v?t(Fs,{ref:x,isEdit:!0}):t(W,{$gap:16,children:e(Et,{bgTint:"1000",children:[e(Et,{bgTint:"900",children:[!u&&t(It,{conditions:R.conditions||[]}),t(Et,{bgTint:"800",cellsPerRow:2,items:Br(R)})]}),!!G.length&&t(Et,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Et,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Et,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(wl,{target:"destination",isOpen:$,onClose:()=>E(!1),onApprove:V}),t(xl,{isOpen:null!==I,onClose:()=>A(null),onApprove:M})]})},Vr=(e,t)=>{const o=[{id:"type",title:He.TYPE,label:t.label},{id:"status",title:He.STATUS,badge:{status:e.disabled?ft.Unknown:Ee.Success,label:e.disabled?He.DISABLED:He.ENABLED}}];return e.ruleName&&o.push({id:"name",title:He.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:He.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:He.NOTES,label:e.notes}),o},Ur=({onClose:i,ruleId:r})=>{const c=f(),{instrumentationRulesApi:d}=sl(),{items:u}=d.useRules(),{addNotification:p}=Lt(),{selectedOption:h,loadRule:g,validateFormData:m,genericForm:b}=Ol(),[v,y]=s(!1),[C,S]=s(!1),[w,x]=s(null),T=v&&!!b?.isFormDirty,k=a(()=>u?.find(e=>Tt(e)===r),[r,u]),$=a(()=>gt.find(({type:e})=>e===k?.type)??null,[k?.type]);n(()=>{k&&g(k)},[k]);const E=l(()=>{if(k){if(!k.mutable)return void p({type:Ee.Warning,title:_t.FORBIDDEN,message:_t.CANNOT_EDIT_RULE,crdType:mt.InstrumentationRule,target:k.ruleId,hideFromHistory:!0});y(!0)}},[k,p]),I=l(()=>{k&&(g(k),y(!1))},[k,g]),A=l(()=>{T?x("close"):i()},[T,i]),N=l(()=>{T?x("cancel"):I()},[T,I]),O=l(()=>{const e=w;x(null),"close"===e?(I(),i()):I()},[w,I,i]),R=l(async()=>{if(k){const{errorMessage:e,preparedFormData:t}=m();e||(await d.update(k.ruleId,t,k.type),y(!1))}},[k,m,d]),D=l(()=>{if(k){if(!k.mutable)return void p({type:Ee.Warning,title:_t.FORBIDDEN,message:_t.CANNOT_DELETE_RULE,crdType:mt.InstrumentationRule,target:k.ruleId,hideFromHistory:!0});S(!0)}},[k,p]),P=l(async()=>{k&&(await d.remove(k.ruleId,k.type),i())},[k,d,i]);if(!k||!$)return null;const F=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Ft(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Ft(e).toLowerCase()}`},e))}),e.headersCollection?.[Pe.HeaderKeys]?.length&&e.headersCollection[Pe.HeaderKeys].forEach(e=>{e&&n.push(t(ae,{size:le.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[ze.Java]?.forEach((e,a)=>{const i=new _e(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[ze.Golang]?.forEach((e,a)=>{const i=new Le(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})(k,c);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:Mt(k.type),title:$.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:kt.EDIT,icon:mi,active:v,onClick:E},{id:"edit-rule-btn-delete",label:kt.DELETE,icon:ri,color:c.v2.colors.red[500],active:C,onClick:D}]},footer:{actions:v?[{"data-id":"edit-rule-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:N},{"data-id":"edit-rule-btn-save",label:kt.SAVE,variant:de.Primary,onClick:R}]:[]},children:t($t,{$padding:"4px 12px 12px",children:v&&h?t(Us,{}):t(W,{$gap:16,children:e(Et,{bgTint:"1000",children:[e(Et,{bgTint:"900",children:[t(It,{conditions:k.conditions||[]}),t(Et,{bgTint:"800",cellsPerRow:2,items:Vr(k,$)})]}),t(ul,{readOnly:!0,scopes:k.sourceScopes??null}),!!F.length&&t(Et,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Et,{bgTint:"800",children:F})}),!!$.supportedLanguages.length&&t(Et,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Et,{bgTint:"800",children:t(se,{$gap:12,$wrap:"wrap",children:$.supportedLanguages.map(e=>t(zt,{label:Xe[e],leftIcon:Ve(e),flex:"0.5"},e))})})})]})})})}),t(wl,{target:"instrumentation rule",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(xl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})};var Hr;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(Hr||(Hr={}));const Gr=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:s,startTime:r,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Bt(),g=Xt(!!o),m=a(()=>({title:l,icon:Ai,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Vt(c);t&&e.push(t);const o=Vt(d,Ni,"health");o&&e.push(o);const n=Vt(u,Oi,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ri,label:kt.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:He.NODE,label:s,withCopy:!0},{id:"age",title:He.AGE,label:r?h(r,{style:"short"}):He.NOT_RUNNING,labelTooltip:r}],[s,r,h]);return t("div",{ref:g,children:t(Et,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},jr=m.div`
|
|
192
192
|
display: flex;
|
|
193
193
|
align-items: center;
|
|
194
194
|
justify-content: space-between;
|
|
@@ -196,7 +196,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
196
196
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
197
197
|
border-radius: 12px;
|
|
198
198
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
199
|
-
`,
|
|
199
|
+
`,Wr=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=Gt(o?.status),s=Ft(o?.name),r=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Ut.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Ut.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Ut.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(jr,{$noPadding:i,children:[t(Ht,{invertColors:!0,hideBackground:!0,status:l,title:s,subTitle:r}),e(se,{$gap:8,children:[t(Yr,{label:He.PODS,count:c}),t(Yr,{label:He.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Yr,{label:He.ODIGOS_HEALTHY,icon:Ni,count:u,total:c}),t(Yr,{label:He.KUBERNETES_HEALTHY,icon:Oi,count:p,total:c})]})]}):null},Kr=m.div`
|
|
200
200
|
display: flex;
|
|
201
201
|
flex-direction: column;
|
|
202
202
|
justify-content: center;
|
|
@@ -207,7 +207,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
207
207
|
width: fit-content;
|
|
208
208
|
border-radius: 8px;
|
|
209
209
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
210
|
-
`,
|
|
210
|
+
`,Yr=({count:o,total:n,label:a,icon:i})=>{const l=f(),s=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Kr,{children:[e(se,{$gap:0,$alignItems:"flex-end",children:[t(ae,{size:le.L,color:s,weight:500,nowrap:!0,children:o}),void 0!==n&&t(ae,{size:le.S,color:s,weight:500,nowrap:!0,children:`/${n}`})]}),e(se,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(ae,{size:le.XXXS,nowrap:!0,children:a})]})]})},Jr=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===jt.PID)??e.identifyingAttributes?.find(({name:e})=>e===jt.VPID);return t?.value??null};var qr;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(qr||(qr={}));const Zr=({overrideProcessNum:o,healthy:i,healthStatus:l,identifyingAttributes:r,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=s(qr.IdentifyingAttributes),g=Xt(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:qr.IdentifyingAttributes,label:He.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:u.v2.colors.purple[500]},{value:qr.InstrumentationLibraries,label:He.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Di,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[r,c]);n(()=>{b&&h(b)},[b]);const y=a(()=>{switch(p){case qr.IdentifyingAttributes:return t(W,{children:r?.map(e=>t(nc,{label:e.name,value:e.value},e.name))});case qr.InstrumentationLibraries:return t(W,{children:c?.map(e=>t(nc,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[p,r,c]),C=a(()=>Jr({overrideProcessNum:o,identifyingAttributes:r}),[o,r]);return t("div",{ref:g,children:e(Et,{bgTint:"800",richTitle:{title:C?`${He.PROCESS} ${He.PID(C)}`:He.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ae,{color:i?ie.Success:ie.Error,size:le.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?Ee.Success:Ee.Error,leftIcon:Ni,label:i?He.HEALTHY:He.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(ue,{options:m,selected:p,setSelected:h}),!v&&y]})})},Qr=m.div`
|
|
211
211
|
display: flex;
|
|
212
212
|
align-items: flex-start;
|
|
213
213
|
gap: 8px;
|
|
@@ -216,23 +216,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
216
216
|
&:hover {
|
|
217
217
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
218
218
|
}
|
|
219
|
-
`,
|
|
219
|
+
`,ec=m(ae)`
|
|
220
220
|
flex: 0 0 30%;
|
|
221
|
-
`,
|
|
221
|
+
`,tc=m(ae)`
|
|
222
222
|
flex: 1 1 auto;
|
|
223
223
|
min-width: 0;
|
|
224
|
-
`,
|
|
224
|
+
`,oc=m(se)`
|
|
225
225
|
flex: 1 1 auto;
|
|
226
226
|
justify-content: flex-end;
|
|
227
227
|
min-width: 0;
|
|
228
|
-
`,
|
|
228
|
+
`,nc=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const s="boolean"==typeof i;return e(Qr,{children:[t(ec,{size:le.XXS,color:ie.Secondary,children:o}),n&&t(tc,{size:le.XXS,color:ie.Primary,align:"right",children:n}),(s||a)&&e(oc,{children:[a&&t(Be,{status:Ee.Info,label:He.STANDARD,textSize:le.XXXS,invertColors:!0}),s&&t(Be,{status:i?Ee.Success:Ee.Error,label:i?He.HEALTHY:He.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},ac=p(null),ic=({value:e,children:o})=>t(ac.Provider,{value:e,children:o}),lc=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:He.CONTAINERS,titleSize:le.XS,badge:{label:i.length}}),[i.length]),s=a(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(Et,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(W,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(rc,{...e,language:Wt(s.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},sc=m.div`
|
|
229
229
|
display: flex;
|
|
230
230
|
flex-direction: column;
|
|
231
231
|
gap: 12px;
|
|
232
232
|
padding: 8px 12px;
|
|
233
233
|
border-radius: 8px;
|
|
234
234
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
235
|
-
`,
|
|
235
|
+
`,rc=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:s,ready:r,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:g,processes:m,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Bt(),C=Xt(v),S=a(()=>({title:n,icon:o?Ve(o):Pi,iconWithWrapper:!0}),[n,o]),w=a(()=>{const e=[],t=Vt({status:i?Ut.Success:Ut.Disabled,reasonEnum:i?He.INSTRUMENTED_WITH_DISTRO(i):He.UNINSTRUMENTED,message:""});t&&e.push(t);const o=Vt(h,Ni,"health");o&&e.push(o);const n=Vt(g,Oi,"health");return n&&e.push(n),e},[g,h,i]),x=a(()=>[{id:"runningTime",title:He.RUNNING_TIME,label:l?y(l,{style:"short"}):He.NOT_RUNNING,labelTooltip:`${He.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:s?Ee.Success:Kt.Disabled,leftIcon:s?ui:pi,label:s?He.STARTED:He.NOT_STARTED,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:r?Ee.Success:Kt.Disabled,leftIcon:r?ui:pi,label:r?He.READY:He.NOT_READY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Ee.Error:Ee.Success,leftIcon:d?pi:ui,label:d?He.CRASHLOOP:He.NO_CRASHLOOP,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:He.RESTARTS,badge:{status:c?Ee.Error:void 0,label:c||0,textSize:le.XXXS}}],[l,y,s,r,d,c]),T=a(()=>p?Ft(u):"",[p,u]);return t("div",{ref:C,children:e(Et,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(sc,{children:e(se,{$gap:10,$alignItems:"center",children:[t(zt,{variant:Yt.Pink,leftIcon:Oi,label:T}),t(ae,{size:le.XXXS,color:ie.Error,children:p})]})}),(m??[]).map((e,o)=>{const a=o+1,i=b&&(l=f,s=e,!!l?.processPid&&Jr({identifyingAttributes:s.identifyingAttributes})===l.processPid);var l,s;return t(Zr,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${n}-process-${a}`)})]})})},cc=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:He.DEBUG_COMMANDS,titleSize:le.XS}),[]),l=a(()=>[{label:He.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:He.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:He.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(Et,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(Jt,{bgTint:"700",label:e,value:o},e))})},dc=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=h(ac);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),s=l?.tab===Hr.Pods?l:null,r=n?.pods??[],c=r.length>0,d=a(()=>r.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[r]),u=a(()=>({title:He.PODS,badge:{label:r.length}}),[r.length]);return t(W,{$gap:12,children:c?e(o,{children:[t(Wr,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:r}),t(Et,{bgTint:"1000",richTitle:u,children:r.map(o=>{const a=s?.podName===o.podName,l=a&&!s?.containerName;return e(Gr,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(cc,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(lc,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?s:null})]},`pod-${o.podName}`)})})]}):t(at,{$height:"70vh",children:t(Ce,{title:He.NO_RUNNING_PODS,subTitle:He.NO_RUNNING_PODS_SUBTITLE})})})},uc=({source:o})=>{const n=a(()=>o.serviceName||o.id.name,[o]),{sourcesApi:i}=sl(),{data:l,loading:s,refetch:r}=i.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||s?t(at,s?{$height:"70vh",children:t(ct,{withSpinner:!0})}:{$height:"70vh",children:t(Ce,{subTitle:He.COULD_NOT_FETCH_PEER_SOURCES})}):e(se,{$gap:16,$alignItems:"flex-start",children:[t(pc,{icon:Fi,title:He.INBOUND,subTitle:He.INBOUND_DESCRIPTION(n),onRefresh:r,items:c?.inbound??[]}),t(pc,{icon:Li,title:He.OUTBOUND,subTitle:He.OUTBOUND_DESCRIPTION(n),onRefresh:r,items:c?.outbound??[]})]})},pc=({icon:o,title:n,subTitle:i,onRefresh:l,items:r})=>{const[c,d]=s(""),u=a(()=>r.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[r,c]);return e(Et,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:le.XS,subTitle:i,subTitleSize:le.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:qt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ri,onClick:l}}],children:[t(Zt,{value:c,onChange:d,width:"100%"}),t(Qt,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(at,{$height:"50vh",children:t(Ce,{icon:o,title:He.NO_RESULTS,subTitle:He.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(gc,{...e},`${n}-${e.serviceName}`)):[t(at,{$height:"50vh",children:t(Ce,{icon:o,title:`No ${n} connections yet`,subTitle:n===He.INBOUND?He.NO_INBOUND_CONNECTIONS_DESCRIPTION:He.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},hc=m.div`
|
|
236
236
|
display: flex;
|
|
237
237
|
align-items: center;
|
|
238
238
|
justify-content: space-between;
|
|
@@ -246,9 +246,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
246
246
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
247
247
|
}
|
|
248
248
|
`}
|
|
249
|
-
`,
|
|
249
|
+
`,gc=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=eo(e=>e.drawerEntityId),{items:s}=sl().sourcesApi.useSources(),r=a(()=>s.find(e=>e.id.name===o||e.serviceName===o),[s,o]),c=a(()=>r&&JSON.stringify(to(r))!==JSON.stringify(to(l)),[r,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[oo({serviceName:o,attributes:e})]}if("user"===o?.toLowerCase())return[_i];const e=r?no(r):void 0;return e?.length?e:[Pi]},[n,i,o,r]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=eo.getState();e(mt.Source),t({namespace:r?.id.namespace??"",name:r?.id.name??"",kind:r?.id.kind??""})}:void 0;return e(hc,{onClick:u,$withClick:!!u,children:[e(se,{$gap:8,children:[t(ao,{icons:d}),t(ae,{size:le.XXS,children:o})]}),n&&t(Be,{status:Ee.Info,label:He.VIRTUAL,textSize:le.XXXS,invertColors:!0,tooltip:He.VIRTUAL_TOOLTIP})]})},mc=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}},fc=({source:o})=>{const i=f(),{k8sManifestApi:l}=sl(),[r,c]=s(!0),[d,u]=s(void 0),[p,h]=s(!0),[g,m]=s(void 0);n(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>u(mc(e))).finally(()=>c(!1)),l.fetch({namespace:o.id.namespace,kind:io.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>m(mc(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const b=a(()=>[{label:He.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:He.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:He.GET_POD_YAML,value:`kubectl get ${io.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(Et,{bgTint:"1000",children:[t(Et,{bgTint:"900",richTitle:{icon:zi,title:He.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:b.map(({label:e,value:o})=>t(Jt,{label:e,value:o},e))}),r?t(lo,{size:1}):t(Tl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(lo,{size:1}):t(Tl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g})]})},bc=({title:o,children:n})=>e(W,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,children:o}),n]}),vc=({source:o})=>{const n=a(()=>{const[e,t]=so(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(bc,{title:He.THROUGHPUT_LAST_10_SECONDS,children:e(se,{$alignItems:"flex-end",$gap:4,children:[t(ae,{size:le.L,children:n.value}),t(ae,{size:le.XS,variant:yt.Span,children:n.units})]})})},yc=({source:o})=>{const{CopyButton:n}=ro();return t(bc,{title:He.NAMESPACE,children:e(se,{children:[t(zt,{variant:Yt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:rt.XS})]})})},Cc=({source:e})=>t(bc,{title:He.KIND,children:t(se,{children:t(zt,{variant:Yt.Blue,label:e.id.kind})})}),Sc=({source:o})=>{const{CopyButton:n}=ro();return t(bc,{title:He.NAME,children:e(se,{children:[t(zt,{variant:Yt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:rt.XS})]})})},wc=({source:o})=>{const{isVm:n}=y();return t(Et,{children:e(se,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!n&&t(vc,{source:o}),!n&&t(yc,{source:o}),t(Cc,{source:o}),t(Sc,{source:o})]})})},xc=({source:e})=>t(Et,{bgTint:"900",children:t(Wr,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}),Tc=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?co(e.workloadOdigosHealthStatus.status):ft.Unknown,title:Ft(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Ht,{...o,width:"100%"}):null},kc="calc(50% - 6px)",$c=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Gt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Ft(t):`${He.ROLLOUT} ${Ft(t)}`,subTitle:a,action:i!==Ee.Success?{icon:Ri,tooltip:He.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),s=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=Gt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Ft(t):`${He.ROLLBACK} ${Ft(t)}`,subTitle:n,action:a!==Ee.Success?{icon:Ri,tooltip:He.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||s?e(se,{$gap:12,$alignItems:"stretch",children:[l&&t(Ht,{invertColors:!0,slim:!0,width:s?kc:"100%",...l}),s&&t(Ht,{invertColors:!0,slim:!0,width:kc,...s})]}):null},Ec=p(null),Ic=m.div`
|
|
250
250
|
position: relative;
|
|
251
|
-
`,
|
|
251
|
+
`,Ac=({children:e})=>{const o=i(null);return t(Ic,{ref:o,children:t(Ec.Provider,{value:o,children:e})})},Nc=m.div`
|
|
252
252
|
position: fixed;
|
|
253
253
|
top: ${({$coords:e})=>e.top}px;
|
|
254
254
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -262,14 +262,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
262
262
|
padding: 12px 16px;
|
|
263
263
|
border-radius: 12px;
|
|
264
264
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
265
|
-
`,
|
|
265
|
+
`,Oc=m.div`
|
|
266
266
|
display: flex;
|
|
267
267
|
align-items: flex-end;
|
|
268
268
|
justify-content: space-between;
|
|
269
269
|
gap: 8px;
|
|
270
|
-
`,
|
|
270
|
+
`,Rc=m.div`
|
|
271
271
|
flex: 1;
|
|
272
|
-
`,
|
|
272
|
+
`,Dc=({width:o,onClose:n,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:r,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:m})=>{const b=f(),v=h(Ec),[y,C]=s(null);return uo(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Kl(e(Nc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(W,{$gap:4,children:[t(ae,{size:le.XXS,children:c}),t(ae,{size:le.XXXS,color:ie.Secondary,children:d})]}),e(Oc,{children:[t(Rc,{children:p}),e(se,{$gap:8,$width:"fit-content",$margin:`0 0 ${m||0} 0`,children:[t(re,{variant:de.Secondary,onClick:l,leftIcon:ri,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:ce.S,textColor:b.v2.colors.red[500]}),t(re,{variant:de.Primary,onClick:a,leftIcon:xi,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ce.S})]})]}),t("div",{children:t($e,{status:Ee.Warning,message:u})})]}),document.body):null},Pc=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:r}=y(),{formData:c,handleFormChange:d,resetFormData:u}=Nt(l),p=a(()=>{if(!o)return[];const e=po[o].community,t=r===bt.Onprem?po[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,g]=s(!1),[m,f]=s(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(se,{$gap:4,$alignItems:"center",children:[n?t(Be,{status:Ee.Info,invertColors:!0,label:He.OVERIDDEN}):null,e(Ac,{children:[t(De,{text:He.OVERRIDE_OTEL_DISTRO_NAME,children:t(st,{icon:mi,onClick:b})}),m&&t(Dc,{width:"500px",onClose:b,onSave:async()=>{g(!0),await i(c),g(!1),b()},saveTooltip:He.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await i({otelDistroName:null}),g(!1),b()},deleteTooltip:He.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:He.OVERRIDE_OTEL_DISTRO_NAME,subTitle:He.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:He.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(lt,{label:He.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Fc=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:r}=Lt(),{formData:c,handleFormChange:d,resetFormData:u}=Nt(i),p=a(()=>ho.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,g]=s(!1),[m,f]=s(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(se,{children:[o?t(Be,{status:Ee.Info,invertColors:!0,label:He.OVERIDDEN}):null,e(Ac,{children:[t(De,{text:He.OVERRIDE_RUNTIME_DETAILS,children:t(st,{icon:mi,onClick:b})}),m&&t(Dc,{width:"500px",onClose:b,onSave:async()=>{!c.version||go(c.version)?(g(!0),await n(c),g(!1),b()):r({type:Ee.Warning,message:_t.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:He.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await n({language:null,version:""}),g(!1),b()},deleteTooltip:He.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:He.OVERRIDE_RUNTIME_DETAILS,subTitle:He.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:He.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(se,{$gap:8,children:[t(lt,{label:He.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(be,{label:He.RUNTIME_VERSION,placeholder:He.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Lc=({source:e})=>{const{isVm:o}=y(),{containers:n,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?He.DETECTED_PROCESSES:`${e.id.kind} ${He.CONTAINERS}`,tooltip:t?.message||(o?He.DETECTED_PROCESSES_DESCRIPTION:He.DETECTED_CONTAINERS_DESCRIPTION),badge:Gt(t?.status)===Kt.Loading?{status:Kt.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(Et,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(W,{$gap:8,children:n.map(o=>o&&t(Bc,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},_c=m.div`
|
|
273
273
|
display: flex;
|
|
274
274
|
flex-direction: column;
|
|
275
275
|
align-self: stretch;
|
|
@@ -277,28 +277,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
277
277
|
padding: 8px 12px;
|
|
278
278
|
border-radius: 8px;
|
|
279
279
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
280
|
-
`,
|
|
280
|
+
`,zc=m.div`
|
|
281
281
|
display: flex;
|
|
282
282
|
align-items: center;
|
|
283
283
|
justify-content: center;
|
|
284
284
|
padding: 8px;
|
|
285
285
|
border-radius: 10px;
|
|
286
286
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
287
|
-
`,
|
|
287
|
+
`,Mc=m.div`
|
|
288
288
|
display: flex;
|
|
289
289
|
flex-direction: column;
|
|
290
290
|
gap: 12px;
|
|
291
291
|
padding: 8px 12px;
|
|
292
292
|
border-radius: 8px;
|
|
293
293
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
294
|
-
`,Wc=({sourceId:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=f(),{sourcesApi:d}=rl(),u=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),p=a(()=>({language:Wt(n),version:mo(n)||void 0}),[n]),h=a(()=>!!s?.otelDistroName,[s]),g=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),m=a(()=>!l&&!u,[l,u]),b=a(()=>m?Fi:Ve(p.language),[m,p]),v=a(()=>{if(m)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[m,p]),y=a(()=>m?{status:Kt.Loading,label:Ge.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Ie.Success:Kt.Disabled,leftIcon:r?.otelDistroName?ui:pi,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[m,r]),C=e=>d.update(o,{containerName:i,...h?g:{},...u?p:{},...e}),S=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Ge.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Ge.TAIL_SAMPLING),e},[n]);return e(Gc,{children:[e(re,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(re,{$gap:8,$alignItems:"center",children:[t(Hc,{children:t(b,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ae,{children:i}),t(zt,v?{variant:Yt.Blue,label:v}:{variant:Yt.Loader,label:Ge.DETECTING_RUNTIME_INFO}),t(Vc,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(re,{$gap:8,$alignItems:"center",children:[t(Be,{...y,textSize:le.XXXS}),t(Xc,{language:p.language,overridden:h,onOverride:C,defaultValues:g})]})]}),!r||r.agentEnabled||m?null:t(jc,{children:e(re,{$gap:10,$alignItems:"center",children:[t(zt,{variant:Yt.Pink,label:Pt(r.agentEnabledStatus?.reasonEnum)||Ge.NO_AVAILABLE_AGENT}),t(ae,{size:le.XXXS,color:ie.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(jc,{children:t(re,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(Be,{label:e,leftIcon:ui,status:Ie.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${o}`))})})]})},Kc=({source:o,onClickRollout:n,onClickRollback:a})=>{const{isVm:i}=y();return e(W,{$gap:12,children:[t(Ac,{source:o}),t(Oc,{source:o}),!i&&t(Dc,{source:o,onClickRollout:n,onClickRollback:a}),!i&&t(Uc,{source:o}),!i&&t(Nc,{source:o})]})};function Yc(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 Jc(e){const t=Math.abs(e);return t>=1e9?`${qc(e/1e9)}s`:t>=1e6?`${qc(e/1e6)}ms`:t>=1e3?`${qc(e/1e3)}μs`:String(Math.round(e))}function qc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Zc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function Qc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function ed(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function td(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1}=i,c=Zc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(r&&(d=d.filter(t=>r(Yc(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Yc(e,l.nameIndex)===Yc(e,t.nameIndex)&&a.add(Qc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(Qc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Qc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const g=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,m=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/g,m)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,r=Math.max(f-v,1),s=Yc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:r,name:s,matchesSearch:ed(s,b)}})}function od(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var nd,ad;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(nd||(nd={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(ad||(ad={}));function id(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ld(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 rd(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const sd=({flamebearer:o,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const m=f(),b=i(null),v=i(null),y=i({x:0,y:0}),C=i(o.numTicks),[S,w]=r({w:0,h:0}),[T,x]=r(""),[k,E]=r(null),[I,$]=r([]),[A,N]=r(!1),[O,R]=r(nd.Fit),[D,F]=r(ad.Fit),[P,_]=r(!1),L=Math.max(1,Math.min(Math.floor(S.w*O),8192)),z=Math.max(1,Math.min(Math.floor(S.h*D),8192)),M=I.length>0?I[I.length-1]:null,B=M?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,$([]))},[o.numTicks]),g(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),n(()=>(p?.(A),()=>{A&&p?.(!1)}),[A,p]);const X=a(()=>td(o,L,z,s,c,{zoomRoot:M,shouldKeepName:d,collapseRecursive:P}),[o,s,c,z,L,M,d,P]),V=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?c.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,c]),U=l(e=>{if(L<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=ld((e.clientX-t.left)/t.width*L,(e.clientY-t.top)/t.height*z,V);if(n){const e=Qc(n);E(e);const t=B>0?(100*n.size/B).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";x(`${n.name}\ntotal ${Jc(n.size)} (${t}% of view, ${a}% of profile) · self ${Jc(n.self)}`)}else E(null),x("")},[V,o.numTicks,z,L,B]),G=l(e=>{U(e)},[U]),H=l(()=>{E(null),x("")},[]),j=l(e=>{y.current={x:e.clientX,y:e.clientY}},[]),W=l(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(L<2||z<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=ld((e.clientX-n.left)/n.width*L,(e.clientY-n.top)/n.height*z,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,z,L]);g(()=>{const e=v.current;if(!e||L<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(L,z),a=Math.min(t,16384/n);e.width=Math.floor(L*a),e.height=Math.floor(z*a),e.style.width=`${L}px`,e.style.height=`${z}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,L,z),X?.length?function(e,t,o,n,a,i,l,r){const s=i.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=od(s,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=id(d,r),m=`${s} (${Jc(d)}, ${g}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(Qc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,L,z,X,c,m,k,o.numTicks):(i.fillStyle=m.v2.colors.silver[900],i.fillRect(0,0,L,z)))},[X,o.numTicks,k,c,z,L,m]);const K=l(()=>N(e=>!e),[]),Y=o.numTicks>0?Math.max(0,Math.min(100,Math.round(B/o.numTicks*100))):100,J=a(()=>function(e,t){const o=Zc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let r=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!r||e.size>r.size||e.size===r.size&&e.level<r.level)&&(r=e);return r}(o,M),[o,M]),q=null!==J,Z=I.length>0,te=M?Yc(o,M.nameIndex):"",oe=l(()=>$([]),[]),ne=l(()=>$(e=>e.slice(0,-1)),[]),pe=l(()=>{J&&$(e=>[...e,J])},[J]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:m.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(re,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(Q,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:ee.Left,size:vt.S,value:P,onChange:_}),e(re,{$gap:8,children:[e(re,{children:[t(se,{variant:de.Secondary,size:ce.S,label:"Reset zoom",leftIcon:Mi,onClick:oe,disabled:!I.length}),t(se,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:Bi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!Z,onClick:ne}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,align:"center",children:`${Y}%`})}),t(se,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:ci,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!q,onClick:pe})]}),e(re,{children:[t(De,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:fo.Filled,options:[{value:nd.Fit,label:"W: Fit"},{value:nd.X10,label:"10x"}],selected:O,setSelected:R})}),t(De,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:fo.Filled,options:[{value:ad.Fit,label:"H: Fit"},{value:ad.X10,label:"10x"}],selected:D,setSelected:F})})]}),t(se,{variant:de.Secondary,size:ce.S,iconSize:24,leftIcon:A?xi:Xi,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:K})]})]}),t(De,{fullWidth:!0,keepAlive:!0,text:T,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:D>1?"auto":"hidden"},children:t("div",{style:{width:L||"100%",height:z||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:k?"pointer":"default"},onPointerDown:j,onPointerMove:G,onPointerLeave:H,onClick:W})})})}),e(re,{$justifyContent:"space-between",children:[t(ae,M?{size:le.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${te} • ${Jc(B)} samples in view`}:{size:le.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ae,{size:le.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${rd(h.totalBytesUsed)} / ${rd(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var cd,dd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(cd||(cd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(dd||(dd={}));const ud=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function pd(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(dd.FilterOutVoid)&&"void"===o)return!1;if(t.includes(dd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&ud.test(o)))return!1}return!0}const hd={options:[{id:dd.FilterOutVoid,label:"Filter out void symbols"},{id:dd.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>pd(e.cells.find(e=>e.key===cd.Symbol)?.rawValue?.toString()??"",t)},gd=({rows:e,languages:o,filters:n,onFiltersChange:i})=>{const l=a(()=>[{key:cd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(bo.Java)?hd:void 0,noFilter:!o?.includes(bo.Java)},{key:cd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:cd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),r=a(()=>e.map(e=>({cells:[{key:cd.Symbol,rawValue:e.name},{key:cd.Self,rawValue:Jc(e.self)},{key:cd.Total,rawValue:Jc(e.total)}]})),[e]);return t(vo,{variant:yo.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:n,onFiltersChange:i,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Vi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var md;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(md||(md={}));const fd=m(W)`
|
|
294
|
+
`,Bc=({sourceId:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:s,overrides:r}=n,c=f(),{sourcesApi:d}=sl(),u=a(()=>!!r?.runtimeInfo?.language||!!r?.runtimeInfo?.runtimeVersion,[r]),p=a(()=>({language:Wt(n),version:mo(n)||void 0}),[n]),h=a(()=>!!r?.otelDistroName,[r]),g=a(()=>({otelDistroName:r?.otelDistroName||n.agentEnabled?.otelDistroName}),[r,n]),m=a(()=>!l&&!u,[l,u]),b=a(()=>m?Pi:Ve(p.language),[m,p]),v=a(()=>{if(m)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[m,p]),y=a(()=>m?{status:Kt.Loading,label:He.WAITING_FOR_RUNTIME_DETECTION}:{status:s?.otelDistroName?Ee.Success:Kt.Disabled,leftIcon:s?.otelDistroName?ui:pi,label:s?.otelDistroName?`Instrumented | ${s.otelDistroName}`:"Uninstrumented",tooltip:s?.agentEnabledStatus?.message},[m,s]),C=e=>d.update(o,{containerName:i,...h?g:{},...u?p:{},...e}),S=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(He.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(He.TAIL_SAMPLING),e},[n]);return e(_c,{children:[e(se,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(se,{$gap:8,$alignItems:"center",children:[t(zc,{children:t(b,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ae,{children:i}),t(zt,v?{variant:Yt.Blue,label:v}:{variant:Yt.Loader,label:He.DETECTING_RUNTIME_INFO}),t(Fc,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(se,{$gap:8,$alignItems:"center",children:[t(Be,{...y,textSize:le.XXXS}),t(Pc,{language:p.language,overridden:h,onOverride:C,defaultValues:g})]})]}),!s||s.agentEnabled||m?null:t(Mc,{children:e(se,{$gap:10,$alignItems:"center",children:[t(zt,{variant:Yt.Pink,label:Ft(s.agentEnabledStatus?.reasonEnum)||He.NO_AVAILABLE_AGENT}),t(ae,{size:le.XXXS,color:ie.Secondary,children:s?.agentEnabledStatus?.message})]})}),S.length>0&&t(Mc,{children:t(se,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(Be,{label:e,leftIcon:ui,status:Ee.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${o}`))})})]})},Xc=({source:o,onClickRollout:n,onClickRollback:a})=>{const{isVm:i}=y();return e(W,{$gap:12,children:[t(wc,{source:o}),t(Tc,{source:o}),!i&&t($c,{source:o,onClickRollout:n,onClickRollback:a}),!i&&t(Lc,{source:o}),!i&&t(xc,{source:o})]})};function Vc(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 Uc(e){const t=Math.abs(e);return t>=1e9?`${Hc(e/1e9)}s`:t>=1e6?`${Hc(e/1e6)}ms`:t>=1e3?`${Hc(e/1e3)}μs`:String(Math.round(e))}function Hc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Gc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],s=n[e+2],r=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function jc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Wc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Kc(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1}=i,c=Gc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(s&&(d=d.filter(t=>s(Vc(e,t.nameIndex))),0===d.length))return null;if(r&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Vc(e,l.nameIndex)===Vc(e,t.nameIndex)&&a.add(jc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(jc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(jc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const g=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,m=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/g,m)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,s=Math.max(f-v,1),r=Vc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:s,name:r,matchesSearch:Wc(r,b)}})}function Yc(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var Jc,qc;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Jc||(Jc={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(qc||(qc={}));function Zc(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Qc(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 ed(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const td=({flamebearer:o,maxRowPx:r,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const m=f(),b=i(null),v=i(null),y=i({x:0,y:0}),C=i(o.numTicks),[S,w]=s({w:0,h:0}),[x,T]=s(""),[k,$]=s(null),[E,I]=s([]),[A,N]=s(!1),[O,R]=s(Jc.Fit),[D,P]=s(qc.Fit),[F,L]=s(!1),_=Math.max(1,Math.min(Math.floor(S.w*O),8192)),z=Math.max(1,Math.min(Math.floor(S.h*D),8192)),M=E.length>0?E[E.length-1]:null,B=M?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,I([]))},[o.numTicks]),g(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),n(()=>(p?.(A),()=>{A&&p?.(!1)}),[A,p]);const X=a(()=>Kc(o,_,z,r,c,{zoomRoot:M,shouldKeepName:d,collapseRecursive:F}),[o,r,c,z,_,M,d,F]),V=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?c.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,c]),U=l(e=>{if(_<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Qc((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*z,V);if(n){const e=jc(n);$(e);const t=B>0?(100*n.size/B).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";T(`${n.name}\ntotal ${Uc(n.size)} (${t}% of view, ${a}% of profile) · self ${Uc(n.self)}`)}else $(null),T("")},[V,o.numTicks,z,_,B]),H=l(e=>{U(e)},[U]),G=l(()=>{$(null),T("")},[]),j=l(e=>{y.current={x:e.clientX,y:e.clientY}},[]),W=l(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||z<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=Qc((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*z,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);I(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,z,_]);g(()=>{const e=v.current;if(!e||_<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,z),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(z*a),e.style.width=`${_}px`,e.style.height=`${z}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,_,z),X?.length?function(e,t,o,n,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Yc(r,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=Zc(d,s),m=`${r} (${Uc(d)}, ${g}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(jc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,_,z,X,c,m,k,o.numTicks):(i.fillStyle=m.v2.colors.silver[900],i.fillRect(0,0,_,z)))},[X,o.numTicks,k,c,z,_,m]);const K=l(()=>N(e=>!e),[]),Y=o.numTicks>0?Math.max(0,Math.min(100,Math.round(B/o.numTicks*100))):100,J=a(()=>function(e,t){const o=Gc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let s=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(o,M),[o,M]),q=null!==J,Z=E.length>0,te=M?Vc(o,M.nameIndex):"",oe=l(()=>I([]),[]),ne=l(()=>I(e=>e.slice(0,-1)),[]),pe=l(()=>{J&&I(e=>[...e,J])},[J]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:m.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(se,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(Q,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:ee.Left,size:vt.S,value:F,onChange:L}),e(se,{$gap:8,children:[e(se,{children:[t(re,{variant:de.Secondary,size:ce.S,label:"Reset zoom",leftIcon:Mi,onClick:oe,disabled:!E.length}),t(re,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:Bi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!Z,onClick:ne}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,align:"center",children:`${Y}%`})}),t(re,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:ci,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!q,onClick:pe})]}),e(se,{children:[t(De,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:fo.Filled,options:[{value:Jc.Fit,label:"W: Fit"},{value:Jc.X10,label:"10x"}],selected:O,setSelected:R})}),t(De,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:fo.Filled,options:[{value:qc.Fit,label:"H: Fit"},{value:qc.X10,label:"10x"}],selected:D,setSelected:P})})]}),t(re,{variant:de.Secondary,size:ce.S,iconSize:24,leftIcon:A?Ti:Xi,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:K})]})]}),t(De,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:D>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:z||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:k?"pointer":"default"},onPointerDown:j,onPointerMove:H,onPointerLeave:G,onClick:W})})})}),e(se,{$justifyContent:"space-between",children:[t(ae,M?{size:le.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${te} • ${Uc(B)} samples in view`}:{size:le.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ae,{size:le.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ed(h.totalBytesUsed)} / ${ed(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var od,nd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(od||(od={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(nd||(nd={}));const ad=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function id(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(nd.FilterOutVoid)&&"void"===o)return!1;if(t.includes(nd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&ad.test(o)))return!1}return!0}const ld={options:[{id:nd.FilterOutVoid,label:"Filter out void symbols"},{id:nd.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>id(e.cells.find(e=>e.key===od.Symbol)?.rawValue?.toString()??"",t)},sd=({rows:e,languages:o,filters:n,onFiltersChange:i})=>{const l=a(()=>[{key:od.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(bo.Java)?ld:void 0,noFilter:!o?.includes(bo.Java)},{key:od.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:od.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),s=a(()=>e.map(e=>({cells:[{key:od.Symbol,rawValue:e.name},{key:od.Self,rawValue:Uc(e.self)},{key:od.Total,rawValue:Uc(e.total)}]})),[e]);return t(vo,{variant:yo.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:s,filters:n,onFiltersChange:i,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Vi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var rd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(rd||(rd={}));const cd=m(W)`
|
|
295
295
|
width: 100%;
|
|
296
296
|
flex: 1;
|
|
297
297
|
border-radius: 16px;
|
|
298
298
|
overflow: hidden;
|
|
299
299
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
300
300
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
301
|
-
`,
|
|
301
|
+
`,dd=m.div`
|
|
302
302
|
display: flex;
|
|
303
303
|
align-items: center;
|
|
304
304
|
gap: 10px;
|
|
@@ -306,11 +306,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
306
306
|
padding: 12px 12px 8px;
|
|
307
307
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
308
308
|
border-radius: 16px 16px 0 0;
|
|
309
|
-
`,
|
|
309
|
+
`,ud=m(se)`
|
|
310
310
|
flex-shrink: 0;
|
|
311
311
|
align-items: center;
|
|
312
312
|
gap: 4px;
|
|
313
|
-
`,
|
|
313
|
+
`,pd=m.div`
|
|
314
314
|
flex: 1;
|
|
315
315
|
display: flex;
|
|
316
316
|
align-items: stretch;
|
|
@@ -318,20 +318,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
318
318
|
padding: 16px;
|
|
319
319
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
320
320
|
border-radius: 0 0 16px 16px;
|
|
321
|
-
`,
|
|
321
|
+
`,hd=m(W)`
|
|
322
322
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
323
323
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
324
324
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
325
325
|
gap: 10px;
|
|
326
|
-
`,
|
|
326
|
+
`,gd=m(W)`
|
|
327
327
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
328
328
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
329
329
|
gap: 10px;
|
|
330
|
-
`,
|
|
330
|
+
`,md=m(se)`
|
|
331
331
|
width: 100%;
|
|
332
332
|
min-height: 32px;
|
|
333
333
|
flex-shrink: 0;
|
|
334
|
-
`,
|
|
334
|
+
`,fd=({source:o,onFlameFullscreenChange:l})=>{const c=f(),d=o.id,{profilingApi:u}=sl(),[p,h]=s(!0),[g,m]=s(rd.Both),[b,v]=s(""),[y,C]=s({}),[S,w]=s(!1),x=i(!1);n(()=>{x.current||(x.current=!0,u.enableProfiling?.(d),w(!0))},[u,d]);const{data:T}=u.useSlots({skip:!S,pollInterval:3e3,fetchPolicy:"network-only"}),[k,$]=s(0),{data:E,refetch:I}=u.useSourceProfiling(d,{skip:!S||!p,pollInterval:3e3,fetchPolicy:"network-only",onCompleted:()=>$(e=>e+1)}),A=E?.profileJson??null,N=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(A),[A]),O=a(()=>N?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=Vc(e,n[o+3]);if(!l)continue;const s=t.get(l);(!s||a>s.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(N.flamebearer):[],[N]),R=a(()=>{const e=b.trim().toLowerCase();return e?O.filter(t=>t.name.toLowerCase().includes(e)):O},[O,b]),D=g===rd.Table||g===rd.Both,P=g===rd.Flame||g===rd.Both,F=D&&P,L=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),_=a(()=>function(e,t){if(!t?.includes(bo.Java))return;const o=e?.[od.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>id(e,o):void 0}(y,L),[y,L]);return!A&&k<2?t(at,{$height:"70vh",children:t(ct,{withSpinner:!0})}):e(cd,{$gap:0,$width:"100%",children:[e(dd,{children:[t(De,{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(ud,{children:t(ae,{size:le.S,weight:500,color:ie.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(se,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Zt,{value:b,onChange:v,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:c.v2.colors.silver[900],emphasizeBackgroundColor:c.v2.colors.silver[800]})}),t(ue,{variant:fo.Filled,options:[{value:rd.Table,label:"Top table"},{value:rd.Flame,label:"Flame graph"},{value:rd.Both,label:"Both"}],selected:g,setSelected:m}),t(re,p?{variant:de.Secondary,size:ce.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(Ui,{...e,size:8,fill:c.v2.colors.green[500]})}:{variant:de.Secondary,size:ce.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Ui,{...e,size:8,fill:c.v2.colors.red[500]})})]})]}),t(pd,{$gap:D&&P?16:0,children:N?e(r,{children:[D&&e(hd,{$splitWithFlame:F,children:[t(md,{$justifyContent:"flex-end",children:t(re,{variant:de.Secondary,size:ce.S,label:"Download snapshot",rightIcon:Hi,onClick:()=>{if(!A)return;const e=new Blob([A],{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:!A})}),t(sd,{rows:R,languages:L,filters:y,onFiltersChange:C})]}),P&&e(gd,{$splitWithTable:F,children:[e(md,{$justifyContent:"space-between",children:[t(Be,{label:N?`Total in view ${Uc(N.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:c.v2.colors.silver[750],textColor:c.v2.colors.silver[200],textSize:le.XXS}),e(se,{$gap:12,children:[!p&&t(re,{variant:de.Secondary,size:ce.S,label:"Refresh",leftIcon:Ri,onClick:I}),t(Q,{label:"Auto refresh",labelAlign:ee.Left,size:vt.S,value:p,onChange:h})]})]}),t(td,{flamebearer:N.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:_,minHostHeight:280,onFullscreenChange:l,profilingSlots:T??null},g)]})]}):t(at,{children:t(Ce,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},bd=m.div`
|
|
335
335
|
position: relative;
|
|
336
336
|
display: flex;
|
|
337
337
|
align-items: center;
|
|
@@ -339,17 +339,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
339
339
|
padding: 8px 16px;
|
|
340
340
|
border-radius: 12px;
|
|
341
341
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
342
|
-
`,
|
|
342
|
+
`,vd=m.div`
|
|
343
343
|
display: flex;
|
|
344
344
|
flex-direction: column;
|
|
345
345
|
gap: 4px;
|
|
346
346
|
flex: 1;
|
|
347
347
|
min-width: 0;
|
|
348
|
-
`,
|
|
348
|
+
`,yd=m.div`
|
|
349
349
|
min-width: 0;
|
|
350
350
|
white-space: pre;
|
|
351
351
|
overflow-x: auto;
|
|
352
|
-
`,
|
|
352
|
+
`,Cd=m.div`
|
|
353
353
|
position: absolute;
|
|
354
354
|
top: 50%;
|
|
355
355
|
right: 8px;
|
|
@@ -358,11 +358,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
358
358
|
pointer-events: none;
|
|
359
359
|
transition: opacity 0.15s ease;
|
|
360
360
|
|
|
361
|
-
${
|
|
361
|
+
${bd}:hover & {
|
|
362
362
|
opacity: 1;
|
|
363
363
|
pointer-events: auto;
|
|
364
364
|
}
|
|
365
|
-
|
|
365
|
+
`,Sd=({name:o,summary:n,onJumpToRule:a})=>e(bd,{children:[e(vd,{children:[o&&t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:o}),t(yd,{children:t(S,{parts:n})})]}),a&&t(Cd,{children:t(De,{text:He.OPEN_IN_SAMPLING_PAGE,children:t(re,{"data-id":"sampling-rule-jump",variant:de.Primary,size:ce.S,leftIcon:Xi,onClick:a})})})]}),wd=({source:e,onRedirectToSampling:o})=>t(Et,{bgTint:"1000",richTitle:{title:He.SAMPLING},children:e.containers?.map(e=>t(kd,{container:e,onRedirectToSampling:o},e.containerName))});var xd;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(xd||(xd={}));const Td=e=>"noisy"===e.type?w(e.rule):"highlyRelevant"===e.type?x(e.rule):"costReduction"===e.type?T(e.rule):[],kd=({container:o,onRedirectToSampling:n})=>{const[i,l]=s(xd.All),r=eo(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]),u=a(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===xd.Noisy?d:i===xd.HighlyRelevant?u:i===xd.CostReduction?p:[...d,...u,...p],[i,u,p]),g=a(()=>(e,t)=>{r({ruleId:e,category:t}),n()},[n,r]);return e(Et,{bgTint:"900",richTitle:{title:o.containerName},withCollapse:!0,collapseIsDefaultOpen:!0,children:[e(Et,{bgTint:"800",richTitle:{title:He.HEAD_SAMPLING,badge:{label:c.length}},withCollapse:!0,collapseIsDefaultOpen:!!c.length,children:[t(ae,{size:le.XXS,children:He.NOISY_OPERATIONS}),t(W,{$gap:4,children:c.length?c.map(e=>t(Sd,{name:e.name,summary:w(e),onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId)):t(Ce,{title:"No noisy operations"})})]}),e(Et,{bgTint:"800",richTitle:{title:He.TAIL_SAMPLING,badge:{label:d.length+u.length+p.length}},withCollapse:!0,collapseIsDefaultOpen:!!h.length,children:[t(ue,{options:(m=d.length,f=u.length,b=p.length,[{value:xd.All,label:"All",badge:{label:m+f+b,textSize:le.XXXS}},{value:xd.Noisy,label:He.NOISY_OPERATIONS,badge:{label:m,textSize:le.XXXS}},{value:xd.HighlyRelevant,label:He.HIGHLY_RELEVANT_OPERATIONS,badge:{label:f,textSize:le.XXXS}},{value:xd.CostReduction,label:He.COST_REDUCTION_OPERATIONS,badge:{label:b,textSize:le.XXXS}}]),selected:i,setSelected:l}),t(W,{$gap:4,children:h.length?h.map(e=>t(Sd,{name:e.rule.name,summary:Td(e),onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Ce,{title:`No ${i===xd.All?`${xd.Noisy}, ${xd.HighlyRelevant} and ${xd.CostReduction}`:i} operations`})})]})]});var m,f,b},$d=[io.Deployment,io.StatefulSet,io.DaemonSet,io.DeploymentConfig,io.Rollout,io.Pod];var Ed;!function(e){e.Workload="Workload",e.Pod="Pod"}(Ed||(Ed={}));const Id=e=>!!e&&Gt(e.status)===Ee.Error,Ad=e=>Id(e.healthStatus),Nd=e=>Id(e.odigosHealthStatus)||(e.processes??[]).some(Ad),Od=e=>Id(e.agentInjectedStatus)||Id(e.odigosHealthStatus)||(e.containers??[]).some(Nd),Rd=({onClose:o,sourceId:r,onRedirectToSampling:c})=>{const d=f(),{isVm:u}=y(),{sourcesApi:p,configApi:h}=sl(),{selectedStreamName:g}=Ge(),{genericForm:m,loadSource:b,validateFormData:v}=Dl(),{data:C}=h.useEffectiveConfig(),[S,w]=s(!1),[x,T]=s(!1),[k,$]=s(!1),[E,I]=s(Hr.Overview),[A,N]=s(null),[O,R]=s({openFor:null}),D=(()=>{const[e,t]=s(null),o=l(e=>{t({tab:Hr.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:Hr.Pods,podName:e.podName,containerName:o.containerName})},[]),i=l((e,o,n)=>{const a=Jr({identifyingAttributes:n.identifyingAttributes});t({tab:Hr.Pods,podName:e.podName,containerName:o.containerName,processPid:a})},[]),r=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:r}),[e,o,n,i,r])})();n(()=>{D.jumpToTarget&&I(D.jumpToTarget.tab)},[D.jumpToTarget]),n(()=>{A&&JSON.stringify(to(r))!==JSON.stringify(to(A))&&N(null)},[r,A]);const P=i(!1),F=l(async()=>N(await p.fetchById(r)||null),[r,p]);n(()=>{if(P.current||(F(),P.current=!0),!S){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,S]),n(()=>{A&&b(A)},[A]);const L=A&&$d.includes(A.id.kind),_=a(()=>{const e=[],o=(A?.pods??[]).some(Od);return e.push({value:Hr.Overview,label:He.OVERVIEW}),u||(e.push({value:Hr.Pods,label:He.PODS,icon:o?e=>t(Di,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:Hr.PeerSources,label:He.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:Hr.Profiling,label:He.PROFILING}),e.push({value:Hr.Sampling,label:He.SAMPLING}),e.push({value:Hr.Debug,label:He.DEBUG})),e},[u,C,A?.pods]),z=l(()=>w(!0),[]),M=a(()=>()=>{o(),c()},[o,c]),B=l(()=>{A&&b(A),w(!1)},[A]),X=l(async()=>{if(!A||!m)return;const{errorMessage:e,preparedFormData:t}=v();if(e)return;const o=t.otelServiceName!==A.id.name?t.otelServiceName:"";await p.update(r,{...t,otelServiceName:o}),w(!1)},[A,m,v,r,p]),V=l(()=>T(!0),[]),U=l(async()=>{A&&(await p.persistV2({[wt]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,selected:!1,currentStreamName:g}]}),T(!1),o())},[A,p,g,o]),H=l(()=>{R({openFor:Ed.Workload})},[]),G=l(e=>{I(e),D.clearJumpToTarget()},[D]),j=l(async()=>{await p.recoverFromRollback(r)},[p,r]),K=l(async()=>{O.openFor===Ed.Workload?await p.restartWorkloads([r]):O.openFor===Ed.Pod&&O.podNamespace&&O.podName&&await p.restartPod(O.podNamespace,O.podName),R({openFor:null})},[O,p,r]),Y=a(()=>{const e=[];return S||E===Hr.Overview&&(e.push({id:"edit-source-btn-edit",label:kt.EDIT,icon:mi,active:S,onClick:z}),!u&&L&&e.push({id:"edit-source-btn-restart",label:kt.RESTART,icon:Gi,onClick:H}),e.push({id:"edit-source-btn-delete",label:kt.DELETE,icon:ri,color:d.v2.colors.red[500],active:x,onClick:V})),e},[E,S,x,u,L,z,H,V,d]),J=a(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:le.S};return e.push({...t,label:A.id.name,leftIcon:u?void 0:Oi}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:Ni,textColor:d.v2.colors.silver[200]}),e},[A,d,u]);if(!A)return t(oe,{isOpen:!0,children:t(at,{$height:"80vh",children:t(ct,{withSpinner:!0})})});const q=E===Hr.Profiling?k?"95vw":"80vw":S?void 0:"60vw";return e(ic,{value:D,children:[t(oe,{isOpen:!0,width:q,minWidth:"777px",header:{icon:u?ji:Co(A.containers)[0],titleBadges:J,onClose:()=>{G(Hr.Overview),N(null),$(!1),o()},actions:Y},footer:{actions:S?[{"data-id":"edit-source-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:kt.SAVE,variant:de.Primary,onClick:X}]:[]},children:t($t,{$padding:"4px 12px 12px",children:e(W,{$gap:16,children:[!S&&_.length>1&&t(ue,{options:_,selected:E,setSelected:G}),(()=>{switch(E){case Hr.Overview:return S?t(js,{}):t(Xc,{source:A,onClickRollout:H,onClickRollback:j});case Hr.Pods:return t(dc,{source:A,onClickRestartPod:L?(e,t)=>R({openFor:Ed.Pod,podNamespace:e,podName:t}):void 0});case Hr.PeerSources:return t(uc,{source:A});case Hr.Profiling:return t(fd,{source:A,onFlameFullscreenChange:$});case Hr.Sampling:return t(wd,{source:A,onRedirectToSampling:M});case Hr.Debug:return t(fc,{source:A});default:return null}})()]})})}),t(wl,{target:"source",action:"uninstrument",isOpen:x,onClose:()=>T(!1),onApprove:U}),t(wl,{target:`${O.openFor?.toLowerCase()??""}`,action:"restart",description:He.RESTART_POD_DESCRIPTION,isOpen:!!O.openFor,onClose:()=>R({openFor:null}),onApprove:K,overrideApproveButtonLabel:He.DELETE_POD_TO_RESTART})]})},Dd=m.div`
|
|
366
366
|
display: flex;
|
|
367
367
|
align-items: center;
|
|
368
368
|
gap: 8px;
|
|
@@ -372,9 +372,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
372
372
|
&:hover {
|
|
373
373
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
374
374
|
}
|
|
375
|
-
`,
|
|
375
|
+
`,Pd=m.div`
|
|
376
376
|
flex: 1;
|
|
377
|
-
`,
|
|
377
|
+
`,Fd=({onClick:o})=>{const n=f().v2.colors.red[500];return e(Dd,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(ae,{size:le.XS,weight:500,color:n,children:To}),t(ri,{size:16,fill:n})]})};function Ld(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:s}=n;return{children:e(o,{children:[t(Fd,{onClick:l}),s&&t($e,{status:Ee.Warning,message:s.message,action:s.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:s.onViewRule}:void 0}),t(Pd,{}),t(re,{"data-id":"sampling-view-edit-btn-cancel",label:So,variant:de.Secondary,size:ce.S,onClick:a}),t(re,{"data-id":"sampling-view-edit-btn-save",label:wo,variant:de.Primary,size:ce.S,onClick:i,disabled:!!s})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(Fd,{onClick:a}),t(Pd,{}),t(re,{"data-id":"sampling-view-btn-cancel",label:So,variant:de.Secondary,size:ce.S,onClick:i}),t(re,{"data-id":"sampling-view-btn-edit",label:xo,variant:de.Primary,size:ce.S,onClick:l})]})}}const _d={[Fl.EditAutoNoisy]:{title:Fo,subTitle:Po,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Fl.EditAutoCostReduction]:{title:Do,subTitle:Ro,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Fl.EditAutoHighlyRelevant]:{title:Oo,subTitle:No,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},zd=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(oe,{isOpen:e,width:_o,header:{icon:Wi,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t($t,{$padding:"12px",children:t(Zs,{})})}),Md=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:s})=>{const{category:r,formData:c,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=Pl(Fl.Create);n(()=>{e&&d()},[e]);const h=l(()=>{if(i){const e=i(c);if(e)return void p(e)}a(c)},[c,a,i,p]),g={note:u?{status:Ee.Warning,message:u.message,action:s?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>s(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:So,variant:de.Secondary,size:ce.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:Io,variant:de.Primary,size:ce.S,onClick:h,disabled:!!u}]};return t(zd,{isOpen:e,title:Ao[r],subTitle:ko[r],onClose:o,footer:g})},Bd=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:i,onNavigateToDuplicate:s})=>{const{data:r,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:g}=Pl(Fl.View),m=r?.rule.name||Eo,f=c&&r?$o[r.category]:`${m} preview`,b=l(()=>{if(r&&c){if(i){const e=i(d);if(e)return void g(e)}n(d,r.rule.ruleId,r.samplingId)}},[r,c,d,n,i,g]),v=l(()=>{r&&o(r.rule.ruleId,r.samplingId)},[r,o]),y=a(()=>{if(!r)return;const t=h?{message:h.message,onViewRule:s?()=>s(h.ruleId):void 0}:null;return Ld(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[r,c,h,p,b,v,u,e,s]);return t(zd,{isOpen:!!r,title:f,subTitle:r?ko[r.category]:"",onClose:e,footer:y})},Xd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Pl(Fl.EditAutoNoisy),s=l(()=>n(a,i),[n,a,i]);return t(Hd,{formType:Fl.EditAutoNoisy,isOpen:e,onClose:o,onSave:s})},Vd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Pl(Fl.EditAutoCostReduction),s=l(()=>n(a,i),[n,a,i]);return t(Hd,{formType:Fl.EditAutoCostReduction,isOpen:e,onClose:o,onSave:s})},Ud=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=Pl(Fl.EditAutoHighlyRelevant),i=l(()=>n(a),[n,a]);return t(Hd,{formType:Fl.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},Hd=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=_d[e];return t(zd,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:So,variant:de.Secondary,size:ce.S,onClick:n},{"data-id":i.saveId,label:Lo,variant:de.Primary,size:ce.S,onClick:a}]}})},Gd=e=>{switch(e.formType){case Fl.Create:return t(Xl,{formType:Fl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Md,{...e})});case Fl.View:return t(Xl,{formType:Fl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Bd,{...e})});case Fl.EditAutoNoisy:return t(Xl,{formType:Fl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Xd,{...e})});case Fl.EditAutoCostReduction:return t(Xl,{formType:Fl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Vd,{...e})});case Fl.EditAutoHighlyRelevant:return t(Xl,{formType:Fl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Ud,{...e})})}},jd=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:s,onSave:r,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=ro(),g=!i||a||!c.newToken;return zo({key:"Enter",active:!g},r),e(se,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(be,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(se,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(ct,{title:"Saving...",withGradient:!0}):e(o,{children:[t(re,{variant:de.Secondary,size:ce.S,leftIcon:Ti,onClick:s,disabled:a}),t(re,{variant:de.Primary,size:ce.S,leftIcon:xi,onClick:r,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ae,{size:le.XS,children:new Array(55).fill("•").join("")}),e(se,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(st,{icon:mi,onClick:l})]})]})},Wd=({expiresAt:e,callbackValid:o,callbackExpired:i})=>{const{formatTimeAgo:l}=Bt(),s=a(()=>l(e),[e,l]),r=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Mo(e,0)?Ee.Error:Mo(e,2592e6)?Ee.Warning:Ee.Success,[e]),d=a(()=>c===Ee.Success?xi:c===Ee.Warning?Ki:Di,[c]);return n(()=>{c===Ee.Success?o():c===Ee.Error&&i()},[c]),t(De,{text:r,children:t(Be,{leftIcon:d,label:s,status:c,invertColors:!0,useSecondaryTone:!0})})},Kd=m.div`
|
|
378
378
|
display: flex;
|
|
379
379
|
flex-direction: column;
|
|
380
380
|
gap: 12px;
|
|
@@ -382,7 +382,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
382
382
|
border-radius: 12px;
|
|
383
383
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
384
384
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
385
|
-
`,
|
|
385
|
+
`,Yd=({children:e})=>{const o=f();return t(ae,{size:le.XXXS,color:o.v2.colors.grey[150],children:e})},Jd=({token:o})=>{const{tokensApi:n}=sl(),[a,i]=s(!1),[l,r]=s(!1),[c,d]=s(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:g,resetFormData:m}=Nt({newToken:""});return t(et,{richTitle:{icon:Yi,title:"Odigos Pro Token"},children:e(Kd,{$isExpired:c,children:[e(se,{$justifyContent:"space-between",children:[e(W,{$gap:4,children:[t(Yd,{children:"Issued for"}),t(ae,{size:le.XS,children:o.name||"N/A"})]}),e(W,{$gap:4,children:[t(Yd,{children:"Expiration"}),t(Wd,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(W,{})]}),t(se,{children:e(W,{children:[t(Yd,{children:"Token"}),t(jd,{token:o.token,newToken:u.newToken,isLoading:a,isEditing:l,onEdit:()=>r(!0),onCancel:()=>(r(!1),void p("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;i(!0);const e=await n.updateToken(u.newToken.trim());i(!1),e?.error?g("newToken",e.error):(r(!1),m())})(),formData:u,handleFormChange:p,handleErrorChange:g,formErrors:h})]})})]})})},qd=m.div`
|
|
386
386
|
display: flex;
|
|
387
387
|
flex-direction: column;
|
|
388
388
|
align-items: center;
|
|
@@ -391,23 +391,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
391
391
|
padding: 12px 24px;
|
|
392
392
|
border-radius: 8px;
|
|
393
393
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
394
|
-
`,lu=()=>{const{progress:o}=Ct(),{describeApi:n,namespacesApi:a}=rl({subscribe:au}),{items:i}=a,[l,s]=r(null),{formData:c,handleFormChange:d,resetFormData:u}=Nt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(et,{richTitle:{icon:Ji,title:"Diagnose"},children:l?e(iu,{children:[t(ct,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[Tt.DownloadingDiagnose]?.percentage,percentage:o[Tt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[Tt.DownloadingDiagnose]?.percentage,visualIcon:Gi,startedAt:l}),o[Tt.DownloadingDiagnose]?.list?.length&&t(W,{$width:"100%",children:o[Tt.DownloadingDiagnose].list.map(o=>e(re,{$gap:4,$alignItems:"center",children:[o.status===Ie.Success?t(Ti,{size:16}):o.status===Ie.Error?t(xi,{size:16}):t(ct,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ae,{size:le.XXXS,color:ie.Secondary,children:o.label})]},o.label))})]}):e(W,{$gap:24,children:[t(ae,{size:le.XXS,color:ie.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(W,{$gap:16,children:[e(re,{$gap:8,children:[t(Y,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include pprof profiles"})]}),e(re,{$gap:8,children:[t(Y,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include Prometheus metrics"})]}),e(re,{$gap:8,children:[t(Y,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Bo,{alignX:Vo.Left,alignY:Xo.Bottom,items:i.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:de.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Be,{label:c.sourceWorkloadNamespaces.length,status:Ie.Default}):void 0}}),t(re,{$justifyContent:"flex-end",children:t(se,{label:"Download Diagnose",rightIcon:Gi,variant:de.Primary,onClick:async()=>{n.downloadDiagnose&&(s(Date.now()),await n.downloadDiagnose(c),s(null),u())},disabled:null!==l})})]})})},ru=()=>{const{platformType:e,version:o,tier:a}=y(),{describeApi:i}=rl(),[l,s]=r(null);return n(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(et,{richTitle:{icon:zi,title:"General Information"},children:t(It,{cellsPerRow:2,items:[{id:Uo(),title:"Odigos Version",label:o},{id:Uo(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Uo(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Uo(),title:"Tier",label:a}]})})},su=({isOpen:o,onClose:n})=>{const{describeApi:a,tokensApi:i}=rl(),{data:l}=sl("GET_TOKENS"),r=l?.[0];return e(oe,{isOpen:o,header:{icon:zi,title:"System Overview",onClose:n},children:[a.fetchDescribeOdigos&&t(ru,{}),i.updateToken&&r&&t(nu,{token:r}),a.downloadDiagnose&&t(lu,{})]})},cu=({isOpen:n,onClose:a,onCloseEnd:i})=>{const{addDataStreams:r,setSelectedStreamName:s}=He(),{dataStreamsApi:c}=rl(),{requestSubmit:d}=Fl(),u=l(async e=>{c.create?await c.create(e):(r([e]),s(e.name)),a()},[c,r,s,a]),p=l(()=>d(u),[d,u]);return zo({key:"Enter",active:n},p),e(o,{children:[t(Ue,{isOpen:n,onClose:a,onCloseEnd:i,title:Ge.NAME_YOUR_STREAM,description:Ge.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:kt.DONE,variant:de.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:a},children:t(Wr,{autoFocus:!0})}),t(jr,{})]})},du=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s})=>{const{dataStreamsApi:c}=rl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Fl();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,g=l(async e=>{await c.update(s,e),i()},[c,s,i]),m=l(()=>p(g),[p,g]);return zo({key:"Enter",active:a},m),e(o,{children:[t(Ue,{isOpen:a,onClose:i,onCloseEnd:r,title:Ge.RENAME_STREAM(s),description:Ge.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:kt.SAVE,variant:de.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:i},children:t(Wr,{autoFocus:!0})}),t(jr,{})]})},uu=({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)"})})]})]}),pu=m.div`
|
|
394
|
+
`,Zd=()=>{const{progress:o}=Ct(),{describeApi:n,namespacesApi:a}=sl(),{items:i}=a.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:u}=Nt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(et,{richTitle:{icon:Ji,title:"Diagnose"},children:l?e(qd,{children:[t(ct,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[xt.DownloadingDiagnose]?.percentage,percentage:o[xt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[xt.DownloadingDiagnose]?.percentage,visualIcon:Hi,startedAt:l}),o[xt.DownloadingDiagnose]?.list?.length&&t(W,{$width:"100%",children:o[xt.DownloadingDiagnose].list.map(o=>e(se,{$gap:4,$alignItems:"center",children:[o.status===Ee.Success?t(xi,{size:16}):o.status===Ee.Error?t(Ti,{size:16}):t(ct,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ae,{size:le.XXXS,color:ie.Secondary,children:o.label})]},o.label))})]}):e(W,{$gap:24,children:[t(ae,{size:le.XXS,color:ie.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(W,{$gap:16,children:[e(se,{$gap:8,children:[t(Y,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include pprof profiles"})]}),e(se,{$gap:8,children:[t(Y,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include Prometheus metrics"})]}),e(se,{$gap:8,children:[t(Y,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Bo,{alignX:Vo.Left,alignY:Xo.Bottom,items:i.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:de.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Be,{label:c.sourceWorkloadNamespaces.length,status:Ee.Default}):void 0}}),t(se,{$justifyContent:"flex-end",children:t(re,{label:"Download Diagnose",rightIcon:Hi,variant:de.Primary,onClick:async()=>{n.downloadDiagnose&&(r(Date.now()),await n.downloadDiagnose(c),r(null),u())},disabled:null!==l})})]})})},Qd=()=>{const{platformType:e,version:o,tier:a}=y(),{describeApi:i}=sl(),[l,r]=s(null);return n(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(et,{richTitle:{icon:zi,title:"General Information"},children:t(Et,{cellsPerRow:2,items:[{id:Uo(),title:"Odigos Version",label:o},{id:Uo(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Uo(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Uo(),title:"Tier",label:a}]})})},eu=({isOpen:o,onClose:n})=>{const{describeApi:a,tokensApi:i}=sl(),l=i.useTokens().items[0];return e(oe,{isOpen:o,header:{icon:zi,title:"System Overview",onClose:n},children:[a.fetchDescribeOdigos&&t(Qd,{}),i.updateToken&&l&&t(Jd,{token:l}),a.downloadDiagnose&&t(Zd,{})]})},tu=({isOpen:n,onClose:a,onCloseEnd:i})=>{const{addDataStreams:s,setSelectedStreamName:r}=Ge(),{dataStreamsApi:c}=sl(),{requestSubmit:d}=Rl(),u=l(async e=>{c.create?await c.create(e):(s([e]),r(e.name)),a()},[c,s,r,a]),p=l(()=>d(u),[d,u]);return zo({key:"Enter",active:n},p),e(o,{children:[t(Ue,{isOpen:n,onClose:a,onCloseEnd:i,title:He.NAME_YOUR_STREAM,description:He.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:kt.DONE,variant:de.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:a},children:t(Gs,{autoFocus:!0})}),t(Hs,{})]})},ou=({isOpen:a,onClose:i,onCloseEnd:s,dataStreamName:r})=>{const{dataStreamsApi:c}=sl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Rl();n(()=>{a&&r&&u(r)},[a,r]);const h=!!d?.isFormDirty,g=l(async e=>{await c.update(r,e),i()},[c,r,i]),m=l(()=>p(g),[p,g]);return zo({key:"Enter",active:a},m),e(o,{children:[t(Ue,{isOpen:a,onClose:i,onCloseEnd:s,title:He.RENAME_STREAM(r),description:He.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:kt.SAVE,variant:de.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:i},children:t(Gs,{autoFocus:!0})}),t(Hs,{})]})},nu=({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)"})})]})]}),au=m.div`
|
|
395
395
|
position: absolute;
|
|
396
396
|
top: 50%;
|
|
397
397
|
left: 50%;
|
|
398
398
|
transform: translate(-50%, -50%);
|
|
399
399
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
400
|
-
`,
|
|
400
|
+
`,iu="onboarding-done",lu=()=>{const{currentModal:o,setCurrentModal:n}=Ho(),a=()=>n("");return e(Go,{isOpen:o===iu,onClose:a,children:[t(nu,{}),t(au,{children:e(W,{$gap:32,$alignItems:"center",children:[e(W,{$gap:24,$alignItems:"center",children:[t(ae,{size:le.L,weight:500,children:"Welcome to"}),t(kl,{size:260}),t(ae,{size:le.S,weight:400,children:"Your observability control plane is ready."})]}),t(re,{label:"Get Started",rightIcon:di,onClick:a})]})})]})},su=m.div`
|
|
401
401
|
display: flex;
|
|
402
402
|
flex-direction: column;
|
|
403
403
|
gap: 8px;
|
|
404
404
|
padding: 4px 8px;
|
|
405
405
|
border-radius: 8px;
|
|
406
406
|
width: 100%;
|
|
407
|
-
`,
|
|
407
|
+
`,ru=m.div`
|
|
408
408
|
white-space: pre;
|
|
409
409
|
overflow-x: auto;
|
|
410
|
-
`,
|
|
410
|
+
`,cu=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:s,toggleName:r})=>{const c=f();return e(su,{children:[e(se,{$gap:8,$justifyContent:"space-between",children:[e(se,{$gap:4,children:[t(ae,{size:le.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Be,{label:jo,leftIcon:qi,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:le.XXXS})]}),t(Q,{name:r??`sampling-onboarding-toggle-${o}`,label:a,labelAlign:ee.Left,value:i,onChange:l,size:vt.S})]}),t(ru,{children:t(S,{parts:s})})]})},du=m.div`
|
|
411
411
|
position: relative;
|
|
412
412
|
display: flex;
|
|
413
413
|
align-items: center;
|
|
@@ -417,18 +417,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
417
417
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
418
418
|
border-top-left-radius: 18px;
|
|
419
419
|
border-top-right-radius: 18px;
|
|
420
|
-
`,
|
|
420
|
+
`,uu=m.div`
|
|
421
421
|
position: absolute;
|
|
422
422
|
left: 16px;
|
|
423
423
|
top: 50%;
|
|
424
424
|
transform: translateY(-50%);
|
|
425
|
-
`,
|
|
425
|
+
`,pu=m.div`
|
|
426
426
|
height: 16px;
|
|
427
427
|
width: 100%;
|
|
428
428
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
429
429
|
border-top-left-radius: 18px;
|
|
430
430
|
border-top-right-radius: 18px;
|
|
431
|
-
`,
|
|
431
|
+
`,hu=m.div`
|
|
432
432
|
width: ${({$width:e})=>e}px;
|
|
433
433
|
display: flex;
|
|
434
434
|
flex-direction: column;
|
|
@@ -436,7 +436,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
436
436
|
gap: 22px;
|
|
437
437
|
padding: 8px 32px 32px 32px;
|
|
438
438
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
439
|
-
`,
|
|
439
|
+
`,gu=e=>t(Zi,{rotate:90,...e}),mu=({children:o,center:n,onNext:a,nextLabel:i=Wo,nextLoading:l})=>e(se,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,a&&t(re,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:gu,variant:de.Primary,size:ce.M,onClick:a,loading:l})]}),fu=e=>t(Zi,{rotate:-90,...e}),bu=({title:o,onBack:n})=>{const a=f();return e(du,{$hasBack:!!n,children:[n&&t(uu,{children:t(st,{"data-id":"sampling-onboarding-back",icon:fu,size:rt.M,onClick:n})}),t(ae,{size:le.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},vu=m.div`
|
|
440
440
|
box-sizing: border-box;
|
|
441
441
|
width: ${({$width:e})=>e??"100%"};
|
|
442
442
|
${({$fillHeight:e})=>e&&b`
|
|
@@ -449,16 +449,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
449
449
|
padding: 16px;
|
|
450
450
|
border-radius: 16px;
|
|
451
451
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
452
|
-
`,
|
|
452
|
+
`,yu=({children:e,fillHeight:o,width:n})=>t(vu,{$fillHeight:o,$width:n,children:e}),Cu=m.ul`
|
|
453
453
|
margin: 0;
|
|
454
454
|
padding: 0;
|
|
455
455
|
list-style: disc;
|
|
456
|
-
`,
|
|
456
|
+
`,Su=m.li`
|
|
457
457
|
margin-left: 18px;
|
|
458
458
|
& + & {
|
|
459
459
|
margin-top: 6px;
|
|
460
460
|
}
|
|
461
|
-
`,
|
|
461
|
+
`,wu=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(Cu,{children:e.map((e,o)=>t(Su,{style:{color:a},children:t(ae,{size:le.XXS,color:a,children:e})},o))})},xu=({items:o})=>{const n=f();return t(W,{$gap:16,children:o.map((o,a)=>e(se,{$gap:8,$alignItems:"flex-start",children:[e(ae,{size:le.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(W,{$gap:2,children:[t(ae,{size:le.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(ae,{size:le.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},Tu=({message:e})=>t($e,{status:Ee.Default,message:e,fullWidth:!0,smallIcon:!0}),ku=m.div`
|
|
462
462
|
width: 100%;
|
|
463
463
|
padding: 8px;
|
|
464
464
|
display: flex;
|
|
@@ -466,12 +466,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
466
466
|
gap: 4px;
|
|
467
467
|
border-radius: 16px;
|
|
468
468
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
469
|
-
|
|
469
|
+
`,$u=m.div`
|
|
470
470
|
display: flex;
|
|
471
471
|
align-items: center;
|
|
472
472
|
gap: 8px;
|
|
473
473
|
padding: 4px 8px 12px 8px;
|
|
474
|
-
`,
|
|
474
|
+
`,Eu=m.div`
|
|
475
475
|
width: 100%;
|
|
476
476
|
display: flex;
|
|
477
477
|
flex-direction: column;
|
|
@@ -479,20 +479,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
479
479
|
padding: 8px;
|
|
480
480
|
border-radius: 12px;
|
|
481
481
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
482
|
-
`,
|
|
482
|
+
`,Iu=({children:e})=>{const o=f();return t(ae,{size:le.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Au=m.div`
|
|
483
483
|
white-space: pre-line;
|
|
484
|
-
`,
|
|
484
|
+
`,Nu=({enabled:n,onEnabledChange:i,onBack:l,onNext:s})=>{const r=f(),c=a(()=>k({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(bu,{title:Ko,onBack:l}),e(hu,{$width:854,children:[t(Iu,{children:Yo}),e(W,{$gap:8,$width:"100%",children:[t(yu,{children:t(Au,{children:t(ae,{size:le.XXS,color:r.v2.colors.silver[200],children:Jo})})}),e(W,{$gap:8,$width:"100%",children:[e(ku,{children:[t($u,{children:t(ae,{size:le.S,weight:500,color:r.v2.colors.white[500],children:qo})}),t(Eu,{children:t(cu,{name:Qo,recommended:!0,toggleLabel:Zo,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Tu,{message:en})]})]})]}),t(mu,{onNext:s})]})},Ou=e=>t(Zi,{rotate:90,...e}),Ru=({onClose:n})=>{const a=f();return e(o,{children:[t(pu,{}),e(hu,{$width:732,children:[t(tn,{icon:Wi}),e(W,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ae,{size:le.M,weight:500,color:a.v2.colors.white[500],children:on}),nn.split("\n").map(e=>t(Iu,{children:e},e)),e(yu,{children:[t(ae,{size:le.XS,color:a.v2.colors.silver[200],children:an}),t(wu,{color:a.v2.colors.white[500],items:[ln,sn,rn]})]})]})]}),t(mu,{center:!0,children:t(re,{"data-id":"sampling-onboarding-btn-go-to",label:cn,rightIcon:Ou,variant:de.Primary,size:ce.M,onClick:n})})]})},Du=e=>t(Zi,{rotate:90,...e}),Pu=m.div`
|
|
485
485
|
display: flex;
|
|
486
486
|
flex-direction: column;
|
|
487
487
|
align-items: center;
|
|
488
488
|
gap: 8px;
|
|
489
489
|
width: 100%;
|
|
490
|
-
`,
|
|
490
|
+
`,Fu=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(pu,{}),e(hu,{$width:732,children:[t(tn,{icon:Wi}),e(W,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Pu,{children:[t(ae,{size:le.M,weight:500,color:i.v2.colors.white[500],children:dn}),t(Iu,{children:un})]}),e(yu,{children:[t(ae,{size:le.XS,color:i.v2.colors.silver[200],children:pn}),t(xu,{items:[{title:gn,description:hn},{title:fn,description:mn},{title:vn,description:bn}]}),t(Tu,{message:yn})]})]})]}),e(mu,{center:!0,children:[t(re,{"data-id":"sampling-onboarding-btn-skip",label:Cn,variant:de.Secondary,onClick:n}),t(re,{"data-id":"sampling-onboarding-btn-start",label:Sn,rightIcon:Du,variant:de.Primary,onClick:a})]})]})},Lu=m.div`
|
|
491
491
|
display: flex;
|
|
492
492
|
align-items: stretch;
|
|
493
493
|
gap: 16px;
|
|
494
494
|
width: 100%;
|
|
495
|
-
`,
|
|
495
|
+
`,_u=m.div`
|
|
496
496
|
flex: 1;
|
|
497
497
|
display: flex;
|
|
498
498
|
flex-direction: column;
|
|
@@ -512,18 +512,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
512
512
|
background-color: ${t.v2.colors.silver[700]};
|
|
513
513
|
}
|
|
514
514
|
`}
|
|
515
|
-
`,
|
|
515
|
+
`,zu=m.div`
|
|
516
516
|
display: flex;
|
|
517
517
|
align-items: center;
|
|
518
518
|
gap: 8px;
|
|
519
519
|
padding: 12px 16px;
|
|
520
|
-
`,
|
|
520
|
+
`,Mu=m.div`
|
|
521
521
|
flex: 1;
|
|
522
522
|
padding: 8px;
|
|
523
523
|
display: flex;
|
|
524
524
|
flex-direction: column;
|
|
525
525
|
gap: 8px;
|
|
526
|
-
`,
|
|
526
|
+
`,Bu=m.div`
|
|
527
527
|
flex: 1;
|
|
528
528
|
display: flex;
|
|
529
529
|
flex-direction: column;
|
|
@@ -531,17 +531,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
531
531
|
padding: 12px;
|
|
532
532
|
border-radius: 12px;
|
|
533
533
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
534
|
-
`,
|
|
534
|
+
`,Xu=m.div`
|
|
535
535
|
display: flex;
|
|
536
536
|
justify-content: flex-end;
|
|
537
|
-
`,
|
|
537
|
+
`,Vu=m.div`
|
|
538
538
|
display: flex;
|
|
539
539
|
align-items: center;
|
|
540
540
|
gap: 8px;
|
|
541
541
|
padding: 4px 12px 4px 4px;
|
|
542
542
|
border-radius: 8px;
|
|
543
543
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
544
|
-
`,
|
|
544
|
+
`,Uu=m.div`
|
|
545
545
|
display: flex;
|
|
546
546
|
align-items: center;
|
|
547
547
|
justify-content: center;
|
|
@@ -549,13 +549,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
549
549
|
height: 24px;
|
|
550
550
|
border-radius: 6px;
|
|
551
551
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
552
|
-
`,
|
|
552
|
+
`,Hu=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:s,warning:r,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(_u,{$selected:o,onClick:n,children:[e(zu,{children:[t(ge,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:fe.L}),t(Wi,{size:24,fill:d.v2.colors.white[500]}),t(ae,{size:le.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(Mu,{children:[e(Bu,{$selected:o,children:[e(W,{$gap:8,children:[t(Be,{...l,textSize:le.XXXS}),t(ae,{size:le.XXS,color:u,children:i})]}),s&&s.length>0&&t(wu,{color:u,items:s}),r&&e(Vu,{children:[t(Uu,{children:t(Ki,{size:18,fill:d.v2.colors.yellow[500]})}),t(ae,{size:le.XXXS,color:d.v2.colors.yellow[500],children:r})]})]}),c&&t(Xu,{children:t(re,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:zn,rightIcon:hi,variant:de.Text,size:ce.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Gu=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:s})=>{const r=f(),c=s?()=>window.open(s,"_blank"):void 0;return e(o,{children:[t(bu,{title:wn,onBack:i}),e(hu,{$width:854,children:[t(Iu,{children:xn}),e(Lu,{children:[t(Hu,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:An,description:In,badgeProps:{label:En,backgroundColor:r.v2.colors.purple[500],textColor:r.v2.colors.white[500]},bullets:[kn,$n],warning:Tn,onReadMore:c}),t(Hu,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:Pn,description:Dn,badgeProps:{label:Rn,backgroundColor:r.v2.colors.green[500],textColor:r.v2.colors.black[500]},bullets:[Nn,On],onReadMore:c}),t(Hu,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:_n,description:Ln,badgeProps:{label:Fn,backgroundColor:r.v2.colors.blue[700],textColor:r.v2.colors.white[500]},onReadMore:c})]})]}),t(mu,{onNext:l})]})},ju=({onBack:n,onNext:i,submitting:l})=>{const s=f(),r=a(()=>[{title:Vn,bullets:[Mn,Bn,Xn]},{title:Kn,bullets:[Un,Hn,Gn,jn,Wn]}],[]);return e(o,{children:[t(bu,{title:Yn,onBack:n}),e(hu,{$width:854,children:[t(Iu,{children:Jn}),t(se,{$gap:16,$width:"100%",$alignItems:"stretch",children:r.map((o,n)=>e(yu,{fillHeight:!0,width:"50%",children:[t(ae,{size:le.XS,color:s.v2.colors.white[500],children:o.title}),t(wu,{items:o.bullets})]},n))}),t(Tu,{message:qn})]}),t(mu,{onNext:i,nextLoading:l})]})},Wu=m.div`
|
|
553
553
|
white-space: pre-line;
|
|
554
|
-
`,
|
|
554
|
+
`,Ku=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:s,submitting:r})=>{const c=f(),d=a(()=>$(n?{disabled:!1}:null),[n]);return e(o,{children:[t(bu,{title:Zn,onBack:l}),e(hu,{$width:854,children:[t(Iu,{children:Qn}),e(W,{$gap:8,$width:"100%",children:[e(yu,{children:[t(Wu,{children:t(ae,{size:le.XXS,color:c.v2.colors.silver[200],children:ea})}),t(Tu,{message:qn})]}),e(ku,{children:[e($u,{children:[t(ae,{size:le.S,weight:500,color:c.v2.colors.white[500],children:ta}),t(Pi,{size:16,fill:c.v2.colors.silver[200]})]}),t(Eu,{children:t(cu,{name:na,recommended:!0,toggleLabel:oa,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(mu,{onNext:s,nextLoading:r})]})},Yu=m.div`
|
|
555
555
|
white-space: pre-line;
|
|
556
|
-
`,
|
|
556
|
+
`,Ju=m.div`
|
|
557
557
|
width: fit-content;
|
|
558
|
-
`,ip=["50","25","10","1","0.1"],lp=({value:o,onChange:n,label:i})=>{const l=f(),r=a(()=>ip.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(W,{$gap:8,children:[t(ae,{size:le.XS,color:l.v2.colors.white[500],children:i}),t(ap,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},rp=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>E(n?{disabled:!1}:null),[n]);return e(o,{children:[t(ku,{title:aa,onBack:s}),e(Su,{$width:854,children:[t(_u,{children:ia}),e(W,{$gap:8,$width:"100%",children:[e(Iu,{children:[t(np,{children:t(ae,{size:le.XXS,color:u.v2.colors.silver[200],children:la})}),t(Nu,{items:[ra,sa,ca,da,ua]}),t(Ru,{message:qn})]}),e(Du,{children:[e(Fu,{children:[t(ae,{size:le.S,weight:500,color:u.v2.colors.white[500],children:pa}),t(Fi,{size:16,fill:u.v2.colors.silver[200]})]}),t(Pu,{children:t(bu,{name:na,recommended:!0,toggleLabel:oa,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Pu,{children:t(lp,{value:l,onChange:r,label:ha})})]})]})]}),t(Tu,{onNext:c,nextLoading:d})]})},sp=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s})=>{const{samplingApi:c}=rl(),[d,u]=r("welcome"),[p,h]=r(!0),[g,m]=r("keep-list"),[f,b]=r(!0),[v,y]=r("25"),[C,S]=r(!1);n(()=>{e&&(u("welcome"),h(a?.enabled??!0),m("keep-list"),b(!0),y("25"),S(!1))},[e,a?.enabled]);const w=l(async()=>{const e=i??"default",t=[];if(p!==(a?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:a?.keepPercentage??0}))}if("advanced"!==g&&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"===g){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),u("success")}catch{}finally{S(!1)}},[i,c,p,a?.enabled,a?.keepPercentage,g,f,v]);let T=null;switch(d){case"welcome":T=t(Uu,{onSkip:o,onNext:()=>u("noisy")});break;case"noisy":T=t(zu,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":T=t(Qu,{strategy:g,onStrategyChange:m,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===g?"keep-list":"drop-list"===g?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(rp,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":T=t(op,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":T=t(ep,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":T=t(Bu,{onClose:o})}return t(Ho,{isOpen:e,onClose:o,children:T})};var cp,dp;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(cp||(cp={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(dp||(dp={}));const up=[{key:dp.Name,label:"Name"},{key:dp.Type,label:"Type",textAlign:"right"},{key:dp.Status,label:"Status"},{key:dp.OdigosVersion,label:"Odigos Version"},{key:dp.ConnectedSince,label:"Connected Since"},{key:dp.LastActivity,label:"Last Activity"}],pp=(e,t)=>{const o=e.find(e=>e.key===dp.Id)?.rawValue;return t(o?.toString()||"")},hp=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===dp.Status)?.rawValue===Ie.Success)(e))return[{id:Uo(),label:"Delete Connection",rightIcon:gi,onClick:()=>pp(e,a)}];const d=pp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&I(n.odigosVersion,o)}),u=pp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&I(o.odigosVersion,n)}),p=[];return i&&p.push({id:Uo(),tooltip:u?Ge.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Ei,disabled:!u,onClick:()=>pp(e,i)}),l&&p.push({id:Uo(),tooltip:Ge.ADD_DESTINATION,rightIcon:Ci,onClick:()=>pp(e,l)}),r&&p.push({id:Uo(),tooltip:Ge.ADD_ACTION,rightIcon:yi,onClick:()=>pp(e,r)}),s&&p.push({id:Uo(),tooltip:Ge.ADD_INSTRUMENTATION_RULE,rightIcon:ki,onClick:()=>pp(e,s)}),c&&p.push({id:Uo(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:$i,disabled:!d,onClick:()=>pp(e,c)}),p}},gp=({connections:o,getConnections:i,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=f(),{formatTimeAgo:h}=Bt(),{capabilities:g}=rl(),[m,b]=r(!1),[v,y]=r(o||[]),C=l(async()=>{try{b(!0),y(await i()??[])}catch(e){}finally{b(!1)}},[]);n(()=>{v.length||C()},[]);const[S,w]=r(""),[T,x]=r(null),[k,E]=r([]),$=a(()=>T===cp.BulkConfig?d:T===cp.BulkSource?u:0,[T,d,u]),{supportedConnections:A,supportedConnectionIds:N}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Ie.Success,n=I(e.odigosVersion,t);return o&&n}))(v,$);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[v,$]);n(()=>{if(!T||T===cp.Delete)return;const e=k.filter(e=>!N.includes(e));e.length&&E(t=>t.filter(t=>!e.includes(t)))},[T,k.length,N.length]);const O=a(()=>v.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:dp.Id,rawValue:e.id},{key:dp.Name,rawValue:e.name},{key:dp.Type,rawValue:e.type},{key:dp.Status,rawValue:e.status,component:()=>(e=>{const o=e===Ie.Success?"Connection live":"Connection lost",n=e===Ie.Success?Ti:xi;return t(Be,{status:e,label:o,leftIcon:n})})(e.status)},{key:dp.OdigosVersion,rawValue:e.odigosVersion},{key:dp.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:dp.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Ie.Success||T?void 0:()=>s(e),isSelected:k.includes(e.id),onSelect:()=>E(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>E(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Ie.Success||T===cp.BulkConfig&&!I(e.odigosVersion,d)||T===cp.BulkSource&&!I(e.odigosVersion,u)})),[v,k,S,T,d,u,h,s]),R=a(()=>{const e=(e,t)=>{E([e]),x(t)};return hp({connections:v,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,cp.Delete),onAddSource:g.canFetchSnapshots&&g.canBulkPersistSources?t=>e(t,cp.BulkSource):void 0,onAddDestination:g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canCreateDestination?t=>e(t,cp.BulkDestination):void 0,onAddAction:g.canCreateAction?t=>e(t,cp.BulkAction):void 0,onAddInstrumentationRule:g.canCreateInstrumentationRule?t=>e(t,cp.BulkInstrumentationRule):void 0,onEditConfiguration:g.canApplyEffectiveConfig?t=>e(t,cp.BulkConfig):void 0})},[v,d,u,g]),D=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];o&&r.push({id:Uo(),type:qt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:"Add Sources",rightIcon:Ei,onClick:o}});const s=[n?{id:cp.BulkDestination,label:Ge.ADD_DESTINATION,icon:Ci}:null,a?{id:cp.BulkAction,label:Ge.ADD_ACTION,icon:yi}:null,i?{id:cp.BulkInstrumentationRule,label:Ge.ADD_INSTRUMENTATION_RULE,icon:ki}:null,l?{id:cp.BulkConfig,label:"Manage Configurations",icon:$i}:null];return s.some(Boolean)&&r.push({id:Uo(),type:qt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"Bulk Operations",onClick:e=>{e===cp.BulkSource?o?.():e===cp.BulkDestination?n?.():e===cp.BulkAction?a?.():e===cp.BulkInstrumentationRule?i?.():e===cp.BulkConfig&&l?.()}},dropDataProps:{alignX:Vo.Left,items:s}}),r.push({id:Uo(),type:qt.Button,buttonProps:{variant:de.Text,size:ce.S,label:kt.CANCEL,onClick:t}}),r})({onCancel:()=>E([]),onAddSource:g.canFetchSnapshots&&g.canBulkPersistSources?()=>x(cp.BulkSource):void 0,onAddDestination:g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canCreateDestination?()=>x(cp.BulkDestination):void 0,onAddAction:g.canCreateAction?()=>x(cp.BulkAction):void 0,onAddInstrumentationRule:g.canCreateInstrumentationRule?()=>x(cp.BulkInstrumentationRule):void 0,onManageConfigurations:g.canApplyEffectiveConfig?()=>x(cp.BulkConfig):void 0}),[g]);return t(ga,{children:e(et,{fullHeight:!0,richTitle:{icon:Qi,title:Ge.CONNECTIONS,badge:{label:v.length.toString(),status:ft.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:Uo(),type:qt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ri,onClick:C,disabled:m}}],children:[t(vo,{variant:yo.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:m,withCheckboxes:!0,columns:up,rows:O,rowActionsPushRightPosition:T?`calc(${$l} - 24px)`:void 0,getRowActions:R}),T===cp.BulkConfig&&g.canApplyEffectiveConfig&&t(Nl,{connectionIds:k,children:t(Us,{onClose:()=>x(null),connections:A,selectedConnectionIds:k,setSelectedConnectionIds:E})}),T===cp.BulkSource&&g.canFetchSnapshots&&g.canBulkPersistSources&&t(Nl,{connectionIds:k,children:t(Gl,{selectedConnectionIds:k,children:t(Ms,{onClose:()=>x(null),selectedConnectionIds:k,setSelectedConnectionIds:E})})}),T===cp.BulkDestination&&g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canTestConnection&&g.canCreateDestination&&t(Nl,{connectionIds:k,children:t(Hl,{children:t(vs,{onClose:()=>x(null),selectedConnectionIds:k,setSelectedConnectionIds:E})})}),T===cp.BulkAction&&g.canCreateAction&&t(Nl,{connectionIds:k,children:t(jl,{children:t(rs,{onClose:()=>x(null),selectedConnectionIds:k,setSelectedConnectionIds:E})})}),T===cp.BulkInstrumentationRule&&g.canCreateInstrumentationRule&&t(Nl,{connectionIds:k,children:t(Wl,{children:t(ys,{onClose:()=>x(null),selectedConnectionIds:k,setSelectedConnectionIds:E})})}),t(xl,{target:"connection",isOpen:T===cp.Delete,onClose:()=>{E([]),x(null)},onApprove:async()=>{const e=k[0];e&&(await c(e),await C())}}),t(ma,{isOpen:!!k.length&&!T,richTitle:{icon:ui,title:"Selected Clusters",badge:{label:k.length}},actions:D})]})})},mp=m.div`
|
|
558
|
+
`,qu=["50","25","10","1","0.1"],Zu=({value:o,onChange:n,label:i})=>{const l=f(),s=a(()=>qu.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(W,{$gap:8,children:[t(ae,{size:le.XS,color:l.v2.colors.white[500],children:i}),t(Ju,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:s,selected:o,setSelected:n})})]})},Qu=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:s,onBack:r,onNext:c,submitting:d})=>{const u=f(),p=a(()=>$(n?{disabled:!1}:null),[n]);return e(o,{children:[t(bu,{title:aa,onBack:r}),e(hu,{$width:854,children:[t(Iu,{children:ia}),e(W,{$gap:8,$width:"100%",children:[e(yu,{children:[t(Yu,{children:t(ae,{size:le.XXS,color:u.v2.colors.silver[200],children:la})}),t(wu,{items:[sa,ra,ca,da,ua]}),t(Tu,{message:qn})]}),e(ku,{children:[e($u,{children:[t(ae,{size:le.S,weight:500,color:u.v2.colors.white[500],children:pa}),t(Pi,{size:16,fill:u.v2.colors.silver[200]})]}),t(Eu,{children:t(cu,{name:na,recommended:!0,toggleLabel:oa,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Eu,{children:t(Zu,{value:l,onChange:s,label:ha})})]})]})]}),t(mu,{onNext:c,nextLoading:d})]})},ep=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:r})=>{const{samplingApi:c}=sl(),[d,u]=s("welcome"),[p,h]=s(!0),[g,m]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);n(()=>{e&&(u("welcome"),h(a?.enabled??!0),m("keep-list"),b(!0),y("25"),S(!1))},[e,a?.enabled]);const w=l(async()=>{const e=i??"default",t=[];if(p!==(a?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:a?.keepPercentage??0}))}if("advanced"!==g&&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"===g){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),u("success")}catch{}finally{S(!1)}},[i,c,p,a?.enabled,a?.keepPercentage,g,f,v]);let x=null;switch(d){case"welcome":x=t(Fu,{onSkip:o,onNext:()=>u("noisy")});break;case"noisy":x=t(Nu,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":x=t(Gu,{strategy:g,onStrategyChange:m,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===g?"keep-list":"drop-list"===g?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":x=t(Qu,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":x=t(Ku,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":x=t(ju,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":x=t(Ru,{onClose:o})}return t(Go,{isOpen:e,onClose:o,children:x})};var tp,op;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(tp||(tp={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(op||(op={}));const np=[{key:op.Name,label:"Name"},{key:op.Type,label:"Type",textAlign:"right"},{key:op.Status,label:"Status"},{key:op.OdigosVersion,label:"Odigos Version"},{key:op.ConnectedSince,label:"Connected Since"},{key:op.LastActivity,label:"Last Activity"}],ap=(e,t)=>{const o=e.find(e=>e.key===op.Id)?.rawValue;return t(o?.toString()||"")},ip=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===op.Status)?.rawValue===Ee.Success)(e))return[{id:Uo(),label:"Delete Connection",rightIcon:gi,onClick:()=>ap(e,a)}];const d=ap(e,e=>{const n=t.find(t=>t.id===e);return!!n&&E(n.odigosVersion,o)}),u=ap(e,e=>{const o=t.find(t=>t.id===e);return!!o&&E(o.odigosVersion,n)}),p=[];return i&&p.push({id:Uo(),tooltip:u?He.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:$i,disabled:!u,onClick:()=>ap(e,i)}),l&&p.push({id:Uo(),tooltip:He.ADD_DESTINATION,rightIcon:Ci,onClick:()=>ap(e,l)}),s&&p.push({id:Uo(),tooltip:He.ADD_ACTION,rightIcon:yi,onClick:()=>ap(e,s)}),r&&p.push({id:Uo(),tooltip:He.ADD_INSTRUMENTATION_RULE,rightIcon:ki,onClick:()=>ap(e,r)}),c&&p.push({id:Uo(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ii,disabled:!d,onClick:()=>ap(e,c)}),p}},lp=({connections:o,getConnections:i,onClickConnection:r,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=f(),{formatTimeAgo:h}=Bt(),{capabilities:g}=sl(),[m,b]=s(!1),[v,y]=s(o||[]),C=l(async()=>{try{b(!0),y(await i()??[])}catch(e){}finally{b(!1)}},[]);n(()=>{v.length||C()},[]);const[S,w]=s(""),[x,T]=s(null),[k,$]=s([]),I=a(()=>x===tp.BulkConfig?d:x===tp.BulkSource?u:0,[x,d,u]),{supportedConnections:A,supportedConnectionIds:N}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Ee.Success,n=E(e.odigosVersion,t);return o&&n}))(v,I);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[v,I]);n(()=>{if(!x||x===tp.Delete)return;const e=k.filter(e=>!N.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[x,k.length,N.length]);const O=a(()=>v.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:op.Id,rawValue:e.id},{key:op.Name,rawValue:e.name},{key:op.Type,rawValue:e.type},{key:op.Status,rawValue:e.status,component:()=>(e=>{const o=e===Ee.Success?"Connection live":"Connection lost",n=e===Ee.Success?xi:Ti;return t(Be,{status:e,label:o,leftIcon:n})})(e.status)},{key:op.OdigosVersion,rawValue:e.odigosVersion},{key:op.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:op.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Ee.Success||x?void 0:()=>r(e),isSelected:k.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Ee.Success||x===tp.BulkConfig&&!E(e.odigosVersion,d)||x===tp.BulkSource&&!E(e.odigosVersion,u)})),[v,k,S,x,d,u,h,r]),R=a(()=>{const e=(e,t)=>{$([e]),T(t)};return ip({connections:v,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,tp.Delete),onAddSource:g.canFetchSnapshots&&g.canBulkPersistSources?t=>e(t,tp.BulkSource):void 0,onAddDestination:g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canCreateDestination?t=>e(t,tp.BulkDestination):void 0,onAddAction:g.canCreateAction?t=>e(t,tp.BulkAction):void 0,onAddInstrumentationRule:g.canCreateInstrumentationRule?t=>e(t,tp.BulkInstrumentationRule):void 0,onEditConfiguration:g.canApplyEffectiveConfig?t=>e(t,tp.BulkConfig):void 0})},[v,d,u,g]),D=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];o&&s.push({id:Uo(),type:qt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:"Add Sources",rightIcon:$i,onClick:o}});const r=[n?{id:tp.BulkDestination,label:He.ADD_DESTINATION,icon:Ci}:null,a?{id:tp.BulkAction,label:He.ADD_ACTION,icon:yi}:null,i?{id:tp.BulkInstrumentationRule,label:He.ADD_INSTRUMENTATION_RULE,icon:ki}:null,l?{id:tp.BulkConfig,label:"Manage Configurations",icon:Ii}:null];return r.some(Boolean)&&s.push({id:Uo(),type:qt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"Bulk Operations",onClick:e=>{e===tp.BulkSource?o?.():e===tp.BulkDestination?n?.():e===tp.BulkAction?a?.():e===tp.BulkInstrumentationRule?i?.():e===tp.BulkConfig&&l?.()}},dropDataProps:{alignX:Vo.Left,items:r}}),s.push({id:Uo(),type:qt.Button,buttonProps:{variant:de.Text,size:ce.S,label:kt.CANCEL,onClick:t}}),s})({onCancel:()=>$([]),onAddSource:g.canFetchSnapshots&&g.canBulkPersistSources?()=>T(tp.BulkSource):void 0,onAddDestination:g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canCreateDestination?()=>T(tp.BulkDestination):void 0,onAddAction:g.canCreateAction?()=>T(tp.BulkAction):void 0,onAddInstrumentationRule:g.canCreateInstrumentationRule?()=>T(tp.BulkInstrumentationRule):void 0,onManageConfigurations:g.canApplyEffectiveConfig?()=>T(tp.BulkConfig):void 0}),[g]);return t(ga,{children:e(et,{fullHeight:!0,richTitle:{icon:Qi,title:He.CONNECTIONS,badge:{label:v.length.toString(),status:ft.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:Uo(),type:qt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ri,onClick:C,disabled:m}}],children:[t(vo,{variant:yo.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:m,withCheckboxes:!0,columns:np,rows:O,rowActionsPushRightPosition:x?`calc(${$l} - 24px)`:void 0,getRowActions:R}),x===tp.BulkConfig&&g.canApplyEffectiveConfig&&t(Il,{connectionIds:k,children:t(Mr,{onClose:()=>T(null),connections:A,selectedConnectionIds:k,setSelectedConnectionIds:$})}),x===tp.BulkSource&&g.canFetchSnapshots&&g.canBulkPersistSources&&t(Il,{connectionIds:k,children:t(Vl,{selectedConnectionIds:k,children:t(Lr,{onClose:()=>T(null),selectedConnectionIds:k,setSelectedConnectionIds:$})})}),x===tp.BulkDestination&&g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canTestConnection&&g.canCreateDestination&&t(Il,{connectionIds:k,children:t(Ul,{children:t(mr,{onClose:()=>T(null),selectedConnectionIds:k,setSelectedConnectionIds:$})})}),x===tp.BulkAction&&g.canCreateAction&&t(Il,{connectionIds:k,children:t(Hl,{children:t(ir,{onClose:()=>T(null),selectedConnectionIds:k,setSelectedConnectionIds:$})})}),x===tp.BulkInstrumentationRule&&g.canCreateInstrumentationRule&&t(Il,{connectionIds:k,children:t(Gl,{children:t(fr,{onClose:()=>T(null),selectedConnectionIds:k,setSelectedConnectionIds:$})})}),t(wl,{target:"connection",isOpen:x===tp.Delete,onClose:()=>{$([]),T(null)},onApprove:async()=>{const e=k[0];e&&(await c(e),await C())}}),t(ma,{isOpen:!!k.length&&!x,richTitle:{icon:ui,title:"Selected Clusters",badge:{label:k.length}},actions:D})]})})},sp=m.div`
|
|
559
559
|
display: flex;
|
|
560
560
|
align-items: center;
|
|
561
561
|
justify-content: space-between;
|
|
@@ -564,26 +564,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
564
564
|
width: 100%;
|
|
565
565
|
border-radius: 16px;
|
|
566
566
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
567
|
-
`,
|
|
567
|
+
`,rp=m.div`
|
|
568
568
|
display: flex;
|
|
569
569
|
align-items: center;
|
|
570
570
|
justify-content: center;
|
|
571
571
|
padding: 8px;
|
|
572
572
|
border-radius: 8px;
|
|
573
573
|
background-color: ${({theme:e})=>e.v2.colors.white[500]+ot["004"]};
|
|
574
|
-
`,
|
|
574
|
+
`,cp=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:s})=>{const r=f(),c=()=>o(2),d=()=>o(3),u=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,a)=>{if(!o.selected)return null;const i=o.kind||mt.Namespace,l=i===mt.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(sp,{children:[t(ae,{nowrap:!0,children:l}),t(Be,{label:i,status:Ee.Info,backgroundColor:r.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((o,n)=>{const a=ut(o.option.type).icon;return e(sp,{children:[e(se,{$gap:8,children:[a&&t(rp,{children:t(a,{size:24})}),t(ae,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Be,{status:o.testResult.succeeded?Ee.Success:Ee.Error,leftIcon:o.testResult.succeeded?xi:Ti})]},`destination-${n}`)})||[],[l]);return t(Sl,{isOpen:!0,disableAnimation:s,onBack:()=>o(3),onSave:n,header:{icon:Ni,title:He.SUMMARY,subTitle:He.REVIEW_SETUP},leftColumn:{width:"50%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t($i,{size:24}),t(ae,{nowrap:!0,children:He.SELECTED_SOURCES}),t(Be,{label:u.length})]}),t(re,{"data-id":"summary-edit-sources",leftIcon:mi,variant:de.Secondary,size:ce.S,onClick:c})]}),list:u.length?u:[t(at,{$height:"100%",children:t(Ce,{icon:$i,title:He.NO_SOURCES_SELECTED,subTitle:He.ADD_SOURCE_PROMPT,button:{leftIcon:ci,label:He.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(se,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(se,{$gap:8,children:[t(Ci,{size:24}),t(ae,{nowrap:!0,children:He.SELECTED_DESTINATIONS}),t(Be,{label:p.length})]}),t(re,{"data-id":"summary-edit-destinations",leftIcon:mi,variant:de.Secondary,size:ce.S,onClick:d})]}),list:p.length?p:[t(at,{"data-id":"summary-no-destinations",$height:"100%",children:t(Ce,{icon:Ci,title:He.NO_DESTINATIONS_SELECTED,subTitle:He.ADD_DESTINATION_PROMPT,button:{leftIcon:ci,label:He.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},dp=m.div`
|
|
575
575
|
position: relative;
|
|
576
576
|
overflow: hidden;
|
|
577
577
|
width: 100vw;
|
|
578
578
|
height: 100vh;
|
|
579
579
|
box-sizing: border-box;
|
|
580
|
-
`,
|
|
580
|
+
`,up=m.svg`
|
|
581
581
|
position: absolute;
|
|
582
582
|
top: 50%;
|
|
583
583
|
left: 50%;
|
|
584
584
|
transform: translate(-50%, -50%);
|
|
585
585
|
z-index: -1;
|
|
586
|
-
`,
|
|
586
|
+
`,pp=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],hp=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:pp},{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:pp},{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:pp}],gp=({paddingXAxis:o="0px",paddingYAxis:i="0px",children:l})=>{const[r,c]=s(window.innerWidth),d=a(()=>r/hp[0].width,[r]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(dp,{$paddingXAxis:o,$paddingYAxis:i,children:[hp.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:s},r)=>{const c=`purple-ring-${r}`;return e(up,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:s.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},mp=m.div`
|
|
587
587
|
display: flex;
|
|
588
588
|
flex-direction: column;
|
|
589
589
|
align-items: center;
|
|
@@ -594,7 +594,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
594
594
|
width: 50vw;
|
|
595
595
|
border-radius: 16px;
|
|
596
596
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
597
|
-
`,
|
|
597
|
+
`,fp=m.div`
|
|
598
598
|
display: flex;
|
|
599
599
|
flex-direction: column;
|
|
600
600
|
align-items: center;
|
|
@@ -604,15 +604,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
604
604
|
& * {
|
|
605
605
|
text-align: center;
|
|
606
606
|
}
|
|
607
|
-
`,
|
|
607
|
+
`,bp=({onStart:o})=>t(oe,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(at,{$height:"100%",children:e(mp,{children:[e(fp,{children:[t(ae,{size:le.L,weight:500,children:He.GET_STARTED_WITH}),t(kl,{size:260}),t(ae,{size:le.S,weight:400,children:He.GET_STARTED_DESCRIPTION})]}),t(re,{"data-id":"onboarding-get-started",label:kt.GET_STARTED,rightIcon:di,size:ce.L,onClick:o})]})})}),vp=[{step:1,label:He.INSTALLATION,forceDoneBadge:!0},{step:2,label:He.SOURCES_SETUP},{step:3,label:He.DESTINATIONS_SETUP},{step:4,label:He.SUMMARY}],yp=m.div`
|
|
608
608
|
display: flex;
|
|
609
609
|
flex-direction: column;
|
|
610
610
|
gap: 32px;
|
|
611
611
|
padding: 64px;
|
|
612
|
-
|
|
612
|
+
`,Cp=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:a})=>{const{setCurrentModal:i}=Ho(),{sourcesApi:l,destinationsApi:r}=sl(),[c,d]=s(1),[u,p]=s(!1),[h,g]=s(null),[m,f]=s(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(gp,{paddingXAxis:o,paddingYAxis:n,children:[e(yp,{children:[t(kl,{useInline:!0}),t(fa,{currentStep:c,data:vp,gap:32})]}),t(Vl,{initialInputs:h,children:e(Ul,{children:[1===c&&t(bp,{onStart:b}),2===c&&t(Lr,{disableAnimation:!0,onBack:e=>{g(e),v()},onNext:e=>{g(e),b()}}),3===c&&t(mr,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:m}),4===c&&t(cp,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),m&&e.push(...m.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")};i(iu),a()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:m})]})})]})},Sp=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),wp=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},xp=m.div`
|
|
613
613
|
position: relative;
|
|
614
614
|
display: inline-flex;
|
|
615
|
-
`,
|
|
615
|
+
`,Tp=m.button`
|
|
616
616
|
display: inline-flex;
|
|
617
617
|
align-items: center;
|
|
618
618
|
gap: 8px;
|
|
@@ -625,7 +625,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
625
625
|
&:hover {
|
|
626
626
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
627
627
|
}
|
|
628
|
-
`,
|
|
628
|
+
`,kp=m.div`
|
|
629
629
|
position: absolute;
|
|
630
630
|
top: calc(100% + 8px);
|
|
631
631
|
right: 0;
|
|
@@ -638,25 +638,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
638
638
|
border-radius: 12px;
|
|
639
639
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
640
640
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
641
|
-
|
|
641
|
+
`,$p=m.div`
|
|
642
642
|
display: flex;
|
|
643
643
|
flex-direction: column;
|
|
644
644
|
gap: 12px;
|
|
645
645
|
padding: 16px;
|
|
646
646
|
max-height: 60vh;
|
|
647
647
|
overflow-y: auto;
|
|
648
|
-
`,
|
|
648
|
+
`,Ep=m.div`
|
|
649
649
|
display: flex;
|
|
650
650
|
align-items: center;
|
|
651
651
|
gap: 8px;
|
|
652
652
|
padding: 12px 16px;
|
|
653
653
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
654
|
-
`,
|
|
654
|
+
`,Ip=m.div`
|
|
655
655
|
display: flex;
|
|
656
656
|
align-items: center;
|
|
657
657
|
gap: 8px;
|
|
658
658
|
margin-left: auto;
|
|
659
|
-
`,
|
|
659
|
+
`,Ap=()=>{const o=f(),{sourcesApi:l,namespacesApi:r}=sl(),c=l.useSources().items,d=r.useNamespaces().items,{selectedStreamName:u}=Ge(),{getItemSS:p,setItemSS:h,removeItemSS:g}=Sa(),{namespaces:m,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:w,clearAll:x,getEmptyState:T}=ba(),k=a(()=>va(c,u),[c,u]);n(()=>{const e=p(ya.OVERVIEW_FILTERS,T());w(e)},[]);const[$,E]=s({namespaces:m,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[I,A]=s(wp($)),[N,O]=s(!1);n(()=>{if(!N){const e={namespaces:m,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};E(e),A(wp(e))}},[N,m,b,v,y,C,S]);const R=i(null);uo(R,()=>O(!1)),zo({key:"Escape",active:N},()=>O(!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]),P=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]),F=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:Xe[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[k]),L=a(()=>Ca.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),_=a(()=>{const e=new Set,t=[];return k.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Ft(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[k]),z=(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})},M=N?Si:wi,B=a(()=>Sp($.languages),[$.languages]);return e(xp,{ref:R,children:[e(Tp,{"data-id":"filters-trigger",$isOpen:N,type:"button",onClick:()=>O(e=>!e),children:[t(el,{size:16,fill:o.v2.colors.white[500]}),t(ae,{size:le.XS,weight:500,nowrap:!0,children:"Filters"}),I>0&&t(Be,{label:I,status:ft.Unknown,textSize:le.XXXS}),t(M,{size:16,fill:o.v2.colors.silver[200]})]}),N&&e(kp,{children:[e($p,{children:[t(lt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Sp($.namespaces),setValues:e=>z("namespaces",D,e)}),t(lt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:Sp($.kinds),setValues:e=>z("kinds",P,e)}),t(lt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:B,setValues:e=>z("languages",F,e)}),t(lt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:Sp($.monitors),setValues:e=>z("monitors",L,e)}),t(lt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:Sp($.podsAgentInjectionStatus),setValues:e=>z("podsAgentInjectionStatus",_,e)}),t(Q,{label:"Show only sources with errors",size:vt.L,value:!!$.onlyErrors,onChange:e=>E(t=>({...t,onlyErrors:e}))})]}),e(Ep,{children:[t(re,{"data-id":"filters-reset",size:ce.S,variant:de.Text,label:"Reset",onClick:()=>{g(ya.OVERVIEW_FILTERS),x(),E(T()),A(0),O(!1)},textColor:o.v2.colors.red[500]}),e(Ip,{children:[t(re,{"data-id":"filters-cancel",size:ce.S,variant:de.Secondary,label:"Cancel",onClick:()=>O(!1)}),t(re,{"data-id":"filters-apply",size:ce.S,variant:de.Primary,label:"Apply",onClick:()=>{h(ya.OVERVIEW_FILTERS,$),w($),A(wp($)),O(!1)}})]})]})]})]})},Np=m.div`
|
|
660
660
|
position: relative;
|
|
661
661
|
display: flex;
|
|
662
662
|
align-items: center;
|
|
@@ -667,7 +667,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
667
667
|
box-sizing: border-box;
|
|
668
668
|
border-radius: 16px 16px 0 0;
|
|
669
669
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
670
|
-
`,
|
|
670
|
+
`,Op=m.div`
|
|
671
671
|
position: absolute;
|
|
672
672
|
bottom: 0;
|
|
673
673
|
left: 0;
|
|
@@ -676,7 +676,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
676
676
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
677
677
|
border-radius: 32px;
|
|
678
678
|
transition: width 0.3s;
|
|
679
|
-
`,
|
|
679
|
+
`,Rp=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:s,allSelected:r,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Ho();return e(Np,{children:[e(se,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Y,{size:wa.S,partiallyChecked:s,value:!!r,onChange:c}),t(ae,{size:le.S,nowrap:!0,children:`${Ft(o)}s`}),t(Be,{label:n,tooltip:a,status:ft.Unknown,textSize:le.XXXS})]}),e(se,{children:[t(st,{"data-id":`add-${o}`,icon:ci,onClick:()=>u(o)}),t(st,{"data-id":`refresh-${o}`,icon:Ri,onClick:l,disabled:i})]}),"number"==typeof d&&t(Op,{$percent:d})]})},Dp=m(W)`
|
|
680
680
|
align-items: center !important;
|
|
681
681
|
justify-content: center !important;
|
|
682
682
|
align-self: stretch;
|
|
@@ -691,7 +691,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
691
691
|
&:hover {
|
|
692
692
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
693
693
|
}
|
|
694
|
-
`,
|
|
694
|
+
`,Pp=({entityType:o,description:n})=>{const{setCurrentModal:a}=Ho();return e(Dp,{onClick:()=>a(o),children:[e(se,{$gap:4,children:[t(ci,{size:16}),t(ae,{size:le.S,children:`Add ${Ft(o)}`})]}),t(ae,{size:le.XXS,align:"center",children:n})]})},Fp=m.div`
|
|
695
695
|
display: flex;
|
|
696
696
|
align-items: center;
|
|
697
697
|
gap: 12px;
|
|
@@ -706,10 +706,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
706
706
|
&:hover {
|
|
707
707
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
708
708
|
}
|
|
709
|
-
`,
|
|
709
|
+
`,Lp=m(se)`
|
|
710
710
|
flex: 1;
|
|
711
711
|
min-width: 0;
|
|
712
|
-
`,
|
|
712
|
+
`,_p=({entityId:o,entityType:n,title:i,status:l,faded:s,tooltip:r,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:g})=>{const m=f(),b=n===mt.Source,v="boolean"==typeof h,y=s||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=eo(),{selectedSources:w,setSelectedSources:x}=xa(),T=g,k=b?T.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind):-1},[b,w,k,T.id]),E=v&&!h?Ta(Ee.Info,m):l?Ta(l,m):void 0,I=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(Fp,{"data-id":I,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(Y,{size:wa.S,value:-1!==$,onChange:()=>{const e={...w};e[k]||(e[k]=[]),-1===$?e[k].push(T):e[k].splice($,1),x(e)}}),t(ao,{icons:u,icon:d,iconSrc:p}),e(Lp,{$gap:4,children:[t(Se,{size:le.XS,nowrap:!0,children:i}),t(se,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(De,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Be,{label:c,status:l&&[Ee.Error,Ee.Warning].includes(l)?l:ft.Unknown,leftIcon:E,textSize:le.XXXS})})})]})]})};function zp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Kt.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Ut.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Mp(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Kt.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Bp=m.div`
|
|
713
713
|
position: absolute;
|
|
714
714
|
top: 0;
|
|
715
715
|
left: 0;
|
|
@@ -720,22 +720,22 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
720
720
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
721
721
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
722
722
|
pointer-events: none;
|
|
723
|
-
`,
|
|
723
|
+
`,Xp=m.div`
|
|
724
724
|
display: flex;
|
|
725
725
|
align-items: center;
|
|
726
726
|
gap: 8px;
|
|
727
727
|
padding: 4px 8px 0;
|
|
728
|
-
`,
|
|
728
|
+
`,Vp=m.div`
|
|
729
729
|
flex: 1;
|
|
730
730
|
height: 1px;
|
|
731
731
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
732
|
-
`,
|
|
732
|
+
`,Up=({namespace:e})=>{const o=f();return t(Bp,{children:t(ae,{size:le.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},Hp=({namespace:o})=>{const n=f();return e(Xp,{children:[t(Vp,{}),t(ae,{size:le.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Vp,{})]})},Gp={[mt.InstrumentationRule]:He.NO_DATA_INSTRUMENTATION_RULES,[mt.Source]:He.NO_DATA_SOURCES,[mt.Action]:He.NO_DATA_ACTIONS,[mt.Destination]:He.NO_DATA_DESTINATIONS},jp=m.div`
|
|
733
733
|
display: flex;
|
|
734
734
|
flex-direction: column;
|
|
735
735
|
flex: 1 0 0;
|
|
736
736
|
min-width: 0;
|
|
737
737
|
${({$isVm:e})=>e?"width: 45vw;":""}
|
|
738
|
-
`,
|
|
738
|
+
`,Wp=m.div`
|
|
739
739
|
display: flex;
|
|
740
740
|
flex-direction: column;
|
|
741
741
|
align-items: stretch;
|
|
@@ -745,7 +745,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
745
745
|
border-radius: 0 0 16px 16px;
|
|
746
746
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
747
747
|
overflow: hidden;
|
|
748
|
-
`,
|
|
748
|
+
`,Kp=m.div`
|
|
749
749
|
position: relative;
|
|
750
750
|
display: flex;
|
|
751
751
|
flex-direction: column;
|
|
@@ -757,7 +757,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
757
757
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
758
758
|
height: ${({$height:e})=>e}px;
|
|
759
759
|
overflow: hidden;
|
|
760
|
-
`,
|
|
760
|
+
`,Yp=(e,t,o)=>{const n=Tt(e);if(!n)return null;const a=t===mt.Source;let i,l,s=!1,r=e;if(a){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Ut.Failure:return{status:Ee.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Ut.Notice:return{status:Ee.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Ut.Pending:case Ut.Waiting:return{status:void 0,faded:!1,displaySource:zp(e)};case Ut.Unsupported:case Ut.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Mp(e)}}}(e);i=t.status,s=t.faded,l=t.tooltip,r=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=$a(e.conditions);i=t,s=o}const c=Ea(e,t,{extended:a,prioritizeDisplayName:!a});let d,u,p,h,g;switch(t){case mt.Source:{d=no(e),u=Aa(mt.Source);const t=o?.get(Ia(n));h=so(t);break}case mt.Destination:{const t=ut(e.destinationType.type);u=t.icon,p=t.iconSrc;const a=o?.get(Ia(n));h=so(a),g=!e.disabled;break}case mt.Action:u=At(e.type),g=!e.disabled;break;case mt.InstrumentationRule:u=Mt(e.type),g=!e.disabled}return{key:Ia(n),entityId:n,namespace:a?e.id.namespace:void 0,raw:r,itemProps:{entityId:n,entityType:t,title:c,status:i,faded:s,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:g,raw:r}}},Jp=({entityType:o,entities:i,unfilteredCount:r,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),g=o===mt.Source,m=i.length!==r,f=Ct(e=>g?e.progress[xt.Instrumenting]?.percentage:void 0),b=Ct(e=>g?e.progress[xt.Uninstrumenting]?.percentage:void 0),v=!g||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=xa(),w=a(()=>g?Object.values(C).reduce((e,t)=>e+t.length,0):0,[g,C]),x=a(()=>{if(!c)return;const e=new Map,t=o===mt.Source?c.sources:o===mt.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(ka(o),o.throughput);return e},[c,o]),T=a(()=>i.map(e=>Yp(e,o,x)).filter(Boolean),[i,o,x]),[k,$]=s(""),{elements:E,indexToNamespace:I,multipleNs:A,dividerCount:N}=a(()=>{const e=[],o=[],n=new Set(T.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const n of T)g&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(Hp,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(_p,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[T,g]);n(()=>{if(g&&I.length&&!k){const e=I.find(Boolean);e&&$(e)}},[g,I]);const O=l(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==k&&$(t)},[I,k]);if(h&&[mt.InstrumentationRule,mt.Action].includes(o))return null;const R=58*T.length+(A?28:0)+32*N,D=Math.max(0,u-52-16),P=Math.min(D,R)+8,F="number"==typeof v?`${v}%`:m?`${i.length}/${r}`:r;return e(jp,{$isVm:h,children:[t(Rp,{entityType:o,badge:F,badgeTooltip:m?He.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&i?.length!==w,allSelected:w>0&&i?.length===w,onSelectAll:g?e=>{if(g)if(e){const e={};i?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(Wp,{children:i.length?e(Kp,{$height:P,children:[A&&k&&t(Up,{namespace:k}),t(Qt,{gap:4,elements:E,onTopIndexChange:A?O:void 0})]}):d?t(lo,{size:3}):t(Pp,{entityType:o,description:Gp[o]??He.TO_COLLECT_OTEL_DATA})})]})},qp=m.div`
|
|
761
761
|
width: 100%;
|
|
762
762
|
flex: 1;
|
|
763
763
|
min-height: 0;
|
|
@@ -765,10 +765,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
765
765
|
display: flex;
|
|
766
766
|
align-items: stretch;
|
|
767
767
|
gap: 16px;
|
|
768
|
-
`,
|
|
768
|
+
`,Zp={sources:[],destinations:[]},Qp=()=>{const o=ba(),{selectedStreamName:n}=Ge(),{containerRef:i,containerHeight:l}=Na(),{sourcesApi:s,destinationsApi:r,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=sl(),{items:p,loading:h}=s.useSources(),{items:g,loading:m}=r.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=eo(e=>e.drawerType),S=Ho(e=>e.currentModal),{data:w}=u.useMetrics({skip:!(p.length&&g.length&&!C&&!S),pollInterval:1e4,fetchPolicy:"network-only"}),x=w?.getOverviewMetrics??Zp,T=a(()=>va(p,n),[p,n]),k=a(()=>Dt(g,n),[g,n]),$=a(()=>Oa(T,o),[T,o]),E=a(()=>Ra(k,o),[k,o]),I=a(()=>Da(f,o),[f,o]);return e(qp,{ref:i,children:[t(Jp,{entityType:mt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(Jp,{entityType:mt.Source,entities:$,unfilteredCount:T.length,metrics:x,loading:h,maxHeight:l,refetch:s.fetchAll}),t(Jp,{entityType:mt.Action,entities:I,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(Jp,{entityType:mt.Destination,entities:E,unfilteredCount:k.length,metrics:x,loading:m,maxHeight:l,refetch:r.fetchAll})]})},eh="40vw",th=m.div`
|
|
769
769
|
position: relative;
|
|
770
|
-
width: ${
|
|
771
|
-
`,
|
|
770
|
+
width: ${eh};
|
|
771
|
+
`,oh=m.div`
|
|
772
772
|
position: absolute;
|
|
773
773
|
top: calc(100% + 8px);
|
|
774
774
|
left: 0;
|
|
@@ -777,23 +777,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
777
777
|
flex-direction: column;
|
|
778
778
|
gap: 8px;
|
|
779
779
|
padding: 8px;
|
|
780
|
-
width: calc(${
|
|
780
|
+
width: calc(${eh} - 16px);
|
|
781
781
|
border-radius: 12px;
|
|
782
782
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
783
783
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
784
|
-
`,
|
|
784
|
+
`,nh=m.div`
|
|
785
785
|
display: flex;
|
|
786
786
|
align-items: center;
|
|
787
787
|
overflow-x: auto;
|
|
788
|
-
`,
|
|
788
|
+
`,ah=m.div`
|
|
789
789
|
display: flex;
|
|
790
790
|
flex-direction: column;
|
|
791
791
|
gap: 0;
|
|
792
792
|
max-height: 60vh;
|
|
793
793
|
overflow-y: auto;
|
|
794
|
-
`,
|
|
794
|
+
`,ih=m.div`
|
|
795
795
|
padding: 8px 12px 4px 12px;
|
|
796
|
-
`,
|
|
796
|
+
`,lh=m.div`
|
|
797
797
|
display: flex;
|
|
798
798
|
align-items: center;
|
|
799
799
|
gap: 8px;
|
|
@@ -803,12 +803,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
803
803
|
&:hover {
|
|
804
804
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
805
805
|
}
|
|
806
|
-
`,
|
|
806
|
+
`,sh=m.div`
|
|
807
807
|
padding: 16px 8px;
|
|
808
|
-
`,
|
|
808
|
+
`,rh=({preventPopup:o=!1})=>{const n=f(),{onClickNode:l}=Pa(),{searchText:c,setSearchText:d}=ba(),{selectedStreamName:u}=Ge(),{sourcesApi:p,destinationsApi:h,actionsApi:g,instrumentationRulesApi:m}=sl(),b=p.useSources().items,v=h.useDestinations().items,y=g.useActions().items,C=m.useRules().items,S=i(null),[w,x]=s(!1),[T,k]=s("all"),$=!o&&(!!c||w),E=()=>{d(""),x(!1),k("all")};uo(S,()=>E()),zo({key:"Escape",active:$},E);const{categories:I,searchResults:A}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,s=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,r=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:mt.Source,label:"Sources",count:s.length,entities:[]},{category:mt.Action,label:"Actions",count:r.length,entities:[]},{category:mt.Destination,label:"Destinations",count:c.length,entities:[]},{category:mt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+s.length+r.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===mt.InstrumentationRule?l:e.category===mt.Source?s:e.category===mt.Action?r:e.category===mt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:C,sources:va(b,u),actions:y,destinations:Dt(v,u),searchText:c,selectedCategory:T}),[C,b,y,v,u,c,T]),N=a(()=>I.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[I]),O=A.some(({entities:e})=>e.length>0);return e(th,{ref:S,children:[t(Zt,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>x(!0),width:eh}),$&&e(oh,{children:[N.length>1&&t(nh,{children:t(ue,{options:N,selected:T,setSelected:k})}),O?t(ah,{children:A.map(({category:o,label:a,entities:i},s)=>{if(!i.length)return null;const c=Aa(o);return e(r,{children:[t(ih,{children:t(ae,{size:le.XXS,color:ie.Secondary,children:a})}),i.map((a,i)=>e(lh,{onClick:()=>{const e=Tt(a);l(null,{data:{type:o,id:e}}),E()},children:[c&&t(c,{size:16,fill:n.v2.colors.white[500]}),t(ae,{size:le.XS,nowrap:!0,children:Ea(a,o,{extended:!0})})]},`entity-${s}-${i}`))]},`category-list-${o}`)})}):t(sh,{children:t(Ce,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},ch=({onRedirectToSampling:n})=>{const{currentModal:i,setCurrentModal:l}=Ho(),{drawerType:s,drawerEntityId:r,setDrawerType:c,setDrawerEntityId:d}=eo(),{sourcesApi:u}=sl(),{items:p}=u.useSources(),h=()=>{l(""),c(null),d(null)},g=a(()=>p.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[p]),m=a(()=>Array.from(new Set(p.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[p]);return e(o,{children:[t(lu,{}),i===mt.Source&&t(Vl,{children:t(Lr,{onClose:h,withOverlay:!0})}),i===mt.Destination&&t(Ul,{children:t(mr,{onClose:h,withOverlay:!0})}),i===mt.InstrumentationRule&&t(Gl,{sourceOptions:g,namespaceOptions:m,children:t(fr,{onClose:h,withOverlay:!0})}),i===mt.Action&&t(Hl,{children:t(ir,{onClose:h,withOverlay:!0})}),s===mt.Source&&r&&t(jl,{children:t(Rd,{onClose:h,sourceId:r,onRedirectToSampling:n})}),s===mt.Destination&&r&&t(Ul,{children:t(Xr,{onClose:h,destinationId:r})}),s===mt.InstrumentationRule&&r&&t(Gl,{sourceOptions:g,namespaceOptions:m,children:t(Ur,{onClose:h,ruleId:r})}),s===mt.Action&&r&&t(Hl,{children:t(zr,{onClose:h,actionId:r})})]})},dh=e=>`Data Stream: ${e}`,uh="Search streams...",ph="No streams match",hh=m.div`
|
|
809
809
|
position: relative;
|
|
810
810
|
display: inline-flex;
|
|
811
|
-
`,
|
|
811
|
+
`,gh=m.div`
|
|
812
812
|
display: inline-flex;
|
|
813
813
|
align-items: center;
|
|
814
814
|
gap: 6px;
|
|
@@ -819,7 +819,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
819
819
|
&:hover {
|
|
820
820
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
821
821
|
}
|
|
822
|
-
|
|
822
|
+
`,mh=m.div`
|
|
823
823
|
position: absolute;
|
|
824
824
|
top: calc(100% + 8px);
|
|
825
825
|
left: 0;
|
|
@@ -833,18 +833,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
833
833
|
border-radius: 12px;
|
|
834
834
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
835
835
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
836
|
-
`,
|
|
836
|
+
`,fh=m.div`
|
|
837
837
|
display: flex;
|
|
838
838
|
align-items: center;
|
|
839
839
|
gap: 8px;
|
|
840
840
|
width: 100%;
|
|
841
|
-
`,
|
|
841
|
+
`,bh=m.div`
|
|
842
842
|
display: flex;
|
|
843
843
|
flex-direction: column;
|
|
844
844
|
gap: 0;
|
|
845
845
|
max-height: 240px;
|
|
846
846
|
overflow-y: auto;
|
|
847
|
-
`,
|
|
847
|
+
`,vh=m.div`
|
|
848
848
|
display: flex;
|
|
849
849
|
align-items: center;
|
|
850
850
|
gap: 8px;
|
|
@@ -855,29 +855,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
855
855
|
&:hover {
|
|
856
856
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
857
857
|
}
|
|
858
|
-
`,
|
|
858
|
+
`,yh=m.div`
|
|
859
859
|
flex: 1;
|
|
860
860
|
min-width: 0;
|
|
861
861
|
overflow: hidden;
|
|
862
862
|
text-overflow: ellipsis;
|
|
863
863
|
white-space: nowrap;
|
|
864
|
-
`,
|
|
864
|
+
`,Ch=m.div`
|
|
865
865
|
display: flex;
|
|
866
866
|
align-items: center;
|
|
867
867
|
gap: 2px;
|
|
868
868
|
flex-shrink: 0;
|
|
869
|
-
`,
|
|
869
|
+
`,Sh=m.div`
|
|
870
870
|
display: flex;
|
|
871
871
|
padding-top: 4px;
|
|
872
872
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
873
|
-
`,
|
|
873
|
+
`,wh=()=>{const l=f(),{isVm:r}=y(),{clearStore:c}=Fa(),{dataStreamsApi:d}=sl();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=Ge(),g=i(null),[m,b]=s(!1),[v,C]=s(""),[S,w]=s(""),[x,T]=s(!1),[k,$]=s(!1),[E,I]=s(!1),[A,N]=s(""),[O,R]=s(!1);uo(g,()=>b(!1)),n(()=>{m||C("")},[m]);const D=a(()=>{if(!v)return u;const e=v.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,v]),P=m?Si:wi;return r?null:e(o,{children:[e(hh,{ref:g,children:[e(gh,{"data-id":"data-stream-select",$isOpen:m,onClick:()=>b(e=>!e),children:[t(tl,{size:24}),t(ae,{size:le.S,weight:500,nowrap:!0,children:dh(p)}),t(Be,{label:u.length,status:ft.Unknown,textSize:le.XXXS}),t(P,{size:20,fill:l.v2.colors.silver[200]})]}),m&&e(mh,{children:[t(fh,{children:t(Zt,{value:v,onChange:C,placeholder:uh,width:"100%"})}),t(bh,{children:0===D.length?t(vh,{children:t(ae,{size:le.XS,color:ie.Secondary,children:ph})}):D.map(({name:o})=>{const n=o===La;return e(vh,{"data-id":`stream-row-${o}`,$selected:o===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),b(!1)})(o),children:[t(yh,{children:t(ae,{size:le.XS,nowrap:!0,children:o})}),e(Ch,{children:[t(st,{"data-id":`stream-edit-${o}`,icon:mi,size:rt.XS,onClick:e=>{e.stopPropagation(),b(!1),w(o),T(!0)}}),!n&&t(st,{"data-id":`stream-delete-${o}`,icon:ri,size:rt.XS,onClick:e=>{e.stopPropagation(),b(!1),N(o),R(!0)}})]})]},`stream-${o}`)})}),t(Sh,{children:t(re,{"data-id":"add-stream-trigger",variant:de.Secondary,size:ce.S,leftIcon:ci,label:`${kt.NEW} ${He.STREAM_NAME}`,fullWidth:!0,onClick:()=>{b(!1),c(),I(!0),$(!0)}})})]})]}),E&&t(Wl,{defaultExcludeName:p,children:t(tu,{isOpen:k,onClose:()=>$(!1),onCloseEnd:()=>I(!1)})}),S&&t(Wl,{children:t(ou,{isOpen:x,dataStreamName:S,onClose:()=>T(!1),onCloseEnd:()=>w("")})}),t(wl,{target:`${He.STREAM_NAME.toLowerCase()} "${A}"`,isOpen:O,onClose:()=>R(!1),onApprove:async()=>{A&&await d.remove(A)}})]})},xh="multi-source-deselect",Th="multi-source-restart",kh="multi-source-uninstrument",$h="Selected sources",Eh="Deselect",Ih="Restart",Ah="Uninstrument",Nh="Rollout Restart Workloads",Oh="Are you sure you want to rollout restart these workloads?",Rh="Go Back",Dh="Confirm",Ph=()=>{const{selectedStreamName:i}=Ge(),{selectedSources:r,setSelectedSources:c}=xa(),{sourcesApi:d}=sl(),[u,p]=s(!1),[h,g]=s(!1),m=a(()=>Object.values(r).reduce((e,t)=>e+t.length,0),[r]),f=l(()=>{c({})},[c]),b=l(()=>p(!1),[]),v=l(()=>g(!1),[]);n(()=>{f()},[i,f]);const y=l(()=>{d.restartWorkloads(Object.values(r).flat().filter(e=>e.id.kind!==io.StaticPod).map(to)),f()},[d,r,f]),C=l(()=>{d.persistV2(Object.fromEntries(Object.entries(r).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:i}))]))),f()},[d,r,i,f]),S=a(()=>[{id:xh,type:qt.Button,buttonProps:{variant:de.Text,size:ce.S,label:Eh,onClick:f}},{id:Th,type:qt.Button,buttonProps:{variant:de.Secondary,size:ce.S,label:Ih,leftIcon:Gi,onClick:()=>p(!0)}},{id:kh,type:qt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:Ah,leftIcon:ri,onClick:()=>g(!0)}}],[f]);return e(o,{children:[t(ma,{isOpen:m>0,richTitle:{icon:$i,title:$h,badge:{label:m}},actions:S}),t(Ue,{isOpen:u,title:Nh,description:Oh,onClose:b,denyButton:{label:Rh,variant:de.Secondary,onClick:b},approveButton:{label:Dh,variant:de.Primary,onClick:()=>{y(),b()}}}),t(wl,{isOpen:h,action:"uninstrument",target:`${m} source${1===m?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},Fh=v`
|
|
874
874
|
0% {
|
|
875
875
|
background-position: 200% 50%;
|
|
876
876
|
}
|
|
877
877
|
100% {
|
|
878
878
|
background-position: 0% 50%;
|
|
879
879
|
}
|
|
880
|
-
`,
|
|
880
|
+
`,Lh=m.div`
|
|
881
881
|
display: flex;
|
|
882
882
|
align-items: center;
|
|
883
883
|
justify-content: space-evenly;
|
|
@@ -888,50 +888,50 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
888
888
|
|
|
889
889
|
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%)`};
|
|
890
890
|
background-size: 200% 100%;
|
|
891
|
-
animation: ${
|
|
892
|
-
`,
|
|
891
|
+
animation: ${Fh} 15s linear infinite;
|
|
892
|
+
`,_h=[ki,$i,yi,Ci],zh=({onRedirectToSampling:o})=>{const n=f();return e(ga,{children:[e(et,{fullHeight:!0,customTitle:t(wh,{}),customSearch:t(rh,{}),filters:t(Ap,{}),children:[t(Lh,{children:_h.map((o,a)=>e(r,{children:[t(o,{size:24}),a<_h.length-1&&t(vi,{fill:n.v2.colors.white[500]+ot["020"],size:24})]},o.name))}),t(Qp,{})]}),t(ch,{onRedirectToSampling:o}),t(Ph,{})]})};var Mh;!function(e){e.Gateway="gateway",e.Node="node"}(Mh||(Mh={}));const Bh=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const s=a(()=>{const e=[];return o&&e.push({id:Uo(),type:qt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Hi,size:ce.S,variant:de.Text,onClick:o,disabled:l}}),n&&e.push({id:Uo(),type:qt.Button,buttonProps:{label:"Refresh",leftIcon:Ri,size:ce.S,variant:de.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(se,{$alignItems:"center",$justifyContent:"space-between",children:[t(_a,{icon:ol,title:"Collectors Pipeline"}),t(za,{actions:s})]})},Xh=({pod:o,onClose:n})=>{const{formatTimeAgo:i}=Bt(),{collectorsApi:l}=sl(),{data:s}=l.usePodInfo(o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),r=a(()=>[{id:Uo(),title:"Node",label:s?.node??"-",withCopy:!0},{id:Uo(),title:"Status",badge:{status:Ma(s?.status),label:s?.status??"-"}}],[s]),c=a(()=>s?.containers?.map(e=>({id:Uo(),items:[{id:Uo(),title:"Container",label:e.name??"-"},{id:Uo(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:Uo(),title:"Ready",badge:{status:e.ready?Ee.Success:Ee.Error,leftIcon:e.ready?ui:pi,label:e.ready?"True":"False",invertColors:!0}},{id:Uo(),title:"Started",badge:{status:e.started?Ee.Success:Ee.Error,leftIcon:e.started?ui:pi,label:e.started?"True":"False",invertColors:!0}},{id:Uo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Uo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Uo(),title:He.RESTARTS,label:e.restarts.toString()},{id:Uo(),title:"State Reason",label:e.stateReason??"-"},{id:Uo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Uo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[s]);return t(oe,{isOpen:!!o,header:{icon:Ai,title:"Pod Information",onClose:n},children:s?e(Et,{bgTint:"1000",richTitle:{icon:Ai,title:s.name,withCopy:!0},children:[t(Et,{bgTint:"900",cellsPerRow:2,items:r}),e(Et,{bgTint:"900",richTitle:{icon:zi,title:He.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(Jt,{value:`kubectl get pod ${s.name} -n ${s.namespace} -o yaml`}),t(Jt,{value:`kubectl describe pod ${s.name} -n ${s.namespace}`}),t(Jt,{value:`kubectl logs ${s.name} -n ${s.namespace}`})]}),t(Et,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:o})=>t(Et,{bgTint:"800",cellsPerRow:2,items:o},e)):t(Ce,{title:"No containers",subTitle:"Pod has no containers"})}),t(Tl,{bgTint:"900",yaml:s.manifestYAML,defaultOpen:!0})]}):t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})})})};var Vh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(Vh||(Vh={}));const Uh=e=>{const t=[{key:Vh.PodName,label:"Pod Name"},{key:Vh.Status,label:"Status"},{key:Vh.Restarts,label:He.RESTARTS},{key:Vh.NodeName,label:"Node Name"},{key:Vh.Age,label:"Age"},{key:Vh.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Vh.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Hh=({isLoading:o,pods:n,withSpanDropRate:i})=>{const l=f(),{formatTimeAgo:r}=Bt(),[c,d]=s(null),u=a(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:Vh.PodName,rawValue:o.name},{key:Vh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Be,{status:Ma(e),label:e});var e}},{key:Vh.Restarts,rawValue:o.restartsCount.toString()},{key:Vh.NodeName,rawValue:o.nodeName},{key:Vh.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(ae,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?Ee.Error:Ee.Success,s=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),r=s>0?Math.round((n?.exporterFailedRps??0)/s*100):0,c=r>0?Ee.Error:Ee.Success;return e(se,{$gap:4,children:[t(De,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Be,{status:l,label:`Receiver ${i}%`,leftIcon:l===Ee.Error?nl:al,useSecondaryTone:!0,invertColors:!0})}),t(De,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Be,{status:c,label:`Exporter ${r}%`,leftIcon:c===Ee.Error?nl:al,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Vh.Age,rawValue:r(o.creationTimestamp)},{key:Vh.DockerImage,rawValue:o.image}]})),[n,l]);return e(Et,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Ai,title:"Pods"},children:[t(vo,{variant:yo.Data,isLoading:o,columns:Uh(i),rows:u}),t(Xh,{pod:c,onClose:()=>d(null)})]})},Gh=({isOpen:e,onClose:o,title:n,yaml:a})=>t(oe,{isOpen:e,header:{icon:il,title:n,onClose:o},children:t(Tl,{yaml:a,defaultOpen:!0})}),jh=e=>{switch(e){case Ba.Healthy:return"All desired replicas are updated, available, and ready";case Ba.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Ba.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Ba.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Ba.Down:return"No available replicas";case Ba.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Wh;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Wh||(Wh={}));const Kh=m.div`
|
|
893
893
|
flex: 0.5;
|
|
894
894
|
padding: 12px;
|
|
895
895
|
border-radius: 12px;
|
|
896
896
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
897
|
-
`,
|
|
897
|
+
`,Yh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=Bt(),[c,d]=s(null),u=a(()=>(e=>{switch(e){case Mh.Gateway:return"Deployment";case Mh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=a(()=>((e,t,o,n)=>{const a={status:ft.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case Mh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Mh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:Ee.Info,label:"Rollout in progress",rightIcon:Ri,useSecondaryTone:!0}:l?{status:ft.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,i,r),[n,i,o,r]),h=a(()=>((e,t,o,n)=>{let a=n?Ee.Info:ft.Unknown,i=n?"Loading":Ba.Unknown,l=n?"Fetching data...":jh(Ba.Unknown);switch(e){case Mh.Gateway:a=t?.status?Ma(t?.status):a,i=t?.status??i,l=t?.status?jh(t.status):l;break;case Mh.Node:a=o?.status?Ma(o?.status):a,i=o?.status??i,l=o?.status?jh(o.status):l}return{status:a,title:i,description:l}})(o,n,i,l),[n,i,o,l]),g=a(()=>((e,t,o)=>{switch(e){case Mh.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 Mh.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),m=a(()=>((e,t,o,n)=>{switch(e){case Mh.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 Mh.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===Mh.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Mh.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(Et,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:il,title:u,badge:p},actions:[{id:Uo(),type:qt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Wh.ManifestYaml,label:u,icon:ll},{id:Wh.ConfigMapYaml,label:"ConfigMap",icon:ll}]}}],children:[e(se,{$gap:16,children:[t("div",{children:t(Xa,{...h})}),g.map(e=>t(Kh,{children:t("div",{children:t(Va,{...e})})},e.title)),m.map(e=>t(Ua,{...e},e.title))]}),t(Gh,{isOpen:c===Wh.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(Gh,{isOpen:c===Wh.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Jh=[{value:Mh.Gateway,label:"Gateway"},{value:Mh.Node,label:"Node Collector"}],qh=({minSupportedVersion:o=0})=>{const{isVersionSupported:n,version:i}=y(o),[r,c]=s(Mh.Gateway),d=r===Mh.Gateway,u=r===Mh.Node,{collectorsApi:p,configApi:h}=sl(),{data:g}=h.useEffectiveConfig(),{data:m,loading:f,refetch:b}=p.useGatewayInfo({skip:!d}),{data:v=[],loading:C,refetch:S}=p.useGatewayPods({skip:!d}),{data:w,loading:x,refetch:T}=p.useNodeCollectorInfo({skip:!u}),{data:k=[],loading:$,refetch:E}=p.useNodeCollectorPods({skip:!u}),I=d&&(f||C)||u&&(x||$),A=l(()=>{d?(b(),S()):u&&(T(),E())},[d,u,b,S,T,E]),N=a(()=>d?v:k,[v,k,d]);return e(ga,{children:[t(Bh,{disabled:!n,loading:I,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e(Ha,{children:[e(W,{children:[t(ue,{variant:fo.Underline,size:we.L,options:Jh,selected:r,setSelected:c}),t(Yh,{selectedTab:r,gatewayInfo:m??null,nodeCollectorInfo:w??null,isLoading:I})]}),t(Hh,{isLoading:I,pods:N,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(El,{minSupportedVersion:o,currentVersion:i||""})]})]})},Zh=m.div`
|
|
898
898
|
display: inline-flex;
|
|
899
899
|
align-items: center;
|
|
900
900
|
min-width: 0;
|
|
901
901
|
overflow: hidden;
|
|
902
902
|
white-space: pre;
|
|
903
903
|
text-overflow: ellipsis;
|
|
904
|
-
`,
|
|
904
|
+
`,Qh=m.div`
|
|
905
905
|
display: flex;
|
|
906
906
|
flex-direction: column;
|
|
907
907
|
gap: 4px;
|
|
908
908
|
min-width: 0;
|
|
909
909
|
flex: 1;
|
|
910
910
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
911
|
-
`,
|
|
911
|
+
`,eg=m(se)`
|
|
912
912
|
flex-shrink: 0;
|
|
913
913
|
gap: 6px;
|
|
914
914
|
align-items: center;
|
|
915
915
|
min-height: 22px;
|
|
916
|
-
`;const
|
|
916
|
+
`;const tg=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],og=[{value:"all",label:ja},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],ng=({title:o,items:n,isLoading:i,showTypeFilter:r,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=f(),[g,m]=s(""),[b,v]=s("all"),y=a(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,b,r);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,g),e},[n,b,r,g]),C=a(()=>y.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(h,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(Qh,{$disabled:o.disabled,children:[t(Zh,{children:t(S,{parts:o.summary})}),o.name&&t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(eg,{children:[o.disabled&&t(Be,{label:Ga,textSize:le.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Be,{label:o.typeBadge,textSize:le.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),w=a(()=>{const e=e=>t(gi,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=l(e=>{const t=C.indexOf(e);if(t<0)return[];const o=y[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:xo,leftIcon:mi,onClick:()=>u(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>p(o.ruleId,o.samplingId)}]:[]},[C,y,u,p,w]);return t(et,{fullHeight:!0,richTitle:{icon:Wi,title:o,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:g,onChange:m,placeholder:"Search..",width:"500px",...r?{segment:{"data-id":"sampling-segment-type-filter",options:og,selected:b,setSelected:v}}:{}},children:t(vo,{variant:yo.Pretty,hideHeader:!0,isLoading:i,noDataProps:g.trim()?{hideIcon:!0,title:Wa,subTitle:Ja(g)}:{hideIcon:!0,title:Ya,button:{label:Ka,onClick:d}},columns:tg,rows:C,getRowActions:x})})},ag=({docsUrl:o})=>{const{samplingApi:r,sourcesApi:c}=sl(),{items:d}=c.useSources(),u=a(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:g,refetch:m}=r.useSamplingRules(),f=l((e,t)=>r.createNoisy?.({samplingId:e,rule:t}),[r]),b=l((e,t,o)=>r.updateNoisy?.(t,{samplingId:e,rule:o}),[r]),v=l((e,t)=>r.createHighlyRelevant?.({samplingId:e,rule:t}),[r]),y=l((e,t,o)=>r.updateHighlyRelevant?.(t,{samplingId:e,rule:o}),[r]),C=l((e,t)=>r.createCostReduction?.({samplingId:e,rule:t}),[r]),S=l((e,t,o)=>r.updateCostReduction?.(t,{samplingId:e,rule:o}),[r]),w=l((e,t,o)=>"noisy"===o?r.deleteNoisy?.(t,e):"highlyRelevant"===o?r.deleteHighlyRelevant?.(t,e):"costReduction"===o?r.deleteCostReduction?.(t,e):void 0,[r]),x=l((e,t)=>r.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[r]),T=a(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[u]),E=a(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[j,K]=s(I.Noisy),[Y,J]=s(null),[q,Z]=s(!1),[Q,ee]=s(!1),[te,oe]=s(null),[ne,ae]=s(!1),[ie,le]=s(!1),[pe,he]=s(!1),[ge,me]=s(!1);i(!1),n(()=>{},[h,p]);const{pendingViewSamplingRule:fe,setPendingViewSamplingRule:be}=eo();n(()=>{if(!fe)return;if(h||0===p.length)return;be(null);const e=A(p,fe.ruleId,fe.category);e&&(K(N[fe.category]),Z(!1),J(e))},[h,p,fe,be]);const ve=a(()=>k(g),[g]),ye=a(()=>O(p),[p]),Ce=a(()=>$(ye?.rule??null),[ye]),Se=a(()=>R(p),[p]),xe=a(()=>D(Se?.rule??null),[Se]),Te=i(Y);Te.current=Y,n(()=>{const e=Te.current;if(!e)return;const t=P(p,e);t?J(t):(J(null),Z(!1))},[p]);const ke=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Ie=a(()=>F(p,j,ke),[p,j,ke]),Ae=l(()=>ee(!0),[]),Ne=l(()=>ee(!1),[]);l(()=>me(!1),[]);const Oe=l(async e=>{const t=p[0]?.id??"default";switch(X[j]){case"noisy":await f(t,z(e));break;case"highlyRelevant":await v(t,_(e));break;case"costReduction":await C(t,L(e))}ee(!1)},[p,j,f,v,C]),Re=l(e=>{const t=M(p,e);t&&(Z(!1),J(t))},[p]),De=l(()=>{J(null),Z(!1)},[]),Pe=l((e,t)=>{const o=Y;if(o&&o.rule.ruleId===e&&o.samplingId===t)Z(!0),J({...o});else for(const o of p){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 Z(!0),void J({category:n.category,rule:n.rule,samplingId:t,summary:B(n.category,n.rule)})}},[Y,p]),Fe=l(async(e,t,o)=>{const n=Y?.category;if(n){switch(n){case"noisy":await b(o,t,z(e));break;case"highlyRelevant":await y(o,t,_(e));break;case"costReduction":await S(o,t,L(e))}Z(!1)}},[Y,b,y,S]),Le=l((e,t)=>{oe({ruleId:e,samplingId:t})},[]),_e=l(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=Y?.category||X[j];await w(t,e,o),J(null),Z(!1),oe(null)},[te,Y,j,w]),ze=l(()=>oe(null),[]),Me=l(async(e,t)=>{await x(e,t),ae(!1)},[x]),Be=l(async e=>{const t=p[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)},[p,ye,v,y]),Xe=l(async(e,t)=>{const o=p[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}),he(!1)},[p,Se,C,S]),Ve=l(e=>{const t=X[j];let o=null;switch(t){case"noisy":{const n=z(e);o=V(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=_(e);o=V(p,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=L(e);o=V(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:qa,ruleId:o}:null},[p,j]),He=l(e=>{const t=Y?.category,o=Y?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const a=z(e);n=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}case"highlyRelevant":{const a=_(e);n=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},o);break}case"costReduction":{const a=L(e);n=V(p,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}}return n?{message:qa,ruleId:n}:null},[p,Y]),Ge=l(e=>{ee(!1);for(const t of p){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 Z(!0),void J({category:o.category,rule:o.rule,samplingId:t.id,summary:B(o.category,o.rule)})}},[p]),We=a(()=>{const e=[];return o&&e.push({id:Uo(),type:qt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Za,leftIcon:hi,size:ce.S,variant:de.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:Uo(),type:qt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Qa,leftIcon:Ri,size:ce.S,variant:de.Text,onClick:m,loading:h}}),e.push({id:Uo(),type:qt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ei,rightIcon:ci,size:ce.S,variant:de.Primary,onClick:Ae}}),e},[o,m,h,Ae]);return e(ga,{children:[e(se,{$gap:12,$justifyContent:"space-between",children:[t(_a,{icon:Wi,title:oi,subTitle:ti}),t(za,{actions:We})]}),e(W,{$gap:12,$fullHeight:!0,children:[t(ue,{variant:fo.Underline,size:we.L,options:U,selected:j,setSelected:K}),e(se,{$justifyContent:"space-between",children:[t($e,{status:Ee.Default,message:H[j]}),o&&t(re,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:hi,size:ce.S,variant:de.Text,onClick:()=>window.open(o,"_blank")})]}),j===I.Noisy?t(pl,{title:qe,summary:ve,onEdit:()=>ae(!0)}):j===I.HighlyRelevant?t(pl,{title:je,summary:Ce,onEdit:()=>le(!0)}):j===I.CostReduction?t(pl,{title:Ye,summary:xe,onEdit:()=>he(!0)}):null,t(ng,{title:G[j],items:Ie,isLoading:h,showTypeFilter:j===I.HighlyRelevant,onRuleClick:Re,onCreateRule:Ae,onEditRule:Pe,onDeleteRule:Le})]}),t(Gd,{formType:Fl.View,data:Y,defaultEditMode:q,onClose:De,onDelete:Le,onSaveEdit:Fe,sourceOptions:T,namespaceOptions:E,validateForm:He,onNavigateToDuplicate:Ge}),t(Gd,{formType:Fl.Create,isOpen:Q,category:X[j],onClose:Ne,onSubmit:Oe,sourceOptions:T,namespaceOptions:E,validateForm:Ve,onNavigateToDuplicate:Ge}),t(Gd,{formType:Fl.EditAutoNoisy,isOpen:ne,enabled:g?.enabled??!1,keepPercentage:g?.keepPercentage??0,onClose:()=>ae(!1),onSave:Me}),t(Gd,{formType:Fl.EditAutoHighlyRelevant,isOpen:ie,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(Gd,{formType:Fl.EditAutoCostReduction,isOpen:pe,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>he(!1),onSave:Xe}),t(Ue,{title:li,description:ii,isOpen:!!te,onClose:ze,denyButton:{label:ai,variant:de.Secondary,onClick:ze},approveButton:{label:ni,variant:de.Primary,onClick:()=>{_e(),ze()}}}),false]})},ig=m.div`
|
|
917
917
|
display: flex;
|
|
918
918
|
align-items: center;
|
|
919
919
|
justify-content: space-between;
|
|
920
920
|
padding: 0 12px;
|
|
921
|
-
`,
|
|
921
|
+
`,lg=({disabled:o,loading:n,tabs:i,selectedTab:l,setSelectedTab:r,onClickReset:c,onClickRefresh:d})=>{const[u,p]=s(!1),h=a(()=>{const e=[];return c&&e.push({id:Uo(),type:qt.Button,buttonProps:{label:"Reset",leftIcon:ri,size:ce.S,variant:de.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Uo(),type:qt.Button,buttonProps:{label:"Refresh",leftIcon:Ri,size:ce.S,variant:de.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(ig,{children:[e(se,{$gap:12,$alignItems:"center",children:[t(_a,{icon:Ii,title:"Odigos Settings"}),t(lt,{width:"350px",options:i,values:[l],setValues:e=>r(e[0]),disabled:o})]}),t(za,{actions:h}),t(Ue,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:de.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:de.Primary,onClick:()=>{c?.(),p(!1)}}})]})},sg=m(se)`
|
|
922
922
|
flex: 1;
|
|
923
923
|
min-height: 0;
|
|
924
924
|
width: 100%;
|
|
925
925
|
align-self: stretch;
|
|
926
|
-
`,
|
|
926
|
+
`,rg=m(W)`
|
|
927
927
|
flex: 1;
|
|
928
928
|
min-height: 0;
|
|
929
929
|
height: 100%;
|
|
930
930
|
overflow-y: auto;
|
|
931
|
-
`,
|
|
931
|
+
`,cg=m(rg)`
|
|
932
932
|
> section {
|
|
933
933
|
min-height: 100%;
|
|
934
934
|
box-sizing: border-box;
|
|
935
935
|
flex-shrink: 0;
|
|
936
936
|
}
|
|
937
|
-
`,
|
|
937
|
+
`,dg=e=>"general"===e.name?0:"advanced"===e.name?2:1,ug=({minSupportedVersion:o=0})=>{const{isVersionSupported:i,version:l,isEnterprise:r}=y(o),{configApi:c}=sl(),{data:d,loading:u}=c.useConfigYamls(),{data:p,loading:h,refetch:g}=c.useEffectiveConfig(),m=d?.configYamls??[],[f,b]=s(!1),v=async()=>{c.resetLocalUiConfigToDefaults&&await c.resetLocalUiConfigToDefaults()},C=a(()=>{if(!p)return{};const{manifestYAML:e,provenance:t,...o}=p;return o},[p]),{formData:S,handleFormChange:w,getNestedValue:x,getFormDiff:T,isFormDirty:k}=Nt(C);n(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(S)&&w(void 0,void 0,C)},[C,S]);const $=a(()=>[...m].sort((e,t)=>dg(e)-dg(t)),[m]),E=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(p?.provenance),[p?.provenance]),I=a(()=>{const e=new Set;for(const t of m)for(const o of t.fields)o.componentType===Rt.Dropdown&&e.add(o.helmValuePath);return e},[m]),A=a(()=>m.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:x("formData",e.helmValuePath)}))),[m,S,x]),[N,O]=s(!1),R=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(T(C,S),I);await(async e=>{c.updateLocalUiConfig&&(b(!0),await c.updateLocalUiConfig(e),b(!1),await g())})(e),w(void 0,void 0,{})},D=a(()=>[{id:Uo(),type:qt.Button,buttonProps:{"data-id":"settings-save",variant:de.Primary,size:ce.S,label:"Save Changes",leftIcon:xi,loading:f,onClick:()=>O(!0)}},{id:Uo(),type:qt.Button,buttonProps:{"data-id":"settings-cancel",variant:de.Secondary,size:ce.S,label:"Cancel",leftIcon:Ti,onClick:()=>w(void 0,void 0,C)}}],[f,T,C,S,w]),P=a(()=>$.map(e=>({id:e.name,label:e.displayName})),[$]),F=a(()=>$.map(e=>e.name),[$]),{selectedSection:L,setSelectedSection:_,setSectionRef:z,setScrollContainerRef:M}=si({sectionNames:F});return e(ga,{$gap:12,children:[t(lg,{disabled:!i,loading:u||h,tabs:P,selectedTab:L,setSelectedTab:_,onClickReset:v?()=>v().then(()=>g?.()):void 0,onClickRefresh:g?()=>g():void 0}),e(Ha,{children:[!i&&t(El,{minSupportedVersion:o,currentVersion:l||""}),t(ma,{isOpen:k,richTitle:{icon:Ii,title:"Config Settings"},actions:D}),t(Ue,{isOpen:N,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>O(!1),denyButton:{label:"Keep editing",variant:de.Secondary,onClick:()=>O(!1)},approveButton:{label:"Save changes",variant:de.Primary,onClick:()=>{R(),O(!1)}}}),e(sg,{$gap:24,$alignItems:"stretch",children:[t(rg,{ref:M,$gap:24,$width:"100%",children:m.length?$.map(o=>t(et,{id:o.name,ref:e=>z(o.name,e),richTitle:{icon:Ii,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!r)return null;if(o.renderCondition&&!ke(o.renderCondition,[],A))return null;const n=ht(o.componentProps||"{}",{}),a=E[o.helmValuePath];return e(W,{$gap:4,children:[t(cl,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?Ee.Warning:ft.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||f,value:x("formData",o.helmValuePath),setValue:e=>w(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t($e,{status:Ee.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):u?t(at,{$height:"30vh",children:t(ct,{withSpinner:!0})}):t(et,{richTitle:{icon:Ii,title:"Config Settings"},children:t(Ce,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(cg,{children:h&&!p?.manifestYAML?t(at,{$height:"30vh",children:t(ct,{withSpinner:!0})}):t(Tl,{title:"Effective Config YAML",yaml:p?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0})})]})]})]})};export{ir as AddActionDrawer,Rs as AddActionForm,tu as AddDataStreamModal,mr as AddDestinationDrawer,Fs as AddDestinationForm,fr as AddRuleDrawer,Us as AddRuleForm,Lr as AddSourceDrawer,lp as CentralConnections,Gs as DataStreamForm,Hs as DataStreamMergeWarning,zr as EditActionDrawer,Mr as EditConfigDrawer,ou as EditDataStreamModal,Xr as EditDestinationDrawer,Ur as EditRuleDrawer,Rd as EditSourceDrawer,js as EditSourceForm,iu as ONBOARDING_DONE_MODAL_ID,Cp as Onboarding,lu as OnboardingDone,zh as Overview,qh as PipelineCollectors,bs as RegexTesterDrawer,ep as SamplingOnboardingModal,Gd as SamplingRuleDrawer,Zs as SamplingRuleForm,ag as SamplingRules,ug as Settings,eu as SystemDrawer,Jh as TABS};
|