@odigos/ui-kit 0.0.267 → 0.0.269
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/lib/chunks/helpers-w7krM8zT.js +9 -0
- package/lib/chunks/index-C8U7vd0v.js +257 -0
- package/lib/chunks/source-instrument-form-context-DS-dr35D.js +5 -0
- package/lib/chunks/{ui-components-Dq_j4_BI.js → ui-components-dsTdscIC.js} +213 -208
- package/lib/components/condition/index.d.ts +6 -18
- package/lib/components.js +1 -1
- package/lib/constants/instrumentation-rules/index.d.ts +1 -0
- package/lib/constants/instrumentation-rules/supported-languages.d.ts +16 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/edit-action-drawer/helpers.d.ts +3 -3
- package/lib/containers/_forms/add-action-form/custom-fields/index.d.ts +3 -0
- package/lib/containers.js +232 -321
- package/lib/contexts/action-form-context.d.ts +8 -2
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/useActionFormData.d.ts +1 -1
- package/lib/hooks/useInstrumentationRuleFormData.d.ts +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/dynamic-field/fields.d.ts +65 -0
- package/lib/snippets/dynamic-field/index.d.ts +2 -27
- package/lib/snippets/dynamic-field/leaf.d.ts +35 -0
- package/lib/snippets.js +1 -1
- package/lib/store/useFilterStore.d.ts +4 -0
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +6 -7
- package/lib/types/common/index.d.ts +25 -1
- package/lib/types/destinations/index.d.ts +2 -6
- package/lib/types/instrumentation-rules/index.d.ts +5 -8
- package/lib/types/workload/index.d.ts +12 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-DUhfkGj1.js +0 -155
- package/lib/chunks/odigos-context-DzuZq_D5.js +0 -9
- package/lib/chunks/source-instrument-form-context-oSSPNkMA.js +0 -5
- package/lib/containers/_forms/add-action-form/dynamic-fields/index.d.ts +0 -21
- package/lib/containers/_forms/add-destination-form/dynamic-fields/index.d.ts +0 -9
package/lib/containers.js
CHANGED
|
@@ -1,106 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEffect as i,
|
|
2
|
-
padding: 8px 16px;
|
|
3
|
-
border-radius: 6px;
|
|
4
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
5
|
-
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
6
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
7
|
-
font-size: 12px;
|
|
8
|
-
line-height: 20px;
|
|
9
|
-
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
10
|
-
word-break: break-all;
|
|
11
|
-
white-space: pre-wrap;
|
|
12
|
-
user-select: text;
|
|
13
|
-
|
|
14
|
-
/* Wraps the background tightly to each visual fragment when a colored
|
|
15
|
-
token gets split across two visual lines. Without this the highlight
|
|
16
|
-
stretches all the way to the right edge of the container. */
|
|
17
|
-
& > span {
|
|
18
|
-
box-decoration-break: clone;
|
|
19
|
-
-webkit-box-decoration-break: clone;
|
|
20
|
-
}
|
|
21
|
-
`,Jr=b.span`
|
|
22
|
-
background: ${({$kind:e})=>Yr[e]};
|
|
23
|
-
`,Zr=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const i=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){i("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){i(e.slice(o,o+2),"class-content"),o+=2;continue}i(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}i(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Wr.has(t)||Kr.has(t))i(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){i(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];Gr.test(t)?i(e.slice(o,o+2),"anchor-quantifier"):i(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(i(t,"literal"),o++):(i("|","alternation"),o++)}else"^"===e[o+1]?(i("[^","class-bracket"),o+=2):(i("[","class-bracket"),o++),n=!0;else i(t,"group"),o++}}return t})(e),[e]);return t(qr,e?{"data-id":o,children:n.map((e,o)=>t(Jr,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},Qr="rgba(102, 191, 255, 0.5)",es=y`
|
|
24
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
25
|
-
font-size: 12px;
|
|
26
|
-
line-height: 20px;
|
|
27
|
-
letter-spacing: 0;
|
|
28
|
-
white-space: pre-wrap;
|
|
29
|
-
word-wrap: break-word;
|
|
30
|
-
overflow-wrap: break-word;
|
|
31
|
-
/* tab-size keeps tabs visually consistent across the two layers — some
|
|
32
|
-
browsers default to 8 on a textarea but 4 on a div. */
|
|
33
|
-
-moz-tab-size: 4;
|
|
34
|
-
tab-size: 4;
|
|
35
|
-
margin: 0;
|
|
36
|
-
`,ts=b.div`
|
|
37
|
-
position: relative;
|
|
38
|
-
width: 100%;
|
|
39
|
-
min-height: ${({$minHeight:e})=>e}px;
|
|
40
|
-
border-radius: 6px;
|
|
41
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
42
|
-
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
43
|
-
|
|
44
|
-
&:hover,
|
|
45
|
-
&:focus-within {
|
|
46
|
-
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
47
|
-
}
|
|
48
|
-
`,os=b.div`
|
|
49
|
-
${es}
|
|
50
|
-
position: absolute;
|
|
51
|
-
inset: 0;
|
|
52
|
-
padding: 12px;
|
|
53
|
-
pointer-events: none;
|
|
54
|
-
color: transparent;
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
|
|
57
|
-
/* Mandatory for backgrounds that wrap across visual lines. */
|
|
58
|
-
& > span {
|
|
59
|
-
box-decoration-break: clone;
|
|
60
|
-
-webkit-box-decoration-break: clone;
|
|
61
|
-
}
|
|
62
|
-
`,ns=b.textarea`
|
|
63
|
-
${es}
|
|
64
|
-
position: relative;
|
|
65
|
-
z-index: 1;
|
|
66
|
-
display: block;
|
|
67
|
-
width: 100%;
|
|
68
|
-
min-height: ${({$minHeight:e})=>e}px;
|
|
69
|
-
padding: 12px;
|
|
70
|
-
border: 0;
|
|
71
|
-
background: transparent;
|
|
72
|
-
outline: none;
|
|
73
|
-
resize: vertical;
|
|
74
|
-
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
75
|
-
caret-color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
76
|
-
box-sizing: border-box;
|
|
77
|
-
|
|
78
|
-
&::placeholder {
|
|
79
|
-
color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
80
|
-
}
|
|
81
|
-
`,is=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),as=({regex:o,value:n,onChange:i,minHeight:s=240,...c})=>{const d=l(null),p=l(null),u=a(()=>((e,t)=>{if(!e||!t)return is(t);let o;try{o=new RegExp(e)}catch{return is(t)}const n=o.exec(t);if(!n)return is(t);const i=n.index,a=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,i),matchPre:"",capture:t.slice(i,a),matchPost:"",after:t.slice(a)};const l=n[0].indexOf(n[1]),r=l>=0?i+l:i,s=r+n[1].length;return{before:t.slice(0,i),matchPre:t.slice(i,r),capture:t.slice(r,s),matchPost:t.slice(s,a),after:t.slice(a)}})(o,n),[o,n]),h=r(()=>{d.current&&p.current&&(d.current.scrollTop=p.current.scrollTop,d.current.scrollLeft=p.current.scrollLeft)},[]);return e(ts,{$minHeight:s,children:[e(os,{ref:d,"aria-hidden":!0,children:[u.before,t("span",{style:{background:Qr},children:u.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:u.capture}),t("span",{style:{background:Qr},children:u.matchPost}),u.after,n.endsWith("\n")?" ":""]}),t(ns,{ref:p,$minHeight:s,value:n,onChange:e=>i(e.target.value),onScroll:h,spellCheck:!1,...c})]})},ls=b.div`
|
|
82
|
-
flex: 1;
|
|
83
|
-
min-height: 0;
|
|
84
|
-
overflow-y: auto;
|
|
85
|
-
`,rs=b.div`
|
|
86
|
-
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
87
|
-
border-radius: 8px;
|
|
88
|
-
padding: 8px;
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
gap: 12px;
|
|
92
|
-
`,ss=b.div`
|
|
93
|
-
padding: 8px 16px;
|
|
94
|
-
border-radius: 8px;
|
|
95
|
-
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
96
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
97
|
-
font-size: 12px;
|
|
98
|
-
line-height: 20px;
|
|
99
|
-
color: ${({theme:e,$tone:t})=>"error"===t?e.v2.colors.red[500]:"match"===t?e.v2.colors.white[500]:e.v2.colors.silver[200]};
|
|
100
|
-
word-break: break-all;
|
|
101
|
-
white-space: pre-wrap;
|
|
102
|
-
user-select: text;
|
|
103
|
-
`,cs=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[r,c]=s(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:de.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:de.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:de.RESULT_INVALID_REGEX_FALLBACK}}const n=o.exec(t);return n?{ok:!0,isMatch:!0,message:n.length>1?n[1]:n[0]}:{ok:!0,isMatch:!1,message:de.RESULT_NO_MATCH}})(n,r),[n,r]),p=d.ok?d.isMatch?"match":"neutral":"error";return t(ce,{isOpen:o,header:{title:de.TITLE,onClose:()=>{c(""),i()}},children:t(ls,{children:e(rs,{children:[e(ee,{$gap:6,children:[t(te,{label:de.REGEX_LABEL}),t(Zr,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(pe,{size:he.XXS,color:ue.Secondary,children:de.REGEX_EMPTY_HINT})]}),e(ee,{$gap:6,children:[e(me,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:de.TEST_STRING_LABEL}),t(ge,{"data-id":"regex-tester-unescape",label:de.UNESCAPE_LABEL,tooltip:de.UNESCAPE_TOOLTIP,variant:be.Secondary,size:fe.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],i="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=i){t+=i,o++;continue}}t+=e[o]}return t})(e)),disabled:(u=r,!/\\["'\\nrt]/.test(u))})]}),t(as,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:de.TEST_STRING_PLACEHOLDER,regex:n,value:r,onChange:c,minHeight:240}),t(ne,{helpMessage:de.TEST_STRING_HELP})]}),e(ee,{$gap:8,children:[t(te,{label:de.RESULT_LABEL}),t(ss,{$tone:p,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(pe,{size:he.XXS,color:ue.Secondary,children:de.RESULT_CAPTURE_HINT})]})]})})});var u},ds=Q.ExtractAttribute;var ps;(e=>{e.Preset="preset",e.Regex="regex"})(ps||(ps={}));const us=[Ce.JSON,Ce.SQL,Ce.ResourcePath],hs=(e=Ce.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),ms=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,gs=b.div`
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEffect as i,useState as a,Fragment as l,forwardRef as r,useImperativeHandle as s,useMemo as c,useCallback as d,useRef as u,Children as p,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as E,h as N,j as O,k as $,p as A,l as R,c as D,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as J,I as q,J as Z}from"./chunks/helpers-w7krM8zT.js";import{bm as Q,F as ee,d as te,C as oe,k as ne,I as ie,bw as ae,o as le,p as re,w as se,Y as ce,bx as de,h as ue,by as pe,aq as he,bz as me,bA as ge,B as fe,i as be,j as ve,x as ye,a4 as Ce,bn as Se,a$ as xe,bB as we,g as Te,bC as ke,u as Ie,N as Ee,S as Ne,bD as Oe,bs as $e,bt as Ae,br as Re,bE as De,e as _e,f as Pe,ae as Le,T as Fe,ac as Me,ad as ze,ab as Be,aa as Xe,a9 as Ue,a8 as Ve,bF as He,bG as je,bH as Ge,bI as We,bJ as Ke,W as Ye,m as Je,ba as qe,bK as Ze,bL as Qe,bM as et,bN as tt,bO as ot,bP as nt,bQ as it,bR as at,Q as lt,bS as rt,bT as st,bU as ct,bV as dt,bW as ut,a_ as pt,bq as ht,s as mt,bX as gt,bY as ft,b0 as bt,bZ as vt,b_ as yt,aX as Ct,v as St,bu as xt,b9 as wt,b as Tt,q as kt,b$ as It,bb as Et,c0 as Nt,c1 as Ot,bd as $t,c2 as At,b2 as Rt,c3 as Dt,l as _t,y as Pt,D as Lt,n as Ft,a3 as Mt,bg as zt,bl as Bt,z as Xt,c4 as Ut,c5 as Vt,bk as Ht,c6 as jt,c7 as Gt,c8 as Wt,af as Kt,b5 as Yt,b6 as Jt,H as qt,c9 as Zt,ca as Qt,cb as eo,cc as to,cd as oo,ce as no,cf as io,cg as ao,ch as lo,O as ro,ci as so,cj as co,A as uo,b1 as po,aZ as ho,ck as mo,cl as go,cm as fo,cn as bo,co as vo,cp as yo,bv as Co,cq as So,cr as xo,cs as wo,ct as To,cu as ko,cv as Io,cw as Eo,cx as No,cy as Oo,cz as $o,M as Ao,cA as Ro,cB as Do,cC as _o,cD as Po,cE as Lo,cF as Fo,cG as Mo,cH as zo,cI as Bo,cJ as Xo,cK as Uo,cL as Vo,cM as Ho,aN as jo,cN as Go,cO as Wo,cP as Ko,cQ as Yo,cR as Jo,cS as qo,cT as Zo,cU as Qo,cV as en,cW as tn,cX as on,cY as nn,cZ as an,c_ as ln,c$ as rn,aw as sn,d0 as cn,d1 as dn,b3 as un,d2 as pn,d3 as hn,d4 as mn,d5 as gn,d6 as fn,d7 as bn,d8 as vn,d9 as yn,da as Cn,db as Sn,dc as xn,dd as wn,de as Tn,df as kn,dg as In,dh as En,di as Nn,dj as On,dk as $n,dl as An,dm as Rn,dn as Dn,dp as _n,dq as Pn,dr as Ln,ds as Fn,dt as Mn,du as zn,dv as Bn,dw as Xn,dx as Un,dy as Vn,dz as Hn,dA as jn,dB as Gn,dC as Wn,dD as Kn,dE as Yn,dF as Jn,dG as qn,dH as Zn,dI as Qn,dJ as ei,dK as ti,dL as oi,dM as ni,dN as ii,dO as ai,dP as li,dQ as ri,dR as si,dS as ci,dT as di,dU as ui,dV as pi,dW as hi,dX as mi,dY as gi,dZ as fi,d_ as bi,d$ as vi,e0 as yi,e1 as Ci,e2 as Si,e3 as xi,e4 as wi,e5 as Ti,e6 as ki,e7 as Ii,e8 as Ei,e9 as Ni,ea as Oi,eb as $i,ec as Ai,ed as Ri,ee as Di,ef as _i,P as Pi,eg as Li,eh as Fi,ei as Mi,ej as zi,ek as Bi,el as Xi,em as Ui,aY as Vi,en as Hi,$ as ji,eo as Gi,ep as Wi,eq as Ki,er as Yi,es as Ji,et as qi,eu as Zi,ev as Qi,ew as ea,ex as ta,ey as oa,bc as na,ez as ia,R as aa,a as la,eA as ra,eB as sa,eC as ca,eD as da,eE as ua,eF as pa,eG as ha,eH as ma,eI as ga,eJ as fa,eK as ba,eL as va,eM as ya,eN as Ca,eO as Sa,eP as xa,eQ as wa,eR as Ta,eS as ka,eT as Ia,eU as Ea,eV as Na}from"./chunks/ui-components-dsTdscIC.js";import{TrashIcon as Oa,PlusIcon as $a,ArrowRightIcon as Aa,VSquareIcon as Ra,XSquareIcon as Da,BookIcon as _a,DeleteIcon as Pa,EditIcon as La,GoLogo as Fa,JavaLogo as Ma,ChevronRightIcon as za,ActionIcon as Ba,DestinationIcon as Xa,ChevronUpIcon as Ua,ChevronDownIcon as Va,VIcon as Ha,XIcon as ja,InstrumentationRuleIcon as Ga,SourceIcon as Wa,NamespacesIcon as Ka,AwsLogo as Ya,CloudConnectorIcon as Ja,EyeOpenIcon as qa,CloudConnectorPolicyIcon as Za,ArrowLeftIcon as Qa,ISquareIcon as el,RefreshIcon as tl,SettingsIcon as ol,PodIcon as nl,OdigosLogo as il,K8sLogo as al,ExclamationCircleIcon as ll,QuestionCircleIcon as rl,InboundIcon as sl,OutboundIcon as cl,UserIcon as dl,TerminalIcon as ul,RefreshLeftArrowIcon as pl,MinusIcon as hl,SearchIcon as ml,ExpandIcon as gl,CopyIcon as fl,DotIcon as bl,ArrowDownIcon as vl,DownloadIcon as yl,VmLogo as Cl,SamplingIcon as Sl,ExclamationTriangleIcon as xl,KeyIcon as wl,DiagnoseIcon as Tl,StarIcon as kl,ArrowIcon as Il,ConnectionsIcon as El,FilterIcon as Nl,DataStreamIcon as Ol,PipelineCollectorIcon as $l,ArrowDownSquareIcon as Al,ArrowUpSquareIcon as Rl,GatewayIcon as Dl,YamlIcon as _l,ImageErrorIcon as Pl,LockIcon as Ll}from"./icons.js";import{h as Fl,o as Ml,n as zl,q as Bl,m as Xl,t as Ul,s as Vl,S as Hl,w as jl,E as Gl,x as Wl,y as Kl,v as Yl,l as Jl,d as ql,O as Zl,f as Ql,b as er,A as tr,R as or,C as nr,e as ir,D as ar}from"./chunks/source-instrument-form-context-DS-dr35D.js";import{n as lr,f as rr,k as sr,I as cr,l as dr,A as ur,i as pr,P as hr,S as mr,R as gr,g as fr,j as br,c as vr,h as yr,m as Cr,W as Sr,C as xr,b as wr,Y as Tr,O as kr,a as Ir,U as Er,e as Nr}from"./chunks/index-C8U7vd0v.js";import{createPortal as Or}from"react-dom";import{MarkerType as $r,useNodesState as Ar,useEdgesState as Rr,Handle as Dr,Position as _r,getSmoothStepPath as Pr,BaseEdge as Lr,EdgeLabelRenderer as Fr,ReactFlowProvider as Mr,ReactFlow as zr,Background as Br,Controls as Xr,ControlButton as Ur,useReactFlow as Vr}from"@xyflow/react";import Hr from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const jr=[{id:"CREDIT_CARD",label:"Credit card"}],Gr=[{id:Q.CollectContainerAttributes,label:"Collect container attributes"},{id:Q.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:Q.CollectWorkloadId,label:"Collect workload ID"},{id:Q.CollectClusterId,label:"Collect cluster ID"}],Wr=[{id:ae.Pod,label:ae.Pod},{id:ae.Namespace,label:ae.Namespace},{id:ae.Node,label:ae.Node}],Kr=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Wr}],Yr=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Wr}],Jr=Q.ExtractAttribute;var qr;(e=>{e.Preset="preset",e.Regex="regex"})(qr||(qr={}));const Zr=[pe.JSON,pe.SQL,pe.ResourcePath],Qr=(e=pe.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),es=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,ts=b.div`
|
|
104
2
|
width: 100%;
|
|
105
3
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
106
4
|
border-radius: 8px;
|
|
@@ -108,13 +6,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
108
6
|
display: flex;
|
|
109
7
|
flex-direction: column;
|
|
110
8
|
gap: 8px;
|
|
111
|
-
`,
|
|
9
|
+
`,os=b.div`
|
|
112
10
|
flex: 1;
|
|
113
11
|
min-width: 0;
|
|
114
|
-
`,
|
|
12
|
+
`,ns=b.div`
|
|
115
13
|
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
116
14
|
padding-top: 24px;
|
|
117
|
-
`,vs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ys=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},Cs=Q.UrlTemplatizationRulesGroups,Ss=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],xs=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},ws=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,o,n]=e;return e=>{const i=null==e?.[t]?"":String(e[t]);switch(o){case"=":case"==":case"===":return i===n;case"!=":case"!==":return i!==n;default:return!0}}},Ts=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,componentType:t.componentType,options:xs(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:ws(t.renderCondition)}})},ks=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const t=e;return{id:String(t.id??t.keyName??t.name??""),label:t.label??t.displayName??String(t.id??""),tooltip:t.tooltip,fields:Array.isArray(t.fields)?t.fields.map(Es):void 0}})},Es=e=>{const t="string"==typeof e.componentProperties?Ne(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:xs(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:Ts(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:ks(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(Es):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},Is=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Ns=e=>Array.isArray(e)?e:[],$s=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},Os=e=>Is(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],As=({field:e,value:o,setValue:n,errorMessage:a,disabled:l})=>{const[r,c]=s(()=>Os(o));return i(()=>{const e=Is(o)?o:{};((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})($s(r),e)||c(Os(o))},[o]),t(ie,{name:e.name,label:e.title,tooltip:e.tooltip,helpMessage:e.helpMessage,required:e.required,disabled:l,limitFieldsPerRow:2,columns:[{keyName:"key",label:e.keyLabel||"Key",placeholder:e.keyLabel||"Key"},{keyName:"value",label:e.valueLabel||"Value",placeholder:e.valueLabel||"Value"}],values:r,setValues:e=>{c(e),n($s(e))},errorMessage:a})},Rs=({field:n,value:i,setValue:a,errorMessage:l,disabled:r})=>{const{name:c,componentType:d,inputType:p,title:u,tooltip:h,placeholder:m,helpMessage:g,required:f,initialValue:b,options:v,itemWrapperKey:y,columns:C,limitFieldsPerRow:S,variant:x,wrapKey:w,checkboxOptions:T}=n,[k,E]=s({open:!1,value:""});if(d===Ee.CheckboxList&&"array"===n.valueMode){const o=Ns(i),n=(e,t)=>a(t?[...o.filter(t=>t!==e),e]:o.filter(t=>t!==e));return e(ee,{$gap:12,children:[u&&t(te,{label:u,tooltip:h,required:f}),t(ee,{$gap:8,children:(T||[]).map(e=>{const i=t(oe,{name:e.id,label:e.label,value:o.includes(e.id),disabled:r,onChange:t=>n(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:i},e.id):i})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ee.CheckboxList){const o=Is(i)?i:{},s=(e=>"emptyObject"!==e.checkedValue||{})(n),d=e=>"emptyObject"===n.checkedValue?Is(e):!!e;return e(ee,{$gap:12,children:[u&&t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:u}),t(ee,{$gap:12,children:(T||[]).map(n=>{const i=o[n.id],l=d(i),p=Is(i)?i:{},u=t(oe,{label:n.label,value:l,disabled:r,onChange:e=>a({...o,[n.id]:e?Is(i)?i:s:null})}),h=n.tooltip?t($e,{text:n.tooltip,withIcon:!0,children:u}):u,m=l&&n.fields?.length?t(ee,{$gap:12,$padding:"0 0 0 24px",children:n.fields.map(e=>t(Rs,{field:e,value:p[e.name],setValue:t=>a({...o,[n.id]:{...p,[e.name]:t}}),disabled:r},`${c}-${n.id}-${e.name}`))}):null;return e(ee,{$gap:12,children:[h,m]},n.id)})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ee.MultiTabledInput){const n=Ns(w?i?.[w]:i),s=e=>a(w?{...Is(i)?i:{},[w]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(o,{children:[t("cards"===x?Oe:ie,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,columns:C||[],limitFieldsPerRow:S,values:n,setValues:s,errorMessage:l,onTestRegex:d?e=>E({open:!0,value:e}):void 0}),d&&t(cs,{isOpen:k.open,regex:k.value,onClose:()=>E({open:!1,value:""})})]})}if(d===Ee.MultiInput&&w){const e=Ns(i?.[w]);return t(se,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a({...Is(i)?i:{},[w]:e}),errorMessage:l})}if(d===Ee.MultiInput&&y){const e=Ns(i).map(e=>String(e?.[y]??""));return t(se,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a(e.map(e=>({[y]:e}))),errorMessage:l})}return d===Ee.KeyValuePair?t(As,{field:n,value:i,setValue:a,errorMessage:l,disabled:r}):t(ir,{componentType:d,inputType:p,name:c,label:u,tooltip:h,helpMessage:g,disabled:r,required:f,placeholder:m,errorMessage:l,dropdownOptions:v,value:(null==i?b:i)??"",setValue:a})},Ds=({field:n,value:i,setValue:a,disabled:l})=>{const r=v(),s=Ns(i),d=s.length?s:[{}],p=n.fields||[],u=e=>a(e);return e(o,{children:[d.map((o,i)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`${n.itemLabel||n.title||"Item"} ${i+1}`}),t(ge,{leftIcon:()=>t(Ia,{fill:r.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=d.filter((t,o)=>o!==e);u(t)})(i),disabled:l||1===d.length})]}),p.map(e=>t(Rs,{field:e,value:o[e.name],setValue:t=>((e,t,o)=>u(d.map((n,i)=>i===e?{...n,[t]:o}:n)))(i,e.name,t),disabled:l},`${n.name}-group-${i}-${e.name}`))]})]},`${n.name}-group-${i}`)),t(ge,{variant:be.Secondary,label:n.addLabel||"Add",leftIcon:Na,onClick:()=>u([...d,{}]),disabled:l}),t(ke,{})]})},_s=({field:o,value:n,setValue:i,errorMessage:a,disabled:l})=>e(ee,{$gap:12,children:[o.title&&t(te,{label:o.title,tooltip:o.tooltip,required:o.required}),t(ee,{$gap:8,children:(o.checkboxOptions||[]).map(e=>{const o=t(oe,{name:e.id,label:e.label,value:!0===n?.[e.id],disabled:l,onChange:t=>i(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:o},e.id):o})}),t(ne,{errorMessage:a,helpMessage:o.helpMessage})]}),Ps=({signals:e,fields:n,value:a,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(n||[]).filter(e=>!!e).map(e=>Es(e));return i(()=>{if(!c)return;const e=a||{},t={};d.forEach(o=>{const n=(e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===Ee.CheckboxList?"array"===e.valueMode?Ne(t,[]):Ne(t,{}):e.componentType!==Ee.MultiInput&&e.componentType!==Ee.MultiTabledInput||!e.wrapKey?e.componentType===Ee.MultiInput||e.componentType===Ee.MultiTabledInput?Ne(t,[]):t:{[e.wrapKey]:Ne(t,[])}})(o);if(void 0===n)return;if(o.componentType===Ee.CheckboxList&&"flatFields"===o.valueMode&&Is(n))return void Object.entries(n).forEach(([o,n])=>{void 0!==e[o]&&null!==e[o]||(t[o]=n)});null==e[o.name]&&(t[o.name]=Is(n)&&Is(t[o.name])?{...t[o.name],...n}:n)}),Object.entries(t).forEach(([e,t])=>l(e,t))},[]),t(o,{children:d.map(o=>{const n=Object.entries(a||{}).map(([e,t])=>({name:e,value:t}));if(o.renderCondition&&!Ie(o.renderCondition,e,n))return null;const i=a?.[o.name];if(o.componentType===Ee.FieldGroup)return t(Ds,{field:o,value:i,setValue:e=>l(o.name,e),disabled:s},o.name);if(o.componentType===Ee.CheckboxList&&"flatFields"===o.valueMode){const e=o.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(_s,{field:o,value:a||{},setValue:l,errorMessage:e,disabled:s},o.name)}return t(Rs,{field:o,value:i,setValue:e=>l(o.name,e),errorMessage:r[o.name],disabled:s},o.name)})})},Ls={[Ae.K8sAttributes]:({value:n,setValue:a,formErrors:l})=>(i(()=>{n[Q.CollectContainerAttributes]||n[Q.CollectReplicaSetAttributes]||n[Q.CollectWorkloadId]||n[Q.CollectClusterId]||n[Q.LabelsAttributes]?.length||n[Q.AnnotationsAttributes]?.length||(a(Q.CollectContainerAttributes,!0),a(Q.CollectReplicaSetAttributes,!0),a(Q.CollectWorkloadId,!0),a(Q.CollectClusterId,!0),a(Q.LabelsAttributes,[]),a(Q.AnnotationsAttributes,[]))},[]),e(o,{children:[t(ee,{$gap:6,children:Ur.map(({id:o,label:i})=>e(ee,{children:[t(oe,{label:i,value:n[o]||!1,onChange:e=>a(o,e)}),t(ne,{errorMessage:l[o]})]},o))}),t(ie,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Hr,values:n[Q.LabelsAttributes]||[],setValues:e=>a(Q.LabelsAttributes,e),errorMessage:l[Q.LabelsAttributes]}),t(ie,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:jr,values:n[Q.AnnotationsAttributes]||[],setValues:e=>a(Q.AnnotationsAttributes,e),errorMessage:l[Q.AnnotationsAttributes]})]})),[Ae.AddClusterInfo]:({value:n,setValue:i,formErrors:a})=>{const l=v();return e(o,{children:[t(le,{label:"Overwrite existing values",labelAlign:re.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[Q.OverwriteExistingValues]||!1,onChange:e=>i(Q.OverwriteExistingValues,e)}),t(ie,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[Q.ClusterAttributes]||[],setValues:e=>i(Q.ClusterAttributes,e),errorMessage:a[Q.ClusterAttributes]})]})},[Ae.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(se,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Q.AttributeNamesToDelete]||[],setValues:e=>o(Q.AttributeNamesToDelete,e),errorMessage:n[Q.AttributeNamesToDelete]}),[Ae.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>{const a=e[Q.Renames],[l,r]=s(()=>vs(a));return i(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(ys(l),a||{})||r(vs(a))},[a]),t(ie,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));r(t),o(Q.Renames,ys(t))},errorMessage:n[Q.Renames]})},[Ae.PiiMasking]:({value:o,setValue:n,formErrors:a})=>(i(()=>{o[Q.PiiCategories]?.length||n(Q.PiiCategories,Xr.map(({id:e})=>e))},[]),e(ee,{$gap:12,children:[t(te,{label:"Attributes to mask"}),t(ee,{$gap:6,children:Xr.map(({id:e,label:i})=>t(oe,{label:i,value:o[Q.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=o[Q.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);n(Q.PiiCategories,a)}},e))}),t(ne,{errorMessage:a[Q.PiiCategories]})]})),[Ae.URLTemplatization]:({value:n,setValue:i,formErrors:a})=>{const l=v(),r=n[Cs]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],s=e=>i(Cs,e),d=(e,t)=>s(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`Rule Group ${n+1}`}),t(ge,{leftIcon:()=>t(Ia,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>{return e=n,s(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(Te,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(ie,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Ss,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(se,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ne,{errorMessage:a[Cs]})]},`url-templatization-group-${n}`)),t(ge,{variant:be.Secondary,label:"Add rule group",leftIcon:Na,onClick:()=>s([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ke,{})]})},[Ae.ExtractAttribute]:({value:o,setValue:n,formErrors:a})=>{const l=v(),r=a[ds],c=o[ds]?.extractions||[],[d,p]=s(()=>(e=>e.length&&e.some(ms)?ps.Regex:ps.Preset)(c)),[u,h]=s(null),m=e=>n(ds,{extractions:e});i(()=>{0===c.length&&m([d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((o,n)=>n===e?{...o,...t}:o))},f=()=>{m([...c,d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===ps.Preset,y=c.length?c:[b?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ee,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:ps.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:ps.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ee,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const i=n===y.length-1,a=o.dataFormat||Ce.JSON,r=xe[a];return e(gs,{"data-id":`extract-row-${n}`,children:[e(me,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ee,{$gap:10,children:[t(te,{label:b?ye.PRESET_ROW_TITLE(n):ye.REGEX_ROW_TITLE(n)}),b&&t(me,{$gap:24,children:us.map(e=>t(Se,{"data-id":`extract-row-${n}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(me,{$gap:4,$alignItems:"center",children:[!b&&t(ge,{"data-id":`extract-row-${n}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:be.Secondary,size:fe.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ge,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(Ia,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);m(t.length?t:[d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(ge,{"data-id":`extract-row-${n}-add`,leftIcon:Na,variant:be.Secondary,size:fe.S,onClick:f})]})]}),b?e(me,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(fs,{children:t(Te,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(bs,{children:t($a,{size:24,fill:l.v2.colors.silver[200]})}),t(fs,{children:t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(ee,{$gap:12,$width:"100%",children:[t(Te,{name:`extract-row-${n}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(ne,{errorMessage:r})]}),t(cs,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})}},Fs=({actionType:e,value:o,setValue:n,formErrors:i,dynamicFields:a,signals:l})=>{if(!e)return null;if(a?.length)return t(Ps,{fields:a,value:o,setValue:n,formErrors:i||{},signals:l||[],seedInitialValues:!0},e);const r=Ls[e];return r?t(r,{value:o,setValue:n,formErrors:i}):null},Ms=()=>{const o=v(),{selectedOption:n,genericForm:i}=Pl();if(!i||!n)return t(Re,{title:"No active form"});const{formData:a,handleFormChange:l,formErrors:r}=i;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:n.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:a.disabled,setSelected:e=>l("disabled",e)}),t(ge,{leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(ar,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(Te,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:a.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(Fs,{actionType:n.type,dynamicFields:n.fields,signals:a.signals||[],value:a.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:a.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},zs=({signals:e,fields:o,disabled:n,formData:i,handleFormChange:a,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:p,placeholder:u,value:h,required:m,options:g})=>{if(o&&!Ie(o,e,i.fields))return null;const f=c,b=i.fields.find(e=>e.key===f),v=b?b.value:h;return t(ir,{componentType:r,inputType:s,name:f,label:d,tooltip:p,disabled:n,required:m,placeholder:u,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>a(f,e)},f)}),Bs=b(me)`
|
|
15
|
+
`,is=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),as=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},ls=Q.UrlTemplatizationRulesGroups,rs=[{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"}],ss={[Se.K8sAttributes]:({value:n,setValue:a,formErrors:l})=>(i(()=>{n[Q.CollectContainerAttributes]||n[Q.CollectReplicaSetAttributes]||n[Q.CollectWorkloadId]||n[Q.CollectClusterId]||n[Q.LabelsAttributes]?.length||n[Q.AnnotationsAttributes]?.length||(a(Q.CollectContainerAttributes,!0),a(Q.CollectReplicaSetAttributes,!0),a(Q.CollectWorkloadId,!0),a(Q.CollectClusterId,!0),a(Q.LabelsAttributes,[]),a(Q.AnnotationsAttributes,[]))},[]),e(o,{children:[t(ee,{$gap:6,children:Gr.map(({id:o,label:i})=>e(ee,{children:[t(oe,{label:i,value:n[o]||!1,onChange:e=>a(o,e)}),t(ne,{errorMessage:l[o]})]},o))}),t(ie,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Kr,values:n[Q.LabelsAttributes]||[],setValues:e=>a(Q.LabelsAttributes,e),errorMessage:l[Q.LabelsAttributes]}),t(ie,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Yr,values:n[Q.AnnotationsAttributes]||[],setValues:e=>a(Q.AnnotationsAttributes,e),errorMessage:l[Q.AnnotationsAttributes]})]})),[Se.AddClusterInfo]:({value:n,setValue:i,formErrors:a})=>{const l=v();return e(o,{children:[t(le,{label:"Overwrite existing values",labelAlign:re.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[Q.OverwriteExistingValues]||!1,onChange:e=>i(Q.OverwriteExistingValues,e)}),t(ie,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[Q.ClusterAttributes]||[],setValues:e=>i(Q.ClusterAttributes,e),errorMessage:a[Q.ClusterAttributes]})]})},[Se.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(se,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Q.AttributeNamesToDelete]||[],setValues:e=>o(Q.AttributeNamesToDelete,e),errorMessage:n[Q.AttributeNamesToDelete]}),[Se.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>{const l=e[Q.Renames],[r,s]=a(()=>is(l));return i(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(as(r),l||{})||s(is(l))},[l]),t(ie,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:r,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),o(Q.Renames,as(t))},errorMessage:n[Q.Renames]})},[Se.PiiMasking]:({value:o,setValue:n,formErrors:a})=>(i(()=>{o[Q.PiiCategories]?.length||n(Q.PiiCategories,jr.map(({id:e})=>e))},[]),e(ee,{$gap:12,children:[t(te,{label:"Attributes to mask"}),t(ee,{$gap:6,children:jr.map(({id:e,label:i})=>t(oe,{label:i,value:o[Q.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=o[Q.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);n(Q.PiiCategories,a)}},e))}),t(ne,{errorMessage:a[Q.PiiCategories]})]})),[Se.URLTemplatization]:({value:n,setValue:i,formErrors:a})=>{const r=v(),s=n[ls]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(ls,e),d=(e,t)=>c(s.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[s.map((o,n)=>e(l,{children:[t(Ce,{}),e(ee,{$gap:12,children:[e(ue,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`Rule Group ${n+1}`}),t(fe,{leftIcon:()=>t(Oa,{fill:r.v2.colors.red[500]}),variant:ve.Secondary,size:be.S,onClick:()=>{return e=n,c(s.filter((t,o)=>o!==e));var e},disabled:1===s.length})]}),t(ye,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(ie,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:rs,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(se,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ne,{errorMessage:a[ls]})]},`url-templatization-group-${n}`)),t(fe,{variant:ve.Secondary,label:"Add rule group",leftIcon:$a,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ce,{})]})},[Se.ExtractAttribute]:({value:o,setValue:n,formErrors:l})=>{const r=v(),s=l[Jr],c=o[Jr]?.extractions||[],[d,u]=a(()=>(e=>e.length&&e.some(es)?qr.Regex:qr.Preset)(c)),[p,h]=a(null),m=e=>n(Jr,{extractions:e});i(()=>{0===c.length&&m([d===qr.Preset?Qr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((o,n)=>n===e?{...o,...t}:o))},f=()=>{m([...c,d===qr.Preset?Qr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===qr.Preset,y=c.length?c:[b?Qr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(ee,{$gap:16,$width:"100%",children:[t(ce,{options:[{value:qr.Preset,label:de.SEGMENT_PRESET_LABEL,tooltip:de.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:qr.Regex,label:de.SEGMENT_REGEX_LABEL,tooltip:de.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===qr.Preset?Qr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ee,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const i=n===y.length-1,a=o.dataFormat||pe.JSON,l=me[a];return e(ts,{"data-id":`extract-row-${n}`,children:[e(ue,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ee,{$gap:10,children:[t(te,{label:b?de.PRESET_ROW_TITLE(n):de.REGEX_ROW_TITLE(n)}),b&&t(ue,{$gap:24,children:Zr.map(e=>t(he,{"data-id":`extract-row-${n}-fmt-${e}`,size:ge.L,label:me[e].label,value:a===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(ue,{$gap:4,$alignItems:"center",children:[!b&&t(fe,{"data-id":`extract-row-${n}-test-regex`,label:de.TEST_REGEX_LABEL,variant:ve.Secondary,size:be.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(fe,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(Oa,{fill:r.v2.colors.red[500]}),variant:ve.Secondary,size:be.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);m(t.length?t:[d===qr.Preset?Qr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(fe,{"data-id":`extract-row-${n}-add`,leftIcon:$a,variant:ve.Secondary,size:be.S,onClick:f})]})]}),b?e(ue,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(os,{children:t(ye,{name:`extract-row-${n}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(ns,{children:t(Aa,{size:24,fill:r.v2.colors.silver[200]})}),t(os,{children:t(ye,{name:`extract-row-${n}-targetAttributeName`,label:de.TARGET_LABEL,placeholder:de.TARGET_PLACEHOLDER,helpMessage:de.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(ee,{$gap:12,$width:"100%",children:[t(ye,{name:`extract-row-${n}-regex`,label:de.REGEX_LABEL,placeholder:de.REGEX_PLACEHOLDER,helpMessage:de.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(ye,{name:`extract-row-${n}-targetAttributeName`,label:de.TARGET_LABEL,placeholder:de.TARGET_PLACEHOLDER,helpMessage:de.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(ne,{errorMessage:s})]}),t(lr,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},cs=({actionType:e,value:o,setValue:n,formErrors:i,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(rr,{fields:a,value:o||{},setValue:n,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=ss[e];return c?t(c,{value:o,setValue:n,formErrors:i}):null},ds=()=>{const o=v(),{selectedOption:n,genericForm:i,sourceOptions:a,namespaceOptions:l}=Fl();if(!i||!n)return t(xe,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=i;return e(ee,{$gap:24,children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(we,{size:Te.XXXS,maxLines:2,children:n.description}),e(ue,{$gap:12,children:[t(ce,{options:[{icon:Ra,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Da,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:ke.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(fe,{leftIcon:_a,variant:ve.Secondary,size:be.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(sr,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(ye,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>s("name",e),errorMessage:c.name}),t(cs,{actionType:n.type,dynamicFields:n.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>s(`fields.${e}`,t),formErrors:c,sourceOptions:a,namespaceOptions:l}),t(Ie,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},us=b(ue)`
|
|
118
16
|
position: sticky;
|
|
119
17
|
bottom: 4px;
|
|
120
18
|
align-self: center;
|
|
@@ -125,17 +23,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
125
23
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
126
24
|
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
127
25
|
z-index: 1;
|
|
128
|
-
`,Xs=d(({isEdit:o},n)=>{const a=v(),{isVm:l}=S(),{destinationsApi:r}=Ll(),{activeForm:c,genericForm:d,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Fl(),[b,y]=s(h?.testResult),[C,x]=s(!!h);i(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!c?.option.testConnectionSupported||!d||l)return;const e=await r.testConnection(Ue(d.formData));return y(e),e};return p(n,()=>({testConnection:w,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,d,r]),d&&c?e(ee,{$gap:24,style:{minHeight:"100%"},children:[e(me,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(Le,{status:Fe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Le,{status:Fe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(me,{$gap:12,children:[!l&&t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],size:_e.S,selected:d.formData.disabled,setSelected:e=>d.handleFormChange("disabled",e),disabled:C}),t(ge,{"data-id":"dest-form-docs",leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>window.open(`${Me}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(ar,{title:"This connection will monitor:",allowedSignals:Xe(c.option.supportedSignals),selectedSignals:Be(d.formData.exportedSignals),setSelectedSignals:e=>d.handleFormChange("exportedSignals",{logs:e.includes(ze.Logs),metrics:e.includes(ze.Metrics),traces:e.includes(ze.Traces),profiles:e.includes(ze.Profiles)}),disabled:C,errorMessage:d.formErrors.exportedSignals}),t(Te,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:d.formData.name,onChange:({target:{value:e}})=>d.handleFormChange("name",e),disabled:C,errorMessage:d.formErrors.name}),t(zs,{signals:Be(d.formData.exportedSignals),fields:c.dynamicFields,disabled:C,formData:d.formData,handleFormChange:(e,t)=>{d.handleFormChange("fields",d.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&d.formErrors[e]&&d.handleErrorChange(e,void 0)},formErrors:d.formErrors}),!o&&e(Bs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Da,variant:be.Secondary,textColor:a.v2.colors.red[500],onClick:()=>f(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:be.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:_a,variant:be.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),o=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t(Re,{title:"No active form"})});Xs.displayName="AddDestinationForm";const Us=[{id:Ve.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ve.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ve.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Vs=[{id:Ve.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ve.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ve.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Hs=["*"],js=[{id:je.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:je.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:je.DbQuery,label:"Collect DB query",tooltip:""},{id:je.Messaging,label:"Collect messaging",tooltip:""}],Gs={[Ke.Java]:[new We("","")],[Ke.Golang]:[new Ge("")]},Ws={[Ye.CodeAttributes]:({value:n,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);i(()=>{if(!c.length&&!s){const e={[Ve.FilePath]:!0,[Ve.Function]:!0,[Ve.LineNumber]:!0,[Ve.Column]:null,[Ve.Namespace]:null,[Ve.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ve).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ee,{$gap:6,children:Us.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]}),e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ee,{$gap:6,children:Vs.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]})]})},[Ye.CustomInstrumentation]:({value:n,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(n?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=a(()=>(n?.customInstrumentations?.[Ke.Java]||[]).map(e=>new We(e.className,e.methodName)),[n]);return i(()=>{n?.customInstrumentations||s||l("customInstrumentations",{[Ke.Golang]:Gs[Ke.Golang],[Ke.Java]:Gs[Ke.Java]})},[]),e(o,{children:[e(ee,{children:[e(me,{$gap:8,children:[t(Pa,{}),t(te,{label:"Golang custom probes"})]}),t(ie,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Ke.Golang]=e.map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(ee,{children:[e(me,{$gap:8,children:[t(La,{}),t(te,{label:"Java custom probes"})]}),t(ie,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ke.Golang]=c,t[Ke.Java]=e.map(e=>new We(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Ye.HeadersCollection]:({value:e,setValue:o,formErrors:n})=>{const l=n.headersCollection,r=a(()=>e?.headersCollection?.[He.HeaderKeys]||[],[e]),s=e=>{const t={[He.HeaderKeys]:e};o("headersCollection",t)};return i(()=>{r.length||l||s(Hs)},[]),t(se,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[Ye.PayloadCollection]:({value:o,setValue:n,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);return i(()=>{if(!s.length&&!r){const e={[je.HttpRequest]:{},[je.HttpResponse]:{},[je.DbQuery]:{},[je.Messaging]:{}};n("payloadCollection",e)}},[]),e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ee,{$gap:6,children:js.map(({id:e,label:o,tooltip:i})=>t($e,{text:i,withIcon:!0,children:t(oe,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[je.HttpRequest]:o.includes(je.HttpRequest)?{}:null,[je.HttpResponse]:o.includes(je.HttpResponse)?{}:null,[je.DbQuery]:o.includes(je.DbQuery)?{}:null,[je.Messaging]:o.includes(je.Messaging)?{}:null};n("payloadCollection",i)})(e,t)})},e))}),t(ne,{errorMessage:r})]})},[Ye.UnknownType]:null},Ks=({ruleType:e,value:o,setValue:n,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(Ps,{fields:a,value:o,setValue:n,formErrors:i||{},signals:[],seedInitialValues:!0});const l=Ws[e];return l?t(l,{value:o,setValue:n,formErrors:i}):null},Ys=()=>{const o=v(),{isVm:n}=S(),{selectedOption:i,genericForm:a,sourceOptions:l,namespaceOptions:r}=Ml();if(!a||!i)return t(Re,{title:"No active form"});const{formData:s,handleFormChange:c,formErrors:d}=a;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:i.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:s.disabled,setSelected:e=>c("disabled",e)}),t(ge,{leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(lr,{option:i,formState:s}),e(me,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Supported Languages:"}),i.supportedLanguages.map(e=>t(qe,{label:Je[e],leftIcon:Ze(e),backgroundColor:o.v2.colors.purple[900]},e))]}),!n&&t(rr,{scopes:s.sourceScopes,onChange:e=>c("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:i.type===Ye.CustomInstrumentation?[]:i.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(Te,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>c("ruleName",e),errorMessage:d.ruleName}),t(Ks,{ruleType:i.type,dynamicFields:i.fields,value:s,setValue:(e,t)=>c(e,t),formErrors:d}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>c("notes",e),errorMessage:d.notes})]})},qs=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=zl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(Qe,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:et.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:be.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:be.Secondary,onClick:n}})},Js=({autoFocus:o})=>{const{dataStreams:n}=tt(),{genericForm:i,excludeName:l,editingName:r}=zl(),{formData:s,formErrors:c,handleFormChange:d}=i,p=s.name,u=a(()=>n.find(e=>e.name===p&&e.name!==l),[n,p,l]);return e(ee,{$width:"100%",$gap:12,children:[t(Te,{name:"data-stream-name",label:et.STREAM_NAME,placeholder:et.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:et.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(Le,{status:Fe.Warning,message:et.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Zs=()=>{const{selectedStreamName:e}=tt(),{genericForm:o}=Bl();if(!o)return t(Re,{title:"No active form"});const{formData:n,handleFormChange:i,formErrors:a}=o;return t(Te,{name:"sourceName",label:et.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Qs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],ec=b.div`
|
|
26
|
+
`,ps=r(({isEdit:o},n)=>{const l=v(),{isVm:r}=S(),{destinationsApi:c}=Ml(),{activeForm:d,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=zl(),[b,y]=a(h?.testResult),[C,x]=a(!!h);i(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!u||r)return;const e=await c.testConnection(De(u.formData));return y(e),e};return s(n,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,u,c]),u&&d?e(ee,{$gap:24,style:{minHeight:"100%"},children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(Ee,{status:Ne.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Ee,{status:Ne.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(ue,{$gap:12,children:[!r&&t(ce,{options:[{icon:Ra,label:"Enabled",value:!1,selectedBgColor:l.v2.colors.green[800]},{icon:Da,label:"Disabled",value:!0,selectedBgColor:l.v2.colors.red[800]}],size:ke.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:C}),t(fe,{"data-id":"dest-form-docs",leftIcon:_a,variant:ve.Secondary,size:be.S,onClick:()=>window.open(`${Oe}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(sr,{title:"This connection will monitor:",allowedSignals:Re(d.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:C,errorMessage:u.formErrors.exportedSignals}),t(ye,{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:C,errorMessage:u.formErrors.name}),t(rr,{signals:Ae(u.formData.exportedSignals),fields:d.option.fields,disabled:C,value:Object.fromEntries(u.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const o=u.formData.fields.some(t=>t.key===e);u.handleFormChange("fields",o?u.formData.fields.map(o=>o.key===e?{...o,value:t}:o):[...u.formData.fields,{key:e,value:t}]),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors,keyValuePersistAs:"array"}),!o&&e(us,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Pa,variant:ve.Secondary,textColor:l.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),!r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ve.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:La,variant:ve.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ve.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await w(),o=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(fe,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ve.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await w(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t(xe,{title:"No active form"})});ps.displayName="AddDestinationForm";const hs=[{id:Le.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Le.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Le.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],ms=[{id:Le.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Le.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Le.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],gs=["*"],fs=[{id:ze.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:ze.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:ze.DbQuery,label:"Collect DB query",tooltip:""},{id:ze.Messaging,label:"Collect messaging",tooltip:""}],bs={[Ue.Java]:[new Xe("","")],[Ue.Golang]:[new Be("")]},vs={[Ve.CodeAttributes]:({value:n,setValue:a,formErrors:l})=>{const r=l.codeAttributes,s=c(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);i(()=>{if(!s.length&&!r){const e={[Le.FilePath]:!0,[Le.Function]:!0,[Le.LineNumber]:!0,[Le.Column]:null,[Le.Namespace]:null,[Le.StackTrace]:null};a("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n=Object.values(Le).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});a("codeAttributes",n)};return e(o,{children:[e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ee,{$gap:6,children:hs.map(({id:e,label:o,tooltip:n})=>t(Fe,{text:n,withIcon:!0,children:t(oe,{label:o,value:s.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:r})]}),e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ee,{$gap:6,children:ms.map(({id:e,label:o,tooltip:n})=>t(Fe,{text:n,withIcon:!0,children:t(oe,{label:o,value:s.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:r})]})]})},[Ve.CustomInstrumentation]:({value:n,setValue:a,formErrors:l})=>{const r=l.customInstrumentations,s=c(()=>(n?.customInstrumentations?.[Ue.Golang]||[]).map(e=>new Be(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=c(()=>(n?.customInstrumentations?.[Ue.Java]||[]).map(e=>new Xe(e.className,e.methodName)),[n]);return i(()=>{n?.customInstrumentations||r||a("customInstrumentations",{[Ue.Golang]:bs[Ue.Golang],[Ue.Java]:bs[Ue.Java]})},[]),e(o,{children:[e(ee,{children:[e(ue,{$gap:8,children:[t(Fa,{}),t(te,{label:"Golang custom probes"})]}),t(ie,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:s,setValues:e=>{const t={};t[Ue.Golang]=e.map(e=>new Be(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ue.Java]=d,a("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]}),e(ee,{children:[e(ue,{$gap:8,children:[t(Ma,{}),t(te,{label:"Java custom probes"})]}),t(ie,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ue.Golang]=s,t[Ue.Java]=e.map(e=>new Xe(e.className,e.methodName)),a("customInstrumentations",t)},errorMessage:r,limitFieldsPerRow:2})]})]})},[Ve.HeadersCollection]:({value:e,setValue:o,formErrors:n})=>{const a=n.headersCollection,l=c(()=>e?.headersCollection?.[Me.HeaderKeys]||[],[e]),r=e=>{const t={[Me.HeaderKeys]:e};o("headersCollection",t)};return i(()=>{l.length||a||r(gs)},[]),t(se,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:l,setValues:r,errorMessage:a})},[Ve.PayloadCollection]:({value:o,setValue:n,formErrors:a})=>{const l=a.payloadCollection,r=c(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);return i(()=>{if(!r.length&&!l){const e={[ze.HttpRequest]:{},[ze.HttpResponse]:{},[ze.DbQuery]:{},[ze.Messaging]:{}};n("payloadCollection",e)}},[]),e(ee,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ee,{$gap:6,children:fs.map(({id:e,label:o,tooltip:i})=>t(Fe,{text:i,withIcon:!0,children:t(oe,{label:o,value:r.includes(e),onChange:t=>((e,t)=>{const o=t?[...r,e]:r.filter(t=>t!==e),i={[ze.HttpRequest]:o.includes(ze.HttpRequest)?{}:null,[ze.HttpResponse]:o.includes(ze.HttpResponse)?{}:null,[ze.DbQuery]:o.includes(ze.DbQuery)?{}:null,[ze.Messaging]:o.includes(ze.Messaging)?{}:null};n("payloadCollection",i)})(e,t)})},e))}),t(ne,{errorMessage:l})]})},[Ve.UnknownType]:null},ys=({ruleType:e,value:o,setValue:n,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(rr,{fields:a,value:o||{},setValue:n,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map"},e);const l=vs[e];return l?t(l,{value:o,setValue:n,formErrors:i}):null},Cs=()=>{const o=v(),{isVm:n}=S(),{selectedOption:i,genericForm:a,sourceOptions:l,namespaceOptions:r}=Bl(),s=c(()=>He(i?.supportedLanguages),[i?.supportedLanguages]),d=c(()=>{if(i)return i.type===Ve.CustomInstrumentation?[]:je(i.supportedLanguages)},[i]);if(!a||!i)return t(xe,{title:"No active form"});const{formData:u,handleFormChange:p,formErrors:h}=a;return e(ee,{$gap:24,children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(we,{size:Te.XXXS,maxLines:2,children:i.description}),e(ue,{$gap:12,children:[t(ce,{options:[{icon:Ra,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Da,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:ke.S,selected:u.disabled,setSelected:e=>p("disabled",e)}),t(fe,{leftIcon:_a,variant:ve.Secondary,size:be.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(cr,{option:i,formState:u}),!!s.length&&e(ue,{$gap:12,children:[t(_e,{size:Te.XS,color:Pe.Secondary,nowrap:!0,children:"Supported Languages:"}),s.map(e=>t(Ge,{label:Ke(e),leftIcon:We(e),backgroundColor:o.v2.colors.purple[900]},e))]}),!n&&t(dr,{scopes:u.sourceScopes,onChange:e=>p("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:d,dataIdPrefix:"instrumentation-rule",slim:!0}),t(ye,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:u.ruleName,onChange:({target:{value:e}})=>p("ruleName",e),errorMessage:h.ruleName}),t(ys,{ruleType:i.type,dynamicFields:i.fields,value:u,setValue:(e,t)=>p(e,t),formErrors:h}),t(Ie,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:u.notes,onChange:({target:{value:e}})=>p("notes",e),errorMessage:h.notes})]})},Ss=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Xl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(Ye,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Je.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ve.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ve.Secondary,onClick:n}})},xs=({autoFocus:o})=>{const{dataStreams:n}=qe(),{genericForm:i,excludeName:a,editingName:l}=Xl(),{formData:r,formErrors:s,handleFormChange:d}=i,u=r.name,p=c(()=>n.find(e=>e.name===u&&e.name!==a),[n,u,a]);return e(ee,{$width:"100%",$gap:12,children:[t(ye,{name:"data-stream-name",label:Je.STREAM_NAME,placeholder:Je.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Je.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:s.name}),p&&t(Ee,{status:Ne.Warning,message:Je.DATA_STREAM_MERGE_WARNING(l,p.name),fullWidth:!0})]})},ws=()=>{const{selectedStreamName:e}=qe(),{genericForm:o}=Ul();if(!o)return t(xe,{title:"No active form"});const{formData:n,handleFormChange:i,formErrors:a}=o;return t(ye,{name:"sourceName",label:Je.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Ts=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],ks=b.div`
|
|
129
27
|
display: flex;
|
|
130
28
|
flex-direction: column;
|
|
131
29
|
gap: 24px;
|
|
132
|
-
`,
|
|
30
|
+
`,Is=b.div`
|
|
133
31
|
display: contents;
|
|
134
32
|
& > * {
|
|
135
33
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
136
34
|
transition: opacity 0.2s ease;
|
|
137
35
|
}
|
|
138
|
-
`,
|
|
36
|
+
`,Es=({value:e})=>{const o=v();return t(Ge,e?{status:Ne.Success,label:it,leftIcon:Ra}:{label:at,leftIcon:Da,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},Ns=({value:e,onChange:o})=>{const n=v(),i=c(()=>[{icon:Ra,label:it,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:Da,label:at,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ce,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},Os=()=>{const e=Vl();switch(e.formType){case Hl.Create:return t($s,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ns,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Hl.View:return e.data?e.isEditing?t($s,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Ns,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(As,{data:e.data,renderAction:()=>t(Es,{value:!e.data?.rule.disabled})}):null;case Hl.EditAutoNoisy:return t(Rs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:nt,sectionTitle:et,sectionSubTitle:ot,presetLabel:Qe,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Ns,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Hl.EditAutoCostReduction:return t(Rs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:tt,sectionTitle:et,presetLabel:Qe,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Ns,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Hl.EditAutoHighlyRelevant:return t(ks,{children:t(ur,{title:e.localEnabled?void 0:Ze,summary:e.summary,renderAction:()=>t(Ns,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},$s=({category:o,formData:n,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(ks,{children:[t(mr,{category:o,formState:n,renderAction:r}),e(Is,{$faded:!!n.disabled,children:[t(gr,{category:o,formState:n,onChange:i}),t(dr,{scopes:n.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(fr,{category:o,formState:n,onChange:i}),"highlyRelevant"===o&&t(br,{formState:n,onChange:i}),"highlyRelevant"===o&&t(vr,{ruleType:n.ruleType,formState:n,onChange:i}),t(yr,{category:o,formState:n,onChange:i})]})]}),As=({data:o,renderAction:n})=>e(ks,{children:[t(mr,{readOnly:!0,summary:o.summary,renderAction:n}),t(gr,{readOnly:!0,data:o}),t(dr,{readOnly:!0,scopes:x(o.rule.sourceScopes)}),t(fr,{readOnly:!0,data:o}),t(yr,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(vr,{readOnly:!0,rule:o.rule})]}),Rs=({enabled:o,summary:n,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:r,customInputName:s,showModeToggle:c=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=d(e=>p(e),[p]),y=d(e=>m(e),[m]),C=d(e=>f(e.target.value),[f]),S=!c||"sample"===u;return e(ks,{children:[t(ur,{title:o?void 0:i,summary:n,renderAction:b}),t(Is,{$faded:!o,children:e(lt,{richTitle:{title:a,subTitle:l},children:[c&&t(ee,{$alignItems:"flex-start",children:t(ce,{options:Ts,selected:u,setSelected:v})}),S&&t(pr,{description:r,options:hr,selected:h,onSelect:y,customName:s,customLabel:rt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Ds=b.div`
|
|
139
37
|
display: flex;
|
|
140
38
|
align-items: center;
|
|
141
39
|
justify-content: space-between;
|
|
@@ -148,27 +46,27 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
148
46
|
&:hover {
|
|
149
47
|
background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>o.v2.colors[t?"purple":"silver"][e?"700":"800"]};
|
|
150
48
|
}
|
|
151
|
-
`,
|
|
49
|
+
`,_s=b.div`
|
|
152
50
|
display: flex;
|
|
153
51
|
align-items: center;
|
|
154
52
|
justify-content: center;
|
|
155
53
|
padding: 8px;
|
|
156
54
|
border-radius: 8px;
|
|
157
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
158
|
-
`,
|
|
55
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+st["004"]};
|
|
56
|
+
`,Ps=({dataId:o,icon:n,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(Ds,{"data-id":o||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(ee,{$gap:4,children:[e(ue,{$gap:12,children:[m&&t(oe,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),n&&t(_s,{children:t(n,{size:20})}),t(_e,{size:Te.XS,children:i})]}),a&&t(_e,{size:Te.XXXS,color:Pe.Secondary,children:a})]}),(l||c)&&e(ue,{$gap:8,children:[c,l&&t(za,{size:18})]})]}),Ls=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{actionsApi:l}=Ml(),{platformType:r,version:s}=S(),[d,p]=a(""),h=u(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=Fl(),{options:v,loading:y}=l.useActionTypes(),C=c(()=>v.length?v:ct(r,s),[v,r,s]),x=c(()=>(d?C.filter(e=>e?.label?.toLowerCase().includes(d.toLowerCase())):C).filter(e=>!!e),[C,d]),w=c(()=>y?[t(dt,{$padding:"8px 12px",children:t(ut,{size:6})},"loading")]:x.map(e=>{const o=m?.type===e.type;return t(Ps,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)}),[y,m?.type,x,g]),T=c(()=>y?[t(dt,{$padding:"8px 12px",children:t(ut,{size:4})},"loading")]:m?[t(ds,{},m.type)]:[t(pt,{$height:"100%",children:t(xe,{icon:Ba,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(Cr,{ref:h,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await l.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:Je.CREATING_ACTION,subTitle:Je.CREATING_ACTION_SUBTITLE},header:{icon:Ba,title:Je.ADD_ACTION,subTitle:Je.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:d,onChange:p},leftColumn:{width:"40%",list:w},rightColumn:{width:"60%",list:T}})},Fs=({destinationsByCategory:n,filters:i,setFilters:a})=>{const l=c(()=>Object.values(ht).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),r=c(()=>{const e=Object.values($e).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(mt,{placeholder:"Select category",options:l,values:i.categoryType?[i.categoryType]:[],setValues:e=>a({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ce,{options:r,selected:i.signalType,setSelected:e=>a({...i,signalType:e})})]})},Ms=b.div`
|
|
159
57
|
display: flex;
|
|
160
58
|
flex-direction: column;
|
|
161
59
|
padding: 8px;
|
|
162
60
|
border-radius: 16px;
|
|
163
61
|
border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
|
|
164
62
|
background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
|
|
165
|
-
`,
|
|
63
|
+
`,zs=b.div`
|
|
166
64
|
display: flex;
|
|
167
65
|
align-items: center;
|
|
168
66
|
justify-content: space-between;
|
|
169
67
|
gap: 12px;
|
|
170
68
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
171
|
-
`,
|
|
69
|
+
`,Bs=({title:o,tooltip:n,list:i,noBgColor:l,purpleColors:r})=>{const[s,c]=a(!0);return e(Ms,{"data-id":`collapse-${o}`,$noBgColor:l,$purpleColors:r,children:[e(zs,{$isOpen:s,children:[e(ue,{$gap:10,children:[t(_e,{size:Te.XS,children:o}),n&&t(Fe,{text:n,withIcon:!0}),t(Ge,{label:i.length,status:r?Ne.Default:void 0})]}),t(gt,{icon:s?Ua:Va,size:ft.M,onClick:()=>c(e=>!e)})]}),s?t(ee,{children:i.length?p.toArray(i):t(pt,{$padding:"12px 0",children:t(xe,{})})}):null]})},Xs=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Re(e.supportedSignals).includes(o.signalType))):e,Us=({option:e,formData:o,testResult:n,isSelected:i,onSelect:a})=>t(Ps,{icon:yt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:i,onClick:()=>a(),children:n&&t(Ge,{status:n.succeeded?Ne.Success:Ne.Error,leftIcon:n.succeeded?Ha:ja})}),Vs=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:i,onChangeActiveForm:a}=zl();return o?.length?t(Bs,{title:vt[e].TITLE,tooltip:vt[e].DESCRIPTION,list:o.map((o,n)=>t(Us,{option:o,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=o.id&&""!==o.id?i?.option.id===o.id:i?.option.type===o.type),onSelect:()=>a({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(Bs,{purpleColors:!0,title:vt[e].TITLE,tooltip:vt[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(Us,{option:o,formData:n,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var Hs;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(Hs||(Hs={}));const js=(e,t)=>{const o=[],n=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Hs.SELF_HOSTED?n.push(...e.items):e.name===Hs.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=Ct(n),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const n=St(t.fields,{});Object.keys(n).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[i]))}}}),{[ht.DETECTED]:o,[ht.SELF_HOSTED]:n,[ht.MANAGED]:i}},Gs=({onClose:e,onBack:o,onNext:n,selectedConnectionIds:l,setSelectedConnectionIds:r,initialInputs:s,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=Ml(),[m,g]=a(""),[f,b]=a({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=zl();i(()=>{s&&I(s)},[s]);const E=C||x,N=c(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=a({[ht.ALL]:[],[ht.UNSAVED]:[],[ht.EXISTS]:[],[ht.DETECTED]:[],[ht.SELF_HOSTED]:[],[ht.MANAGED]:[]});i(()=>{const e=v.map(e=>{let t;for(const o of N){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=St(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});$(t=>({...t,[ht.EXISTS]:e}))},[v,N]),i(()=>{(y||S)&&$(e=>({...e,...js(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const o=De(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:a}=zl();return{width:"40%",list:c(()=>{const l=[];a.length&&l.push(t(Vs,{listType:ht.UNSAVED,unsavedDestinations:a},"unsaved"));for(const e of Object.values(ht)){if(i.categoryType&&i.categoryType!==e)continue;const a=Xs(o[e],n,i);a.length&&l.push(t(Vs,{listType:e,destinationOptions:a},e))}return e&&l.push(t(pt,{$height:"100%",children:t(bt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),l},[a,o,n,i,e])}})({isFetching:E,destinationsByCategory:O,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=zl();return{width:"60%",list:e?[t(ps,{},e.option.type)]:[t(pt,{$height:"100%",children:t(xe,{icon:Xa,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Cr,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:o?()=>o(k):void 0,onNext:n?()=>n(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:E,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:Je.CREATING_DESTINATION,subTitle:Je.CREATING_DESTINATION_SUBTITLE},header:{icon:Xa,title:Je.ADD_DESTINATIONS,subTitle:Je.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:l&&r?{value:l,setValue:r}:void 0,search:{value:m,onChange:g},filters:t(Fs,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},Ws=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{instrumentationRulesApi:l}=Ml(),[r,s]=a(""),d=u(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=Bl(),{options:f,loading:b}=l.useRuleTypes(),v=c(()=>f.length?f:xt,[f]),y=c(()=>r?v.filter(e=>e.label.toLowerCase().includes(r.toLowerCase())):v,[v,r]),C=c(()=>b?[t(dt,{$padding:"8px 12px",children:t(ut,{size:4})},"loading")]:y.map(e=>{const o=p?.type===e.type;return t(Ps,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{d.current?.clearErrors(),h(e)}},e.type)}),[b,p?.type,y,h]),S=c(()=>b?[t(dt,{$padding:"8px 12px",children:t(ut,{size:4})},"loading")]:p?[t(Cs,{},p.type)]:[t(pt,{$height:"100%",children:t(xe,{icon:Ga,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[b,p]);return t(Cr,{ref:d,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await l.create(t,p?.type)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Je.CREATING_INSTRUMENTATION_RULE,subTitle:Je.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ga,title:Je.ADD_INSTRUMENTATION_RULE,subTitle:Je.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:r,onChange:s},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:S}})},Ks={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Je.FETCHING_NAMESPACES,subTitle:Je.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Je.SELECT_NAMESPACE,subTitle:Je.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Ys={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===wt.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},Js=e=>e?Ys:Ks,qs="No matches",Zs=e=>(e?"Unselect":"Select")+" all",Qs="Selected",ec=b.div``,tc=b.div`
|
|
172
70
|
visibility: hidden;
|
|
173
71
|
|
|
174
72
|
transition: visibility 0s;
|
|
@@ -176,19 +74,19 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
176
74
|
transition-duration: 0s;
|
|
177
75
|
}
|
|
178
76
|
|
|
179
|
-
${
|
|
77
|
+
${ec}:hover & {
|
|
180
78
|
visibility: visible;
|
|
181
79
|
}
|
|
182
|
-
`,
|
|
80
|
+
`,oc=({workloadName:e,workloadKind:o,isChecked:n,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t(ec,{children:t(Ps,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:n,onCheckboxChange:a?r:i,children:a?t(Fe,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(Ge,{label:"Enterprise only",status:Ne.Default,textSize:Te.XXXS})}):t(tc,{children:t(Ge,{label:o,status:Ne.Info,textSize:Te.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},nc=b.div``,ic=b.div`
|
|
183
81
|
visibility: ${({$visible:e})=>e?"visible":"hidden"};
|
|
184
82
|
|
|
185
83
|
transition: visibility 0s;
|
|
186
84
|
${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
|
|
187
85
|
|
|
188
|
-
${
|
|
86
|
+
${nc}:hover & {
|
|
189
87
|
visibility: visible;
|
|
190
88
|
}
|
|
191
|
-
`,
|
|
89
|
+
`,ac=({clusterId:o,namespaceName:n,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isK8s:d}=S(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(nc,{children:t(Ps,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(ue,{$gap:12,children:[d&&t(ic,{$visible:r||a,children:t(Fe,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(le,{label:"Auto",labelAlign:re.Left,size:kt.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(ue,{$gap:8,children:[t(_e,{variant:It.Span,size:Te.XXXS,color:Pe.Secondary,align:"right",children:Qs}),t(Ge,{label:`${l.sourced}/${l.total}`,status:r?Ne.Default:Ne.Unknown,minWidth:"42px"})]})]})})})},lc=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:a,setSelectedArea:l,handleSourceChange:r})=>{const s=c(()=>i.map(({name:e,totalWorkloads:i,selectedCount:s,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(ac,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:s,total:i},isActive:a.clusterId===o&&a.namespaceName===e,onActive:()=>l({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:r},`${o}#${e}`)),[o,n,i,a]);return e?t(Bs,{title:n,list:s,noBgColor:!0}):s},rc=({onClose:o,onBack:n,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:s,withOverlay:d,disableAnimation:u})=>{const{isVm:p,isConnector:h}=S(),{sourcesApi:m,snapshotsApi:g,namespacesApi:f}=Ml(),{data:b,loading:v,refetch:y}=g.useSnapshots(),{items:C,loading:x,refetch:w}=f.useNamespaces(),T=Js(p||!!h),{selectedStreamName:k}=qe(),{progress:I,resetProgress:E}=Et(),{isFetching:N,setIsFetching:O,setSnapshots:$,formData:A,handleSourceChange:R,handleSelectAll:D,formDiff:_,isFormDirty:P}=Yl();i(()=>{y(),w()},[]);const L=c(()=>{if(b)return b;const e=C;return e.length?{clusters:[{clusterId:Ot,clusterName:Nt,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[b,C,k]);i(()=>{O(v||x),L&&$(L)},[L,v,x,O,$]);const[F,M]=a(""),[z,B]=a(wt.Namespace),[X,U]=a({showOnlySelected:!1}),[V,H]=a({clusterId:"",clusterName:"",namespaceName:""}),j=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:a,selectedArea:l,setSelectedArea:r,searchText:s,searchBy:d,filters:u})=>{const{isVm:p,isConnector:h}=S(),m=Js(p||!!h),g=c(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Wl(e,s,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Kl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,s,u]),f=c(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:b,withFilterCount:v,filteredCount:y,totalCount:C}=c(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(lc,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:l,setSelectedArea:r,handleSourceChange:i},e):null).filter(e=>null!==e),o=g.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=n.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:o!==a,filteredCount:o,totalCount:a}},[g,n,l]);return{width:"60%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(_e,{size:Te.XS,nowrap:!0,children:m.groupColumnHeader}),t(Fe,{text:v?Je.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ge,{label:`${v?`${y} / ${C}`:C}`,status:Ne.Unknown})})]}),t(_e,{"data-id":"namespaces-select-all",onClick:()=>a({boolean:!f,searchText:s,searchBy:d,filters:u}),disabled:!b.length,size:Te.XS,children:Zs(f)})]}),list:b.length?b:o?[t(pt,{$height:"100%",children:t(bt,{title:m.fetchingGroups.title,subTitle:m.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(pt,{$height:"100%",children:t(xe,s?{icon:Ka,title:qs,subTitle:m.noGroupMatchedFilter(s)}:{icon:Ka,title:m.noGroups.title,subTitle:m.noGroups.subTitle})},"no-data")]}})({isFetching:N,formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:V,setSelectedArea:H,searchText:z===wt.Namespace?F:"",searchBy:z,filters:X}),G=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:a,searchText:l,searchBy:r,filters:s})=>{const{tier:d,isVm:u,isConnector:p,isK8s:h}=S(),m=Js(u||!!p),g=d===Tt.Onprem,f=c(()=>a.value.namespaceName?o.find(({clusterId:e})=>e===a.value.clusterId)?.namespaces.find(({name:e})=>e===a.value.namespaceName):void 0,[o,a.value.clusterId,a.value.namespaceName]),b=c(()=>f?[...f.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>jl(e,l,s)):[],[f,l,s]),v=c(()=>!!b.length&&b.every(({selected:e})=>e),[b]),y=c(()=>{if(!f)return[];const{clusterId:e}=a.value,{name:o}=f;return b.map(({name:i,selected:a,kind:l,region:r})=>{const s=h&&!g&&Gl.has(l);return t(oc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:i,kind:l,region:r}}),disabled:s},`${e}#${o}#${i}#${l}#${r??""}`)})},[b,f,a.value.clusterId,n,h,g]),{withFilterCount:C,filteredCount:x,totalCount:w}=c(()=>{const e=f?.workloads.length??0;return{withFilterCount:b.length!==e,filteredCount:b.length,totalCount:e}},[b,f]);return{width:"40%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(_e,{size:Te.XS,nowrap:!0,children:a.value.namespaceName?`${a.value.namespaceName} > ${m.itemColumnHeader}`:m.itemColumnHeader}),t(Fe,{text:C?Je.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ge,{label:`${C?`${x} / ${w}`:w}`,status:Ne.Unknown})})]}),t(_e,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:a.value.clusterId,namespaceName:a.value.namespaceName,boolean:!v,searchText:l,searchBy:r,filters:s}),disabled:!y.length,size:Te.XS,children:Zs(v)})]}),list:y.length?y:[t(pt,{$height:"100%",children:t(xe,f?l?{icon:Wa,title:qs,subTitle:(T=l,`No sources matched the filter '${T}'`)}:{icon:Wa,title:"No sources",subTitle:m.noItemsInGroupSubTitle}:{icon:Wa,title:m.selectGroupPrompt.title,subTitle:m.selectGroupPrompt.subTitle})},"no-data")]};var T})({formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:{value:V},searchText:z===wt.Source?F:"",searchBy:z,filters:X});return t(Cr,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{E($t.BulkInstrumenting),o()}:void 0,onBack:n?()=>n(_):void 0,onNext:l?()=>l(_):void 0,nextIsSkip:!P,onSave:()=>m.persistV2(_),header:{icon:Wa,title:Je.ADD_SOURCE,subTitle:Je.ADD_SOURCES_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:F,onChange:e=>{M(e),z===wt.Namespace&&H({clusterId:"",clusterName:"",namespaceName:""})},placeholder:T.searchPlaceholder(z),segment:{options:[{label:T.groupSegmentLabel,value:wt.Namespace},{label:T.itemSegmentLabel,value:wt.Source}],selected:z,setSelected:B}},filters:e(ue,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:"Show only:"}),t(le,{name:"filter-selected",size:kt.S,label:Qs,value:X.showOnlySelected,onChange:e=>U(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:N,progress:{title:Je.CREATING_SOURCES,subTitle:Je.CREATING_SOURCES_SUBTITLE,percentage:I[$t.BulkInstrumenting]?.percentage||0},leftColumn:j,rightColumn:G})},sc={aws:Ya},cc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},dc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),uc=e=>e.provider.toUpperCase(),pc=b.div`
|
|
192
90
|
display: flex;
|
|
193
91
|
flex-direction: column;
|
|
194
92
|
gap: 8px;
|
|
@@ -196,7 +94,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
196
94
|
padding: 8px 12px;
|
|
197
95
|
border-radius: 16px 0 0 16px;
|
|
198
96
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
199
|
-
`,
|
|
97
|
+
`,hc=b.button`
|
|
200
98
|
display: flex;
|
|
201
99
|
align-items: center;
|
|
202
100
|
gap: 12px;
|
|
@@ -212,7 +110,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
212
110
|
&:hover {
|
|
213
111
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
214
112
|
}
|
|
215
|
-
`,
|
|
113
|
+
`,mc=b.div`
|
|
216
114
|
display: flex;
|
|
217
115
|
align-items: center;
|
|
218
116
|
justify-content: center;
|
|
@@ -221,13 +119,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
221
119
|
border-radius: 8px;
|
|
222
120
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
223
121
|
flex-shrink: 0;
|
|
224
|
-
`,
|
|
122
|
+
`,gc=b.div`
|
|
225
123
|
display: flex;
|
|
226
124
|
flex-direction: column;
|
|
227
125
|
gap: 2px;
|
|
228
126
|
flex: 1;
|
|
229
127
|
min-width: 0;
|
|
230
|
-
`,
|
|
128
|
+
`,fc=({providers:o,selectedProvider:n,onSelect:i})=>{const a=v();return o.length?t(pc,{children:o.map(o=>{const l=(e=>sc[e.provider]??Ja)(o),r=o.provider===n,s=(e=>{const t=e.features.find(e=>e.key===At.Discovery);if(!t)return"";const o=[],n=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=cc[t]??dc(t);n.has(i)||(n.add(i),o.push(i))}return o.join(", ")})(o);return e(hc,{type:"button",$selected:r,onClick:()=>i(o.provider),"data-id":`cloud-connector-provider-${o.provider}`,children:[t(mc,{children:t(l,{size:24})}),e(gc,{children:[t(_e,{size:Te.S,weight:400,lineHeight:"24px",color:Pe.Primary,children:uc(o)}),s&&t(_e,{size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:s})]}),t(za,{size:18,fill:a.v2.colors.silver[300]})]},o.provider)})}):t(_e,{size:Te.XS,color:Pe.Secondary,children:"No providers available."})},bc=b.div`
|
|
231
129
|
display: flex;
|
|
232
130
|
flex-direction: column;
|
|
233
131
|
gap: 8px;
|
|
@@ -237,15 +135,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
237
135
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
238
136
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
239
137
|
cursor: default;
|
|
240
|
-
`,
|
|
138
|
+
`,vc=b.div`
|
|
241
139
|
display: flex;
|
|
242
140
|
align-items: center;
|
|
243
141
|
gap: 4px;
|
|
244
142
|
width: 100%;
|
|
245
|
-
`,
|
|
143
|
+
`,yc=b.div`
|
|
246
144
|
flex: 1;
|
|
247
145
|
min-width: 0;
|
|
248
|
-
`,
|
|
146
|
+
`,Cc=b.div`
|
|
249
147
|
width: 100%;
|
|
250
148
|
max-height: 145px;
|
|
251
149
|
overflow: auto;
|
|
@@ -267,39 +165,39 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
267
165
|
transition: background-color 0.2s ease;
|
|
268
166
|
}
|
|
269
167
|
|
|
270
|
-
${
|
|
168
|
+
${bc}:hover & {
|
|
271
169
|
scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
|
|
272
170
|
}
|
|
273
171
|
|
|
274
|
-
${
|
|
172
|
+
${bc}:hover &::-webkit-scrollbar-thumb {
|
|
275
173
|
background-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
276
174
|
}
|
|
277
|
-
`,
|
|
175
|
+
`,Sc=b.pre`
|
|
278
176
|
margin: 0;
|
|
279
177
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
280
178
|
font-size: 12px;
|
|
281
179
|
line-height: 20px;
|
|
282
180
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
283
181
|
white-space: pre;
|
|
284
|
-
`,
|
|
182
|
+
`,xc=({policy:o})=>{const n=v(),{CopyButton:i}=Rt();return e(bc,{children:[e(vc,{children:[t(qa,{size:16,fill:n.v2.colors.silver[200]}),t(yc,{children:t(_e,{size:Te.XXS,color:Pe.Primary,children:Je.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:o,size:ft.XS})]}),t(Cc,{children:t(Sc,{children:o})})]})};var wc;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(wc||(wc={}));const Tc=[{id:wc.DiscoveryOnly,title:Je.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:Je.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[At.Discovery]},{id:wc.DiscoveryInstrumentation,title:Je.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:Je.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[At.Discovery,At.Instrumentation]},{id:wc.Custom,title:Je.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:Je.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],kc=(e,t)=>e.features?.find(e=>e.key===t),Ic=e=>{if(!e)return[];const t=kc(e,At.Discovery),o=kc(e,At.Instrumentation);return t?t.types.map(e=>{const t=o?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},Ec=()=>{const e=new Set,t=[];return{out:t,add:o=>o?.forEach(o=>{o&&!e.has(o)&&(e.add(o),t.push(o))})}},Nc=(e,t,o)=>{const n=t===wc.Custom?((e,t)=>{if(!e)return[];const o=Ic(e),n=kc(e,At.Discovery),i=o.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=Ec();return l(e.auth?.permissions),i&&l(n?.permissions),o.forEach(e=>{const o=t[e.typeName];o?.discovery&&l(e.discoveryPermissions),o?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,o??{}):((e,t)=>{if(!e)return[];const o=Tc.find(e=>e.id===t)?.featureKeys??[],{out:n,add:i}=Ec();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&o.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),n})(e,t),i={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:n,Resource:"*"}]};return JSON.stringify(i,null,2)},Oc=b.div`
|
|
285
183
|
width: 100%;
|
|
286
184
|
padding: 12px 16px;
|
|
287
185
|
border-radius: 12px;
|
|
288
186
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
289
187
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
290
|
-
|
|
188
|
+
`,$c=b.div`
|
|
291
189
|
display: grid;
|
|
292
190
|
grid-template-columns: minmax(0, 1fr) 120px 150px;
|
|
293
191
|
align-items: center;
|
|
294
192
|
row-gap: 16px;
|
|
295
193
|
column-gap: 8px;
|
|
296
|
-
`,
|
|
194
|
+
`,Ac=b.div`
|
|
297
195
|
display: flex;
|
|
298
196
|
align-items: center;
|
|
299
197
|
min-width: 0;
|
|
300
|
-
`,
|
|
198
|
+
`,Rc=b(Ac)`
|
|
301
199
|
justify-content: center;
|
|
302
|
-
`,
|
|
200
|
+
`,Dc={discovery:!1,instrumentation:!1},_c=({provider:o,capabilities:i,onCapabilitiesChange:a})=>{const l=Ic(o),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(Oc,{children:e($c,{children:[t(Ac,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Je.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(Rc,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Je.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(Rc,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:Je.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(o=>{const a=i[o.typeName]??Dc,l=void 0!==o.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(n.Fragment,{children:[t(Ac,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Primary,children:o.displayName})}),t(Rc,{children:t(le,{name:`cloud-connector-custom-${o.typeName}-discovery`,size:kt.S,value:s,disabled:a.instrumentation,onChange:e=>r(o.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(Rc,{children:t(le,{name:`cloud-connector-custom-${o.typeName}-instrumentation`,size:kt.S,value:a.instrumentation,disabled:!l,onChange:e=>r(o.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},o.typeName)})]})}):null},Pc=b.div`
|
|
303
201
|
display: flex;
|
|
304
202
|
flex-direction: column;
|
|
305
203
|
gap: 8px;
|
|
@@ -308,12 +206,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
308
206
|
padding: 8px;
|
|
309
207
|
border-radius: 0 16px 16px 0;
|
|
310
208
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
311
|
-
`,
|
|
209
|
+
`,Lc=b.div`
|
|
312
210
|
display: flex;
|
|
313
211
|
flex-direction: column;
|
|
314
212
|
gap: 8px;
|
|
315
213
|
width: 100%;
|
|
316
|
-
`,
|
|
214
|
+
`,Fc=b.div`
|
|
317
215
|
display: flex;
|
|
318
216
|
align-items: center;
|
|
319
217
|
gap: 10px;
|
|
@@ -321,7 +219,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
321
219
|
padding: 4px 12px 4px 4px;
|
|
322
220
|
border-radius: 8px;
|
|
323
221
|
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
324
|
-
`,
|
|
222
|
+
`,Mc=b.div`
|
|
325
223
|
display: flex;
|
|
326
224
|
align-items: center;
|
|
327
225
|
justify-content: center;
|
|
@@ -330,30 +228,30 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
330
228
|
border-radius: 6px;
|
|
331
229
|
flex-shrink: 0;
|
|
332
230
|
background-color: ${({theme:e})=>e.v2.colors.purple[800]};
|
|
333
|
-
`,
|
|
231
|
+
`,zc=({message:o})=>{const n=v();return e(Fc,{children:[t(Mc,{children:t(Za,{size:24})}),t(_e,{size:Te.XXS,color:n.v2.colors.purple[300],children:o})]})},Bc=({provider:o,selectedPermission:n,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(Pc,{children:Tc.map(r=>{const s=r.id===n,c=r.id===wc.Custom,d=s?e(Lc,{children:[c&&t(_c,{provider:o,capabilities:a,onCapabilitiesChange:l}),t(xc,{policy:Nc(o,r.id,a)})]}):void 0,u=s?t(zc,{message:c?Je.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:Je.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Dt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:u},r.id)})}),Xc=b.div`
|
|
334
232
|
display: flex;
|
|
335
233
|
flex-direction: column;
|
|
336
234
|
padding: 16px;
|
|
337
|
-
`,
|
|
235
|
+
`,Uc=b.div`
|
|
338
236
|
display: flex;
|
|
339
237
|
flex-direction: column;
|
|
340
238
|
gap: 16px;
|
|
341
239
|
padding: 16px;
|
|
342
240
|
border-radius: 16px;
|
|
343
241
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
344
|
-
`,
|
|
242
|
+
`,Vc=b.div`
|
|
345
243
|
display: flex;
|
|
346
244
|
flex-direction: column;
|
|
347
245
|
gap: 4px;
|
|
348
|
-
`,
|
|
246
|
+
`,Hc=b.div`
|
|
349
247
|
display: flex;
|
|
350
248
|
align-items: stretch;
|
|
351
249
|
width: 100%;
|
|
352
|
-
`,
|
|
250
|
+
`,jc=b.div`
|
|
353
251
|
display: flex;
|
|
354
252
|
flex: 0 0 40%;
|
|
355
253
|
min-width: 0;
|
|
356
|
-
`,
|
|
254
|
+
`,Gc=()=>{const{providers:o,genericForm:n}=Jl(),[l,r]=a(!0),s=c(()=>o.find(e=>e.provider===n.formData.provider),[o,n.formData.provider]);return i(()=>{!n.formData.provider&&o.length>0&&n.handleFormChange("provider",o[0].provider)},[o,n.formData.provider,n]),i(()=>{n.formData.permission||n.handleFormChange("permission",wc.DiscoveryInstrumentation)},[n.formData.permission,n]),t(Xc,{children:e(Uc,{children:[e(Vc,{children:[t(_e,{size:Te.S,weight:500,lineHeight:"24px",color:Pe.Primary,children:Je.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:Je.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),l&&t(Ee,{fullWidth:!0,smallIcon:!0,status:Ne.Info,message:Je.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:_t.CLOSE,onClick:()=>r(!1)}}),e(Hc,{children:[t(jc,{children:t(fc,{providers:o,selectedProvider:n.formData.provider,onSelect:e=>n.handleFormChange("provider",e)})}),t(Bc,{provider:s,selectedPermission:n.formData.permission,onSelect:e=>n.handleFormChange("permission",e),capabilities:n.formData.customCapabilities,onCapabilitiesChange:e=>n.handleFormChange("customCapabilities",e)})]})]})})},Wc=b.div`
|
|
357
255
|
display: flex;
|
|
358
256
|
flex-direction: column;
|
|
359
257
|
gap: 16px;
|
|
@@ -361,12 +259,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
361
259
|
padding: 12px;
|
|
362
260
|
border-radius: 8px;
|
|
363
261
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
364
|
-
`,
|
|
262
|
+
`,Kc=b.div`
|
|
365
263
|
display: flex;
|
|
366
264
|
align-items: center;
|
|
367
265
|
gap: 12px;
|
|
368
266
|
width: 100%;
|
|
369
|
-
`,
|
|
267
|
+
`,Yc=b.div`
|
|
370
268
|
display: flex;
|
|
371
269
|
align-items: center;
|
|
372
270
|
justify-content: center;
|
|
@@ -375,41 +273,41 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
375
273
|
height: 24px;
|
|
376
274
|
border-radius: 16px;
|
|
377
275
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
378
|
-
`,
|
|
276
|
+
`,Jc=b.div`
|
|
379
277
|
display: flex;
|
|
380
278
|
flex: 1;
|
|
381
279
|
flex-direction: column;
|
|
382
280
|
gap: 2px;
|
|
383
281
|
min-width: 0;
|
|
384
|
-
`,
|
|
282
|
+
`,qc=b.div`
|
|
385
283
|
display: flex;
|
|
386
284
|
flex-direction: column;
|
|
387
285
|
gap: 10px;
|
|
388
286
|
width: 100%;
|
|
389
287
|
padding-left: 32px;
|
|
390
|
-
`,
|
|
288
|
+
`,Zc=({"data-id":o,step:n,title:i,description:a,children:l})=>e(Wc,{"data-id":o,children:[e(Kc,{children:[t(Yc,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:n})}),e(Jc,{children:[t(_e,{size:Te.S,weight:400,lineHeight:"24px",color:Pe.Primary,children:i}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:a})]})]}),l&&t(qc,{children:l})]});var Qc,ed;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(Qc||(Qc={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})(ed||(ed={}));const td=[{id:Qc.AssumeRole,label:Je.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:Je.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:Qc.StaticKeys,label:Je.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:Je.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],od=[{id:ed.CloudFormation,label:Je.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:ed.Terraform,label:Je.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:ed.AwsCli,label:Je.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:ed.Manual,label:Je.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],nd={[ed.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[ed.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[ed.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[ed.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},id=b.div`
|
|
391
289
|
display: flex;
|
|
392
290
|
align-items: stretch;
|
|
393
291
|
gap: 10px;
|
|
394
292
|
width: 100%;
|
|
395
|
-
`,
|
|
293
|
+
`,ad=b.div`
|
|
396
294
|
display: flex;
|
|
397
295
|
flex: 2 1 0;
|
|
398
296
|
flex-direction: column;
|
|
399
297
|
gap: 12px;
|
|
400
298
|
min-width: 0;
|
|
401
299
|
padding: 12px 0;
|
|
402
|
-
`,
|
|
300
|
+
`,ld=b.div`
|
|
403
301
|
display: flex;
|
|
404
302
|
flex-direction: column;
|
|
405
303
|
gap: 8px;
|
|
406
304
|
width: 100%;
|
|
407
|
-
`,
|
|
305
|
+
`,rd=b.div`
|
|
408
306
|
display: flex;
|
|
409
307
|
align-items: center;
|
|
410
308
|
gap: 12px;
|
|
411
309
|
width: 100%;
|
|
412
|
-
`,
|
|
310
|
+
`,sd=b.div`
|
|
413
311
|
display: flex;
|
|
414
312
|
align-items: center;
|
|
415
313
|
justify-content: center;
|
|
@@ -418,7 +316,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
418
316
|
height: 24px;
|
|
419
317
|
border-radius: 16px;
|
|
420
318
|
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
421
|
-
`,
|
|
319
|
+
`,cd=b.div`
|
|
422
320
|
display: flex;
|
|
423
321
|
flex: 3 1 0;
|
|
424
322
|
flex-direction: column;
|
|
@@ -427,60 +325,60 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
427
325
|
border-radius: 12px;
|
|
428
326
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
429
327
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
430
|
-
`,
|
|
328
|
+
`,dd=b.div`
|
|
431
329
|
display: flex;
|
|
432
330
|
align-items: center;
|
|
433
331
|
justify-content: flex-end;
|
|
434
332
|
width: 100%;
|
|
435
|
-
`,
|
|
333
|
+
`,ud=b.div`
|
|
436
334
|
flex: 1;
|
|
437
335
|
width: 100%;
|
|
438
336
|
min-height: 200px;
|
|
439
337
|
max-height: 260px;
|
|
440
338
|
overflow: auto;
|
|
441
339
|
padding: 0 12px 12px;
|
|
442
|
-
`,
|
|
340
|
+
`,pd=b.pre`
|
|
443
341
|
margin: 0;
|
|
444
342
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
445
343
|
font-size: 12px;
|
|
446
344
|
line-height: 20px;
|
|
447
345
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
448
346
|
white-space: pre;
|
|
449
|
-
`,
|
|
347
|
+
`,hd=({step:o,setupMethod:n})=>{const i=v(),{CopyButton:a}=Rt(),{description:l,steps:r,code:s}=(e=>nd[e]??nd[ed.CloudFormation])(n);return t(Zc,{"data-id":"cloud-connector-create-role",step:o,title:Je.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(id,{children:[e(ad,{children:[t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:Je.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(ld,{children:r.map((o,a)=>e(rd,{children:[t(sd,{children:t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(_e,{size:Te.XXS,weight:400,lineHeight:"20px",color:Pe.Primary,children:o})]},`${n}-step-${a}`))})]}),e(cd,{children:[t(dd,{children:t(a,{value:s,size:ft.XS})}),t(ud,{children:t(pd,{children:s})})]})]})})},md=b.div`
|
|
450
348
|
display: flex;
|
|
451
349
|
flex-direction: column;
|
|
452
350
|
gap: 16px;
|
|
453
351
|
width: 100%;
|
|
454
|
-
`,
|
|
352
|
+
`,gd=b.div`
|
|
455
353
|
display: flex;
|
|
456
354
|
flex-wrap: wrap;
|
|
457
355
|
gap: 24px;
|
|
458
356
|
width: 100%;
|
|
459
|
-
`,
|
|
357
|
+
`,fd=b.div`
|
|
460
358
|
display: flex;
|
|
461
359
|
flex: 1 1 calc(50% - 12px);
|
|
462
360
|
min-width: 0;
|
|
463
|
-
`,
|
|
361
|
+
`,bd=b.div`
|
|
464
362
|
display: flex;
|
|
465
363
|
width: 100%;
|
|
466
364
|
max-width: 479px;
|
|
467
|
-
`,
|
|
365
|
+
`,vd=({step:o})=>{const{genericForm:n,providers:i}=Jl(),{provider:a,authMethod:l,awsAccountId:r,credentials:s}=n.formData,d=c(()=>i.find(e=>e.provider===a),[i,a]),u=c(()=>((e,t)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return[];const n=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return o.baseMethods?.forEach(e=>l(n.get(e)?.fields)),l(o.fields),a})(d,l),[d,l]);return t(Zc,{"data-id":"cloud-connector-enter-arn",step:o,title:Je.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:Je.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(md,{children:[t(bd,{children:t(ye,{name:"cloud-connector-aws-account-id",width:"100%",label:Je.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:Je.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:Je.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:r,onChange:e=>n.handleFormChange("awsAccountId",e.target.value)})}),u.length>0&&t(gd,{children:u.map(e=>t(fd,{children:t(ye,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Pt.Password:Pt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:s[e.name]??"",onChange:t=>{return o=e.name,i=t.target.value,void n.handleFormChange("credentials",{...s,[o]:i});var o,i}})},e.name))})]})})},yd=b.div`
|
|
468
366
|
display: flex;
|
|
469
367
|
flex-direction: column;
|
|
470
368
|
padding: 16px;
|
|
471
|
-
`,
|
|
369
|
+
`,Cd=b.div`
|
|
472
370
|
display: flex;
|
|
473
371
|
flex-direction: column;
|
|
474
372
|
gap: 12px;
|
|
475
373
|
padding: 16px 16px 12px;
|
|
476
374
|
border-radius: 16px;
|
|
477
375
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
478
|
-
`,
|
|
376
|
+
`,Sd=b.div`
|
|
479
377
|
display: flex;
|
|
480
378
|
align-items: center;
|
|
481
379
|
gap: 8px;
|
|
482
380
|
width: 100%;
|
|
483
|
-
`,
|
|
381
|
+
`,xd=b.button`
|
|
484
382
|
display: flex;
|
|
485
383
|
align-items: center;
|
|
486
384
|
justify-content: center;
|
|
@@ -497,24 +395,24 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
497
395
|
&:hover {
|
|
498
396
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
499
397
|
}
|
|
500
|
-
`,
|
|
398
|
+
`,wd=b.div`
|
|
501
399
|
display: flex;
|
|
502
400
|
flex: 1;
|
|
503
401
|
flex-direction: column;
|
|
504
402
|
gap: 4px;
|
|
505
403
|
min-width: 0;
|
|
506
|
-
`,
|
|
404
|
+
`,Td=b.div`
|
|
507
405
|
display: flex;
|
|
508
406
|
align-items: center;
|
|
509
407
|
gap: 4px;
|
|
510
408
|
padding: 8px 0 8px 2px;
|
|
511
|
-
`,
|
|
409
|
+
`,kd=({onBack:o})=>{const n=v(),{genericForm:a}=Jl(),l=a.formData.authMethod,r=a.formData.setupMethod;i(()=>{l||a.handleFormChange("authMethod",Qc.AssumeRole)},[l,a]),i(()=>{r||a.handleFormChange("setupMethod",ed.CloudFormation)},[r,a]);const s=td.find(e=>e.id===l)?.note;return t(yd,{children:e(Cd,{children:[e(Sd,{children:[t(xd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:o,"aria-label":Je.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(Qa,{size:24})}),e(wd,{children:[t(_e,{size:Te.S,weight:500,lineHeight:"24px",color:Pe.Primary,children:Je.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:Je.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE})]})]}),e(Zc,{"data-id":"cloud-connector-auth-method",step:1,title:Je.CLOUD_CONNECTOR_AUTH_TITLE,description:Je.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(ce,{"data-id":"cloud-connector-auth-method-segment",size:ke.S,selected:l,setSelected:e=>a.handleFormChange("authMethod",e),options:td.map(e=>({value:e.id,label:e.label}))}),s&&e(Td,{children:[t(el,{size:16,fill:n.v2.colors.silver[200]}),t(_e,{size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:s})]})]}),t(Zc,{"data-id":"cloud-connector-setup-method",step:2,title:Je.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:Je.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ce,{"data-id":"cloud-connector-setup-method-segment",size:ke.S,selected:r,setSelected:e=>a.handleFormChange("setupMethod",e),options:od.map(e=>({value:e.id,label:e.label}))})}),t(hd,{step:3,setupMethod:r}),t(vd,{step:4})]})})},Id=b.div`
|
|
512
410
|
display: flex;
|
|
513
411
|
flex-direction: column;
|
|
514
412
|
flex: 1;
|
|
515
413
|
min-height: 0;
|
|
516
414
|
padding: 16px;
|
|
517
|
-
`,
|
|
415
|
+
`,Ed=b.div`
|
|
518
416
|
display: flex;
|
|
519
417
|
flex-direction: column;
|
|
520
418
|
flex: 1;
|
|
@@ -522,13 +420,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
522
420
|
padding: 16px;
|
|
523
421
|
border-radius: 16px;
|
|
524
422
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
525
|
-
`,
|
|
423
|
+
`,Nd=b.div`
|
|
526
424
|
display: flex;
|
|
527
425
|
flex: 1;
|
|
528
426
|
align-items: center;
|
|
529
427
|
justify-content: center;
|
|
530
428
|
width: 100%;
|
|
531
|
-
`,
|
|
429
|
+
`,Od=b.div`
|
|
532
430
|
display: flex;
|
|
533
431
|
flex-direction: column;
|
|
534
432
|
align-items: center;
|
|
@@ -538,7 +436,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
538
436
|
padding: 24px 8px;
|
|
539
437
|
border-radius: 8px;
|
|
540
438
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
541
|
-
|
|
439
|
+
`,$d=b.div`
|
|
542
440
|
display: flex;
|
|
543
441
|
flex-direction: column;
|
|
544
442
|
align-items: center;
|
|
@@ -547,7 +445,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
547
445
|
padding: 16px;
|
|
548
446
|
border-radius: 12px;
|
|
549
447
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
550
|
-
`,
|
|
448
|
+
`,Ad=b.div`
|
|
551
449
|
display: flex;
|
|
552
450
|
align-items: center;
|
|
553
451
|
justify-content: center;
|
|
@@ -556,7 +454,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
556
454
|
height: 39px;
|
|
557
455
|
border-radius: 20px;
|
|
558
456
|
background-color: ${({theme:e})=>e.v2.colors.red[500]};
|
|
559
|
-
`,
|
|
457
|
+
`,Rd=b.div`
|
|
560
458
|
display: flex;
|
|
561
459
|
align-items: flex-start;
|
|
562
460
|
gap: 8px;
|
|
@@ -566,7 +464,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
566
464
|
padding: 12px;
|
|
567
465
|
border-radius: 8px;
|
|
568
466
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
569
|
-
`,
|
|
467
|
+
`,Dd=b.pre`
|
|
570
468
|
flex: 1;
|
|
571
469
|
min-width: 0;
|
|
572
470
|
margin: 0;
|
|
@@ -576,25 +474,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
576
474
|
color: ${({theme:e})=>e.v2.colors.silver[200]};
|
|
577
475
|
white-space: pre-wrap;
|
|
578
476
|
word-break: break-word;
|
|
579
|
-
`,
|
|
477
|
+
`,_d=b.div`
|
|
580
478
|
display: flex;
|
|
581
479
|
flex-direction: column;
|
|
582
480
|
gap: 12px;
|
|
583
481
|
width: 100%;
|
|
584
|
-
`,
|
|
482
|
+
`,Pd=b.div`
|
|
585
483
|
display: flex;
|
|
586
484
|
flex-wrap: wrap;
|
|
587
485
|
gap: 24px;
|
|
588
486
|
padding: 0 2px;
|
|
589
|
-
`,
|
|
487
|
+
`,Ld=b.div`
|
|
590
488
|
display: flex;
|
|
591
489
|
gap: 6px;
|
|
592
490
|
min-width: 0;
|
|
593
|
-
`,
|
|
491
|
+
`,Fd=b.div`
|
|
594
492
|
display: flex;
|
|
595
493
|
flex-direction: column;
|
|
596
494
|
gap: 8px;
|
|
597
|
-
`,
|
|
495
|
+
`,Md=b.div`
|
|
598
496
|
display: flex;
|
|
599
497
|
flex-direction: column;
|
|
600
498
|
gap: 6px;
|
|
@@ -602,7 +500,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
602
500
|
border-radius: 12px;
|
|
603
501
|
border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
|
|
604
502
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
605
|
-
`,mp=({isTesting:o,error:n,result:i})=>{const l=v(),{CopyButton:r}=Pt(),s=a(()=>i?.checks.filter(e=>!e.passed)??[],[i]),c=!(o||!n&&(!i||i.success)),d=n?et.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||et.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=n||s.map(e=>e.message).filter(Boolean).join("\n");return t(tp,{children:t(op,{children:o?t(np,{children:t(ip,{children:t(St,{withVisual:!0,withGradient:!0,title:et.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:he.XS})})}):c?t(np,{children:e(ap,{children:[t(lp,{children:t(Va,{size:20,fill:l.v2.colors.black[500]})}),t(pe,{size:he.XS,weight:400,lineHeight:"20px",color:ue.Primary,children:et.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(pe,{align:"center",size:he.XXXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:d}),p&&e(rp,{children:[t(sp,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):i?e(cp,{children:[t(qe,{status:Fe.Success,label:et.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Ua,fullWidth:!0}),(i.accountId||i.identity)&&e(dp,{children:[i.accountId&&e(pp,{children:[e(pe,{size:he.XXS,weight:500,color:ue.Secondary,children:[et.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(pe,{size:he.XXS,weight:400,color:ue.Primary,children:i.accountId})]}),i.identity&&e(pp,{children:[e(pe,{size:he.XXS,weight:500,color:ue.Secondary,children:[et.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(pe,{size:he.XXS,weight:400,color:ue.Primary,children:i.identity})]})]}),i.checks.length>0&&t(up,{children:i.checks.map(o=>e(hp,{$passed:o.passed,children:[t(qe,{status:o.passed?Fe.Success:Fe.Error,label:o.displayName,leftIcon:o.passed?Ua:Va}),o.message&&t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:o.message}),!o.passed&&o.remediation&&t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Primary,children:o.remediation})]},o.name))})]}):t(np,{children:t(pe,{size:he.XXS,weight:400,color:ue.Secondary,children:et.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var gp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(gp||(gp={}));const fp=gp.SelectProvider,bp=gp.Validate,vp=({onClose:o,withOverlay:n,onCreateCloudConnector:i,onCreated:l})=>{const{providers:c,genericForm:d}=Kl(),[p,u]=s(fp),[h,m]=s(!1),[g,f]=s(!1),[b,v]=s(void 0),[y,C]=s(void 0),[S,x]=s(void 0),w=d.isFormDirty,T=p===fp,k=p===bp,E=r(()=>{w&&!h?m(!0):(m(!1),o?.())},[w,h,o]),I=r(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>fp?e-1:e)},[]),N=r(()=>{if(x(void 0),p===gp.SelectProvider){if(!d.formData.provider)return void x("Please select a cloud provider");if(!d.formData.permission)return void x("Please select a permission level")}u(e=>e<bp?e+1:e)},[p,d.formData.provider,d.formData.permission]),$=r(async()=>{if(x(void 0),C(void 0),v(void 0),u(gp.Validate),!i)return;const{provider:e,permission:t,customCapabilities:o,awsAccountId:n,credentials:a,name:r}=d.formData,s=((e,t,o)=>{const n=td(e),i=[];return n.forEach(e=>{const n=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Zc.DiscoveryOnly:a=!0;break;case Zc.DiscoveryInstrumentation:a=!0,l=n;break;case Zc.Custom:{const t=o[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(c.find(t=>t.provider===e),t,o);f(!0);try{const t=await i({provider:e,displayName:r,credentials:a,expectedAccountId:n,capabilities:s});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[i,l,d.formData,c]),O=g,A=k&&!g&&(!!y||!!b&&!b.success),R=a(()=>S?{status:Fe.Error,message:S}:void 0,[S]),D=a(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:E,disabled:O}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:be.Text,leftIcon:Ja,onClick:I,disabled:O},[T,E,I,O]),_=a(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:be.Primary,rightIcon:Qa,onClick:$}:void 0}return p===gp.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:be.Primary,onClick:$,disabled:O}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:be.Primary,onClick:N,disabled:O}},[k,g,A,p,$,N,O]),P=a(()=>[D,_].filter(Boolean),[D,_]);return e(ce,{width:vr,isOpen:!0,hideOverlay:!O&&!n,header:{icon:Ka,title:et.CREATE_CLOUD_CONNECTOR,onClose:o?E:void 0,onCloseDisabled:O},footer:{note:R,actions:P},children:[p===gp.SelectProvider&&t(Sd,{}),p===gp.Config&&t(ep,{onBack:I}),p===gp.Validate&&t(mp,{isTesting:g,error:y,result:b}),t(yr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>o?.()})]})},yp=(e,t)=>{const o=[{id:"type",title:et.TYPE,label:t.label},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:et.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:et.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:et.NOTES,label:e.notes}),o},Cp=({onClose:n,actionId:l})=>{const c=v(),{isVm:d}=S(),{actionsApi:p}=Ll(),{items:u,refetch:h}=p.useActions(),{options:m}=p.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:b,genericForm:y}=Pl();i(()=>{h()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=C&&!!y?.isFormDirty,N=a(()=>u?.find(e=>zt(e)===l),[l,u]),$=a(()=>m.find(({type:e})=>e===N?.type)??Bt.find(({type:e})=>e===N?.type)??null,[m,N?.type]);i(()=>{N&&f(N,$)},[N,$]);const O=r(()=>{N&&x(!0)},[N]),A=r(()=>{N&&(f(N,$),x(!1))},[N,$,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await p.update(N.id,t),x(!1))}},[N,b,p]),L=r(()=>{N&&T(!0)},[N]),F=r(async()=>{N&&(await p.remove(N.id,N.type),n())},[N,p,n]);if(!N||!$)return null;const M=(e=>{const t=[],{type:o,fields:n}=e,i=e=>({status:e?Fe.Success:Fe.Unknown,label:e?"True":"False",invertColors:!0});if(o===Ae.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:i(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:i(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:i(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:i(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===Ae.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:i(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===Ae.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===Ae.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:i,regex:a},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),i&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:i}),a&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:a})})}return o===Ae.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const i=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${i}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,a)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${a}`,title:`${i}Workload${(e.workloadFilters?.length??0)>1?` #${a+1}`:""}`,label:l})});const a=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");a&&t.push({id:`group-${o}-templates`,title:`${i}Templates`,label:a}),e.notes&&t.push({id:`group-${o}-notes`,title:`${i}Notes`,label:e.notes})}),t})(N);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:Vt(N.type),title:$.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:_a,active:C,onClick:O},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ia,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:P}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:C&&g?t(Ms,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!d&&t(Ut,{conditions:N.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:yp(N,$)})]}),!!M?.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",cellsPerRow:2,items:M})})]})})})}),t(Cr,{target:"action",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(yr,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})},Sp=({onClose:o,connections:n,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=Ll(),[p,u]=s(""),[h,m]=s({showOnlySelected:!1}),g=a(()=>n.filter(e=>{const t=!p||e.name.toLowerCase().includes(p.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&o}),[n.length,r.length,p,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Ht(C||{rollout:{automaticRolloutDisabled:!1}}),k=l(T);k.current=T,i(()=>{C&&k.current(C)},[C]);const E=a(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(br,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:el,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:p,onChange:u},filters:e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(le,{size:Nt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:y,leftColumn:{width:"35%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(pe,{size:he.XS,children:"Clusters"}),t(qe,{label:g.length,status:Fe.Unknown})]}),e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,align:"right",children:"Selected clusters"}),t(qe,{label:`${r.length}/${g.length}`,status:Fe.Unknown})]})]}),list:g.map(e=>t(dc,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(pe,{size:he.XS,children:"Configurations"}),list:[t(le,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},xp=e=>{const t=[{id:"type",title:et.TYPE,label:e.destinationType.displayName},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}],o=Be(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:et.MONITORS,label:o}),e.name&&t.push({id:"name",title:et.NAME,label:e.name}),t},wp=({onClose:n,destinationId:c})=>{const d=v(),{isVm:p}=S(),{destinationsApi:u}=Ll(),{selectedStreamName:h}=tt(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Fl();i(()=>{g()},[]);const T=l(null),[k,E]=s(!1),[I,N]=s(!1),[$,O]=s(null),A=k&&!!w?.isFormDirty,R=a(()=>Gt(m,h),[m,h]),D=a(()=>R?.find(e=>zt(e)===c),[c,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&C(D,_)},[D,_]);const P=a(()=>D&&_?Wt(_,D):[],[D,_]),L=r(()=>{D&&E(!0)},[D]),F=r(()=>{D&&_&&(C(D,_),E(!1))},[D,_,C]),M=r(()=>{A?O("close"):n()},[A,n]),z=r(()=>{A?O("cancel"):F()},[A,F]),B=r(()=>{const e=$;O(null),"close"===e?(F(),n()):F()},[$,F,n]),X=r(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Ue(t)),E(!1))}},[D,x,u]),U=r(()=>{D&&N(!0)},[D]),V=r(async()=>{D&&(await u.remove(D.id),n())},[D,u,n]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const o=[],n=jt(e,t),i=n.map(e=>({name:e.key,value:e.value})),a=Be(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Ie(h,a,i))return;const{type:g}=Ne(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(p===Ee.MultiInput){const t=Ne(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(p===Ee.KeyValuePair){const t=Ne(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(D,P);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:_a,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ia,color:d.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:z},...y?.option.testConnectionSupported&&!p?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:be.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:X}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t(Xs,{ref:T,isEdit:!0}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!p&&t(Ut,{conditions:D.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:xp(D)})]}),!!G.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Xt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Xt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Cr,{target:"destination",isOpen:I,onClose:()=>N(!1),onApprove:V}),t(yr,{isOpen:null!==$,onClose:()=>O(null),onApprove:B})]})},Tp=(e,t)=>{const o=[{id:"type",title:et.TYPE,label:t.label},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}];return e.ruleName&&o.push({id:"name",title:et.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:et.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:et.NOTES,label:e.notes}),o},kp=({onClose:n,ruleId:l})=>{const c=v(),{addNotification:d}=Yt(),{isVm:p}=S(),{instrumentationRulesApi:u}=Ll(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Ml();i(()=>{m()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=C&&!!y?.isFormDirty,N=a(()=>h?.find(e=>zt(e)===l),[l,h]),$=a(()=>kt.find(({type:e})=>e===N?.type)??null,[N?.type]);i(()=>{N&&f(N)},[N]);const O=r(()=>{if(N){if(!N.mutable)return void d({type:Fe.Warning,title:qt.FORBIDDEN,message:qt.CANNOT_EDIT_RULE,crdType:Et.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});x(!0)}},[N,d]),A=r(()=>{N&&(f(N),x(!1))},[N,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update(N.ruleId,t,N.type),x(!1))}},[N,b,u]),L=r(()=>{if(N){if(!N.mutable)return void d({type:Fe.Warning,title:qt.FORBIDDEN,message:qt.CANNOT_DELETE_RULE,crdType:Et.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});T(!0)}},[N,d]),F=r(async()=>{N&&(await u.remove(N.ruleId,N.type),n())},[N,u,n]);if(!N||!$)return null;const M=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(pe,{size:he.XS,children:`• ${Kt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(pe,{size:he.XS,children:`• ${Kt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[He.HeaderKeys]?.length&&e.headersCollection[He.HeaderKeys].forEach((e,o)=>{e&&n.push(t(pe,{size:he.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ke.Java]?.forEach((e,i)=>{const a=new We(e.className,e.methodName);if(a.Verify()){0===i&&n.push(t(pe,{size:he.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=a.toString();n.push(t(pe,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${i}-${e}`))}}),e.customInstrumentations[Ke.Golang]?.forEach((e,i)=>{const a=new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(a.Verify()){0===i&&n.push(t(pe,{size:he.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=a.toString();n.push(t(pe,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${i}-${e}`))}})),n})(N,c);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:Zt(N.type),title:$.label,onClose:R,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:_a,active:C,onClick:O},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ia,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:P}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:C&&g?t(Ys,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!p&&t(Ut,{conditions:N.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:Tp(N,$)})]}),!p&&t(rr,{readOnly:!0,scopes:N.sourceScopes??null}),!!M.length&&t(Xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:M})}),!!$.supportedLanguages.length&&t(Xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:t(me,{$gap:12,$wrap:"wrap",children:$.supportedLanguages.map(e=>t(Jt,{label:Je[e],leftIcon:Ze(e),flex:"0.5"},e))})})})]})})})}),t(Cr,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(yr,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})};var Ep;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Ep||(Ep={}));const Ip=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=Qt(),m=eo(!!o),g=a(()=>({title:l,icon:tl,withCopy:!0}),[l]),f=a(()=>{const e=[],t=to(c);t&&e.push(t);const o=to(d,ol,"health");o&&e.push(o);const n=to(p,nl,"health");return n&&e.push(n),e},[c,d,p]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Qa,label:Ft.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:et.NODE,label:r,withCopy:!0},{id:"age",title:et.AGE,label:s?h(s,{style:"short"}):et.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Xt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Np=b.div`
|
|
503
|
+
`,zd=({isTesting:o,error:n,result:i})=>{const a=v(),{CopyButton:l}=Rt(),r=c(()=>i?.checks.filter(e=>!e.passed)??[],[i]),s=!(o||!n&&(!i||i.success)),d=n?Je.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:r[0]?.remediation||r[0]?.message||Je.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,u=n||r.map(e=>e.message).filter(Boolean).join("\n");return t(Id,{children:t(Ed,{children:o?t(Nd,{children:t(Od,{children:t(bt,{withVisual:!0,withGradient:!0,title:Je.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:Te.XS})})}):s?t(Nd,{children:e($d,{children:[t(Ad,{children:t(ja,{size:20,fill:a.v2.colors.black[500]})}),t(_e,{size:Te.XS,weight:400,lineHeight:"20px",color:Pe.Primary,children:Je.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(_e,{align:"center",size:Te.XXXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:d}),u&&e(Rd,{children:[t(Dd,{children:u}),t(l,{value:u,size:ft.XS})]})]})}):i?e(_d,{children:[t(Ge,{status:Ne.Success,label:Je.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Ha,fullWidth:!0}),(i.accountId||i.identity)&&e(Pd,{children:[i.accountId&&e(Ld,{children:[e(_e,{size:Te.XXS,weight:500,color:Pe.Secondary,children:[Je.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(_e,{size:Te.XXS,weight:400,color:Pe.Primary,children:i.accountId})]}),i.identity&&e(Ld,{children:[e(_e,{size:Te.XXS,weight:500,color:Pe.Secondary,children:[Je.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(_e,{size:Te.XXS,weight:400,color:Pe.Primary,children:i.identity})]})]}),i.checks.length>0&&t(Fd,{children:i.checks.map(o=>e(Md,{$passed:o.passed,children:[t(Ge,{status:o.passed?Ne.Success:Ne.Error,label:o.displayName,leftIcon:o.passed?Ha:ja}),o.message&&t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Secondary,children:o.message}),!o.passed&&o.remediation&&t(_e,{size:Te.XXS,weight:400,lineHeight:"normal",color:Pe.Primary,children:o.remediation})]},o.name))})]}):t(Nd,{children:t(_e,{size:Te.XXS,weight:400,color:Pe.Secondary,children:Je.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var Bd;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(Bd||(Bd={}));const Xd=Bd.SelectProvider,Ud=Bd.Validate,Vd=({onClose:o,withOverlay:n,onCreateCloudConnector:i,onCreated:l})=>{const{providers:r,genericForm:s}=Jl(),[u,p]=a(Xd),[h,m]=a(!1),[g,f]=a(!1),[b,v]=a(void 0),[y,C]=a(void 0),[S,x]=a(void 0),w=s.isFormDirty,T=u===Xd,k=u===Ud,I=d(()=>{w&&!h?m(!0):(m(!1),o?.())},[w,h,o]),E=d(()=>{x(void 0),C(void 0),v(void 0),p(e=>e>Xd?e-1:e)},[]),N=d(()=>{if(x(void 0),u===Bd.SelectProvider){if(!s.formData.provider)return void x("Please select a cloud provider");if(!s.formData.permission)return void x("Please select a permission level")}p(e=>e<Ud?e+1:e)},[u,s.formData.provider,s.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),p(Bd.Validate),!i)return;const{provider:e,permission:t,customCapabilities:o,awsAccountId:n,credentials:a,name:c}=s.formData,d=((e,t,o)=>{const n=Ic(e),i=[];return n.forEach(e=>{const n=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case wc.DiscoveryOnly:a=!0;break;case wc.DiscoveryInstrumentation:a=!0,l=n;break;case wc.Custom:{const t=o[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(r.find(t=>t.provider===e),t,o);f(!0);try{const t=await i({provider:e,displayName:c,credentials:a,expectedAccountId:n,capabilities:d});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[i,l,s.formData,r]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),R=c(()=>S?{status:Ne.Error,message:S}:void 0,[S]),D=c(()=>T?{"data-id":"cloud-connector-cancel",label:_t.CANCEL,variant:ve.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:_t.BACK,variant:ve.Text,leftIcon:Qa,onClick:E,disabled:$},[T,I,E,$]),_=c(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:_t.RETRY,variant:ve.Primary,rightIcon:tl,onClick:O}:void 0}return u===Bd.Config?{"data-id":"cloud-connector-verify",label:_t.VERIFY_AND_CREATE_CONNECTOR,variant:ve.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:_t.NEXT,variant:ve.Primary,onClick:N,disabled:$}},[k,g,A,u,O,N,$]),P=c(()=>[D,_].filter(Boolean),[D,_]);return e(Lt,{width:Sr,isOpen:!0,hideOverlay:!$&&!n,header:{icon:Ja,title:Je.CREATE_CLOUD_CONNECTOR,onClose:o?I:void 0,onCloseDisabled:$},footer:{note:R,actions:P},children:[u===Bd.SelectProvider&&t(Gc,{}),u===Bd.Config&&t(kd,{onBack:E}),u===Bd.Validate&&t(zd,{isTesting:g,error:y,result:b}),t(xr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>o?.()})]})},Hd=(e,t)=>{const o=[{id:"type",title:Je.TYPE,label:t.label},{id:"status",title:Je.STATUS,badge:{status:e.disabled?Ne.Unknown:Ne.Success,label:e.disabled?Je.DISABLED:Je.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:Je.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Je.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Je.NOTES,label:e.notes}),o},jd=e=>({status:e?Ne.Success:Ne.Unknown,label:e?"True":"False",invertColors:!0}),Gd=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Wd=e=>null==e||""===e?"-":"boolean"==typeof e?e?"True":"False":"number"==typeof e?String(e):"string"==typeof e?e||"-":JSON.stringify(e),Kd=({onClose:n,actionId:l})=>{const r=v(),{isVm:s}=S(),{actionsApi:u}=Ml(),{items:p,refetch:h}=u.useActions(),{options:m}=u.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:b,genericForm:y}=Fl();i(()=>{h()},[]);const[C,x]=a(!1),[w,T]=a(!1),[k,I]=a(null),E=C&&!!y?.isFormDirty,N=c(()=>p?.find(e=>zt(e)===l),[l,p]),O=c(()=>m.find(({type:e})=>e===N?.type)??Bt.find(({type:e})=>e===N?.type)??null,[m,N?.type]);i(()=>{N&&f(N,O)},[N,O]);const $=d(()=>{N&&x(!0)},[N]),A=d(()=>{N&&(f(N,O),x(!1))},[N,O,f]),R=d(()=>{E?I("close"):n()},[E,n]),D=d(()=>{E?I("cancel"):A()},[E,A]),_=d(()=>{const e=k;I(null),"close"===e?(A(),n()):A()},[k,A,n]),P=d(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update(N.id,t),x(!1))}},[N,b,u]),L=d(()=>{N&&T(!0)},[N]),F=d(async()=>{N&&(await u.remove(N.id,N.type),n())},[N,u,n]);if(!N||!O)return null;const M=((e,t)=>{if(t?.fields?.length)return((e,t)=>{const o=[],n=e.fields||{},i=e.signals||[],a=Object.entries(n).map(([e,t])=>({name:e,key:e,value:t}));return t.forEach(e=>{if(!e?.name||e.componentType===Ft.SourceScopes)return;if(e.renderCondition?.length&&!Mt(e.renderCondition,i,a))return;const t=e.displayName||e.name,l=n[e.name],r=St(e.componentProperties,{});switch(e.componentType){case Ft.Toggle:case Ft.Checkbox:return void o.push({id:e.name,title:t,badge:jd(!!l)});case Ft.CheckboxList:{const i=r.valueMode||"object";if("array"===i){const n=Array.isArray(l)?l.map(String):[];return void o.push({id:e.name,title:t,label:n.length?n.join(", "):"-"})}if("flatFields"===i)return void(Array.isArray(r.options)?r.options:[]).forEach(e=>{const t="string"==typeof e?{id:e,label:e}:e,i=String(t.id??"");i&&o.push({id:i,title:t.label||t.displayName||i,badge:jd(!0===n[i])})});const a=Gd(l)?l:{},s=Object.entries(a).filter(([,e])=>!!e).map(([e])=>e);return void o.push({id:e.name,title:t,label:s.length?s.join(", "):"-"})}case Ft.MultiInput:{const n=r.wrapKey,i=r.itemWrapperKey,a=n&&Gd(l)?l[n]:l;if(Array.isArray(a)&&a.length){const n=a.map(e=>i&&Gd(e)?String(e[i]??""):String(e??""));return void o.push({id:e.name,title:t,label:n.filter(Boolean).join(", ")||"-"})}return void o.push({id:e.name,title:t,label:"-"})}case Ft.KeyValuePair:return Gd(l)&&Object.keys(l).length?void Object.entries(l).forEach(([t,n],i)=>{o.push({id:`${e.name}-${i}`,title:t,label:String(n??"")})}):Array.isArray(l)&&l.length?void l.forEach((t,n)=>{const i=Gd(t)?t:{};o.push({id:`${e.name}-${n}`,title:String(i.key??""),label:String(i.value??"")})}):void o.push({id:e.name,title:t,label:"-"});case Ft.MultiTabledInput:{const n=r.wrapKey,i=Array.isArray(n&&Gd(l)?l[n]:l)?n&&Gd(l)?l[n]:l:[];return i.length?void i.forEach((n,a)=>{const l=i.length>1?`${t} #${a+1} `:`${t} `;Object.entries(n||{}).forEach(([t,n])=>{null!=n&&""!==n&&o.push({id:`${e.name}-${a}-${t}`,title:`${l}${t}`,label:Wd(n)})})}):void o.push({id:e.name,title:t,label:"-"})}case Ft.FieldGroup:{const n=Array.isArray(l)?l:[];return n.length?void n.forEach((i,a)=>{const l=n.length>1?`${t} #${a+1} `:`${t} `;Object.entries(i||{}).forEach(([t,n])=>{null!=n&&""!==n&&o.push({id:`${e.name}-${a}-${t}`,title:`${l}${t}`,label:Wd(n)})})}):void o.push({id:e.name,title:t,label:"-"})}default:o.push({id:e.name,title:t,label:Wd(l)})}}),o})(e,t.fields);const o=[],{type:n,fields:i}=e;if(n===Se.K8sAttributes&&(o.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:jd(i.collectContainerAttributes)}),o.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:jd(i.collectReplicaSetAttributes)}),o.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:jd(i.collectWorkloadId)}),o.push({id:"collectClusterId",title:"Collect Cluster ID",badge:jd(i.collectClusterId)}),i.labelsAttributes?.forEach(({labelKey:e,attributeKey:t,from:n,fromSources:a},l)=>{const r=a?.length?a.join(", "):n||ae.Pod,s=(i.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";o.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),o.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:t}),o.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),i.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:t,from:n,fromSources:a},l)=>{const r=a?.length?a.join(", "):n||ae.Pod,s=(i.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";o.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),o.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:t}),o.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),n===Se.AddClusterInfo&&(o.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:jd(i.overwriteExistingValues)}),i.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:t},n)=>{o.push({id:`cluster-attr-${n}`,title:e,label:t})})),n===Se.DeleteAttributes&&i.attributeNamesToDelete?.forEach((e,t)=>{o.push({id:`del-attr-${t}`,title:"Attribute"+((i.attributeNamesToDelete?.length??0)>1?` #${t+1}`:""),label:e})}),n===Se.RenameAttributes&&Object.entries(i.renames||{}).forEach(([e,t],n)=>{o.push({id:`rename-${n}`,title:e,label:t})}),n===Se.PiiMasking&&i.piiCategories?.forEach((e,t)=>{o.push({id:`pii-${t}`,title:"Category"+((i.piiCategories?.length??0)>1?` #${t+1}`:""),label:e})}),n===Se.ExtractAttribute){const e=i.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:t,lookupKey:n,dataFormat:i,regex:a},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";o.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:t||"-"}),n&&o.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),i&&o.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:i}),a&&o.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:a})})}return n===Se.URLTemplatization&&i.urlTemplatizationRulesGroups?.forEach((e,t)=>{const n=(i.urlTemplatizationRulesGroups?.length??0)>1?`Group #${t+1} `:"Group ";e.filterK8sNamespace&&o.push({id:`group-${t}-ns`,title:`${n}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((i,a)=>{const l=[i.kind,i.name].filter(Boolean).join("/");l&&o.push({id:`group-${t}-wf-${a}`,title:`${n}Workload${(e.workloadFilters?.length??0)>1?` #${a+1}`:""}`,label:l})});const a=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");a&&o.push({id:`group-${t}-templates`,title:`${n}Templates`,label:a}),e.notes&&o.push({id:`group-${t}-notes`,title:`${n}Notes`,label:e.notes})}),o})(N,O),z=O.fields?.find(e=>e.componentType===Ft.SourceScopes),B=z?.name||Q.Scopes,X=N.fields?.[B]??null,U=!(s||!z&&void 0===N.fields?.scopes);return e(o,{children:[t(Lt,{isOpen:!0,header:{icon:Vt(N.type),title:O.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:_t.EDIT,icon:La,active:C,onClick:$},{id:"edit-action-btn-delete",label:_t.DELETE,icon:Oa,color:r.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-action-btn-cancel",label:_t.CANCEL,variant:ve.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:_t.SAVE,variant:ve.Primary,onClick:P}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:C&&g?t(ds,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!s&&t(Ut,{conditions:N.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:Hd(N,O)})]}),U&&t(dr,{readOnly:!0,scopes:X}),!!M?.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",cellsPerRow:2,items:M})})]})})})}),t(wr,{target:"action",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(xr,{isOpen:null!==k,onClose:()=>I(null),onApprove:_})]})},Yd=({onClose:o,connections:n,selectedConnectionIds:l,setSelectedConnectionIds:r})=>{const{configApi:s}=Ml(),[d,p]=a(""),[h,m]=a({showOnlySelected:!1}),g=c(()=>n.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&l.includes(e.id);return t&&o}),[n.length,l.length,d,h]),f=e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===l.length?l[0]:void 0,{data:v,loading:y}=s.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=c(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Ht(C||{rollout:{automaticRolloutDisabled:!1}}),k=u(T);k.current=T,i(()=>{C&&k.current(C)},[C]);const I=c(()=>l.length>1||void 0!==C&&!w(C,S),[l.length,C,S]);return t(Cr,{isOpen:!0,onClose:o,onSave:async()=>await(s.applyConfigurations?.(S,l))??void 0,header:{icon:ol,title:"Cluster Configuration"},connectionIds:{value:l,setValue:r},search:{placeholder:"Search by cluster name",value:d,onChange:p},filters:e(ue,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:"Show only:"}),t(le,{size:kt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(_e,{size:Te.XS,children:"Clusters"}),t(Ge,{label:g.length,status:Ne.Unknown})]}),e(ue,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,align:"right",children:"Selected clusters"}),t(Ge,{label:`${l.length}/${g.length}`,status:Ne.Unknown})]})]}),list:g.map(e=>t(Ps,{title:e.name,isChecked:l.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(_e,{size:Te.XS,children:"Configurations"}),list:[t(le,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Jd=e=>{const t=[{id:"type",title:Je.TYPE,label:e.destinationType.displayName},{id:"status",title:Je.STATUS,badge:{status:e.disabled?Ne.Unknown:Ne.Success,label:e.disabled?Je.DISABLED:Je.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:Je.MONITORS,label:o}),e.name&&t.push({id:"name",title:Je.NAME,label:e.name}),t},qd=({onClose:n,destinationId:l})=>{const r=v(),{isVm:s}=S(),{destinationsApi:p}=Ml(),{selectedStreamName:h}=qe(),{items:m,refetch:g}=p.useDestinations(),{data:f,loading:b}=p.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=zl();i(()=>{g()},[]);const T=u(null),[k,I]=a(!1),[E,N]=a(!1),[O,$]=a(null),A=k&&!!w?.isFormDirty,R=c(()=>Gt(m,h),[m,h]),D=c(()=>R?.find(e=>zt(e)===l),[l,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&C(D,_)},[D,_]);const P=c(()=>D&&_?Wt(_,D):[],[D,_]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&_&&(C(D,_),I(!1))},[D,_,C]),M=d(()=>{A?$("close"):n()},[A,n]),z=d(()=>{A?$("cancel"):F()},[A,F]),B=d(()=>{const e=O;$(null),"close"===e?(F(),n()):F()},[O,F,n]),X=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await p.update(D.id,De(t)),I(!1))}},[D,x,p]),U=d(()=>{D&&N(!0)},[D]),V=d(async()=>{D&&(await p.remove(D.id),n())},[D,p,n]);if(!D)return null;const{icon:H,iconSrc:j}=yt(D.destinationType.type),G=((e,t)=>{const o=[],n=jt(e,t),i=n.map(e=>({name:e.key,value:e.value})),a=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:m}=c||{};if(h?.length&&Mt(h,a,i))return;const{type:g}=St(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===Ft.MultiInput){const t=St(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===Ft.KeyValuePair){const t=St(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(D,P);return e(o,{children:[t(Lt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:_t.EDIT,icon:La,active:k,onClick:L},{id:"edit-destination-btn-delete",label:_t.DELETE,icon:Oa,color:r.v2.colors.red[500],active:E,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:_t.CANCEL,variant:ve.Secondary,onClick:z},...y?.option.testConnectionSupported&&!s?[{"data-id":"edit-destination-btn-test-connection",label:_t.TEST_CONNECTION,variant:ve.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:_t.SAVE,variant:ve.Primary,onClick:X}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:b?t(pt,{$height:"50vh",children:t(bt,{withSpinner:!0})}):k&&y?t(ps,{ref:T,isEdit:!0}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!s&&t(Ut,{conditions:D.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:Jd(D)})]}),!!G.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Xt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Xt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(wr,{target:"destination",isOpen:E,onClose:()=>N(!1),onApprove:V}),t(xr,{isOpen:null!==O,onClose:()=>$(null),onApprove:B})]})},Zd=(e,t)=>{const o=[{id:"type",title:Je.TYPE,label:t.label},{id:"status",title:Je.STATUS,badge:{status:e.disabled?Ne.Unknown:Ne.Success,label:e.disabled?Je.DISABLED:Je.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Je.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Je.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Je.NOTES,label:e.notes}),o},Qd=({onClose:n,ruleId:l})=>{const r=v(),{addNotification:s}=Yt(),{isVm:u}=S(),{instrumentationRulesApi:p}=Ml(),{items:h,refetch:m}=p.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Bl();i(()=>{m()},[]);const[C,x]=a(!1),[w,T]=a(!1),[k,I]=a(null),E=C&&!!y?.isFormDirty,{options:N}=p.useRuleTypes(),O=c(()=>N.length?N:xt,[N]),$=c(()=>h?.find(e=>zt(e)===l),[l,h]),A=c(()=>O.find(({type:e})=>e===$?.type)??null,[O,$?.type]),R=c(()=>He(A?.supportedLanguages),[A?.supportedLanguages]);i(()=>{$&&A&&f($,A)},[$,A]);const D=d(()=>{if($){if(!$.mutable)return void s({type:Ne.Warning,title:Jt.FORBIDDEN,message:Jt.CANNOT_EDIT_RULE,crdType:wt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});x(!0)}},[$,s]),_=d(()=>{$&&A&&(f($,A),x(!1))},[$,A,f]),P=d(()=>{E?I("close"):n()},[E,n]),L=d(()=>{E?I("cancel"):_()},[E,_]),F=d(()=>{const e=k;I(null),"close"===e?(_(),n()):_()},[k,_,n]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await p.update($.ruleId,t,$.type),x(!1))}},[$,b,p]),z=d(()=>{if($){if(!$.mutable)return void s({type:Ne.Warning,title:Jt.FORBIDDEN,message:Jt.CANNOT_DELETE_RULE,crdType:wt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});T(!0)}},[$,s]),B=d(async()=>{$&&(await p.remove($.ruleId,$.type),n())},[$,p,n]);if(!$||!A)return null;const X=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(_e,{size:Te.XS,children:`• ${Kt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(_e,{size:Te.XS,children:`• ${Kt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Me.HeaderKeys]?.length&&e.headersCollection[Me.HeaderKeys].forEach((e,o)=>{e&&n.push(t(_e,{size:Te.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ue.Java]?.forEach((e,i)=>{const a=new Xe(e.className,e.methodName);if(a.Verify()){0===i&&n.push(t(_e,{size:Te.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=a.toString();n.push(t(_e,{size:Te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${i}-${e}`))}}),e.customInstrumentations[Ue.Golang]?.forEach((e,i)=>{const a=new Be(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(a.Verify()){0===i&&n.push(t(_e,{size:Te.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=a.toString();n.push(t(_e,{size:Te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${i}-${e}`))}})),n})($,r);return e(o,{children:[t(Lt,{isOpen:!0,header:{icon:Zt($.type),title:A.label,onClose:P,actions:[{id:"edit-rule-btn-edit",label:_t.EDIT,icon:La,active:C,onClick:D},{id:"edit-rule-btn-delete",label:_t.DELETE,icon:Oa,color:r.v2.colors.red[500],active:w,onClick:z}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:_t.CANCEL,variant:ve.Secondary,onClick:L},{"data-id":"edit-rule-btn-save",label:_t.SAVE,variant:ve.Primary,onClick:M}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:C&&g?t(Cs,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!u&&t(Ut,{conditions:$.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:Zd($,A)})]}),!u&&t(dr,{readOnly:!0,scopes:$.sourceScopes??null}),!!X.length&&t(Xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:X})}),!!R.length&&t(Xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:t(ue,{$gap:12,$wrap:"wrap",children:R.map(e=>t(qt,{label:Ke(e),leftIcon:We(e),flex:R.length>1?"0.5":"1"},e))})})})]})})})}),t(wr,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:B}),t(xr,{isOpen:null!==k,onClose:()=>I(null),onApprove:F})]})};var eu;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(eu||(eu={}));const tu=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:a,nodeName:l,startTime:r,agentInjectedStatus:s,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Qt(),m=eo(!!o),g=c(()=>({title:a,icon:nl,withCopy:!0}),[a]),f=c(()=>{const e=[],t=to(s);t&&e.push(t);const o=to(d,il,"health");o&&e.push(o);const n=to(u,al,"health");return n&&e.push(n),e},[s,d,u]),b=c(()=>n?[{id:`restart-pod-${a}`,icon:tl,label:_t.RESTART_POD,onClick:()=>n(i,a)}]:void 0,[n,i,a]),v=c(()=>[{id:"nodeName",title:Je.NODE,label:l,withCopy:!0},{id:"age",title:Je.AGE,label:r?h(r,{style:"short"}):Je.NOT_RUNNING,labelTooltip:r}],[l,r,h]);return t("div",{ref:m,children:t(Xt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},ou=b.div`
|
|
606
504
|
display: flex;
|
|
607
505
|
align-items: center;
|
|
608
506
|
justify-content: space-between;
|
|
@@ -610,7 +508,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
610
508
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
611
509
|
border-radius: 12px;
|
|
612
510
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
613
|
-
|
|
511
|
+
`,nu=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const a=io(o?.status),l=Kt(o?.name),r=o?.message,{totalPodsCount:s,odigosHealthyPodsCount:d,k8sHealthyPodsCount:u}=c(()=>({totalPodsCount:n?.length||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===oo.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===oo.Success?1:0),0)||0}),[n]);return n?.length&&o&&a?e(ou,{$noPadding:i,children:[t(no,{invertColors:!0,hideBackground:!0,status:a,title:l,subTitle:r}),e(ue,{$gap:8,children:[t(au,{label:Je.PODS,count:s}),t(au,{label:Je.ODIGOS_HEALTHY,icon:il,count:d,total:s}),t(au,{label:Je.KUBERNETES_HEALTHY,icon:al,count:u,total:s})]})]}):null},iu=b.div`
|
|
614
512
|
display: flex;
|
|
615
513
|
flex-direction: column;
|
|
616
514
|
justify-content: center;
|
|
@@ -621,7 +519,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
621
519
|
width: fit-content;
|
|
622
520
|
border-radius: 8px;
|
|
623
521
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
624
|
-
`,
|
|
522
|
+
`,au=({count:o,total:n,label:i,icon:a})=>{const l=v(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(iu,{children:[e(ue,{$gap:0,$alignItems:"flex-end",children:[t(_e,{size:Te.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(_e,{size:Te.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(ue,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(_e,{size:Te.XXXS,nowrap:!0,children:i})]})]})},lu=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===ao.PID)??e.identifyingAttributes?.find(({name:e})=>e===ao.VPID);return t?.value??null};var ru;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(ru||(ru={}));const su=({overrideProcessNum:o,healthy:n,healthStatus:l,identifyingAttributes:r,instrumentations:s,isJumpToTarget:d})=>{const u=v(),[p,h]=a(ru.IdentifyingAttributes),m=eo(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=c(()=>{const e=s?.some(e=>!1===e.healthy),o=[{value:ru.IdentifyingAttributes,label:Je.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:u.v2.colors.purple[500]},{value:ru.InstrumentationLibraries,label:Je.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(ll,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!s?.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,s]);i(()=>{f&&h(f)},[f]);const y=c(()=>{switch(p){case ru.IdentifyingAttributes:return t(ee,{children:r?.map((e,o)=>t(hu,{label:e.name,value:e.value},`attr-${o}-${e.name}`))});case ru.InstrumentationLibraries:return t(ee,{children:s?.map((e,o)=>t(hu,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))});default:return null}},[p,r,s]),C=c(()=>lu({overrideProcessNum:o,identifyingAttributes:r}),[o,r]);return t("div",{ref:m,children:e(Xt,{bgTint:"800",richTitle:{title:C?`${Je.PROCESS} ${Je.PID(C)}`:Je.PROCESS_FALLBACK_NAME},renderOnRightSide:t(_e,{color:n?Pe.Success:Pe.Error,size:Te.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:n?Ne.Success:Ne.Error,leftIcon:il,label:n?Je.HEALTHY:Je.NOT_HEALTHY,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ce,{options:g,selected:p,setSelected:h}),!b&&y]})})},cu=b.div`
|
|
625
523
|
display: flex;
|
|
626
524
|
align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
|
|
627
525
|
gap: 8px;
|
|
@@ -630,23 +528,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
630
528
|
&:hover {
|
|
631
529
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
632
530
|
}
|
|
633
|
-
`,
|
|
531
|
+
`,du=b(_e)`
|
|
634
532
|
flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
|
|
635
|
-
`,
|
|
533
|
+
`,uu=b(_e)`
|
|
636
534
|
flex: 1 1 auto;
|
|
637
535
|
min-width: 0;
|
|
638
|
-
`,
|
|
536
|
+
`,pu=b(ue)`
|
|
639
537
|
flex: 1 1 auto;
|
|
640
538
|
justify-content: flex-end;
|
|
641
539
|
min-width: 0;
|
|
642
|
-
`,
|
|
540
|
+
`,hu=({label:o,value:n,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(cu,{$withHealthBadge:r,children:[t(du,{size:Te.XXS,color:Pe.Secondary,$withHealthBadge:r,children:o}),n&&t(uu,{size:Te.XXS,color:Pe.Primary,align:"right",children:n}),(i||r)&&e(pu,{children:[i&&t(Ge,{status:Ne.Info,label:Je.STANDARD,textSize:Te.XXXS,invertColors:!0}),r&&e(ue,{$gap:4,children:[l&&t(uu,{size:Te.XXXS,color:Pe.Error,align:"right",children:l}),t(Ge,{status:a?Ne.Success:Ne.Error,label:a?Je.HEALTHY:Je.NOT_HEALTHY,leftIcon:il,textSize:Te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},mu=h(null),gu=({value:e,children:o})=>t(mu.Provider,{value:e,children:o}),fu=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],a=c(()=>({title:Je.CONTAINERS,titleSize:Te.XS,badge:{label:i.length}}),[i.length]),l=c(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(Xt,{bgTint:"800",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(vu,{...e,language:lo(l.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},bu=b.div`
|
|
643
541
|
display: flex;
|
|
644
542
|
flex-direction: column;
|
|
645
543
|
gap: 12px;
|
|
646
544
|
padding: 8px 12px;
|
|
647
545
|
border-radius: 8px;
|
|
648
546
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
649
|
-
`,
|
|
547
|
+
`,vu=({language:o,containerName:n,otelDistroName:i,runningStartedTime:a,started:l,ready:r,restartCount:s,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Qt(),C=eo(v),S=c(()=>({title:n,icon:o?ro(o):rl,iconWithWrapper:!0}),[n,o]),x=c(()=>{const e=[],t=to({status:i?oo.Success:oo.Disabled,reasonEnum:i?Je.INSTRUMENTED_WITH_DISTRO(i):Je.UNINSTRUMENTED,message:""});t&&e.push(t);const o=to(h,il,"health");o&&e.push(o);const n=to(m,al,"health");return n&&e.push(n),e},[m,h,i]),w=c(()=>[{id:"runningTime",title:Je.RUNNING_TIME,label:a?y(a,{style:"short"}):Je.NOT_RUNNING,labelTooltip:`${Je.RUNNING_TIME_TOOLTIP}. (${a})`},{id:"blank",spacer:!0},{id:"started",badge:{status:l?Ne.Success:Ne.Disabled,leftIcon:l?Ra:Da,label:l?Je.STARTED:Je.NOT_STARTED,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:r?Ne.Success:Ne.Disabled,leftIcon:r?Ra:Da,label:r?Je.READY:Je.NOT_READY,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Ne.Error:Ne.Success,leftIcon:d?Da:Ra,label:d?Je.CRASHLOOP:Je.NO_CRASHLOOP,textSize:Te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Je.RESTARTS,badge:{status:s?Ne.Error:void 0,label:s||0,textSize:Te.XXXS}}],[a,y,l,r,d,s]),T=c(()=>p?Kt(u):"",[p,u]);return t("div",{ref:C,children:e(Xt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(bu,{children:e(ue,{$gap:10,$alignItems:"center",children:[t(qt,{variant:so.Pink,leftIcon:al,label:T}),t(_e,{size:Te.XXXS,color:Pe.Error,children:p})]})}),(g??[]).map((e,o)=>{const i=o+1,a=b&&(l=f,r=e,!!l?.processPid&&lu({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(su,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${n}-process-${i}`)})]})})},yu=({podName:e,namespace:o,hasRestarted:n})=>{const i=c(()=>({title:Je.DEBUG_COMMANDS,titleSize:Te.XS}),[]),a=c(()=>[{label:Je.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Je.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Je.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(Xt,{bgTint:"800",richTitle:i,withCollapse:!0,children:a.map(({label:e,value:o})=>t(co,{bgTint:"700",label:e,value:o},e))})},Cu=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:a}=(()=>{const e=m(mu);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),l=a?.tab===eu.Pods?a:null,r=n?.pods??[],s=r.length>0,d=c(()=>r.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[r]),u=c(()=>({title:Je.PODS,badge:{label:r.length}}),[r.length]);return t(ee,{$gap:12,children:s?e(o,{children:[t(nu,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:r}),t(Xt,{bgTint:"1000",richTitle:u,children:r.map(o=>{const a=l?.podName===o.podName,r=a&&!l?.containerName;return e(tu,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:r,children:[t(yu,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(fu,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?l:null})]},`pod-${o.podName}`)})})]}):t(pt,{$height:"70vh",children:t(xe,{title:Je.NO_RUNNING_PODS,subTitle:Je.NO_RUNNING_PODS_SUBTITLE})})})},Su="user",xu=({source:o})=>{const n=c(()=>o.serviceName||o.id.name,[o]),{sourcesApi:i}=Ml(),{data:a,loading:l,refetch:r}=i.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),s=a?.peerSources??null;return!s||l?t(pt,l?{$height:"70vh",children:t(bt,{withSpinner:!0})}:{$height:"70vh",children:t(xe,{subTitle:Je.COULD_NOT_FETCH_PEER_SOURCES})}):e(ue,{$gap:16,$alignItems:"flex-start",children:[t(wu,{icon:sl,title:Je.INBOUND,subTitle:Je.INBOUND_DESCRIPTION(n),onRefresh:r,items:s?.inbound??[]}),t(wu,{icon:cl,title:Je.OUTBOUND,subTitle:Je.OUTBOUND_DESCRIPTION(n),onRefresh:r,items:s?.outbound??[]})]})},wu=({icon:o,title:n,subTitle:i,onRefresh:l,items:r})=>{const[s,d]=a(""),u=c(()=>r.filter(e=>e.serviceName.toLowerCase().includes(s.toLowerCase())),[r,s]);return e(Xt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:Te.XS,subTitle:i,subTitleSize:Te.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:uo.Button,buttonProps:{variant:ve.Secondary,size:be.S,leftIcon:tl,onClick:l}}],children:[t(po,{value:s,onChange:d,width:"100%"}),t(ho,{height:"calc(100vh - 284px)",gap:4,elements:u.length||s?!u.length&&s?[t(pt,{$height:"50vh",children:t(xe,{icon:o,title:Je.NO_RESULTS,subTitle:Je.NO_RESULTS_FOR_FILTER(s)})},"no-results")]:u.map(e=>t(ku,{...e},`${n}-${e.serviceName}`)):[t(pt,{$height:"50vh",children:t(xe,{icon:o,title:`No ${n} connections yet`,subTitle:n===Je.INBOUND?Je.NO_INBOUND_CONNECTIONS_DESCRIPTION:Je.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Tu=b.div`
|
|
650
548
|
display: flex;
|
|
651
549
|
align-items: center;
|
|
652
550
|
justify-content: space-between;
|
|
@@ -660,9 +558,22 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
660
558
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
661
559
|
}
|
|
662
560
|
`}
|
|
663
|
-
`,
|
|
561
|
+
`,ku=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const a=mo(e=>e.drawerEntityId),{items:l}=Ml().sourcesApi.useSources(),r=c(()=>l.find(e=>e.id.name===o||e.serviceName===o),[l,o]),s=c(()=>r&&JSON.stringify(go(r))!==JSON.stringify(go(a)),[r,a]),d=c(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[fo({serviceName:o,attributes:e})]}if(o?.toLowerCase()===Su)return[dl];const e=r?bo(r):void 0;return e?.length?e:[rl]},[n,i,o,r]),u=s?()=>{const{setDrawerType:e,setDrawerEntityId:t}=mo.getState();e(yo(wt.Source)),t({namespace:r?.id.namespace??"",name:r?.id.name??"",kind:r?.id.kind??"",region:r?.id.region??""})}:void 0;return e(Tu,{onClick:u,$withClick:!!u,children:[e(ue,{$gap:8,children:[t(vo,{icons:d}),t(_e,{size:Te.XXS,children:o})]}),n&&t(Ge,{status:Ne.Info,label:Je.VIRTUAL,textSize:Te.XXXS,invertColors:!0,tooltip:Je.VIRTUAL_TOOLTIP})]})},Iu=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}},Eu=({source:o})=>{const n=v(),{k8sManifestApi:l}=Ml(),[r,s]=a(!0),[d,u]=a(void 0),[p,h]=a(!0),[m,g]=a(void 0);i(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>u(Iu(e))).finally(()=>s(!1)),l.fetch({namespace:o.id.namespace,kind:Co.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>g(Iu(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const f=c(()=>[{label:Je.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:Je.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:Je.GET_POD_YAML,value:`kubectl get ${Co.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(Xt,{bgTint:"1000",children:[t(Xt,{bgTint:"900",richTitle:{icon:ul,title:Je.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:f.map(({label:e,value:o},n)=>t(co,{label:e,value:o},`debug-cmd-${n}-${e}`))}),r?t(ut,{size:1}):t(Tr,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(ut,{size:1}):t(Tr,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},Nu=({title:o,children:n})=>e(ee,{$gap:8,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:o}),n]}),Ou=({source:o})=>{const n=c(()=>{const[e,t]=xo(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(Nu,{title:Je.THROUGHPUT_LAST_10_SECONDS,children:e(ue,{$alignItems:"flex-end",$gap:4,children:[t(_e,{size:Te.L,children:n.value}),t(_e,{size:Te.XS,variant:It.Span,children:n.units})]})})},$u=({source:o})=>{const{CopyButton:n}=Rt();return t(Nu,{title:Je.NAMESPACE,children:e(ue,{children:[t(qt,{variant:so.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:ft.XS})]})})},Au=({source:o})=>{const{CopyButton:n}=Rt(),i=o.id.region;return i?t(Nu,{title:Je.REGION,children:e(ue,{children:[t(qt,{variant:so.Blue,label:i}),t(n,{value:i,size:ft.XS})]})}):null},Ru=({source:e})=>{const o=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(Nu,{title:Je.ENABLED,children:t(ue,{children:t(qt,{variant:o?so.Green:so.Default,label:o?Je.ENABLED:Je.DISABLED})})})},Du=({source:e,label:o})=>t(Nu,{title:Je.KIND,children:t(ue,{children:t(qt,{variant:so.Blue,label:o||e.id.kind})})}),_u=({source:o})=>{const{CopyButton:n}=Rt();return t(Nu,{title:Je.NAME,children:e(ue,{children:[t(qt,{variant:so.Blue,label:o.id.name}),t(n,{value:o.id.name,size:ft.XS})]})})},Pu=({source:o})=>{const{CopyButton:n}=Rt(),i=o.serviceName||o.id.name;return t(Nu,{title:Je.SERVICE_NAME,children:e(ue,{children:[t(qt,{variant:so.Blue,label:i}),t(n,{value:i,size:ft.XS})]})})},Lu=({source:o})=>{const{isVm:n,isConnector:i,isK8s:a}=S(),l=c(()=>So(o.id.kind),[o.id.kind]);return t(Xt,{children:e(ue,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[a&&t(Ou,{source:o}),a&&t($u,{source:o}),i&&t(Au,{source:o}),i&&t(Ru,{source:o}),t(Du,{source:o,label:l}),t(_u,{source:o}),(i||n)&&t(Pu,{source:o})]})})},Fu=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Xt,{bgTint:"900",children:t(nu,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Mu=({source:e})=>{const o=c(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?wo(e.workloadOdigosHealthStatus.status):Ne.Unknown,title:Kt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(no,{...o,width:"100%"}):null},zu="100%",Bu=b(ue)`
|
|
562
|
+
@media (max-width: 1099px) {
|
|
563
|
+
flex-direction: column;
|
|
564
|
+
|
|
565
|
+
& > * {
|
|
566
|
+
width: 100%;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
`,Xu=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Kt(e):`${t} ${Kt(e)}`:t,Uu=b(ue)`
|
|
570
|
+
width: fit-content;
|
|
571
|
+
padding: 2px 6px;
|
|
572
|
+
border-radius: 8px;
|
|
573
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
574
|
+
`,Vu=({overview:o,status:n})=>{const i=v(),a=o?[{id:"applied",count:o.totalAgentAppliedPods,ok:o.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:o.totalAgentOutOfDatePods,ok:o.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:o.totalAgentNotAppliedPods,ok:o.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return a.length?t(Uu,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Ne.Success:n,d=ko(c,i);return e(ue,{$gap:2,children:[t(d,{size:16,fill:To(i,c,"300")}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:`${l}/${o?.totalPods??0} ${s}`})]},a)})}):null},Hu=({changedTime:e})=>{const{formatTimeAgo:o}=Qt();return t(_e,{size:Te.XXXS,color:Pe.Disable,nowrap:!0,children:`Agent Assignment Updated · ${o(e)}`})},ju=({source:o,onClickRollout:n,onClickRollback:i})=>{const a=o.rollout?.podsManifestInjectionStatus??o.conditions?.rollout,l=c(()=>{const{status:e,reasonEnum:i,message:l,actionItems:r}=a||{},s=io(e);if(!s)return null;const c=Xu(i,Je.ROLLOUT),d=l,u=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:pl,onClick:n}]);return{status:s,title:c,subTitle:d,details:t(Vu,{overview:o.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:o.rollout?.agentsMetaHashChangedTime?t(Hu,{changedTime:o.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:u}},[o.rollout,a,n]),r=c(()=>{const{status:e,reasonEnum:t,message:n,actionItems:a}=o.autoRollback?.autoRollbackStatus||{},l=io(e);if(!l)return null;const r=Xu(t,Je.ROLLBACK),s=n,c=(a??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:tl,onClick:i}]);return c.length||l===Ne.Success||c.push({"data-id":"rollback-action",label:Je.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:tl,onClick:i}),{status:l,title:r,subTitle:s,actionButtons:c}},[o,i]);return l||r?e(Bu,{$gap:12,$alignItems:"stretch",children:[l&&t(no,{invertColors:!0,slim:!0,width:r?"calc(60% - 6px)":zu,...l}),r&&t(no,{invertColors:!0,slim:!0,width:l?"calc(40% - 6px)":zu,...r})]}):null},Gu=h(null),Wu=b.div`
|
|
664
575
|
position: relative;
|
|
665
|
-
`,
|
|
576
|
+
`,Ku=({children:e})=>{const o=u(null);return t(Wu,{ref:o,children:t(Gu.Provider,{value:o,children:e})})},Yu=b.div`
|
|
666
577
|
position: fixed;
|
|
667
578
|
top: ${({$coords:e})=>e.top}px;
|
|
668
579
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -676,14 +587,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
676
587
|
padding: 12px 16px;
|
|
677
588
|
border-radius: 12px;
|
|
678
589
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
679
|
-
`,
|
|
590
|
+
`,Ju=b.div`
|
|
680
591
|
display: flex;
|
|
681
592
|
align-items: flex-end;
|
|
682
593
|
justify-content: space-between;
|
|
683
594
|
gap: 8px;
|
|
684
|
-
`,
|
|
595
|
+
`,qu=b.div`
|
|
685
596
|
flex: 1;
|
|
686
|
-
`,
|
|
597
|
+
`,Zu=({width:o,onClose:n,onSave:i,saveTooltip:l,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:h})=>{const f=v(),b=m(Gu),[y,C]=a(null);return Io(b??{current:null},n),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?Or(e(Yu,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(ee,{$gap:4,children:[t(_e,{size:Te.XXS,children:c}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:d})]}),e(Ju,{children:[t(qu,{children:p}),e(ue,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(fe,{variant:ve.Secondary,onClick:r,leftIcon:Oa,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:be.S,textColor:f.v2.colors.red[500]}),t(fe,{variant:ve.Primary,onClick:i,leftIcon:Ha,tooltip:l,hideTooltipIcon:!0,iconSize:16,size:be.S})]})]}),t("div",{children:t(Ee,{status:Ne.Warning,message:u})})]}),document.body):null},Qu=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:r}=S(),{formData:s,handleFormChange:d,resetFormData:u}=Ht(l),p=c(()=>{if(!o)return[];const e=Eo[o].community,t=r===Tt.Onprem?Eo[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,r]),[h,m]=a(!1),[g,f]=a(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(ue,{$gap:4,$alignItems:"center",children:[n?t(Ge,{status:Ne.Info,invertColors:!0,label:Je.OVERIDDEN}):null,e(Ku,{children:[t(Fe,{text:Je.OVERRIDE_OTEL_DISTRO_NAME,children:t(gt,{icon:La,onClick:b})}),g&&t(Zu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(s),m(!1),b()},saveTooltip:Je.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:Je.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Je.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Je.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Je.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(mt,{label:Je.OTEL_DISTRO_NAME,options:p,values:s.otelDistroName?[s.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},ep=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:r}=Yt(),{formData:s,handleFormChange:d,resetFormData:u}=Ht(i),p=c(()=>No.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=a(!1),[g,f]=a(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(ue,{children:[o?t(Ge,{status:Ne.Info,invertColors:!0,label:Je.OVERIDDEN}):null,e(Ku,{children:[t(Fe,{text:Je.OVERRIDE_RUNTIME_DETAILS,children:t(gt,{icon:La,onClick:b})}),g&&t(Zu,{width:"500px",onClose:b,onSave:async()=>{!s.version||Oo(s.version)?(m(!0),await n(s),m(!1),b()):r({type:Ne.Warning,message:Jt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Je.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:Je.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Je.OVERRIDE_RUNTIME_DETAILS,subTitle:Je.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Je.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(ue,{$gap:8,children:[t(mt,{label:Je.LANGUAGE,options:p,values:s.language?[s.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(ye,{label:Je.RUNTIME_VERSION,placeholder:Je.VERSION_PLACEHOLDER,value:s.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},tp=({source:e})=>{const{isVm:o}=S(),{containers:n,containersRichTitle:i}=c(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?Je.DETECTED_PROCESSES:`${e.id.kind} ${Je.CONTAINERS}`,tooltip:t?.message||(o?Je.DETECTED_PROCESSES_DESCRIPTION:Je.DETECTED_CONTAINERS_DESCRIPTION),badge:io(t?.status)===Ne.Loading?{status:Ne.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(Xt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:n.map(o=>o&&t(ap,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},op=b.div`
|
|
687
598
|
display: flex;
|
|
688
599
|
flex-direction: column;
|
|
689
600
|
align-self: stretch;
|
|
@@ -691,32 +602,32 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
691
602
|
padding: 8px 12px;
|
|
692
603
|
border-radius: 8px;
|
|
693
604
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
694
|
-
`,
|
|
605
|
+
`,np=b.div`
|
|
695
606
|
display: flex;
|
|
696
607
|
align-items: center;
|
|
697
608
|
justify-content: center;
|
|
698
609
|
padding: 8px;
|
|
699
610
|
border-radius: 10px;
|
|
700
611
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
701
|
-
`,
|
|
612
|
+
`,ip=b.div`
|
|
702
613
|
display: flex;
|
|
703
614
|
flex-direction: column;
|
|
704
615
|
gap: 12px;
|
|
705
616
|
padding: 8px 12px;
|
|
706
617
|
border-radius: 8px;
|
|
707
618
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
708
|
-
`,
|
|
619
|
+
`,ap=({sourceId:o,...n})=>{const{containerName:i,runtimeInfo:a,agentEnabled:l,overrides:r}=n,s=v(),{sourcesApi:d}=Ml(),u=c(()=>!!r?.runtimeInfo?.language||!!r?.runtimeInfo?.runtimeVersion,[r]),p=c(()=>({language:lo(n),version:$o(n)||void 0}),[n]),h=c(()=>!!r?.otelDistroName,[r]),m=c(()=>({otelDistroName:r?.otelDistroName||n.agentEnabled?.otelDistroName}),[r,n]),g=c(()=>!a&&!u,[a,u]),f=c(()=>g?rl:ro(p.language),[g,p]),b=c(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),y=c(()=>g?{status:Ne.Loading,label:Je.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?Ne.Success:Ne.Disabled,leftIcon:l?.otelDistroName?Ra:Da,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[g,l]),C=e=>d.update(o,{containerName:i,...h?m:{},...u?p:{},...e}),S=c(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Je.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Je.TAIL_SAMPLING),e},[n]);return e(op,{children:[e(ue,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ue,{$gap:8,$alignItems:"center",children:[t(np,{children:t(f,{size:24,fill:a?void 0:s.v2.colors.grey[400]})}),t(_e,{children:i}),t(qt,b?{variant:so.Blue,label:b}:{variant:so.Loader,label:Je.DETECTING_RUNTIME_INFO}),t(ep,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(ue,{$gap:8,$alignItems:"center",children:[t(Ge,{...y,textSize:Te.XXXS}),t(Qu,{language:p.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!l||l.agentEnabled||g?null:t(ip,{children:e(ue,{$gap:10,$alignItems:"center",children:[t(qt,{variant:so.Pink,label:Kt(l.agentEnabledStatus?.reasonEnum)||Je.NO_AVAILABLE_AGENT}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:l?.agentEnabledStatus?.message})]})}),S.length>0&&t(ip,{children:t(ue,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(Ge,{label:e,leftIcon:Ra,status:Ne.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${o}`))})})]})},lp=b.div`
|
|
709
620
|
display: flex;
|
|
710
621
|
flex-direction: column;
|
|
711
622
|
gap: 10px;
|
|
712
623
|
padding: 10px 12px 10px 20px;
|
|
713
624
|
border-radius: 8px;
|
|
714
625
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
715
|
-
|
|
626
|
+
`,rp=b.div`
|
|
716
627
|
display: flex;
|
|
717
628
|
flex-wrap: wrap;
|
|
718
629
|
gap: 12px 24px;
|
|
719
|
-
`,
|
|
630
|
+
`,sp=({title:o,children:n})=>e(ee,{$gap:4,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:o}),n]}),cp=({processes:o})=>{const n=c(()=>[...o].sort((e,t)=>e.pid-t.pid),[o]);return n.length?e(ee,{$gap:6,children:[t(_e,{size:Te.XXXS,color:Pe.Secondary,children:`${Je.PROCESSES} (${n.length})`}),n.map(o=>{const n=o.exe?.trim()||null,i=o.cmdline?.trim()||null;return e(lp,{children:[t(rp,{children:t(sp,{title:Je.PROCESS_PID,children:t(_e,{size:Te.XS,children:String(o.pid)})})}),n?t(co,{label:Je.EXECUTABLE,value:n,bgTint:"900"}):null,i&&i!==n?t(co,{label:Je.COMMAND,value:i,bgTint:"900"}):null]},o.pid)})]}):null},dp=b.div`
|
|
720
631
|
display: flex;
|
|
721
632
|
flex-direction: column;
|
|
722
633
|
align-self: stretch;
|
|
@@ -724,19 +635,19 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
724
635
|
padding: 8px 12px;
|
|
725
636
|
border-radius: 8px;
|
|
726
637
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
727
|
-
`,
|
|
638
|
+
`,up=b.div`
|
|
728
639
|
display: flex;
|
|
729
640
|
align-items: center;
|
|
730
641
|
justify-content: center;
|
|
731
642
|
padding: 8px;
|
|
732
643
|
border-radius: 10px;
|
|
733
644
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
734
|
-
`,
|
|
645
|
+
`,pp=e=>{if(!e)return Ao.Unknown;const t=e.trim().toLowerCase();return{go:Ao.Go,golang:Ao.Go,javascript:Ao.JavaScript,js:Ao.JavaScript,node:Ao.JavaScript,nodejs:Ao.JavaScript,typescript:Ao.JavaScript,python:Ao.Python,java:Ao.Java,dotnet:Ao.DotNet,csharp:Ao.CSharp,php:Ao.Php,ruby:Ao.Ruby,rust:Ao.Rust,swift:Ao.Swift,elixir:Ao.Elixir}[t]??Ao.Unknown},hp=({source:o})=>{const n=v(),{isConnector:i,isVm:a}=S(),{sourcesApi:l}=Ml(),r=o.instrumentationReport,s=o.sourceConfig,d=a?r?.processes:null,u=c(()=>!(!s?.runtimeOverride?.language&&!s?.runtimeOverride?.version),[s]),p=c(()=>{const e=pp(r?.runtimeLanguage);return e!==Ao.Unknown?e:o.runtimeInfo?.detectedLanguages?.[0]??Ao.Unknown},[r?.runtimeLanguage,o.runtimeInfo?.detectedLanguages]),h=r?.runtimeVersion?.trim()||"",m=c(()=>{const e=pp(s?.runtimeOverride?.language);return{language:e!==Ao.Unknown?e:p,version:s?.runtimeOverride?.version?.trim()||h||void 0}},[s,p,h]),g=c(()=>!!s?.distroOverride?.otelDistroName,[s]),f=c(()=>({otelDistroName:s?.distroOverride?.otelDistroName||void 0}),[s]),b=c(()=>{const{language:e,version:t}=m;return e!==Ao.Unknown||t?e!==Ao.Unknown&&t?`${e} • ${t}`:e!==Ao.Unknown?e:t||null:null},[m]),y=!b&&!u&&"Instrumenting"===r?.state,C=c(()=>y||m.language===Ao.Unknown?rl:ro(m.language),[y,m.language]),x=c(()=>{const e=r?.state??"",t=r?.instrumented||"Instrumented"===e,o=s?.distroOverride?.otelDistroName?.trim()||r?.sdkType?.trim();return"Instrumenting"===e?{status:Ne.Loading,label:Kt(r?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Ne.Disabled,leftIcon:Da,label:Kt(e)||e}:"Error"===e?{status:Ne.Error,leftIcon:Da,label:"Error"}:t?{status:Ne.Success,leftIcon:Ra,label:o?`Instrumented | ${o}`:"Instrumented"}:{status:Ne.Disabled,leftIcon:Da,label:Je.UNINSTRUMENTED}},[r,s]),w=e=>l.update(o.id,{...g?f:{},...u?{language:m.language!==Ao.Unknown?m.language:void 0,version:m.version}:{},...e});return(i||a)&&r?t(Xt,{bgTint:"1000",richTitle:{title:Je.INSTRUMENTATION,tooltip:Je.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:e(dp,{children:[e(ue,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(ue,{$gap:8,$alignItems:"center",children:[t(up,{children:t(C,{size:24,fill:y||m.language===Ao.Unknown?n.v2.colors.grey[400]:void 0})}),t(_e,{children:o.id.name}),y?t(qt,{variant:so.Loader,label:Je.DETECTING_RUNTIME_INFO}):b?t(qt,{variant:so.Blue,label:b}):null,t(ep,{overridden:u,onOverride:w,defaultValues:{language:m.language!==Ao.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:p!==Ao.Unknown?p:void 0,version:h}})]}),e(ue,{$gap:8,$alignItems:"center",children:[t(Ge,{...x,textSize:Te.XXXS}),t(Qu,{language:m.language!==Ao.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(cp,{processes:d}):null]})})}):null},mp=({source:o,onClickRollout:n,onClickRollback:i})=>{const{isK8s:a,isConnector:l,isVm:r}=S();return e(ee,{$gap:12,children:[t(Lu,{source:o}),t(Mu,{source:o}),a&&t(ju,{source:o,onClickRollout:n,onClickRollback:i}),a&&t(tp,{source:o}),(l||r)&&t(hp,{source:o}),a&&t(Fu,{source:o})]})},gp=({source:e})=>{const o=e.containers||[];return t(Xt,{bgTint:"1000",richTitle:{title:Je.INSTRUMENTED_LIBRARIES},children:o.length?o.map(e=>{const o=e.instrumentations||[];return t(Xt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:o.length}},withCollapse:!0,collapseIsDefaultOpen:!!o?.length,children:o?.length?t(ee,{children:o.map((e,o)=>t(hu,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))}):t(xe,{title:"No libraries found"})},e.containerName)}):t(xe,{title:"No containers found"})})},fp=b(ee)`
|
|
735
646
|
width: 100%;
|
|
736
647
|
max-height: 320px;
|
|
737
648
|
overflow-y: auto;
|
|
738
649
|
gap: 8px;
|
|
739
|
-
`,
|
|
650
|
+
`,bp=b(ue)`
|
|
740
651
|
width: 100%;
|
|
741
652
|
align-items: center;
|
|
742
653
|
gap: 8px;
|
|
@@ -746,14 +657,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
746
657
|
& > * {
|
|
747
658
|
font-family: monospace !important;
|
|
748
659
|
}
|
|
749
|
-
`,Bu=({pendingModify:o,onClose:n,onConfirm:i})=>{const a=v();return t(Qe,{isOpen:!!o,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:n,denyButton:{variant:be.Secondary,label:"Cancel",onClick:n},approveButton:{variant:be.Primary,label:"Confirm",onClick:i},children:o&&e(Mu,{children:[o.add.map(o=>e(zu,{children:[t(qe,{leftIcon:Na,status:Fe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(pe,{size:he.XS,color:ue.Primary,children:o})]},`add-${o}`)),o.remove.map(o=>e(zu,{children:[t(qe,{leftIcon:pl,status:Fe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(pe,{size:he.XS,color:ue.Primary,children:o})]},`remove-${o}`))]})})};function Xu(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function Uu(e){const t=Math.abs(e);return t>=1e9?`${Vu(e/1e9)}s`:t>=1e6?`${Vu(e/1e6)}ms`:t>=1e3?`${Vu(e/1e3)}μs`:String(Math.round(e))}function Vu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Hu(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let i=0;for(let e=0;e+3<n.length;e+=4){const a=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=i+a;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function ju(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Gu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Wu(e,t,o){return((e,t)=>{const o=[];for(let n=0;n<=t.level;n++){let i;for(const o of e)if(o.level===n&&t.offset>=o.offset&&t.offset+t.size<=o.offset+o.size){i=o;break}if(!i)return o;o.push(i)}return o})(t,o).map(t=>Xu(e,t.nameIndex))}function Ku(e,t,o){if(0===o.length)return null;let n=null,i=null;for(let a=0;a<o.length;a++){const l=o[a];let r=null;for(const o of t)o.level===a&&Xu(e,o.nameIndex)===l&&(n&&(o.offset<n.offset||o.offset+o.size>n.offset+n.size)||(!r||o.size>r.size)&&(r=o));if(!r)return null;n=r,i=r}return i}function Yu(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=o;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){i.push(e);break}}return i}function qu(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Ju(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return i[o%i.length]}var Zu,Qu;function eh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function th(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function oh(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Zu||(Zu={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Qu||(Qu={}));const nh=({flamebearer:o,maxRowPx:n,searchQuery:c="",shouldKeepName:d,minHostHeight:p=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=l(null),S=l(null),x=l({x:0,y:0}),[w,T]=s({w:0,h:0}),[k,E]=s(""),[I,N]=s(null),[$,O]=s([]),[A,R]=s(!1),[D,_]=s(Zu.Fit),[P,L]=s(Qu.Fit),[F,M]=s(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=$.length>0?$[$.length-1]:null,U=X?.size??o.numTicks,V=a(()=>Hu(o),[o]),H=l({fb:o,rects:V});i(()=>{const e=H.current;e.fb!==o&&(H.current={fb:o,rects:V},O(t=>{if(0===t.length)return t;const n=((e,t,o,n,i)=>{const a=[];for(const l of i){const i=Wu(e,t,l);if(0===i.length)break;const r=Ku(o,n,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,o,V,t);return n.length===t.length&&n.every((e,o)=>Gu(e,t[o]))?t:n}))},[o,V]),i(()=>{if(!f)return;if(!X)return void f(null);const e=Yu(V,X),t=new Set;for(const n of e){const e=Xu(o,n.nameIndex);e&&t.add(e)}f([...t])},[X,o,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),i(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),i(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=a(()=>function(e,t,o,n,i,a={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Hu(e);let p=l?Yu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Xu(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const i=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const a=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&Xu(e,l.nameIndex)===Xu(e,t.nameIndex)&&i.add(ju(l))}if(0===i.size)return o;const a=[];for(const e of o){if(i.has(ju(e)))continue;let t=0;for(let o=0;o<e.level;o++){const a=n.get(o);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(ju(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=n??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(o/g,f)),v=i.trim(),y=b>8?1:0;return p.map(o=>{const n=o.level-u,i=(o.offset-h)/m*t,a=Math.max(o.size/m*t,1),l=n*b,r=Math.max(b-y,1),s=Xu(e,o.nameIndex);return{...o,x:i,y:l,w:a,h:r,name:s,matchesSearch:qu(s,v)}})}(o,z,B,n,c,{zoomRoot:X,shouldKeepName:d,collapseRecursive:F,allRects:V}),[o,n,c,B,z,X,d,F,V]),G=a(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?c.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,c]),W=r(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=th((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(n){const e=ju(n);N(e);const t=U>0?(100*n.size/U).toFixed(1):"0",i=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";E(`${n.name}\ntotal ${Uu(n.size)} (${t}% of view, ${i}% of profile) · self ${Uu(n.self)}`)}else N(null),E("")},[G,o.numTicks,B,z,U]),K=r(e=>{W(e)},[W]),Y=r(()=>{N(null),E("")},[]),q=r(e=>{x.current={x:e.clientX,y:e.clientY}},[]),J=r(e=>{const{x:t,y:o}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(z<2||B<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=th((e.clientX-n.left)/n.width*z,(e.clientY-n.top)/n.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Gu(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(z,B),i=Math.min(t,16384/n);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,o,n,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Ju(s,a);e.fillStyle=u,e.fillRect(o,n,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+i-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(i-1,0),Math.max(l-1,0));const m=eh(d,r),g=`${s} (${Uu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(ju(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,c,y,I,o.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,o.numTicks,I,c,B,z,y]);const Z=r(()=>R(e=>!e),[]),Q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(U/o.numTicks*100))):100,ee=a(()=>((e,t,o)=>{const n=o??Hu(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(o,X,V),[o,X,V]),te=null!==ee,oe=$.length>0,ne=X?Xu(o,X.nameIndex):"",ie=r(()=>{O([]),b?.()},[b]),ae=r(()=>O(e=>e.slice(0,-1)),[]),se=r(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:p,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(me,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(le,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:re.Left,size:Nt.S,value:F,onChange:M}),e(me,{$gap:8,children:[e(me,{children:[t(ge,{variant:be.Secondary,size:fe.S,label:"Reset zoom",leftIcon:ul,onClick:ie,disabled:!$.length}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:pl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!oe,onClick:ae}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(pe,{size:he.XXS,color:ue.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:Na,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(me,{children:[t($e,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Oo.Filled,options:[{value:Zu.Fit,label:"W: Fit"},{value:Zu.X10,label:"10x"}],selected:D,setSelected:_})}),t($e,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Oo.Filled,options:[{value:Qu.Fit,label:"H: Fit"},{value:Qu.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:24,leftIcon:A?Va:hl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t($e,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:I?"pointer":"default"},onPointerDown:q,onPointerMove:K,onPointerLeave:Y,onClick:J})})})})}),e(me,{$justifyContent:"space-between",children:[t(pe,X?{size:he.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ne} • ${Uu(U)} samples in view`}:{size:he.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(pe,{size:he.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${oh(h.totalBytesUsed)} / ${oh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},ih=[$o.Go,$o.Java],ah="Profiling Symbols";function lh(e,t){if(0===t.length)return null;const o=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?$o.Go:e.includes(" ")||e.includes("(")?$o.Java:$o.Go)(e);if(o===$o.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const o=t.lastIndexOf("/"),n=t.indexOf(".",o+1);if(-1===n)return null;const i=t.slice(0,n),a=t.slice(n+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Ge(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new Ge(i,a);return r.Verify()?r:null})(e);return t?{language:o,golang:t}:null}if(o===$o.Java){const t=(e=>{let t=e.trim();if(!t)return null;const o=t.indexOf("(");-1!==o&&(t=t.slice(0,o).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new We(a,l);return r.Verify()?r:null})(e);return t?{language:o,java:t}:null}return null}function rh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function sh(e,t,o){if(!e)return!0;const{sources:n=[],namespaces:i=[],languages:a=[]}=e,l=!n.length||n.some(e=>rh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==o||a.includes(o);return l&&r&&s}function ch(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function dh(e,t){return e.className===t.className&&e.methodName===t.methodName}function ph(e,t,o,n){const i=lh(e,o);if(!i)return[];const a=[];for(const e of n){const o=e.customInstrumentations;if(!o)continue;if(!sh(e.sourceScopes,t,i.language))continue;const n=!!i.golang&&!!o[Ke.Golang]?.some(e=>ch(e,i.golang)),l=!!i.java&&!!o[Ke.Java]?.some(e=>dh(e,i.java));(n||l)&&a.push({rule:e,resolved:i})}return a}var uh,hh,mh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(uh||(uh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(hh||(hh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(mh||(mh={}));const gh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function fh(e,t){const o=(e=>e.split(" ")[0]??"")(e);return(!t.includes(mh.FilterOutVoid)||"void"!==o)&&!!(!t.includes(mh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==o&&gh.test(o))}const bh=({rows:e,languages:o,instrumentation:n,searchQuery:i,filters:l,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:p})=>{const u=!!o?.includes($o.Java),h=a(()=>{const t=c?new Set(c):null,o=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!o||e.name.toLowerCase().includes(o)))},[e,i,c]),m=a(()=>{const e=[];if(n.selectionEnabled&&e.push({id:hh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:mh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:mh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const o=e.cells.find(e=>e.key===uh.Symbol)?.rawValue?.toString()??"";return!(t.includes(hh.OnlyInstrumentable)&&!n.getSymbolState(o).showCheckbox)&&fh(o,t)}}},[n,u]),g=a(()=>[{key:uh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:uh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:uh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=n.getSymbolState(e.name),o=t.showCheckbox;return{id:e.name,cells:[{key:uh.Symbol,rawValue:e.name},{key:uh.Self,rawValue:Uu(e.self)},{key:uh.Total,rawValue:Uu(e.total)}],isSelected:o?n.isSelected(e.name):void 0,onSelect:o?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:o?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!o,checkboxDisabled:o?t.checkboxDisabled:void 0,checkboxTooltip:o?t.checkboxTooltip:void 0}}),[h,n]),b=r(e=>{const t=e.cells[0].rawValue,o=n.getSymbolState(t),i=[];return o.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ia,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Na,tooltip:o.addTooltip,disabled:!o.addEnabled,onClick:()=>n.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:ml,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[n]);return t(Ao,{variant:Ro.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:n.selectionEnabled,filters:l,onFiltersChange:s,activeRowId:d,scrollSignal:p,getRowActions:b})};var vh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(vh||(vh={}));const yh=b(ee)`
|
|
660
|
+
`,vp=({pendingModify:o,onClose:n,onConfirm:i})=>{const a=v();return t(Ye,{isOpen:!!o,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:n,denyButton:{variant:ve.Secondary,label:"Cancel",onClick:n},approveButton:{variant:ve.Primary,label:"Confirm",onClick:i},children:o&&e(fp,{children:[o.add.map(o=>e(bp,{children:[t(Ge,{leftIcon:$a,status:Ne.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:Te.XXS}),t(_e,{size:Te.XS,color:Pe.Primary,children:o})]},`add-${o}`)),o.remove.map(o=>e(bp,{children:[t(Ge,{leftIcon:hl,status:Ne.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:Te.XXS}),t(_e,{size:Te.XS,color:Pe.Primary,children:o})]},`remove-${o}`))]})})};function yp(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 Cp(e){const t=Math.abs(e);return t>=1e9?`${Sp(e/1e9)}s`:t>=1e6?`${Sp(e/1e6)}ms`:t>=1e3?`${Sp(e/1e3)}μs`:String(Math.round(e))}function Sp(e){return e.toFixed(2).replace(/\.?0+$/,"")}function xp(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let i=0;for(let e=0;e+3<n.length;e+=4){const a=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=i+a;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function wp(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Tp(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function kp(e,t,o){return((e,t)=>{const o=[];for(let n=0;n<=t.level;n++){let i;for(const o of e)if(o.level===n&&t.offset>=o.offset&&t.offset+t.size<=o.offset+o.size){i=o;break}if(!i)return o;o.push(i)}return o})(t,o).map(t=>yp(e,t.nameIndex))}function Ip(e,t,o){if(0===o.length)return null;let n=null,i=null;for(let a=0;a<o.length;a++){const l=o[a];let r=null;for(const o of t)o.level===a&&yp(e,o.nameIndex)===l&&(n&&(o.offset<n.offset||o.offset+o.size>n.offset+n.size)||(!r||o.size>r.size)&&(r=o));if(!r)return null;n=r,i=r}return i}function Ep(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=o;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){i.push(e);break}}return i}function Np(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Op(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return i[o%i.length]}var $p,Ap;function Rp(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Dp(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 _p(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})($p||($p={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Ap||(Ap={}));const Pp=({flamebearer:o,maxRowPx:n,searchQuery:l="",shouldKeepName:r,minHostHeight:s=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=u(null),S=u(null),x=u({x:0,y:0}),[w,T]=a({w:0,h:0}),[k,I]=a(""),[E,N]=a(null),[O,$]=a([]),[A,R]=a(!1),[D,_]=a($p.Fit),[P,L]=a(Ap.Fit),[F,M]=a(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=O.length>0?O[O.length-1]:null,U=X?.size??o.numTicks,V=c(()=>xp(o),[o]),H=u({fb:o,rects:V});i(()=>{const e=H.current;e.fb!==o&&(H.current={fb:o,rects:V},$(t=>{if(0===t.length)return t;const n=((e,t,o,n,i)=>{const a=[];for(const l of i){const i=kp(e,t,l);if(0===i.length)break;const r=Ip(o,n,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,o,V,t);return n.length===t.length&&n.every((e,o)=>Tp(e,t[o]))?t:n}))},[o,V]),i(()=>{if(!f)return;if(!X)return void f(null);const e=Ep(V,X),t=new Set;for(const n of e){const e=yp(o,n.nameIndex);e&&t.add(e)}f([...t])},[X,o,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),i(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),i(()=>(p?.(A),()=>{A&&p?.(!1)}),[A,p]);const j=c(()=>function(e,t,o,n,i,a={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??xp(e);let u=l?Ep(d,l):d;if(0===u.length)return null;if(r&&(u=u.filter(t=>r(yp(e,t.nameIndex))),0===u.length))return null;if(s&&(u=((e,t)=>{if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const i=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const a=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&yp(e,l.nameIndex)===yp(e,t.nameIndex)&&i.add(wp(l))}if(0===i.size)return o;const a=[];for(const e of o){if(i.has(wp(e)))continue;let t=0;for(let o=0;o<e.level;o++){const a=n.get(o);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(wp(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=n??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(o/g,f)),v=i.trim(),y=b>8?1:0;return u.map(o=>{const n=o.level-p,i=(o.offset-h)/m*t,a=Math.max(o.size/m*t,1),l=n*b,r=Math.max(b-y,1),s=yp(e,o.nameIndex);return{...o,x:i,y:l,w:a,h:r,name:s,matchesSearch:Np(s,v)}})}(o,z,B,n,l,{zoomRoot:X,shouldKeepName:r,collapseRecursive:F,allRects:V}),[o,n,l,B,z,X,r,F,V]),G=c(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?l.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,l]),W=d(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Dp((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(n){const e=wp(n);N(e);const t=U>0?(100*n.size/U).toFixed(1):"0",i=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";I(`${n.name}\ntotal ${Cp(n.size)} (${t}% of view, ${i}% of profile) · self ${Cp(n.self)}`)}else N(null),I("")},[G,o.numTicks,B,z,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{N(null),I("")},[]),J=d(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=d(e=>{const{x:t,y:o}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(z<2||B<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=Dp((e.clientX-n.left)/n.width*z,(e.clientY-n.top)/n.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Tp(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(z,B),i=Math.min(t,16384/n);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,o,n,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:i,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Op(s,a);e.fillStyle=p,e.fillRect(o,n,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+i-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(i-1,0),Math.max(l-1,0));const m=Rp(d,r),g=`${s} (${Cp(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(wp(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,l,y,E,o.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,o.numTicks,E,l,B,z,y]);const Z=d(()=>R(e=>!e),[]),Q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(U/o.numTicks*100))):100,ee=c(()=>((e,t,o)=>{const n=o??xp(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(o,X,V),[o,X,V]),te=null!==ee,oe=O.length>0,ne=X?yp(o,X.nameIndex):"",ie=d(()=>{$([]),b?.()},[b]),ae=d(()=>$(e=>e.slice(0,-1)),[]),se=d(()=>{ee&&$(e=>[...e,ee])},[ee]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:s,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(ue,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(le,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:re.Left,size:kt.S,value:F,onChange:M}),e(ue,{$gap:8,children:[e(ue,{children:[t(fe,{variant:ve.Secondary,size:be.S,label:"Reset zoom",leftIcon:ml,onClick:ie,disabled:!O.length}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:20,leftIcon:hl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!oe,onClick:ae}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(_e,{size:Te.XXS,color:Pe.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:20,leftIcon:$a,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(ue,{children:[t(Fe,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ce,{variant:Ro.Filled,options:[{value:$p.Fit,label:"W: Fit"},{value:$p.X10,label:"10x"}],selected:D,setSelected:_})}),t(Fe,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ce,{variant:Ro.Filled,options:[{value:Ap.Fit,label:"H: Fit"},{value:Ap.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(fe,{variant:ve.Secondary,size:be.S,iconSize:24,leftIcon:A?ja:gl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Fe,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(ue,{$justifyContent:"space-between",children:[t(_e,X?{size:Te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ne} • ${Cp(U)} samples in view`}:{size:Te.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(_e,{size:Te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${_p(h.totalBytesUsed)} / ${_p(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Lp=[Ao.Go,Ao.Java],Fp="Profiling Symbols";function Mp(e,t){if(0===t.length)return null;const o=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Ao.Go:e.includes(" ")||e.includes("(")?Ao.Java:Ao.Go)(e);if(o===Ao.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const o=t.lastIndexOf("/"),n=t.indexOf(".",o+1);if(-1===n)return null;const i=t.slice(0,n),a=t.slice(n+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Be(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new Be(i,a);return r.Verify()?r:null})(e);return t?{language:o,golang:t}:null}if(o===Ao.Java){const t=(e=>{let t=e.trim();if(!t)return null;const o=t.indexOf("(");-1!==o&&(t=t.slice(0,o).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new Xe(a,l);return r.Verify()?r:null})(e);return t?{language:o,java:t}:null}return null}function zp(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function Bp(e,t,o){if(!e)return!0;const{sources:n=[],namespaces:i=[],languages:a=[]}=e,l=!n.length||n.some(e=>zp(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==o||a.includes(o);return l&&r&&s}function Xp(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Up(e,t){return e.className===t.className&&e.methodName===t.methodName}function Vp(e,t,o,n){const i=Mp(e,o);if(!i)return[];const a=[];for(const e of n){const o=e.customInstrumentations;if(!o)continue;if(!Bp(e.sourceScopes,t,i.language))continue;const n=!!i.golang&&!!o[Ue.Golang]?.some(e=>Xp(e,i.golang)),l=!!i.java&&!!o[Ue.Java]?.some(e=>Up(e,i.java));(n||l)&&a.push({rule:e,resolved:i})}return a}var Hp,jp,Gp;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(Hp||(Hp={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(jp||(jp={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(Gp||(Gp={}));const Wp=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Kp(e,t){const o=(e=>e.split(" ")[0]??"")(e);return(!t.includes(Gp.FilterOutVoid)||"void"!==o)&&!!(!t.includes(Gp.OnlyWithReturnValues)||e.includes(" ")&&"void"!==o&&Wp.test(o))}const Yp=({rows:e,languages:o,instrumentation:n,searchQuery:i,filters:a,onFiltersChange:l,zoomedSymbols:r,highlightSymbol:s,scrollSignal:u})=>{const p=!!o?.includes(Ao.Java),h=c(()=>{const t=r?new Set(r):null,o=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!o||e.name.toLowerCase().includes(o)))},[e,i,r]),m=c(()=>{const e=[];if(n.selectionEnabled&&e.push({id:jp.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:Gp.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:Gp.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const o=e.cells.find(e=>e.key===Hp.Symbol)?.rawValue?.toString()??"";return!(t.includes(jp.OnlyInstrumentable)&&!n.getSymbolState(o).showCheckbox)&&Kp(o,t)}}},[n,p]),g=c(()=>[{key:Hp.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Hp.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Hp.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=c(()=>h.map(e=>{const t=n.getSymbolState(e.name),o=t.showCheckbox;return{id:e.name,cells:[{key:Hp.Symbol,rawValue:e.name},{key:Hp.Self,rawValue:Cp(e.self)},{key:Hp.Total,rawValue:Cp(e.total)}],isSelected:o?n.isSelected(e.name):void 0,onSelect:o?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:o?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!o,checkboxDisabled:o?t.checkboxDisabled:void 0,checkboxTooltip:o?t.checkboxTooltip:void 0}}),[h,n]),b=d(e=>{const t=e.cells[0].rawValue,o=n.getSymbolState(t),i=[];return o.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Oa,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:$a,tooltip:o.addTooltip,disabled:!o.addEnabled,onClick:()=>n.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:fl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[n]);return t(Do,{variant:_o.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:n.selectionEnabled,filters:a,onFiltersChange:l,activeRowId:s,scrollSignal:u,getRowActions:b})};var Jp;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(Jp||(Jp={}));const qp=b(ee)`
|
|
750
661
|
width: 100%;
|
|
751
662
|
flex: 1;
|
|
752
663
|
border-radius: 16px;
|
|
753
664
|
overflow: hidden;
|
|
754
665
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
755
666
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
756
|
-
`,
|
|
667
|
+
`,Zp=b.div`
|
|
757
668
|
display: flex;
|
|
758
669
|
align-items: center;
|
|
759
670
|
gap: 10px;
|
|
@@ -761,11 +672,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
761
672
|
padding: 12px 12px 8px;
|
|
762
673
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
763
674
|
border-radius: 16px 16px 0 0;
|
|
764
|
-
`,
|
|
675
|
+
`,Qp=b(ue)`
|
|
765
676
|
flex-shrink: 0;
|
|
766
677
|
align-items: center;
|
|
767
678
|
gap: 4px;
|
|
768
|
-
`,
|
|
679
|
+
`,eh=b.div`
|
|
769
680
|
flex: 1;
|
|
770
681
|
display: flex;
|
|
771
682
|
align-items: stretch;
|
|
@@ -773,20 +684,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
773
684
|
padding: 16px;
|
|
774
685
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
775
686
|
border-radius: 0 0 16px 16px;
|
|
776
|
-
`,
|
|
687
|
+
`,th=b(ee)`
|
|
777
688
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
778
689
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
779
690
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
780
691
|
gap: 10px;
|
|
781
|
-
`,
|
|
692
|
+
`,oh=b(ee)`
|
|
782
693
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
783
694
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
784
695
|
gap: 10px;
|
|
785
|
-
`,
|
|
696
|
+
`,nh=b(ue)`
|
|
786
697
|
width: 100%;
|
|
787
698
|
min-height: 32px;
|
|
788
699
|
flex-shrink: 0;
|
|
789
|
-
`,
|
|
700
|
+
`,ih=({source:o,onFlameFullscreenChange:n})=>{const r=v(),s=o.id,{profilingApi:p}=Ml(),[h,m]=a(!0),[g,f]=a(Jp.Both),[b,y]=a(""),[C,S]=a({}),[x,w]=a(!1),T=u(!1);i(()=>{T.current||(T.current=!0,p.enableProfiling?.(s),w(!0))},[p,s]);const{data:k}=p.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:E,refetch:N}=p.useSourceProfiling(s,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),O=I?.profileJson??null,$=c(()=>(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}})(O),[O]),A=c(()=>$?(e=>{const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const i=n[o+1],a=n[o+2],l=yp(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})($.flamebearer):[],[$]),R=g===Jp.Table||g===Jp.Both,D=g===Jp.Flame||g===Jp.Both,_=R&&D,P=o.runtimeInfo?.detectedLanguages?.join("\0")??"",L=o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=c(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=c(()=>((e,t)=>{if(!t?.includes(Ao.Java))return;const o=(e?.[Hp.Symbol]?.filter(Boolean)??[]).filter(e=>e===Gp.FilterOutVoid||e===Gp.OnlyWithReturnValues);return 0!==o.length?e=>Kp(e,o):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:o}){const{instrumentationRulesApi:n,capabilities:i}=Ml(),{items:l}=n.useRules(),[r,s]=a(new Set),[u,p]=a(new Set),[h,m]=a(null),g=c(()=>(e=>{const t=new Set(e??[]);return Lp.filter(e=>t.has(e))})(t),[t]),f=i.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=c(()=>((e,t)=>{const o=e.filter(e=>e.type===Ve.CustomInstrumentation&&e.ruleName===Fp&&Bp(e.sourceScopes,t));return o.find(e=>e.sourceScopes?.sources?.some(e=>zp(e,t.id)))??o[0]??null})(l,e),[l,b]),y=f&&g.length>0,C=c(()=>{const t=new Map;for(const n of o){const o=!!Mp(n.name,g),i=Vp(n.name,e,g,l),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),r=i.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&r.length>0,c=y&&o,d=s;let u;if(s){const e=[...new Set(r.map(e=>e.rule.ruleName))];u=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let p=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=u??"Managed by another rule":0===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?o?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(n.name,{parsable:o,inManagedRule:a,otherRules:r,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[o,l,b,g,f,y,v]),S=c(()=>{const e=new Set;return C.forEach((t,o)=>{t.inManagedRule&&e.add(o)}),e},[C]),x=c(()=>[...r].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[r,C,S]),w=c(()=>[...u].filter(e=>S.has(e)),[u,S]),T=x.length+w.length,k=d(e=>{const t=C.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||r.has(e)},[C,u,r]),I=d((e,t)=>{const o=C.get(e);o&&!o.checkboxDisabled&&(o.inManagedRule?p(o=>{const n=new Set(o);return t?n.delete(e):n.add(e),n}):s(o=>{const n=new Set(o);return t?n.add(e):n.delete(e),n}))},[C]),E=d(()=>{s(new Set),p(new Set)},[]),N=d(t=>{(async()=>{const o=t.add.map(e=>Mp(e,g)).filter(e=>!!e),i=t.remove.map(e=>Mp(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,o)=>{const n=e.customInstrumentations??{};let i=[...n[Ue.Golang]??[]],a=[...n[Ue.Java]??[]];for(const e of o)e.golang&&(i=i.filter(t=>!Xp(t,e.golang))),e.java&&(a=a.filter(t=>!Up(t,e.java)));for(const e of t)e.golang&&!i.some(t=>Xp(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>Up(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ue.Golang]:i,[Ue.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,o,i);t?await n.remove(v.ruleId,Ve.CustomInstrumentation):await n.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),Ve.CustomInstrumentation)}else o.length>0&&await n.create(((e,t)=>{const o=e.map(e=>e.golang).filter(e=>!!e),n=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:Fp,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ue.Golang]:o,[Ue.Java]:n}}})(o,e),Ve.CustomInstrumentation)})()},[v,g,e,n]),O=d(()=>{T&&m({add:x,remove:w})},[T,x,w]),$=d(e=>m({add:[e],remove:[]}),[]),A=d(e=>m({add:[],remove:[e]}),[]),R=d(()=>m(null),[]),D=d(()=>{h&&(N(h),m(null),E())},[h,N,E]),_=d(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:c(()=>({getSymbolState:_,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[_,$,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:O,resetSelection:E,confirmModify:D}}({source:o,languages:F,rows:A}),[G,W]=a(null),[K,Y]=a(0),[J,q]=a(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===Jp.Flame?Jp.Both:e)},[]),Q=d(e=>{q(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const o=new Set(t);if(e.every(e=>o.has(e)))return t}return e})},[]),te=d(()=>W(null),[]);return!O&&E?t(pt,{$height:"70vh",children:t(bt,{withSpinner:!0})}):e(qp,{$gap:0,$width:"100%",children:[e(Zp,{children:[t(Fe,{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(Qp,{children:t(_e,{size:Te.S,weight:500,color:Pe.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(ue,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(po,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:r.v2.colors.silver[900],emphasizeBackgroundColor:r.v2.colors.silver[800]})}),t(ce,{variant:Ro.Filled,options:[{value:Jp.Table,label:"Top table"},{value:Jp.Flame,label:"Flame graph"},{value:Jp.Both,label:"Both"}],selected:g,setSelected:f}),t(fe,h?{variant:ve.Secondary,size:be.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(bl,{...e,size:8,fill:r.v2.colors.green[500]})}:{variant:ve.Secondary,size:be.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(bl,{...e,size:8,fill:r.v2.colors.red[500]})})]})]}),t(eh,{$gap:R&&D?16:0,children:$?e(l,{children:[R&&e(th,{$splitWithFlame:_,children:[e(nh,{$justifyContent:"space-between",children:[e(ee,{$margin:"0 0 0 20px",children:[t(_e,{size:Te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(ue,{$gap:8,children:[e(ue,{children:[t(vl,{size:24}),t(_e,{size:Te.S,color:Pe.Success,nowrap:!0,children:"Custom Instrument"})]}),t(fe,{leftIcon:_a,variant:ve.Secondary,size:be.S,onClick:()=>window.open(`${Oe}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(ue,{$gap:8,children:[J&&t(Fe,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(Ge,{label:`Zoomed: ${J.length} symbols`,backgroundColor:r.v2.colors.silver[750],textColor:r.v2.colors.silver[200],textSize:Te.XXS})}),t(fe,{variant:ve.Secondary,size:be.S,label:"Download snapshot",rightIcon:yl,onClick:()=>{if(!O)return;const e=new Blob([O],{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:!O})]})]}),t(Yp,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),D&&e(oh,{$splitWithTable:_,children:[e(nh,{$justifyContent:"space-between",children:[t(Ge,{label:$?`Total in view ${Cp($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:r.v2.colors.silver[750],textColor:r.v2.colors.silver[200],textSize:Te.XXS}),e(ue,{$gap:12,children:[!h&&t(fe,{variant:ve.Secondary,size:be.S,label:"Refresh",leftIcon:tl,onClick:N}),t(le,{label:"Auto refresh",labelAlign:re.Left,size:kt.S,value:h,onChange:m})]})]}),t(Pp,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:n,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:te})]})]}):t(pt,{children:t(xe,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(vp,{pendingModify:X,onClose:U,onConfirm:j}),t(Po,{isOpen:B>0,richTitle:{icon:Ga,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:uo.Button,buttonProps:{variant:ve.Secondary,size:be.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:uo.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Modify Rule",leftIcon:La,onClick:V}}]})]})},ah=b.div`
|
|
790
701
|
position: relative;
|
|
791
702
|
display: flex;
|
|
792
703
|
align-items: center;
|
|
@@ -794,23 +705,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
794
705
|
padding: 8px 16px;
|
|
795
706
|
border-radius: 12px;
|
|
796
707
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
797
|
-
`,
|
|
708
|
+
`,lh=b.div`
|
|
798
709
|
display: flex;
|
|
799
710
|
flex-direction: column;
|
|
800
711
|
gap: 4px;
|
|
801
712
|
flex: 1;
|
|
802
713
|
min-width: 0;
|
|
803
714
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
804
|
-
|
|
715
|
+
`,rh=b.div`
|
|
805
716
|
flex-shrink: 0;
|
|
806
717
|
display: flex;
|
|
807
718
|
align-items: center;
|
|
808
719
|
margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
|
|
809
|
-
`,
|
|
720
|
+
`,sh=b.div`
|
|
810
721
|
min-width: 0;
|
|
811
722
|
white-space: pre;
|
|
812
723
|
overflow-x: auto;
|
|
813
|
-
`,
|
|
724
|
+
`,ch=b.div`
|
|
814
725
|
position: absolute;
|
|
815
726
|
top: 50%;
|
|
816
727
|
right: 8px;
|
|
@@ -819,24 +730,24 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
819
730
|
pointer-events: none;
|
|
820
731
|
transition: opacity 0.15s ease;
|
|
821
732
|
|
|
822
|
-
${
|
|
733
|
+
${ah}:hover & {
|
|
823
734
|
opacity: 1;
|
|
824
735
|
pointer-events: auto;
|
|
825
736
|
}
|
|
826
|
-
`,
|
|
737
|
+
`,dh=({name:o,summary:n,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(ah,{children:[e(lh,{$disabled:i,children:[o&&t(_e,{size:Te.XXXS,color:Pe.Secondary,nowrap:!0,children:o}),t(sh,{children:t(w,{parts:n})})]}),i&&t(rh,{$reserveJumpSpace:!!a,children:t(Ge,{label:Lo,textSize:Te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(ch,{children:t(Fe,{text:Je.OPEN_IN_SAMPLING_PAGE,children:t(fe,{"data-id":"sampling-rule-jump",variant:ve.Primary,size:be.S,leftIcon:gl,onClick:a})})})]})},uh=b.div`
|
|
827
738
|
opacity: 0;
|
|
828
739
|
pointer-events: none;
|
|
829
740
|
transition: opacity 0.15s ease;
|
|
830
|
-
`,
|
|
831
|
-
&:hover ${
|
|
741
|
+
`,ph=b.div`
|
|
742
|
+
&:hover ${uh} {
|
|
832
743
|
opacity: 1;
|
|
833
744
|
pointer-events: auto;
|
|
834
745
|
}
|
|
835
|
-
`,
|
|
746
|
+
`,hh=b.div`
|
|
836
747
|
display: flex;
|
|
837
748
|
align-items: center;
|
|
838
749
|
padding: 4px 12px;
|
|
839
|
-
`,
|
|
750
|
+
`,mh=({source:e,onRedirectToSampling:o})=>t(Xt,{bgTint:"1000",richTitle:{title:Je.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(bh,{container:e,onRedirectToSampling:o},e.containerName))});var gh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(gh||(gh={}));const fh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],bh=({container:o,onRedirectToSampling:n})=>{const[i,l]=a(gh.All),r=mo(e=>e.setPendingViewSamplingRule),s=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=c(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),u=c(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=c(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=c(()=>i===gh.Noisy?d:i===gh.HighlyRelevant?u:i===gh.CostReduction?p:[...d,...u,...p],[i,u,p]),m=d.length+u.length+p.length,g=c(()=>(e,t)=>{r({ruleId:e,category:t}),n()},[n,r]),f=t(uh,{children:t(fe,{"data-id":"sampling-container-create-rule",variant:ve.Secondary,size:be.S,label:Fo,rightIcon:$a,onClick:e=>{e.stopPropagation(),n()}})});return t(ph,{children:e(Xt,{bgTint:"900",richTitle:{title:o.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[s.length?e(Xt,{bgTint:"800",richTitle:{title:Je.HEAD_SAMPLING,badge:{label:s.length}},children:[t(_e,{size:Te.XXS,children:Je.NOISY_OPERATIONS}),t(ee,{$gap:4,children:s.map(e=>t(dh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(hh,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:Je.HEAD_SAMPLING})}),m?e(Xt,{bgTint:"800",richTitle:{title:Je.TAIL_SAMPLING,badge:{label:m}},children:[t(ce,{options:(b=d.length,v=u.length,y=p.length,[{value:gh.All,label:"All",badge:{label:b+v+y,textSize:Te.XXXS}},{value:gh.Noisy,label:Je.NOISY_OPERATIONS,badge:{label:b,textSize:Te.XXXS}},{value:gh.HighlyRelevant,label:Je.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:Te.XXXS}},{value:gh.CostReduction,label:Je.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:Te.XXXS}}]),selected:i,setSelected:l}),t(ee,{$gap:4,children:h.length?h.map(e=>t(dh,{name:e.rule.name,summary:fh(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(xe,{title:`No ${i===gh.All?`${gh.Noisy}, ${gh.HighlyRelevant} and ${gh.CostReduction}`:i} operations`})})]}):t(hh,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:Je.TAIL_SAMPLING})})]})});var b,v,y},vh=[Co.Deployment,Co.StatefulSet,Co.DaemonSet,Co.DeploymentConfig,Co.Rollout,Co.Pod];var yh;(e=>{e.Workload="Workload",e.Pod="Pod"})(yh||(yh={}));const Ch=e=>!!e&&io(e.status)===Ne.Error,Sh=e=>Ch(e.healthStatus),xh=e=>Ch(e.odigosHealthStatus)||(e.processes??[]).some(Sh),wh=e=>Ch(e.agentInjectedStatus)||Ch(e.odigosHealthStatus)||(e.containers??[]).some(xh),Th=({onClose:o,sourceId:n,onRedirectToSampling:l})=>{const r=v(),{isVm:s,isConnector:p,isK8s:h}=S(),{sourcesApi:m,configApi:g}=Ml(),{selectedStreamName:f}=qe(),{genericForm:b,loadSource:y,validateFormData:C}=Ul(),{data:x}=g.useEffectiveConfig(),[w,T]=a(!1),[k,I]=a(!1),[E,N]=a(!1),[O,$]=a(eu.Overview),[A,R]=a(null),[D,_]=a({openFor:null}),P=(()=>{const[e,t]=a(null),o=d(e=>{t({tab:eu.Pods,podName:e.podName})},[]),n=d((e,o)=>{t({tab:eu.Pods,podName:e.podName,containerName:o.containerName})},[]),i=d((e,o,n)=>{const i=lu({identifyingAttributes:n.identifyingAttributes});t({tab:eu.Pods,podName:e.podName,containerName:o.containerName,processPid:i})},[]),l=d(()=>t(null),[]);return c(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:l}),[e,o,n,i,l])})();i(()=>{P.jumpToTarget&&$(P.jumpToTarget.tab)},[P.jumpToTarget]),i(()=>{A&&JSON.stringify(go(n))!==JSON.stringify(go(A))&&R(null)},[n,A]);const L=u(!1),F=d(async()=>R(await m.fetchById(n)||null),[n,m]);i(()=>{if(L.current||(F(),L.current=!0),!w){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,w]),i(()=>{A&&y(A)},[A]);const M=A&&vh.includes(A.id.kind),z=c(()=>{const e=[],o=(A?.pods??[]).some(wh),n=(i=A,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(ll,{...e,fill:r.v2.colors.red[500]});return e.push({value:eu.Overview,label:Je.OVERVIEW}),h?(e.push({value:eu.Pods,label:Je.PODS,icon:o?a:void 0}),e.push({value:eu.Libraries,label:Je.LIBRARIES,icon:n?a:void 0}),e.push({value:eu.PeerSources,label:Je.PEER_SOURCES}),x?.profiling?.enabled&&e.push({value:eu.Profiling,label:Je.PROFILING}),e.push({value:eu.Sampling,label:Je.SAMPLING}),e.push({value:eu.Debug,label:Je.DEBUG}),e):e},[h,x,A?.pods,r]),B=d(()=>T(!0),[]),X=c(()=>()=>{o(),l()},[o,l]),U=d(()=>{A&&y(A),T(!1)},[A]),V=d(async()=>{if(!A||!b)return;const{errorMessage:e,preparedFormData:t}=C();if(e)return;const o=t.otelServiceName!==A.id.name?t.otelServiceName:"";await m.update(n,{...t,otelServiceName:o}),T(!1)},[A,b,C,n,m]),H=d(()=>I(!0),[]),j=d(async()=>{A&&(await m.persistV2({[Ot]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,region:A.id.region??"",selected:!1,currentStreamName:f}]}),I(!1),o())},[A,m,f,o]),G=d(()=>{_({openFor:yh.Workload})},[]),W=d(e=>{$(e),P.clearJumpToTarget()},[P]),K=d(async()=>{await m.recoverFromRollback(n)},[m,n]),Y=d(()=>_({openFor:null}),[]),J=d(async()=>{D.openFor===yh.Workload?await m.restartWorkloads([n]):D.openFor===yh.Pod&&D.podNamespace&&D.podName&&await m.restartPod(D.podNamespace,D.podName),Y()},[D,m,n,Y]),q=c(()=>{const{kind:e,name:t}=n;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[n]),Z=c(()=>{const e=[];return w||O===eu.Overview&&(e.push({id:"edit-source-btn-edit",label:_t.EDIT,icon:La,active:w,onClick:B}),e.push({id:"edit-source-btn-delete",label:_t.UNINSTRUMENT,icon:Oa,color:r.v2.colors.red[500],active:k,onClick:H})),e},[O,w,k,B,H,r]),Q=c(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:Te.S};return e.push({...t,label:A.id.name,leftIcon:h?al:void 0}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:il,textColor:r.v2.colors.silver[200]}),e},[A,r,h]);if(!A)return t(Lt,{isOpen:!0,children:t(pt,{$height:"80vh",children:t(bt,{withSpinner:!0})})});const te=O===eu.Profiling?E?"95vw":"fit-content":w?void 0:"60vw",oe=s?Cl:p?Ja:Mo(A.containers)[0];return e(gu,{value:P,children:[t(Lt,{isOpen:!0,width:te,minWidth:"min(1100px, 100vw)",header:{icon:oe,titleBadges:Q,onClose:()=>{W(eu.Overview),R(null),N(!1),o()},actions:Z},footer:{actions:w?[{"data-id":"edit-source-btn-cancel",label:_t.CANCEL,variant:ve.Secondary,onClick:U},{"data-id":"edit-source-btn-save",label:_t.SAVE,variant:ve.Primary,onClick:V}]:[]},children:t(dt,{$padding:"4px 12px 12px",children:e(ee,{$gap:16,children:[!w&&z.length>1&&t(ce,{options:z,selected:O,setSelected:W}),(()=>{switch(O){case eu.Overview:return w?t(ws,{}):t(mp,{source:A,onClickRollout:G,onClickRollback:K});case eu.Pods:return t(Cu,{source:A,onClickRestartPod:M?(e,t)=>_({openFor:yh.Pod,podNamespace:e,podName:t}):void 0});case eu.Libraries:return t(gp,{source:A});case eu.PeerSources:return t(xu,{source:A});case eu.Profiling:return t(ih,{source:A,onFlameFullscreenChange:N});case eu.Sampling:return t(mh,{source:A,onRedirectToSampling:X});case eu.Debug:return t(Eu,{source:A});default:return null}})()]})})}),t(wr,{target:"source",action:"uninstrument",isOpen:k,onClose:()=>I(!1),onApprove:j}),t(Ye,{isOpen:D.openFor===yh.Workload,title:q.title,description:q.description,onClose:Y,denyButton:{label:"Go back",variant:ve.Secondary,onClick:Y},approveButton:{label:_t.CONFIRM,variant:ve.Primary,onClick:J}}),t(wr,{target:"pod",action:"restart",description:Je.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:D.openFor===yh.Pod,onClose:Y,onApprove:J,overrideApproveButtonLabel:Je.DELETE_POD_TO_RESTART})]})},kh=b.div`
|
|
840
751
|
display: flex;
|
|
841
752
|
align-items: center;
|
|
842
753
|
gap: 8px;
|
|
@@ -846,9 +757,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
846
757
|
&:hover {
|
|
847
758
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
848
759
|
}
|
|
849
|
-
`,
|
|
760
|
+
`,Ih=b.div`
|
|
850
761
|
flex: 1;
|
|
851
|
-
`,
|
|
762
|
+
`,Eh=({onClick:o})=>{const n=v().v2.colors.red[500];return e(kh,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(_e,{size:Te.XS,weight:500,color:n,children:Uo}),t(Oa,{size:16,fill:n})]})};const Nh={[Hl.EditAutoNoisy]:{title:on,subTitle:tn,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Hl.EditAutoCostReduction]:{title:en,subTitle:Qo,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Hl.EditAutoHighlyRelevant]:{title:Zo,subTitle:qo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Oh=({isOpen:e,title:o,subTitle:n,onClose:i,footer:a,renderBody:l})=>t(Lt,{isOpen:e,width:an,header:{icon:Sl,title:o,subTitle:n,onClose:i},footer:a,children:l?l():t(dt,{$padding:"12px",children:t(Os,{})})}),$h=({isOpen:n,onClose:l,onSubmit:r,validateForm:s,onNavigateToDuplicate:u})=>{const{category:p,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Vl(Hl.Create),[b,v]=a(!1);i(()=>{n&&(m(),v(!1))},[n]);const y=d(()=>{v(!1),r(h)},[h,r]),C=d(()=>{if(s){const e=s(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(E(t)))(h,p)?v(!0):y()},[h,p,s,f,y]),S=c(()=>b?((e,t)=>{switch(e){case"noisy":return T($(t));case"highlyRelevant":return k(O(t));case"costReduction":return I(N(t))}})(p,h):[],[b,p,h]),x={note:g?{status:Ne.Warning,message:g.message,action:u?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>u(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:zo,variant:ve.Secondary,size:be.S,onClick:l},{"data-id":"sampling-create-btn-submit",label:Fo,variant:ve.Primary,size:be.S,onClick:C,disabled:!!g}]};return e(o,{children:[t(Oh,{isOpen:n,title:Go[p],subTitle:Vo[p],onClose:l,footer:x}),t(Ye,{isOpen:b,title:Yo,description:Ko,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Wo,variant:ve.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Fo,variant:ve.Primary,onClick:y},children:e(ee,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(_e,{size:Te.XS,weight:500,color:Pe.Secondary,children:Jo}),t("div",{style:{width:"100%"},children:t(ur,{summary:S})})]})})]})},Ah=({onClose:n,onDelete:i,onSaveEdit:a,validateForm:l,onNavigateToDuplicate:r})=>{const{data:s,isEditing:u,formData:p,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Vl(Hl.View),b=s?.rule.name||jo,v=u&&s?Ho[s.category]:`${b} preview`,y=d(()=>{if(s&&u){if(l){const e=l(p);if(e)return void f(e)}a(p,s.rule.ruleId,s.samplingId),m()}},[s,u,p,a,l,f,m]),C=d(()=>{s&&i(s.rule.ruleId,s.samplingId)},[s,i]),S=c(()=>{if(!s)return;const i=g?{message:g.message,onViewRule:r?()=>r(g.ruleId):void 0}:null;return function(n){if(n.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(Eh,{onClick:l}),r&&t(Ee,{status:Ne.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Ih,{}),t(fe,{"data-id":"sampling-view-edit-btn-cancel",label:zo,variant:ve.Secondary,size:be.S,onClick:i}),t(fe,{"data-id":"sampling-view-edit-btn-save",label:Bo,variant:ve.Primary,size:be.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=n;return{children:e(o,{children:[t(Eh,{onClick:i}),t(Ih,{}),t(fe,{"data-id":"sampling-view-btn-cancel",label:zo,variant:ve.Secondary,size:be.S,onClick:a}),t(fe,{"data-id":"sampling-view-btn-edit",label:Xo,variant:ve.Primary,size:be.S,onClick:l})]})}}(u?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:n,onEdit:h})},[s,u,g,m,y,C,h,n,r]);return t(Oh,{isOpen:!!s,title:v,subTitle:s?Vo[s.category]:"",onClose:n,footer:S})},Rh=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Vl(Hl.EditAutoNoisy),l=d(()=>n(i,a),[n,i,a]);return t(Ph,{formType:Hl.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},Dh=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Vl(Hl.EditAutoCostReduction),l=d(()=>n(i,a),[n,i,a]);return t(Ph,{formType:Hl.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},_h=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i}=Vl(Hl.EditAutoHighlyRelevant),a=d(()=>n(i),[n,i]);return t(Ph,{formType:Hl.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:a})},Ph=({formType:e,isOpen:o,onClose:n,onSave:i})=>{const a=Nh[e];return t(Oh,{isOpen:o,title:a.title,subTitle:a.subTitle,onClose:n,footer:{actions:[{"data-id":a.cancelId,label:zo,variant:ve.Secondary,size:be.S,onClick:n},{"data-id":a.saveId,label:nn,variant:ve.Primary,size:be.S,onClick:i}]}})},Lh=e=>{switch(e.formType){case Hl.Create:return t(ql,{formType:Hl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t($h,{...e})});case Hl.View:return t(ql,{formType:Hl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Ah,{...e})});case Hl.EditAutoNoisy:return t(ql,{formType:Hl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Rh,{...e})});case Hl.EditAutoCostReduction:return t(ql,{formType:Hl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Dh,{...e})});case Hl.EditAutoHighlyRelevant:return t(ql,{formType:Hl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(_h,{...e})})}},Fh=({token:n,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=Rt(),m=!a||i||!c.newToken;return ln({key:"Enter",active:!m},s),e(ue,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(ye,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(ue,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(bt,{title:"Saving...",withGradient:!0}):e(o,{children:[t(fe,{variant:ve.Secondary,size:be.S,leftIcon:ja,onClick:r,disabled:i}),t(fe,{variant:ve.Primary,size:be.S,leftIcon:Ha,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(_e,{size:Te.XS,children:new Array(55).fill("•").join("")}),e(ue,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(gt,{icon:La,onClick:l})]})]})},Mh=({expiresAt:e,callbackValid:o,callbackExpired:n})=>{const{formatTimeAgo:a}=Qt(),l=c(()=>a(e),[e,a]),r=c(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),s=c(()=>rn(e,0)?Ne.Error:rn(e,2592e6)?Ne.Warning:Ne.Success,[e]),d=c(()=>s===Ne.Success?Ha:s===Ne.Warning?xl:ll,[s]);return i(()=>{s===Ne.Success?o():s===Ne.Error&&n()},[s]),t(Fe,{text:r,children:t(Ge,{leftIcon:d,label:l,status:s,invertColors:!0,useSecondaryTone:!0})})},zh=b.div`
|
|
852
763
|
display: flex;
|
|
853
764
|
flex-direction: column;
|
|
854
765
|
gap: 12px;
|
|
@@ -856,7 +767,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
856
767
|
border-radius: 12px;
|
|
857
768
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
858
769
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
859
|
-
`,
|
|
770
|
+
`,Bh=({children:e})=>{const o=v();return t(_e,{size:Te.XXXS,color:o.v2.colors.grey[150],children:e})},Xh=({token:o})=>{const{tokensApi:n}=Ml(),[i,l]=a(!1),[r,s]=a(!1),[c,d]=a(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=Ht({newToken:""});return t(lt,{richTitle:{icon:wl,title:"Odigos Pro Token"},children:e(zh,{$isExpired:c,children:[e(ue,{$justifyContent:"space-between",children:[e(ee,{$gap:4,children:[t(Bh,{children:"Issued for"}),t(_e,{size:Te.XS,children:o.name||"N/A"})]}),e(ee,{$gap:4,children:[t(Bh,{children:"Expiration"}),t(Mh,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ee,{})]}),t(ue,{children:e(ee,{children:[t(Bh,{children:"Token"}),t(Fh,{token:o.token,newToken:u.newToken,isLoading:i,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void p("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;l(!0);const e=await n.updateToken(u.newToken.trim());l(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},Uh=b.div`
|
|
860
771
|
display: flex;
|
|
861
772
|
flex-direction: column;
|
|
862
773
|
align-items: center;
|
|
@@ -865,23 +776,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
865
776
|
padding: 12px 24px;
|
|
866
777
|
border-radius: 8px;
|
|
867
778
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
868
|
-
`,pm=()=>{const{progress:o}=Ot(),{describeApi:n,namespacesApi:i}=Ll(),{items:a}=i.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:p}=Ht({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(dt,{richTitle:{icon:xl,title:"Diagnose"},children:l?e(dm,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[Dt.DownloadingDiagnose]?.percentage,percentage:o[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[Dt.DownloadingDiagnose]?.percentage,visualIcon:bl,startedAt:l}),o[Dt.DownloadingDiagnose]?.list?.length&&t(ee,{$width:"100%",children:o[Dt.DownloadingDiagnose].list.map((o,n)=>e(me,{$gap:4,$alignItems:"center",children:[o.status===Fe.Success?t(Ua,{size:16}):o.status===Fe.Error?t(Va,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(pe,{size:he.XXXS,color:ue.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(ee,{$gap:24,children:[t(pe,{size:he.XXS,color:ue.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(ee,{$gap:16,children:[e(me,{$gap:8,children:[t(oe,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include pprof profiles"})]}),e(me,{$gap:8,children:[t(oe,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include Prometheus metrics"})]}),e(me,{$gap:8,children:[t(oe,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(ln,{alignX:sn.Left,alignY:rn.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:be.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(qe,{label:c.sourceWorkloadNamespaces.length,status:Fe.Default}):void 0}}),t(me,{$justifyContent:"flex-end",children:t(ge,{label:"Download Diagnose",rightIcon:bl,variant:be.Primary,onClick:async()=>{n.downloadDiagnose&&(r(Date.now()),await n.downloadDiagnose(c),r(null),p())},disabled:null!==l})})]})})},um=()=>{const{platformType:e,version:o,tier:n}=S(),{describeApi:a}=Ll(),[l,r]=s(null);return i(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(dt,{richTitle:{icon:cl,title:"General Information"},children:t(Xt,{cellsPerRow:2,items:[{id:cn(),title:"Odigos Version",label:o},{id:cn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:cn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:cn(),title:"Tier",label:n}]})})},hm=({isOpen:o,onClose:n})=>{const{describeApi:i,tokensApi:a}=Ll(),l=a.useTokens().items[0];return e(ce,{isOpen:o,header:{icon:cl,title:"System Overview",onClose:n},children:[i.fetchDescribeOdigos&&t(um,{}),a.updateToken&&l&&t(cm,{token:l}),i.downloadDiagnose&&t(pm,{})]})},mm=({isOpen:n,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:s}=tt(),{dataStreamsApi:c}=Ll(),{requestSubmit:d}=zl(),p=r(async e=>{c.create?await c.create(e):(l([e]),s(e.name)),i()},[c,l,s,i]),u=r(()=>d(p),[d,p]);return nn({key:"Enter",active:n},u),e(o,{children:[t(Qe,{isOpen:n,onClose:i,onCloseEnd:a,title:et.NAME_YOUR_STREAM,description:et.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:be.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:i},children:t(Js,{autoFocus:!0})}),t(qs,{})]})},gm=({isOpen:n,onClose:a,onCloseEnd:l,dataStreamName:s})=>{const{dataStreamsApi:c}=Ll(),{genericForm:d,loadDataStream:p,requestSubmit:u}=zl();i(()=>{n&&s&&p(s)},[n,s]);const h=!!d?.isFormDirty,m=r(async e=>{await c.update(s,e),a()},[c,s,a]),g=r(()=>u(m),[u,m]);return nn({key:"Enter",active:n},g),e(o,{children:[t(Qe,{isOpen:n,onClose:a,onCloseEnd:l,title:et.RENAME_STREAM(s),description:et.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:a},children:t(Js,{autoFocus:!0})}),t(qs,{})]})},fm=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),bm=b.div`
|
|
779
|
+
`,Vh=()=>{const{progress:o}=Et(),{describeApi:n,namespacesApi:i}=Ml(),{items:l}=i.useNamespaces(),[r,s]=a(null),{formData:c,handleFormChange:d,resetFormData:u}=Ht({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(lt,{richTitle:{icon:Tl,title:"Diagnose"},children:r?e(Uh,{children:[t(bt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[$t.DownloadingDiagnose]?.percentage,percentage:o[$t.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[$t.DownloadingDiagnose]?.percentage,visualIcon:yl,startedAt:r}),o[$t.DownloadingDiagnose]?.list?.length&&t(ee,{$width:"100%",children:o[$t.DownloadingDiagnose].list.map((o,n)=>e(ue,{$gap:4,$alignItems:"center",children:[o.status===Ne.Success?t(Ha,{size:16}):o.status===Ne.Error?t(ja,{size:16}):t(bt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(ee,{$gap:24,children:[t(_e,{size:Te.XXS,color:Pe.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(ee,{$gap:16,children:[e(ue,{$gap:8,children:[t(oe,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include pprof profiles"})]}),e(ue,{$gap:8,children:[t(oe,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include Prometheus metrics"})]}),e(ue,{$gap:8,children:[t(oe,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(_e,{size:Te.XXXS,color:Pe.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(sn,{alignX:dn.Left,alignY:cn.Bottom,items:l.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:ve.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Ge,{label:c.sourceWorkloadNamespaces.length,status:Ne.Default}):void 0}}),t(ue,{$justifyContent:"flex-end",children:t(fe,{label:"Download Diagnose",rightIcon:yl,variant:ve.Primary,onClick:async()=>{n.downloadDiagnose&&(s(Date.now()),await n.downloadDiagnose(c),s(null),u())},disabled:null!==r})})]})})},Hh=()=>{const{platformType:e,version:o,tier:n}=S(),{describeApi:l}=Ml(),[r,s]=a(null);return i(()=>{l.fetchDescribeOdigos&&l.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(lt,{richTitle:{icon:ul,title:"General Information"},children:t(Xt,{cellsPerRow:2,items:[{id:un(),title:"Odigos Version",label:o},{id:un(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:un(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:un(),title:"Tier",label:n}]})})},jh=({isOpen:o,onClose:n})=>{const{describeApi:i,tokensApi:a}=Ml(),l=a.useTokens().items[0];return e(Lt,{isOpen:o,header:{icon:ul,title:"System Overview",onClose:n},children:[i.fetchDescribeOdigos&&t(Hh,{}),a.updateToken&&l&&t(Xh,{token:l}),i.downloadDiagnose&&t(Vh,{})]})},Gh=({isOpen:n,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=qe(),{dataStreamsApi:s}=Ml(),{requestSubmit:c}=Xl(),u=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),i()},[s,l,r,i]),p=d(()=>c(u),[c,u]);return ln({key:"Enter",active:n},p),e(o,{children:[t(Ye,{isOpen:n,onClose:i,onCloseEnd:a,title:Je.NAME_YOUR_STREAM,description:Je.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:_t.DONE,variant:ve.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:_t.CANCEL,variant:ve.Secondary,onClick:i},children:t(xs,{autoFocus:!0})}),t(Ss,{})]})},Wh=({isOpen:n,onClose:a,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Ml(),{genericForm:c,loadDataStream:u,requestSubmit:p}=Xl();i(()=>{n&&r&&u(r)},[n,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),a()},[s,r,a]),g=d(()=>p(m),[p,m]);return ln({key:"Enter",active:n},g),e(o,{children:[t(Ye,{isOpen:n,onClose:a,onCloseEnd:l,title:Je.RENAME_STREAM(r),description:Je.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:_t.SAVE,variant:ve.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:_t.CANCEL,variant:ve.Secondary,onClick:a},children:t(xs,{autoFocus:!0})}),t(Ss,{})]})},Kh=({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)"})})]})]}),Yh=b.div`
|
|
869
780
|
position: absolute;
|
|
870
781
|
top: 50%;
|
|
871
782
|
left: 50%;
|
|
872
783
|
transform: translate(-50%, -50%);
|
|
873
784
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
874
|
-
`,
|
|
785
|
+
`,Jh=()=>{const{drawerType:o,setDrawerType:n}=mo(),i=o===hn.OnboardingDone,a=()=>n(null);return e(pn,{isOpen:i,onClose:a,children:[t(Kh,{}),t(Yh,{children:e(ee,{$gap:32,$alignItems:"center",children:[e(ee,{$gap:24,$alignItems:"center",children:[t(_e,{size:Te.L,weight:500,children:"Welcome to"}),t(kr,{size:260}),t(_e,{size:Te.S,weight:400,children:"Your observability control plane is ready."})]}),t(fe,{label:"Get Started",rightIcon:Aa,onClick:a})]})})]})},qh=b.div`
|
|
875
786
|
display: flex;
|
|
876
787
|
flex-direction: column;
|
|
877
788
|
gap: 8px;
|
|
878
789
|
padding: 4px 8px;
|
|
879
790
|
border-radius: 8px;
|
|
880
791
|
width: 100%;
|
|
881
|
-
`,
|
|
792
|
+
`,Zh=b.div`
|
|
882
793
|
white-space: pre;
|
|
883
794
|
overflow-x: auto;
|
|
884
|
-
`,
|
|
795
|
+
`,Qh=({name:o,recommended:n,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(qh,{children:[e(ue,{$gap:8,$justifyContent:"space-between",children:[e(ue,{$gap:4,children:[t(_e,{size:Te.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Ge,{label:mn,leftIcon:kl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:Te.XXXS})]}),t(le,{name:s??`sampling-onboarding-toggle-${o}`,label:i,labelAlign:re.Left,value:a,onChange:l,size:kt.S})]}),t(Zh,{children:t(w,{parts:r})})]})},em=b.div`
|
|
885
796
|
position: relative;
|
|
886
797
|
display: flex;
|
|
887
798
|
align-items: center;
|
|
@@ -891,18 +802,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
891
802
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
892
803
|
border-top-left-radius: 18px;
|
|
893
804
|
border-top-right-radius: 18px;
|
|
894
|
-
`,
|
|
805
|
+
`,tm=b.div`
|
|
895
806
|
position: absolute;
|
|
896
807
|
left: 16px;
|
|
897
808
|
top: 50%;
|
|
898
809
|
transform: translateY(-50%);
|
|
899
|
-
`,
|
|
810
|
+
`,om=b.div`
|
|
900
811
|
height: 16px;
|
|
901
812
|
width: 100%;
|
|
902
813
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
903
814
|
border-top-left-radius: 18px;
|
|
904
815
|
border-top-right-radius: 18px;
|
|
905
|
-
`,
|
|
816
|
+
`,nm=b.div`
|
|
906
817
|
width: ${({$width:e})=>e}px;
|
|
907
818
|
display: flex;
|
|
908
819
|
flex-direction: column;
|
|
@@ -910,7 +821,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
910
821
|
gap: 22px;
|
|
911
822
|
padding: 8px 32px 32px 32px;
|
|
912
823
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
913
|
-
`,
|
|
824
|
+
`,im=e=>t(Il,{rotate:90,...e}),am=({children:o,center:n,onNext:i,nextLabel:a=gn,nextLoading:l})=>e(ue,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,i&&t(fe,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:im,variant:ve.Primary,size:be.M,onClick:i,loading:l})]}),lm=e=>t(Il,{rotate:-90,...e}),rm=({title:o,onBack:n})=>{const i=v();return e(em,{$hasBack:!!n,children:[n&&t(tm,{children:t(gt,{"data-id":"sampling-onboarding-back",icon:lm,size:ft.M,onClick:n})}),t(_e,{size:Te.M,weight:500,color:i.v2.colors.white[500],align:"center",children:o})]})},sm=b.div`
|
|
914
825
|
box-sizing: border-box;
|
|
915
826
|
width: ${({$width:e})=>e??"100%"};
|
|
916
827
|
${({$fillHeight:e})=>e&&y`
|
|
@@ -923,16 +834,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
923
834
|
padding: 16px;
|
|
924
835
|
border-radius: 16px;
|
|
925
836
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
926
|
-
`,
|
|
837
|
+
`,cm=({children:e,fillHeight:o,width:n})=>t(sm,{$fillHeight:o,$width:n,children:e}),dm=b.ul`
|
|
927
838
|
margin: 0;
|
|
928
839
|
padding: 0;
|
|
929
840
|
list-style: disc;
|
|
930
|
-
`,
|
|
841
|
+
`,um=b.li`
|
|
931
842
|
margin-left: 18px;
|
|
932
843
|
& + & {
|
|
933
844
|
margin-top: 6px;
|
|
934
845
|
}
|
|
935
|
-
`,
|
|
846
|
+
`,pm=({items:e,color:o})=>{const n=v(),i=o||n.v2.colors.silver[200];return t(dm,{children:e.map((e,o)=>t(um,{style:{color:i},children:t(_e,{size:Te.XXS,color:i,children:e})},o))})},hm=({items:o})=>{const n=v();return t(ee,{$gap:16,children:o.map((o,i)=>e(ue,{$gap:8,$alignItems:"flex-start",children:[e(_e,{size:Te.XS,color:n.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ee,{$gap:2,children:[t(_e,{size:Te.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(_e,{size:Te.XS,color:n.v2.colors.silver[200],children:o.description})]})]},i))})},mm=({message:e})=>t(Ee,{status:Ne.Default,message:e,fullWidth:!0,smallIcon:!0}),gm=b.div`
|
|
936
847
|
width: 100%;
|
|
937
848
|
padding: 8px;
|
|
938
849
|
display: flex;
|
|
@@ -940,12 +851,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
940
851
|
gap: 4px;
|
|
941
852
|
border-radius: 16px;
|
|
942
853
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
943
|
-
`,
|
|
854
|
+
`,fm=b.div`
|
|
944
855
|
display: flex;
|
|
945
856
|
align-items: center;
|
|
946
857
|
gap: 8px;
|
|
947
858
|
padding: 4px 8px 12px 8px;
|
|
948
|
-
`,
|
|
859
|
+
`,bm=b.div`
|
|
949
860
|
width: 100%;
|
|
950
861
|
display: flex;
|
|
951
862
|
flex-direction: column;
|
|
@@ -953,20 +864,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
953
864
|
padding: 8px;
|
|
954
865
|
border-radius: 12px;
|
|
955
866
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
956
|
-
`,
|
|
867
|
+
`,vm=({children:e})=>{const o=v();return t(_e,{size:Te.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},ym=b.div`
|
|
957
868
|
white-space: pre-line;
|
|
958
|
-
`,
|
|
869
|
+
`,Cm=({enabled:n,onEnabledChange:i,onBack:a,onNext:l})=>{const r=v(),s=c(()=>A({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(rm,{title:fn,onBack:a}),e(nm,{$width:854,children:[t(vm,{children:bn}),e(ee,{$gap:8,$width:"100%",children:[t(cm,{children:t(ym,{children:t(_e,{size:Te.XXS,color:r.v2.colors.silver[200],children:vn})})}),e(ee,{$gap:8,$width:"100%",children:[e(gm,{children:[t(fm,{children:t(_e,{size:Te.S,weight:500,color:r.v2.colors.white[500],children:yn})}),t(bm,{children:t(Qh,{name:Sn,recommended:!0,toggleLabel:Cn,enabled:n,onEnabledChange:i,summary:s,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(mm,{message:xn})]})]})]}),t(am,{onNext:l})]})},Sm=e=>t(Il,{rotate:90,...e}),xm=({onClose:n})=>{const i=v();return e(o,{children:[t(om,{}),e(nm,{$width:732,children:[t(wn,{icon:Sl}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[t(_e,{size:Te.M,weight:500,color:i.v2.colors.white[500],children:Tn}),kn.split("\n").map((e,o)=>t(vm,{children:e},`subtitle-${o}-${e}`)),e(cm,{children:[t(_e,{size:Te.XS,color:i.v2.colors.silver[200],children:In}),t(pm,{color:i.v2.colors.white[500],items:[En,Nn,On]})]})]})]}),t(am,{center:!0,children:t(fe,{"data-id":"sampling-onboarding-btn-go-to",label:$n,rightIcon:Sm,variant:ve.Primary,size:be.M,onClick:n})})]})},wm=e=>t(Il,{rotate:90,...e}),Tm=b.div`
|
|
959
870
|
display: flex;
|
|
960
871
|
flex-direction: column;
|
|
961
872
|
align-items: center;
|
|
962
873
|
gap: 8px;
|
|
963
874
|
width: 100%;
|
|
964
|
-
`,
|
|
875
|
+
`,km=({onSkip:n,onNext:i})=>{const a=v();return e(o,{children:[t(om,{}),e(nm,{$width:732,children:[t(wn,{icon:Sl}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Tm,{children:[t(_e,{size:Te.M,weight:500,color:a.v2.colors.white[500],children:An}),t(vm,{children:Rn})]}),e(cm,{children:[t(_e,{size:Te.XS,color:a.v2.colors.silver[200],children:Dn}),t(hm,{items:[{title:Pn,description:_n},{title:Fn,description:Ln},{title:zn,description:Mn}]}),t(mm,{message:Bn})]})]})]}),e(am,{center:!0,children:[t(fe,{"data-id":"sampling-onboarding-btn-skip",label:Xn,variant:ve.Secondary,onClick:n}),t(fe,{"data-id":"sampling-onboarding-btn-start",label:Un,rightIcon:wm,variant:ve.Primary,onClick:i})]})]})},Im=b.div`
|
|
965
876
|
display: flex;
|
|
966
877
|
align-items: stretch;
|
|
967
878
|
gap: 16px;
|
|
968
879
|
width: 100%;
|
|
969
|
-
`,
|
|
880
|
+
`,Em=b.div`
|
|
970
881
|
flex: 1;
|
|
971
882
|
display: flex;
|
|
972
883
|
flex-direction: column;
|
|
@@ -986,18 +897,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
986
897
|
background-color: ${t.v2.colors.silver[700]};
|
|
987
898
|
}
|
|
988
899
|
`}
|
|
989
|
-
`,
|
|
900
|
+
`,Nm=b.div`
|
|
990
901
|
display: flex;
|
|
991
902
|
align-items: center;
|
|
992
903
|
gap: 8px;
|
|
993
904
|
padding: 12px 16px;
|
|
994
|
-
`,
|
|
905
|
+
`,Om=b.div`
|
|
995
906
|
flex: 1;
|
|
996
907
|
padding: 8px;
|
|
997
908
|
display: flex;
|
|
998
909
|
flex-direction: column;
|
|
999
910
|
gap: 8px;
|
|
1000
|
-
|
|
911
|
+
`,$m=b.div`
|
|
1001
912
|
flex: 1;
|
|
1002
913
|
display: flex;
|
|
1003
914
|
flex-direction: column;
|
|
@@ -1005,17 +916,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1005
916
|
padding: 12px;
|
|
1006
917
|
border-radius: 12px;
|
|
1007
918
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
1008
|
-
`,
|
|
919
|
+
`,Am=b.div`
|
|
1009
920
|
display: flex;
|
|
1010
921
|
justify-content: flex-end;
|
|
1011
|
-
`,
|
|
922
|
+
`,Rm=b.div`
|
|
1012
923
|
display: flex;
|
|
1013
924
|
align-items: center;
|
|
1014
925
|
gap: 8px;
|
|
1015
926
|
padding: 4px 12px 4px 4px;
|
|
1016
927
|
border-radius: 8px;
|
|
1017
928
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
1018
|
-
`,
|
|
929
|
+
`,Dm=b.div`
|
|
1019
930
|
display: flex;
|
|
1020
931
|
align-items: center;
|
|
1021
932
|
justify-content: center;
|
|
@@ -1023,13 +934,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1023
934
|
height: 24px;
|
|
1024
935
|
border-radius: 6px;
|
|
1025
936
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
1026
|
-
`,
|
|
937
|
+
`,_m=({selected:o,onSelect:n,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Em,{$selected:o,onClick:n,children:[e(Nm,{children:[t(he,{"data-id":`sampling-onboarding-radio-${i}`,value:o,onChange:n,size:ge.L}),t(Sl,{size:24,fill:d.v2.colors.white[500]}),t(_e,{size:Te.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Om,{children:[e($m,{$selected:o,children:[e(ee,{$gap:8,children:[t(Ge,{...l,textSize:Te.XXXS}),t(_e,{size:Te.XXS,color:u,children:a})]}),r&&r.length>0&&t(pm,{color:u,items:r}),s&&e(Rm,{children:[t(Dm,{children:t(xl,{size:18,fill:d.v2.colors.yellow[500]})}),t(_e,{size:Te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Am,{children:t(fe,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:ai,rightIcon:_a,variant:ve.Text,size:be.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Pm=({strategy:n,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(rm,{title:Vn,onBack:a}),e(nm,{$width:854,children:[t(vm,{children:Hn}),e(Im,{children:[t(_m,{selected:"keep-list"===n,onSelect:()=>i("keep-list"),name:Jn,description:Yn,badgeProps:{label:Kn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Gn,Wn],warning:jn,onReadMore:c}),t(_m,{selected:"drop-list"===n,onSelect:()=>i("drop-list"),name:ti,description:ei,badgeProps:{label:Qn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[qn,Zn],onReadMore:c}),t(_m,{selected:"advanced"===n,onSelect:()=>i("advanced"),name:ii,description:ni,badgeProps:{label:oi,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(am,{onNext:l})]})},Lm=({onBack:n,onNext:i,submitting:a})=>{const l=v(),r=c(()=>[{title:ci,bullets:[li,ri,si]},{title:gi,bullets:[di,ui,pi,hi,mi]}],[]);return e(o,{children:[t(rm,{title:fi,onBack:n}),e(nm,{$width:854,children:[t(vm,{children:bi}),t(ue,{$gap:16,$width:"100%",$alignItems:"stretch",children:r.map((o,n)=>e(cm,{fillHeight:!0,width:"50%",children:[t(_e,{size:Te.XS,color:l.v2.colors.white[500],children:o.title}),t(pm,{items:o.bullets})]},n))}),t(mm,{message:vi})]}),t(am,{onNext:i,nextLoading:a})]})},Fm=b.div`
|
|
1027
938
|
white-space: pre-line;
|
|
1028
|
-
`,
|
|
939
|
+
`,Mm=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:a,onNext:l,submitting:r})=>{const s=v(),d=c(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t(rm,{title:yi,onBack:a}),e(nm,{$width:854,children:[t(vm,{children:Ci}),e(ee,{$gap:8,$width:"100%",children:[e(cm,{children:[t(Fm,{children:t(_e,{size:Te.XXS,color:s.v2.colors.silver[200],children:Si})}),t(mm,{message:vi})]}),e(gm,{children:[e(fm,{children:[t(_e,{size:Te.S,weight:500,color:s.v2.colors.white[500],children:xi}),t(rl,{size:16,fill:s.v2.colors.silver[200]})]}),t(bm,{children:t(Qh,{name:Ti,recommended:!0,toggleLabel:wi,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(am,{onNext:l,nextLoading:r})]})},zm=b.div`
|
|
1029
940
|
white-space: pre-line;
|
|
1030
|
-
`,
|
|
941
|
+
`,Bm=b.div`
|
|
1031
942
|
width: fit-content;
|
|
1032
|
-
`,cg=["50","25","10","1","0.1"],dg=({value:o,onChange:n,label:i})=>{const l=v(),r=a(()=>cg.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ee,{$gap:8,children:[t(pe,{size:he.XS,color:l.v2.colors.white[500],children:i}),t(sg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},pg=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=a(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t($m,{title:wi,onBack:s}),e(km,{$width:854,children:[t(Bm,{children:Ti}),e(ee,{$gap:8,$width:"100%",children:[e(Am,{children:[t(rg,{children:t(pe,{size:he.XXS,color:p.v2.colors.silver[200],children:ki})}),t(_m,{items:[Ei,Ii,Ni,$i,Oi]}),t(Lm,{message:fi})]}),e(Fm,{children:[e(Mm,{children:[t(pe,{size:he.S,weight:500,color:p.v2.colors.white[500],children:Ai}),t(al,{size:16,fill:p.v2.colors.silver[200]})]}),t(zm,{children:t(Sm,{name:xi,recommended:!0,toggleLabel:Si,enabled:n,onEnabledChange:i,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(zm,{children:t(dg,{value:l,onChange:r,label:Ri})})]})]})]}),t(Im,{onNext:c,nextLoading:d})]})},ug=({isOpen:e,onClose:o,k8sHealthProbesConfig:n,samplingId:a,docsUrl:l})=>{const{samplingApi:c}=Ll(),[d,p]=s("welcome"),[u,h]=s(!0),[m,g]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);i(()=>{e&&(p("welcome"),h(n?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,n?.enabled]);const x=r(async()=>{const e=a??"default",t=[];if(u!==(n?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:n?.keepPercentage??0}))}if("advanced"!==m&&f){const o=c.createHighlyRelevant;o&&t.push(o({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const o=c.createCostReduction;o&&t.push(o({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),p("success")}catch{}finally{S(!1)}},[a,c,u,n?.enabled,n?.keepPercentage,m,f,v]);let w=null;switch(d){case"welcome":w=t(Wm,{onSkip:o,onNext:()=>p("noisy")});break;case"noisy":w=t(Um,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(ng,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:l});break;case"keep-list":w=t(pg,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(lg,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(ig,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Hm,{onClose:o})}return t(dn,{isOpen:e,onClose:o,children:w})};var hg,mg;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"})(hg||(hg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"})(mg||(mg={}));const gg=[{id:mg.CloudConnector,label:"Cloud Connector"}];var fg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(fg||(fg={}));const bg=[{key:fg.Name,label:"Name"},{key:fg.Type,label:"Type"},{key:fg.Status,label:"Status"},{key:fg.OdigosVersion,label:"Odigos Version"},{key:fg.ConnectedSince,label:"Connected Since"},{key:fg.LastActivity,label:"Last Activity"}],vg=(e,t)=>{const o=e.find(e=>e.key===fg.Id)?.rawValue;return t(o?.toString()||"")},yg={[Fe.Success]:"Connected",[Fe.Warning]:"Degraded",[Fe.Error]:"Error",[Fe.Disabled]:"Disabled",[Fe.Info]:"Pending"},Cg={[Di.K8s]:ro.Purple,[Di.Vm]:ro.Blue,[Di.Connector]:ro.Green},Sg=({connections:o,getConnections:n,onClickConnection:l,deleteConnection:c,onCreateNew:d,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=Qt(),{capabilities:b}=Ll(),[y,C]=s(!1),[S,x]=s(o||[]),w=r(async()=>{try{C(!0),x(await n()??[])}catch(e){}finally{C(!1)}},[]);i(()=>{S.length||w()},[]);const[T,k]=s(""),[E,I]=s(null),[N,$]=s([]),[O,A]=s(!1),[R,P]=s(!1),L=r(()=>{A(!1),P(!0),w()},[w]),F=r(e=>{e===mg.CloudConnector?A(!0):d?.(e)},[d]),M=a(()=>E===hg.BulkConfig?h:E===hg.BulkSource?m:0,[E,h,m]),{supportedConnections:z,supportedConnectionIds:B}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Fe.Success,n=D(e.odigosVersion,t,e.type);return o&&n}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);i(()=>{if(!E||E===hg.Delete)return;const e=N.filter(e=>!B.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[E,N.length,B.length]);const X=a(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:fg.Id,rawValue:e.id},{key:fg.Name,rawValue:e.name},{key:fg.Type,rawValue:e.type,component:()=>t(Jt,{variant:Cg[e.type]??ro.Default,label:_i(e.type)})},{key:fg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Di.Connector){const o=yg[e.status]??"Pending",n=e.status===Fe.Success?Ua:e.status===Fe.Error?Va:void 0;return t(qe,{status:e.status,label:o,leftIcon:n})}const o=e.status===Fe.Success?"Connection live":"Connection lost",n=e.status===Fe.Success?Ua:Va;return t(qe,{status:e.status,label:o,leftIcon:n})})(e)},{key:fg.OdigosVersion,rawValue:e.odigosVersion},{key:fg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:fg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Fe.Success||E?void 0:()=>l(e),isSelected:N.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Fe.Success||E===hg.BulkConfig&&!D(e.odigosVersion,h,e.type)||E===hg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,N,T,E,h,m,f,l]),U=a(()=>S.length>0&&S.every(e=>e.type===Di.K8s),[S]),V=a(()=>{const e=(e,t)=>{$([e]),I(t)};return(e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===fg.Status)?.rawValue===Fe.Success)(e))return[{id:cn(),label:"Delete Connection",rightIcon:Da,onClick:()=>vg(e,i)}];const d=vg(e,e=>t.find(t=>t.id===e));if(d?.type!==Di.K8s)return[];const p=!!d&&D(d.odigosVersion,o,d.type),u=!!d&&D(d.odigosVersion,n,d.type),h=_(o,d?.type),m=_(n,d?.type),g=[];return a&&g.push({id:cn(),tooltip:u?et.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:ja,disabled:!u,onClick:()=>vg(e,a)}),l&&g.push({id:cn(),tooltip:et.ADD_DESTINATION,rightIcon:za,onClick:()=>vg(e,l)}),r&&g.push({id:cn(),tooltip:et.ADD_ACTION,rightIcon:Ma,onClick:()=>vg(e,r)}),s&&g.push({id:cn(),tooltip:et.ADD_INSTRUMENTATION_RULE,rightIcon:Ha,onClick:()=>vg(e,s)}),c&&g.push({id:cn(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:el,disabled:!p,onClick:()=>vg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,hg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,hg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,hg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,hg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,hg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,hg.BulkConfig):void 0})},[S,h,m,b]),H=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];o&&r.push({id:cn(),type:co.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Add Sources",rightIcon:ja,onClick:o}});const s=[n?{id:hg.BulkDestination,label:et.ADD_DESTINATION,icon:za}:null,i?{id:hg.BulkAction,label:et.ADD_ACTION,icon:Ma}:null,a?{id:hg.BulkInstrumentationRule,label:et.ADD_INSTRUMENTATION_RULE,icon:Ha}:null,l?{id:hg.BulkConfig,label:"Manage Configurations",icon:el}:null];return s.some(Boolean)&&r.push({id:cn(),type:co.ButtonDropData,buttonProps:{variant:be.Secondary,size:fe.S,label:"Bulk Operations",onClick:e=>{e===hg.BulkSource?o?.():e===hg.BulkDestination?n?.():e===hg.BulkAction?i?.():e===hg.BulkInstrumentationRule?a?.():e===hg.BulkConfig&&l?.()}},dropDataProps:{alignX:sn.Left,items:s}}),r.push({id:cn(),type:co.Button,buttonProps:{variant:be.Text,size:fe.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>I(hg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>I(hg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>I(hg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>I(hg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>I(hg.BulkConfig):void 0}),[b]);return t(Pi,{children:e(dt,{fullHeight:!0,richTitle:{icon:kl,title:et.CONNECTIONS,badge:{label:S.length.toString(),status:Fe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,leftIcon:Qa,onClick:w,disabled:y}},{id:"connections-create-new",type:co.ButtonDropData,buttonProps:{variant:be.Primary,size:fe.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:sn.Right,items:gg}}],children:[t(Ao,{variant:Ro.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:bg,rows:X,rowActionsPushRightPosition:E?`calc(${vr} - 24px)`:void 0,getRowActions:V}),E===hg.BulkConfig&&b.canApplyEffectiveConfig&&t(ql,{connectionIds:N,children:t(Sp,{onClose:()=>I(null),connections:z,selectedConnectionIds:N,setSelectedConnectionIds:$})}),E===hg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(ql,{connectionIds:N,children:t(Jl,{selectedConnectionIds:N,children:t(Lc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(ql,{connectionIds:N,children:t(Zl,{children:t(Sc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkAction&&b.canCreateAction&&t(ql,{connectionIds:N,children:t(Ql,{children:t(pc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(ql,{connectionIds:N,children:t(er,{children:t(xc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),O&&t(tr,{providers:p,children:t(vp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(wr,{isOpen:R,onClose:()=>P(!1)}),t(Cr,{target:"connection",isOpen:E===hg.Delete,onClose:()=>{$([]),I(null)},onApprove:async()=>{const e=N[0];e&&(await c(e),await w())}}),t(Do,{isOpen:!!N.length&&!E,richTitle:{icon:Oa,title:"Selected Clusters",badge:{label:N.length}},actions:H})]})})},xg=b.div`
|
|
943
|
+
`,Xm=["50","25","10","1","0.1"],Um=({value:o,onChange:n,label:i})=>{const a=v(),l=c(()=>Xm.map(e=>({value:e,label:`${e}%`,selectedBgColor:a.v2.colors.purple[900],selectedBorderColor:a.v2.colors.purple[400]})),[a]);return e(ee,{$gap:8,children:[t(_e,{size:Te.XS,color:a.v2.colors.white[500],children:i}),t(Bm,{children:t(ce,{"data-id":"sampling-onboarding-ambient",options:l,selected:o,setSelected:n})})]})},Vm=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:a,onAmbientPercentageChange:l,onBack:r,onNext:s,submitting:d})=>{const u=v(),p=c(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t(rm,{title:ki,onBack:r}),e(nm,{$width:854,children:[t(vm,{children:Ii}),e(ee,{$gap:8,$width:"100%",children:[e(cm,{children:[t(zm,{children:t(_e,{size:Te.XXS,color:u.v2.colors.silver[200],children:Ei})}),t(pm,{items:[Ni,Oi,$i,Ai,Ri]}),t(mm,{message:vi})]}),e(gm,{children:[e(fm,{children:[t(_e,{size:Te.S,weight:500,color:u.v2.colors.white[500],children:Di}),t(rl,{size:16,fill:u.v2.colors.silver[200]})]}),t(bm,{children:t(Qh,{name:Ti,recommended:!0,toggleLabel:wi,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(bm,{children:t(Um,{value:a,onChange:l,label:_i})})]})]})]}),t(am,{onNext:s,nextLoading:d})]})},Hm=({isOpen:e,onClose:o,k8sHealthProbesConfig:n,samplingId:l,docsUrl:r})=>{const{samplingApi:s}=Ml(),[c,u]=a("welcome"),[p,h]=a(!0),[m,g]=a("keep-list"),[f,b]=a(!0),[v,y]=a("25"),[C,S]=a(!1);i(()=>{e&&(u("welcome"),h(n?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,n?.enabled]);const x=d(async()=>{const e=l??"default",t=[];if(p!==(n?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:n?.keepPercentage??0}))}if("advanced"!==m&&f){const o=s.createHighlyRelevant;o&&t.push(o({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const o=s.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)}},[l,s,p,n?.enabled,n?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(km,{onSkip:o,onNext:()=>u("noisy")});break;case"noisy":w=t(Cm,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":w=t(Pm,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(Vm,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Mm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(Lm,{onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"success":w=t(xm,{onClose:o})}return t(pn,{isOpen:e,onClose:o,children:w})};var jm,Gm;(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"})(jm||(jm={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"})(Gm||(Gm={}));const Wm=[{id:Gm.CloudConnector,label:"Cloud Connector"}];var Km;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(Km||(Km={}));const Ym=[{key:Km.Name,label:"Name"},{key:Km.Type,label:"Type"},{key:Km.Status,label:"Status"},{key:Km.OdigosVersion,label:"Odigos Version"},{key:Km.ConnectedSince,label:"Connected Since"},{key:Km.LastActivity,label:"Last Activity"}],Jm=(e,t)=>{const o=e.find(e=>e.key===Km.Id)?.rawValue;return t(o?.toString()||"")},qm={[Ne.Success]:"Connected",[Ne.Warning]:"Degraded",[Ne.Error]:"Error",[Ne.Disabled]:"Disabled",[Ne.Info]:"Pending"},Zm={[Pi.K8s]:so.Purple,[Pi.Vm]:so.Blue,[Pi.Connector]:so.Green},Qm=({connections:o,getConnections:n,onClickConnection:l,deleteConnection:r,onCreateNew:s,cloudConnectorProviders:u,onCreateCloudConnector:p,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=Qt(),{capabilities:b}=Ml(),[y,C]=a(!1),[S,x]=a(o||[]),w=d(async()=>{try{C(!0),x(await n()??[])}catch(e){}finally{C(!1)}},[]);i(()=>{S.length||w()},[]);const[T,k]=a(""),[I,E]=a(null),[N,O]=a([]),[$,A]=a(!1),[R,P]=a(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===Gm.CloudConnector?A(!0):s?.(e)},[s]),M=c(()=>I===jm.BulkConfig?h:I===jm.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=c(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Ne.Success,n=D(e.odigosVersion,t,e.type);return o&&n}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);i(()=>{if(!I||I===jm.Delete)return;const e=N.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,N.length,B.length]);const X=c(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:Km.Id,rawValue:e.id},{key:Km.Name,rawValue:e.name},{key:Km.Type,rawValue:e.type,component:()=>t(qt,{variant:Zm[e.type]??so.Default,label:Li(e.type)})},{key:Km.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Pi.Connector){const o=qm[e.status]??"Pending",n=e.status===Ne.Success?Ha:e.status===Ne.Error?ja:void 0;return t(Ge,{status:e.status,label:o,leftIcon:n})}const o=e.status===Ne.Success?"Connection live":"Connection lost",n=e.status===Ne.Success?Ha:ja;return t(Ge,{status:e.status,label:o,leftIcon:n})})(e)},{key:Km.OdigosVersion,rawValue:e.odigosVersion},{key:Km.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:Km.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Ne.Success||I?void 0:()=>l(e),isSelected:N.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Ne.Success||I===jm.BulkConfig&&!D(e.odigosVersion,h,e.type)||I===jm.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,N,T,I,h,m,f,l]),U=c(()=>S.length>0&&S.every(e=>e.type===Pi.K8s),[S]),V=c(()=>{const e=(e,t)=>{O([e]),E(t)};return(e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Km.Status)?.rawValue===Ne.Success)(e))return[{id:un(),label:"Delete Connection",rightIcon:Pa,onClick:()=>Jm(e,i)}];const d=Jm(e,e=>t.find(t=>t.id===e));if(d?.type!==Pi.K8s)return[];const u=!!d&&D(d.odigosVersion,o,d.type),p=!!d&&D(d.odigosVersion,n,d.type),h=_(o,d?.type),m=_(n,d?.type),g=[];return a&&g.push({id:un(),tooltip:p?Je.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:Wa,disabled:!p,onClick:()=>Jm(e,a)}),l&&g.push({id:un(),tooltip:Je.ADD_DESTINATION,rightIcon:Xa,onClick:()=>Jm(e,l)}),r&&g.push({id:un(),tooltip:Je.ADD_ACTION,rightIcon:Ba,onClick:()=>Jm(e,r)}),s&&g.push({id:un(),tooltip:Je.ADD_INSTRUMENTATION_RULE,rightIcon:Ga,onClick:()=>Jm(e,s)}),c&&g.push({id:un(),tooltip:u?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:ol,disabled:!u,onClick:()=>Jm(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,jm.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,jm.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,jm.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,jm.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,jm.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,jm.BulkConfig):void 0})},[S,h,m,b]),H=c(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];o&&r.push({id:un(),type:uo.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Add Sources",rightIcon:Wa,onClick:o}});const s=[n?{id:jm.BulkDestination,label:Je.ADD_DESTINATION,icon:Xa}:null,i?{id:jm.BulkAction,label:Je.ADD_ACTION,icon:Ba}:null,a?{id:jm.BulkInstrumentationRule,label:Je.ADD_INSTRUMENTATION_RULE,icon:Ga}:null,l?{id:jm.BulkConfig,label:"Manage Configurations",icon:ol}:null];return s.some(Boolean)&&r.push({id:un(),type:uo.ButtonDropData,buttonProps:{variant:ve.Secondary,size:be.S,label:"Bulk Operations",onClick:e=>{e===jm.BulkSource?o?.():e===jm.BulkDestination?n?.():e===jm.BulkAction?i?.():e===jm.BulkInstrumentationRule?a?.():e===jm.BulkConfig&&l?.()}},dropDataProps:{alignX:dn.Left,items:s}}),r.push({id:un(),type:uo.Button,buttonProps:{variant:ve.Text,size:be.S,label:_t.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>E(jm.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>E(jm.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>E(jm.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>E(jm.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>E(jm.BulkConfig):void 0}),[b]);return t(Fi,{children:e(lt,{fullHeight:!0,richTitle:{icon:El,title:Je.CONNECTIONS,badge:{label:S.length.toString(),status:Ne.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:uo.Button,buttonProps:{variant:ve.Secondary,size:be.S,leftIcon:tl,onClick:w,disabled:y}},{id:"connections-create-new",type:uo.ButtonDropData,buttonProps:{variant:ve.Primary,size:be.S,label:_t.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:dn.Right,items:Wm}}],children:[t(Do,{variant:_o.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:Ym,rows:X,rowActionsPushRightPosition:I?`calc(${Sr} - 24px)`:void 0,getRowActions:V}),I===jm.BulkConfig&&b.canApplyEffectiveConfig&&t(Zl,{connectionIds:N,children:t(Yd,{onClose:()=>E(null),connections:z,selectedConnectionIds:N,setSelectedConnectionIds:O})}),I===jm.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(Zl,{connectionIds:N,children:t(Ql,{selectedConnectionIds:N,children:t(rc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===jm.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(Zl,{connectionIds:N,children:t(er,{children:t(Gs,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===jm.BulkAction&&b.canCreateAction&&t(Zl,{connectionIds:N,children:t(tr,{children:t(Ls,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===jm.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(Zl,{connectionIds:N,children:t(or,{children:t(Ws,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),$&&t(nr,{providers:u,children:t(Vd,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:p,onCreated:L})}),t(Ir,{isOpen:R,onClose:()=>P(!1)}),t(wr,{target:"connection",isOpen:I===jm.Delete,onClose:()=>{O([]),E(null)},onApprove:async()=>{const e=N[0];e&&(await r(e),await w())}}),t(Po,{isOpen:!!N.length&&!I,richTitle:{icon:Ra,title:"Selected Clusters",badge:{label:N.length}},actions:H})]})})},eg=b.div`
|
|
1033
944
|
display: flex;
|
|
1034
945
|
align-items: center;
|
|
1035
946
|
justify-content: space-between;
|
|
@@ -1038,26 +949,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1038
949
|
width: 100%;
|
|
1039
950
|
border-radius: 16px;
|
|
1040
951
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1041
|
-
`,
|
|
952
|
+
`,tg=b.div`
|
|
1042
953
|
display: flex;
|
|
1043
954
|
align-items: center;
|
|
1044
955
|
justify-content: center;
|
|
1045
956
|
padding: 8px;
|
|
1046
957
|
border-radius: 8px;
|
|
1047
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
1048
|
-
`,
|
|
958
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+st["004"]};
|
|
959
|
+
`,og=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:a,disableAnimation:l})=>{const r=v(),s=()=>o(2),d=()=>o(3),u=c(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,i)=>{if(!o.selected)return null;const a=o.kind||wt.Namespace,l=a===wt.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(eg,{children:[t(_e,{nowrap:!0,children:l}),t(Ge,{label:a,status:Ne.Info,backgroundColor:r.v2.colors.blue[900]})]},`source-${n}-${i}`)})).filter(Boolean),[i]),p=c(()=>a?.map((o,n)=>{const i=yt(o.option.type).icon;return e(eg,{children:[e(ue,{$gap:8,children:[i&&t(tg,{children:t(i,{size:24})}),t(_e,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Ge,{status:o.testResult.succeeded?Ne.Success:Ne.Error,leftIcon:o.testResult.succeeded?Ha:ja})]},`destination-${n}`)})||[],[a]);return t(Cr,{isOpen:!0,disableAnimation:l,onBack:()=>o(3),onSave:n,header:{icon:il,title:Je.SUMMARY,subTitle:Je.REVIEW_SETUP},leftColumn:{width:"50%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(Wa,{size:24}),t(_e,{nowrap:!0,children:Je.SELECTED_SOURCES}),t(Ge,{label:u.length})]}),t(fe,{"data-id":"summary-edit-sources",leftIcon:La,variant:ve.Secondary,size:be.S,onClick:s})]}),list:u.length?u:[t(pt,{$height:"100%",children:t(xe,{icon:Wa,title:Je.NO_SOURCES_SELECTED,subTitle:Je.ADD_SOURCE_PROMPT,button:{leftIcon:$a,label:Je.ADD_SOURCE,onClick:s}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(Xa,{size:24}),t(_e,{nowrap:!0,children:Je.SELECTED_DESTINATIONS}),t(Ge,{label:p.length})]}),t(fe,{"data-id":"summary-edit-destinations",leftIcon:La,variant:ve.Secondary,size:be.S,onClick:d})]}),list:p.length?p:[t(pt,{"data-id":"summary-no-destinations",$height:"100%",children:t(xe,{icon:Xa,title:Je.NO_DESTINATIONS_SELECTED,subTitle:Je.ADD_DESTINATION_PROMPT,button:{leftIcon:$a,label:Je.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},ng=b.div`
|
|
1049
960
|
position: relative;
|
|
1050
961
|
overflow: hidden;
|
|
1051
962
|
width: 100vw;
|
|
1052
963
|
height: 100vh;
|
|
1053
964
|
box-sizing: border-box;
|
|
1054
|
-
`,
|
|
965
|
+
`,ig=b.svg`
|
|
1055
966
|
position: absolute;
|
|
1056
967
|
top: 50%;
|
|
1057
968
|
left: 50%;
|
|
1058
969
|
transform: translate(-50%, -50%);
|
|
1059
970
|
z-index: -1;
|
|
1060
|
-
`,
|
|
971
|
+
`,ag=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],lg=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:ag},{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:ag},{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:ag}],rg=({paddingXAxis:o="0px",paddingYAxis:n="0px",children:l})=>{const[r,s]=a(window.innerWidth),d=c(()=>r/lg[0].width,[r]);return i(()=>{const e=()=>s(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(ng,{$paddingXAxis:o,$paddingYAxis:n,children:[lg.map(({width:o,height:n,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(ig,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:i,d:a,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},sg=b.div`
|
|
1061
972
|
display: flex;
|
|
1062
973
|
flex-direction: column;
|
|
1063
974
|
align-items: center;
|
|
@@ -1068,7 +979,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1068
979
|
width: 50vw;
|
|
1069
980
|
border-radius: 16px;
|
|
1070
981
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1071
|
-
`,
|
|
982
|
+
`,cg=b.div`
|
|
1072
983
|
display: flex;
|
|
1073
984
|
flex-direction: column;
|
|
1074
985
|
align-items: center;
|
|
@@ -1078,15 +989,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1078
989
|
& * {
|
|
1079
990
|
text-align: center;
|
|
1080
991
|
}
|
|
1081
|
-
`,
|
|
992
|
+
`,dg=({onStart:o})=>t(Lt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(pt,{$height:"100%",children:e(sg,{children:[e(cg,{children:[t(_e,{size:Te.L,weight:500,children:Je.GET_STARTED_WITH}),t(kr,{size:260}),t(_e,{size:Te.S,weight:400,children:Je.GET_STARTED_DESCRIPTION})]}),t(fe,{"data-id":"onboarding-get-started",label:_t.GET_STARTED,rightIcon:Aa,size:be.L,onClick:o})]})})}),ug=[{step:1,label:Je.INSTALLATION,forceDoneBadge:!0},{step:2,label:Je.SOURCES_SETUP},{step:3,label:Je.DESTINATIONS_SETUP},{step:4,label:Je.SUMMARY}],pg=b.div`
|
|
1082
993
|
display: flex;
|
|
1083
994
|
flex-direction: column;
|
|
1084
995
|
gap: 32px;
|
|
1085
996
|
padding: 64px;
|
|
1086
|
-
`,
|
|
997
|
+
`,hg=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:i})=>{const{setDrawerType:l}=mo(),{sourcesApi:r,destinationsApi:s}=Ml(),[c,d]=a(1),[u,p]=a(!1),[h,m]=a(null),[g,f]=a(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(rg,{paddingXAxis:o,paddingYAxis:n,children:[e(pg,{children:[t(kr,{useInline:!0}),t(Mi,{currentStep:c,data:ug,gap:32})]}),t(Ql,{initialInputs:h,children:e(er,{children:[1===c&&t(dg,{onStart:b}),2===c&&t(rc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(Gs,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(og,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(r.persistV2(h)),g&&e.push(...g.map(e=>s.create(e.formData)));const t=await Promise.allSettled(e),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")};l(hn.OnboardingDone),i()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},mg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),gg=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),fg=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},bg=b.div`
|
|
1087
998
|
position: relative;
|
|
1088
999
|
display: inline-flex;
|
|
1089
|
-
`,
|
|
1000
|
+
`,vg=b.button`
|
|
1090
1001
|
display: inline-flex;
|
|
1091
1002
|
align-items: center;
|
|
1092
1003
|
gap: 8px;
|
|
@@ -1099,7 +1010,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1099
1010
|
&:hover {
|
|
1100
1011
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1101
1012
|
}
|
|
1102
|
-
`,
|
|
1013
|
+
`,yg=b.div`
|
|
1103
1014
|
position: absolute;
|
|
1104
1015
|
top: calc(100% + 8px);
|
|
1105
1016
|
right: 0;
|
|
@@ -1112,25 +1023,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1112
1023
|
border-radius: 12px;
|
|
1113
1024
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1114
1025
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1115
|
-
`,
|
|
1026
|
+
`,Cg=b.div`
|
|
1116
1027
|
display: flex;
|
|
1117
1028
|
flex-direction: column;
|
|
1118
1029
|
gap: 12px;
|
|
1119
1030
|
padding: 16px;
|
|
1120
1031
|
max-height: 60vh;
|
|
1121
1032
|
overflow-y: auto;
|
|
1122
|
-
`,
|
|
1033
|
+
`,Sg=b.div`
|
|
1123
1034
|
display: flex;
|
|
1124
1035
|
align-items: center;
|
|
1125
1036
|
gap: 8px;
|
|
1126
1037
|
padding: 12px 16px;
|
|
1127
1038
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1128
|
-
`,
|
|
1039
|
+
`,xg=b.div`
|
|
1129
1040
|
display: flex;
|
|
1130
1041
|
align-items: center;
|
|
1131
1042
|
gap: 8px;
|
|
1132
1043
|
margin-left: auto;
|
|
1133
|
-
`,
|
|
1044
|
+
`,wg=()=>{const o=v(),{sourcesApi:n,namespacesApi:l,capabilities:r}=Ml(),{isK8s:s,isVm:d,isConnector:p}=r,h=s?"k8s":d?"vm":"connector",m=n.useSources().items,g=l.useNamespaces().items,{selectedStreamName:f}=qe(),{getItemSS:b,setItemSS:y,removeItemSS:C}=Hi(),{statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:E,podsAgentInjectionStatus:N,setAll:O,clearFilters:$,getEmptyState:A}=zi(),R=c(()=>Bi(m,f),[m,f]);i(()=>{const e=b(Xi.OVERVIEW_FILTERS,A());O(e)},[]);const[D,_]=a({statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:E,podsAgentInjectionStatus:N}),[P,L]=a(fg(D)),[F,M]=a(!1),z=u(h);i(()=>{if(!F){const e={statuses:S,namespaces:x,regions:w,kinds:T,monitors:k,languages:I,onlyErrors:E,podsAgentInjectionStatus:N};_(e),L(fg(e))}},[F,S,x,w,T,k,I,E,N]),i(()=>{z.current!==h&&(z.current=h,C(Xi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1))},[h]);const B=u(null);Io(B,()=>M(!1)),ln({key:"Escape",active:F},()=>M(!1));const X=c(()=>{const e=new Set,t=[];return g.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[g]),U=c(()=>{const e=new Set,t=[];return R.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:So(n),withCheckbox:!0}))}),t},[R]),V=c(()=>{const e=new Set,t=[];return R.forEach(({id:o})=>{const n=o.region?.trim();n&&!e.has(n)&&(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),H=c(()=>{const e=new Set,t=[];return R.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Ui[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),j=c(()=>Vi.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=c(()=>{const e=new Set,t=[];return R.forEach(({instrumentationReport:o})=>{const n=o?.state||o?.progressStage;n&&!e.has(n)&&(e.add(n),t.push({id:n,label:gg(n),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),W=c(()=>{const e=new Set,t=[];return R.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:i}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Kt(n),withCheckbox:!0})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[R]),K=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));_(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},Y=F?Ua:Va,J=c(()=>mg(D.languages),[D.languages]);return e(bg,{ref:B,children:[e(vg,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>M(e=>!e),children:[t(Nl,{size:16,fill:o.v2.colors.white[500]}),t(_e,{size:Te.XS,weight:500,nowrap:!0,children:"Filters"}),P>0&&t(Ge,{label:P,status:Ne.Unknown,textSize:Te.XXXS}),t(Y,{size:16,fill:o.v2.colors.silver[200]})]}),F&&e(yg,{children:[e(Cg,{children:[s&&t(mt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!X.length,options:X,values:mg(D.namespaces),setValues:e=>K("namespaces",X,e)}),p&&t(mt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:mg(D.regions),setValues:e=>K("regions",V,e)}),t(mt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:mg(D.kinds),setValues:e=>K("kinds",U,e)}),t(mt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:J,setValues:e=>K("languages",H,e)}),t(mt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:mg(D.monitors),setValues:e=>K("monitors",j,e)}),t(mt,s?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:mg(D.podsAgentInjectionStatus),setValues:e=>K("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:mg(D.statuses),setValues:e=>K("statuses",G,e)}),t(le,{label:"Show only sources with errors",size:kt.L,value:!!D.onlyErrors,onChange:e=>_(t=>({...t,onlyErrors:e}))})]}),e(Sg,{children:[t(fe,{"data-id":"filters-reset",size:be.S,variant:ve.Text,label:"Reset",onClick:()=>{C(Xi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1)},textColor:o.v2.colors.red[500]}),e(xg,{children:[t(fe,{"data-id":"filters-cancel",size:be.S,variant:ve.Secondary,label:"Cancel",onClick:()=>M(!1)}),t(fe,{"data-id":"filters-apply",size:be.S,variant:ve.Primary,label:"Apply",onClick:()=>{y(Xi.OVERVIEW_FILTERS,D),O(D),L(fg(D)),M(!1)}})]})]})]})]})},Tg=b.div`
|
|
1134
1045
|
position: relative;
|
|
1135
1046
|
display: flex;
|
|
1136
1047
|
align-items: center;
|
|
@@ -1141,7 +1052,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1141
1052
|
box-sizing: border-box;
|
|
1142
1053
|
border-radius: 16px 16px 0 0;
|
|
1143
1054
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1144
|
-
`,
|
|
1055
|
+
`,kg=b.div`
|
|
1145
1056
|
position: absolute;
|
|
1146
1057
|
bottom: 0;
|
|
1147
1058
|
left: 0;
|
|
@@ -1150,7 +1061,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1150
1061
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
1151
1062
|
border-radius: 32px;
|
|
1152
1063
|
transition: width 0.3s;
|
|
1153
|
-
`,
|
|
1064
|
+
`,Ig=({entityType:o,badge:n,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:u}=mo();return e(Tg,{children:[e(ue,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(oe,{size:ji.S,partiallyChecked:r,value:!!s,onChange:c}),t(_e,{size:Te.S,nowrap:!0,children:`${Kt(o)}s`}),t(Ge,{label:n,tooltip:i,status:Ne.Unknown,textSize:Te.XXXS})]}),e(ue,{children:[t(gt,{"data-id":`add-${o}`,icon:$a,onClick:()=>u(Gi(o))}),t(gt,{"data-id":`refresh-${o}`,icon:tl,onClick:l,disabled:a})]}),"number"==typeof d&&t(kg,{$percent:d})]})},Eg=b(ee)`
|
|
1154
1065
|
align-items: center !important;
|
|
1155
1066
|
justify-content: center !important;
|
|
1156
1067
|
align-self: stretch;
|
|
@@ -1165,7 +1076,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1165
1076
|
&:hover {
|
|
1166
1077
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1167
1078
|
}
|
|
1168
|
-
`,
|
|
1079
|
+
`,Ng=({entityType:o,description:n})=>{const{setDrawerType:i}=mo();return e(Eg,{onClick:()=>i(Gi(o)),children:[e(ue,{$gap:4,children:[t($a,{size:16}),t(_e,{size:Te.S,children:`Add ${Kt(o)}`})]}),t(_e,{size:Te.XXS,align:"center",children:n})]})},Og=b.div`
|
|
1169
1080
|
display: flex;
|
|
1170
1081
|
align-items: center;
|
|
1171
1082
|
gap: 12px;
|
|
@@ -1180,10 +1091,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1180
1091
|
&:hover {
|
|
1181
1092
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1182
1093
|
}
|
|
1183
|
-
|
|
1094
|
+
`,$g=b(ue)`
|
|
1184
1095
|
flex: 1;
|
|
1185
1096
|
min-width: 0;
|
|
1186
|
-
`,
|
|
1097
|
+
`,Ag=({entityId:o,entityType:n,title:i,status:a,faded:l,tooltip:r,throughput:s,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=v(),f=n===wt.Source,b="boolean"==typeof h,y=l||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=mo(),{selectedSources:x,setSelectedSources:w}=Wi(),T=m,k=f?T.id.namespace:"",I=c(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),E=b&&!h?ko(Ne.Info,g):a?ko(a,g):void 0,N=f&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}${o.region?`-${o.region}`:""}`:o;return e(Og,{"data-id":N,$faded:y,onClick:()=>{C(yo(n)),S(o)},children:[f&&t(oe,{size:ji.S,value:-1!==I,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===I?e[k].push(T):e[k].splice(I,1),w(e)}}),t(vo,{icons:u,icon:d,iconSrc:p}),e($g,{$gap:4,children:[t(we,{size:Te.XS,nowrap:!0,children:i}),t(ue,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:s&&t(Fe,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ge,{label:s,status:a&&[Ne.Error,Ne.Warning].includes(a)?a:Ne.Unknown,leftIcon:E,textSize:Te.XXXS})})})]})]})};function Rg(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Ne.Loading)?e:{...e,workloadOdigosHealthStatus:{status:oo.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Dg(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Ne.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const _g=b.div`
|
|
1187
1098
|
position: absolute;
|
|
1188
1099
|
top: 0;
|
|
1189
1100
|
left: 0;
|
|
@@ -1194,21 +1105,21 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1194
1105
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1195
1106
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1196
1107
|
pointer-events: none;
|
|
1197
|
-
`,
|
|
1108
|
+
`,Pg=b.div`
|
|
1198
1109
|
display: flex;
|
|
1199
1110
|
align-items: center;
|
|
1200
1111
|
gap: 8px;
|
|
1201
1112
|
padding: 4px 8px 0;
|
|
1202
|
-
`,
|
|
1113
|
+
`,Lg=b.div`
|
|
1203
1114
|
flex: 1;
|
|
1204
1115
|
height: 1px;
|
|
1205
1116
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1206
|
-
`,
|
|
1117
|
+
`,Fg=({namespace:e})=>{const o=v();return t(_g,{children:t(_e,{size:Te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},Mg=({namespace:o})=>{const n=v();return e(Pg,{children:[t(Lg,{}),t(_e,{size:Te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Lg,{})]})},zg={[wt.InstrumentationRule]:Je.NO_DATA_INSTRUMENTATION_RULES,[wt.Source]:Je.NO_DATA_SOURCES,[wt.Action]:Je.NO_DATA_ACTIONS,[wt.Destination]:Je.NO_DATA_DESTINATIONS},Bg=b.div`
|
|
1207
1118
|
display: flex;
|
|
1208
1119
|
flex-direction: column;
|
|
1209
1120
|
flex: 1 0 0;
|
|
1210
1121
|
min-width: 0;
|
|
1211
|
-
`,
|
|
1122
|
+
`,Xg=b.div`
|
|
1212
1123
|
display: flex;
|
|
1213
1124
|
flex-direction: column;
|
|
1214
1125
|
align-items: stretch;
|
|
@@ -1218,7 +1129,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1218
1129
|
border-radius: 0 0 16px 16px;
|
|
1219
1130
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1220
1131
|
overflow: hidden;
|
|
1221
|
-
`,
|
|
1132
|
+
`,Ug=b.div`
|
|
1222
1133
|
position: relative;
|
|
1223
1134
|
display: flex;
|
|
1224
1135
|
flex-direction: column;
|
|
@@ -1230,7 +1141,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1230
1141
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1231
1142
|
height: ${({$height:e})=>e}px;
|
|
1232
1143
|
overflow: hidden;
|
|
1233
|
-
`,
|
|
1144
|
+
`,Vg=({entityType:o,entities:n,unfilteredCount:l,metrics:r,loading:s,maxHeight:u,refetch:p})=>{const h=o===wt.Source,m=n.length!==l,g=Et(e=>h?e.progress[$t.Instrumenting]?.percentage:void 0),f=Et(e=>h?e.progress[$t.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Wi(),C=c(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=c(()=>{if(!r)return;const e=new Map,t=o===wt.Source?r.sources:o===wt.Destination?r.destinations:void 0;if(t)for(const o of t)e.set(Ki(o),o.throughput);return e},[r,o]),x=c(()=>n.map(e=>((e,t,o)=>{const n=zt(e);if(!n)return null;const i=t===wt.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status;switch(t){case oo.Failure:return{status:Ne.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case oo.Notice:return{status:Ne.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case oo.Pending:case oo.Waiting:return{status:void 0,faded:!1,displaySource:Rg(e)};case oo.Unsupported:case oo.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Dg(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=Yi(e.conditions);a=t,r=o}const c=Ji(e,t,{extended:i,prioritizeDisplayName:!i});let d,u,p,h,m;switch(t){case wt.Source:{d=bo(e),u=Zi(wt.Source);const t=o?.get(qi(n));h=xo(t);break}case wt.Destination:{const t=yt(e.destinationType.type);u=t.icon,p=t.iconSrc;const i=o?.get(qi(n));h=xo(i),m=!e.disabled;break}case wt.Action:u=Vt(e.type),m=!e.disabled;break;case wt.InstrumentationRule:u=Zt(e.type),m=!e.disabled}return{key:qi(n),entityId:n,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:n,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:m,raw:s}}})(e,o,S)).filter(Boolean),[n,o,S]),[w,T]=a(""),{elements:k,indexToNamespace:I,multipleNs:E,dividerCount:N}=c(()=>{const e=[],o=[],n=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const n of x)h&&n.namespace&&n.namespace!==a&&(""!==a&&(o.push(n.namespace),e.push(t(Mg,{namespace:n.namespace},`ns-divider-${n.namespace}`)),i+=1),a=n.namespace),o.push(n.namespace||""),e.push(t(Ag,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:i}},[x,h]);i(()=>{if(h&&I.length&&!w){const e=I.find(Boolean);e&&T(e)}},[h,I]);const O=d(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==w&&T(t)},[I,w]),$=58*x.length+(E?28:0)+32*N,A=Math.max(0,u-52-16),R=Math.min(A,$)+8,D="number"==typeof b?`${b}%`:m?`${n.length}/${l}`:l;return e(Bg,{children:[t(Ig,{entityType:o,badge:D,badgeTooltip:m?Je.FILTERED_COUNT_TOOLTIP:void 0,isLoading:s,refetch:p,partiallySelected:C>0&&n?.length!==C,allSelected:C>0&&n?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(Xg,{children:n.length?e(Ug,{$height:R,children:[E&&w&&t(Fg,{namespace:w}),t(ho,{gap:4,elements:k,onTopIndexChange:E?O:void 0})]}):s?t(ut,{size:3}):t(Ng,{entityType:o,description:zg[o]??Je.TO_COLLECT_OTEL_DATA})})]})},Hg=b.div`
|
|
1234
1145
|
width: 100%;
|
|
1235
1146
|
flex: 1;
|
|
1236
1147
|
min-height: 0;
|
|
@@ -1238,10 +1149,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1238
1149
|
display: flex;
|
|
1239
1150
|
align-items: stretch;
|
|
1240
1151
|
gap: 16px;
|
|
1241
|
-
`,
|
|
1152
|
+
`,jg={sources:[],destinations:[]},Gg=()=>{const o=zi(),{selectedStreamName:n}=qe(),{containerRef:i,containerHeight:a}=Qi(),{sourcesApi:l,destinationsApi:r,actionsApi:s,instrumentationRulesApi:d,metricsApi:u}=Ml(),{items:p,loading:h}=l.useSources(),{items:m,loading:g}=r.useDestinations(),{items:f,loading:b}=s.useActions(),{items:v,loading:y}=d.useRules(),C=mo(e=>e.drawerType),{data:S}=u.useMetrics({skip:!p.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??jg,w=c(()=>Bi(p,n),[p,n]),T=c(()=>Gt(m,n),[m,n]),k=c(()=>ea(w,o),[w,o]),I=c(()=>ta(T,o),[T,o]),E=c(()=>oa(f,o),[f,o]);return e(Hg,{ref:i,children:[t(Vg,{entityType:wt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:a,refetch:d.fetchAll}),t(Vg,{entityType:wt.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:a,refetch:l.fetchAll}),t(Vg,{entityType:wt.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:a,refetch:s.fetchAll}),t(Vg,{entityType:wt.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:a,refetch:r.fetchAll})]})},Wg="40vw",Kg=b.div`
|
|
1242
1153
|
position: relative;
|
|
1243
|
-
width: ${
|
|
1244
|
-
`,
|
|
1154
|
+
width: ${Wg};
|
|
1155
|
+
`,Yg=b.div`
|
|
1245
1156
|
position: absolute;
|
|
1246
1157
|
top: calc(100% + 8px);
|
|
1247
1158
|
left: 0;
|
|
@@ -1250,23 +1161,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1250
1161
|
flex-direction: column;
|
|
1251
1162
|
gap: 8px;
|
|
1252
1163
|
padding: 8px;
|
|
1253
|
-
width: calc(${
|
|
1164
|
+
width: calc(${Wg} - 16px);
|
|
1254
1165
|
border-radius: 12px;
|
|
1255
1166
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1256
1167
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
1257
|
-
`,
|
|
1168
|
+
`,Jg=b.div`
|
|
1258
1169
|
display: flex;
|
|
1259
1170
|
align-items: center;
|
|
1260
1171
|
overflow-x: auto;
|
|
1261
|
-
`,
|
|
1172
|
+
`,qg=b.div`
|
|
1262
1173
|
display: flex;
|
|
1263
1174
|
flex-direction: column;
|
|
1264
1175
|
gap: 0;
|
|
1265
1176
|
max-height: 60vh;
|
|
1266
1177
|
overflow-y: auto;
|
|
1267
|
-
`,
|
|
1178
|
+
`,Zg=b.div`
|
|
1268
1179
|
padding: 8px 12px 4px 12px;
|
|
1269
|
-
`,
|
|
1180
|
+
`,Qg=b.div`
|
|
1270
1181
|
display: flex;
|
|
1271
1182
|
align-items: center;
|
|
1272
1183
|
gap: 8px;
|
|
@@ -1276,12 +1187,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1276
1187
|
&:hover {
|
|
1277
1188
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1278
1189
|
}
|
|
1279
|
-
`,
|
|
1190
|
+
`,ef=b.div`
|
|
1280
1191
|
padding: 16px 8px;
|
|
1281
|
-
`,
|
|
1192
|
+
`,tf=({preventPopup:o=!1})=>{const n=v(),{selectedStreamName:i}=qe(),{searchText:r,setSearchText:s}=zi(),{setDrawerType:d,setDrawerEntityId:p}=mo(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Ml(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=u(null),[w,T]=a(!1),[k,I]=a("all"),E=!o&&(!!r||w),N=()=>{s(""),T(!1),I("all")};Io(x,()=>N()),ln({key:"Escape",active:E},N);const{categories:O,searchResults:$}=c(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?o.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,c=i?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,d=[{category:wt.Source,label:"Sources",count:r.length,entities:[]},{category:wt.Action,label:"Actions",count:s.length,entities:[]},{category:wt.Destination,label:"Destinations",count:c.length,entities:[]},{category:wt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===wt.InstrumentationRule?l:e.category===wt.Source?r:e.category===wt.Action?s:e.category===wt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:S,sources:Bi(b,i),actions:C,destinations:Gt(y,i),searchText:r,selectedCategory:k}),[S,b,C,y,i,r,k]),A=c(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[O]),R=$.some(({entities:e})=>e.length>0);return e(Kg,{ref:x,children:[t(po,{value:r,onChange:e=>s(e.toLowerCase()),onFocus:()=>T(!0),width:Wg}),E&&e(Yg,{children:[A.length>1&&t(Jg,{children:t(ce,{options:A,selected:k,setSelected:I})}),R?t(qg,{children:$.map(({category:o,label:i,entities:a},r)=>{if(!a.length)return null;const s=Zi(o);return e(l,{children:[t(Zg,{children:t(_e,{size:Te.XXS,color:Pe.Secondary,children:i})}),a.map((i,a)=>e(Qg,{onClick:()=>{const e=zt(i);e&&(d(yo(o)),p(e),N())},children:[s&&t(s,{size:16,fill:n.v2.colors.white[500]}),t(_e,{size:Te.XS,nowrap:!0,children:Ji(i,o,{extended:!0})})]},`entity-${r}-${a}`))]},`category-list-${o}`)})}):t(ef,{children:t(xe,{hideIcon:!0,title:"No results",subTitle:r?`No matches for "${r}"`:"Start typing to search"})})]})]})},of=({onRedirectToSampling:n})=>{const{sourcesApi:i}=Ml(),{items:a}=i.useSources(),{drawerType:l,drawerEntityId:r,setDrawerType:s,setDrawerEntityId:d}=mo(),u=()=>{s(null),d(null)},p=c(()=>a.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[a]),h=c(()=>Array.from(new Set(a.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[a]);return e(o,{children:[t(Jh,{}),l===hn.AddSource&&t(Ql,{children:t(rc,{onClose:u,withOverlay:!0})}),l===hn.AddDestination&&t(er,{children:t(Gs,{onClose:u,withOverlay:!0})}),l===hn.AddInstrumentationRule&&t(or,{sourceOptions:p,namespaceOptions:h,children:t(Ws,{onClose:u,withOverlay:!0})}),l===hn.AddAction&&t(tr,{sourceOptions:p,namespaceOptions:h,children:t(Ls,{onClose:u,withOverlay:!0})}),l===hn.EditSource&&t(ir,{children:t(Th,{onClose:u,sourceId:r,onRedirectToSampling:n})}),l===hn.EditDestination&&t(er,{children:t(qd,{onClose:u,destinationId:r})}),l===hn.EditInstrumentationRule&&t(or,{sourceOptions:p,namespaceOptions:h,children:t(Qd,{onClose:u,ruleId:r})}),l===hn.EditAction&&t(tr,{sourceOptions:p,namespaceOptions:h,children:t(Kd,{onClose:u,actionId:r})})]})},nf=b.div`
|
|
1282
1193
|
position: relative;
|
|
1283
1194
|
display: inline-flex;
|
|
1284
|
-
`,
|
|
1195
|
+
`,af=b.div`
|
|
1285
1196
|
display: inline-flex;
|
|
1286
1197
|
align-items: center;
|
|
1287
1198
|
gap: 6px;
|
|
@@ -1292,7 +1203,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1292
1203
|
&:hover {
|
|
1293
1204
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1294
1205
|
}
|
|
1295
|
-
`,
|
|
1206
|
+
`,lf=b.div`
|
|
1296
1207
|
position: absolute;
|
|
1297
1208
|
top: calc(100% + 8px);
|
|
1298
1209
|
left: 0;
|
|
@@ -1306,18 +1217,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1306
1217
|
border-radius: 12px;
|
|
1307
1218
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1308
1219
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1309
|
-
`,
|
|
1220
|
+
`,rf=b.div`
|
|
1310
1221
|
display: flex;
|
|
1311
1222
|
align-items: center;
|
|
1312
1223
|
gap: 8px;
|
|
1313
1224
|
width: 100%;
|
|
1314
|
-
|
|
1225
|
+
`,sf=b.div`
|
|
1315
1226
|
display: flex;
|
|
1316
1227
|
flex-direction: column;
|
|
1317
1228
|
gap: 0;
|
|
1318
1229
|
max-height: 240px;
|
|
1319
1230
|
overflow-y: auto;
|
|
1320
|
-
`,
|
|
1231
|
+
`,cf=b.div`
|
|
1321
1232
|
display: flex;
|
|
1322
1233
|
align-items: center;
|
|
1323
1234
|
gap: 8px;
|
|
@@ -1328,29 +1239,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1328
1239
|
&:hover {
|
|
1329
1240
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
1330
1241
|
}
|
|
1331
|
-
`,
|
|
1242
|
+
`,df=b.div`
|
|
1332
1243
|
flex: 1;
|
|
1333
1244
|
min-width: 0;
|
|
1334
1245
|
overflow: hidden;
|
|
1335
1246
|
text-overflow: ellipsis;
|
|
1336
1247
|
white-space: nowrap;
|
|
1337
|
-
`,
|
|
1248
|
+
`,uf=b.div`
|
|
1338
1249
|
display: flex;
|
|
1339
1250
|
align-items: center;
|
|
1340
1251
|
gap: 2px;
|
|
1341
1252
|
flex-shrink: 0;
|
|
1342
|
-
`,
|
|
1253
|
+
`,pf=b.div`
|
|
1343
1254
|
display: flex;
|
|
1344
1255
|
padding-top: 4px;
|
|
1345
1256
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1346
|
-
`,
|
|
1257
|
+
`,hf=()=>{const n=v(),{isVm:l}=S(),{clearStore:r}=na(),{dataStreamsApi:s}=Ml();s.useDataStreams();const{dataStreams:d,selectedStreamName:p,setSelectedStreamName:h}=qe(),m=u(null),[g,f]=a(!1),[b,y]=a(""),[C,x]=a(""),[w,T]=a(!1),[k,I]=a(!1),[E,N]=a(!1),[O,$]=a(""),[A,R]=a(!1);Io(m,()=>f(!1)),i(()=>{g||y("")},[g]);const D=c(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),_=g?Ua:Va;return l?null:e(o,{children:[e(nf,{ref:m,children:[e(af,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Ol,{size:24}),t(_e,{size:Te.S,weight:500,nowrap:!0,children:(P=p,`Data Stream: ${P}`)}),t(Ge,{label:d.length,status:Ne.Unknown,textSize:Te.XXXS}),t(_,{size:20,fill:n.v2.colors.silver[200]})]}),g&&e(lf,{children:[t(rf,{children:t(po,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(sf,{children:0===D.length?t(cf,{children:t(_e,{size:Te.XS,color:Pe.Secondary,children:"No streams match"})}):D.map(({name:o})=>{const n=o===ia;return e(cf,{"data-id":`stream-row-${o}`,$selected:o===p,onClick:()=>(e=>{e!==p&&(r(),h(e)),f(!1)})(o),children:[t(df,{children:t(_e,{size:Te.XS,nowrap:!0,children:o})}),e(uf,{children:[t(gt,{"data-id":`stream-edit-${o}`,icon:La,size:ft.XS,onClick:e=>{e.stopPropagation(),f(!1),x(o),T(!0)}}),!n&&t(gt,{"data-id":`stream-delete-${o}`,icon:Oa,size:ft.XS,onClick:e=>{e.stopPropagation(),f(!1),$(o),R(!0)}})]})]},`stream-${o}`)})}),t(pf,{children:t(fe,{"data-id":"add-stream-trigger",variant:ve.Secondary,size:be.S,leftIcon:$a,label:`${_t.NEW} ${Je.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),r(),N(!0),I(!0)}})})]})]}),E&&t(ar,{defaultExcludeName:p,children:t(Gh,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>N(!1)})}),C&&t(ar,{children:t(Wh,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(wr,{target:`${Je.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{O&&await s.remove(O)}})]});var P},mf=()=>{const{selectedStreamName:n}=qe(),{selectedSources:l,setSelectedSources:r}=Wi(),{sourcesApi:s}=Ml(),[u,p]=a(!1),[h,m]=a(!1),g=c(()=>Object.values(l).reduce((e,t)=>e+t.length,0),[l]),f=d(()=>{r({})},[r]),b=d(()=>p(!1),[]),v=d(()=>m(!1),[]);i(()=>{f()},[n,f]);const y=d(()=>{s.restartWorkloads(Object.values(l).flat().filter(e=>e.id.kind!==Co.StaticPod).map(go)),f()},[s,l,f]),C=d(()=>{s.persistV2(Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,region:e.region,selected:!1,currentStreamName:n}))]))),f()},[s,l,n,f]),S=c(()=>[{id:"multi-source-deselect",type:uo.Button,buttonProps:{variant:ve.Text,size:be.S,label:"Deselect",onClick:f}},{id:"multi-source-restart",type:uo.Button,buttonProps:{variant:ve.Secondary,size:be.S,label:"Restart",leftIcon:pl,onClick:()=>p(!0)}},{id:"multi-source-uninstrument",type:uo.Button,buttonProps:{variant:ve.Primary,size:be.S,label:"Uninstrument",leftIcon:Oa,onClick:()=>m(!0)}}],[f]);return e(o,{children:[t(Po,{isOpen:g>0,richTitle:{icon:Wa,title:"Selected sources",badge:{label:g}},actions:S}),t(Ye,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:b,denyButton:{label:"Go Back",variant:ve.Secondary,onClick:b},approveButton:{label:"Confirm",variant:ve.Primary,onClick:()=>{y(),b()}}}),t(wr,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},gf=C`
|
|
1347
1258
|
0% {
|
|
1348
1259
|
background-position: 200% 50%;
|
|
1349
1260
|
}
|
|
1350
1261
|
100% {
|
|
1351
1262
|
background-position: 0% 50%;
|
|
1352
1263
|
}
|
|
1353
|
-
`,
|
|
1264
|
+
`,ff=b.div`
|
|
1354
1265
|
display: flex;
|
|
1355
1266
|
align-items: center;
|
|
1356
1267
|
justify-content: space-evenly;
|
|
@@ -1361,43 +1272,43 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1361
1272
|
|
|
1362
1273
|
background: ${({theme:e})=>`linear-gradient(90deg, ${e.v2.colors.pink[500]} 0%, ${e.v2.colors.purple[400]} 25%, ${e.v2.colors.green[500]} 50%, ${e.v2.colors.purple[400]} 75%, ${e.v2.colors.pink[500]} 100%)`};
|
|
1363
1274
|
background-size: 200% 100%;
|
|
1364
|
-
animation: ${
|
|
1365
|
-
`,
|
|
1275
|
+
animation: ${gf} 15s linear infinite;
|
|
1276
|
+
`,bf=[Ga,Wa,Ba,Xa],vf=({onRedirectToSampling:o})=>{const n=v();return e(Fi,{children:[e(lt,{fullHeight:!0,customTitle:t(hf,{}),customSearch:t(tf,{}),filters:t(wg,{}),children:[t(ff,{children:bf.map((o,i)=>e(l,{children:[t(o,{size:24}),i<bf.length-1&&t(za,{fill:n.v2.colors.white[500]+st["020"],size:24})]},o.name))}),t(Gg,{})]}),t(of,{onRedirectToSampling:o}),t(mf,{})]})};var yf;(e=>{e.Gateway="gateway",e.Node="node"})(yf||(yf={}));const Cf=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:a})=>{const l=c(()=>{const e=[];return o&&e.push({id:un(),type:uo.Button,buttonProps:{label:"Download Diagnose",leftIcon:yl,size:be.S,variant:ve.Text,onClick:o,disabled:a}}),n&&e.push({id:un(),type:uo.Button,buttonProps:{label:"Refresh",leftIcon:tl,size:be.S,variant:ve.Text,onClick:n,disabled:a,loading:i}}),e},[o,n,a,i]);return e(ue,{$alignItems:"center",$justifyContent:"space-between",children:[t(aa,{icon:$l,title:"Collectors Pipeline"}),t(la,{actions:l})]})},Sf=({pod:o,onClose:n})=>{const{formatTimeAgo:i}=Qt(),{collectorsApi:a}=Ml(),{data:l}=a.usePodInfo(o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),r=c(()=>[{id:un(),title:"Node",label:l?.node??"-",withCopy:!0},{id:un(),title:"Status",badge:{status:ra(l?.status),label:l?.status??"-"}}],[l]),s=c(()=>l?.containers?.map(e=>({id:un(),items:[{id:un(),title:"Container",label:e.name??"-"},{id:un(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:un(),title:"Ready",badge:{status:e.ready?Ne.Success:Ne.Error,leftIcon:e.ready?Ra:Da,label:e.ready?"True":"False",invertColors:!0}},{id:un(),title:"Started",badge:{status:e.started?Ne.Success:Ne.Error,leftIcon:e.started?Ra:Da,label:e.started?"True":"False",invertColors:!0}},{id:un(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:un(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:un(),title:Je.RESTARTS,label:e.restarts.toString()},{id:un(),title:"State Reason",label:e.stateReason??"-"},{id:un(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:un(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[l]);return t(Lt,{isOpen:!!o,header:{icon:nl,title:"Pod Information",onClose:n},children:l?e(Xt,{bgTint:"1000",richTitle:{icon:nl,title:l.name,withCopy:!0},children:[t(Xt,{bgTint:"900",cellsPerRow:2,items:r}),e(Xt,{bgTint:"900",richTitle:{icon:ul,title:Je.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(co,{value:`kubectl get pod ${l.name} -n ${l.namespace} -o yaml`}),t(co,{value:`kubectl describe pod ${l.name} -n ${l.namespace}`}),t(co,{value:`kubectl logs ${l.name} -n ${l.namespace}`})]}),t(Xt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:s.length?s.map(({id:e,items:o})=>t(Xt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(xe,{title:"No containers",subTitle:"Pod has no containers"})}),t(Tr,{bgTint:"900",yaml:l.manifestYAML,defaultOpen:!0})]}):t(pt,{$height:"50vh",children:t(bt,{withSpinner:!0})})})};var xf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(xf||(xf={}));const wf=e=>{const t=[{key:xf.PodName,label:"Pod Name"},{key:xf.Status,label:"Status"},{key:xf.Restarts,label:Je.RESTARTS},{key:xf.NodeName,label:"Node Name"},{key:xf.Age,label:"Age"},{key:xf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:xf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Tf=({isLoading:o,pods:n,withSpanDropRate:i})=>{const l=v(),{formatTimeAgo:r}=Qt(),[s,d]=a(null),u=c(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:xf.PodName,rawValue:o.name},{key:xf.Status,rawValue:o.status,component:()=>{return e=o.status,t(Ge,{status:ra(e),label:e});var e}},{key:xf.Restarts,rawValue:o.restartsCount.toString()},{key:xf.NodeName,rawValue:o.nodeName},{key:xf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(_e,{children:"-"});const i=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),a=i>0?Math.round((n?.metricsDroppedRps??0)/i*100):0,l=a>0?Ne.Error:Ne.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?Ne.Error:Ne.Success;return e(ue,{$gap:4,children:[t(Fe,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Ge,{status:l,label:`Receiver ${a}%`,leftIcon:l===Ne.Error?Al:Rl,useSecondaryTone:!0,invertColors:!0})}),t(Fe,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Ge,{status:c,label:`Exporter ${s}%`,leftIcon:c===Ne.Error?Al:Rl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:xf.Age,rawValue:r(o.creationTimestamp)},{key:xf.DockerImage,rawValue:o.image}]})),[n,l]);return e(Xt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:nl,title:"Pods"},children:[t(Do,{variant:_o.Data,isLoading:o,columns:wf(i),rows:u}),t(Sf,{pod:s,onClose:()=>d(null)})]})},kf=({isOpen:e,onClose:o,title:n,yaml:i})=>t(Lt,{isOpen:e,header:{icon:Dl,title:n,onClose:o},children:t(Tr,{yaml:i,defaultOpen:!0})}),If=e=>{switch(e){case sa.Healthy:return"All desired replicas are updated, available, and ready";case sa.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case sa.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case sa.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case sa.Down:return"No available replicas";case sa.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Ef;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Ef||(Ef={}));const Nf=b.div`
|
|
1366
1277
|
flex: 0.5;
|
|
1367
1278
|
padding: 12px;
|
|
1368
1279
|
border-radius: 12px;
|
|
1369
1280
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1370
|
-
`,
|
|
1281
|
+
`,Of=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=Qt(),[s,d]=a(null),u=c(()=>(e=>{switch(e){case yf.Gateway:return"Deployment";case yf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=c(()=>((e,t,o,n)=>{const i={status:Ne.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case yf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case yf.Node:a=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return i}return a?{status:Ne.Info,label:"Rollout in progress",rightIcon:tl,useSecondaryTone:!0}:l?{status:Ne.Disabled,label:`Last Rollout: ${n(l)}`}:i})(o,n,i,r),[n,i,o,r]),h=c(()=>((e,t,o,n)=>{let i=n?Ne.Info:Ne.Unknown,a=n?"Loading":sa.Unknown,l=n?"Fetching data...":If(sa.Unknown);switch(e){case yf.Gateway:i=t?.status?ra(t?.status):i,a=t?.status??a,l=t?.status?If(t.status):l;break;case yf.Node:i=o?.status?ra(o?.status):i,a=o?.status??a,l=o?.status?If(o.status):l}return{status:i,title:a,description:l}})(o,n,i,l),[n,i,o,l]),m=c(()=>((e,t,o)=>{switch(e){case yf.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 yf.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),g=c(()=>((e,t,o,n)=>{switch(e){case yf.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 yf.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=c(()=>(o===yf.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=c(()=>(o===yf.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(Xt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Dl,title:u,badge:p},actions:[{id:un(),type:uo.ButtonDropData,buttonProps:{variant:ve.Secondary,size:be.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Ef.ManifestYaml,label:u,icon:_l},{id:Ef.ConfigMapYaml,label:"ConfigMap",icon:_l}]}}],children:[e(ue,{$gap:16,children:[t("div",{children:t(ca,{...h})}),m.map(e=>t(Nf,{children:t("div",{children:t(da,{...e})})},e.title)),g.map(e=>t(ua,{...e},e.title))]}),t(kf,{isOpen:s===Ef.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(kf,{isOpen:s===Ef.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},$f=[{value:yf.Gateway,label:"Gateway"},{value:yf.Node,label:"Node Collector"}],Af=({minSupportedVersion:o})=>{const{isVersionSupported:n,version:i,minSupportedVersion:l}=S(o),[r,s]=a(yf.Gateway),u=r===yf.Gateway,p=r===yf.Node,{collectorsApi:h,configApi:m}=Ml(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!u}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!u}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!p}),{data:I=[],loading:E,refetch:N}=h.useNodeCollectorPods({skip:!p}),O=u&&(b||C)||p&&(T||E),$=d(()=>{u?(v(),x()):p&&(k(),N())},[u,p,v,x,k,N]),A=c(()=>u?y:I,[y,I,u]);return e(Fi,{children:[t(Cf,{disabled:!n,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(pa,{children:[e(ee,{children:[t(ce,{variant:Ro.Underline,size:ke.L,options:$f,selected:r,setSelected:s}),t(Of,{selectedTab:r,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(Tf,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(Er,{minSupportedVersion:l,currentVersion:i||""})]})]})},Rf=b.div`
|
|
1371
1282
|
display: inline-flex;
|
|
1372
1283
|
align-items: center;
|
|
1373
1284
|
min-width: 0;
|
|
1374
1285
|
overflow: hidden;
|
|
1375
1286
|
white-space: pre;
|
|
1376
1287
|
text-overflow: ellipsis;
|
|
1377
|
-
`,
|
|
1288
|
+
`,Df=b.div`
|
|
1378
1289
|
display: flex;
|
|
1379
1290
|
flex-direction: column;
|
|
1380
1291
|
gap: 4px;
|
|
1381
1292
|
min-width: 0;
|
|
1382
1293
|
flex: 1;
|
|
1383
1294
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
1384
|
-
`,
|
|
1295
|
+
`,_f=b(ue)`
|
|
1385
1296
|
flex-shrink: 0;
|
|
1386
1297
|
gap: 6px;
|
|
1387
1298
|
align-items: center;
|
|
1388
1299
|
min-height: 22px;
|
|
1389
|
-
`,
|
|
1300
|
+
`,Pf=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Lf=[{value:"all",label:ha},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Ff=({title:o,items:n,isLoading:i,showTypeFilter:l,onRuleClick:r,onCreateRule:s,onEditRule:u,onDeleteRule:p})=>{const h=v(),[m,g]=a(""),[f,b]=a("all"),y=c(()=>{let e=((e,t,o)=>o&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(n,f,l);return e=((e,t)=>{if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})})(e,m),e},[n,f,l,m]),C=c(()=>y.map(o=>{const n=o.typeBadge?((e,t)=>{const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}})(h,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(Df,{$disabled:o.disabled,children:[t(Rf,{children:t(w,{parts:o.summary})}),o.name&&t(_e,{size:Te.XXS,color:Pe.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(_f,{children:[o.disabled&&t(Ge,{label:Lo,textSize:Te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Ge,{label:o.typeBadge,textSize:Te.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>r(o)}}),[y,h,r]),S=c(()=>{const e=e=>t(Pa,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=d(e=>{const t=C.indexOf(e);if(t<0)return[];const o=y[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:Xo,leftIcon:La,onClick:()=>u(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>p(o.ruleId,o.samplingId)}]:[]},[C,y,u,p,S]);return t(lt,{fullHeight:!0,richTitle:{icon:Sl,title:o,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...l?{segment:{"data-id":"sampling-segment-type-filter",options:Lf,selected:f,setSelected:b}}:{}},children:t(Do,{variant:_o.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:ma,subTitle:ba(m)}:{hideIcon:!0,title:fa,button:{label:ga,onClick:s}},columns:Pf,rows:C,getRowActions:x})})},Mf=({docsUrl:o})=>{const{samplingApi:n,sourcesApi:l}=Ml(),{items:r}=l.useSources(),s=c(()=>r.map(e=>({id:e.id})),[r]),{items:p,loading:h,k8sHealthProbesConfig:m,refetch:g}=n.useSamplingRules(),f=d((e,t)=>n.createNoisy?.({samplingId:e,rule:t}),[n]),b=d((e,t,o)=>n.updateNoisy?.(t,{samplingId:e,rule:o}),[n]),v=d((e,t)=>n.createHighlyRelevant?.({samplingId:e,rule:t}),[n]),y=d((e,t,o)=>n.updateHighlyRelevant?.(t,{samplingId:e,rule:o}),[n]),C=d((e,t)=>n.createCostReduction?.({samplingId:e,rule:t}),[n]),S=d((e,t,o)=>n.updateCostReduction?.(t,{samplingId:e,rule:o}),[n]),x=d((e,t,o)=>"noisy"===o?n.deleteNoisy?.(t,e):"highlyRelevant"===o?n.deleteHighlyRelevant?.(t,e):"costReduction"===o?n.deleteCostReduction?.(t,e):void 0,[n]),w=d((e,t)=>n.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[n]),T=c(()=>s.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[s]),k=c(()=>Array.from(new Set(s.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[s]),[I,E]=a(P.Noisy),[N,O]=a(null),[$,D]=a(!1),[_,Q]=a(!1),[te,oe]=a(null),[ne,ie]=a(!1),[ae,le]=a(!1),[re,se]=a(!1),[de,pe]=a(!1);u(!1),i(()=>{},[h,p]);const{pendingViewSamplingRule:he,setPendingViewSamplingRule:me}=mo();i(()=>{if(!he)return;if(h||0===p.length)return;me(null);const e=L(p,he.ruleId,he.category);e&&(E(F[he.category]),D(!1),O(e))},[h,p,he,me]);const ge=c(()=>A(m),[m]),ye=c(()=>M(p),[p]),Ce=c(()=>R(ye?.rule??null),[ye]),Se=c(()=>z(p),[p]),xe=c(()=>B(Se?.rule??null),[Se]),we=u(N);we.current=N,i(()=>{const e=we.current;if(!e)return;const t=X(p,e);t?O(t):(O(null),D(!1))},[p]);const Te=c(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Ie=c(()=>U(p,I,Te),[p,I,Te]),Oe=d(()=>Q(!0),[]),$e=d(()=>Q(!1),[]);d(()=>pe(!1),[]);const Ae=d(async e=>{const t=p[0]?.id??"default";switch(K[I]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[p,I,f,v,C]),Re=d(e=>{const t=G(p,e);t&&(D(!1),O(t))},[p]),De=d(()=>{O(null),D(!1)},[]),_e=d((e,t)=>{const o=N;if(o&&o.rule.ruleId===e&&o.samplingId===t)D(!0),O({...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 D(!0),void O({category:n.category,rule:n.rule,samplingId:t,summary:W(n.category,n.rule)})}},[N,p]),Pe=d(async(e,t,o)=>{const n=N?.category;if(n){switch(n){case"noisy":await b(o,t,j(e));break;case"highlyRelevant":await y(o,t,H(e));break;case"costReduction":await S(o,t,V(e))}D(!1)}},[N,b,y,S]),Le=d((e,t)=>{oe({ruleId:e,samplingId:t})},[]),Fe=d(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=N?.category||K[I];await x(t,e,o),O(null),D(!1),oe(null)},[te,N,I,x]),Me=d(()=>oe(null),[]),ze=d(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=d(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=d(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}),se(!1)},[p,Se,C,S]),Ue=d(e=>{const t=K[I];let o=null;switch(t){case"noisy":{const n=j(e);o=Y(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=H(e);o=Y(p,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=V(e);o=Y(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:va,ruleId:o}:null},[p,I]),Ve=d(e=>{const t=N?.category,o=N?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=j(e);n=Y(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=H(e);n=Y(p,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=V(e);n=Y(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:va,ruleId:n}:null},[p,N]),He=d(e=>{Q(!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 D(!0),void O({category:o.category,rule:o.rule,samplingId:t.id,summary:W(o.category,o.rule)})}},[p]),je=c(()=>{const e=[];return o&&e.push({id:un(),type:uo.Button,buttonProps:{"data-id":"sampling-btn-docs",label:ya,leftIcon:_a,size:be.S,variant:ve.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:un(),type:uo.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ca,leftIcon:tl,size:be.S,variant:ve.Text,onClick:g,loading:h}}),e.push({id:un(),type:uo.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Sa,rightIcon:$a,size:be.S,variant:ve.Primary,onClick:Oe}}),e},[o,g,h,Oe]);return e(Fi,{children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(aa,{icon:Sl,title:wa,subTitle:xa}),t(la,{actions:je})]}),e(ee,{$gap:12,$fullHeight:!0,children:[t(ce,{variant:Ro.Underline,size:ke.L,options:J,selected:I,setSelected:E}),e(ue,{$justifyContent:"space-between",children:[t(Ee,{status:Ne.Default,message:q[I]}),o&&t(fe,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:_a,size:be.S,variant:ve.Text,onClick:()=>window.open(o,"_blank")})]}),I===P.Noisy?t(ur,{title:nt,summary:ge,onEdit:()=>ie(!0)}):I===P.HighlyRelevant?t(ur,{title:Ze,summary:Ce,onEdit:()=>le(!0)}):I===P.CostReduction?t(ur,{title:tt,summary:xe,onEdit:()=>se(!0)}):null,t(Ff,{title:Z[I],items:Ie,isLoading:h,showTypeFilter:I===P.HighlyRelevant,onRuleClick:Re,onCreateRule:Oe,onEditRule:_e,onDeleteRule:Le})]}),t(Lh,{formType:Hl.View,data:N,defaultEditMode:$,onClose:De,onDelete:Le,onSaveEdit:Pe,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(Lh,{formType:Hl.Create,isOpen:_,category:K[I],onClose:$e,onSubmit:Ae,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(Lh,{formType:Hl.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(Lh,{formType:Hl.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(Lh,{formType:Hl.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(Ye,{title:Ea,description:Ia,isOpen:!!te,onClose:Me,denyButton:{label:ka,variant:ve.Secondary,onClick:Me},approveButton:{label:Ta,variant:ve.Primary,onClick:()=>{Fe(),Me()}}}),!1]})},zf=b.div`
|
|
1390
1301
|
padding: 12px;
|
|
1391
1302
|
border-radius: 12px;
|
|
1392
1303
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
1393
|
-
`,
|
|
1304
|
+
`,Bf=f(({id:e,data:o})=>t(zf,{"data-id":e,children:t(xe,{...o})}));var Xf,Uf;Bf.displayName=Bf.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(Xf||(Xf={})),(e=>{e.AnimatedTraffic="animated-traffic"})(Uf||(Uf={}));const Vf=(e,t,o)=>{if(o)return{icons:[dl],aggService:e,selected:!0};const n=e.isVirtual,i=n?[fo(e)]:t?bo(t):[Pl],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:Yi(t?.conditions||[]);return{icons:i,status:a,isVirtual:n,aggService:e,selected:!0}},Hf=e=>!(!e||e.serviceName!==Su||e.id.namespace||e.id.name||e.id.kind),jf=new Hr,Gf={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},Wf=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},Kf={id:{namespace:"",name:"",kind:""},serviceName:Su,markedForInstrumentation:{markedForInstrumentation:!0}},Yf=h(null),Jf=()=>{const e=m(Yf);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},qf=({serviceMap:e,children:o})=>{const n=v(),{sourcesApi:l}=Ml(),{items:r}=l.useSources(),[s,u,p]=Ar([]),[h,m,g]=Rr([]),[f,b]=a(0),y=d(()=>b(e=>e+1),[]),[C,S]=a(""),[x,w]=a(null),[T,k]=a(null),I=d(e=>k(t=>t===e?null:e),[]),E=d(()=>k(null),[]),N=d((e,t)=>{const o=new Set(e);u(e=>e.map(e=>e.type===Xf.MapItem&&o.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[u]);i(()=>{let t=!1;const o=(e=>{const t=new Map,o=new Set,n=(e,o,n=!1)=>{let i=t.get(e);return i||(i={serviceName:o,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:o,value:n}of t)o in e||(e[o]=n)};for(const t of e){const{graphKey:e}=Wf(t.nodeId),a=n(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=Wf(e?.nodeId??"");e.isVirtual&&(o.add(t),i(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||n(i,a.targetServiceName,o.has(i));const l=[];for(const[e,{serviceName:o,isVirtual:n,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:o,isVirtual:n,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const o=[],n={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=Hf(t);o.push({id:i.graphKey,type:Xf.MapItem,position:n,data:Vf(i,t,a),measured:{width:80,height:80}})}else o.push({id:Xf.NoData,type:Xf.NoData,position:n,data:{subTitle:Je.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return o})({aggregatedServiceMap:o,sources:[Kf].concat(r)});if(1===i.length&&i[0].id===Xf.NoData)return u(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:o})=>{const n=[],i=new Map(t.map(e=>[e.id,e]));for(const t of o){const o=t.graphKey,a=i.get(o);if(!a)continue;const l=a.data?.status===Ne.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&n.push({id:`${o}-to-${r}`,type:"smoothstep",source:o,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:$r.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return n})({theme:n,nodes:i,aggregatedServiceMap:o});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,o={})=>{const n={id:"root",layoutOptions:{...Gf,...o},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Su?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await jf.layout(n),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(i,a).then(({nodes:e})=>{t||(u(e),S(l),y())}),()=>{t=!0};u(e=>{const t=new Map(e.map(e=>[e.id,e]));return i.map(e=>{const o=t.get(e.id);return o?e.type===Xf.MapItem&&o.type===Xf.MapItem?{...e,position:o.position,data:{...e.data,selected:o.data.selected}}:{...e,position:o.position}:e})})},[n,e,r,C]);const O=c(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:Uf.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),$=c(()=>({nodes:s,edges:O,onNodesChange:p,onEdgesChange:g,setNodesSelected:N,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:E}),[s,O,p,g,N,f,x,T,I,E]);return t(Yf.Provider,{value:$,children:o})},Zf=b.div`
|
|
1394
1305
|
border: 1px ${({theme:e,$isSelected:t,$isVirtual:o})=>t?`solid ${e.v2.colors.blue[300]}`:o?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
|
|
1395
1306
|
border-radius: 8px;
|
|
1396
1307
|
cursor: pointer;
|
|
1397
1308
|
opacity: ${({$isVirtual:e})=>e?.8:1};
|
|
1398
|
-
`,
|
|
1309
|
+
`,Qf=b.div`
|
|
1399
1310
|
position: relative;
|
|
1400
|
-
`,
|
|
1311
|
+
`,eb=b.div`
|
|
1401
1312
|
position: absolute;
|
|
1402
1313
|
top: 100%;
|
|
1403
1314
|
left: 50%;
|
|
@@ -1406,7 +1317,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1406
1317
|
align-items: center;
|
|
1407
1318
|
gap: 4px;
|
|
1408
1319
|
margin-top: 4px;
|
|
1409
|
-
`,
|
|
1320
|
+
`,tb=f(({id:n,data:i})=>{const{icons:a,status:l,isVirtual:r}=i,s=v(),{activeNodeId:d,hoveredNodeId:u}=Jf(),{isUserSource:p,isNodeSelected:h,isHovered:m}=c(()=>({isUserSource:n===Su,isNodeSelected:d===n,isHovered:u===n}),[n,d,u,n]),{isSelected:g,isHighlighted:f}=c(()=>({isSelected:h||p,isHighlighted:h||m||p}),[h,m,p]),b=l?ko(l,s):null;return e(o,{children:[t(Dr,{type:"source",position:_r.Right,style:{visibility:"hidden"}}),t(Dr,{type:"target",position:_r.Left,style:{visibility:"hidden"}}),e(Qf,{"data-id":n,children:[t(Zf,{$isSelected:g,$isVirtual:r,children:t(vo,{padding:12,icons:a,status:f?Ne.Info:l})}),e(eb,{children:[b&&t(b,{}),t(_e,{size:Te.XXS,nowrap:!0,children:n})]})]})]})});tb.displayName=tb.name;const ob=b.div`
|
|
1410
1321
|
display: flex;
|
|
1411
1322
|
flex-direction: column;
|
|
1412
1323
|
gap: 12px;
|
|
@@ -1419,10 +1330,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1419
1330
|
top: 16px;
|
|
1420
1331
|
left: 8px;
|
|
1421
1332
|
z-index: ${({theme:e})=>e.v2.zIndex.drawer};
|
|
1422
|
-
`,
|
|
1333
|
+
`,nb=({children:e})=>t(ob,{children:e});var ib,ab;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(ib||(ib={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(ab||(ab={}));const lb=b.div`
|
|
1423
1334
|
flex: 1 1 auto;
|
|
1424
1335
|
min-height: 0;
|
|
1425
|
-
`,
|
|
1336
|
+
`,rb=()=>{const{nodes:o,activeNodeId:n,resetActiveNode:i}=Jf(),[l,r]=a(ib.All),s=c(()=>{const e=new Map;for(const t of o)t.type===Xf.MapItem&&e.set(t.id,t);return e},[o]),d=c(()=>s.get(n??""),[s,n]),{inbound:u,outbound:p}=c(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:ab.Outbound,totalRequests:e.totalRequests});for(const t of s.values())if(t.id!==d.id)for(const o of t.data.aggService?.connections??[])o.targetGraphKey===d.id&&e.push({peerId:t.id,direction:ab.Inbound,totalRequests:o.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,s]);if(!d)return null;const h=[ib.All,ib.Inbound].includes(l)&&u.length>0,m=[ib.All,ib.Outbound].includes(l)&&p.length>0;return e(nb,{children:[e(ue,{$width:"100%",$gap:8,children:[t(fe,{variant:ve.Text,size:be.S,leftIcon:Qa,onClick:i}),t(vo,{icons:d.data.icons}),t(_e,{size:Te.XS,children:d.id})]}),t(ce,{fullWidth:!0,options:[{label:`${ib.All}`,value:ib.All,badge:{label:`${u.length+p.length}`}},{label:`${ib.Inbound}`,value:ib.Inbound,badge:{label:`${u.length}`}},{label:`${ib.Outbound}`,value:ib.Outbound,badge:{label:`${p.length}`}}],selected:l,setSelected:r}),h&&t(cb,{halfHeight:m,title:"Inbound",icon:sl,connections:u,mapNodesById:s}),m&&t(cb,{halfHeight:h,title:"Outbound",icon:cl,connections:p,mapNodesById:s})]})},sb=b.div`
|
|
1426
1337
|
display: flex;
|
|
1427
1338
|
flex-direction: column;
|
|
1428
1339
|
gap: 8px;
|
|
@@ -1430,17 +1341,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1430
1341
|
border-radius: 12px;
|
|
1431
1342
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1432
1343
|
height: ${({$halfHeight:e})=>e?"48%":"100%"};
|
|
1433
|
-
`,
|
|
1344
|
+
`,cb=({halfHeight:o,title:n,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(sb,{$halfHeight:o,children:[e(ue,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(_e,{size:Te.XXS,color:Pe.Secondary,children:n})]}),t(lb,{children:t(ho,{gap:4,elements:a.map(e=>t(ub,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},db=b.div`
|
|
1434
1345
|
display: flex;
|
|
1435
1346
|
align-items: center;
|
|
1436
1347
|
gap: 8px;
|
|
1437
1348
|
padding: 8px;
|
|
1438
1349
|
border-radius: 8px;
|
|
1439
1350
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1440
|
-
`,
|
|
1351
|
+
`,ub=({connection:o,peerNode:n})=>e(db,{children:[n&&t(vo,{icons:n.data.icons}),e(ue,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(_e,{size:Te.XXS,children:o.peerId}),t(Ge,{label:o.totalRequests,tooltip:"Total requests"})]})]}),pb="0;0.5;1",hb=f(({id:n,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const u=v(),[p]=Pr({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${n}__animated-traffic-motion`,m=u.v2.colors.blue[700],g=u.v2.colors.blue[900],f=u.v2.colors.blue[500],b="4s";return e(o,{children:[t(Lr,{id:n,path:p,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Fr,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:p,fill:"none",stroke:"none"}),Array.from({length:5}).map((o,n)=>{const i=`-${(.8*n).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:pb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:pb,values:`${g};${f};${f}`})]},n)})]})})]})});hb.displayName=hb.name;const mb=b.div`
|
|
1441
1352
|
flex: 1 1 auto;
|
|
1442
1353
|
min-height: 0;
|
|
1443
|
-
`,
|
|
1354
|
+
`,gb=({})=>{const{nodes:o,setNodesSelected:n,resetActiveNode:i}=Jf(),[l,r]=a(""),s=c(()=>o.filter(e=>e.type===Xf.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[o]),u=c(()=>s.filter(e=>e.data.selected),[s]),p=c(()=>s.filter(e=>e.id.toLowerCase().includes(l.toLowerCase())),[s,l]),h=c(()=>p.every(e=>e.data.selected),[p]),m=d(()=>{const e=!h;n(p.map(e=>e.id),e),e||i()},[p,h,n,i]);return s.length?e(nb,{children:[e(ue,{$width:"100%",$gap:8,children:[t(_e,{size:Te.XS,children:"Services"}),t(Ge,{label:s.length})]}),t(po,{width:"100%",value:l,onChange:r}),e(ue,{$width:"100%",$justifyContent:"space-between",children:[t(_e,{size:Te.XXXS,children:`Showing ${u.length} out of ${s.length}`}),t(_e,{"data-id":"namespaces-select-all",onClick:m,disabled:!p.length,size:Te.XS,children:h?Je.UNSELECT_ALL:Je.SELECT_ALL})]}),t(mb,{children:t(ho,{gap:4,elements:p.map(e=>t(bb,{node:e},e.id))})})]}):null},fb=b.div`
|
|
1444
1355
|
display: flex;
|
|
1445
1356
|
align-items: center;
|
|
1446
1357
|
gap: 8px;
|
|
@@ -1448,7 +1359,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1448
1359
|
border-radius: 8px;
|
|
1449
1360
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1450
1361
|
cursor: pointer;
|
|
1451
|
-
`,
|
|
1362
|
+
`,bb=({node:o})=>{const{setNodesSelected:n,activeNodeId:i,resetActiveNode:a}=Jf(),l=d(()=>{const e=!o.data.selected,t=i===o.id;n([o.id],e),!e&&t&&a()},[o,i,n,a]);return e(fb,{onClick:l,children:[t(oe,{value:o.data.selected||!1,onChange:l}),t(vo,{icons:o.data.icons}),t(_e,{size:Te.XXS,children:o.id})]},o.id)},vb=b.div`
|
|
1452
1363
|
position: relative;
|
|
1453
1364
|
height: 100%;
|
|
1454
1365
|
.react-flow__attribution {
|
|
@@ -1457,7 +1368,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1457
1368
|
* {
|
|
1458
1369
|
transition: none;
|
|
1459
1370
|
}
|
|
1460
|
-
`,
|
|
1371
|
+
`,yb=b.div`
|
|
1461
1372
|
.react-flow__controls {
|
|
1462
1373
|
display: flex;
|
|
1463
1374
|
align-items: center;
|
|
@@ -1483,33 +1394,33 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1483
1394
|
}
|
|
1484
1395
|
}
|
|
1485
1396
|
}
|
|
1486
|
-
`,
|
|
1397
|
+
`,Cb={[Xf.MapItem]:tb,[Xf.NoData]:Bf},Sb={[Uf.AnimatedTraffic]:hb},xb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},wb=({trigger:e})=>{const{fitView:t}=Vr(),o=u(!0);return i(()=>{o.current?o.current=!1:e>0&&requestAnimationFrame(()=>t(xb))},[e,t]),null},Tb=({onRefresh:o})=>{const{nodes:n,edges:i,fitViewTrigger:a,onNodesChange:l,onEdgesChange:r,setHoveredNodeId:s,toggleActiveNode:d}=Jf(),u=c(()=>{const e=new Set(n.filter(e=>e.type===Xf.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const o of i)e.has(o.source)&&t.add(o.target),e.has(o.target)&&t.add(o.source);return n.filter(e=>e.type!==Xf.MapItem||e.data.selected||t.has(e.id))},[n,i]);return e(zr,{zoomOnScroll:!0,nodes:u,nodeTypes:Cb,edges:i,edgeTypes:Sb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>s(t.id),onNodeMouseLeave:()=>s(null),onNodesChange:l,onEdgesChange:r,children:[t(Br,{}),t(wb,{trigger:a}),t(yb,{children:t(Xr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:xb,children:t(Ur,{onClick:o,children:t(tl,{})})})})]})},kb=o=>t(Mr,{children:e(vb,{children:[t(Tb,{...o}),t(gb,{}),t(rb,{})]})}),Ib=b.div`
|
|
1487
1398
|
width: 100%;
|
|
1488
1399
|
flex: 1;
|
|
1489
1400
|
align-self: stretch;
|
|
1490
1401
|
min-height: 0;
|
|
1491
1402
|
height: 100%;
|
|
1492
1403
|
position: relative;
|
|
1493
|
-
`,
|
|
1404
|
+
`,Eb=()=>{const{serviceMapApi:e}=Ml(),{data:o,refetch:n}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(qf,{serviceMap:o?.serviceMap??[],children:t(Ib,{children:t(kb,{onRefresh:n})})})},Nb=b.div`
|
|
1494
1405
|
display: flex;
|
|
1495
1406
|
align-items: center;
|
|
1496
1407
|
justify-content: space-between;
|
|
1497
1408
|
padding: 0 12px;
|
|
1498
|
-
`,
|
|
1409
|
+
`,Ob=b.div`
|
|
1499
1410
|
display: flex;
|
|
1500
1411
|
align-items: center;
|
|
1501
1412
|
gap: 8px;
|
|
1502
|
-
|
|
1413
|
+
`,$b=b.div`
|
|
1503
1414
|
width: 1px;
|
|
1504
1415
|
height: 20px;
|
|
1505
1416
|
background-color: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1506
|
-
`,
|
|
1417
|
+
`,Ab=({disabled:o,loading:n,onClickShowYaml:i,onClickReset:l,onClickRefresh:r})=>{const s=v(),[d,u]=a(!1),p=c(()=>i?[{id:un(),type:uo.Button,buttonProps:{label:"Show Config YAML",leftIcon:_l,size:be.S,variant:ve.Secondary,onClick:i,disabled:o}}]:[],[i,o]),h=c(()=>{const e=[];return r&&e.push({id:un(),type:uo.Button,buttonProps:{leftIcon:tl,tooltip:"Refresh",hideTooltipIcon:!0,size:be.S,variant:ve.Text,onClick:r,disabled:o,loading:n}}),l&&e.push({id:un(),type:uo.Button,buttonProps:{leftIcon:Oa,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:be.S,variant:ve.Text,textColor:s.v2.colors.red[500],onClick:()=>u(!0),disabled:o}}),e},[o,n,l,r,s]),m=p.length>0,g=h.length>0;return e(Nb,{children:[t(aa,{icon:ol,title:"Odigos Settings"}),e(Ob,{children:[m&&t(la,{actions:p}),m&&g&&t($b,{}),g&&t(la,{actions:h})]}),t(Ye,{isOpen:d,onClose:()=>u(!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:ve.Secondary,onClick:()=>u(!1)},approveButton:{label:"Approve",variant:ve.Primary,onClick:()=>{l?.(),u(!1)}}})]})},Rb=b(ee)`
|
|
1507
1418
|
width: 220px;
|
|
1508
1419
|
flex-shrink: 0;
|
|
1509
1420
|
height: 100%;
|
|
1510
1421
|
gap: 4px;
|
|
1511
1422
|
overflow-y: auto;
|
|
1512
|
-
`,
|
|
1423
|
+
`,Db=({options:e,selected:o,setSelected:n,disabled:i})=>t(Rb,{children:e.map(e=>t(Ps,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:o===e.id,disabled:i,onClick:()=>n(e.id)},e.id))}),_b=b(ee)`
|
|
1513
1424
|
width: 100%;
|
|
1514
1425
|
/* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
|
|
1515
1426
|
max-width: 844px;
|
|
@@ -1519,25 +1430,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1519
1430
|
gap: 24px;
|
|
1520
1431
|
flex: 1;
|
|
1521
1432
|
min-height: 0;
|
|
1522
|
-
`,
|
|
1433
|
+
`,Pb=b(ue)`
|
|
1523
1434
|
flex: 1;
|
|
1524
1435
|
min-height: 0;
|
|
1525
1436
|
width: 100%;
|
|
1526
1437
|
align-self: stretch;
|
|
1527
|
-
`,
|
|
1438
|
+
`,Lb=b(ee)`
|
|
1528
1439
|
flex: 1;
|
|
1529
1440
|
min-height: 0;
|
|
1530
1441
|
height: 100%;
|
|
1531
1442
|
max-width: 600px;
|
|
1532
1443
|
overflow-y: auto;
|
|
1533
|
-
`,
|
|
1444
|
+
`,Fb=b(ue)`
|
|
1534
1445
|
gap: 8px;
|
|
1535
1446
|
width: 100%;
|
|
1536
1447
|
align-items: center;
|
|
1537
|
-
`,
|
|
1448
|
+
`,Mb=b.div`
|
|
1538
1449
|
flex: 1;
|
|
1539
1450
|
min-width: 0;
|
|
1540
|
-
`,
|
|
1451
|
+
`,zb=e=>"general"===e.name?0:"advanced"===e.name?2:1,Bb=({minSupportedVersion:n})=>{const{isVersionSupported:l,version:r,isEnterprise:s,minSupportedVersion:d}=S(n),{configApi:u}=Ml(),{data:p,loading:h}=u.useConfigYamls(),{data:m,loading:g,refetch:f}=u.useEffectiveConfig(),b=p?.configYamls??[],[v,y]=a(!1),C=c(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...o}=m;return o},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=Ht(C);i(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const E=c(()=>[...b].sort((e,t)=>zb(e)-zb(t)),[b]),N=c(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(m?.provenance),[m?.provenance]),O=c(()=>{const e=new Set;for(const t of b)for(const o of t.fields)o.componentType===Ft.Dropdown&&e.add(o.helmValuePath);return e},[b]),$=c(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=a(!1),[D,_]=a(!1),P=c(()=>[{id:un(),type:uo.Button,buttonProps:{"data-id":"settings-save",variant:ve.Primary,size:be.S,label:"Save Changes",leftIcon:Ha,loading:v,onClick:()=>R(!0)}},{id:un(),type:uo.Button,buttonProps:{"data-id":"settings-cancel",variant:ve.Secondary,size:be.S,label:"Cancel",leftIcon:ja,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=c(()=>E.map(e=>({id:e.name,label:e.displayName})),[E]),F=c(()=>E.map(e=>e.name),[E]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=Na({sectionNames:F});return t(Fi,{$gap:24,children:e(_b,{children:[t(Ab,{disabled:!l,loading:h||g,onClickShowYaml:()=>_(!0),onClickReset:async()=>{await(async()=>{u.resetLocalUiConfigToDefaults&&await u.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(pa,{children:[!l&&t(Er,{minSupportedVersion:d,currentVersion:r||""}),t(Po,{isOpen:I,richTitle:{icon:ol,title:"Config Settings"},actions:P}),t(Ye,{isOpen:A,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>R(!1),denyButton:{label:"Keep editing",variant:ve.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:ve.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let i=n;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&o(n,t,i.replaceAll("-","_"))}return n})(k(C,x),O);await(async e=>{u.updateLocalUiConfig&&(y(!0),await u.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),R(!1)}}}),e(Pb,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(Db,{options:L,selected:M,setSelected:z,disabled:!l}),t(Lb,{ref:X,$gap:24,$width:"100%",children:b.length?E.map(n=>t(lt,{id:n.name,bordered:!0,ref:e=>B(n.name,e),customTitle:t(_e,{size:Te.M,weight:500,color:Pe.Primary,children:n.displayName}),children:t(ee,{$gap:24,children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!s)return null;if(n.renderCondition&&!Mt(n.renderCondition,[],$))return null;const i=St(n.componentProps||"{}",{}),a=N[n.helmValuePath],l=n.componentType===Ft.Toggle,r=t(_e,{size:Te.XS,weight:500,color:Pe.Primary,children:n.displayName}),c=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Ne.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Ne.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Ne.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=c?t(Ge,{...c}):null,u=n.description?t(_e,{size:Te.XXS,color:Pe.Secondary,children:n.description}):null,p=e(ee,{$gap:4,children:[e(ue,{$gap:8,$alignItems:"center",children:[r,d]}),u]}),h=t(Nr,{componentType:n.componentType,inputType:i.type,name:n.helmValuePath,disabled:n.isHelmOnly||v,value:T("formData",n.helmValuePath),setValue:e=>w(n.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:kt.S},n.helmValuePath),m=n.isHelmOnly?t(Fe,{text:"This field can only be updated via the Helm values.yaml file",children:t(Ll,{})}):null;return t(ee,{$gap:8,children:l?e(ue,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[p,e(ue,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(o,{children:[p,e(Fb,{children:[t(Mb,{children:h}),m]})]})},n.helmValuePath)})})},n.name)):h?t(pt,{$height:"30vh",children:t(bt,{withSpinner:!0})}):t(lt,{richTitle:{icon:ol,title:"Config Settings"},children:t(xe,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(Lt,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:_l,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(pt,{$height:"30vh",children:t(bt,{withSpinner:!0})}):t(Tr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},Xb=b.div`
|
|
1541
1452
|
position: fixed;
|
|
1542
1453
|
bottom: 12px;
|
|
1543
1454
|
left: 12px;
|
|
@@ -1546,4 +1457,4 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
|
|
|
1546
1457
|
flex-direction: column-reverse;
|
|
1547
1458
|
gap: 6px;
|
|
1548
1459
|
max-width: 600px;
|
|
1549
|
-
`,
|
|
1460
|
+
`,Ub=()=>{const{notifications:e,markAsDismissed:o,markAsSeen:n}=Yt(),i=e.filter(({dismissed:e})=>!e);return t(Xb,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(Ee,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{o(e),t&&n(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{Ls as AddActionDrawer,ds as AddActionForm,Gh as AddDataStreamModal,Gs as AddDestinationDrawer,ps as AddDestinationForm,Ws as AddRuleDrawer,Cs as AddRuleForm,rc as AddSourceDrawer,Qm as CentralConnections,Bd as CloudConnectorStep,Vd as CreateCloudConnectorDrawer,Gm as CreateNewType,xs as DataStreamForm,Ss as DataStreamMergeWarning,Kd as EditActionDrawer,Yd as EditConfigDrawer,Wh as EditDataStreamModal,qd as EditDestinationDrawer,Qd as EditRuleDrawer,Th as EditSourceDrawer,ws as EditSourceForm,hg as Onboarding,Jh as OnboardingDone,vf as Overview,Af as PipelineCollectors,lr as RegexTesterDrawer,Hm as SamplingOnboardingModal,Lh as SamplingRuleDrawer,Os as SamplingRuleForm,Mf as SamplingRules,Eb as ServiceMap,Bb as Settings,jh as SystemDrawer,$f as TABS,Ub as ToastList};
|