@odigos/ui-kit 0.0.262 → 0.0.263-dev.519
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 +12 -0
- package/lib/chunks/{connections-scope-7HTW_FyZ.js → connections-scope-DEVWbigK.js} +1 -1
- package/lib/chunks/index-BVtv0LGZ.js +155 -0
- package/lib/chunks/{odigos-context-nQT2LWDb.js → odigos-context-DGEWcwEQ.js} +1 -1
- package/lib/chunks/source-instrument-form-context-DMCdySjE.js +1 -0
- package/lib/chunks/ui-components-BDtk3K99.js +1742 -0
- package/lib/chunks/{use-odigos-api-CPlk79JW.js → use-odigos-api-ZAJiPzPh.js} +2 -2
- package/lib/components/_v2/cards/section-card/index.d.ts +2 -0
- package/lib/components/_v2/index.d.ts +1 -0
- package/lib/components/_v2/input-list/index.d.ts +2 -0
- package/lib/components/_v2/radio-card/index.d.ts +16 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/strings/index.d.ts +64 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/add-source-drawer/strings.d.ts +1 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/index.d.ts +15 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/custom-resource-table.d.ts +9 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/helpers.d.ts +5 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/index.d.ts +2 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/permission-list.d.ts +12 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/permissions.d.ts +25 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/policy-preview.d.ts +5 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/select-provider/provider-list.d.ts +8 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/setup-credentials/create-role-section.d.ts +6 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/setup-credentials/enter-arn-section.d.ts +5 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/setup-credentials/index.d.ts +5 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/setup-credentials/methods.d.ts +30 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/setup-credentials/section.d.ts +9 -0
- package/lib/containers/_v2/_drawers/create-cloud-connector-drawer/steps/validate-connection/index.d.ts +8 -0
- package/lib/containers/_v2/_drawers/index.d.ts +1 -0
- package/lib/containers/_v2/central-connections/helpers.d.ts +9 -0
- package/lib/containers/_v2/central-connections/index.d.ts +6 -1
- package/lib/containers/_v2/settings/side-menu/index.d.ts +12 -0
- package/lib/containers/_v2/settings/toolbar/index.d.ts +2 -5
- package/lib/containers/v2.js +598 -158
- package/lib/containers.js +1 -1
- package/lib/contexts/cloud-connector-form-context.d.ts +35 -0
- package/lib/contexts/index.d.ts +1 -0
- package/lib/contexts/odigos-api/types.d.ts +1 -0
- package/lib/contexts/odigos-api.js +1 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons/common/index.d.ts +1 -0
- package/lib/icons/common/lock-icon/index.d.ts +2 -0
- package/lib/icons/compute-platform/cloud-connector-icon/index.d.ts +2 -0
- package/lib/icons/compute-platform/cloud-connector-policy-icon/index.d.ts +2 -0
- package/lib/icons/compute-platform/index.d.ts +2 -0
- package/lib/icons.js +1 -1
- package/lib/snippets/_v2/connector-created-modal/index.d.ts +7 -0
- package/lib/snippets/_v2/dynamic-field/index.d.ts +2 -1
- package/lib/snippets/_v2/index.d.ts +1 -0
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +1 -4
- package/lib/types/cloud-connectors/index.d.ts +88 -0
- package/lib/types/common/index.d.ts +2 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/snapshot/index.d.ts +1 -0
- package/lib/types/sources/index.d.ts +1 -0
- package/lib/types/workload/index.d.ts +1 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-raAGXSYj.js +0 -155
- package/lib/chunks/source-instrument-form-context-BDrkrejS.js +0 -1
- package/lib/chunks/ui-components-p39Q_a1_.js +0 -1703
package/lib/containers/v2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEffect as i,useMemo as a,useRef as l,useCallback as r,useState as s,Fragment as c,forwardRef as d,useImperativeHandle as u,Children as p,createContext as h,useContext as m,useLayoutEffect as g}from"react";import f,{useTheme as b,css as v,keyframes as y}from"styled-components";import{u as C,n as S,C as x,e as w,f as T,h as k,g as E,j as I,k as O,l as N,d as $,b as A,c as R,S as D,o as _,R as P,p as L,q as F,a as M,r as z,s as B,t as X,w as U,x as V,y as H,z as j,A as G,B as W,D as K,E as Y,F as J}from"../chunks/odigos-context-DGEWcwEQ.js";import{f as q,a8 as Z,a9 as Q,V as ee,aa as te,ab as oe,ac as ne,ad as ie,ae,af as le,ag as re,ah as se,T as ce,O as de,a as ue,y as pe,B as he,z as me,L as ge,M as fe,ai as be,aj as ve,ak as ye,al as Ce,am as Se,an as xe,ao as we,l as Te,ap as ke,s as Ee,aq as Ie,ar as Oe,g as Ne,N as $e,as as Ae,at as Re,au as De,Y as _e,o as Pe,av as Le,S as Fe,k as Me,m as ze,aw as Be,ax as Xe,H as Ue,ay as Ve,G as He,J as je,C as Ge,n as We,R as Ke,az as Ye,aA as Je,aB as qe,p as Ze,h as Qe,aC as et,aD as tt,aE as ot,aF as nt,aG as it,aH as at,aI as lt,aJ as rt,aK as st,aL as ct,aM as dt,aN as ut,aO as pt,aP as ht,aQ as mt,D as gt,aR as ft,aS as bt,aT as vt,aU as yt,aV as Ct,aW as St,e as xt,I as wt,E as Tt,b as kt,aX as Et,aY as It,$ as Ot,aZ as Nt,a_ as $t,a1 as At,a$ as Rt,b0 as Dt,b1 as _t,b2 as Pt,b3 as Lt,a4 as Ft,A as Mt,b4 as zt,b5 as Bt,b6 as Xt,d as Ut,b7 as Vt,b8 as Ht,b9 as jt,ba as Gt,W as Wt,F as Kt,bb as Yt,bc as Jt,bd as qt,be as Zt,bf as Qt,bg as eo,bh as to,bi as oo,bj as no,bk as io,bl as ao,bm as lo,bn as ro,U as so,Q as co,bo as uo,bp as po,q as ho,r as mo,w as go,K as fo,bq as bo,br as vo,bs as yo,bt as Co,bu as So,bv as xo,bw as wo,bx as To,by as ko,bz as Eo,bA as Io,bB as Oo,bC as No,bD as $o,bE as Ao,bF as Ro,bG as Do,bH as _o,bI as Po,bJ as Lo,bK as Fo,bL as Mo,bM as zo,bN as Bo,bO as Xo,bP as Uo,bQ as Vo,bR as Ho,bS as jo,bT as Go,bU as Wo,bV as Ko,bW as Yo,bX as Jo,bY as qo,bZ as Zo,b_ as Qo,b$ as en,c0 as tn,c1 as on,c2 as nn,c3 as an,c4 as ln,c5 as rn,c6 as sn,c7 as cn,c8 as dn,c9 as un,ca as pn,cb as hn,cc as mn,cd as gn,ce as fn,cf as bn,cg as vn,ch as yn,ci as Cn,cj as Sn,ck as xn,cl as wn,cm as Tn,cn as kn,co as En,cp as In,cq as On,cr as Nn,cs as $n,ct as An,cu as Rn,cv as Dn,cw as _n,cx as Pn,cy as Ln,cz as Fn,cA as Mn,cB as zn,cC as Bn,cD as Xn,cE as Un,cF as Vn,cG as Hn,cH as jn,cI as Gn,cJ as Wn,cK as Kn,cL as Yn,cM as Jn,cN as qn,cO as Zn,cP as Qn,cQ as ei,cR as ti,cS as oi,cT as ni,cU as ii,cV as ai,cW as li,cX as ri,cY as si,cZ as ci,c_ as di,c$ as ui,d0 as pi,d1 as hi,d2 as mi,d3 as gi,d4 as fi,d5 as bi,d6 as vi,d7 as yi,d8 as Ci,d9 as Si,da as xi,db as wi,dc as Ti,dd as ki,de as Ei,c as Ii,df as Oi,dg as Ni,dh as $i,di as Ai,dj as Ri,dk as Di,dl as _i,dm as Pi,dn as Li,dp as Fi,x as Mi,dq as zi,v as Bi,dr as Xi,ds as Ui,dt as Vi,du as Hi,dv as ji,dw as Gi,dx as Wi,dy as Ki,a0 as Yi,dz as Ji,dA as qi,dB as Zi,dC as Qi,dD as ea,dE as ta,dF as oa,dG as na,dH as ia,dI as aa,dJ as la,dK as ra,dL as sa,dM as ca,dN as da,dO as ua,dP as pa,dQ as ha,dR as ma,dS as ga,dT as fa,dU as ba,dV as va,dW as ya,dX as Ca,dY as Sa}from"../chunks/ui-components-BDtk3K99.js";import{TrashIcon as xa,PlusIcon as wa,ArrowRightIcon as Ta,VSquareIcon as ka,XSquareIcon as Ea,BookIcon as Ia,DeleteIcon as Oa,EditIcon as Na,GoLogo as $a,JavaLogo as Aa,ChevronRightIcon as Ra,ActionIcon as Da,DestinationIcon as _a,ChevronUpIcon as Pa,ChevronDownIcon as La,VIcon as Fa,XIcon as Ma,InstrumentationRuleIcon as za,SourceIcon as Ba,NamespacesIcon as Xa,AwsLogo as Ua,CloudConnectorIcon as Va,EyeOpenIcon as Ha,CloudConnectorPolicyIcon as ja,ArrowLeftIcon as Ga,ISquareIcon as Wa,RefreshIcon as Ka,SettingsIcon as Ya,PodIcon as Ja,OdigosLogo as qa,K8sLogo as Za,ExclamationCircleIcon as Qa,QuestionCircleIcon as el,InboundIcon as tl,OutboundIcon as ol,UserIcon as nl,TerminalIcon as il,MinusIcon as al,SearchIcon as ll,ExpandIcon as rl,CopyIcon as sl,DotIcon as cl,ArrowDownIcon as dl,DownloadIcon as ul,RefreshLeftArrowIcon as pl,VmLogo as hl,SamplingIcon as ml,ExclamationTriangleIcon as gl,KeyIcon as fl,DiagnoseIcon as bl,StarIcon as vl,ArrowIcon as yl,ConnectionsIcon as Cl,FilterIcon as Sl,DataStreamIcon as xl,PipelineCollectorIcon as wl,ArrowDownSquareIcon as Tl,ArrowUpSquareIcon as kl,GatewayIcon as El,YamlIcon as Il,LockIcon as Ol}from"../icons.js";import{d as Nl}from"../chunks/use-odigos-api-ZAJiPzPh.js";import{D as $l,S as Al,I as Rl,a as Dl,A as _l,P as Pl,b as Ll,c as Fl,R as Ml,O as zl,d as Bl,e as Xl,f as Ul,W as Vl,g as Hl,C as jl,h as Gl,Y as Wl,i as Kl,j as Yl,U as Jl}from"../chunks/index-BVtv0LGZ.js";import{O as ql}from"../chunks/connections-scope-DEVWbigK.js";import{u as Zl,g as Ql,h as er,f as tr,j as or,i as nr,S as ir,l as ar,E as lr,m as rr,n as sr,k as cr,e as dr,b as ur,d as pr,a as hr,A as mr,R as gr,C as fr,c as br,D as vr}from"../chunks/source-instrument-form-context-DMCdySjE.js";import{U as yr}from"../chunks/consts-D6GCMJ6c.js";import{createPortal as Cr}from"react-dom";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const Sr=[{id:"CREDIT_CARD",label:"Credit card"}],xr=[{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:ne.Pod,label:ne.Pod},{id:ne.Namespace,label:ne.Namespace},{id:ne.Node,label:ne.Node}],Tr=[{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}],kr=[{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}],Er=/^[a-zA-Z]$/,Ir=new Set(["*","+","?"]),Or=new Set(["^","$"]),Nr={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},$r=f.div`
|
|
2
2
|
padding: 8px 16px;
|
|
3
3
|
border-radius: 6px;
|
|
4
4
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
@@ -18,9 +18,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
18
18
|
box-decoration-break: clone;
|
|
19
19
|
-webkit-box-decoration-break: clone;
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
22
|
-
background: ${({$kind:e})=>
|
|
23
|
-
`,
|
|
21
|
+
`,Ar=f.span`
|
|
22
|
+
background: ${({$kind:e})=>Nr[e]};
|
|
23
|
+
`,Rr=({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(Ir.has(t)||Or.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];Er.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($r,e?{"data-id":o,children:n.map((e,o)=>t(Ar,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},Dr="rgba(102, 191, 255, 0.5)",_r=v`
|
|
24
24
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
25
25
|
font-size: 12px;
|
|
26
26
|
line-height: 20px;
|
|
@@ -33,7 +33,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
33
33
|
-moz-tab-size: 4;
|
|
34
34
|
tab-size: 4;
|
|
35
35
|
margin: 0;
|
|
36
|
-
`,
|
|
36
|
+
`,Pr=f.div`
|
|
37
37
|
position: relative;
|
|
38
38
|
width: 100%;
|
|
39
39
|
min-height: ${({$minHeight:e})=>e}px;
|
|
@@ -45,8 +45,8 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
45
45
|
&:focus-within {
|
|
46
46
|
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
47
47
|
}
|
|
48
|
-
`,
|
|
49
|
-
${
|
|
48
|
+
`,Lr=f.div`
|
|
49
|
+
${_r}
|
|
50
50
|
position: absolute;
|
|
51
51
|
inset: 0;
|
|
52
52
|
padding: 12px;
|
|
@@ -59,8 +59,8 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
59
59
|
box-decoration-break: clone;
|
|
60
60
|
-webkit-box-decoration-break: clone;
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
63
|
-
${
|
|
62
|
+
`,Fr=f.textarea`
|
|
63
|
+
${_r}
|
|
64
64
|
position: relative;
|
|
65
65
|
z-index: 1;
|
|
66
66
|
display: block;
|
|
@@ -78,18 +78,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
78
78
|
&::placeholder {
|
|
79
79
|
color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
80
80
|
}
|
|
81
|
-
`,
|
|
81
|
+
`,Mr=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),zr=({regex:o,value:n,onChange:i,minHeight:s=240,...c})=>{const d=l(null),u=l(null),p=a(()=>((e,t)=>{if(!e||!t)return Mr(t);let o;try{o=new RegExp(e)}catch{return Mr(t)}const n=o.exec(t);if(!n)return Mr(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&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(Pr,{$minHeight:s,children:[e(Lr,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:Dr},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:Dr},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(Fr,{ref:u,$minHeight:s,value:n,onChange:e=>i(e.target.value),onScroll:h,spellCheck:!1,...c})]})},Br=f.div`
|
|
82
82
|
flex: 1;
|
|
83
83
|
min-height: 0;
|
|
84
84
|
overflow-y: auto;
|
|
85
|
-
|
|
85
|
+
`,Xr=f.div`
|
|
86
86
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
87
87
|
border-radius: 8px;
|
|
88
88
|
padding: 8px;
|
|
89
89
|
display: flex;
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
gap: 12px;
|
|
92
|
-
`,
|
|
92
|
+
`,Ur=f.div`
|
|
93
93
|
padding: 8px 16px;
|
|
94
94
|
border-radius: 8px;
|
|
95
95
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
@@ -100,7 +100,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
100
100
|
word-break: break-all;
|
|
101
101
|
white-space: pre-wrap;
|
|
102
102
|
user-select: text;
|
|
103
|
-
`,
|
|
103
|
+
`,Vr=({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:se.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:se.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:se.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:se.RESULT_NO_MATCH}})(n,r),[n,r]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(re,{isOpen:o,header:{title:se.TITLE,onClose:()=>{c(""),i()}},children:t(Br,{children:e(Xr,{children:[e(Z,{$gap:6,children:[t(Q,{label:se.REGEX_LABEL}),t(Rr,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(ce,{size:ue.XXS,color:de.Secondary,children:se.REGEX_EMPTY_HINT})]}),e(Z,{$gap:6,children:[e(pe,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(Q,{label:se.TEST_STRING_LABEL}),t(he,{"data-id":"regex-tester-unescape",label:se.UNESCAPE_LABEL,tooltip:se.UNESCAPE_TOOLTIP,variant:ge.Secondary,size:me.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:(p=r,!/\\["'\\nrt]/.test(p))})]}),t(zr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:se.TEST_STRING_PLACEHOLDER,regex:n,value:r,onChange:c,minHeight:240}),t(te,{helpMessage:se.TEST_STRING_HELP})]}),e(Z,{$gap:8,children:[t(Q,{label:se.RESULT_LABEL}),t(Ur,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(ce,{size:ue.XXS,color:de.Secondary,children:se.RESULT_CAPTURE_HINT})]})]})})});var p},Hr=q.ExtractAttribute;var jr;!function(e){e.Preset="preset",e.Regex="regex"}(jr||(jr={}));const Gr=[ve.JSON,ve.SQL,ve.ResourcePath],Wr=(e=ve.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),Kr=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,Yr=f.div`
|
|
104
104
|
width: 100%;
|
|
105
105
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
106
106
|
border-radius: 8px;
|
|
@@ -108,13 +108,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
108
108
|
display: flex;
|
|
109
109
|
flex-direction: column;
|
|
110
110
|
gap: 8px;
|
|
111
|
-
`,
|
|
111
|
+
`,Jr=f.div`
|
|
112
112
|
flex: 1;
|
|
113
113
|
min-width: 0;
|
|
114
|
-
`,
|
|
114
|
+
`,qr=f.div`
|
|
115
115
|
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
116
116
|
padding-top: 24px;
|
|
117
|
-
`,Mr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),_r=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},zr=J.UrlTemplatizationRulesGroups,Br=[{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"}],Xr=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},Vr=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,n,o]=e;return e=>{const a=null==e?.[t]?"":String(e[t]);switch(n){case"=":case"==":case"===":return a===o;case"!=":case"!==":return a!==o;default:return!0}}},Ur=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:Xr(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:Vr(t.renderCondition)}})},jr=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(Gr):void 0}})},Gr=e=>{const t="string"==typeof e.componentProperties?Te(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:Xr(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:Ur(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:jr(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(Gr):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},Hr=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Wr=e=>Array.isArray(e)?e:[],Kr=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},Yr=e=>Hr(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],Jr=({field:e,value:n,setValue:a,errorMessage:i,disabled:l})=>{const[s,c]=r(()=>Yr(n));return o(()=>{const e=Hr(n)?n:{};((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(Kr(s),e)||c(Yr(n))},[n]),t(te,{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:s,setValues:e=>{c(e),a(Kr(e))},errorMessage:i})},qr=({field:o,value:a,setValue:i,errorMessage:l,disabled:s})=>{const{name:c,componentType:d,inputType:u,title:p,tooltip:h,placeholder:m,helpMessage:g,required:f,initialValue:b,options:y,itemWrapperKey:v,columns:C,limitFieldsPerRow:S,variant:w,wrapKey:x,checkboxOptions:k}=o,[T,$]=r({open:!1,value:""});if(d===xe.CheckboxList&&"array"===o.valueMode){const n=Wr(a),o=(e,t)=>i(t?[...n.filter(t=>t!==e),e]:n.filter(t=>t!==e));return e(q,{$gap:12,children:[p&&t(Z,{label:p,tooltip:h,required:f}),t(q,{$gap:8,children:(k||[]).map(e=>{const a=t(Q,{name:e.id,label:e.label,value:n.includes(e.id),disabled:s,onChange:t=>o(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:a},e.id):a})}),t(ee,{errorMessage:l,helpMessage:g})]})}if(d===xe.CheckboxList){const n=Hr(a)?a:{},r=(e=>"emptyObject"!==e.checkedValue||{})(o),d=e=>"emptyObject"===o.checkedValue?Hr(e):!!e;return e(q,{$gap:12,children:[p&&t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:p}),t(q,{$gap:12,children:(k||[]).map(o=>{const a=n[o.id],l=d(a),u=Hr(a)?a:{},p=t(Q,{label:o.label,value:l,disabled:s,onChange:e=>i({...n,[o.id]:e?Hr(a)?a:r:null})}),h=o.tooltip?t($e,{text:o.tooltip,withIcon:!0,children:p}):p,m=l&&o.fields?.length?t(q,{$gap:12,$padding:"0 0 0 24px",children:o.fields.map(e=>t(qr,{field:e,value:u[e.name],setValue:t=>i({...n,[o.id]:{...u,[e.name]:t}}),disabled:s},`${c}-${o.id}-${e.name}`))}):null;return e(q,{$gap:12,children:[h,m]},o.id)})}),t(ee,{errorMessage:l,helpMessage:g})]})}if(d===xe.MultiTabledInput){const o=Wr(x?a?.[x]:a),r=e=>i(x?{...Hr(a)?a:{},[x]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(n,{children:[t("cards"===w?Ie:te,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,columns:C||[],limitFieldsPerRow:S,values:o,setValues:r,errorMessage:l,onTestRegex:d?e=>$({open:!0,value:e}):void 0}),d&&t(Er,{isOpen:T.open,regex:T.value,onClose:()=>$({open:!1,value:""})})]})}if(d===xe.MultiInput&&x){const e=Wr(a?.[x]);return t(ie,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,placeholder:m,values:e,setValues:e=>i({...Hr(a)?a:{},[x]:e}),errorMessage:l})}if(d===xe.MultiInput&&v){const e=Wr(a).map(e=>String(e?.[v]??""));return t(ie,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,placeholder:m,values:e,setValues:e=>i(e.map(e=>({[v]:e}))),errorMessage:l})}if(d===xe.KeyValuePair)return t(Jr,{field:o,value:a,setValue:i,errorMessage:l,disabled:s});return t(yl,{componentType:d,inputType:u,name:c,label:p,tooltip:h,helpMessage:g,disabled:s,required:f,placeholder:m,errorMessage:l,dropdownOptions:y,value:(null==a?b:a)??"",setValue:i})},Zr=({field:o,value:a,setValue:i,disabled:l})=>{const r=f(),c=Wr(a),d=c.length?c:[{}],u=o.fields||[],p=e=>i(e);return e(n,{children:[d.map((n,a)=>e(s,{children:[t(we,{}),e(q,{$gap:12,children:[e(ue,{$justifyContent:"space-between",$alignItems:"center",children:[t(Z,{label:`${o.itemLabel||o.title||"Item"} ${a+1}`}),t(pe,{leftIcon:()=>t(bi,{fill:r.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>(e=>{const t=d.filter((t,n)=>n!==e);p(t)})(a),disabled:l||1===d.length})]}),u.map(e=>t(qr,{field:e,value:n[e.name],setValue:t=>((e,t,n)=>p(d.map((o,a)=>a===e?{...o,[t]:n}:o)))(a,e.name,t),disabled:l},`${o.name}-group-${a}-${e.name}`))]})]},`${o.name}-group-${a}`)),t(pe,{variant:me.Secondary,label:o.addLabel||"Add",leftIcon:yi,onClick:()=>p([...d,{}]),disabled:l}),t(we,{})]})},Qr=({field:n,value:o,setValue:a,errorMessage:i,disabled:l})=>e(q,{$gap:12,children:[n.title&&t(Z,{label:n.title,tooltip:n.tooltip,required:n.required}),t(q,{$gap:8,children:(n.checkboxOptions||[]).map(e=>{const n=t(Q,{name:e.id,label:e.label,value:!0===o?.[e.id],disabled:l,onChange:t=>a(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:n},e.id):n})}),t(ee,{errorMessage:i,helpMessage:n.helpMessage})]}),es=({signals:e,fields:a,value:i,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(a||[]).filter(e=>!!e).map(e=>Gr(e));return o(()=>{if(!c)return;const e=i||{},t={};d.forEach(n=>{const o=(e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===xe.CheckboxList?"array"===e.valueMode?Te(t,[]):Te(t,{}):e.componentType!==xe.MultiInput&&e.componentType!==xe.MultiTabledInput||!e.wrapKey?e.componentType===xe.MultiInput||e.componentType===xe.MultiTabledInput?Te(t,[]):t:{[e.wrapKey]:Te(t,[])}})(n);if(void 0===o)return;if(n.componentType===xe.CheckboxList&&"flatFields"===n.valueMode&&Hr(o))return void Object.entries(o).forEach(([n,o])=>{void 0!==e[n]&&null!==e[n]||(t[n]=o)});const a=e[n.name];null==a&&(t[n.name]=Hr(o)&&Hr(t[n.name])?{...t[n.name],...o}:o)}),Object.entries(t).forEach(([e,t])=>l(e,t))},[]),t(n,{children:d.map(n=>{const o=Object.entries(i||{}).map(([e,t])=>({name:e,value:t}));if(!(!n.renderCondition||ke(n.renderCondition,e,o)))return null;const a=i?.[n.name];if(n.componentType===xe.FieldGroup)return t(Zr,{field:n,value:a,setValue:e=>l(n.name,e),disabled:s},n.name);if(n.componentType===xe.CheckboxList&&"flatFields"===n.valueMode){const e=n.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(Qr,{field:n,value:i||{},setValue:l,errorMessage:e,disabled:s},n.name)}return t(qr,{field:n,value:a,setValue:e=>l(n.name,e),errorMessage:r[n.name],disabled:s},n.name)})})},ts={[Ee.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(o(()=>{a[J.CollectContainerAttributes]||a[J.CollectReplicaSetAttributes]||a[J.CollectWorkloadId]||a[J.CollectClusterId]||a[J.LabelsAttributes]?.length||a[J.AnnotationsAttributes]?.length||(i(J.CollectContainerAttributes,!0),i(J.CollectReplicaSetAttributes,!0),i(J.CollectWorkloadId,!0),i(J.CollectClusterId,!0),i(J.LabelsAttributes,[]),i(J.AnnotationsAttributes,[]))},[]),e(n,{children:[t(q,{$gap:6,children:rr.map(({id:n,label:o})=>e(q,{children:[t(Q,{label:o,value:a[n]||!1,onChange:e=>i(n,e)}),t(ee,{errorMessage:l[n]})]},n))}),t(te,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:cr,values:a[J.LabelsAttributes]||[],setValues:e=>i(J.LabelsAttributes,e),errorMessage:l[J.LabelsAttributes]}),t(te,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:dr,values:a[J.AnnotationsAttributes]||[],setValues:e=>i(J.AnnotationsAttributes,e),errorMessage:l[J.AnnotationsAttributes]})]})),[Ee.AddClusterInfo]:({value:o,setValue:a,formErrors:i})=>{const l=f();return e(n,{children:[t(oe,{label:"Overwrite existing values",labelAlign:ae.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[J.OverwriteExistingValues]||!1,onChange:e=>a(J.OverwriteExistingValues,e)}),t(te,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:o[J.ClusterAttributes]||[],setValues:e=>a(J.ClusterAttributes,e),errorMessage:i[J.ClusterAttributes]})]})},[Ee.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(ie,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[J.AttributeNamesToDelete]||[],setValues:e=>n(J.AttributeNamesToDelete,e),errorMessage:o[J.AttributeNamesToDelete]}),[Ee.RenameAttributes]:({value:e,setValue:n,formErrors:a})=>{const i=e[J.Renames],[l,s]=r(()=>Mr(i));return o(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(_r(l),i||{})||s(Mr(i))},[i]),t(te,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),n(J.Renames,_r(t))},errorMessage:a[J.Renames]})},[Ee.PiiMasking]:({value:n,setValue:a,formErrors:i})=>(o(()=>{n[J.PiiCategories]?.length||a(J.PiiCategories,lr.map(({id:e})=>e))},[]),e(q,{$gap:12,children:[t(Z,{label:"Attributes to mask"}),t(q,{$gap:6,children:lr.map(({id:e,label:o})=>t(Q,{label:o,value:n[J.PiiCategories]?.includes(e)||!1,onChange:t=>{const o=n[J.PiiCategories]||[],i=t?[...o,e]:o.filter(t=>t!==e);a(J.PiiCategories,i)}},e))}),t(ee,{errorMessage:i[J.PiiCategories]})]})),[Ee.URLTemplatization]:({value:o,setValue:a,formErrors:i})=>{const l=f(),r=o[zr]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(zr,e),d=(e,t)=>c(r.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[r.map((n,o)=>e(s,{children:[t(we,{}),e(q,{$gap:12,children:[e(ue,{$justifyContent:"space-between",$alignItems:"center",children:[t(Z,{label:`Rule Group ${o+1}`}),t(pe,{leftIcon:()=>t(bi,{fill:l.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>{return e=o,c(r.filter((t,n)=>n!==e));var e},disabled:1===r.length})]}),t(Se,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(te,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Br,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(ie,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ee,{errorMessage:i[zr]})]},`url-templatization-group-${o}`)),t(pe,{variant:me.Secondary,label:"Add rule group",leftIcon:yi,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(we,{})]})},[Ee.ExtractAttribute]:({value:n,setValue:a,formErrors:i})=>{const l=f(),s=i[Ar],c=n[Ar]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(Dr)?Nr.Regex:Nr.Preset)(c)),[p,h]=r(null),m=e=>a(Ar,{extractions:e});o(()=>{0===c.length&&m([d===Nr.Preset?Rr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},b=()=>{m([...c,d===Nr.Preset?Rr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},y=d===Nr.Preset,v=c.length?c:[y?Rr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&v[p]?.regex||"";return e(q,{$gap:16,$width:"100%",children:[t(ge,{options:[{value:Nr.Preset,label:fe.SEGMENT_PRESET_LABEL,tooltip:fe.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:Nr.Regex,label:fe.SEGMENT_REGEX_LABEL,tooltip:fe.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===Nr.Preset?Rr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(q,{$gap:8,$width:"100%",children:[v.map((n,o)=>{const a=o===v.length-1,i=n.dataFormat||be.JSON,r=ve[i];return e(Pr,{"data-id":`extract-row-${o}`,children:[e(ue,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(q,{$gap:10,children:[t(Z,{label:y?fe.PRESET_ROW_TITLE(o):fe.REGEX_ROW_TITLE(o)}),y&&t(ue,{$gap:24,children:Or.map(e=>t(ye,{"data-id":`extract-row-${o}-fmt-${e}`,size:Ce.L,label:ve[e].label,value:i===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(ue,{$gap:4,$alignItems:"center",children:[!y&&t(pe,{"data-id":`extract-row-${o}-test-regex`,label:fe.TEST_REGEX_LABEL,variant:me.Secondary,size:he.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(pe,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(bi,{fill:l.v2.colors.red[500]}),variant:me.Secondary,size:he.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===Nr.Preset?Rr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),a&&t(pe,{"data-id":`extract-row-${o}-add`,leftIcon:yi,variant:me.Secondary,size:he.S,onClick:b})]})]}),y?e(ue,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Fr,{children:t(Se,{name:`extract-row-${o}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Lr,{children:t(vi,{size:24,fill:l.v2.colors.silver[200]})}),t(Fr,{children:t(Se,{name:`extract-row-${o}-targetAttributeName`,label:fe.TARGET_LABEL,placeholder:fe.TARGET_PLACEHOLDER,helpMessage:fe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(q,{$gap:12,$width:"100%",children:[t(Se,{name:`extract-row-${o}-regex`,label:fe.REGEX_LABEL,placeholder:fe.REGEX_PLACEHOLDER,helpMessage:fe.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(Se,{name:`extract-row-${o}-targetAttributeName`,label:fe.TARGET_LABEL,placeholder:fe.TARGET_PLACEHOLDER,helpMessage:fe.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(ee,{errorMessage:s})]}),t(Er,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},ns=({actionType:e,value:n,setValue:o,formErrors:a,dynamicFields:i,signals:l})=>{if(!e)return null;if(i?.length)return t(es,{fields:i,value:n,setValue:o,formErrors:a||{},signals:l||[],seedInitialValues:!0},e);const r=ts[e];return r?t(r,{value:n,setValue:o,formErrors:a}):null},os=()=>{const n=f(),{selectedOption:o,genericForm:a}=zl();if(!a||!o)return t(Ae,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(q,{$gap:24,children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(Ne,{size:de.XXXS,maxLines:2,children:o.description}),e(ue,{$gap:12,children:[t(ge,{options:[{icon:Ci,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Si,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Oe.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(pe,{leftIcon:wi,variant:me.Secondary,size:he.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(vl,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(Se,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(ns,{actionType:o.type,dynamicFields:o.fields,signals:i.signals||[],value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},as=({signals:e,fields:n,disabled:o,formData:a,handleFormChange:i,formErrors:l})=>n?.map(({renderCondition:n,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!n||ke(n,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),y=b?b.value:h;return t(yl,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:o,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:y||"",setValue:e=>i(f,e)},f)}),is=g(ue)`
|
|
117
|
+
`,Zr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Qr=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},es=q.UrlTemplatizationRulesGroups,ts=[{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"}],os=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},ns=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}}},is=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:os(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:ns(t.renderCondition)}})},as=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(ls):void 0}})},ls=e=>{const t="string"==typeof e.componentProperties?Ee(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:os(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:is(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:as(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(ls):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},rs=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),ss=e=>Array.isArray(e)?e:[],cs=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},ds=e=>rs(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],us=({field:e,value:o,setValue:n,errorMessage:a,disabled:l})=>{const[r,c]=s(()=>ds(o));return i(()=>{const e=rs(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])})(cs(r),e)||c(ds(o))},[o]),t(oe,{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(cs(e))},errorMessage:a})},ps=({field:n,value:i,setValue:a,errorMessage:l,disabled:r})=>{const{name:c,componentType:d,inputType:u,title:p,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===Te.CheckboxList&&"array"===n.valueMode){const o=ss(i),n=(e,t)=>a(t?[...o.filter(t=>t!==e),e]:o.filter(t=>t!==e));return e(Z,{$gap:12,children:[p&&t(Q,{label:p,tooltip:h,required:f}),t(Z,{$gap:8,children:(T||[]).map(e=>{const i=t(ee,{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(Ie,{text:e.tooltip,withIcon:!0,children:i},e.id):i})}),t(te,{errorMessage:l,helpMessage:g})]})}if(d===Te.CheckboxList){const o=rs(i)?i:{},s=(e=>"emptyObject"!==e.checkedValue||{})(n),d=e=>"emptyObject"===n.checkedValue?rs(e):!!e;return e(Z,{$gap:12,children:[p&&t(ce,{size:ue.XS,color:de.Secondary,nowrap:!0,children:p}),t(Z,{$gap:12,children:(T||[]).map(n=>{const i=o[n.id],l=d(i),u=rs(i)?i:{},p=t(ee,{label:n.label,value:l,disabled:r,onChange:e=>a({...o,[n.id]:e?rs(i)?i:s:null})}),h=n.tooltip?t(Ie,{text:n.tooltip,withIcon:!0,children:p}):p,m=l&&n.fields?.length?t(Z,{$gap:12,$padding:"0 0 0 24px",children:n.fields.map(e=>t(ps,{field:e,value:u[e.name],setValue:t=>a({...o,[n.id]:{...u,[e.name]:t}}),disabled:r},`${c}-${n.id}-${e.name}`))}):null;return e(Z,{$gap:12,children:[h,m]},n.id)})}),t(te,{errorMessage:l,helpMessage:g})]})}if(d===Te.MultiTabledInput){const n=ss(w?i?.[w]:i),s=e=>a(w?{...rs(i)?i:{},[w]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(o,{children:[t("cards"===x?Oe:oe,{name:c,label:p,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(Vr,{isOpen:k.open,regex:k.value,onClose:()=>E({open:!1,value:""})})]})}if(d===Te.MultiInput&&w){const e=ss(i?.[w]);return t(le,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a({...rs(i)?i:{},[w]:e}),errorMessage:l})}if(d===Te.MultiInput&&y){const e=ss(i).map(e=>String(e?.[y]??""));return t(le,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a(e.map(e=>({[y]:e}))),errorMessage:l})}if(d===Te.KeyValuePair)return t(us,{field:n,value:i,setValue:a,errorMessage:l,disabled:r});return t($l,{componentType:d,inputType:u,name:c,label:p,tooltip:h,helpMessage:g,disabled:r,required:f,placeholder:m,errorMessage:l,dropdownOptions:v,value:(null==i?b:i)??"",setValue:a})},hs=({field:n,value:i,setValue:a,disabled:l})=>{const r=b(),s=ss(i),d=s.length?s:[{}],u=n.fields||[],p=e=>a(e);return e(o,{children:[d.map((o,i)=>e(c,{children:[t(we,{}),e(Z,{$gap:12,children:[e(pe,{$justifyContent:"space-between",$alignItems:"center",children:[t(Q,{label:`${n.itemLabel||n.title||"Item"} ${i+1}`}),t(he,{leftIcon:()=>t(xa,{fill:r.v2.colors.red[500]}),variant:ge.Secondary,size:me.S,onClick:()=>(e=>{const t=d.filter((t,o)=>o!==e);p(t)})(i),disabled:l||1===d.length})]}),u.map(e=>t(ps,{field:e,value:o[e.name],setValue:t=>((e,t,o)=>p(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(he,{variant:ge.Secondary,label:n.addLabel||"Add",leftIcon:wa,onClick:()=>p([...d,{}]),disabled:l}),t(we,{})]})},ms=({field:o,value:n,setValue:i,errorMessage:a,disabled:l})=>e(Z,{$gap:12,children:[o.title&&t(Q,{label:o.title,tooltip:o.tooltip,required:o.required}),t(Z,{$gap:8,children:(o.checkboxOptions||[]).map(e=>{const o=t(ee,{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(Ie,{text:e.tooltip,withIcon:!0,children:o},e.id):o})}),t(te,{errorMessage:a,helpMessage:o.helpMessage})]}),gs=({signals:e,fields:n,value:a,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(n||[]).filter(e=>!!e).map(e=>ls(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===Te.CheckboxList?"array"===e.valueMode?Ee(t,[]):Ee(t,{}):e.componentType!==Te.MultiInput&&e.componentType!==Te.MultiTabledInput||!e.wrapKey?e.componentType===Te.MultiInput||e.componentType===Te.MultiTabledInput?Ee(t,[]):t:{[e.wrapKey]:Ee(t,[])}})(o);if(void 0===n)return;if(o.componentType===Te.CheckboxList&&"flatFields"===o.valueMode&&rs(n))return void Object.entries(n).forEach(([o,n])=>{void 0!==e[o]&&null!==e[o]||(t[o]=n)});const i=e[o.name];null==i&&(t[o.name]=rs(n)&&rs(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||ke(o.renderCondition,e,n)))return null;const i=a?.[o.name];if(o.componentType===Te.FieldGroup)return t(hs,{field:o,value:i,setValue:e=>l(o.name,e),disabled:s},o.name);if(o.componentType===Te.CheckboxList&&"flatFields"===o.valueMode){const e=o.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(ms,{field:o,value:a||{},setValue:l,errorMessage:e,disabled:s},o.name)}return t(ps,{field:o,value:i,setValue:e=>l(o.name,e),errorMessage:r[o.name],disabled:s},o.name)})})},fs={[Ne.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(Z,{$gap:6,children:xr.map(({id:o,label:i})=>e(Z,{children:[t(ee,{label:i,value:n[o]||!1,onChange:e=>a(o,e)}),t(te,{errorMessage:l[o]})]},o))}),t(oe,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Tr,values:n[q.LabelsAttributes]||[],setValues:e=>a(q.LabelsAttributes,e),errorMessage:l[q.LabelsAttributes]}),t(oe,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:kr,values:n[q.AnnotationsAttributes]||[],setValues:e=>a(q.AnnotationsAttributes,e),errorMessage:l[q.AnnotationsAttributes]})]})),[Ne.AddClusterInfo]:({value:n,setValue:i,formErrors:a})=>{const l=b();return e(o,{children:[t(ie,{label:"Overwrite existing values",labelAlign:ae.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[q.OverwriteExistingValues]||!1,onChange:e=>i(q.OverwriteExistingValues,e)}),t(oe,{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]})]})},[Ne.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(le,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[q.AttributeNamesToDelete]||[],setValues:e=>o(q.AttributeNamesToDelete,e),errorMessage:n[q.AttributeNamesToDelete]}),[Ne.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>{const a=e[q.Renames],[l,r]=s(()=>Zr(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])})(Qr(l),a||{})||r(Zr(a))},[a]),t(oe,{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,Qr(t))},errorMessage:n[q.Renames]})},[Ne.PiiMasking]:({value:o,setValue:n,formErrors:a})=>(i(()=>{o[q.PiiCategories]?.length||n(q.PiiCategories,Sr.map(({id:e})=>e))},[]),e(Z,{$gap:12,children:[t(Q,{label:"Attributes to mask"}),t(Z,{$gap:6,children:Sr.map(({id:e,label:i})=>t(ee,{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(te,{errorMessage:a[q.PiiCategories]})]})),[Ne.URLTemplatization]:({value:n,setValue:i,formErrors:a})=>{const l=b(),r=n[es]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],s=e=>i(es,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(we,{}),e(Z,{$gap:12,children:[e(pe,{$justifyContent:"space-between",$alignItems:"center",children:[t(Q,{label:`Rule Group ${n+1}`}),t(he,{leftIcon:()=>t(xa,{fill:l.v2.colors.red[500]}),variant:ge.Secondary,size:me.S,onClick:()=>{return e=n,s(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(xe,{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(oe,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ts,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(le,{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(te,{errorMessage:a[es]})]},`url-templatization-group-${n}`)),t(he,{variant:ge.Secondary,label:"Add rule group",leftIcon:wa,onClick:()=>s([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(we,{})]})},[Ne.ExtractAttribute]:({value:o,setValue:n,formErrors:a})=>{const l=b(),r=a[Hr],c=o[Hr]?.extractions||[],[d,u]=s(()=>(e=>e.length&&e.some(Kr)?jr.Regex:jr.Preset)(c)),[p,h]=s(null),m=e=>n(Hr,{extractions:e});i(()=>{0===c.length&&m([d===jr.Preset?Wr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((o,n)=>n===e?{...o,...t}:o))},f=()=>{m([...c,d===jr.Preset?Wr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===jr.Preset,y=c.length?c:[v?Wr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(Z,{$gap:16,$width:"100%",children:[t(fe,{options:[{value:jr.Preset,label:be.SEGMENT_PRESET_LABEL,tooltip:be.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:jr.Regex,label:be.SEGMENT_REGEX_LABEL,tooltip:be.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===jr.Preset?Wr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(Z,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const i=n===y.length-1,a=o.dataFormat||ve.JSON,r=Ce[a];return e(Yr,{"data-id":`extract-row-${n}`,children:[e(pe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(Z,{$gap:10,children:[t(Q,{label:v?be.PRESET_ROW_TITLE(n):be.REGEX_ROW_TITLE(n)}),v&&t(pe,{$gap:24,children:Gr.map(e=>t(ye,{"data-id":`extract-row-${n}-fmt-${e}`,size:Se.L,label:Ce[e].label,value:a===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(pe,{$gap:4,$alignItems:"center",children:[!v&&t(he,{"data-id":`extract-row-${n}-test-regex`,label:be.TEST_REGEX_LABEL,variant:ge.Secondary,size:me.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(he,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(xa,{fill:l.v2.colors.red[500]}),variant:ge.Secondary,size:me.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);m(t.length?t:[d===jr.Preset?Wr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(he,{"data-id":`extract-row-${n}-add`,leftIcon:wa,variant:ge.Secondary,size:me.S,onClick:f})]})]}),v?e(pe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Jr,{children:t(xe,{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(qr,{children:t(Ta,{size:24,fill:l.v2.colors.silver[200]})}),t(Jr,{children:t(xe,{name:`extract-row-${n}-targetAttributeName`,label:be.TARGET_LABEL,placeholder:be.TARGET_PLACEHOLDER,helpMessage:be.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(Z,{$gap:12,$width:"100%",children:[t(xe,{name:`extract-row-${n}-regex`,label:be.REGEX_LABEL,placeholder:be.REGEX_PLACEHOLDER,helpMessage:be.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(xe,{name:`extract-row-${n}-targetAttributeName`,label:be.TARGET_LABEL,placeholder:be.TARGET_PLACEHOLDER,helpMessage:be.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(te,{errorMessage:r})]}),t(Vr,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},bs=({actionType:e,value:o,setValue:n,formErrors:i,dynamicFields:a,signals:l})=>{if(!e)return null;if(a?.length)return t(gs,{fields:a,value:o,setValue:n,formErrors:i||{},signals:l||[],seedInitialValues:!0},e);const r=fs[e];return r?t(r,{value:o,setValue:n,formErrors:i}):null},vs=()=>{const o=b(),{selectedOption:n,genericForm:i}=Zl();if(!i||!n)return t($e,{title:"No active form"});const{formData:a,handleFormChange:l,formErrors:r}=i;return e(Z,{$gap:24,children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:ue.XXXS,maxLines:2,children:n.description}),e(pe,{$gap:12,children:[t(fe,{options:[{icon:ka,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Ea,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:Re.S,selected:a.disabled,setSelected:e=>l("disabled",e)}),t(he,{leftIcon:Ia,variant:ge.Secondary,size:me.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Al,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(xe,{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(bs,{actionType:n.type,dynamicFields:n.fields,signals:a.signals||[],value:a.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:a.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},ys=({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:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!o||ke(o,e,i.fields)))return null;const f=c,b=i.fields.find(e=>e.key===f),v=b?b.value:h;return t($l,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>a(f,e)},f)}),Cs=f(pe)`
|
|
118
118
|
position: sticky;
|
|
119
119
|
bottom: 4px;
|
|
120
120
|
align-self: center;
|
|
@@ -125,50 +125,50 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
125
125
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
126
126
|
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
127
127
|
z-index: 1;
|
|
128
|
-
`,ls=c(({isEdit:n},a)=>{const i=f(),{isVm:l}=v(),{destinationsApi:s}=bl(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:b}=Bl(),[y,C]=r(h?.testResult),[S,w]=r(!!h);o(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await s.testConnection(ze(u.formData));return C(e),e};return d(a,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,s]),u&&c?e(q,{$gap:24,style:{minHeight:"100%"},children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[y?y.succeeded?t(De,{status:Pe.Success,message:y.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(De,{status:Pe.Error,message:y.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(ue,{$gap:12,children:[!l&&t(ge,{options:[{icon:Ci,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Si,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:Oe.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(pe,{"data-id":"dest-form-docs",leftIcon:wi,variant:me.Secondary,size:he.S,onClick:()=>window.open(`${Fe}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(vl,{title:"This connection will monitor:",allowedSignals:_e(c.option.supportedSignals),selectedSignals:Me(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(Le.Logs),metrics:e.includes(Le.Metrics),traces:e.includes(Le.Traces),profiles:e.includes(Le.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(Se,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(as,{signals:Me(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(n=>n.key===e?{...n,value:t}:n)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!n&&e(is,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:xi,variant:me.Secondary,textColor:i.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:me.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:ki,variant:me.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:me.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(pe,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:me.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t(Ae,{title:"No active form"})});ls.displayName="AddDestinationForm";const rs=[{id:Be.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Be.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Be.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],ss=[{id:Be.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Be.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Be.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],cs=["*"],ds=[{id:Ve.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ve.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ve.DbQuery,label:"Collect DB query",tooltip:""},{id:Ve.Messaging,label:"Collect messaging",tooltip:""}],us={[Ge.Java]:[new je("","")],[Ge.Golang]:[new Ue("")]},ps={[He.CodeAttributes]:({value:i,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);o(()=>{if(!c.length&&!s){const e={[Be.FilePath]:!0,[Be.Function]:!0,[Be.LineNumber]:!0,[Be.Column]:null,[Be.Namespace]:null,[Be.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),o=Object.values(Be).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(q,{$gap:6,children:rs.map(({id:e,label:n,tooltip:o})=>t($e,{text:o,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ee,{errorMessage:s})]}),e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(q,{$gap:6,children:ss.map(({id:e,label:n,tooltip:o})=>t($e,{text:o,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ee,{errorMessage:s})]})]})},[He.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Ge.Golang]||[]).map(e=>new Ue(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Ge.Java]||[]).map(e=>new je(e.className,e.methodName)),[i]);return o(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[Ge.Golang]:us[Ge.Golang],[Ge.Java]:us[Ge.Java]})},[]),e(n,{children:[e(q,{children:[e(ue,{$gap:8,children:[t(Ti,{}),t(Z,{label:"Golang custom probes"})]}),t(te,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Ge.Golang]=e.map(e=>new Ue(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ge.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(q,{children:[e(ue,{$gap:8,children:[t($i,{}),t(Z,{label:"Java custom probes"})]}),t(te,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ge.Golang]=c,t[Ge.Java]=e.map(e=>new je(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[He.HeadersCollection]:({value:e,setValue:n,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Xe.HeaderKeys]||[],[e]),s=e=>{const t={[Xe.HeaderKeys]:e};n("headersCollection",t)};return o(()=>{r.length||l||s(cs)},[]),t(ie,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[He.PayloadCollection]:({value:n,setValue:i,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);o(()=>{if(!s.length&&!r){const e={[Ve.HttpRequest]:{},[Ve.HttpResponse]:{},[Ve.DbQuery]:{},[Ve.Messaging]:{}};i("payloadCollection",e)}},[]);return e(q,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Type of data to collect"}),t(q,{$gap:6,children:ds.map(({id:e,label:n,tooltip:o})=>t($e,{text:o,withIcon:!0,children:t(Q,{label:n,value:s.includes(e),onChange:t=>((e,t)=>{const n=t?[...s,e]:s.filter(t=>t!==e),o={[Ve.HttpRequest]:n.includes(Ve.HttpRequest)?{}:null,[Ve.HttpResponse]:n.includes(Ve.HttpResponse)?{}:null,[Ve.DbQuery]:n.includes(Ve.DbQuery)?{}:null,[Ve.Messaging]:n.includes(Ve.Messaging)?{}:null};i("payloadCollection",o)})(e,t)})},e))}),t(ee,{errorMessage:r})]})},[He.UnknownType]:null},hs=({ruleType:e,value:n,setValue:o,formErrors:a,dynamicFields:i})=>{if(!e)return null;if(i?.length)return t(es,{fields:i,value:n,setValue:o,formErrors:a||{},signals:[],seedInitialValues:!0});const l=ps[e];return l?t(l,{value:n,setValue:o,formErrors:a}):null},ms=()=>{const n=f(),{isVm:o}=v(),{selectedOption:a,genericForm:i,sourceOptions:l,namespaceOptions:r}=Xl();if(!i||!a)return t(Ae,{title:"No active form"});const{formData:s,handleFormChange:c,formErrors:d}=i;return e(q,{$gap:24,children:[e(ue,{$gap:12,$justifyContent:"space-between",children:[t(Ne,{size:de.XXXS,maxLines:2,children:a.description}),e(ue,{$gap:12,children:[t(ge,{options:[{icon:Ci,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Si,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Oe.S,selected:s.disabled,setSelected:e=>c("disabled",e)}),t(pe,{leftIcon:wi,variant:me.Secondary,size:he.S,onClick:()=>a.docsUrl&&window.open(a.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Cl,{option:a,formState:s}),e(ue,{$gap:12,children:[t(se,{size:de.XS,color:ce.Secondary,nowrap:!0,children:"Supported Languages:"}),a.supportedLanguages.map(e=>t(We,{label:Ke[e],leftIcon:Ye(e),backgroundColor:n.v2.colors.purple[900]},e))]}),!o&&t(Sl,{scopes:s.sourceScopes,onChange:e=>c("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:a.type===He.CustomInstrumentation?[]:a.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(Se,{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(hs,{ruleType:a.type,dynamicFields:a.fields,value:s,setValue:(e,t)=>c(e,t),formErrors:d}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>c("notes",e),errorMessage:d.notes})]})},gs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Vl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Je,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:qe.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:me.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:me.Secondary,onClick:o}})},fs=({autoFocus:n})=>{const{dataStreams:o}=Ze(),{genericForm:i,excludeName:l,editingName:r}=Vl(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>o.find(e=>e.name===u&&e.name!==l),[o,u,l]);return e(q,{$width:"100%",$gap:12,children:[t(Se,{name:"data-stream-name",label:qe.STREAM_NAME,placeholder:qe.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:qe.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(De,{status:Pe.Warning,message:qe.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},bs=()=>{const{selectedStreamName:e}=Ze(),{genericForm:n}=Ul();if(!n)return t(Ae,{title:"No active form"});const{formData:o,handleFormChange:a,formErrors:i}=n;return t(Se,{name:"sourceName",label:qe.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},ys=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],vs=g.div`
|
|
128
|
+
`,Ss=d(({isEdit:o},n)=>{const a=b(),{isVm:l}=C(),{destinationsApi:r}=Nl(),{activeForm:c,genericForm:d,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Ql(),[v,y]=s(h?.testResult),[S,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(Be(d.formData));return y(e),e};return u(n,()=>({testConnection:w,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,d,r]),d&&c?e(Z,{$gap:24,style:{minHeight:"100%"},children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(_e,{status:Pe.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(_e,{status:Pe.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(pe,{$gap:12,children:[!l&&t(fe,{options:[{icon:ka,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:Ea,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],size:Re.S,selected:d.formData.disabled,setSelected:e=>d.handleFormChange("disabled",e),disabled:S}),t(he,{"data-id":"dest-form-docs",leftIcon:Ia,variant:ge.Secondary,size:me.S,onClick:()=>window.open(`${Le}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(Al,{title:"This connection will monitor:",allowedSignals:ze(c.option.supportedSignals),selectedSignals:Me(d.formData.exportedSignals),setSelectedSignals:e=>d.handleFormChange("exportedSignals",{logs:e.includes(Fe.Logs),metrics:e.includes(Fe.Metrics),traces:e.includes(Fe.Traces),profiles:e.includes(Fe.Profiles)}),disabled:S,errorMessage:d.formErrors.exportedSignals}),t(xe,{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:S,errorMessage:d.formErrors.name}),t(ys,{signals:Me(d.formData.exportedSignals),fields:c.dynamicFields,disabled:S,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(Cs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(he,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Oa,variant:ge.Secondary,textColor:a.v2.colors.red[500],onClick:()=>f(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(he,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ge.Secondary,onClick:w})}),h&&t("div",S?{style:{width:"150px"},children:t(he,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Na,variant:ge.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(he,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ge.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();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(he,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ge.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($e,{title:"No active form"})});Ss.displayName="AddDestinationForm";const xs=[{id:Xe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Xe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Xe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],ws=[{id:Xe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Xe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Xe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ts=["*"],ks=[{id:Ve.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ve.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ve.DbQuery,label:"Collect DB query",tooltip:""},{id:Ve.Messaging,label:"Collect messaging",tooltip:""}],Es={[Ge.Java]:[new je("","")],[Ge.Golang]:[new He("")]},Is={[We.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={[Xe.FilePath]:!0,[Xe.Function]:!0,[Xe.LineNumber]:!0,[Xe.Column]:null,[Xe.Namespace]:null,[Xe.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Xe).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(Z,{$gap:12,children:[t(ce,{size:ue.XS,color:de.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(Z,{$gap:6,children:xs.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(ee,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(te,{errorMessage:s})]}),e(Z,{$gap:12,children:[t(ce,{size:ue.XS,color:de.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(Z,{$gap:6,children:ws.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(ee,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(te,{errorMessage:s})]})]})},[We.CustomInstrumentation]:({value:n,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(n?.customInstrumentations?.[Ge.Golang]||[]).map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=a(()=>(n?.customInstrumentations?.[Ge.Java]||[]).map(e=>new je(e.className,e.methodName)),[n]);return i(()=>{n?.customInstrumentations||s||l("customInstrumentations",{[Ge.Golang]:Es[Ge.Golang],[Ge.Java]:Es[Ge.Java]})},[]),e(o,{children:[e(Z,{children:[e(pe,{$gap:8,children:[t($a,{}),t(Q,{label:"Golang custom probes"})]}),t(oe,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Ge.Golang]=e.map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ge.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(Z,{children:[e(pe,{$gap:8,children:[t(Aa,{}),t(Q,{label:"Java custom probes"})]}),t(oe,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ge.Golang]=c,t[Ge.Java]=e.map(e=>new je(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[We.HeadersCollection]:({value:e,setValue:o,formErrors:n})=>{const l=n.headersCollection,r=a(()=>e?.headersCollection?.[Ue.HeaderKeys]||[],[e]),s=e=>{const t={[Ue.HeaderKeys]:e};o("headersCollection",t)};return i(()=>{r.length||l||s(Ts)},[]),t(le,{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})},[We.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]);i(()=>{if(!s.length&&!r){const e={[Ve.HttpRequest]:{},[Ve.HttpResponse]:{},[Ve.DbQuery]:{},[Ve.Messaging]:{}};n("payloadCollection",e)}},[]);return e(Z,{$gap:12,children:[t(ce,{size:ue.XS,color:de.Secondary,nowrap:!0,children:"Type of data to collect"}),t(Z,{$gap:6,children:ks.map(({id:e,label:o,tooltip:i})=>t(Ie,{text:i,withIcon:!0,children:t(ee,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[Ve.HttpRequest]:o.includes(Ve.HttpRequest)?{}:null,[Ve.HttpResponse]:o.includes(Ve.HttpResponse)?{}:null,[Ve.DbQuery]:o.includes(Ve.DbQuery)?{}:null,[Ve.Messaging]:o.includes(Ve.Messaging)?{}:null};n("payloadCollection",i)})(e,t)})},e))}),t(te,{errorMessage:r})]})},[We.UnknownType]:null},Os=({ruleType:e,value:o,setValue:n,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(gs,{fields:a,value:o,setValue:n,formErrors:i||{},signals:[],seedInitialValues:!0});const l=Is[e];return l?t(l,{value:o,setValue:n,formErrors:i}):null},Ns=()=>{const o=b(),{isVm:n}=C(),{selectedOption:i,genericForm:a,sourceOptions:l,namespaceOptions:r}=er();if(!a||!i)return t($e,{title:"No active form"});const{formData:s,handleFormChange:c,formErrors:d}=a;return e(Z,{$gap:24,children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:ue.XXXS,maxLines:2,children:i.description}),e(pe,{$gap:12,children:[t(fe,{options:[{icon:ka,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Ea,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:Re.S,selected:s.disabled,setSelected:e=>c("disabled",e)}),t(he,{leftIcon:Ia,variant:ge.Secondary,size:me.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Rl,{option:i,formState:s}),e(pe,{$gap:12,children:[t(ce,{size:ue.XS,color:de.Secondary,nowrap:!0,children:"Supported Languages:"}),i.supportedLanguages.map(e=>t(Ke,{label:Ye[e],leftIcon:Je(e),backgroundColor:o.v2.colors.purple[900]},e))]}),!n&&t(Dl,{scopes:s.sourceScopes,onChange:e=>c("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:i.type===We.CustomInstrumentation?[]:i.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(xe,{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(Os,{ruleType:i.type,dynamicFields:i.fields,value:s,setValue:(e,t)=>c(e,t),formErrors:d}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>c("notes",e),errorMessage:d.notes})]})},$s=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=tr();if(!e)return null;const{existingName:i,editingName:a}=e;return t(qe,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Ze.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ge.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ge.Secondary,onClick:n}})},As=({autoFocus:o})=>{const{dataStreams:n}=Qe(),{genericForm:i,excludeName:l,editingName:r}=tr(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(Z,{$width:"100%",$gap:12,children:[t(xe,{name:"data-stream-name",label:Ze.STREAM_NAME,placeholder:Ze.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Ze.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(_e,{status:Pe.Warning,message:Ze.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Rs=()=>{const{selectedStreamName:e}=Qe(),{genericForm:o}=or();if(!o)return t($e,{title:"No active form"});const{formData:n,handleFormChange:i,formErrors:a}=o;return t(xe,{name:"sourceName",label:Ze.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})},Ds=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],_s=f.div`
|
|
129
129
|
display: flex;
|
|
130
130
|
flex-direction: column;
|
|
131
131
|
gap: 24px;
|
|
132
|
-
`,
|
|
132
|
+
`,Ps=f.div`
|
|
133
133
|
display: contents;
|
|
134
134
|
& > * {
|
|
135
135
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
136
136
|
transition: opacity 0.2s ease;
|
|
137
137
|
}
|
|
138
|
-
`,
|
|
138
|
+
`,Ls=({value:e})=>{const o=b();return t(Ke,e?{status:Pe.Success,label:lt,leftIcon:ka}:{label:rt,leftIcon:Ea,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},Fs=({value:e,onChange:o})=>{const n=b(),i=a(()=>[{icon:ka,label:lt,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:Ea,label:rt,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(fe,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},Ms=()=>{const e=nr();switch(e.formType){case ir.Create:return t(zs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Fs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case ir.View:return e.data?e.isEditing?t(zs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Fs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Bs,{data:e.data,renderAction:()=>t(Ls,{value:!e.data?.rule.disabled})}):null;case ir.EditAutoNoisy:return t(Xs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:at,sectionTitle:ot,sectionSubTitle:it,presetLabel:tt,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(Fs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ir.EditAutoCostReduction:return t(Xs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:nt,sectionTitle:ot,presetLabel:tt,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(Fs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ir.EditAutoHighlyRelevant:return t(_s,{children:t(_l,{title:e.localEnabled?void 0:et,summary:e.summary,renderAction:()=>t(Fs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},zs=({category:o,formData:n,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(_s,{children:[t(Fl,{category:o,formState:n,renderAction:r}),e(Ps,{$faded:!!n.disabled,children:[t(Ml,{category:o,formState:n,onChange:i}),t(Dl,{scopes:n.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(zl,{category:o,formState:n,onChange:i}),"highlyRelevant"===o&&t(Bl,{formState:n,onChange:i}),"highlyRelevant"===o&&t(Xl,{ruleType:n.ruleType,formState:n,onChange:i}),t(Ul,{category:o,formState:n,onChange:i})]})]}),Bs=({data:o,renderAction:n})=>e(_s,{children:[t(Fl,{readOnly:!0,summary:o.summary,renderAction:n}),t(Ml,{readOnly:!0,data:o}),t(Dl,{readOnly:!0,scopes:S(o.rule.sourceScopes)}),t(zl,{readOnly:!0,data:o}),t(Ul,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(Xl,{readOnly:!0,rule:o.rule})]}),Xs=({enabled:o,summary:n,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=r(e=>p(e),[p]),y=r(e=>m(e),[m]),C=r(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(_s,{children:[t(_l,{title:o?void 0:i,summary:n,renderAction:b}),t(Ps,{$faded:!o,children:e(st,{richTitle:{title:a,subTitle:l},children:[d&&t(Z,{$alignItems:"flex-start",children:t(fe,{options:Ds,selected:u,setSelected:v})}),S&&t(Pl,{description:s,options:Ll,selected:h,onSelect:y,customName:c,customLabel:ct,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Us=f.div`
|
|
139
139
|
display: flex;
|
|
140
140
|
align-items: center;
|
|
141
141
|
justify-content: space-between;
|
|
142
142
|
gap: 12px;
|
|
143
143
|
padding: 8px 12px;
|
|
144
144
|
border-radius: 12px;
|
|
145
|
-
background-color: ${({$isSelected:e,$purpleColors:t,theme:
|
|
145
|
+
background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>e?t?o.v2.colors.purple[800]:o.v2.colors.silver[600]:t?o.v2.colors.purple[900]:"transparent"};
|
|
146
146
|
cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
|
|
147
147
|
opacity: ${({$disabled:e})=>e?.5:1};
|
|
148
148
|
&:hover {
|
|
149
|
-
background-color: ${({$isSelected:e,$purpleColors:t,theme:
|
|
149
|
+
background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>o.v2.colors[t?"purple":"silver"][e?"700":"800"]};
|
|
150
150
|
}
|
|
151
|
-
`,
|
|
151
|
+
`,Vs=f.div`
|
|
152
152
|
display: flex;
|
|
153
153
|
align-items: center;
|
|
154
154
|
justify-content: center;
|
|
155
155
|
padding: 8px;
|
|
156
156
|
border-radius: 8px;
|
|
157
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
158
|
-
`,
|
|
157
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+dt["004"]};
|
|
158
|
+
`,Hs=({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(Us,{"data-id":o||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(Z,{$gap:4,children:[e(pe,{$gap:12,children:[m&&t(ee,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),n&&t(Vs,{children:t(n,{size:20})}),t(ce,{size:ue.XS,children:i})]}),a&&t(ce,{size:ue.XXXS,color:de.Secondary,children:a})]}),(l||c)&&e(pe,{$gap:8,children:[c,l&&t(Ra,{size:18})]})]}),js=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{actionsApi:r}=Nl(),{platformType:c,version:d}=C(),[u,p]=s(""),h=l(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=Zl(),{options:v,loading:y}=r.useActionTypes(),S=a(()=>v.length?v:ut(c,d),[v,c,d]),x=a(()=>(u?S.filter(e=>e?.label?.toLowerCase().includes(u.toLowerCase())):S).filter(e=>!!e),[S,u]),w=a(()=>{if(y)return[t(pt,{$padding:"8px 12px",children:t(ht,{size:6})},"loading")];return x.map(e=>{const o=m?.type===e.type;return t(Hs,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)})},[y,m?.type,x,g]),T=a(()=>y?[t(pt,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:m?[t(vs,{},m.type)]:[t(mt,{$height:"100%",children:t($e,{icon:Da,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(Vl,{ref:h,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await r.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_ACTION,subTitle:Ze.CREATING_ACTION_SUBTITLE},header:{icon:Da,title:Ze.ADD_ACTION,subTitle:Ze.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:u,onChange:p},leftColumn:{width:"40%",list:w},rightColumn:{width:"60%",list:T}})},Gs=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(gt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=a(()=>{const e=Object.values(Fe).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(ft,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(fe,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},Ws=f.div`
|
|
159
159
|
display: flex;
|
|
160
160
|
flex-direction: column;
|
|
161
161
|
padding: 8px;
|
|
162
162
|
border-radius: 16px;
|
|
163
163
|
border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
|
|
164
|
-
background-color: ${({$noBgColor:e,$purpleColors:t,theme:
|
|
165
|
-
`,
|
|
164
|
+
background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
|
|
165
|
+
`,Ks=f.div`
|
|
166
166
|
display: flex;
|
|
167
167
|
align-items: center;
|
|
168
168
|
justify-content: space-between;
|
|
169
169
|
gap: 12px;
|
|
170
170
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
171
|
-
`,
|
|
171
|
+
`,Ys=({title:o,tooltip:n,list:i,noBgColor:a,purpleColors:l})=>{const[r,c]=s(!0);return e(Ws,{"data-id":`collapse-${o}`,$noBgColor:a,$purpleColors:l,children:[e(Ks,{$isOpen:r,children:[e(pe,{$gap:10,children:[t(ce,{size:ue.XS,children:o}),n&&t(Ie,{text:n,withIcon:!0}),t(Ke,{label:i.length,status:l?Pe.Default:void 0})]}),t(bt,{icon:r?Pa:La,size:vt.M,onClick:()=>c(e=>!e)})]}),r?t(Z,{children:i.length?p.toArray(i):t(mt,{$padding:"12px 0",children:t($e,{})})}):null]})},Js=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||ze(e.supportedSignals).includes(o.signalType))):e,qs=({option:e,formData:o,testResult:n,isSelected:i,onSelect:a})=>t(Hs,{icon:St(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:i,onClick:()=>a(),children:n&&t(Ke,{status:n.succeeded?Pe.Success:Pe.Error,leftIcon:n.succeeded?Fa:Ma})}),Zs=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:i,onChangeActiveForm:a}=Ql();return o?.length?t(Ys,{title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:o.map((o,n)=>t(qs,{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(Ys,{purpleColors:!0,title:Ct[e].TITLE,tooltip:Ct[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(qs,{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 Qs;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(Qs||(Qs={}));const ec=(e,t)=>{const o=[],n=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Qs.SELF_HOSTED?n.push(...e.items):e.name===Qs.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=xt(n),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const n=Ee(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]))}}}),{[gt.DETECTED]:o,[gt.SELF_HOSTED]:n,[gt.MANAGED]:i}},tc=({onClose:e,onBack:o,onNext:n,selectedConnectionIds:l,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=Nl(),[m,g]=s(""),[f,b]=s({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:E}=Ql();i(()=>{d&&E(d)},[d]);const I=C||x,O=a(()=>y?.destinationCategories?.categories??[],[y]),[N,$]=s({[gt.ALL]:[],[gt.UNSAVED]:[],[gt.EXISTS]:[],[gt.DETECTED]:[],[gt.SELF_HOSTED]:[],[gt.MANAGED]:[]});i(()=>{const e=v.map(e=>{let t;for(const o of O){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=Ee(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,[gt.EXISTS]:e}))},[v,O]),i(()=>{(y||S)&&$(e=>({...e,...ec(y,S)}))},[y,S]);const A=r(async()=>{for(const{option:e,formData:t}of k){const o=Be(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e])){await h.update(e.id,o);continue}}await h.create(o)}},[k,h]),R=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Ql();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(Zs,{listType:gt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(gt)){if(i.categoryType&&i.categoryType!==e)continue;const l=Js(o[e],n,i);l.length&&a.push(t(Zs,{listType:e,destinationOptions:l},e))}return e&&a.push(t(mt,{$height:"100%",children:t(yt,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:I,destinationsByCategory:N,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Ql();return{width:"60%",list:e?[t(Ss,{},e.option.type)]:[t(mt,{$height:"100%",children:t($e,{icon:_a,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Vl,{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:I,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_DESTINATION,subTitle:Ze.CREATING_DESTINATION_SUBTITLE},header:{icon:_a,title:Ze.ADD_DESTINATIONS,subTitle:Ze.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:l&&c?{value:l,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(Gs,{destinationsByCategory:N,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},oc=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{instrumentationRulesApi:r}=Nl(),[c,d]=s(""),u=l(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=er(),{options:f,loading:b}=r.useRuleTypes(),v=a(()=>f.length?f:wt,[f]),y=a(()=>c?v.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):v,[v,c]),C=a(()=>b?[t(pt,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:y.map(e=>{const o=p?.type===e.type;return t(Hs,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[b,p?.type,y,h]),S=a(()=>b?[t(pt,{$padding:"8px 12px",children:t(ht,{size:4})},"loading")]:p?[t(Ns,{},p.type)]:[t(mt,{$height:"100%",children:t($e,{icon:za,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[b,p]);return t(Vl,{ref:u,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await r.create(t,p?.type)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Ze.CREATING_INSTRUMENTATION_RULE,subTitle:Ze.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:za,title:Ze.ADD_INSTRUMENTATION_RULE,subTitle:Ze.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:S}})},nc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Ze.FETCHING_NAMESPACES,subTitle:Ze.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:Ze.SELECT_NAMESPACE,subTitle:Ze.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},ic={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Tt.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"},ac=e=>e?ic:nc,lc="No matches",rc="No sources",sc=e=>`No sources matched the filter '${e}'`,cc=e=>(e?"Unselect":"Select")+" all",dc="Show only:",uc="Selected",pc="Auto",hc="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",mc="Enterprise only",gc="Static pods can only be instrumented with Odigos Enterprise.",fc=f.div``,bc=f.div`
|
|
172
172
|
visibility: hidden;
|
|
173
173
|
|
|
174
174
|
transition: visibility 0s;
|
|
@@ -176,19 +176,433 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
176
176
|
transition-duration: 0s;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
${
|
|
179
|
+
${fc}:hover & {
|
|
180
180
|
visibility: visible;
|
|
181
181
|
}
|
|
182
|
-
`,
|
|
182
|
+
`,vc=({workloadName:e,workloadKind:o,isChecked:n,onToggle:i,disabled:a})=>{const l=b(),r=()=>{};return t(fc,{children:t(Hs,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:n,onCheckboxChange:a?r:i,children:a?t(Ie,{text:gc,children:t(Ke,{label:mc,status:Pe.Default,textSize:ue.XXXS})}):t(bc,{children:t(Ke,{label:o,status:Pe.Info,textSize:ue.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},yc=f.div``,Cc=f.div`
|
|
183
183
|
visibility: ${({$visible:e})=>e?"visible":"hidden"};
|
|
184
184
|
|
|
185
185
|
transition: visibility 0s;
|
|
186
186
|
${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
|
|
187
187
|
|
|
188
|
-
${
|
|
188
|
+
${yc}:hover & {
|
|
189
189
|
visibility: visible;
|
|
190
190
|
}
|
|
191
|
-
`,ic=({clusterId:n,namespaceName:o,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=v(),u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(oc,{children:t(As,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(ue,{$gap:12,children:[!d&&t(ac,{$visible:r||i,children:t($e,{text:Zs,children:t(oe,{label:qs,labelAlign:ae.Left,size:Tt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(ue,{$gap:8,children:[t(se,{variant:$t.Span,size:de.XXXS,color:ce.Secondary,align:"right",children:Js}),t(We,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},lc=({withCollapse:e,clusterId:n,clusterName:o,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(ic,{clusterId:n,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,o,i,l]);return e?t(Ps,{title:o,list:c,noBgColor:!0}):c},rc=({onClose:n,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=v(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=bl(),{data:f,loading:b,refetch:y}=m.useSnapshots(),{items:C,loading:S,refetch:w}=g.useNamespaces(),x=js(p),{selectedStreamName:k}=Ze(),{progress:T,resetProgress:$}=It(),{isFetching:I,setIsFetching:E,setSnapshots:A,formData:N,handleSourceChange:O,handleSelectAll:R,formDiff:D,isFormDirty:P}=Jl();o(()=>{y(),w()},[]);const F=a(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:At,clusterName:Et,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[f,C,k]);o(()=>{E(b||S),F&&A(F)},[F,b,S,E,A]);const[L,M]=r(""),[_,z]=r(xt.Namespace),[B,X]=r({showOnlySelected:!1}),[V,U]=r({clusterId:"",clusterName:"",namespaceName:""}),j=(({isFetching:n,formData:o,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=v(),h=js(p),m=a(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Kl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Yl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,u]),g=a(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:y,totalCount:C}=a(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(lc,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==a,filteredCount:n,totalCount:a}},[m,o,r]);return{width:"60%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,nowrap:!0,children:h.groupColumnHeader}),t($e,{text:b?qe.FILTERED_COUNT_TOOLTIP:void 0,children:t(We,{label:`${b?`${y} / ${C}`:C}`,status:Pe.Unknown})})]}),t(se,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:de.XS,children:Ks(g)})]}),list:f.length?f:n?[t(ht,{$height:"100%",children:t(yt,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ht,{$height:"100%",children:t(Ae,c?{icon:Li,title:Gs,subTitle:h.noGroupMatchedFilter(c)}:{icon:Li,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:V,setSelectedArea:U,searchText:_===xt.Namespace?L:"",searchBy:_,filters:B}),G=(({formData:n,handleSourceChange:o,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=v(),p=js(u),h=d===kt.Onprem,m=a(()=>l.value.namespaceName?n.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[n,l.value.clusterId,l.value.namespaceName]),g=a(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Hl(e,r,c)):[],[m,r,c]),f=a(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=a(()=>{if(!m)return[];const{clusterId:e}=l.value,{name:n}=m;return g.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Wl.has(l);return t(nc,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:a,kind:l}}),disabled:r,disabledReason:Qs},`${e}#${n}#${a}#${l}`)})},[g,m,l.value.clusterId]),{withFilterCount:y,filteredCount:C,totalCount:S}=a(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t($e,{text:y?qe.FILTERED_COUNT_TOOLTIP:void 0,children:t(We,{label:`${y?`${C} / ${S}`:S}`,status:Pe.Unknown})})]}),t(se,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:de.XS,children:Ks(f)})]}),list:b.length?b:[t(ht,{$height:"100%",children:t(Ae,m?r?{icon:Fi,title:Gs,subTitle:Ws(r)}:{icon:Fi,title:Hs,subTitle:p.noItemsInGroupSubTitle}:{icon:Fi,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:N,handleSourceChange:O,handleSelectAll:R,selectedArea:{value:V},searchText:_===xt.Source?L:"",searchBy:_,filters:B});return t(Ol,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:n?()=>{$(Nt.BulkInstrumenting),n()}:void 0,onBack:i?()=>i(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:Fi,title:qe.ADD_SOURCE,subTitle:qe.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{M(e),_===xt.Namespace&&U({clusterId:"",clusterName:"",namespaceName:""})},placeholder:x.searchPlaceholder(_),segment:{options:[{label:x.groupSegmentLabel,value:xt.Namespace},{label:x.itemSegmentLabel,value:xt.Source}],selected:_,setSelected:z}},filters:e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,nowrap:!0,children:Ys}),t(oe,{name:"filter-selected",size:Tt.S,label:Js,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:I,progress:{title:qe.CREATING_SOURCES,subTitle:qe.CREATING_SOURCES_SUBTITLE,percentage:T[Nt.BulkInstrumenting]?.percentage||0},leftColumn:j,rightColumn:G})},sc=(e,t)=>{const n=[{id:"type",title:qe.TYPE,label:t.label},{id:"status",title:qe.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?qe.DISABLED:qe.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:qe.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:qe.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:qe.NOTES,label:e.notes}),n},cc=({onClose:i,actionId:s})=>{const c=f(),{isVm:d}=v(),{actionsApi:u}=bl(),{items:p,refetch:h}=u.useActions(),{options:m}=u.useActionTypes(),{selectedOption:g,loadAction:b,validateFormData:y,genericForm:C}=zl();o(()=>{h()},[]);const[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(null),I=S&&!!C?.isFormDirty,E=a(()=>p?.find(e=>Ot(e)===s),[s,p]),A=a(()=>m.find(({type:e})=>e===E?.type)??Rt.find(({type:e})=>e===E?.type)??null,[m,E?.type]);o(()=>{E&&b(E,A)},[E,A]);const N=l(()=>{E&&w(!0)},[E]),O=l(()=>{E&&(b(E,A),w(!1))},[E,A,b]),R=l(()=>{I?$("close"):i()},[I,i]),D=l(()=>{I?$("cancel"):O()},[I,O]),P=l(()=>{const e=T;$(null),"close"===e?(O(),i()):O()},[T,O,i]),F=l(async()=>{if(E){const{errorMessage:e,preparedFormData:t}=y();e||(await u.update(E.id,t),w(!1))}},[E,y,u]),L=l(()=>{E&&k(!0)},[E]),M=l(async()=>{E&&(await u.remove(E.id,E.type),i())},[E,u,i]);if(!E||!A)return null;const _=(e=>{const t=[],{type:n,fields:o}=e,a=e=>({status:e?Pe.Success:Pe.Unknown,label:e?"True":"False",invertColors:!0});if(n===Ee.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(o.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(o.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(o.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(o.collectClusterId)}),o.labelsAttributes?.forEach(({labelKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||ne.Pod,s=(o.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:n}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),o.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:n,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||ne.Pod,s=(o.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:n}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),n===Ee.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(o.overwriteExistingValues)}),o.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:n},o)=>{t.push({id:`cluster-attr-${o}`,title:e,label:n})})),n===Ee.DeleteAttributes&&o.attributeNamesToDelete?.forEach((e,n)=>{t.push({id:`del-attr-${n}`,title:"Attribute"+((o.attributeNamesToDelete?.length??0)>1?` #${n+1}`:""),label:e})}),n===Ee.RenameAttributes&&Object.entries(o.renames||{}).forEach(([e,n],o)=>{t.push({id:`rename-${o}`,title:e,label:n})}),n===Ee.PiiMasking&&o.piiCategories?.forEach((e,n)=>{t.push({id:`pii-${n}`,title:"Category"+((o.piiCategories?.length??0)>1?` #${n+1}`:""),label:e})}),n===Ee.ExtractAttribute){const e=o.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:n,lookupKey:o,dataFormat:a,regex:i},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:n||"-"}),o&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:o}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})})}return n===Ee.URLTemplatization&&o.urlTemplatizationRulesGroups?.forEach((e,n)=>{const a=(o.urlTemplatizationRulesGroups?.length??0)>1?`Group #${n+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${n}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((o,i)=>{const l=[o.kind,o.name].filter(Boolean).join("/");l&&t.push({id:`group-${n}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${n}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${n}-notes`,title:`${a}Notes`,label:e.notes})}),t})(E);return e(n,{children:[t(le,{isOpen:!0,header:{icon:Lt(E.type),title:A.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Dt.EDIT,icon:ki,active:S,onClick:N},{id:"edit-action-btn-delete",label:Dt.DELETE,icon:bi,color:c.v2.colors.red[500],active:x,onClick:L}]},footer:{actions:S?[{"data-id":"edit-action-btn-cancel",label:Dt.CANCEL,variant:me.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Dt.SAVE,variant:me.Primary,onClick:F}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:S&&g?t(os,{}):t(q,{$gap:16,children:e(Pt,{bgTint:"1000",children:[e(Pt,{bgTint:"900",children:[!d&&t(Ft,{conditions:E.conditions||[]}),t(Pt,{bgTint:"800",cellsPerRow:2,items:sc(E,A)})]}),!!_?.length&&t(Pt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Pt,{bgTint:"800",cellsPerRow:2,items:_})})]})})})}),t(Rl,{target:"action",isOpen:x,onClose:()=>k(!1),onApprove:M}),t(Dl,{isOpen:null!==T,onClose:()=>$(null),onApprove:P})]})},dc=({onClose:n,connections:l,selectedConnectionIds:s,setSelectedConnectionIds:c})=>{const{configApi:d}=bl(),[u,p]=r(""),[h,m]=r({showOnlySelected:!1}),g=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&s.includes(e.id);return t&&n}),[l.length,s.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===s.length?s[0]:void 0,{data:y,loading:v}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&y)return{rollout:{automaticRolloutDisabled:y.rollout?.automaticRolloutDisabled??!1}}},[b,y]),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=Mt(C||{rollout:{automaticRolloutDisabled:!1}}),T=i(k);T.current=k,o(()=>{C&&T.current(C)},[C]);const $=a(()=>s.length>1||void 0!==C&&!x(C,S),[s.length,C,S]);return t(Ol,{isOpen:!0,onClose:n,onSave:async()=>await(d.applyConfigurations?.(S,s))??void 0,header:{icon:Mi,title:"Cluster Configuration"},connectionIds:{value:s,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,nowrap:!0,children:"Show only:"}),t(oe,{size:Tt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:$,isFetching:v,leftColumn:{width:"35%",header:e(ue,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(ue,{$gap:8,children:[t(se,{size:de.XS,children:"Clusters"}),t(We,{label:g.length,status:Pe.Unknown})]}),e(ue,{$gap:8,children:[t(se,{size:de.XXXS,color:ce.Secondary,align:"right",children:"Selected clusters"}),t(We,{label:`${s.length}/${g.length}`,status:Pe.Unknown})]})]}),list:g.map(e=>t(As,{title:e.name,isChecked:s.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(se,{size:de.XS,children:"Configurations"}),list:[t(oe,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},uc=e=>{const t=[{id:"type",title:qe.TYPE,label:e.destinationType.displayName},{id:"status",title:qe.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?qe.DISABLED:qe.ENABLED}}],n=Me(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:qe.MONITORS,label:n}),e.name&&t.push({id:"name",title:qe.NAME,label:e.name}),t},pc=({onClose:s,destinationId:c})=>{const d=f(),{isVm:u}=v(),{destinationsApi:p}=bl(),{selectedStreamName:h}=Ze(),{items:m,refetch:g}=p.useDestinations(),{data:b,loading:y}=p.useDestinationCategories(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Bl();o(()=>{g()},[]);const k=i(null),[T,$]=r(!1),[I,E]=r(!1),[A,N]=r(null),O=T&&!!x?.isFormDirty,R=a(()=>zt(m,h),[m,h]),D=a(()=>R?.find(e=>Ot(e)===c),[c,R]),P=b?.destinationCategories?.categories??null;o(()=>{D&&P&&S(D,P)},[D,P]);const F=a(()=>D&&P?Bt(P,D):[],[D,P]),L=l(()=>{D&&$(!0)},[D]),M=l(()=>{D&&P&&(S(D,P),$(!1))},[D,P,S]),_=l(()=>{O?N("close"):s()},[O,s]),z=l(()=>{O?N("cancel"):M()},[O,M]),B=l(()=>{const e=A;N(null),"close"===e?(M(),s()):M()},[A,M,s]),X=l(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=w();e||(await p.update(D.id,ze(t)),$(!1))}},[D,w,p]),V=l(()=>{D&&E(!0)},[D]),U=l(async()=>{D&&(await p.remove(D.id),s())},[D,p,s]);if(!D)return null;const{icon:j,iconSrc:G}=Ct(D.destinationType.type),H=((e,t)=>{const n=[],o=_t(e,t),a=o.map(e=>({name:e.key,value:e.value})),i=Me(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&ke(h,i,a))return;const{type:g}=Te(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(u===xe.MultiInput){const t=Te(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(u===xe.KeyValuePair){const t=Te(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(D,F);return e(n,{children:[t(le,{isOpen:!0,header:{icon:j,iconSrc:G,title:D.name||D.destinationType.displayName,onClose:_,actions:[{id:"edit-destination-btn-edit",label:Dt.EDIT,icon:ki,active:T,onClick:L},{id:"edit-destination-btn-delete",label:Dt.DELETE,icon:bi,color:d.v2.colors.red[500],active:I,onClick:V}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:Dt.CANCEL,variant:me.Secondary,onClick:z},...C?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:Dt.TEST_CONNECTION,variant:me.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Dt.SAVE,variant:me.Primary,onClick:X}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:y?t(ht,{$height:"50vh",children:t(yt,{withSpinner:!0})}):T&&C?t(ls,{ref:k,isEdit:!0}):t(q,{$gap:16,children:e(Pt,{bgTint:"1000",children:[e(Pt,{bgTint:"900",children:[!u&&t(Ft,{conditions:D.conditions||[]}),t(Pt,{bgTint:"800",cellsPerRow:2,items:uc(D)})]}),!!H.length&&t(Pt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:H.map(e=>"cells"===e.kind?t(Pt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Pt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Rl,{target:"destination",isOpen:I,onClose:()=>E(!1),onApprove:U}),t(Dl,{isOpen:null!==A,onClose:()=>N(null),onApprove:B})]})},hc=(e,t)=>{const n=[{id:"type",title:qe.TYPE,label:t.label},{id:"status",title:qe.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?qe.DISABLED:qe.ENABLED}}];return e.ruleName&&n.push({id:"name",title:qe.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:qe.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:qe.NOTES,label:e.notes}),n},mc=({onClose:i,ruleId:s})=>{const c=f(),{addNotification:d}=Vt(),{isVm:u}=v(),{instrumentationRulesApi:p}=bl(),{items:h,refetch:m}=p.useRules(),{selectedOption:g,loadRule:b,validateFormData:y,genericForm:C}=Xl();o(()=>{m()},[]);const[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(null),I=S&&!!C?.isFormDirty,E=a(()=>h?.find(e=>Ot(e)===s),[s,h]),A=a(()=>wt.find(({type:e})=>e===E?.type)??null,[E?.type]);o(()=>{E&&b(E)},[E]);const N=l(()=>{if(E){if(!E.mutable)return void d({type:Pe.Warning,title:Ut.FORBIDDEN,message:Ut.CANNOT_EDIT_RULE,crdType:xt.InstrumentationRule,target:E.ruleId,hideFromHistory:!0});w(!0)}},[E,d]),O=l(()=>{E&&(b(E),w(!1))},[E,b]),R=l(()=>{I?$("close"):i()},[I,i]),D=l(()=>{I?$("cancel"):O()},[I,O]),P=l(()=>{const e=T;$(null),"close"===e?(O(),i()):O()},[T,O,i]),F=l(async()=>{if(E){const{errorMessage:e,preparedFormData:t}=y();e||(await p.update(E.ruleId,t,E.type),w(!1))}},[E,y,p]),L=l(()=>{if(E){if(!E.mutable)return void d({type:Pe.Warning,title:Ut.FORBIDDEN,message:Ut.CANNOT_DELETE_RULE,crdType:xt.InstrumentationRule,target:E.ruleId,hideFromHistory:!0});k(!0)}},[E,d]),M=l(async()=>{E&&(await p.remove(E.ruleId,E.type),i())},[E,p,i]);if(!E||!A)return null;const _=((e,n)=>{const o=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,n])=>{n&&o.push(t(se,{size:de.XS,children:`• ${Xt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,n])=>{n&&o.push(t(se,{size:de.XS,children:`• ${Xt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Xe.HeaderKeys]?.length&&e.headersCollection[Xe.HeaderKeys].forEach((e,n)=>{e&&o.push(t(se,{size:de.XS,children:e},`header-${n}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ge.Java]?.forEach((e,a)=>{const i=new je(e.className,e.methodName);if(i.Verify()){0===a&&o.push(t(se,{size:de.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();o.push(t(se,{size:de.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`java-probe-${a}-${e}`))}}),e.customInstrumentations[Ge.Golang]?.forEach((e,a)=>{const i=new Ue(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&o.push(t(se,{size:de.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();o.push(t(se,{size:de.XXS,color:n.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${a}-${e}`))}})),o})(E,c);return e(n,{children:[t(le,{isOpen:!0,header:{icon:Gt(E.type),title:A.label,onClose:R,actions:[{id:"edit-rule-btn-edit",label:Dt.EDIT,icon:ki,active:S,onClick:N},{id:"edit-rule-btn-delete",label:Dt.DELETE,icon:bi,color:c.v2.colors.red[500],active:x,onClick:L}]},footer:{actions:S?[{"data-id":"edit-rule-btn-cancel",label:Dt.CANCEL,variant:me.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:Dt.SAVE,variant:me.Primary,onClick:F}]:[]},children:t(ut,{$padding:"4px 12px 12px",children:S&&g?t(ms,{}):t(q,{$gap:16,children:e(Pt,{bgTint:"1000",children:[e(Pt,{bgTint:"900",children:[!u&&t(Ft,{conditions:E.conditions||[]}),t(Pt,{bgTint:"800",cellsPerRow:2,items:hc(E,A)})]}),!u&&t(Sl,{readOnly:!0,scopes:E.sourceScopes??null}),!!_.length&&t(Pt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Pt,{bgTint:"800",children:_})}),!!A.supportedLanguages.length&&t(Pt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Pt,{bgTint:"800",children:t(ue,{$gap:12,$wrap:"wrap",children:A.supportedLanguages.map(e=>t(jt,{label:Ke[e],leftIcon:Ye(e),flex:"0.5"},e))})})})]})})})}),t(Rl,{target:"instrumentation rule",isOpen:x,onClose:()=>k(!1),onApprove:M}),t(Dl,{isOpen:null!==T,onClose:()=>$(null),onApprove:P})]})};var gc;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(gc||(gc={}));const fc=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Ht(),m=Wt(!!n),g=a(()=>({title:l,icon:_i,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Kt(c);t&&e.push(t);const n=Kt(d,zi,"health");n&&e.push(n);const o=Kt(u,Bi,"health");return o&&e.push(o),e},[c,d,u]),b=a(()=>o?[{id:`restart-pod-${l}`,icon:Xi,label:Dt.RESTART_POD,onClick:()=>o(i,l)}]:void 0,[o,i,l]),y=a(()=>[{id:"nodeName",title:qe.NODE,label:r,withCopy:!0},{id:"age",title:qe.AGE,label:s?h(s,{style:"short"}):qe.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Pt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:y,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},bc=g.div`
|
|
191
|
+
`,Sc=({clusterId:o,namespaceName:n,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=C(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(yc,{children:t(Hs,{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(pe,{$gap:12,children:[!d&&t(Cc,{$visible:r||a,children:t(Ie,{text:hc,children:t(ie,{label:pc,labelAlign:ae.Left,size:Et.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(pe,{$gap:8,children:[t(ce,{variant:It.Span,size:ue.XXXS,color:de.Secondary,align:"right",children:uc}),t(Ke,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},xc=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Sc,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(Ys,{title:n,list:c,noBgColor:!0}):c},wc=({onClose:o,onBack:n,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=C(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=Nl(),{data:f,loading:b,refetch:v}=m.useSnapshots(),{items:y,loading:S,refetch:x}=g.useNamespaces(),w=ac(p),{selectedStreamName:T}=Qe(),{progress:k,resetProgress:E}=Ot(),{isFetching:I,setIsFetching:O,setSnapshots:N,formData:$,handleSourceChange:A,handleSelectAll:R,formDiff:D,isFormDirty:_}=cr();i(()=>{v(),x()},[]);const P=a(()=>{if(f)return f;const e=y;return e.length?{clusters:[{clusterId:$t,clusterName:Nt,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(T),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,...e.id.region?{region:e.id.region}:{},selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(T)??!1)}))||[]}))}]}:null},[f,y,T]);i(()=>{O(b||S),P&&N(P)},[P,b,S,O,N]);const[L,F]=s(""),[M,z]=s(Tt.Namespace),[B,X]=s({showOnlySelected:!1}),[U,V]=s({clusterId:"",clusterName:"",namespaceName:""}),H=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=C(),h=ac(p),m=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>rr(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...sr(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),g=a(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:y}=a(()=>{const e=m.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(xc,{withCollapse:m.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null).filter(e=>null!==e),o=m.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}},[m,n,r]);return{width:"60%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(ce,{size:ue.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ie,{text:b?Ze.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ke,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ce,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:ue.XS,children:cc(g)})]}),list:f.length?f:o?[t(mt,{$height:"100%",children:t(yt,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(mt,{$height:"100%",children:t($e,c?{icon:Xa,title:lc,subTitle:h.noGroupMatchedFilter(c)}:{icon:Xa,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:U,setSelectedArea:V,searchText:M===Tt.Namespace?L:"",searchBy:M,filters:B}),j=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=C(),p=ac(u),h=d===kt.Onprem,m=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),g=a(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>ar(e,r,c)):[],[m,r,c]),f=a(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=a(()=>{if(!m)return[];const{clusterId:e}=l.value,{name:o}=m;return g.map(({name:i,selected:a,kind:l,region:r})=>{const s=!u&&!h&&lr.has(l);return t(vc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:i,kind:l,...r?{region:r}:{}}}),disabled:s},`${e}#${o}#${i}#${l}#${r??""}`)})},[g,m,l.value.clusterId]),{withFilterCount:v,filteredCount:y,totalCount:S}=a(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(ce,{size:ue.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(Ie,{text:v?Ze.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ke,{label:`${v?`${y} / ${S}`:S}`,status:Pe.Unknown})})]}),t(ce,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:ue.XS,children:cc(f)})]}),list:b.length?b:[t(mt,{$height:"100%",children:t($e,m?r?{icon:Ba,title:lc,subTitle:sc(r)}:{icon:Ba,title:rc,subTitle:p.noItemsInGroupSubTitle}:{icon:Ba,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:$,handleSourceChange:A,handleSelectAll:R,selectedArea:{value:U},searchText:M===Tt.Source?L:"",searchBy:M,filters:B});return t(Vl,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{E(At.BulkInstrumenting),o()}:void 0,onBack:n?()=>n(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!_,onSave:()=>h.persistV2(D),header:{icon:Ba,title:Ze.ADD_SOURCE,subTitle:Ze.ADD_SOURCES_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:L,onChange:e=>{F(e),M===Tt.Namespace&&V({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(M),segment:{options:[{label:w.groupSegmentLabel,value:Tt.Namespace},{label:w.itemSegmentLabel,value:Tt.Source}],selected:M,setSelected:z}},filters:e(pe,{$gap:8,children:[t(ce,{size:ue.XXXS,color:de.Secondary,nowrap:!0,children:dc}),t(ie,{name:"filter-selected",size:Et.S,label:uc,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:_,isFetching:I,progress:{title:Ze.CREATING_SOURCES,subTitle:Ze.CREATING_SOURCES_SUBTITLE,percentage:k[At.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},Tc={aws:Ua},kc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Ec=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Ic=e=>e.provider.toUpperCase(),Oc=f.div`
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
gap: 8px;
|
|
195
|
+
width: 100%;
|
|
196
|
+
padding: 8px 12px;
|
|
197
|
+
border-radius: 16px 0 0 16px;
|
|
198
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
199
|
+
`,Nc=f.button`
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
gap: 12px;
|
|
203
|
+
width: 100%;
|
|
204
|
+
padding: 12px 8px 12px 4px;
|
|
205
|
+
border: none;
|
|
206
|
+
border-radius: 8px;
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
text-align: left;
|
|
209
|
+
background-color: ${({theme:e,$selected:t})=>Boolean(t)?e.v2.colors.silver[800]:e.v2.colors.silver[900]};
|
|
210
|
+
transition: background-color 0.15s ease;
|
|
211
|
+
|
|
212
|
+
&:hover {
|
|
213
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
214
|
+
}
|
|
215
|
+
`,$c=f.div`
|
|
216
|
+
display: flex;
|
|
217
|
+
align-items: center;
|
|
218
|
+
justify-content: center;
|
|
219
|
+
width: 36px;
|
|
220
|
+
height: 36px;
|
|
221
|
+
border-radius: 8px;
|
|
222
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
223
|
+
flex-shrink: 0;
|
|
224
|
+
`,Ac=f.div`
|
|
225
|
+
display: flex;
|
|
226
|
+
flex-direction: column;
|
|
227
|
+
gap: 2px;
|
|
228
|
+
flex: 1;
|
|
229
|
+
min-width: 0;
|
|
230
|
+
`,Rc=({providers:o,selectedProvider:n,onSelect:i})=>{const a=b();return o.length?t(Oc,{children:o.map(o=>{const l=(e=>Tc[e.provider]??Va)(o),r=o.provider===n,s=(e=>{const t=e.features.find(e=>e.key===Rt.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=kc[t]??Ec(t);n.has(i)||(n.add(i),o.push(i))}return o.join(", ")})(o);return e(Nc,{type:"button",$selected:r,onClick:()=>i(o.provider),"data-id":`cloud-connector-provider-${o.provider}`,children:[t($c,{children:t(l,{size:24})}),e(Ac,{children:[t(ce,{size:ue.S,weight:400,lineHeight:"24px",color:de.Primary,children:Ic(o)}),s&&t(ce,{size:ue.XXXS,weight:400,lineHeight:"normal",color:de.Secondary,children:s})]}),t(Ra,{size:18,fill:a.v2.colors.silver[300]})]},o.provider)})}):t(ce,{size:ue.XS,color:de.Secondary,children:"No providers available."})},Dc=f.div`
|
|
231
|
+
display: flex;
|
|
232
|
+
flex-direction: column;
|
|
233
|
+
gap: 8px;
|
|
234
|
+
width: 100%;
|
|
235
|
+
padding: 8px;
|
|
236
|
+
border-radius: 12px;
|
|
237
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
238
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
239
|
+
cursor: default;
|
|
240
|
+
`,_c=f.div`
|
|
241
|
+
display: flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
gap: 4px;
|
|
244
|
+
width: 100%;
|
|
245
|
+
`,Pc=f.div`
|
|
246
|
+
flex: 1;
|
|
247
|
+
min-width: 0;
|
|
248
|
+
`,Lc=f.div`
|
|
249
|
+
width: 100%;
|
|
250
|
+
max-height: 145px;
|
|
251
|
+
overflow: auto;
|
|
252
|
+
padding: 0 12px;
|
|
253
|
+
|
|
254
|
+
scrollbar-width: thin;
|
|
255
|
+
scrollbar-color: transparent transparent;
|
|
256
|
+
|
|
257
|
+
&::-webkit-scrollbar {
|
|
258
|
+
width: 10px;
|
|
259
|
+
height: 10px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&::-webkit-scrollbar-thumb {
|
|
263
|
+
border: 2px solid transparent;
|
|
264
|
+
border-radius: 8px;
|
|
265
|
+
background-color: transparent;
|
|
266
|
+
background-clip: padding-box;
|
|
267
|
+
transition: background-color 0.2s ease;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
${Dc}:hover & {
|
|
271
|
+
scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
${Dc}:hover &::-webkit-scrollbar-thumb {
|
|
275
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
276
|
+
}
|
|
277
|
+
`,Fc=f.pre`
|
|
278
|
+
margin: 0;
|
|
279
|
+
font-family: ${({theme:e})=>e.font_family.code};
|
|
280
|
+
font-size: 12px;
|
|
281
|
+
line-height: 20px;
|
|
282
|
+
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
283
|
+
white-space: pre;
|
|
284
|
+
`,Mc=({policy:o})=>{const n=b(),{CopyButton:i}=Dt();return e(Dc,{children:[e(_c,{children:[t(Ha,{size:16,fill:n.v2.colors.silver[200]}),t(Pc,{children:t(ce,{size:ue.XXS,color:de.Primary,children:Ze.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:o,size:vt.XS})]}),t(Lc,{children:t(Fc,{children:o})})]})};var zc;!function(e){e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"}(zc||(zc={}));const Bc=[{id:zc.DiscoveryOnly,title:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[Rt.Discovery]},{id:zc.DiscoveryInstrumentation,title:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[Rt.Discovery,Rt.Instrumentation]},{id:zc.Custom,title:Ze.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:Ze.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],Xc=(e,t)=>e.features?.find(e=>e.key===t),Uc=e=>{if(!e)return[];const t=Xc(e,Rt.Discovery),o=Xc(e,Rt.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}}):[]},Vc=()=>{const e=new Set,t=[];return{out:t,add:o=>o?.forEach(o=>{o&&!e.has(o)&&(e.add(o),t.push(o))})}},Hc=(e,t,o)=>{const n=t===zc.Custom?((e,t)=>{if(!e)return[];const o=Uc(e),n=Xc(e,Rt.Discovery),i=o.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=Vc();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=Bc.find(e=>e.id===t)?.featureKeys??[],{out:n,add:i}=Vc();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)},jc=f.div`
|
|
285
|
+
width: 100%;
|
|
286
|
+
padding: 12px 16px;
|
|
287
|
+
border-radius: 12px;
|
|
288
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
289
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
290
|
+
`,Gc=f.div`
|
|
291
|
+
display: grid;
|
|
292
|
+
grid-template-columns: minmax(0, 1fr) 120px 150px;
|
|
293
|
+
align-items: center;
|
|
294
|
+
row-gap: 16px;
|
|
295
|
+
column-gap: 8px;
|
|
296
|
+
`,Wc=f.div`
|
|
297
|
+
display: flex;
|
|
298
|
+
align-items: center;
|
|
299
|
+
min-width: 0;
|
|
300
|
+
`,Kc=f(Wc)`
|
|
301
|
+
justify-content: center;
|
|
302
|
+
`,Yc={discovery:!1,instrumentation:!1},Jc=({provider:o,capabilities:i,onCapabilitiesChange:a})=>{const l=Uc(o),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(jc,{children:e(Gc,{children:[t(Wc,{children:t(ce,{size:ue.XXS,color:de.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(Kc,{children:t(ce,{size:ue.XXS,color:de.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(Kc,{children:t(ce,{size:ue.XXS,color:de.Secondary,children:Ze.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(o=>{const a=i[o.typeName]??Yc,l=void 0!==o.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(n.Fragment,{children:[t(Wc,{children:t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Primary,children:o.displayName})}),t(Kc,{children:t(ie,{name:`cloud-connector-custom-${o.typeName}-discovery`,size:Et.S,value:s,disabled:a.instrumentation,onChange:e=>r(o.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(Kc,{children:t(ie,{name:`cloud-connector-custom-${o.typeName}-instrumentation`,size:Et.S,value:a.instrumentation,disabled:!l,onChange:e=>r(o.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},o.typeName)})]})}):null},qc=f.div`
|
|
303
|
+
display: flex;
|
|
304
|
+
flex-direction: column;
|
|
305
|
+
gap: 8px;
|
|
306
|
+
flex: 1;
|
|
307
|
+
min-width: 0;
|
|
308
|
+
padding: 8px;
|
|
309
|
+
border-radius: 0 16px 16px 0;
|
|
310
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
311
|
+
`,Zc=f.div`
|
|
312
|
+
display: flex;
|
|
313
|
+
flex-direction: column;
|
|
314
|
+
gap: 8px;
|
|
315
|
+
width: 100%;
|
|
316
|
+
`,Qc=f.div`
|
|
317
|
+
display: flex;
|
|
318
|
+
align-items: center;
|
|
319
|
+
gap: 10px;
|
|
320
|
+
width: 100%;
|
|
321
|
+
padding: 4px 12px 4px 4px;
|
|
322
|
+
border-radius: 8px;
|
|
323
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
324
|
+
`,ed=f.div`
|
|
325
|
+
display: flex;
|
|
326
|
+
align-items: center;
|
|
327
|
+
justify-content: center;
|
|
328
|
+
width: 36px;
|
|
329
|
+
height: 36px;
|
|
330
|
+
border-radius: 6px;
|
|
331
|
+
flex-shrink: 0;
|
|
332
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[800]};
|
|
333
|
+
`,td=({message:o})=>{const n=b();return e(Qc,{children:[t(ed,{children:t(ja,{size:24})}),t(ce,{size:ue.XXS,color:n.v2.colors.purple[300],children:o})]})},od=({provider:o,selectedPermission:n,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(qc,{children:Bc.map(r=>{const s=r.id===n,c=r.id===zc.Custom,d=s?e(Zc,{children:[c&&t(Jc,{provider:o,capabilities:a,onCapabilitiesChange:l}),t(Mc,{policy:Hc(o,r.id,a)})]}):void 0,u=s?t(td,{message:c?Ze.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:Ze.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(_t,{"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)})}),nd=f.div`
|
|
334
|
+
display: flex;
|
|
335
|
+
flex-direction: column;
|
|
336
|
+
padding: 16px;
|
|
337
|
+
`,id=f.div`
|
|
338
|
+
display: flex;
|
|
339
|
+
flex-direction: column;
|
|
340
|
+
gap: 16px;
|
|
341
|
+
padding: 16px;
|
|
342
|
+
border-radius: 16px;
|
|
343
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
344
|
+
`,ad=f.div`
|
|
345
|
+
display: flex;
|
|
346
|
+
flex-direction: column;
|
|
347
|
+
gap: 4px;
|
|
348
|
+
`,ld=f.div`
|
|
349
|
+
display: flex;
|
|
350
|
+
align-items: stretch;
|
|
351
|
+
width: 100%;
|
|
352
|
+
`,rd=f.div`
|
|
353
|
+
display: flex;
|
|
354
|
+
flex: 0 0 40%;
|
|
355
|
+
min-width: 0;
|
|
356
|
+
`,sd=()=>{const{providers:o,genericForm:n}=dr(),[l,r]=s(!0),c=a(()=>o.find(e=>e.provider===n.formData.provider),[o,n.formData.provider]);return i(()=>{!n.formData.provider&&o.length>0&&n.handleFormChange("provider",o[0].provider)},[o,n.formData.provider,n]),i(()=>{n.formData.permission||n.handleFormChange("permission",zc.DiscoveryInstrumentation)},[n.formData.permission,n]),t(nd,{children:e(id,{children:[e(ad,{children:[t(ce,{size:ue.S,weight:500,lineHeight:"24px",color:de.Primary,children:Ze.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Secondary,children:Ze.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),l&&t(_e,{fullWidth:!0,smallIcon:!0,status:Pe.Info,message:Ze.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Pt.CLOSE,onClick:()=>r(!1)}}),e(ld,{children:[t(rd,{children:t(Rc,{providers:o,selectedProvider:n.formData.provider,onSelect:e=>n.handleFormChange("provider",e)})}),t(od,{provider:c,selectedPermission:n.formData.permission,onSelect:e=>n.handleFormChange("permission",e),capabilities:n.formData.customCapabilities,onCapabilitiesChange:e=>n.handleFormChange("customCapabilities",e)})]})]})})},cd=f.div`
|
|
357
|
+
display: flex;
|
|
358
|
+
flex-direction: column;
|
|
359
|
+
gap: 16px;
|
|
360
|
+
width: 100%;
|
|
361
|
+
padding: 12px;
|
|
362
|
+
border-radius: 8px;
|
|
363
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
364
|
+
`,dd=f.div`
|
|
365
|
+
display: flex;
|
|
366
|
+
align-items: center;
|
|
367
|
+
gap: 12px;
|
|
368
|
+
width: 100%;
|
|
369
|
+
`,ud=f.div`
|
|
370
|
+
display: flex;
|
|
371
|
+
align-items: center;
|
|
372
|
+
justify-content: center;
|
|
373
|
+
flex-shrink: 0;
|
|
374
|
+
width: 24px;
|
|
375
|
+
height: 24px;
|
|
376
|
+
border-radius: 16px;
|
|
377
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
378
|
+
`,pd=f.div`
|
|
379
|
+
display: flex;
|
|
380
|
+
flex: 1;
|
|
381
|
+
flex-direction: column;
|
|
382
|
+
gap: 2px;
|
|
383
|
+
min-width: 0;
|
|
384
|
+
`,hd=f.div`
|
|
385
|
+
display: flex;
|
|
386
|
+
flex-direction: column;
|
|
387
|
+
gap: 10px;
|
|
388
|
+
width: 100%;
|
|
389
|
+
padding-left: 32px;
|
|
390
|
+
`,md=({"data-id":o,step:n,title:i,description:a,children:l})=>e(cd,{"data-id":o,children:[e(dd,{children:[t(ud,{children:t(ce,{size:ue.XXS,weight:400,lineHeight:"20px",color:de.Primary,children:n})}),e(pd,{children:[t(ce,{size:ue.S,weight:400,lineHeight:"24px",color:de.Primary,children:i}),t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Secondary,children:a})]})]}),l&&t(hd,{children:l})]});var gd,fd;!function(e){e.AssumeRole="assume-role",e.StaticKeys="static-keys"}(gd||(gd={})),function(e){e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"}(fd||(fd={}));const bd=[{id:gd.AssumeRole,label:Ze.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:Ze.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:gd.StaticKeys,label:Ze.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:Ze.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],vd=[{id:fd.CloudFormation,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:fd.Terraform,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:fd.AwsCli,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:fd.Manual,label:Ze.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],yd={[fd.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")},[fd.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")},[fd.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")},[fd.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")}},Cd=f.div`
|
|
391
|
+
display: flex;
|
|
392
|
+
align-items: stretch;
|
|
393
|
+
gap: 10px;
|
|
394
|
+
width: 100%;
|
|
395
|
+
`,Sd=f.div`
|
|
396
|
+
display: flex;
|
|
397
|
+
flex: 2 1 0;
|
|
398
|
+
flex-direction: column;
|
|
399
|
+
gap: 12px;
|
|
400
|
+
min-width: 0;
|
|
401
|
+
padding: 12px 0;
|
|
402
|
+
`,xd=f.div`
|
|
403
|
+
display: flex;
|
|
404
|
+
flex-direction: column;
|
|
405
|
+
gap: 8px;
|
|
406
|
+
width: 100%;
|
|
407
|
+
`,wd=f.div`
|
|
408
|
+
display: flex;
|
|
409
|
+
align-items: center;
|
|
410
|
+
gap: 12px;
|
|
411
|
+
width: 100%;
|
|
412
|
+
`,Td=f.div`
|
|
413
|
+
display: flex;
|
|
414
|
+
align-items: center;
|
|
415
|
+
justify-content: center;
|
|
416
|
+
flex-shrink: 0;
|
|
417
|
+
width: 24px;
|
|
418
|
+
height: 24px;
|
|
419
|
+
border-radius: 16px;
|
|
420
|
+
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
421
|
+
`,kd=f.div`
|
|
422
|
+
display: flex;
|
|
423
|
+
flex: 3 1 0;
|
|
424
|
+
flex-direction: column;
|
|
425
|
+
min-width: 0;
|
|
426
|
+
padding: 8px;
|
|
427
|
+
border-radius: 12px;
|
|
428
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
429
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
430
|
+
`,Ed=f.div`
|
|
431
|
+
display: flex;
|
|
432
|
+
align-items: center;
|
|
433
|
+
justify-content: flex-end;
|
|
434
|
+
width: 100%;
|
|
435
|
+
`,Id=f.div`
|
|
436
|
+
flex: 1;
|
|
437
|
+
width: 100%;
|
|
438
|
+
min-height: 200px;
|
|
439
|
+
max-height: 260px;
|
|
440
|
+
overflow: auto;
|
|
441
|
+
padding: 0 12px 12px;
|
|
442
|
+
`,Od=f.pre`
|
|
443
|
+
margin: 0;
|
|
444
|
+
font-family: ${({theme:e})=>e.font_family.code};
|
|
445
|
+
font-size: 12px;
|
|
446
|
+
line-height: 20px;
|
|
447
|
+
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
448
|
+
white-space: pre;
|
|
449
|
+
`,Nd=({step:o,setupMethod:n})=>{const i=b(),{CopyButton:a}=Dt(),{description:l,steps:r,code:s}=(e=>yd[e]??yd[fd.CloudFormation])(n);return t(md,{"data-id":"cloud-connector-create-role",step:o,title:Ze.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(Cd,{children:[e(Sd,{children:[t(ce,{size:ue.XXS,weight:400,lineHeight:"20px",color:de.Primary,children:Ze.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(xd,{children:r.map((o,a)=>e(wd,{children:[t(Td,{children:t(ce,{size:ue.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(ce,{size:ue.XXS,weight:400,lineHeight:"20px",color:de.Primary,children:o})]},`${n}-step-${a}`))})]}),e(kd,{children:[t(Ed,{children:t(a,{value:s,size:vt.XS})}),t(Id,{children:t(Od,{children:s})})]})]})})},$d=f.div`
|
|
450
|
+
display: flex;
|
|
451
|
+
flex-direction: column;
|
|
452
|
+
gap: 16px;
|
|
453
|
+
width: 100%;
|
|
454
|
+
`,Ad=f.div`
|
|
455
|
+
display: flex;
|
|
456
|
+
flex-wrap: wrap;
|
|
457
|
+
gap: 24px;
|
|
458
|
+
width: 100%;
|
|
459
|
+
`,Rd=f.div`
|
|
460
|
+
display: flex;
|
|
461
|
+
flex: 1 1 calc(50% - 12px);
|
|
462
|
+
min-width: 0;
|
|
463
|
+
`,Dd=f.div`
|
|
464
|
+
display: flex;
|
|
465
|
+
width: 100%;
|
|
466
|
+
max-width: 479px;
|
|
467
|
+
`,_d=({step:o})=>{const{genericForm:n,providers:i}=dr(),{provider:l,authMethod:r,awsAccountId:s,credentials:c}=n.formData,d=a(()=>i.find(e=>e.provider===l),[i,l]),u=a(()=>((e,t)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return[];const n=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return o.baseMethods?.forEach(e=>l(n.get(e)?.fields)),l(o.fields),a})(d,r),[d,r]);return t(md,{"data-id":"cloud-connector-enter-arn",step:o,title:Ze.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:Ze.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e($d,{children:[t(Dd,{children:t(xe,{name:"cloud-connector-aws-account-id",width:"100%",label:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:Ze.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>n.handleFormChange("awsAccountId",e.target.value)})}),u.length>0&&t(Ad,{children:u.map(e=>t(Rd,{children:t(xe,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Lt.Password:Lt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:c[e.name]??"",onChange:t=>{return o=e.name,i=t.target.value,void n.handleFormChange("credentials",{...c,[o]:i});var o,i}})},e.name))})]})})},Pd=f.div`
|
|
468
|
+
display: flex;
|
|
469
|
+
flex-direction: column;
|
|
470
|
+
padding: 16px;
|
|
471
|
+
`,Ld=f.div`
|
|
472
|
+
display: flex;
|
|
473
|
+
flex-direction: column;
|
|
474
|
+
gap: 12px;
|
|
475
|
+
padding: 16px 16px 12px;
|
|
476
|
+
border-radius: 16px;
|
|
477
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
478
|
+
`,Fd=f.div`
|
|
479
|
+
display: flex;
|
|
480
|
+
align-items: center;
|
|
481
|
+
gap: 8px;
|
|
482
|
+
width: 100%;
|
|
483
|
+
`,Md=f.button`
|
|
484
|
+
display: flex;
|
|
485
|
+
align-items: center;
|
|
486
|
+
justify-content: center;
|
|
487
|
+
flex-shrink: 0;
|
|
488
|
+
width: 36px;
|
|
489
|
+
height: 36px;
|
|
490
|
+
padding: 0 8px;
|
|
491
|
+
border: none;
|
|
492
|
+
border-radius: 8px;
|
|
493
|
+
background-color: transparent;
|
|
494
|
+
cursor: pointer;
|
|
495
|
+
transition: background-color 0.15s ease;
|
|
496
|
+
|
|
497
|
+
&:hover {
|
|
498
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
499
|
+
}
|
|
500
|
+
`,zd=f.div`
|
|
501
|
+
display: flex;
|
|
502
|
+
flex: 1;
|
|
503
|
+
flex-direction: column;
|
|
504
|
+
gap: 4px;
|
|
505
|
+
min-width: 0;
|
|
506
|
+
`,Bd=f.div`
|
|
507
|
+
display: flex;
|
|
508
|
+
align-items: center;
|
|
509
|
+
gap: 4px;
|
|
510
|
+
padding: 8px 0 8px 2px;
|
|
511
|
+
`,Xd=({onBack:o})=>{const n=b(),{genericForm:a}=dr(),l=a.formData.authMethod,r=a.formData.setupMethod;i(()=>{l||a.handleFormChange("authMethod",gd.AssumeRole)},[l,a]),i(()=>{r||a.handleFormChange("setupMethod",fd.CloudFormation)},[r,a]);const s=bd.find(e=>e.id===l)?.note;return t(Pd,{children:e(Ld,{children:[e(Fd,{children:[t(Md,{"data-id":"cloud-connector-setup-back",type:"button",onClick:o,"aria-label":Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(Ga,{size:24})}),e(zd,{children:[t(ce,{size:ue.S,weight:500,lineHeight:"24px",color:de.Primary,children:Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Secondary,children:Ze.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE})]})]}),e(md,{"data-id":"cloud-connector-auth-method",step:1,title:Ze.CLOUD_CONNECTOR_AUTH_TITLE,description:Ze.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(fe,{"data-id":"cloud-connector-auth-method-segment",size:Re.S,selected:l,setSelected:e=>a.handleFormChange("authMethod",e),options:bd.map(e=>({value:e.id,label:e.label}))}),s&&e(Bd,{children:[t(Wa,{size:16,fill:n.v2.colors.silver[200]}),t(ce,{size:ue.XXXS,weight:400,lineHeight:"normal",color:de.Secondary,children:s})]})]}),t(md,{"data-id":"cloud-connector-setup-method",step:2,title:Ze.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:Ze.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(fe,{"data-id":"cloud-connector-setup-method-segment",size:Re.S,selected:r,setSelected:e=>a.handleFormChange("setupMethod",e),options:vd.map(e=>({value:e.id,label:e.label}))})}),t(Nd,{step:3,setupMethod:r}),t(_d,{step:4})]})})},Ud=f.div`
|
|
512
|
+
display: flex;
|
|
513
|
+
flex-direction: column;
|
|
514
|
+
flex: 1;
|
|
515
|
+
min-height: 0;
|
|
516
|
+
padding: 16px;
|
|
517
|
+
`,Vd=f.div`
|
|
518
|
+
display: flex;
|
|
519
|
+
flex-direction: column;
|
|
520
|
+
flex: 1;
|
|
521
|
+
min-height: 0;
|
|
522
|
+
padding: 16px;
|
|
523
|
+
border-radius: 16px;
|
|
524
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
525
|
+
`,Hd=f.div`
|
|
526
|
+
display: flex;
|
|
527
|
+
flex: 1;
|
|
528
|
+
align-items: center;
|
|
529
|
+
justify-content: center;
|
|
530
|
+
width: 100%;
|
|
531
|
+
`,jd=f.div`
|
|
532
|
+
display: flex;
|
|
533
|
+
flex-direction: column;
|
|
534
|
+
align-items: center;
|
|
535
|
+
justify-content: center;
|
|
536
|
+
gap: 12px;
|
|
537
|
+
width: 294px;
|
|
538
|
+
padding: 24px 8px;
|
|
539
|
+
border-radius: 8px;
|
|
540
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
541
|
+
`,Gd=f.div`
|
|
542
|
+
display: flex;
|
|
543
|
+
flex-direction: column;
|
|
544
|
+
align-items: center;
|
|
545
|
+
gap: 12px;
|
|
546
|
+
width: 409px;
|
|
547
|
+
padding: 16px;
|
|
548
|
+
border-radius: 12px;
|
|
549
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
550
|
+
`,Wd=f.div`
|
|
551
|
+
display: flex;
|
|
552
|
+
align-items: center;
|
|
553
|
+
justify-content: center;
|
|
554
|
+
flex-shrink: 0;
|
|
555
|
+
width: 39px;
|
|
556
|
+
height: 39px;
|
|
557
|
+
border-radius: 20px;
|
|
558
|
+
background-color: ${({theme:e})=>e.v2.colors.red[500]};
|
|
559
|
+
`,Kd=f.div`
|
|
560
|
+
display: flex;
|
|
561
|
+
align-items: flex-start;
|
|
562
|
+
gap: 8px;
|
|
563
|
+
width: 100%;
|
|
564
|
+
max-height: 112px;
|
|
565
|
+
overflow: auto;
|
|
566
|
+
padding: 12px;
|
|
567
|
+
border-radius: 8px;
|
|
568
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
569
|
+
`,Yd=f.pre`
|
|
570
|
+
flex: 1;
|
|
571
|
+
min-width: 0;
|
|
572
|
+
margin: 0;
|
|
573
|
+
font-family: ${({theme:e})=>e.font_family.code};
|
|
574
|
+
font-size: 10px;
|
|
575
|
+
line-height: 14px;
|
|
576
|
+
color: ${({theme:e})=>e.v2.colors.silver[200]};
|
|
577
|
+
white-space: pre-wrap;
|
|
578
|
+
word-break: break-word;
|
|
579
|
+
`,Jd=f.div`
|
|
580
|
+
display: flex;
|
|
581
|
+
flex-direction: column;
|
|
582
|
+
gap: 12px;
|
|
583
|
+
width: 100%;
|
|
584
|
+
`,qd=f.div`
|
|
585
|
+
display: flex;
|
|
586
|
+
flex-wrap: wrap;
|
|
587
|
+
gap: 24px;
|
|
588
|
+
padding: 0 2px;
|
|
589
|
+
`,Zd=f.div`
|
|
590
|
+
display: flex;
|
|
591
|
+
gap: 6px;
|
|
592
|
+
min-width: 0;
|
|
593
|
+
`,Qd=f.div`
|
|
594
|
+
display: flex;
|
|
595
|
+
flex-direction: column;
|
|
596
|
+
gap: 8px;
|
|
597
|
+
`,eu=f.div`
|
|
598
|
+
display: flex;
|
|
599
|
+
flex-direction: column;
|
|
600
|
+
gap: 6px;
|
|
601
|
+
padding: 12px;
|
|
602
|
+
border-radius: 12px;
|
|
603
|
+
border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
|
|
604
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
605
|
+
`,tu=({isTesting:o,error:n,result:i})=>{const l=b(),{CopyButton:r}=Dt(),s=a(()=>i?.checks.filter(e=>!e.passed)??[],[i]),c=!(o||!n&&(!i||i.success)),d=n?Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,u=n||s.map(e=>e.message).filter(Boolean).join("\n");return t(Ud,{children:t(Vd,{children:o?t(Hd,{children:t(jd,{children:t(yt,{withVisual:!0,withGradient:!0,title:Ze.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:ue.XS})})}):c?t(Hd,{children:e(Gd,{children:[t(Wd,{children:t(Ma,{size:20,fill:l.v2.colors.black[500]})}),t(ce,{size:ue.XS,weight:400,lineHeight:"20px",color:de.Primary,children:Ze.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ce,{align:"center",size:ue.XXXS,weight:400,lineHeight:"normal",color:de.Secondary,children:d}),u&&e(Kd,{children:[t(Yd,{children:u}),t(r,{value:u,size:vt.XS})]})]})}):i?e(Jd,{children:[t(Ke,{status:Pe.Success,label:Ze.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Fa,fullWidth:!0}),(i.accountId||i.identity)&&e(qd,{children:[i.accountId&&e(Zd,{children:[e(ce,{size:ue.XXS,weight:500,color:de.Secondary,children:[Ze.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ce,{size:ue.XXS,weight:400,color:de.Primary,children:i.accountId})]}),i.identity&&e(Zd,{children:[e(ce,{size:ue.XXS,weight:500,color:de.Secondary,children:[Ze.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ce,{size:ue.XXS,weight:400,color:de.Primary,children:i.identity})]})]}),i.checks.length>0&&t(Qd,{children:i.checks.map(o=>e(eu,{$passed:o.passed,children:[t(Ke,{status:o.passed?Pe.Success:Pe.Error,label:o.displayName,leftIcon:o.passed?Fa:Ma}),o.message&&t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Secondary,children:o.message}),!o.passed&&o.remediation&&t(ce,{size:ue.XXS,weight:400,lineHeight:"normal",color:de.Primary,children:o.remediation})]},o.name))})]}):t(Hd,{children:t(ce,{size:ue.XXS,weight:400,color:de.Secondary,children:Ze.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var ou;!function(e){e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"}(ou||(ou={}));const nu=ou.SelectProvider,iu=ou.Validate,au=({onClose:o,withOverlay:n,onCreateCloudConnector:i,onCreated:l})=>{const{providers:c,genericForm:d}=dr(),[u,p]=s(nu),[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=u===nu,k=u===iu,E=r(()=>{w&&!h?m(!0):(m(!1),o?.())},[w,h,o]),I=r(()=>{x(void 0),C(void 0),v(void 0),p(e=>e>nu?e-1:e)},[]),O=r(()=>{if(x(void 0),u===ou.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")}p(e=>e<iu?e+1:e)},[u,d.formData.provider,d.formData.permission]),N=r(async()=>{if(x(void 0),C(void 0),v(void 0),p(ou.Validate),!i)return;const{provider:e,permission:t,customCapabilities:o,awsAccountId:n,credentials:a,name:r}=d.formData,s=((e,t,o)=>{const n=Uc(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]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),R=a(()=>S?{status:Pe.Error,message:S}:void 0,[S]),D=a(()=>T?{"data-id":"cloud-connector-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:E,disabled:$}:{"data-id":"cloud-connector-back",label:Pt.BACK,variant:ge.Text,leftIcon:Ga,onClick:I,disabled:$},[T,E,I,$]),_=a(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Pt.RETRY,variant:ge.Primary,rightIcon:Ka,onClick:N}:void 0}return u===ou.Config?{"data-id":"cloud-connector-verify",label:Pt.VERIFY_AND_CREATE_CONNECTOR,variant:ge.Primary,onClick:N,disabled:$}:{"data-id":"cloud-connector-next",label:Pt.NEXT,variant:ge.Primary,onClick:O,disabled:$}},[k,g,A,u,N,O,$]),P=a(()=>[D,_].filter(Boolean),[D,_]);return e(re,{width:Hl,isOpen:!0,hideOverlay:!$&&!n,header:{icon:Va,title:Ze.CREATE_CLOUD_CONNECTOR,onClose:o?E:void 0,onCloseDisabled:$},footer:{note:R,actions:P},children:[u===ou.SelectProvider&&t(sd,{}),u===ou.Config&&t(Xd,{onBack:I}),u===ou.Validate&&t(tu,{isTesting:g,error:y,result:b}),t(jl,{isOpen:h,onClose:()=>m(!1),onApprove:()=>o?.()})]})},lu=(e,t)=>{const o=[{id:"type",title:Ze.TYPE,label:t.label},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?Ze.DISABLED:Ze.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:Ze.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Ze.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Ze.NOTES,label:e.notes}),o},ru=({onClose:n,actionId:l})=>{const c=b(),{isVm:d}=C(),{actionsApi:u}=Nl(),{items:p,refetch:h}=u.useActions(),{options:m}=u.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:v,genericForm:y}=Zl();i(()=>{h()},[]);const[S,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=S&&!!y?.isFormDirty,O=a(()=>p?.find(e=>Ft(e)===l),[l,p]),N=a(()=>m.find(({type:e})=>e===O?.type)??Mt.find(({type:e})=>e===O?.type)??null,[m,O?.type]);i(()=>{O&&f(O,N)},[O,N]);const $=r(()=>{O&&x(!0)},[O]),A=r(()=>{O&&(f(O,N),x(!1))},[O,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(O){const{errorMessage:e,preparedFormData:t}=v();e||(await u.update(O.id,t),x(!1))}},[O,v,u]),L=r(()=>{O&&T(!0)},[O]),F=r(async()=>{O&&(await u.remove(O.id,O.type),n())},[O,u,n]);if(!O||!N)return null;const M=(e=>{const t=[],{type:o,fields:n}=e,i=e=>({status:e?Pe.Success:Pe.Unknown,label:e?"True":"False",invertColors:!0});if(o===Ne.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||ne.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||ne.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===Ne.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===Ne.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ne.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===Ne.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ne.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===Ne.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})(O);return e(o,{children:[t(re,{isOpen:!0,header:{icon:Xt(O.type),title:N.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Pt.EDIT,icon:Na,active:S,onClick:$},{id:"edit-action-btn-delete",label:Pt.DELETE,icon:xa,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:S?[{"data-id":"edit-action-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Pt.SAVE,variant:ge.Primary,onClick:P}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:S&&g?t(vs,{}):t(Z,{$gap:16,children:e(zt,{bgTint:"1000",children:[e(zt,{bgTint:"900",children:[!d&&t(Bt,{conditions:O.conditions||[]}),t(zt,{bgTint:"800",cellsPerRow:2,items:lu(O,N)})]}),!!M?.length&&t(zt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(zt,{bgTint:"800",cellsPerRow:2,items:M})})]})})})}),t(Gl,{target:"action",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(jl,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})},su=({onClose:o,connections:n,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=Nl(),[u,p]=s(""),[h,m]=s({showOnlySelected:!1}),g=a(()=>n.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&o}),[n.length,r.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Ut(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(Vl,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:Ya,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(pe,{$gap:8,children:[t(ce,{size:ue.XXXS,color:de.Secondary,nowrap:!0,children:"Show only:"}),t(ie,{size:Et.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:y,leftColumn:{width:"35%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(ce,{size:ue.XS,children:"Clusters"}),t(Ke,{label:g.length,status:Pe.Unknown})]}),e(pe,{$gap:8,children:[t(ce,{size:ue.XXXS,color:de.Secondary,align:"right",children:"Selected clusters"}),t(Ke,{label:`${r.length}/${g.length}`,status:Pe.Unknown})]})]}),list:g.map(e=>t(Hs,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ce,{size:ue.XS,children:"Configurations"}),list:[t(ie,{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")]}})},cu=e=>{const t=[{id:"type",title:Ze.TYPE,label:e.destinationType.displayName},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}],o=Me(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:Ze.MONITORS,label:o}),e.name&&t.push({id:"name",title:Ze.NAME,label:e.name}),t},du=({onClose:n,destinationId:c})=>{const d=b(),{isVm:u}=C(),{destinationsApi:p}=Nl(),{selectedStreamName:h}=Qe(),{items:m,refetch:g}=p.useDestinations(),{data:f,loading:v}=p.useDestinationCategories(),{activeForm:y,loadDestination:S,validateFormData:x,genericForm:w}=Ql();i(()=>{g()},[]);const T=l(null),[k,E]=s(!1),[I,O]=s(!1),[N,$]=s(null),A=k&&!!w?.isFormDirty,R=a(()=>Ht(m,h),[m,h]),D=a(()=>R?.find(e=>Ft(e)===c),[c,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&S(D,_)},[D,_]);const P=a(()=>D&&_?jt(_,D):[],[D,_]),L=r(()=>{D&&E(!0)},[D]),F=r(()=>{D&&_&&(S(D,_),E(!1))},[D,_,S]),M=r(()=>{A?$("close"):n()},[A,n]),z=r(()=>{A?$("cancel"):F()},[A,F]),B=r(()=>{const e=N;$(null),"close"===e?(F(),n()):F()},[N,F,n]),X=r(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await p.update(D.id,Be(t)),E(!1))}},[D,x,p]),U=r(()=>{D&&O(!0)},[D]),V=r(async()=>{D&&(await p.remove(D.id),n())},[D,p,n]);if(!D)return null;const{icon:H,iconSrc:j}=St(D.destinationType.type),G=((e,t)=>{const o=[],n=Vt(e,t),i=n.map(e=>({name:e.key,value:e.value})),a=Me(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&&ke(h,a,i))return;const{type:g}=Ee(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===Te.MultiInput){const t=Ee(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===Te.KeyValuePair){const t=Ee(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(re,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Pt.EDIT,icon:Na,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Pt.DELETE,icon:xa,color:d.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:z},...y?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:Pt.TEST_CONNECTION,variant:ge.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Pt.SAVE,variant:ge.Primary,onClick:X}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:v?t(mt,{$height:"50vh",children:t(yt,{withSpinner:!0})}):k&&y?t(Ss,{ref:T,isEdit:!0}):t(Z,{$gap:16,children:e(zt,{bgTint:"1000",children:[e(zt,{bgTint:"900",children:[!u&&t(Bt,{conditions:D.conditions||[]}),t(zt,{bgTint:"800",cellsPerRow:2,items:cu(D)})]}),!!G.length&&t(zt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(zt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(zt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Gl,{target:"destination",isOpen:I,onClose:()=>O(!1),onApprove:V}),t(jl,{isOpen:null!==N,onClose:()=>$(null),onApprove:B})]})},uu=(e,t)=>{const o=[{id:"type",title:Ze.TYPE,label:t.label},{id:"status",title:Ze.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?Ze.DISABLED:Ze.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Ze.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Ze.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Ze.NOTES,label:e.notes}),o},pu=({onClose:n,ruleId:l})=>{const c=b(),{addNotification:d}=Wt(),{isVm:u}=C(),{instrumentationRulesApi:p}=Nl(),{items:h,refetch:m}=p.useRules(),{selectedOption:g,loadRule:f,validateFormData:v,genericForm:y}=er();i(()=>{m()},[]);const[S,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=S&&!!y?.isFormDirty,O=a(()=>h?.find(e=>Ft(e)===l),[l,h]),N=a(()=>wt.find(({type:e})=>e===O?.type)??null,[O?.type]);i(()=>{O&&f(O)},[O]);const $=r(()=>{if(O){if(!O.mutable)return void d({type:Pe.Warning,title:Kt.FORBIDDEN,message:Kt.CANNOT_EDIT_RULE,crdType:Tt.InstrumentationRule,target:O.ruleId,hideFromHistory:!0});x(!0)}},[O,d]),A=r(()=>{O&&(f(O),x(!1))},[O,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(O){const{errorMessage:e,preparedFormData:t}=v();e||(await p.update(O.ruleId,t,O.type),x(!1))}},[O,v,p]),L=r(()=>{if(O){if(!O.mutable)return void d({type:Pe.Warning,title:Kt.FORBIDDEN,message:Kt.CANNOT_DELETE_RULE,crdType:Tt.InstrumentationRule,target:O.ruleId,hideFromHistory:!0});T(!0)}},[O,d]),F=r(async()=>{O&&(await p.remove(O.ruleId,O.type),n())},[O,p,n]);if(!O||!N)return null;const M=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(ce,{size:ue.XS,children:`• ${Gt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(ce,{size:ue.XS,children:`• ${Gt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Ue.HeaderKeys]?.length&&e.headersCollection[Ue.HeaderKeys].forEach((e,o)=>{e&&n.push(t(ce,{size:ue.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ge.Java]?.forEach((e,i)=>{const a=new je(e.className,e.methodName);if(a.Verify()){0===i&&n.push(t(ce,{size:ue.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=a.toString();n.push(t(ce,{size:ue.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${i}-${e}`))}}),e.customInstrumentations[Ge.Golang]?.forEach((e,i)=>{const a=new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(a.Verify()){0===i&&n.push(t(ce,{size:ue.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=a.toString();n.push(t(ce,{size:ue.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${i}-${e}`))}})),n})(O,c);return e(o,{children:[t(re,{isOpen:!0,header:{icon:Jt(O.type),title:N.label,onClose:R,actions:[{id:"edit-rule-btn-edit",label:Pt.EDIT,icon:Na,active:S,onClick:$},{id:"edit-rule-btn-delete",label:Pt.DELETE,icon:xa,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:S?[{"data-id":"edit-rule-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:Pt.SAVE,variant:ge.Primary,onClick:P}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:S&&g?t(Ns,{}):t(Z,{$gap:16,children:e(zt,{bgTint:"1000",children:[e(zt,{bgTint:"900",children:[!u&&t(Bt,{conditions:O.conditions||[]}),t(zt,{bgTint:"800",cellsPerRow:2,items:uu(O,N)})]}),!u&&t(Dl,{readOnly:!0,scopes:O.sourceScopes??null}),!!M.length&&t(zt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(zt,{bgTint:"800",children:M})}),!!N.supportedLanguages.length&&t(zt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(zt,{bgTint:"800",children:t(pe,{$gap:12,$wrap:"wrap",children:N.supportedLanguages.map(e=>t(Yt,{label:Ye[e],leftIcon:Je(e),flex:"0.5"},e))})})})]})})})}),t(Gl,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(jl,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})};var hu;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(hu||(hu={}));const mu=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=qt(),m=Zt(!!o),g=a(()=>({title:l,icon:Ja,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Qt(c);t&&e.push(t);const o=Qt(d,qa,"health");o&&e.push(o);const n=Qt(u,Za,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ka,label:Pt.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Ze.NODE,label:r,withCopy:!0},{id:"age",title:Ze.AGE,label:s?h(s,{style:"short"}):Ze.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(zt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},gu=f.div`
|
|
192
606
|
display: flex;
|
|
193
607
|
align-items: center;
|
|
194
608
|
justify-content: space-between;
|
|
@@ -196,7 +610,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
196
610
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
197
611
|
border-radius: 12px;
|
|
198
612
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
199
|
-
`,
|
|
613
|
+
`,fu=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=oo(o?.status),r=Gt(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===eo.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===eo.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===eo.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(gu,{$noPadding:i,children:[t(to,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(pe,{$gap:8,children:[t(vu,{label:Ze.PODS,count:c}),t(vu,{label:Ze.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(vu,{label:Ze.ODIGOS_HEALTHY,icon:qa,count:u,total:c}),t(vu,{label:Ze.KUBERNETES_HEALTHY,icon:Za,count:p,total:c})]})]}):null},bu=f.div`
|
|
200
614
|
display: flex;
|
|
201
615
|
flex-direction: column;
|
|
202
616
|
justify-content: center;
|
|
@@ -207,7 +621,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
207
621
|
width: fit-content;
|
|
208
622
|
border-radius: 8px;
|
|
209
623
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
210
|
-
`,
|
|
624
|
+
`,vu=({count:o,total:n,label:i,icon:a})=>{const l=b(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(bu,{children:[e(pe,{$gap:0,$alignItems:"flex-end",children:[t(ce,{size:ue.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(ce,{size:ue.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(pe,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(ce,{size:ue.XXXS,nowrap:!0,children:i})]})]})},yu=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===no.PID)??e.identifyingAttributes?.find(({name:e})=>e===no.VPID);return t?.value??null};var Cu;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(Cu||(Cu={}));const Su=({overrideProcessNum:o,healthy:n,healthStatus:l,identifyingAttributes:r,instrumentations:c,isJumpToTarget:d})=>{const u=b(),[p,h]=s(Cu.IdentifyingAttributes),m=Zt(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Cu.IdentifyingAttributes,label:Ze.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:u.v2.colors.purple[500]},{value:Cu.InstrumentationLibraries,label:Ze.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Qa,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[r,c]);i(()=>{f&&h(f)},[f]);const y=a(()=>{switch(p){case Cu.IdentifyingAttributes:return t(Z,{children:r?.map((e,o)=>t(Eu,{label:e.name,value:e.value},`attr-${o}-${e.name}`))});case Cu.InstrumentationLibraries:return t(Z,{children:c?.map((e,o)=>t(Eu,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))});default:return null}},[p,r,c]),C=a(()=>yu({overrideProcessNum:o,identifyingAttributes:r}),[o,r]);return t("div",{ref:m,children:e(zt,{bgTint:"800",richTitle:{title:C?`${Ze.PROCESS} ${Ze.PID(C)}`:Ze.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ce,{color:n?de.Success:de.Error,size:ue.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:n?Pe.Success:Pe.Error,leftIcon:qa,label:n?Ze.HEALTHY:Ze.NOT_HEALTHY,textSize:ue.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(fe,{options:g,selected:p,setSelected:h}),!v&&y]})})},xu=f.div`
|
|
211
625
|
display: flex;
|
|
212
626
|
align-items: flex-start;
|
|
213
627
|
gap: 8px;
|
|
@@ -216,23 +630,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
216
630
|
&:hover {
|
|
217
631
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
218
632
|
}
|
|
219
|
-
`,
|
|
633
|
+
`,wu=f(ce)`
|
|
220
634
|
flex: 0 0 30%;
|
|
221
|
-
|
|
635
|
+
`,Tu=f(ce)`
|
|
222
636
|
flex: 1 1 auto;
|
|
223
637
|
min-width: 0;
|
|
224
|
-
`,
|
|
638
|
+
`,ku=f(pe)`
|
|
225
639
|
flex: 1 1 auto;
|
|
226
640
|
justify-content: flex-end;
|
|
227
641
|
min-width: 0;
|
|
228
|
-
`,
|
|
642
|
+
`,Eu=({label:o,value:n,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(xu,{children:[t(wu,{size:ue.XXS,color:de.Secondary,children:o}),n&&t(Tu,{size:ue.XXS,color:de.Primary,align:"right",children:n}),(r||i)&&e(ku,{children:[i&&t(Ke,{status:Pe.Info,label:Ze.STANDARD,textSize:ue.XXXS,invertColors:!0}),r&&t(Ke,{status:a?Pe.Success:Pe.Error,label:a?Ze.HEALTHY:Ze.NOT_HEALTHY,textSize:ue.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Iu=h(null),Ou=({value:e,children:o})=>t(Iu.Provider,{value:e,children:o}),Nu=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:Ze.CONTAINERS,titleSize:ue.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(zt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Z,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(Au,{...e,language:io(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},$u=f.div`
|
|
229
643
|
display: flex;
|
|
230
644
|
flex-direction: column;
|
|
231
645
|
gap: 12px;
|
|
232
646
|
padding: 8px 12px;
|
|
233
647
|
border-radius: 8px;
|
|
234
648
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
235
|
-
`,
|
|
649
|
+
`,Au=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=qt(),C=Zt(v),S=a(()=>({title:n,icon:o?Je(o):el,iconWithWrapper:!0}),[n,o]),x=a(()=>{const e=[],t=Qt({status:i?eo.Success:eo.Disabled,reasonEnum:i?Ze.INSTRUMENTED_WITH_DISTRO(i):Ze.UNINSTRUMENTED,message:""});t&&e.push(t);const o=Qt(h,qa,"health");o&&e.push(o);const n=Qt(m,Za,"health");return n&&e.push(n),e},[m,h,i]),w=a(()=>[{id:"runningTime",title:Ze.RUNNING_TIME,label:l?y(l,{style:"short"}):Ze.NOT_RUNNING,labelTooltip:`${Ze.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?ka:Ea,label:r?Ze.STARTED:Ze.NOT_STARTED,textSize:ue.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?ka:Ea,label:s?Ze.READY:Ze.NOT_READY,textSize:ue.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Pe.Error:Pe.Success,leftIcon:d?Ea:ka,label:d?Ze.CRASHLOOP:Ze.NO_CRASHLOOP,textSize:ue.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Ze.RESTARTS,badge:{status:c?Pe.Error:void 0,label:c||0,textSize:ue.XXXS}}],[l,y,r,s,d,c]),T=a(()=>p?Gt(u):"",[p,u]);return t("div",{ref:C,children:e(zt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t($u,{children:e(pe,{$gap:10,$alignItems:"center",children:[t(Yt,{variant:ao.Pink,leftIcon:Za,label:T}),t(ce,{size:ue.XXXS,color:de.Error,children:p})]})}),(g??[]).map((e,o)=>{const i=o+1,a=b&&(l=f,r=e,!!l?.processPid&&yu({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Su,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${n}-process-${i}`)})]})})},Ru=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:Ze.DEBUG_COMMANDS,titleSize:ue.XS}),[]),l=a(()=>[{label:Ze.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Ze.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Ze.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(zt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(lo,{bgTint:"700",label:e,value:o},e))})},Du=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=m(Iu);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===hu.Pods?l:null,s=n?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=a(()=>({title:Ze.PODS,badge:{label:s.length}}),[s.length]);return t(Z,{$gap:12,children:c?e(o,{children:[t(fu,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(zt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(mu,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(Ru,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(Nu,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(mt,{$height:"70vh",children:t($e,{title:Ze.NO_RUNNING_PODS,subTitle:Ze.NO_RUNNING_PODS_SUBTITLE})})})},_u=({source:o})=>{const n=a(()=>o.serviceName||o.id.name,[o]),{sourcesApi:i}=Nl(),{data:l,loading:r,refetch:s}=i.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(mt,r?{$height:"70vh",children:t(yt,{withSpinner:!0})}:{$height:"70vh",children:t($e,{subTitle:Ze.COULD_NOT_FETCH_PEER_SOURCES})}):e(pe,{$gap:16,$alignItems:"flex-start",children:[t(Pu,{icon:tl,title:Ze.INBOUND,subTitle:Ze.INBOUND_DESCRIPTION(n),onRefresh:s,items:c?.inbound??[]}),t(Pu,{icon:ol,title:Ze.OUTBOUND,subTitle:Ze.OUTBOUND_DESCRIPTION(n),onRefresh:s,items:c?.outbound??[]})]})},Pu=({icon:o,title:n,subTitle:i,onRefresh:l,items:r})=>{const[c,d]=s(""),u=a(()=>r.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[r,c]);return e(zt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:ue.XS,subTitle:i,subTitleSize:ue.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:ro.Button,buttonProps:{variant:ge.Secondary,size:me.S,leftIcon:Ka,onClick:l}}],children:[t(so,{value:c,onChange:d,width:"100%"}),t(co,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(mt,{$height:"50vh",children:t($e,{icon:o,title:Ze.NO_RESULTS,subTitle:Ze.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(Fu,{...e},`${n}-${e.serviceName}`)):[t(mt,{$height:"50vh",children:t($e,{icon:o,title:`No ${n} connections yet`,subTitle:n===Ze.INBOUND?Ze.NO_INBOUND_CONNECTIONS_DESCRIPTION:Ze.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Lu=f.div`
|
|
236
650
|
display: flex;
|
|
237
651
|
align-items: center;
|
|
238
652
|
justify-content: space-between;
|
|
@@ -240,15 +654,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
240
654
|
padding: 8px;
|
|
241
655
|
border-radius: 8px;
|
|
242
656
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
243
|
-
${({$withClick:e})=>e&&
|
|
657
|
+
${({$withClick:e})=>e&&v`
|
|
244
658
|
cursor: pointer;
|
|
245
659
|
&:hover {
|
|
246
660
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
247
661
|
}
|
|
248
662
|
`}
|
|
249
|
-
`,
|
|
663
|
+
`,Fu=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=uo(e=>e.drawerEntityId),{items:r}=Nl().sourcesApi.useSources(),s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(po(s))!==JSON.stringify(po(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[ho({serviceName:o,attributes:e})]}if(o?.toLowerCase()===yr)return[nl];const e=s?mo(s):void 0;return e?.length?e:[el]},[n,i,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=uo.getState();e(Tt.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(Lu,{onClick:u,$withClick:!!u,children:[e(pe,{$gap:8,children:[t(go,{icons:d}),t(ce,{size:ue.XXS,children:o})]}),n&&t(Ke,{status:Pe.Info,label:Ze.VIRTUAL,textSize:ue.XXXS,invertColors:!0,tooltip:Ze.VIRTUAL_TOOLTIP})]})},Mu=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}},zu=({source:o})=>{const n=b(),{k8sManifestApi:l}=Nl(),[r,c]=s(!0),[d,u]=s(void 0),[p,h]=s(!0),[m,g]=s(void 0);i(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>u(Mu(e))).finally(()=>c(!1)),l.fetch({namespace:o.id.namespace,kind:fo.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>g(Mu(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const f=a(()=>[{label:Ze.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:Ze.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:Ze.GET_POD_YAML,value:`kubectl get ${fo.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(zt,{bgTint:"1000",children:[t(zt,{bgTint:"900",richTitle:{icon:il,title:Ze.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:f.map(({label:e,value:o},n)=>t(lo,{label:e,value:o},`debug-cmd-${n}-${e}`))}),r?t(ht,{size:1}):t(Wl,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(ht,{size:1}):t(Wl,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},Bu=({title:o,children:n})=>e(Z,{$gap:8,children:[t(ce,{size:ue.XXXS,color:de.Secondary,children:o}),n]}),Xu=({source:o})=>{const n=a(()=>{const[e,t]=bo(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(Bu,{title:Ze.THROUGHPUT_LAST_10_SECONDS,children:e(pe,{$alignItems:"flex-end",$gap:4,children:[t(ce,{size:ue.L,children:n.value}),t(ce,{size:ue.XS,variant:It.Span,children:n.units})]})})},Uu=({source:o})=>{const{CopyButton:n}=Dt();return t(Bu,{title:Ze.NAMESPACE,children:e(pe,{children:[t(Yt,{variant:ao.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:vt.XS})]})})},Vu=({source:e})=>t(Bu,{title:Ze.KIND,children:t(pe,{children:t(Yt,{variant:ao.Blue,label:e.id.kind})})}),Hu=({source:o})=>{const{CopyButton:n}=Dt();return t(Bu,{title:Ze.NAME,children:e(pe,{children:[t(Yt,{variant:ao.Blue,label:o.id.name}),t(n,{value:o.id.name,size:vt.XS})]})})},ju=({source:o})=>{const{isVm:n}=C();return t(zt,{children:e(pe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!n&&t(Xu,{source:o}),!n&&t(Uu,{source:o}),t(Vu,{source:o}),t(Hu,{source:o})]})})},Gu=({source:e})=>e.pods?.length?t(zt,{bgTint:"900",children:t(fu,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,Wu=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?vo(e.workloadOdigosHealthStatus.status):Pe.Unknown,title:Gt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(to,{...o,width:"100%"}):null},Ku="calc(50% - 6px)",Yu=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:i}=o.conditions?.rollout||{},a=oo(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollout")?Gt(t):`${Ze.ROLLOUT} ${Gt(t)}`,subTitle:i,action:a!==Pe.Success?{icon:Ka,tooltip:Ze.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),r=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=oo(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Gt(t):`${Ze.ROLLBACK} ${Gt(t)}`,subTitle:n,action:a!==Pe.Success?{icon:Ka,tooltip:Ze.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||r?e(pe,{$gap:12,$alignItems:"stretch",children:[l&&t(to,{invertColors:!0,slim:!0,width:r?Ku:"100%",...l}),r&&t(to,{invertColors:!0,slim:!0,width:Ku,...r})]}):null},Ju=h(null),qu=f.div`
|
|
250
664
|
position: relative;
|
|
251
|
-
`,
|
|
665
|
+
`,Zu=({children:e})=>{const o=l(null);return t(qu,{ref:o,children:t(Ju.Provider,{value:o,children:e})})},Qu=f.div`
|
|
252
666
|
position: fixed;
|
|
253
667
|
top: ${({$coords:e})=>e.top}px;
|
|
254
668
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -262,14 +676,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
262
676
|
padding: 12px 16px;
|
|
263
677
|
border-radius: 12px;
|
|
264
678
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
265
|
-
`,
|
|
679
|
+
`,ep=f.div`
|
|
266
680
|
display: flex;
|
|
267
681
|
align-items: flex-end;
|
|
268
682
|
justify-content: space-between;
|
|
269
683
|
gap: 8px;
|
|
270
|
-
`,
|
|
684
|
+
`,tp=f.div`
|
|
271
685
|
flex: 1;
|
|
272
|
-
`,
|
|
686
|
+
`,op=({width:o,onClose:n,onSave:i,saveTooltip:a,onDelete:l,deleteTooltip:r,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:h})=>{const f=b(),v=m(Ju),[y,C]=s(null);return yo(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Cr(e(Qu,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(Z,{$gap:4,children:[t(ce,{size:ue.XXS,children:c}),t(ce,{size:ue.XXXS,color:de.Secondary,children:d})]}),e(ep,{children:[t(tp,{children:p}),e(pe,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(he,{variant:ge.Secondary,onClick:l,leftIcon:xa,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:me.S,textColor:f.v2.colors.red[500]}),t(he,{variant:ge.Primary,onClick:i,leftIcon:Fa,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:me.S})]})]}),t("div",{children:t(_e,{status:Pe.Warning,message:u})})]}),document.body):null},np=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:r}=C(),{formData:c,handleFormChange:d,resetFormData:u}=Ut(l),p=a(()=>{if(!o)return[];const e=Co[o].community,t=r===kt.Onprem?Co[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,r]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(pe,{$gap:4,$alignItems:"center",children:[n?t(Ke,{status:Pe.Info,invertColors:!0,label:Ze.OVERIDDEN}):null,e(Zu,{children:[t(Ie,{text:Ze.OVERRIDE_OTEL_DISTRO_NAME,children:t(bt,{icon:Na,onClick:b})}),g&&t(op,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(c),m(!1),b()},saveTooltip:Ze.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:Ze.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Ze.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Ze.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Ze.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(ft,{label:Ze.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},ip=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:r}=Wt(),{formData:c,handleFormChange:d,resetFormData:u}=Ut(i),p=a(()=>So.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(pe,{children:[o?t(Ke,{status:Pe.Info,invertColors:!0,label:Ze.OVERIDDEN}):null,e(Zu,{children:[t(Ie,{text:Ze.OVERRIDE_RUNTIME_DETAILS,children:t(bt,{icon:Na,onClick:b})}),g&&t(op,{width:"500px",onClose:b,onSave:async()=>{!c.version||xo(c.version)?(m(!0),await n(c),m(!1),b()):r({type:Pe.Warning,message:Kt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Ze.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:Ze.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Ze.OVERRIDE_RUNTIME_DETAILS,subTitle:Ze.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Ze.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(pe,{$gap:8,children:[t(ft,{label:Ze.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(xe,{label:Ze.RUNTIME_VERSION,placeholder:Ze.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},ap=({source:e})=>{const{isVm:o}=C(),{containers:n,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?Ze.DETECTED_PROCESSES:`${e.id.kind} ${Ze.CONTAINERS}`,tooltip:t?.message||(o?Ze.DETECTED_PROCESSES_DESCRIPTION:Ze.DETECTED_CONTAINERS_DESCRIPTION),badge:oo(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(zt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Z,{$gap:8,children:n.map(o=>o&&t(cp,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},lp=f.div`
|
|
273
687
|
display: flex;
|
|
274
688
|
flex-direction: column;
|
|
275
689
|
align-self: stretch;
|
|
@@ -277,26 +691,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
277
691
|
padding: 8px 12px;
|
|
278
692
|
border-radius: 8px;
|
|
279
693
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
280
|
-
`,
|
|
694
|
+
`,rp=f.div`
|
|
281
695
|
display: flex;
|
|
282
696
|
align-items: center;
|
|
283
697
|
justify-content: center;
|
|
284
698
|
padding: 8px;
|
|
285
699
|
border-radius: 10px;
|
|
286
700
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
287
|
-
`,
|
|
701
|
+
`,sp=f.div`
|
|
288
702
|
display: flex;
|
|
289
703
|
flex-direction: column;
|
|
290
704
|
gap: 12px;
|
|
291
705
|
padding: 8px 12px;
|
|
292
706
|
border-radius: 8px;
|
|
293
707
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
294
|
-
`,
|
|
708
|
+
`,cp=({sourceId:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=b(),{sourcesApi:d}=Nl(),u=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),p=a(()=>({language:io(n),version:wo(n)||void 0}),[n]),h=a(()=>!!s?.otelDistroName,[s]),m=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!u,[l,u]),f=a(()=>g?el:Je(p.language),[g,p]),v=a(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),y=a(()=>g?{status:Pe.Loading,label:Ze.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Pe.Success:Pe.Disabled,leftIcon:r?.otelDistroName?ka:Ea,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(o,{containerName:i,...h?m:{},...u?p:{},...e}),S=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Ze.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Ze.TAIL_SAMPLING),e},[n]);return e(lp,{children:[e(pe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(pe,{$gap:8,$alignItems:"center",children:[t(rp,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ce,{children:i}),t(Yt,v?{variant:ao.Blue,label:v}:{variant:ao.Loader,label:Ze.DETECTING_RUNTIME_INFO}),t(ip,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(pe,{$gap:8,$alignItems:"center",children:[t(Ke,{...y,textSize:ue.XXXS}),t(np,{language:p.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(sp,{children:e(pe,{$gap:10,$alignItems:"center",children:[t(Yt,{variant:ao.Pink,label:Gt(r.agentEnabledStatus?.reasonEnum)||Ze.NO_AVAILABLE_AGENT}),t(ce,{size:ue.XXXS,color:de.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(sp,{children:t(pe,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(Ke,{label:e,leftIcon:ka,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${o}`))})})]})},dp=({source:o,onClickRollout:n,onClickRollback:i})=>{const{isVm:a}=C();return e(Z,{$gap:12,children:[t(ju,{source:o}),t(Wu,{source:o}),!a&&t(Yu,{source:o,onClickRollout:n,onClickRollback:i}),!a&&t(ap,{source:o}),!a&&t(Gu,{source:o})]})},up=f(Z)`
|
|
295
709
|
width: 100%;
|
|
296
710
|
max-height: 320px;
|
|
297
711
|
overflow-y: auto;
|
|
298
712
|
gap: 8px;
|
|
299
|
-
`,
|
|
713
|
+
`,pp=f(pe)`
|
|
300
714
|
width: 100%;
|
|
301
715
|
align-items: center;
|
|
302
716
|
gap: 8px;
|
|
@@ -306,14 +720,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
306
720
|
& > * {
|
|
307
721
|
font-family: monospace !important;
|
|
308
722
|
}
|
|
309
|
-
`,gd=({pendingModify:n,onClose:o,onConfirm:a})=>{const i=f();return t(Je,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:o,denyButton:{variant:me.Secondary,label:"Cancel",onClick:o},approveButton:{variant:me.Primary,label:"Confirm",onClick:a},children:n&&e(hd,{children:[n.add.map(n=>e(md,{children:[t(We,{leftIcon:yi,status:Pe.Success,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:de.XXS}),t(se,{size:de.XS,color:ce.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(md,{children:[t(We,{leftIcon:Ki,status:Pe.Error,useSecondaryTone:!0,textColor:i.v2.colors.white[500],textSize:de.XXS}),t(se,{size:de.XS,color:ce.Primary,children:n})]},`remove-${n}`))]})})};function fd(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function bd(e){const t=Math.abs(e);return t>=1e9?`${yd(e/1e9)}s`:t>=1e6?`${yd(e/1e6)}ms`:t>=1e3?`${yd(e/1e3)}μs`:String(Math.round(e))}function yd(e){return e.toFixed(2).replace(/\.?0+$/,"")}function vd(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let a=0;for(let e=0;e+3<o.length;e+=4){const i=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=a+i;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function Cd(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Sd(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=n;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){a.push(e);break}}return a}function wd(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function xd(e,t,n,o,a,i={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=i,d=c??vd(e);let u=l?Sd(d,l):d;if(0===u.length)return null;if(r&&(u=u.filter(t=>r(fd(e,t.nameIndex))),0===u.length))return null;if(s&&(u=function(e,t){if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const a=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const i=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&fd(e,l.nameIndex)===fd(e,t.nameIndex)&&a.add(Cd(l))}if(0===a.size)return n;const i=[];for(const e of n){if(a.has(Cd(e)))continue;let t=0;for(let n=0;n<e.level;n++){const i=o.get(n);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Cd(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),y=a.trim(),v=b>8?1:0;return u.map(n=>{const o=n.level-p,a=(n.offset-h)/m*t,i=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-v,1),s=fd(e,n.nameIndex);return{...n,x:a,y:l,w:i,h:r,name:s,matchesSearch:wd(s,y)}})}function kd(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return a[n%a.length]}var Td,$d;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Td||(Td={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}($d||($d={}));function Id(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ed(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function Ad(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Nd=({flamebearer:n,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:b,onResetZoom:y})=>{const v=f(),C=i(null),S=i(null),w=i({x:0,y:0}),x=i(n.numTicks),[k,T]=r({w:0,h:0}),[$,I]=r(""),[E,A]=r(null),[N,O]=r([]),[R,D]=r(!1),[P,F]=r(Td.Fit),[L,M]=r($d.Fit),[_,z]=r(!1),B=Math.max(1,Math.min(Math.floor(k.w*P),8192)),X=Math.max(1,Math.min(Math.floor(k.h*L),8192)),V=N.length>0?N[N.length-1]:null,U=V?.size??n.numTicks,j=a(()=>vd(n),[n]);o(()=>{x.current!==n.numTicks&&(x.current=n.numTicks,O([]))},[n.numTicks]),o(()=>{if(!b)return;if(!V)return void b(null);const e=Sd(j,V),t=new Set;for(const o of e){const e=fd(n,o.nameIndex);e&&t.add(e)}b([...t])},[V,n,j,b]),m(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(!R)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[R]),o(()=>(p?.(R),()=>{R&&p?.(!1)}),[R,p]);const G=a(()=>xd(n,B,X,s,c,{zoomRoot:V,shouldKeepName:d,collapseRecursive:_,allRects:j}),[n,s,c,X,B,V,d,_,j]),H=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(G?.length?c.trim()?G.filter(e=>e.matchesSearch):G:[]),[G,c]),W=l(e=>{if(B<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=Ed((e.clientX-t.left)/t.width*B,(e.clientY-t.top)/t.height*X,H);if(o){const e=Cd(o);A(e);const t=U>0?(100*o.size/U).toFixed(1):"0",a=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${bd(o.size)} (${t}% of view, ${a}% of profile) · self ${bd(o.self)}`)}else A(null),I("")},[H,n.numTicks,X,B,U]),K=l(e=>{W(e)},[W]),Y=l(()=>{A(null),I("")},[]),J=l(e=>{w.current={x:e.clientX,y:e.clientY}},[]),q=l(e=>{const{x:t,y:n}=w.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(B<2||X<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const a=Ed((e.clientX-o.left)/o.width*B,(e.clientY-o.top)/o.height*X,H);if(!a)return;g?.(a.name);const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[H,X,B,g]);m(()=>{const e=S.current;if(!e||B<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(B,X),a=Math.min(t,16384/o);e.width=Math.floor(B*a),e.height=Math.floor(X*a),e.style.width=`${B}px`,e.style.height=`${X}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,B,X),G?.length?function(e,t,n,o,a,i,l,r){const s=i.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:a,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=kd(s,i);e.fillStyle=p,e.fillRect(n,o,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+a-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(a-1,0),Math.max(l-1,0));const m=Id(d,r),g=`${s} (${bd(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,y=5,v=26,C=Math.min(f,Math.floor(l-2));if(a>=v&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*y;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*y&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+y,o+l/2),e.fillStyle=h,e.fillText(t,n+y,o+l/2))}}if(l)for(const t of o){if(Cd(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,B,X,G,c,v,E,n.numTicks):(i.fillStyle=v.v2.colors.silver[900],i.fillRect(0,0,B,X)))},[G,n.numTicks,E,c,X,B,v]);const Z=l(()=>D(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ee=a(()=>function(e,t,n){const o=n??vd(e),a=t?.offset??0,i=a+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<a||e.offset+e.size>i||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(n,V,j),[n,V,j]),te=null!==ee,ne=N.length>0,ie=V?fd(n,V.nameIndex):"",le=l(()=>{O([]),y?.()},[y]),re=l(()=>O(e=>e.slice(0,-1)),[]),fe=l(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:R?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:v.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(ue,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(oe,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:ae.Left,size:Tt.S,value:_,onChange:z}),e(ue,{$gap:8,children:[e(ue,{children:[t(pe,{variant:me.Secondary,size:he.S,label:"Reset zoom",leftIcon:Yi,onClick:le,disabled:!N.length}),t(pe,{variant:me.Secondary,size:he.S,iconSize:20,leftIcon:Ki,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ne,onClick:re}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(se,{size:de.XXS,color:ce.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(pe,{variant:me.Secondary,size:he.S,iconSize:20,leftIcon:yi,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:fe})]}),e(ue,{children:[t($e,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ge,{variant:Cn.Filled,options:[{value:Td.Fit,label:"W: Fit"},{value:Td.X10,label:"10x"}],selected:P,setSelected:F})}),t($e,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ge,{variant:Cn.Filled,options:[{value:$d.Fit,label:"H: Fit"},{value:$d.X10,label:"10x"}],selected:L,setSelected:M})})]}),t(pe,{variant:me.Secondary,size:he.S,iconSize:24,leftIcon:R?Di:Ji,tooltip:R?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t($e,{fullWidth:!0,keepAlive:!0,text:$,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:R?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:P>1?"auto":"hidden",overflowY:L>1?"auto":"hidden"},children:t("div",{style:{width:B||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(ue,{$justifyContent:"space-between",children:[t(se,V?{size:de.XXXS,color:v.v2.colors.silver[300],children:`Zoomed: ${ie} • ${bd(U)} samples in view`}:{size:de.XXXS,color:v.v2.colors.silver[300],children:g?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(se,{size:de.XXXS,color:v.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Ad(h.totalBytesUsed)} / ${Ad(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Od=[Sn.Go,Sn.Java],Rd="Profiling Symbols";function Dd(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:function(e){return e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Sn.Go:e.includes(" ")||e.includes("(")?Sn.Java:Sn.Go}(e);if(n===Sn.Go){const t=function(e){let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const a=t.slice(0,o),i=t.slice(o+1);if(!a||!i)return null;const l=i.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Ue(a,"",l[1],l[2]);return e.Verify()?e:null}const r=new Ue(a,i);return r.Verify()?r:null}(e);return t?{language:n,golang:t}:null}if(n===Sn.Java){const t=function(e){let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const o=t.split(/\s+/);t=o[o.length-1]??"";const a=t.lastIndexOf(".");if(-1===a)return null;const i=t.slice(0,a),l=t.slice(a+1),r=new je(i,l);return r.Verify()?r:null}(e);return t?{language:n,java:t}:null}return null}function Pd(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function Fd(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:a=[],languages:i=[]}=e,l=!o.length||o.some(e=>Pd(e,t.id)),r=!a.length||a.includes(t.id.namespace),s=!i.length||null==n||i.includes(n);return l&&r&&s}function Ld(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Md(e,t){return e.className===t.className&&e.methodName===t.methodName}function _d(e,t,n,o){const a=Dd(e,n);if(!a)return[];const i=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!Fd(e.sourceScopes,t,a.language))continue;const o=!!a.golang&&!!n[Ge.Golang]?.some(e=>Ld(e,a.golang)),l=!!a.java&&!!n[Ge.Java]?.some(e=>Md(e,a.java));(o||l)&&i.push({rule:e,resolved:a})}return i}function zd({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:i}=bl(),{items:s}=o.useRules(),[c,d]=r(new Set),[u,p]=r(new Set),[h,m]=r(null),g=a(()=>function(e){const t=new Set(e??[]);return Od.filter(e=>t.has(e))}(t),[t]),f=i.canCreateInstrumentationRule,b=a(()=>function(e,t){const n=e.filter(e=>e.type===He.CustomInstrumentation&&e.ruleName===Rd&&Fd(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>Pd(e,t.id)))??n[0]??null}(s,e),[s,e]),y=f&&g.length>0,v=a(()=>{const t=new Map;for(const o of n){const n=!!Dd(o.name,g),a=_d(o.name,e,g,s),i=!!b&&a.some(e=>e.rule.ruleId===b.ruleId),l=a.filter(e=>e.rule.ruleId!==b?.ruleId),r=!i&&l.length>0,c=y&&n,d=r;let u;if(r){const e=[...new Set(l.map(e=>e.rule.ruleName))];u=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let p=!1,h="Add this symbol to the “Profiling Symbols” rule";r?h=u??"Managed by another rule":0===a.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(o.name,{parsable:n,inManagedRule:i,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[n,s,e,g,f,y,b]),C=a(()=>{const e=new Set;return v.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[v]),S=a(()=>[...c].filter(e=>v.get(e)?.addEnabled&&!C.has(e)),[c,v,C]),w=a(()=>[...u].filter(e=>C.has(e)),[u,C]),x=S.length+w.length,k=l(e=>{const t=v.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[v,u,c]),T=l((e,t)=>{const n=v.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?p(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):d(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[v]),$=l(()=>{d(new Set),p(new Set)},[]),I=l(t=>{(async()=>{const n=t.add.map(e=>Dd(e,g)).filter(e=>!!e),a=t.remove.map(e=>Dd(e,g)).filter(e=>!!e);if(b){const{customInstrumentations:e,isEmpty:t}=function(e,t,n){const o=e.customInstrumentations??{};let a=[...o[Ge.Golang]??[]],i=[...o[Ge.Java]??[]];for(const e of n)e.golang&&(a=a.filter(t=>!Ld(t,e.golang))),e.java&&(i=i.filter(t=>!Md(t,e.java)));for(const e of t)e.golang&&!a.some(t=>Ld(t,e.golang))&&a.push(e.golang),e.java&&!i.some(t=>Md(t,e.java))&&i.push(e.java);return{customInstrumentations:{[Ge.Golang]:a,[Ge.Java]:i},isEmpty:0===a.length&&0===i.length}}(b,n,a);t?await o.remove(b.ruleId,He.CustomInstrumentation):await o.update(b.ruleId,function(e,t){return{ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}}(b,e),He.CustomInstrumentation)}else n.length>0&&await o.create(function(e,t){const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),a={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:Rd,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:a,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ge.Golang]:n,[Ge.Java]:o}}}(n,e),He.CustomInstrumentation)})()},[b,g,e,o]),E=l(()=>{x&&m({add:S,remove:w})},[x,S,w]),A=l(e=>m({add:[e],remove:[]}),[]),N=l(e=>m({add:[],remove:[e]}),[]),O=l(()=>m(null),[]),R=l(()=>{h&&(I(h),m(null),$())},[h,I,$]),D=l(e=>v.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[v]);return{instrumentation:a(()=>({getSymbolState:D,onAdd:A,onRemove:N,selectionEnabled:y,isSelected:k,onToggleSymbol:T}),[D,A,N,y,k,T]),pendingCount:x,pendingModify:h,closeModify:O,openBulkModify:E,resetSelection:$,confirmModify:R}}var Bd,Xd,Vd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Bd||(Bd={})),function(e){e.OnlyInstrumentable="only-instrumentable"}(Xd||(Xd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Vd||(Vd={}));const Ud=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function jd(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Vd.FilterOutVoid)&&"void"===n)return!1;if(t.includes(Vd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&Ud.test(n)))return!1}return!0}const Gd=({rows:e,languages:n,instrumentation:o,searchQuery:i,filters:r,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!n?.includes(Sn.Java),h=a(()=>{const t=c?new Set(c):null,n=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,i,c]),m=a(()=>{const e=[];if(o.selectionEnabled&&e.push({id:Xd.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:Vd.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:Vd.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===Bd.Symbol)?.rawValue?.toString()??"";return!(t.includes(Xd.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&jd(n,t)}}},[o,p]),g=a(()=>[{key:Bd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Bd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Bd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:Bd.Symbol,rawValue:e.name},{key:Bd.Self,rawValue:bd(e.self)},{key:Bd.Total,rawValue:bd(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=l(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),a=[];return n.inManagedRule?a.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:bi,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):a.push({id:`add-instrumentation-${t}`,label:"",leftIcon:yi,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),a.push({id:`copy-${t}`,label:"",leftIcon:qi,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),a},[o]);return t(wn,{variant:xn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:r,onFiltersChange:s,activeRowId:d,scrollSignal:u,getRowActions:b})};var Hd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Hd||(Hd={}));const Wd=g(q)`
|
|
723
|
+
`,hp=({pendingModify:o,onClose:n,onConfirm:i})=>{const a=b();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:ge.Secondary,label:"Cancel",onClick:n},approveButton:{variant:ge.Primary,label:"Confirm",onClick:i},children:o&&e(up,{children:[o.add.map(o=>e(pp,{children:[t(Ke,{leftIcon:wa,status:Pe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:ue.XXS}),t(ce,{size:ue.XS,color:de.Primary,children:o})]},`add-${o}`)),o.remove.map(o=>e(pp,{children:[t(Ke,{leftIcon:al,status:Pe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:ue.XXS}),t(ce,{size:ue.XS,color:de.Primary,children:o})]},`remove-${o}`))]})})};function mp(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 gp(e){const t=Math.abs(e);return t>=1e9?`${fp(e/1e9)}s`:t>=1e6?`${fp(e/1e6)}ms`:t>=1e3?`${fp(e/1e3)}μs`:String(Math.round(e))}function fp(e){return e.toFixed(2).replace(/\.?0+$/,"")}function bp(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 vp(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function yp(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 Cp(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Sp(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??bp(e);let u=l?yp(d,l):d;if(0===u.length)return null;if(r&&(u=u.filter(t=>r(mp(e,t.nameIndex))),0===u.length))return null;if(s&&(u=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const 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&&mp(e,l.nameIndex)===mp(e,t.nameIndex)&&i.add(vp(l))}if(0===i.size)return o;const a=[];for(const e of o){if(i.has(vp(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(vp(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=mp(e,o.nameIndex);return{...o,x:i,y:l,w:a,h:r,name:s,matchesSearch:Cp(s,v)}})}function xp(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 wp,Tp;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(wp||(wp={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Tp||(Tp={}));function kp(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ep(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 Ip(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Op=({flamebearer:o,maxRowPx:n,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:v})=>{const y=b(),C=l(null),S=l(null),x=l({x:0,y:0}),w=l(o.numTicks),[T,k]=s({w:0,h:0}),[E,I]=s(""),[O,N]=s(null),[$,A]=s([]),[R,D]=s(!1),[_,P]=s(wp.Fit),[L,F]=s(Tp.Fit),[M,z]=s(!1),B=Math.max(1,Math.min(Math.floor(T.w*_),8192)),X=Math.max(1,Math.min(Math.floor(T.h*L),8192)),U=$.length>0?$[$.length-1]:null,V=U?.size??o.numTicks,H=a(()=>bp(o),[o]);i(()=>{w.current!==o.numTicks&&(w.current=o.numTicks,A([]))},[o.numTicks]),i(()=>{if(!f)return;if(!U)return void f(null);const e=yp(H,U),t=new Set;for(const n of e){const e=mp(o,n.nameIndex);e&&t.add(e)}f([...t])},[U,o,H,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();k({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),i(()=>{if(!R)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[R]),i(()=>(p?.(R),()=>{R&&p?.(!1)}),[R,p]);const j=a(()=>Sp(o,B,X,n,c,{zoomRoot:U,shouldKeepName:d,collapseRecursive:M,allRects:H}),[o,n,c,X,B,U,d,M,H]),G=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(j?.length?c.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,c]),W=r(e=>{if(B<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Ep((e.clientX-t.left)/t.width*B,(e.clientY-t.top)/t.height*X,G);if(n){const e=vp(n);N(e);const t=V>0?(100*n.size/V).toFixed(1):"0",i=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";I(`${n.name}\ntotal ${gp(n.size)} (${t}% of view, ${i}% of profile) · self ${gp(n.self)}`)}else N(null),I("")},[G,o.numTicks,X,B,V]),K=r(e=>{W(e)},[W]),Y=r(()=>{N(null),I("")},[]),J=r(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=r(e=>{const{x:t,y:o}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(B<2||X<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=Ep((e.clientX-n.left)/n.width*B,(e.clientY-n.top)/n.height*X,G);if(!i)return;m?.(i.name);const a=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(i);A(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(a,t)?e.slice(0,-1):[...e,a]})},[G,X,B,m]);g(()=>{const e=S.current;if(!e||B<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(B,X),i=Math.min(t,16384/n);e.width=Math.floor(B*i),e.height=Math.floor(X*i),e.style.width=`${B}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,B,X),j?.length?function(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}=xp(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=kp(d,r),g=`${s} (${gp(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(vp(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,B,X,j,c,y,O,o.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,B,X)))},[j,o.numTicks,O,c,X,B,y]);const Z=r(()=>D(e=>!e),[]),Q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(V/o.numTicks*100))):100,ee=a(()=>function(e,t,o){const n=o??bp(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,U,H),[o,U,H]),te=null!==ee,oe=$.length>0,ne=U?mp(o,U.nameIndex):"",le=r(()=>{A([]),v?.()},[v]),re=r(()=>A(e=>e.slice(0,-1)),[]),se=r(()=>{ee&&A(e=>[...e,ee])},[ee]);return e("div",{style:R?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(pe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ie,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:ae.Left,size:Et.S,value:M,onChange:z}),e(pe,{$gap:8,children:[e(pe,{children:[t(he,{variant:ge.Secondary,size:me.S,label:"Reset zoom",leftIcon:ll,onClick:le,disabled:!$.length}),t(he,{variant:ge.Secondary,size:me.S,iconSize:20,leftIcon:al,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!oe,onClick:re}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ce,{size:ue.XXS,color:de.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(he,{variant:ge.Secondary,size:me.S,iconSize:20,leftIcon:wa,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(pe,{children:[t(Ie,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(fe,{variant:To.Filled,options:[{value:wp.Fit,label:"W: Fit"},{value:wp.X10,label:"10x"}],selected:_,setSelected:P})}),t(Ie,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(fe,{variant:To.Filled,options:[{value:Tp.Fit,label:"H: Fit"},{value:Tp.X10,label:"10x"}],selected:L,setSelected:F})})]}),t(he,{variant:ge.Secondary,size:me.S,iconSize:24,leftIcon:R?Ma:rl,tooltip:R?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Ie,{fullWidth:!0,keepAlive:!0,text:E,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:R?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:_>1?"auto":"hidden",overflowY:L>1?"auto":"hidden"},children:t("div",{style:{width:B||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:O?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(pe,{$justifyContent:"space-between",children:[t(ce,U?{size:ue.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ne} • ${gp(V)} samples in view`}:{size:ue.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(ce,{size:ue.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Ip(h.totalBytesUsed)} / ${Ip(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Np=[ko.Go,ko.Java],$p="Profiling Symbols";function Ap(e,t){if(0===t.length)return null;const o=1===t.length?t[0]:function(e){return e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?ko.Go:e.includes(" ")||e.includes("(")?ko.Java:ko.Go}(e);if(o===ko.Go){const t=function(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 He(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new He(i,a);return r.Verify()?r:null}(e);return t?{language:o,golang:t}:null}if(o===ko.Java){const t=function(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 je(a,l);return r.Verify()?r:null}(e);return t?{language:o,java:t}:null}return null}function Rp(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function Dp(e,t,o){if(!e)return!0;const{sources:n=[],namespaces:i=[],languages:a=[]}=e,l=!n.length||n.some(e=>Rp(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==o||a.includes(o);return l&&r&&s}function _p(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Pp(e,t){return e.className===t.className&&e.methodName===t.methodName}function Lp(e,t,o,n){const i=Ap(e,o);if(!i)return[];const a=[];for(const e of n){const o=e.customInstrumentations;if(!o)continue;if(!Dp(e.sourceScopes,t,i.language))continue;const n=!!i.golang&&!!o[Ge.Golang]?.some(e=>_p(e,i.golang)),l=!!i.java&&!!o[Ge.Java]?.some(e=>Pp(e,i.java));(n||l)&&a.push({rule:e,resolved:i})}return a}function Fp({source:e,languages:t,rows:o}){const{instrumentationRulesApi:n,capabilities:i}=Nl(),{items:l}=n.useRules(),[c,d]=s(new Set),[u,p]=s(new Set),[h,m]=s(null),g=a(()=>function(e){const t=new Set(e??[]);return Np.filter(e=>t.has(e))}(t),[t]),f=i.canCreateInstrumentationRule,b=a(()=>function(e,t){const o=e.filter(e=>e.type===We.CustomInstrumentation&&e.ruleName===$p&&Dp(e.sourceScopes,t));return o.find(e=>e.sourceScopes?.sources?.some(e=>Rp(e,t.id)))??o[0]??null}(l,e),[l,e]),v=f&&g.length>0,y=a(()=>{const t=new Map;for(const n of o){const o=!!Ap(n.name,g),i=Lp(n.name,e,g,l),a=!!b&&i.some(e=>e.rule.ruleId===b.ruleId),r=i.filter(e=>e.rule.ruleId!==b?.ruleId),s=!a&&r.length>0,c=v&&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,e,g,f,v,b]),C=a(()=>{const e=new Set;return y.forEach((t,o)=>{t.inManagedRule&&e.add(o)}),e},[y]),S=a(()=>[...c].filter(e=>y.get(e)?.addEnabled&&!C.has(e)),[c,y,C]),x=a(()=>[...u].filter(e=>C.has(e)),[u,C]),w=S.length+x.length,T=r(e=>{const t=y.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[y,u,c]),k=r((e,t)=>{const o=y.get(e);o&&!o.checkboxDisabled&&(o.inManagedRule?p(o=>{const n=new Set(o);return t?n.delete(e):n.add(e),n}):d(o=>{const n=new Set(o);return t?n.add(e):n.delete(e),n}))},[y]),E=r(()=>{d(new Set),p(new Set)},[]),I=r(t=>{(async()=>{const o=t.add.map(e=>Ap(e,g)).filter(e=>!!e),i=t.remove.map(e=>Ap(e,g)).filter(e=>!!e);if(b){const{customInstrumentations:e,isEmpty:t}=function(e,t,o){const n=e.customInstrumentations??{};let i=[...n[Ge.Golang]??[]],a=[...n[Ge.Java]??[]];for(const e of o)e.golang&&(i=i.filter(t=>!_p(t,e.golang))),e.java&&(a=a.filter(t=>!Pp(t,e.java)));for(const e of t)e.golang&&!i.some(t=>_p(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>Pp(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ge.Golang]:i,[Ge.Java]:a},isEmpty:0===i.length&&0===a.length}}(b,o,i);t?await n.remove(b.ruleId,We.CustomInstrumentation):await n.update(b.ruleId,function(e,t){return{ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}}(b,e),We.CustomInstrumentation)}else o.length>0&&await n.create(function(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:$p,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ge.Golang]:o,[Ge.Java]:n}}}(o,e),We.CustomInstrumentation)})()},[b,g,e,n]),O=r(()=>{w&&m({add:S,remove:x})},[w,S,x]),N=r(e=>m({add:[e],remove:[]}),[]),$=r(e=>m({add:[],remove:[e]}),[]),A=r(()=>m(null),[]),R=r(()=>{h&&(I(h),m(null),E())},[h,I,E]),D=r(e=>y.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[y]);return{instrumentation:a(()=>({getSymbolState:D,onAdd:N,onRemove:$,selectionEnabled:v,isSelected:T,onToggleSymbol:k}),[D,N,$,v,T,k]),pendingCount:w,pendingModify:h,closeModify:A,openBulkModify:O,resetSelection:E,confirmModify:R}}var Mp,zp,Bp;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Mp||(Mp={})),function(e){e.OnlyInstrumentable="only-instrumentable"}(zp||(zp={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Bp||(Bp={}));const Xp=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Up(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Bp.FilterOutVoid)&&"void"===o)return!1;if(t.includes(Bp.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&Xp.test(o)))return!1}return!0}const Vp=({rows:e,languages:o,instrumentation:n,searchQuery:i,filters:l,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!o?.includes(ko.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:zp.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:Bp.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:Bp.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===Mp.Symbol)?.rawValue?.toString()??"";return!(t.includes(zp.OnlyInstrumentable)&&!n.getSymbolState(o).showCheckbox)&&Up(o,t)}}},[n,p]),g=a(()=>[{key:Mp.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Mp.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Mp.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:Mp.Symbol,rawValue:e.name},{key:Mp.Self,rawValue:gp(e.self)},{key:Mp.Total,rawValue:gp(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:xa,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:wa,tooltip:o.addTooltip,disabled:!o.addEnabled,onClick:()=>n.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:sl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[n]);return t(Eo,{variant:Io.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:n.selectionEnabled,filters:l,onFiltersChange:s,activeRowId:d,scrollSignal:u,getRowActions:b})};var Hp;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Hp||(Hp={}));const jp=f(Z)`
|
|
310
724
|
width: 100%;
|
|
311
725
|
flex: 1;
|
|
312
726
|
border-radius: 16px;
|
|
313
727
|
overflow: hidden;
|
|
314
728
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
315
729
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
316
|
-
`,
|
|
730
|
+
`,Gp=f.div`
|
|
317
731
|
display: flex;
|
|
318
732
|
align-items: center;
|
|
319
733
|
gap: 10px;
|
|
@@ -321,11 +735,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
321
735
|
padding: 12px 12px 8px;
|
|
322
736
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
323
737
|
border-radius: 16px 16px 0 0;
|
|
324
|
-
`,
|
|
738
|
+
`,Wp=f(pe)`
|
|
325
739
|
flex-shrink: 0;
|
|
326
740
|
align-items: center;
|
|
327
741
|
gap: 4px;
|
|
328
|
-
`,
|
|
742
|
+
`,Kp=f.div`
|
|
329
743
|
flex: 1;
|
|
330
744
|
display: flex;
|
|
331
745
|
align-items: stretch;
|
|
@@ -333,20 +747,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
333
747
|
padding: 16px;
|
|
334
748
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
335
749
|
border-radius: 0 0 16px 16px;
|
|
336
|
-
`,
|
|
750
|
+
`,Yp=f(Z)`
|
|
337
751
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
338
752
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
339
753
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
340
754
|
gap: 10px;
|
|
341
|
-
`,
|
|
755
|
+
`,Jp=f(Z)`
|
|
342
756
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
343
757
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
344
758
|
gap: 10px;
|
|
345
|
-
`,
|
|
759
|
+
`,qp=f(pe)`
|
|
346
760
|
width: 100%;
|
|
347
761
|
min-height: 32px;
|
|
348
762
|
flex-shrink: 0;
|
|
349
|
-
`,
|
|
763
|
+
`,Zp=({source:o,onFlameFullscreenChange:n})=>{const d=b(),u=o.id,{profilingApi:p}=Nl(),[h,m]=s(!0),[g,f]=s(Hp.Both),[v,y]=s(""),[C,S]=s({}),[x,w]=s(!1),T=l(!1);i(()=>{T.current||(T.current=!0,p.enableProfiling?.(u),w(!0))},[p,u]);const{data:k}=p.useSlots({skip:!x,pollInterval:3e3,fetchPolicy:"network-only"}),{data:E,loading:I,refetch:O}=p.useSourceProfiling(u,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),N=E?.profileJson??null,$=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(N),[N]),A=a(()=>$?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const i=n[o+1],a=n[o+2],l=mp(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===Hp.Table||g===Hp.Both,D=g===Hp.Flame||g===Hp.Both,_=R&&D,P=a(()=>o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),[o]),L=a(()=>function(e,t){if(!t?.includes(ko.Java))return;const o=(e?.[Mp.Symbol]?.filter(Boolean)??[]).filter(e=>e===Bp.FilterOutVoid||e===Bp.OnlyWithReturnValues);return 0!==o.length?e=>Up(e,o):void 0}(C,P),[C,P]),{instrumentation:F,pendingCount:M,pendingModify:z,closeModify:B,openBulkModify:X,resetSelection:U,confirmModify:V}=Fp({source:o,languages:P,rows:A}),[H,j]=s(null),[G,W]=s(0),[K,Y]=s(null),J=r(e=>{j(e),W(e=>e+1),f(e=>e===Hp.Flame?Hp.Both:e)},[]);return!N&&I?t(mt,{$height:"70vh",children:t(yt,{withSpinner:!0})}):e(jp,{$gap:0,$width:"100%",children:[e(Gp,{children:[t(Ie,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(Wp,{children:t(ce,{size:ue.S,weight:500,color:de.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(pe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(so,{value:v,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(fe,{variant:To.Filled,options:[{value:Hp.Table,label:"Top table"},{value:Hp.Flame,label:"Flame graph"},{value:Hp.Both,label:"Both"}],selected:g,setSelected:f}),t(he,h?{variant:ge.Secondary,size:me.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(cl,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:ge.Secondary,size:me.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(cl,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(Kp,{$gap:R&&D?16:0,children:$?e(c,{children:[R&&e(Yp,{$splitWithFlame:_,children:[e(qp,{$justifyContent:"space-between",children:[e(Z,{$margin:"0 0 0 20px",children:[t(ce,{size:ue.XXXS,nowrap:!0,children:"Please select symbols to"}),e(pe,{$gap:8,children:[e(pe,{children:[t(dl,{size:24}),t(ce,{size:ue.S,color:de.Success,nowrap:!0,children:"Custom Instrument"})]}),t(he,{leftIcon:Ia,variant:ge.Secondary,size:me.S,onClick:()=>window.open(`${Le}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(pe,{$gap:8,children:[K&&t(Ie,{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(Ke,{label:`Zoomed: ${K.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:ue.XXS})}),t(he,{variant:ge.Secondary,size:me.S,label:"Download snapshot",rightIcon:ul,onClick:()=>{if(!N)return;const e=new Blob([N],{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:!N})]})]}),t(Vp,{rows:A,languages:P,instrumentation:F,searchQuery:v,filters:C,onFiltersChange:S,zoomedSymbols:K,highlightSymbol:H,scrollSignal:G})]}),D&&e(Jp,{$splitWithTable:_,children:[e(qp,{$justifyContent:"space-between",children:[t(Ke,{label:$?`Total in view ${gp($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:ue.XXS}),e(pe,{$gap:12,children:[!h&&t(he,{variant:ge.Secondary,size:me.S,label:"Refresh",leftIcon:Ka,onClick:O}),t(ie,{label:"Auto refresh",labelAlign:ae.Left,size:Et.S,value:h,onChange:m})]})]}),t(Op,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:v,shouldKeepName:L,minHostHeight:280,onFullscreenChange:n,profilingSlots:k??null,onFrameClick:J,onZoomedSymbolsChange:Y,onResetZoom:()=>j(null)},g)]})]}):t(mt,{children:t($e,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(hp,{pendingModify:z,onClose:B,onConfirm:V}),t(Oo,{isOpen:M>0,richTitle:{icon:za,title:"Profiling Symbols",badge:{label:M}},actions:[{id:"profiling-bulk-cancel",type:ro.Button,buttonProps:{variant:ge.Secondary,size:me.S,label:"Cancel",onClick:U}},{id:"profiling-bulk-apply",type:ro.Button,buttonProps:{variant:ge.Primary,size:me.S,label:"Modify Rule",leftIcon:Na,onClick:X}}]})]})},Qp=f.div`
|
|
350
764
|
position: relative;
|
|
351
765
|
display: flex;
|
|
352
766
|
align-items: center;
|
|
@@ -354,17 +768,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
354
768
|
padding: 8px 16px;
|
|
355
769
|
border-radius: 12px;
|
|
356
770
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
357
|
-
`,
|
|
771
|
+
`,eh=f.div`
|
|
358
772
|
display: flex;
|
|
359
773
|
flex-direction: column;
|
|
360
774
|
gap: 4px;
|
|
361
775
|
flex: 1;
|
|
362
776
|
min-width: 0;
|
|
363
|
-
`,
|
|
777
|
+
`,th=f.div`
|
|
364
778
|
min-width: 0;
|
|
365
779
|
white-space: pre;
|
|
366
780
|
overflow-x: auto;
|
|
367
|
-
`,
|
|
781
|
+
`,oh=f.div`
|
|
368
782
|
position: absolute;
|
|
369
783
|
top: 50%;
|
|
370
784
|
right: 8px;
|
|
@@ -373,24 +787,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
373
787
|
pointer-events: none;
|
|
374
788
|
transition: opacity 0.15s ease;
|
|
375
789
|
|
|
376
|
-
${
|
|
790
|
+
${Qp}:hover & {
|
|
377
791
|
opacity: 1;
|
|
378
792
|
pointer-events: auto;
|
|
379
793
|
}
|
|
380
|
-
`,
|
|
794
|
+
`,nh=({name:o,summary:n,onJumpToRule:i})=>e(Qp,{children:[e(eh,{children:[o&&t(ce,{size:ue.XXXS,color:de.Secondary,nowrap:!0,children:o}),t(th,{children:t(x,{parts:n})})]}),i&&t(oh,{children:t(Ie,{text:Ze.OPEN_IN_SAMPLING_PAGE,children:t(he,{"data-id":"sampling-rule-jump",variant:ge.Primary,size:me.S,leftIcon:rl,onClick:i})})})]}),ih=f.div`
|
|
381
795
|
opacity: 0;
|
|
382
796
|
pointer-events: none;
|
|
383
797
|
transition: opacity 0.15s ease;
|
|
384
|
-
`,
|
|
385
|
-
&:hover ${
|
|
798
|
+
`,ah=f.div`
|
|
799
|
+
&:hover ${ih} {
|
|
386
800
|
opacity: 1;
|
|
387
801
|
pointer-events: auto;
|
|
388
802
|
}
|
|
389
|
-
`,
|
|
803
|
+
`,lh=f.div`
|
|
390
804
|
display: flex;
|
|
391
805
|
align-items: center;
|
|
392
806
|
padding: 4px 12px;
|
|
393
|
-
`,
|
|
807
|
+
`,rh=({source:e,onRedirectToSampling:o})=>t(zt,{bgTint:"1000",richTitle:{title:Ze.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(dh,{container:e,onRedirectToSampling:o},e.containerName))});var sh;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(sh||(sh={}));const ch=e=>"noisy"===e.type?w(e.rule,"source"):"highlyRelevant"===e.type?T(e.rule,"source"):"costReduction"===e.type?k(e.rule,"source"):[],dh=({container:o,onRedirectToSampling:n})=>{const[i,l]=s(sh.All),r=uo(e=>e.setPendingViewSamplingRule),c=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===sh.Noisy?d:i===sh.HighlyRelevant?u:i===sh.CostReduction?p:[...d,...u,...p],[i,u,p]),m=d.length+u.length+p.length,g=a(()=>(e,t)=>{r({ruleId:e,category:t}),n()},[n,r]),f=t(ih,{children:t(he,{"data-id":"sampling-container-create-rule",variant:ge.Secondary,size:me.S,label:No,rightIcon:wa,onClick:e=>{e.stopPropagation(),n()}})});return t(ah,{children:e(zt,{bgTint:"900",richTitle:{title:o.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(zt,{bgTint:"800",richTitle:{title:Ze.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ce,{size:ue.XXS,children:Ze.NOISY_OPERATIONS}),t(Z,{$gap:4,children:c.map(e=>t(nh,{name:e.name,summary:w(e),onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(lh,{children:t(ce,{size:ue.XS,color:de.Secondary,children:Ze.HEAD_SAMPLING})}),m?e(zt,{bgTint:"800",richTitle:{title:Ze.TAIL_SAMPLING,badge:{label:m}},children:[t(fe,{options:(b=d.length,v=u.length,y=p.length,[{value:sh.All,label:"All",badge:{label:b+v+y,textSize:ue.XXXS}},{value:sh.Noisy,label:Ze.NOISY_OPERATIONS,badge:{label:b,textSize:ue.XXXS}},{value:sh.HighlyRelevant,label:Ze.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:ue.XXXS}},{value:sh.CostReduction,label:Ze.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:ue.XXXS}}]),selected:i,setSelected:l}),t(Z,{$gap:4,children:h.length?h.map(e=>t(nh,{name:e.rule.name,summary:ch(e),onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t($e,{title:`No ${i===sh.All?`${sh.Noisy}, ${sh.HighlyRelevant} and ${sh.CostReduction}`:i} operations`})})]}):t(lh,{children:t(ce,{size:ue.XS,color:de.Secondary,children:Ze.TAIL_SAMPLING})})]})});var b,v,y},uh=[fo.Deployment,fo.StatefulSet,fo.DaemonSet,fo.DeploymentConfig,fo.Rollout,fo.Pod];var ph;!function(e){e.Workload="Workload",e.Pod="Pod"}(ph||(ph={}));const hh=e=>!!e&&oo(e.status)===Pe.Error,mh=e=>hh(e.healthStatus),gh=e=>hh(e.odigosHealthStatus)||(e.processes??[]).some(mh),fh=e=>hh(e.agentInjectedStatus)||hh(e.odigosHealthStatus)||(e.containers??[]).some(gh),bh=({onClose:o,sourceId:n,onRedirectToSampling:c})=>{const d=b(),{isVm:u}=C(),{sourcesApi:p,configApi:h}=Nl(),{selectedStreamName:m}=Qe(),{genericForm:g,loadSource:f,validateFormData:v}=or(),{data:y}=h.useEffectiveConfig(),[S,x]=s(!1),[w,T]=s(!1),[k,E]=s(!1),[I,O]=s(hu.Overview),[N,$]=s(null),[A,R]=s({openFor:null}),D=(()=>{const[e,t]=s(null),o=r(e=>{t({tab:hu.Pods,podName:e.podName})},[]),n=r((e,o)=>{t({tab:hu.Pods,podName:e.podName,containerName:o.containerName})},[]),i=r((e,o,n)=>{const i=yu({identifyingAttributes:n.identifyingAttributes});t({tab:hu.Pods,podName:e.podName,containerName:o.containerName,processPid:i})},[]),l=r(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:l}),[e,o,n,i,l])})();i(()=>{D.jumpToTarget&&O(D.jumpToTarget.tab)},[D.jumpToTarget]),i(()=>{N&&JSON.stringify(po(n))!==JSON.stringify(po(N))&&$(null)},[n,N]);const _=l(!1),P=r(async()=>$(await p.fetchById(n)||null),[n,p]);i(()=>{if(_.current||(P(),_.current=!0),!S){const e=setInterval(()=>P(),3e3);return()=>clearInterval(e)}},[P,S]),i(()=>{N&&f(N)},[N]);const L=N&&uh.includes(N.id.kind),F=a(()=>{const e=[],o=(N?.pods??[]).some(fh);return e.push({value:hu.Overview,label:Ze.OVERVIEW}),u||(e.push({value:hu.Pods,label:Ze.PODS,icon:o?e=>t(Qa,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:hu.PeerSources,label:Ze.PEER_SOURCES}),y?.profiling?.enabled&&e.push({value:hu.Profiling,label:Ze.PROFILING}),e.push({value:hu.Sampling,label:Ze.SAMPLING}),e.push({value:hu.Debug,label:Ze.DEBUG})),e},[u,y,N?.pods]),M=r(()=>x(!0),[]),z=a(()=>()=>{o(),c()},[o,c]),B=r(()=>{N&&f(N),x(!1)},[N]),X=r(async()=>{if(!N||!g)return;const{errorMessage:e,preparedFormData:t}=v();if(e)return;const o=t.otelServiceName!==N.id.name?t.otelServiceName:"";await p.update(n,{...t,otelServiceName:o}),x(!1)},[N,g,v,n,p]),U=r(()=>T(!0),[]),V=r(async()=>{N&&(await p.persistV2({[$t]:[{namespace:N.id.namespace,name:N.id.name,kind:N.id.kind,...N.id.region?{region:N.id.region}:{},selected:!1,currentStreamName:m}]}),T(!1),o())},[N,p,m,o]),H=r(()=>{R({openFor:ph.Workload})},[]),j=r(e=>{O(e),D.clearJumpToTarget()},[D]),G=r(async()=>{await p.recoverFromRollback(n)},[p,n]),W=r(()=>R({openFor:null}),[]),K=r(async()=>{A.openFor===ph.Workload?await p.restartWorkloads([n]):A.openFor===ph.Pod&&A.podNamespace&&A.podName&&await p.restartPod(A.podNamespace,A.podName),W()},[A,p,n,W]),Y=a(()=>{const{kind:e,name:t}=n;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[n]),J=a(()=>{const e=[];return S||I===hu.Overview&&(e.push({id:"edit-source-btn-edit",label:Pt.EDIT,icon:Na,active:S,onClick:M}),!u&&L&&e.push({id:"edit-source-btn-restart",label:Ze.ROLLOUT,icon:pl,onClick:H}),e.push({id:"edit-source-btn-delete",label:Pt.UNINSTRUMENT,icon:xa,color:d.v2.colors.red[500],active:w,onClick:U})),e},[I,S,w,u,L,M,H,U,d]),q=a(()=>{if(!N)return[];const e=[],t={backgroundColor:"transparent",textSize:ue.S};return e.push({...t,label:N.id.name,leftIcon:u?void 0:Za}),N.serviceName&&N.serviceName!==N.id.name&&e.push({...t,label:N.serviceName,leftIcon:qa,textColor:d.v2.colors.silver[200]}),e},[N,d,u]);if(!N)return t(re,{isOpen:!0,children:t(mt,{$height:"80vh",children:t(yt,{withSpinner:!0})})});const Q=I===hu.Profiling?k?"95vw":"fit-content":S?void 0:"60vw";return e(Ou,{value:D,children:[t(re,{isOpen:!0,width:Q,minWidth:"777px",header:{icon:u?hl:$o(N.containers)[0],titleBadges:q,onClose:()=>{j(hu.Overview),$(null),E(!1),o()},actions:J},footer:{actions:S?[{"data-id":"edit-source-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:Pt.SAVE,variant:ge.Primary,onClick:X}]:[]},children:t(pt,{$padding:"4px 12px 12px",children:e(Z,{$gap:16,children:[!S&&F.length>1&&t(fe,{options:F,selected:I,setSelected:j}),(()=>{switch(I){case hu.Overview:return S?t(Rs,{}):t(dp,{source:N,onClickRollout:H,onClickRollback:G});case hu.Pods:return t(Du,{source:N,onClickRestartPod:L?(e,t)=>R({openFor:ph.Pod,podNamespace:e,podName:t}):void 0});case hu.PeerSources:return t(_u,{source:N});case hu.Profiling:return t(Zp,{source:N,onFlameFullscreenChange:E});case hu.Sampling:return t(rh,{source:N,onRedirectToSampling:z});case hu.Debug:return t(zu,{source:N});default:return null}})()]})})}),t(Gl,{target:"source",action:"uninstrument",isOpen:w,onClose:()=>T(!1),onApprove:V}),t(qe,{isOpen:A.openFor===ph.Workload,title:Y.title,description:Y.description,onClose:W,denyButton:{label:"Go back",variant:ge.Secondary,onClick:W},approveButton:{label:Pt.CONFIRM,variant:ge.Primary,onClick:K}}),t(Gl,{target:"pod",action:"restart",description:Ze.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:A.openFor===ph.Pod,onClose:W,onApprove:K,overrideApproveButtonLabel:Ze.DELETE_POD_TO_RESTART})]})},vh=f.div`
|
|
394
808
|
display: flex;
|
|
395
809
|
align-items: center;
|
|
396
810
|
gap: 8px;
|
|
@@ -400,9 +814,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
400
814
|
&:hover {
|
|
401
815
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
402
816
|
}
|
|
403
|
-
`,
|
|
817
|
+
`,yh=f.div`
|
|
404
818
|
flex: 1;
|
|
405
|
-
`,
|
|
819
|
+
`,Ch=({onClick:o})=>{const n=b().v2.colors.red[500];return e(vh,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(ce,{size:ue.XS,weight:500,color:n,children:_o}),t(xa,{size:16,fill:n})]})};function Sh(n){if(n.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(Ch,{onClick:l}),r&&t(_e,{status:Pe.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(yh,{}),t(he,{"data-id":"sampling-view-edit-btn-cancel",label:Ao,variant:ge.Secondary,size:me.S,onClick:i}),t(he,{"data-id":"sampling-view-edit-btn-save",label:Ro,variant:ge.Primary,size:me.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=n;return{children:e(o,{children:[t(Ch,{onClick:i}),t(yh,{}),t(he,{"data-id":"sampling-view-btn-cancel",label:Ao,variant:ge.Secondary,size:me.S,onClick:a}),t(he,{"data-id":"sampling-view-btn-edit",label:Do,variant:ge.Primary,size:me.S,onClick:l})]})}}const xh={[ir.EditAutoNoisy]:{title:Ko,subTitle:Wo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[ir.EditAutoCostReduction]:{title:Go,subTitle:jo,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[ir.EditAutoHighlyRelevant]:{title:Ho,subTitle:Vo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},wh=({isOpen:e,title:o,subTitle:n,onClose:i,footer:a,renderBody:l})=>t(re,{isOpen:e,width:Jo,header:{icon:ml,title:o,subTitle:n,onClose:i},footer:a,children:l?l():t(pt,{$padding:"12px",children:t(Ms,{})})}),Th=({isOpen:n,onClose:l,onSubmit:c,validateForm:d,onNavigateToDuplicate:u})=>{const{category:p,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=nr(ir.Create),[b,v]=s(!1);i(()=>{n&&(m(),v(!1))},[n]);const y=r(()=>{v(!1),c(h)},[h,c]),C=r(()=>{if(d){const e=d(h);if(e)return void f(e)}!function(e,t){return JSON.stringify(e)===JSON.stringify(E(t))}(h,p)?y():v(!0)},[h,p,d,f,y]),S=a(()=>b?function(e,t){switch(e){case"noisy":return w(N(t));case"highlyRelevant":return T(O(t));case"costReduction":return k(I(t))}}(p,h):[],[b,p,h]),x={note:g?{status:Pe.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:Ao,variant:ge.Secondary,size:me.S,onClick:l},{"data-id":"sampling-create-btn-submit",label:No,variant:ge.Primary,size:me.S,onClick:C,disabled:!!g}]};return e(o,{children:[t(wh,{isOpen:n,title:Mo[p],subTitle:Po[p],onClose:l,footer:x}),t(qe,{isOpen:b,title:Xo,description:Bo,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:zo,variant:ge.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:No,variant:ge.Primary,onClick:y},children:e(Z,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(ce,{size:ue.XS,weight:500,color:de.Secondary,children:Uo}),t("div",{style:{width:"100%"},children:t(_l,{summary:S})})]})})]})},kh=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:i,onNavigateToDuplicate:l})=>{const{data:s,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:m}=nr(ir.View),g=s?.rule.name||Fo,f=c&&s?Lo[s.category]:`${g} preview`,b=r(()=>{if(s&&c){if(i){const e=i(d);if(e)return void m(e)}n(d,s.rule.ruleId,s.samplingId),p()}},[s,c,d,n,i,m,p]),v=r(()=>{s&&o(s.rule.ruleId,s.samplingId)},[s,o]),y=a(()=>{if(!s)return;const t=h?{message:h.message,onViewRule:l?()=>l(h.ruleId):void 0}:null;return Sh(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[s,c,h,p,b,v,u,e,l]);return t(wh,{isOpen:!!s,title:f,subTitle:s?Po[s.category]:"",onClose:e,footer:y})},Eh=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=nr(ir.EditAutoNoisy),l=r(()=>n(i,a),[n,i,a]);return t(Nh,{formType:ir.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},Ih=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=nr(ir.EditAutoCostReduction),l=r(()=>n(i,a),[n,i,a]);return t(Nh,{formType:ir.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},Oh=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i}=nr(ir.EditAutoHighlyRelevant),a=r(()=>n(i),[n,i]);return t(Nh,{formType:ir.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:a})},Nh=({formType:e,isOpen:o,onClose:n,onSave:i})=>{const a=xh[e];return t(wh,{isOpen:o,title:a.title,subTitle:a.subTitle,onClose:n,footer:{actions:[{"data-id":a.cancelId,label:Ao,variant:ge.Secondary,size:me.S,onClick:n},{"data-id":a.saveId,label:Yo,variant:ge.Primary,size:me.S,onClick:i}]}})},$h=e=>{switch(e.formType){case ir.Create:return t(ur,{formType:ir.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Th,{...e})});case ir.View:return t(ur,{formType:ir.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(kh,{...e})});case ir.EditAutoNoisy:return t(ur,{formType:ir.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Eh,{...e})});case ir.EditAutoCostReduction:return t(ur,{formType:ir.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Ih,{...e})});case ir.EditAutoHighlyRelevant:return t(ur,{formType:ir.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Oh,{...e})})}},Ah=({token:n,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=Dt(),m=!a||i||!c.newToken;return qo({key:"Enter",active:!m},s),e(pe,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(xe,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(pe,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(yt,{title:"Saving...",withGradient:!0}):e(o,{children:[t(he,{variant:ge.Secondary,size:me.S,leftIcon:Ma,onClick:r,disabled:i}),t(he,{variant:ge.Primary,size:me.S,leftIcon:Fa,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ce,{size:ue.XS,children:new Array(55).fill("•").join("")}),e(pe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(bt,{icon:Na,onClick:l})]})]})},Rh=({expiresAt:e,callbackValid:o,callbackExpired:n})=>{const{formatTimeAgo:l}=qt(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Zo(e,0)?Pe.Error:Zo(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=a(()=>c===Pe.Success?Fa:c===Pe.Warning?gl:Qa,[c]);return i(()=>{c===Pe.Success?o():c===Pe.Error&&n()},[c]),t(Ie,{text:s,children:t(Ke,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},Dh=f.div`
|
|
406
820
|
display: flex;
|
|
407
821
|
flex-direction: column;
|
|
408
822
|
gap: 12px;
|
|
@@ -410,7 +824,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
410
824
|
border-radius: 12px;
|
|
411
825
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
412
826
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
413
|
-
`,
|
|
827
|
+
`,_h=({children:e})=>{const o=b();return t(ce,{size:ue.XXXS,color:o.v2.colors.grey[150],children:e})},Ph=({token:o})=>{const{tokensApi:n}=Nl(),[i,a]=s(!1),[l,r]=s(!1),[c,d]=s(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=Ut({newToken:""});return t(st,{richTitle:{icon:fl,title:"Odigos Pro Token"},children:e(Dh,{$isExpired:c,children:[e(pe,{$justifyContent:"space-between",children:[e(Z,{$gap:4,children:[t(_h,{children:"Issued for"}),t(ce,{size:ue.XS,children:o.name||"N/A"})]}),e(Z,{$gap:4,children:[t(_h,{children:"Expiration"}),t(Rh,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(Z,{})]}),t(pe,{children:e(Z,{children:[t(_h,{children:"Token"}),t(Ah,{token:o.token,newToken:u.newToken,isLoading:i,isEditing:l,onEdit:()=>r(!0),onCancel:()=>(r(!1),void p("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;a(!0);const e=await n.updateToken(u.newToken.trim());a(!1),e?.error?m("newToken",e.error):(r(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},Lh=f.div`
|
|
414
828
|
display: flex;
|
|
415
829
|
flex-direction: column;
|
|
416
830
|
align-items: center;
|
|
@@ -419,23 +833,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
419
833
|
padding: 12px 24px;
|
|
420
834
|
border-radius: 8px;
|
|
421
835
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
422
|
-
`,zu=()=>{const{progress:n}=It(),{describeApi:o,namespacesApi:a}=bl(),{items:i}=a.useNamespaces(),[l,s]=r(null),{formData:c,handleFormChange:d,resetFormData:u}=Mt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(rt,{richTitle:{icon:ll,title:"Diagnose"},children:l?e(_u,{children:[t(yt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Nt.DownloadingDiagnose]?.percentage,percentage:n[Nt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Nt.DownloadingDiagnose]?.percentage,visualIcon:el,startedAt:l}),n[Nt.DownloadingDiagnose]?.list?.length&&t(q,{$width:"100%",children:n[Nt.DownloadingDiagnose].list.map((n,o)=>e(ue,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(Ri,{size:16}):n.status===Pe.Error?t(Di,{size:16}):t(yt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(se,{size:de.XXXS,color:ce.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(q,{$gap:24,children:[t(se,{size:de.XXS,color:ce.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(q,{$gap:16,children:[e(ue,{$gap:8,children:[t(Q,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(se,{size:de.XXXS,color:ce.Secondary,children:"Include pprof profiles"})]}),e(ue,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(se,{size:de.XXXS,color:ce.Secondary,children:"Include Prometheus metrics"})]}),e(ue,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(se,{size:de.XXXS,color:ce.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Yn,{alignX:qn.Left,alignY:Jn.Bottom,items:i.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:me.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(We,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(ue,{$justifyContent:"flex-end",children:t(pe,{label:"Download Diagnose",rightIcon:el,variant:me.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),u())},disabled:null!==l})})]})})},Bu=()=>{const{platformType:e,version:n,tier:a}=v(),{describeApi:i}=bl(),[l,s]=r(null);return o(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(rt,{richTitle:{icon:Wi,title:"General Information"},children:t(Pt,{cellsPerRow:2,items:[{id:Zn(),title:"Odigos Version",label:n},{id:Zn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Zn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Zn(),title:"Tier",label:a}]})})},Xu=({isOpen:n,onClose:o})=>{const{describeApi:a,tokensApi:i}=bl(),l=i.useTokens().items[0];return e(le,{isOpen:n,header:{icon:Wi,title:"System Overview",onClose:o},children:[a.fetchDescribeOdigos&&t(Bu,{}),i.updateToken&&l&&t(Mu,{token:l}),a.downloadDiagnose&&t(zu,{})]})},Vu=({isOpen:o,onClose:a,onCloseEnd:i})=>{const{addDataStreams:r,setSelectedStreamName:s}=Ze(),{dataStreamsApi:c}=bl(),{requestSubmit:d}=Vl(),u=l(async e=>{c.create?await c.create(e):(r([e]),s(e.name)),a()},[c,r,s,a]),p=l(()=>d(u),[d,u]);return Wn({key:"Enter",active:o},p),e(n,{children:[t(Je,{isOpen:o,onClose:a,onCloseEnd:i,title:qe.NAME_YOUR_STREAM,description:qe.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Dt.DONE,variant:me.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:Dt.CANCEL,variant:me.Secondary,onClick:a},children:t(fs,{autoFocus:!0})}),t(gs,{})]})},Uu=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s})=>{const{dataStreamsApi:c}=bl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Vl();o(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,m=l(async e=>{await c.update(s,e),i()},[c,s,i]),g=l(()=>p(m),[p,m]);return Wn({key:"Enter",active:a},g),e(n,{children:[t(Je,{isOpen:a,onClose:i,onCloseEnd:r,title:qe.RENAME_STREAM(s),description:qe.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Dt.SAVE,variant:me.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Dt.CANCEL,variant:me.Secondary,onClick:i},children:t(fs,{autoFocus:!0})}),t(gs,{})]})},ju=({scale:n=1})=>e("svg",{width:742*n,height:533*n,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),Gu=g.div`
|
|
836
|
+
`,Fh=()=>{const{progress:o}=Ot(),{describeApi:n,namespacesApi:i}=Nl(),{items:a}=i.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:u}=Ut({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(st,{richTitle:{icon:bl,title:"Diagnose"},children:l?e(Lh,{children:[t(yt,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[At.DownloadingDiagnose]?.percentage,percentage:o[At.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[At.DownloadingDiagnose]?.percentage,visualIcon:ul,startedAt:l}),o[At.DownloadingDiagnose]?.list?.length&&t(Z,{$width:"100%",children:o[At.DownloadingDiagnose].list.map((o,n)=>e(pe,{$gap:4,$alignItems:"center",children:[o.status===Pe.Success?t(Fa,{size:16}):o.status===Pe.Error?t(Ma,{size:16}):t(yt,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ce,{size:ue.XXXS,color:de.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(Z,{$gap:24,children:[t(ce,{size:ue.XXS,color:de.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(Z,{$gap:16,children:[e(pe,{$gap:8,children:[t(ee,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ce,{size:ue.XXXS,color:de.Secondary,children:"Include pprof profiles"})]}),e(pe,{$gap:8,children:[t(ee,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ce,{size:ue.XXXS,color:de.Secondary,children:"Include Prometheus metrics"})]}),e(pe,{$gap:8,children:[t(ee,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(ce,{size:ue.XXXS,color:de.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Qo,{alignX:tn.Left,alignY:en.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:ge.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Ke,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(pe,{$justifyContent:"flex-end",children:t(he,{label:"Download Diagnose",rightIcon:ul,variant:ge.Primary,onClick:async()=>{n.downloadDiagnose&&(r(Date.now()),await n.downloadDiagnose(c),r(null),u())},disabled:null!==l})})]})})},Mh=()=>{const{platformType:e,version:o,tier:n}=C(),{describeApi:a}=Nl(),[l,r]=s(null);return i(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(st,{richTitle:{icon:il,title:"General Information"},children:t(zt,{cellsPerRow:2,items:[{id:on(),title:"Odigos Version",label:o},{id:on(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:on(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:on(),title:"Tier",label:n}]})})},zh=({isOpen:o,onClose:n})=>{const{describeApi:i,tokensApi:a}=Nl(),l=a.useTokens().items[0];return e(re,{isOpen:o,header:{icon:il,title:"System Overview",onClose:n},children:[i.fetchDescribeOdigos&&t(Mh,{}),a.updateToken&&l&&t(Ph,{token:l}),i.downloadDiagnose&&t(Fh,{})]})},Bh=({isOpen:n,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:s}=Qe(),{dataStreamsApi:c}=Nl(),{requestSubmit:d}=tr(),u=r(async e=>{c.create?await c.create(e):(l([e]),s(e.name)),i()},[c,l,s,i]),p=r(()=>d(u),[d,u]);return qo({key:"Enter",active:n},p),e(o,{children:[t(qe,{isOpen:n,onClose:i,onCloseEnd:a,title:Ze.NAME_YOUR_STREAM,description:Ze.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Pt.DONE,variant:ge.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:i},children:t(As,{autoFocus:!0})}),t($s,{})]})},Xh=({isOpen:n,onClose:a,onCloseEnd:l,dataStreamName:s})=>{const{dataStreamsApi:c}=Nl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=tr();i(()=>{n&&s&&u(s)},[n,s]);const h=!!d?.isFormDirty,m=r(async e=>{await c.update(s,e),a()},[c,s,a]),g=r(()=>p(m),[p,m]);return qo({key:"Enter",active:n},g),e(o,{children:[t(qe,{isOpen:n,onClose:a,onCloseEnd:l,title:Ze.RENAME_STREAM(s),description:Ze.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Pt.SAVE,variant:ge.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Pt.CANCEL,variant:ge.Secondary,onClick:a},children:t(As,{autoFocus:!0})}),t($s,{})]})},Uh=({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)"})})]})]}),Vh=f.div`
|
|
423
837
|
position: absolute;
|
|
424
838
|
top: 50%;
|
|
425
839
|
left: 50%;
|
|
426
840
|
transform: translate(-50%, -50%);
|
|
427
841
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
428
|
-
`,
|
|
842
|
+
`,Hh="onboarding-done",jh=()=>{const{currentModal:o,setCurrentModal:n}=nn(),i=()=>n("");return e(an,{isOpen:o===Hh,onClose:i,children:[t(Uh,{}),t(Vh,{children:e(Z,{$gap:32,$alignItems:"center",children:[e(Z,{$gap:24,$alignItems:"center",children:[t(ce,{size:ue.L,weight:500,children:"Welcome to"}),t(Kl,{size:260}),t(ce,{size:ue.S,weight:400,children:"Your observability control plane is ready."})]}),t(he,{label:"Get Started",rightIcon:Ta,onClick:i})]})})]})},Gh=f.div`
|
|
429
843
|
display: flex;
|
|
430
844
|
flex-direction: column;
|
|
431
845
|
gap: 8px;
|
|
432
846
|
padding: 4px 8px;
|
|
433
847
|
border-radius: 8px;
|
|
434
848
|
width: 100%;
|
|
435
|
-
`,
|
|
849
|
+
`,Wh=f.div`
|
|
436
850
|
white-space: pre;
|
|
437
851
|
overflow-x: auto;
|
|
438
|
-
`,
|
|
852
|
+
`,Kh=({name:o,recommended:n,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=b();return e(Gh,{children:[e(pe,{$gap:8,$justifyContent:"space-between",children:[e(pe,{$gap:4,children:[t(ce,{size:ue.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Ke,{label:ln,leftIcon:vl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:ue.XXXS})]}),t(ie,{name:s??`sampling-onboarding-toggle-${o}`,label:i,labelAlign:ae.Left,value:a,onChange:l,size:Et.S})]}),t(Wh,{children:t(x,{parts:r})})]})},Yh=f.div`
|
|
439
853
|
position: relative;
|
|
440
854
|
display: flex;
|
|
441
855
|
align-items: center;
|
|
@@ -445,18 +859,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
445
859
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
446
860
|
border-top-left-radius: 18px;
|
|
447
861
|
border-top-right-radius: 18px;
|
|
448
|
-
`,
|
|
862
|
+
`,Jh=f.div`
|
|
449
863
|
position: absolute;
|
|
450
864
|
left: 16px;
|
|
451
865
|
top: 50%;
|
|
452
866
|
transform: translateY(-50%);
|
|
453
|
-
`,
|
|
867
|
+
`,qh=f.div`
|
|
454
868
|
height: 16px;
|
|
455
869
|
width: 100%;
|
|
456
870
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
457
871
|
border-top-left-radius: 18px;
|
|
458
872
|
border-top-right-radius: 18px;
|
|
459
|
-
`,
|
|
873
|
+
`,Zh=f.div`
|
|
460
874
|
width: ${({$width:e})=>e}px;
|
|
461
875
|
display: flex;
|
|
462
876
|
flex-direction: column;
|
|
@@ -464,10 +878,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
464
878
|
gap: 22px;
|
|
465
879
|
padding: 8px 32px 32px 32px;
|
|
466
880
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
467
|
-
`,
|
|
881
|
+
`,Qh=e=>t(yl,{rotate:90,...e}),em=({children:o,center:n,onNext:i,nextLabel:a=rn,nextLoading:l})=>e(pe,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,i&&t(he,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:Qh,variant:ge.Primary,size:me.M,onClick:i,loading:l})]}),tm=e=>t(yl,{rotate:-90,...e}),om=({title:o,onBack:n})=>{const i=b();return e(Yh,{$hasBack:!!n,children:[n&&t(Jh,{children:t(bt,{"data-id":"sampling-onboarding-back",icon:tm,size:vt.M,onClick:n})}),t(ce,{size:ue.M,weight:500,color:i.v2.colors.white[500],align:"center",children:o})]})},nm=f.div`
|
|
468
882
|
box-sizing: border-box;
|
|
469
883
|
width: ${({$width:e})=>e??"100%"};
|
|
470
|
-
${({$fillHeight:e})=>e&&
|
|
884
|
+
${({$fillHeight:e})=>e&&v`
|
|
471
885
|
align-self: stretch;
|
|
472
886
|
height: auto;
|
|
473
887
|
`}
|
|
@@ -477,16 +891,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
477
891
|
padding: 16px;
|
|
478
892
|
border-radius: 16px;
|
|
479
893
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
480
|
-
`,
|
|
894
|
+
`,im=({children:e,fillHeight:o,width:n})=>t(nm,{$fillHeight:o,$width:n,children:e}),am=f.ul`
|
|
481
895
|
margin: 0;
|
|
482
896
|
padding: 0;
|
|
483
897
|
list-style: disc;
|
|
484
|
-
`,
|
|
898
|
+
`,lm=f.li`
|
|
485
899
|
margin-left: 18px;
|
|
486
900
|
& + & {
|
|
487
901
|
margin-top: 6px;
|
|
488
902
|
}
|
|
489
|
-
`,
|
|
903
|
+
`,rm=({items:e,color:o})=>{const n=b(),i=o||n.v2.colors.silver[200];return t(am,{children:e.map((e,o)=>t(lm,{style:{color:i},children:t(ce,{size:ue.XXS,color:i,children:e})},o))})},sm=({items:o})=>{const n=b();return t(Z,{$gap:16,children:o.map((o,i)=>e(pe,{$gap:8,$alignItems:"flex-start",children:[e(ce,{size:ue.XS,color:n.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(Z,{$gap:2,children:[t(ce,{size:ue.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(ce,{size:ue.XS,color:n.v2.colors.silver[200],children:o.description})]})]},i))})},cm=({message:e})=>t(_e,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),dm=f.div`
|
|
490
904
|
width: 100%;
|
|
491
905
|
padding: 8px;
|
|
492
906
|
display: flex;
|
|
@@ -494,12 +908,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
494
908
|
gap: 4px;
|
|
495
909
|
border-radius: 16px;
|
|
496
910
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
497
|
-
`,
|
|
911
|
+
`,um=f.div`
|
|
498
912
|
display: flex;
|
|
499
913
|
align-items: center;
|
|
500
914
|
gap: 8px;
|
|
501
915
|
padding: 4px 8px 12px 8px;
|
|
502
|
-
`,
|
|
916
|
+
`,pm=f.div`
|
|
503
917
|
width: 100%;
|
|
504
918
|
display: flex;
|
|
505
919
|
flex-direction: column;
|
|
@@ -507,20 +921,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
507
921
|
padding: 8px;
|
|
508
922
|
border-radius: 12px;
|
|
509
923
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
510
|
-
`,
|
|
924
|
+
`,hm=({children:e})=>{const o=b();return t(ce,{size:ue.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},mm=f.div`
|
|
511
925
|
white-space: pre-line;
|
|
512
|
-
`,
|
|
926
|
+
`,gm=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=b(),c=a(()=>$({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(om,{title:sn,onBack:l}),e(Zh,{$width:854,children:[t(hm,{children:cn}),e(Z,{$gap:8,$width:"100%",children:[t(im,{children:t(mm,{children:t(ce,{size:ue.XXS,color:s.v2.colors.silver[200],children:dn})})}),e(Z,{$gap:8,$width:"100%",children:[e(dm,{children:[t(um,{children:t(ce,{size:ue.S,weight:500,color:s.v2.colors.white[500],children:un})}),t(pm,{children:t(Kh,{name:hn,recommended:!0,toggleLabel:pn,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(cm,{message:mn})]})]})]}),t(em,{onNext:r})]})},fm=e=>t(yl,{rotate:90,...e}),bm=({onClose:n})=>{const i=b();return e(o,{children:[t(qh,{}),e(Zh,{$width:732,children:[t(gn,{icon:ml}),e(Z,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ce,{size:ue.M,weight:500,color:i.v2.colors.white[500],children:fn}),bn.split("\n").map((e,o)=>t(hm,{children:e},`subtitle-${o}-${e}`)),e(im,{children:[t(ce,{size:ue.XS,color:i.v2.colors.silver[200],children:vn}),t(rm,{color:i.v2.colors.white[500],items:[yn,Cn,Sn]})]})]})]}),t(em,{center:!0,children:t(he,{"data-id":"sampling-onboarding-btn-go-to",label:xn,rightIcon:fm,variant:ge.Primary,size:me.M,onClick:n})})]})},vm=e=>t(yl,{rotate:90,...e}),ym=f.div`
|
|
513
927
|
display: flex;
|
|
514
928
|
flex-direction: column;
|
|
515
929
|
align-items: center;
|
|
516
930
|
gap: 8px;
|
|
517
931
|
width: 100%;
|
|
518
|
-
`,
|
|
932
|
+
`,Cm=({onSkip:n,onNext:i})=>{const a=b();return e(o,{children:[t(qh,{}),e(Zh,{$width:732,children:[t(gn,{icon:ml}),e(Z,{$gap:16,$alignItems:"center",$width:"100%",children:[e(ym,{children:[t(ce,{size:ue.M,weight:500,color:a.v2.colors.white[500],children:wn}),t(hm,{children:Tn})]}),e(im,{children:[t(ce,{size:ue.XS,color:a.v2.colors.silver[200],children:kn}),t(sm,{items:[{title:In,description:En},{title:Nn,description:On},{title:An,description:$n}]}),t(cm,{message:Rn})]})]})]}),e(em,{center:!0,children:[t(he,{"data-id":"sampling-onboarding-btn-skip",label:Dn,variant:ge.Secondary,onClick:n}),t(he,{"data-id":"sampling-onboarding-btn-start",label:_n,rightIcon:vm,variant:ge.Primary,onClick:i})]})]})},Sm=f.div`
|
|
519
933
|
display: flex;
|
|
520
934
|
align-items: stretch;
|
|
521
935
|
gap: 16px;
|
|
522
936
|
width: 100%;
|
|
523
|
-
`,
|
|
937
|
+
`,xm=f.div`
|
|
524
938
|
flex: 1;
|
|
525
939
|
display: flex;
|
|
526
940
|
flex-direction: column;
|
|
@@ -532,26 +946,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
532
946
|
background-color 0.15s ease,
|
|
533
947
|
border-color 0.15s ease;
|
|
534
948
|
|
|
535
|
-
${({$selected:e,theme:t})=>e?
|
|
949
|
+
${({$selected:e,theme:t})=>e?v`
|
|
536
950
|
background-color: ${t.v2.colors.purple[900]};
|
|
537
951
|
border-color: ${t.v2.colors.purple[400]};
|
|
538
|
-
`:
|
|
952
|
+
`:v`
|
|
539
953
|
&:hover {
|
|
540
954
|
background-color: ${t.v2.colors.silver[700]};
|
|
541
955
|
}
|
|
542
956
|
`}
|
|
543
|
-
`,
|
|
957
|
+
`,wm=f.div`
|
|
544
958
|
display: flex;
|
|
545
959
|
align-items: center;
|
|
546
960
|
gap: 8px;
|
|
547
961
|
padding: 12px 16px;
|
|
548
|
-
|
|
962
|
+
`,Tm=f.div`
|
|
549
963
|
flex: 1;
|
|
550
964
|
padding: 8px;
|
|
551
965
|
display: flex;
|
|
552
966
|
flex-direction: column;
|
|
553
967
|
gap: 8px;
|
|
554
|
-
`,
|
|
968
|
+
`,km=f.div`
|
|
555
969
|
flex: 1;
|
|
556
970
|
display: flex;
|
|
557
971
|
flex-direction: column;
|
|
@@ -559,17 +973,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
559
973
|
padding: 12px;
|
|
560
974
|
border-radius: 12px;
|
|
561
975
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
562
|
-
`,
|
|
976
|
+
`,Em=f.div`
|
|
563
977
|
display: flex;
|
|
564
978
|
justify-content: flex-end;
|
|
565
|
-
`,
|
|
979
|
+
`,Im=f.div`
|
|
566
980
|
display: flex;
|
|
567
981
|
align-items: center;
|
|
568
982
|
gap: 8px;
|
|
569
983
|
padding: 4px 12px 4px 4px;
|
|
570
984
|
border-radius: 8px;
|
|
571
985
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
572
|
-
`,
|
|
986
|
+
`,Om=f.div`
|
|
573
987
|
display: flex;
|
|
574
988
|
align-items: center;
|
|
575
989
|
justify-content: center;
|
|
@@ -577,13 +991,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
577
991
|
height: 24px;
|
|
578
992
|
border-radius: 6px;
|
|
579
993
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
580
|
-
`,
|
|
994
|
+
`,Nm=({selected:o,onSelect:n,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=b(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(xm,{$selected:o,onClick:n,children:[e(wm,{children:[t(ye,{"data-id":`sampling-onboarding-radio-${i}`,value:o,onChange:n,size:Se.L}),t(ml,{size:24,fill:d.v2.colors.white[500]}),t(ce,{size:ue.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Tm,{children:[e(km,{$selected:o,children:[e(Z,{$gap:8,children:[t(Ke,{...l,textSize:ue.XXXS}),t(ce,{size:ue.XXS,color:u,children:a})]}),r&&r.length>0&&t(rm,{color:u,items:r}),s&&e(Im,{children:[t(Om,{children:t(gl,{size:18,fill:d.v2.colors.yellow[500]})}),t(ce,{size:ue.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Em,{children:t(he,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:qn,rightIcon:Ia,variant:ge.Text,size:me.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},$m=({strategy:n,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=b(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(om,{title:Pn,onBack:a}),e(Zh,{$width:854,children:[t(hm,{children:Ln}),e(Sm,{children:[t(Nm,{selected:"keep-list"===n,onSelect:()=>i("keep-list"),name:Un,description:Xn,badgeProps:{label:Bn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Mn,zn],warning:Fn,onReadMore:c}),t(Nm,{selected:"drop-list"===n,onSelect:()=>i("drop-list"),name:Wn,description:Gn,badgeProps:{label:jn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Vn,Hn],onReadMore:c}),t(Nm,{selected:"advanced"===n,onSelect:()=>i("advanced"),name:Jn,description:Yn,badgeProps:{label:Kn,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(em,{onNext:l})]})},Am=({onBack:n,onNext:i,submitting:l})=>{const r=b(),s=a(()=>[{title:ti,bullets:[Zn,Qn,ei]},{title:ri,bullets:[oi,ni,ii,ai,li]}],[]);return e(o,{children:[t(om,{title:si,onBack:n}),e(Zh,{$width:854,children:[t(hm,{children:ci}),t(pe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(im,{fillHeight:!0,width:"50%",children:[t(ce,{size:ue.XS,color:r.v2.colors.white[500],children:o.title}),t(rm,{items:o.bullets})]},n))}),t(cm,{message:di})]}),t(em,{onNext:i,nextLoading:l})]})},Rm=f.div`
|
|
581
995
|
white-space: pre-line;
|
|
582
|
-
`,
|
|
996
|
+
`,Dm=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=b(),d=a(()=>A(n?{disabled:!1}:null),[n]);return e(o,{children:[t(om,{title:ui,onBack:l}),e(Zh,{$width:854,children:[t(hm,{children:pi}),e(Z,{$gap:8,$width:"100%",children:[e(im,{children:[t(Rm,{children:t(ce,{size:ue.XXS,color:c.v2.colors.silver[200],children:hi})}),t(cm,{message:di})]}),e(dm,{children:[e(um,{children:[t(ce,{size:ue.S,weight:500,color:c.v2.colors.white[500],children:mi}),t(el,{size:16,fill:c.v2.colors.silver[200]})]}),t(pm,{children:t(Kh,{name:fi,recommended:!0,toggleLabel:gi,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(em,{onNext:r,nextLoading:s})]})},_m=f.div`
|
|
583
997
|
white-space: pre-line;
|
|
584
|
-
`,
|
|
998
|
+
`,Pm=f.div`
|
|
585
999
|
width: fit-content;
|
|
586
|
-
`,_p=["50","25","10","1","0.1"],zp=({value:n,onChange:o,label:i})=>{const l=f(),r=a(()=>_p.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(q,{$gap:8,children:[t(se,{size:de.XS,color:l.v2.colors.white[500],children:i}),t(Mp,{children:t(ge,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},Bp=({errorPresetEnabled:o,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>N(o?{disabled:!1}:null),[o]);return e(n,{children:[t(ap,{title:ha,onBack:s}),e(ep,{$width:854,children:[t(gp,{children:ma}),e(q,{$gap:8,$width:"100%",children:[e(lp,{children:[t(Lp,{children:t(se,{size:de.XXS,color:u.v2.colors.silver[200],children:ga})}),t(cp,{items:[fa,ba,ya,va,Ca]}),t(up,{message:la})]}),e(pp,{children:[e(hp,{children:[t(se,{size:de.S,weight:500,color:u.v2.colors.white[500],children:Sa}),t(Ui,{size:16,fill:u.v2.colors.silver[200]})]}),t(mp,{children:t(Ju,{name:pa,recommended:!0,toggleLabel:ua,enabled:o,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(mp,{children:t(zp,{value:l,onChange:r,label:wa})})]})]})]}),t(np,{onNext:c,nextLoading:d})]})},Xp=({isOpen:e,onClose:n,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s})=>{const{samplingApi:c}=bl(),[d,u]=r("welcome"),[p,h]=r(!0),[m,g]=r("keep-list"),[f,b]=r(!0),[y,v]=r("25"),[C,S]=r(!1);o(()=>{e&&(u("welcome"),h(a?.enabled??!0),g("keep-list"),b(!0),v("25"),S(!1))},[e,a?.enabled]);const w=l(async()=>{const e=i??"default",t=[];if(p!==(a?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:a?.keepPercentage??0}))}if("advanced"!==m&&f){const n=c.createHighlyRelevant;n&&t.push(n({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const n=c.createCostReduction;n&&t.push(n({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(y)}}))}S(!0);try{await Promise.all(t),u("success")}catch{}finally{S(!1)}},[i,c,p,a?.enabled,a?.keepPercentage,m,f,y]);let x=null;switch(d){case"welcome":x=t(wp,{onSkip:n,onNext:()=>u("noisy")});break;case"noisy":x=t(bp,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":x=t(Rp,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":x=t(Bp,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:y,onAmbientPercentageChange:v,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":x=t(Fp,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":x=t(Dp,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":x=t(vp,{onClose:n})}return t(eo,{isOpen:e,onClose:n,children:x})};var Vp,Up;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Vp||(Vp={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Up||(Up={}));const jp=[{key:Up.Name,label:"Name"},{key:Up.Type,label:"Type"},{key:Up.Status,label:"Status"},{key:Up.OdigosVersion,label:"Odigos Version"},{key:Up.ConnectedSince,label:"Connected Since"},{key:Up.LastActivity,label:"Last Activity"}],Gp=(e,t)=>{const n=e.find(e=>e.key===Up.Id)?.rawValue;return t(n?.toString()||"")},Hp=e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Up.Status)?.rawValue===Pe.Success)(e))return[{id:Zn(),label:"Delete Connection",rightIcon:xi,onClick:()=>Gp(e,a)}];if(!Gp(e,e=>{const n=t.find(t=>t.id===e);return n?.type===xa.K8s}))return[];const d=Gp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&O(o.odigosVersion,n)}),u=Gp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&O(n.odigosVersion,o)}),p=[];return i&&p.push({id:Zn(),tooltip:u?qe.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Fi,disabled:!u,onClick:()=>Gp(e,i)}),l&&p.push({id:Zn(),tooltip:qe.ADD_DESTINATION,rightIcon:Ai,onClick:()=>Gp(e,l)}),r&&p.push({id:Zn(),tooltip:qe.ADD_ACTION,rightIcon:Ei,onClick:()=>Gp(e,r)}),s&&p.push({id:Zn(),tooltip:qe.ADD_INSTRUMENTATION_RULE,rightIcon:Pi,onClick:()=>Gp(e,s)}),c&&p.push({id:Zn(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Mi,disabled:!d,onClick:()=>Gp(e,c)}),p}},Wp=({connections:n,getConnections:i,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=f(),{formatTimeAgo:h}=Ht(),{capabilities:m}=bl(),[g,b]=r(!1),[y,v]=r(n||[]),C=l(async()=>{try{b(!0),v(await i()??[])}catch(e){}finally{b(!1)}},[]);o(()=>{y.length||C()},[]);const[S,w]=r(""),[x,k]=r(null),[T,$]=r([]),I=a(()=>x===Vp.BulkConfig?d:x===Vp.BulkSource?u:0,[x,d,u]),{supportedConnections:E,supportedConnectionIds:A}=a(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=O(e.odigosVersion,t);return n&&o}))(y,I);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[y,I]);o(()=>{if(!x||x===Vp.Delete)return;const e=T.filter(e=>!A.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[x,T.length,A.length]);const N=a(()=>y.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:Up.Id,rawValue:e.id},{key:Up.Name,rawValue:e.name},{key:Up.Type,rawValue:e.type},{key:Up.Status,rawValue:e.status,component:()=>(e=>{const n=e===Pe.Success?"Connection live":"Connection lost",o=e===Pe.Success?Ri:Di;return t(We,{status:e,label:n,leftIcon:o})})(e.status)},{key:Up.OdigosVersion,rawValue:e.odigosVersion},{key:Up.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:Up.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||x?void 0:()=>s(e),isSelected:T.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||x===Vp.BulkConfig&&!O(e.odigosVersion,d)||x===Vp.BulkSource&&!O(e.odigosVersion,u)})),[y,T,S,x,d,u,h,s]),R=a(()=>y.length>0&&y.every(e=>e.type===xa.K8s),[y]),D=a(()=>{const e=(e,t)=>{$([e]),k(t)};return Hp({connections:y,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,Vp.Delete),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?t=>e(t,Vp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?t=>e(t,Vp.BulkDestination):void 0,onAddAction:m.canCreateAction?t=>e(t,Vp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?t=>e(t,Vp.BulkInstrumentationRule):void 0,onEditConfiguration:m.canApplyEffectiveConfig?t=>e(t,Vp.BulkConfig):void 0})},[y,d,u,m]),P=a(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];n&&r.push({id:Zn(),type:nn.Button,buttonProps:{variant:me.Primary,size:he.S,label:"Add Sources",rightIcon:Fi,onClick:n}});const s=[o?{id:Vp.BulkDestination,label:qe.ADD_DESTINATION,icon:Ai}:null,a?{id:Vp.BulkAction,label:qe.ADD_ACTION,icon:Ei}:null,i?{id:Vp.BulkInstrumentationRule,label:qe.ADD_INSTRUMENTATION_RULE,icon:Pi}:null,l?{id:Vp.BulkConfig,label:"Manage Configurations",icon:Mi}:null];return s.some(Boolean)&&r.push({id:Zn(),type:nn.ButtonDropData,buttonProps:{variant:me.Secondary,size:he.S,label:"Bulk Operations",onClick:e=>{e===Vp.BulkSource?n?.():e===Vp.BulkDestination?o?.():e===Vp.BulkAction?a?.():e===Vp.BulkInstrumentationRule?i?.():e===Vp.BulkConfig&&l?.()}},dropDataProps:{alignX:qn.Left,items:s}}),r.push({id:Zn(),type:nn.Button,buttonProps:{variant:me.Text,size:he.S,label:Dt.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?()=>k(Vp.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?()=>k(Vp.BulkDestination):void 0,onAddAction:m.canCreateAction?()=>k(Vp.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?()=>k(Vp.BulkInstrumentationRule):void 0,onManageConfigurations:m.canApplyEffectiveConfig?()=>k(Vp.BulkConfig):void 0}),[m]);return t(ka,{children:e(rt,{fullHeight:!0,richTitle:{icon:cl,title:qe.CONNECTIONS,badge:{label:y.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:Zn(),type:nn.Button,buttonProps:{variant:me.Secondary,size:he.S,leftIcon:Xi,onClick:C,disabled:g}}],children:[t(wn,{variant:xn.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:g,withCheckboxes:R,columns:jp,rows:N,rowActionsPushRightPosition:x?`calc(${Ll} - 24px)`:void 0,getRowActions:D}),x===Vp.BulkConfig&&m.canApplyEffectiveConfig&&t(_l,{connectionIds:T,children:t(dc,{onClose:()=>k(null),connections:E,selectedConnectionIds:T,setSelectedConnectionIds:$})}),x===Vp.BulkSource&&m.canFetchSnapshots&&m.canBulkPersistSources&&t(_l,{connectionIds:T,children:t(Zl,{selectedConnectionIds:T,children:t(rc,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Vp.BulkDestination&&m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canTestConnection&&m.canCreateDestination&&t(_l,{connectionIds:T,children:t(Ql,{children:t(Bs,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Vp.BulkAction&&m.canCreateAction&&t(_l,{connectionIds:T,children:t(er,{children:t(Ns,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===Vp.BulkInstrumentationRule&&m.canCreateInstrumentationRule&&t(_l,{connectionIds:T,children:t(tr,{children:t(Xs,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),t(Rl,{target:"connection",isOpen:x===Vp.Delete,onClose:()=>{$([]),k(null)},onApprove:async()=>{const e=T[0];e&&(await c(e),await C())}}),t(kn,{isOpen:!!T.length&&!x,richTitle:{icon:Ci,title:"Selected Clusters",badge:{label:T.length}},actions:P})]})})},Kp=g.div`
|
|
1000
|
+
`,Lm=["50","25","10","1","0.1"],Fm=({value:o,onChange:n,label:i})=>{const l=b(),r=a(()=>Lm.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(Z,{$gap:8,children:[t(ce,{size:ue.XS,color:l.v2.colors.white[500],children:i}),t(Pm,{children:t(fe,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},Mm=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=b(),p=a(()=>A(n?{disabled:!1}:null),[n]);return e(o,{children:[t(om,{title:bi,onBack:s}),e(Zh,{$width:854,children:[t(hm,{children:vi}),e(Z,{$gap:8,$width:"100%",children:[e(im,{children:[t(_m,{children:t(ce,{size:ue.XXS,color:u.v2.colors.silver[200],children:yi})}),t(rm,{items:[Ci,Si,xi,wi,Ti]}),t(cm,{message:di})]}),e(dm,{children:[e(um,{children:[t(ce,{size:ue.S,weight:500,color:u.v2.colors.white[500],children:ki}),t(el,{size:16,fill:u.v2.colors.silver[200]})]}),t(pm,{children:t(Kh,{name:fi,recommended:!0,toggleLabel:gi,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(pm,{children:t(Fm,{value:l,onChange:r,label:Ei})})]})]})]}),t(em,{onNext:c,nextLoading:d})]})},zm=({isOpen:e,onClose:o,k8sHealthProbesConfig:n,samplingId:a,docsUrl:l})=>{const{samplingApi:c}=Nl(),[d,u]=s("welcome"),[p,h]=s(!0),[m,g]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);i(()=>{e&&(u("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(p!==(n?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,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),u("success")}catch{}finally{S(!1)}},[a,c,p,n?.enabled,n?.keepPercentage,m,f,v]);let w=null;switch(d){case"welcome":w=t(Cm,{onSkip:o,onNext:()=>u("noisy")});break;case"noisy":w=t(gm,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":w=t($m,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:l});break;case"keep-list":w=t(Mm,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Dm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(Am,{onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"success":w=t(bm,{onClose:o})}return t(an,{isOpen:e,onClose:o,children:w})};var Bm,Xm;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Bm||(Bm={})),function(e){e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"}(Xm||(Xm={}));const Um=[{id:Xm.K8s,label:"K8s"},{id:Xm.VmAgent,label:"VM agent"},{id:Xm.CloudConnector,label:"Cloud Connector"}];var Vm;!function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Vm||(Vm={}));const Hm=[{key:Vm.Name,label:"Name"},{key:Vm.Type,label:"Type"},{key:Vm.Status,label:"Status"},{key:Vm.OdigosVersion,label:"Odigos Version"},{key:Vm.ConnectedSince,label:"Connected Since"},{key:Vm.LastActivity,label:"Last Activity"}],jm=(e,t)=>{const o=e.find(e=>e.key===Vm.Id)?.rawValue;return t(o?.toString()||"")},Gm=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===Vm.Status)?.rawValue===Pe.Success)(e))return[{id:on(),label:"Delete Connection",rightIcon:Oa,onClick:()=>jm(e,i)}];if(!jm(e,e=>{const o=t.find(t=>t.id===e);return o?.type===Ii.K8s}))return[];const d=jm(e,e=>{const n=t.find(t=>t.id===e);return!!n&&R(n.odigosVersion,o)}),u=jm(e,e=>{const o=t.find(t=>t.id===e);return!!o&&R(o.odigosVersion,n)}),p=[];return a&&p.push({id:on(),tooltip:u?Ze.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Ba,disabled:!u,onClick:()=>jm(e,a)}),l&&p.push({id:on(),tooltip:Ze.ADD_DESTINATION,rightIcon:_a,onClick:()=>jm(e,l)}),r&&p.push({id:on(),tooltip:Ze.ADD_ACTION,rightIcon:Da,onClick:()=>jm(e,r)}),s&&p.push({id:on(),tooltip:Ze.ADD_INSTRUMENTATION_RULE,rightIcon:za,onClick:()=>jm(e,s)}),c&&p.push({id:on(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ya,disabled:!d,onClick:()=>jm(e,c)}),p}},Wm={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},Km={[Ii.K8s]:ao.Purple,[Ii.Vm]:ao.Blue,[Ii.Connector]:ao.Green},Ym=({connections:o,getConnections:n,onClickConnection:l,deleteConnection:c,onCreateNew:d,cloudConnectorProviders:u,onCreateCloudConnector:p,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=b(),{formatTimeAgo:f}=qt(),{capabilities:v}=Nl(),[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),[O,N]=s([]),[$,A]=s(!1),[D,_]=s(!1),P=r(()=>{A(!1),_(!0),w()},[w]),L=r(e=>{e===Xm.CloudConnector?A(!0):d?.(e)},[d]),F=a(()=>E===Bm.BulkConfig?h:E===Bm.BulkSource?m:0,[E,h,m]),{supportedConnections:M,supportedConnectionIds:z}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Pe.Success,n=R(e.odigosVersion,t);return o&&n}))(S,F);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,F]);i(()=>{if(!E||E===Bm.Delete)return;const e=O.filter(e=>!z.includes(e));e.length&&N(t=>t.filter(t=>!e.includes(t)))},[E,O.length,z.length]);const B=a(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:Vm.Id,rawValue:e.id},{key:Vm.Name,rawValue:e.name},{key:Vm.Type,rawValue:e.type,component:()=>t(Yt,{variant:Km[e.type]??ao.Default,label:Oi(e.type)})},{key:Vm.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Ii.Connector){const o=Wm[e.status]??"Pending",n=e.status===Pe.Success?Fa:e.status===Pe.Error?Ma:void 0;return t(Ke,{status:e.status,label:o,leftIcon:n})}const o=e.status===Pe.Success?"Connection live":"Connection lost",n=e.status===Pe.Success?Fa:Ma;return t(Ke,{status:e.status,label:o,leftIcon:n})})(e)},{key:Vm.OdigosVersion,rawValue:e.odigosVersion},{key:Vm.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:Vm.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||E?void 0:()=>l(e),isSelected:O.includes(e.id),onSelect:()=>N(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>N(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||E===Bm.BulkConfig&&!R(e.odigosVersion,h)||E===Bm.BulkSource&&!R(e.odigosVersion,m)})),[S,O,T,E,h,m,f,l]),X=a(()=>S.length>0&&S.every(e=>e.type===Ii.K8s),[S]),U=a(()=>{const e=(e,t)=>{N([e]),I(t)};return Gm({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,Bm.Delete),onAddSource:v.canFetchSnapshots&&v.canBulkPersistSources?t=>e(t,Bm.BulkSource):void 0,onAddDestination:v.canFetchDestinationCategories&&v.canFetchPotentialDestinations&&v.canCreateDestination?t=>e(t,Bm.BulkDestination):void 0,onAddAction:v.canCreateAction?t=>e(t,Bm.BulkAction):void 0,onAddInstrumentationRule:v.canCreateInstrumentationRule?t=>e(t,Bm.BulkInstrumentationRule):void 0,onEditConfiguration:v.canApplyEffectiveConfig?t=>e(t,Bm.BulkConfig):void 0})},[S,h,m,v]),V=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];o&&r.push({id:on(),type:ro.Button,buttonProps:{variant:ge.Primary,size:me.S,label:"Add Sources",rightIcon:Ba,onClick:o}});const s=[n?{id:Bm.BulkDestination,label:Ze.ADD_DESTINATION,icon:_a}:null,i?{id:Bm.BulkAction,label:Ze.ADD_ACTION,icon:Da}:null,a?{id:Bm.BulkInstrumentationRule,label:Ze.ADD_INSTRUMENTATION_RULE,icon:za}:null,l?{id:Bm.BulkConfig,label:"Manage Configurations",icon:Ya}:null];return s.some(Boolean)&&r.push({id:on(),type:ro.ButtonDropData,buttonProps:{variant:ge.Secondary,size:me.S,label:"Bulk Operations",onClick:e=>{e===Bm.BulkSource?o?.():e===Bm.BulkDestination?n?.():e===Bm.BulkAction?i?.():e===Bm.BulkInstrumentationRule?a?.():e===Bm.BulkConfig&&l?.()}},dropDataProps:{alignX:tn.Left,items:s}}),r.push({id:on(),type:ro.Button,buttonProps:{variant:ge.Text,size:me.S,label:Pt.CANCEL,onClick:t}}),r})({onCancel:()=>N([]),onAddSource:v.canFetchSnapshots&&v.canBulkPersistSources?()=>I(Bm.BulkSource):void 0,onAddDestination:v.canFetchDestinationCategories&&v.canFetchPotentialDestinations&&v.canCreateDestination?()=>I(Bm.BulkDestination):void 0,onAddAction:v.canCreateAction?()=>I(Bm.BulkAction):void 0,onAddInstrumentationRule:v.canCreateInstrumentationRule?()=>I(Bm.BulkInstrumentationRule):void 0,onManageConfigurations:v.canApplyEffectiveConfig?()=>I(Bm.BulkConfig):void 0}),[v]);return t(Ni,{children:e(st,{fullHeight:!0,richTitle:{icon:Cl,title:Ze.CONNECTIONS,badge:{label:S.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:ro.Button,buttonProps:{variant:ge.Secondary,size:me.S,leftIcon:Ka,onClick:w,disabled:y}},{id:"connections-create-new",type:ro.ButtonDropData,buttonProps:{variant:ge.Primary,size:me.S,label:Pt.CREATE_NEW,onClick:e=>L(e)},dropDataProps:{alignX:tn.Right,items:Um}}],children:[t(Eo,{variant:Io.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:X,columns:Hm,rows:B,rowActionsPushRightPosition:E?`calc(${Hl} - 24px)`:void 0,getRowActions:U}),E===Bm.BulkConfig&&v.canApplyEffectiveConfig&&t(ql,{connectionIds:O,children:t(su,{onClose:()=>I(null),connections:M,selectedConnectionIds:O,setSelectedConnectionIds:N})}),E===Bm.BulkSource&&v.canFetchSnapshots&&v.canBulkPersistSources&&t(ql,{connectionIds:O,children:t(pr,{selectedConnectionIds:O,children:t(wc,{onClose:()=>I(null),selectedConnectionIds:O,setSelectedConnectionIds:N})})}),E===Bm.BulkDestination&&v.canFetchDestinationCategories&&v.canFetchPotentialDestinations&&v.canTestConnection&&v.canCreateDestination&&t(ql,{connectionIds:O,children:t(hr,{children:t(tc,{onClose:()=>I(null),selectedConnectionIds:O,setSelectedConnectionIds:N})})}),E===Bm.BulkAction&&v.canCreateAction&&t(ql,{connectionIds:O,children:t(mr,{children:t(js,{onClose:()=>I(null),selectedConnectionIds:O,setSelectedConnectionIds:N})})}),E===Bm.BulkInstrumentationRule&&v.canCreateInstrumentationRule&&t(ql,{connectionIds:O,children:t(gr,{children:t(oc,{onClose:()=>I(null),selectedConnectionIds:O,setSelectedConnectionIds:N})})}),$&&t(fr,{providers:u,children:t(au,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:p,onCreated:P})}),t(Yl,{isOpen:D,onClose:()=>_(!1)}),t(Gl,{target:"connection",isOpen:E===Bm.Delete,onClose:()=>{N([]),I(null)},onApprove:async()=>{const e=O[0];e&&(await c(e),await w())}}),t(Oo,{isOpen:!!O.length&&!E,richTitle:{icon:ka,title:"Selected Clusters",badge:{label:O.length}},actions:V})]})})},Jm=f.div`
|
|
587
1001
|
display: flex;
|
|
588
1002
|
align-items: center;
|
|
589
1003
|
justify-content: space-between;
|
|
@@ -592,26 +1006,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
592
1006
|
width: 100%;
|
|
593
1007
|
border-radius: 16px;
|
|
594
1008
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
595
|
-
`,
|
|
1009
|
+
`,qm=f.div`
|
|
596
1010
|
display: flex;
|
|
597
1011
|
align-items: center;
|
|
598
1012
|
justify-content: center;
|
|
599
1013
|
padding: 8px;
|
|
600
1014
|
border-radius: 8px;
|
|
601
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
602
|
-
`,
|
|
1015
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+dt["004"]};
|
|
1016
|
+
`,Zm=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=b(),c=()=>o(2),d=()=>o(3),u=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,i)=>{if(!o.selected)return null;const a=o.kind||Tt.Namespace,l=a===Tt.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(Jm,{children:[t(ce,{nowrap:!0,children:l}),t(Ke,{label:a,status:Pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${i}`)})).filter(Boolean),[i]),p=a(()=>l?.map((o,n)=>{const i=St(o.option.type).icon;return e(Jm,{children:[e(pe,{$gap:8,children:[i&&t(qm,{children:t(i,{size:24})}),t(ce,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Ke,{status:o.testResult.succeeded?Pe.Success:Pe.Error,leftIcon:o.testResult.succeeded?Fa:Ma})]},`destination-${n}`)})||[],[l]);return t(Vl,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:qa,title:Ze.SUMMARY,subTitle:Ze.REVIEW_SETUP},leftColumn:{width:"50%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(Ba,{size:24}),t(ce,{nowrap:!0,children:Ze.SELECTED_SOURCES}),t(Ke,{label:u.length})]}),t(he,{"data-id":"summary-edit-sources",leftIcon:Na,variant:ge.Secondary,size:me.S,onClick:c})]}),list:u.length?u:[t(mt,{$height:"100%",children:t($e,{icon:Ba,title:Ze.NO_SOURCES_SELECTED,subTitle:Ze.ADD_SOURCE_PROMPT,button:{leftIcon:wa,label:Ze.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(pe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(pe,{$gap:8,children:[t(_a,{size:24}),t(ce,{nowrap:!0,children:Ze.SELECTED_DESTINATIONS}),t(Ke,{label:p.length})]}),t(he,{"data-id":"summary-edit-destinations",leftIcon:Na,variant:ge.Secondary,size:me.S,onClick:d})]}),list:p.length?p:[t(mt,{"data-id":"summary-no-destinations",$height:"100%",children:t($e,{icon:_a,title:Ze.NO_DESTINATIONS_SELECTED,subTitle:Ze.ADD_DESTINATION_PROMPT,button:{leftIcon:wa,label:Ze.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Qm=f.div`
|
|
603
1017
|
position: relative;
|
|
604
1018
|
overflow: hidden;
|
|
605
1019
|
width: 100vw;
|
|
606
1020
|
height: 100vh;
|
|
607
1021
|
box-sizing: border-box;
|
|
608
|
-
`,
|
|
1022
|
+
`,eg=f.svg`
|
|
609
1023
|
position: absolute;
|
|
610
1024
|
top: 50%;
|
|
611
1025
|
left: 50%;
|
|
612
1026
|
transform: translate(-50%, -50%);
|
|
613
1027
|
z-index: -1;
|
|
614
|
-
`,
|
|
1028
|
+
`,tg=[{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"}],og=[{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:tg},{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:tg},{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:tg}],ng=({paddingXAxis:o="0px",paddingYAxis:n="0px",children:l})=>{const[r,c]=s(window.innerWidth),d=a(()=>r/og[0].width,[r]);return i(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Qm,{$paddingXAxis:o,$paddingYAxis:n,children:[og.map(({width:o,height:n,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(eg,{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]})},ig=f.div`
|
|
615
1029
|
display: flex;
|
|
616
1030
|
flex-direction: column;
|
|
617
1031
|
align-items: center;
|
|
@@ -622,7 +1036,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
622
1036
|
width: 50vw;
|
|
623
1037
|
border-radius: 16px;
|
|
624
1038
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
625
|
-
`,
|
|
1039
|
+
`,ag=f.div`
|
|
626
1040
|
display: flex;
|
|
627
1041
|
flex-direction: column;
|
|
628
1042
|
align-items: center;
|
|
@@ -632,15 +1046,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
632
1046
|
& * {
|
|
633
1047
|
text-align: center;
|
|
634
1048
|
}
|
|
635
|
-
`,
|
|
1049
|
+
`,lg=({onStart:o})=>t(re,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(mt,{$height:"100%",children:e(ig,{children:[e(ag,{children:[t(ce,{size:ue.L,weight:500,children:Ze.GET_STARTED_WITH}),t(Kl,{size:260}),t(ce,{size:ue.S,weight:400,children:Ze.GET_STARTED_DESCRIPTION})]}),t(he,{"data-id":"onboarding-get-started",label:Pt.GET_STARTED,rightIcon:Ta,size:me.L,onClick:o})]})})}),rg=[{step:1,label:Ze.INSTALLATION,forceDoneBadge:!0},{step:2,label:Ze.SOURCES_SETUP},{step:3,label:Ze.DESTINATIONS_SETUP},{step:4,label:Ze.SUMMARY}],sg=f.div`
|
|
636
1050
|
display: flex;
|
|
637
1051
|
flex-direction: column;
|
|
638
1052
|
gap: 32px;
|
|
639
1053
|
padding: 64px;
|
|
640
|
-
`,
|
|
1054
|
+
`,cg=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:i})=>{const{setCurrentModal:a}=nn(),{sourcesApi:l,destinationsApi:r}=Nl(),[c,d]=s(1),[u,p]=s(!1),[h,m]=s(null),[g,f]=s(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(ng,{paddingXAxis:o,paddingYAxis:n,children:[e(sg,{children:[t(Kl,{useInline:!0}),t($i,{currentStep:c,data:rg,gap:32})]}),t(pr,{initialInputs:h,children:e(hr,{children:[1===c&&t(lg,{onStart:b}),2===c&&t(wc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(tc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Zm,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.map(e=>r.create(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};a(Hh),i()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},dg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),ug=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},pg=f.div`
|
|
641
1055
|
position: relative;
|
|
642
1056
|
display: inline-flex;
|
|
643
|
-
`,
|
|
1057
|
+
`,hg=f.button`
|
|
644
1058
|
display: inline-flex;
|
|
645
1059
|
align-items: center;
|
|
646
1060
|
gap: 8px;
|
|
@@ -653,7 +1067,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
653
1067
|
&:hover {
|
|
654
1068
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
655
1069
|
}
|
|
656
|
-
`,
|
|
1070
|
+
`,mg=f.div`
|
|
657
1071
|
position: absolute;
|
|
658
1072
|
top: calc(100% + 8px);
|
|
659
1073
|
right: 0;
|
|
@@ -666,25 +1080,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
666
1080
|
border-radius: 12px;
|
|
667
1081
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
668
1082
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
669
|
-
`,
|
|
1083
|
+
`,gg=f.div`
|
|
670
1084
|
display: flex;
|
|
671
1085
|
flex-direction: column;
|
|
672
1086
|
gap: 12px;
|
|
673
1087
|
padding: 16px;
|
|
674
1088
|
max-height: 60vh;
|
|
675
1089
|
overflow-y: auto;
|
|
676
|
-
`,
|
|
1090
|
+
`,fg=f.div`
|
|
677
1091
|
display: flex;
|
|
678
1092
|
align-items: center;
|
|
679
1093
|
gap: 8px;
|
|
680
1094
|
padding: 12px 16px;
|
|
681
1095
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
682
|
-
`,
|
|
1096
|
+
`,bg=f.div`
|
|
683
1097
|
display: flex;
|
|
684
1098
|
align-items: center;
|
|
685
1099
|
gap: 8px;
|
|
686
1100
|
margin-left: auto;
|
|
687
|
-
`,
|
|
1101
|
+
`,vg=()=>{const o=b(),{sourcesApi:n,namespacesApi:r}=Nl(),c=n.useSources().items,d=r.useNamespaces().items,{selectedStreamName:u}=Qe(),{getItemSS:p,setItemSS:h,removeItemSS:m}=Pi(),{namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:x,clearAll:w,getEmptyState:T}=Ai(),k=a(()=>Ri(c,u),[c,u]);i(()=>{const e=p(Di.OVERVIEW_FILTERS,T());x(e)},[]);const[E,I]=s({namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[O,N]=s(ug(E)),[$,A]=s(!1);i(()=>{if(!$){const e={namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),N(ug(e))}},[$,g,f,v,y,C,S]);const R=l(null);yo(R,()=>A(!1)),qo({key:"Escape",active:$},()=>A(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[d]),_=a(()=>{const e=new Set,t=[];return k.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[k]),P=a(()=>{const e=new Set,t=[];return k.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Ye[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[k]),L=a(()=>_i.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=a(()=>{const e=new Set,t=[];return k.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:i}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Gt(n)})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[k]),M=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));I(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},z=$?Pa:La,B=a(()=>dg(E.languages),[E.languages]);return e(pg,{ref:R,children:[e(hg,{"data-id":"filters-trigger",$isOpen:$,type:"button",onClick:()=>A(e=>!e),children:[t(Sl,{size:16,fill:o.v2.colors.white[500]}),t(ce,{size:ue.XS,weight:500,nowrap:!0,children:"Filters"}),O>0&&t(Ke,{label:O,status:Pe.Unknown,textSize:ue.XXXS}),t(z,{size:16,fill:o.v2.colors.silver[200]})]}),$&&e(mg,{children:[e(gg,{children:[t(ft,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:dg(E.namespaces),setValues:e=>M("namespaces",D,e)}),t(ft,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:dg(E.kinds),setValues:e=>M("kinds",_,e)}),t(ft,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:B,setValues:e=>M("languages",P,e)}),t(ft,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:dg(E.monitors),setValues:e=>M("monitors",L,e)}),t(ft,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:dg(E.podsAgentInjectionStatus),setValues:e=>M("podsAgentInjectionStatus",F,e)}),t(ie,{label:"Show only sources with errors",size:Et.L,value:!!E.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(fg,{children:[t(he,{"data-id":"filters-reset",size:me.S,variant:ge.Text,label:"Reset",onClick:()=>{m(Di.OVERVIEW_FILTERS),w(),I(T()),N(0),A(!1)},textColor:o.v2.colors.red[500]}),e(bg,{children:[t(he,{"data-id":"filters-cancel",size:me.S,variant:ge.Secondary,label:"Cancel",onClick:()=>A(!1)}),t(he,{"data-id":"filters-apply",size:me.S,variant:ge.Primary,label:"Apply",onClick:()=>{h(Di.OVERVIEW_FILTERS,E),x(E),N(ug(E)),A(!1)}})]})]})]})]})},yg=f.div`
|
|
688
1102
|
position: relative;
|
|
689
1103
|
display: flex;
|
|
690
1104
|
align-items: center;
|
|
@@ -695,7 +1109,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
695
1109
|
box-sizing: border-box;
|
|
696
1110
|
border-radius: 16px 16px 0 0;
|
|
697
1111
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
698
|
-
`,
|
|
1112
|
+
`,Cg=f.div`
|
|
699
1113
|
position: absolute;
|
|
700
1114
|
bottom: 0;
|
|
701
1115
|
left: 0;
|
|
@@ -704,7 +1118,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
704
1118
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
705
1119
|
border-radius: 32px;
|
|
706
1120
|
transition: width 0.3s;
|
|
707
|
-
`,
|
|
1121
|
+
`,Sg=({entityType:o,badge:n,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=nn();return e(yg,{children:[e(pe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(ee,{size:Li.S,partiallyChecked:r,value:!!s,onChange:c}),t(ce,{size:ue.S,nowrap:!0,children:`${Gt(o)}s`}),t(Ke,{label:n,tooltip:i,status:Pe.Unknown,textSize:ue.XXXS})]}),e(pe,{children:[t(bt,{"data-id":`add-${o}`,icon:wa,onClick:()=>u(o)}),t(bt,{"data-id":`refresh-${o}`,icon:Ka,onClick:l,disabled:a})]}),"number"==typeof d&&t(Cg,{$percent:d})]})},xg=f(Z)`
|
|
708
1122
|
align-items: center !important;
|
|
709
1123
|
justify-content: center !important;
|
|
710
1124
|
align-self: stretch;
|
|
@@ -719,7 +1133,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
719
1133
|
&:hover {
|
|
720
1134
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
721
1135
|
}
|
|
722
|
-
`,
|
|
1136
|
+
`,wg=({entityType:o,description:n})=>{const{setCurrentModal:i}=nn();return e(xg,{onClick:()=>i(o),children:[e(pe,{$gap:4,children:[t(wa,{size:16}),t(ce,{size:ue.S,children:`Add ${Gt(o)}`})]}),t(ce,{size:ue.XXS,align:"center",children:n})]})},Tg=f.div`
|
|
723
1137
|
display: flex;
|
|
724
1138
|
align-items: center;
|
|
725
1139
|
gap: 12px;
|
|
@@ -734,10 +1148,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
734
1148
|
&:hover {
|
|
735
1149
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
736
1150
|
}
|
|
737
|
-
`,
|
|
1151
|
+
`,kg=f(pe)`
|
|
738
1152
|
flex: 1;
|
|
739
1153
|
min-width: 0;
|
|
740
|
-
`,
|
|
1154
|
+
`,Eg=({entityId:o,entityType:n,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=b(),f=n===Tt.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=uo(),{selectedSources:x,setSelectedSources:w}=Fi(),T=m,k=f?T.id.namespace:"",E=a(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind):-1},[f,x,k,T.id]),I=v&&!h?Mi(Pe.Info,g):l?Mi(l,g):void 0,O=f&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(Tg,{"data-id":O,$faded:y,onClick:()=>{C(n),S(o)},children:[f&&t(ee,{size:Li.S,value:-1!==E,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===E?e[k].push(T):e[k].splice(E,1),w(e)}}),t(go,{icons:u,icon:d,iconSrc:p}),e(kg,{$gap:4,children:[t(Ae,{size:ue.XS,nowrap:!0,children:i}),t(pe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(Ie,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ke,{label:c,status:l&&[Pe.Error,Pe.Warning].includes(l)?l:Pe.Unknown,leftIcon:I,textSize:ue.XXXS})})})]})]})};function Ig(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:eo.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Og(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Pe.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Ng=f.div`
|
|
741
1155
|
position: absolute;
|
|
742
1156
|
top: 0;
|
|
743
1157
|
left: 0;
|
|
@@ -748,21 +1162,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
748
1162
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
749
1163
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
750
1164
|
pointer-events: none;
|
|
751
|
-
|
|
1165
|
+
`,$g=f.div`
|
|
752
1166
|
display: flex;
|
|
753
1167
|
align-items: center;
|
|
754
1168
|
gap: 8px;
|
|
755
1169
|
padding: 4px 8px 0;
|
|
756
|
-
`,
|
|
1170
|
+
`,Ag=f.div`
|
|
757
1171
|
flex: 1;
|
|
758
1172
|
height: 1px;
|
|
759
1173
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
760
|
-
`,
|
|
1174
|
+
`,Rg=({namespace:e})=>{const o=b();return t(Ng,{children:t(ce,{size:ue.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},Dg=({namespace:o})=>{const n=b();return e($g,{children:[t(Ag,{}),t(ce,{size:ue.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Ag,{})]})},_g={[Tt.InstrumentationRule]:Ze.NO_DATA_INSTRUMENTATION_RULES,[Tt.Source]:Ze.NO_DATA_SOURCES,[Tt.Action]:Ze.NO_DATA_ACTIONS,[Tt.Destination]:Ze.NO_DATA_DESTINATIONS},Pg=f.div`
|
|
761
1175
|
display: flex;
|
|
762
1176
|
flex-direction: column;
|
|
763
1177
|
flex: 1 0 0;
|
|
764
1178
|
min-width: 0;
|
|
765
|
-
`,
|
|
1179
|
+
`,Lg=f.div`
|
|
766
1180
|
display: flex;
|
|
767
1181
|
flex-direction: column;
|
|
768
1182
|
align-items: stretch;
|
|
@@ -772,7 +1186,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
772
1186
|
border-radius: 0 0 16px 16px;
|
|
773
1187
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
774
1188
|
overflow: hidden;
|
|
775
|
-
`,
|
|
1189
|
+
`,Fg=f.div`
|
|
776
1190
|
position: relative;
|
|
777
1191
|
display: flex;
|
|
778
1192
|
flex-direction: column;
|
|
@@ -784,7 +1198,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
784
1198
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
785
1199
|
height: ${({$height:e})=>e}px;
|
|
786
1200
|
overflow: hidden;
|
|
787
|
-
`,
|
|
1201
|
+
`,Mg=(e,t,o)=>{const n=Ft(e);if(!n)return null;const i=t===Tt.Source;let a,l,r=!1,s=e;if(i){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case eo.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case eo.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case eo.Pending:case eo.Waiting:return{status:void 0,faded:!1,displaySource:Ig(e)};case eo.Unsupported:case eo.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Og(e)}}}(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=Bi(e.conditions);a=t,r=o}const c=Xi(e,t,{extended:i,prioritizeDisplayName:!i});let d,u,p,h,m;switch(t){case Tt.Source:{d=mo(e),u=Vi(Tt.Source);const t=o?.get(Ui(n));h=bo(t);break}case Tt.Destination:{const t=St(e.destinationType.type);u=t.icon,p=t.iconSrc;const i=o?.get(Ui(n));h=bo(i),m=!e.disabled;break}case Tt.Action:u=Xt(e.type),m=!e.disabled;break;case Tt.InstrumentationRule:u=Jt(e.type),m=!e.disabled}return{key:Ui(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}}},zg=({entityType:o,entities:n,unfilteredCount:l,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const h=o===Tt.Source,m=n.length!==l,g=Ot(e=>h?e.progress[At.Instrumenting]?.percentage:void 0),f=Ot(e=>h?e.progress[At.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Fi(),C=a(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=a(()=>{if(!c)return;const e=new Map,t=o===Tt.Source?c.sources:o===Tt.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(zi(o),o.throughput);return e},[c,o]),x=a(()=>n.map(e=>Mg(e,o,S)).filter(Boolean),[n,o,S]),[w,T]=s(""),{elements:k,indexToNamespace:E,multipleNs:I,dividerCount:O}=a(()=>{const e=[],o=[],n=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const n of x)h&&n.namespace&&n.namespace!==a&&(""!==a&&(o.push(n.namespace),e.push(t(Dg,{namespace:n.namespace},`ns-divider-${n.namespace}`)),i+=1),a=n.namespace),o.push(n.namespace||""),e.push(t(Eg,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:i}},[x,h]);i(()=>{if(h&&E.length&&!w){const e=E.find(Boolean);e&&T(e)}},[h,E]);const N=r(e=>{if(!E.length)return;const t=E[Math.min(e,E.length-1)];t&&t!==w&&T(t)},[E,w]),$=58*x.length+(I?28:0)+32*O,A=Math.max(0,u-52-16),R=Math.min(A,$)+8,D="number"==typeof b?`${b}%`:m?`${n.length}/${l}`:l;return e(Pg,{children:[t(Sg,{entityType:o,badge:D,badgeTooltip:m?Ze.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,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(Lg,{children:n.length?e(Fg,{$height:R,children:[I&&w&&t(Rg,{namespace:w}),t(co,{gap:4,elements:k,onTopIndexChange:I?N:void 0})]}):d?t(ht,{size:3}):t(wg,{entityType:o,description:_g[o]??Ze.TO_COLLECT_OTEL_DATA})})]})},Bg=f.div`
|
|
788
1202
|
width: 100%;
|
|
789
1203
|
flex: 1;
|
|
790
1204
|
min-height: 0;
|
|
@@ -792,10 +1206,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
792
1206
|
display: flex;
|
|
793
1207
|
align-items: stretch;
|
|
794
1208
|
gap: 16px;
|
|
795
|
-
`,
|
|
1209
|
+
`,Xg={sources:[],destinations:[]},Ug=()=>{const o=Ai(),{selectedStreamName:n}=Qe(),{containerRef:i,containerHeight:l}=Hi(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=Nl(),{items:p,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=uo(e=>e.drawerType),S=nn(e=>e.currentModal),{data:x}=u.useMetrics({skip:!(p.length&&m.length&&!C&&!S),pollInterval:1e4,fetchPolicy:"network-only"}),w=x?.getOverviewMetrics??Xg,T=a(()=>Ri(p,n),[p,n]),k=a(()=>Ht(m,n),[m,n]),E=a(()=>ji(T,o),[T,o]),I=a(()=>Gi(k,o),[k,o]),O=a(()=>Wi(f,o),[f,o]);return e(Bg,{ref:i,children:[t(zg,{entityType:Tt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(zg,{entityType:Tt.Source,entities:E,unfilteredCount:T.length,metrics:w,loading:h,maxHeight:l,refetch:r.fetchAll}),t(zg,{entityType:Tt.Action,entities:O,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(zg,{entityType:Tt.Destination,entities:I,unfilteredCount:k.length,metrics:w,loading:g,maxHeight:l,refetch:s.fetchAll})]})},Vg="40vw",Hg=f.div`
|
|
796
1210
|
position: relative;
|
|
797
|
-
width: ${
|
|
798
|
-
`,
|
|
1211
|
+
width: ${Vg};
|
|
1212
|
+
`,jg=f.div`
|
|
799
1213
|
position: absolute;
|
|
800
1214
|
top: calc(100% + 8px);
|
|
801
1215
|
left: 0;
|
|
@@ -804,23 +1218,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
804
1218
|
flex-direction: column;
|
|
805
1219
|
gap: 8px;
|
|
806
1220
|
padding: 8px;
|
|
807
|
-
width: calc(${
|
|
1221
|
+
width: calc(${Vg} - 16px);
|
|
808
1222
|
border-radius: 12px;
|
|
809
1223
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
810
1224
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
811
|
-
`,
|
|
1225
|
+
`,Gg=f.div`
|
|
812
1226
|
display: flex;
|
|
813
1227
|
align-items: center;
|
|
814
1228
|
overflow-x: auto;
|
|
815
|
-
`,
|
|
1229
|
+
`,Wg=f.div`
|
|
816
1230
|
display: flex;
|
|
817
1231
|
flex-direction: column;
|
|
818
1232
|
gap: 0;
|
|
819
1233
|
max-height: 60vh;
|
|
820
1234
|
overflow-y: auto;
|
|
821
|
-
`,
|
|
1235
|
+
`,Kg=f.div`
|
|
822
1236
|
padding: 8px 12px 4px 12px;
|
|
823
|
-
`,
|
|
1237
|
+
`,Yg=f.div`
|
|
824
1238
|
display: flex;
|
|
825
1239
|
align-items: center;
|
|
826
1240
|
gap: 8px;
|
|
@@ -830,12 +1244,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
830
1244
|
&:hover {
|
|
831
1245
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
832
1246
|
}
|
|
833
|
-
`,
|
|
1247
|
+
`,Jg=f.div`
|
|
834
1248
|
padding: 16px 8px;
|
|
835
|
-
`,
|
|
1249
|
+
`,qg=({preventPopup:o=!1})=>{const n=b(),{onClickNode:i}=Ki(),{searchText:r,setSearchText:d}=Ai(),{selectedStreamName:u}=Qe(),{sourcesApi:p,destinationsApi:h,actionsApi:m,instrumentationRulesApi:g}=Nl(),f=p.useSources().items,v=h.useDestinations().items,y=m.useActions().items,C=g.useRules().items,S=l(null),[x,w]=s(!1),[T,k]=s("all"),E=!o&&(!!r||x),I=()=>{d(""),w(!1),k("all")};yo(S,()=>I()),qo({key:"Escape",active:E},I);const{categories:O,searchResults:N}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?o.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,c=i?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,d=[{category:Tt.Source,label:"Sources",count:r.length,entities:[]},{category:Tt.Action,label:"Actions",count:s.length,entities:[]},{category:Tt.Destination,label:"Destinations",count:c.length,entities:[]},{category:Tt.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===Tt.InstrumentationRule?l:e.category===Tt.Source?r:e.category===Tt.Action?s:e.category===Tt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:C,sources:Ri(f,u),actions:y,destinations:Ht(v,u),searchText:r,selectedCategory:T}),[C,f,y,v,u,r,T]),$=a(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[O]),A=N.some(({entities:e})=>e.length>0);return e(Hg,{ref:S,children:[t(so,{value:r,onChange:e=>d(e.toLowerCase()),onFocus:()=>w(!0),width:Vg}),E&&e(jg,{children:[$.length>1&&t(Gg,{children:t(fe,{options:$,selected:T,setSelected:k})}),A?t(Wg,{children:N.map(({category:o,label:a,entities:l},r)=>{if(!l.length)return null;const s=Vi(o);return e(c,{children:[t(Kg,{children:t(ce,{size:ue.XXS,color:de.Secondary,children:a})}),l.map((a,l)=>e(Yg,{onClick:()=>{const e=Ft(a);i(null,{data:{type:o,id:e}}),I()},children:[s&&t(s,{size:16,fill:n.v2.colors.white[500]}),t(ce,{size:ue.XS,nowrap:!0,children:Xi(a,o,{extended:!0})})]},`entity-${r}-${l}`))]},`category-list-${o}`)})}):t(Jg,{children:t($e,{hideIcon:!0,title:"No results",subTitle:r?`No matches for "${r}"`:"Start typing to search"})})]})]})},Zg=({onRedirectToSampling:n})=>{const{sourcesApi:i}=Nl(),{items:l}=i.useSources(),{currentModal:r,setCurrentModal:s}=nn(),{drawerType:c,drawerEntityId:d,setDrawerType:u,setDrawerEntityId:p}=uo(),h=()=>{s("")},m=()=>{u(null),p(null)},g=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),f=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(o,{children:[t(jh,{}),r===Tt.Source&&t(pr,{children:t(wc,{onClose:h,withOverlay:!0})}),r===Tt.Destination&&t(hr,{children:t(tc,{onClose:h,withOverlay:!0})}),r===Tt.InstrumentationRule&&t(gr,{sourceOptions:g,namespaceOptions:f,children:t(oc,{onClose:h,withOverlay:!0})}),r===Tt.Action&&t(mr,{children:t(js,{onClose:h,withOverlay:!0})}),c===Tt.Source&&d&&t(br,{children:t(bh,{onClose:m,sourceId:d,onRedirectToSampling:n})}),c===Tt.Destination&&d&&t(hr,{children:t(du,{onClose:m,destinationId:d})}),c===Tt.InstrumentationRule&&d&&t(gr,{sourceOptions:g,namespaceOptions:f,children:t(pu,{onClose:m,ruleId:d})}),c===Tt.Action&&d&&t(mr,{children:t(ru,{onClose:m,actionId:d})})]})},Qg=e=>`Data Stream: ${e}`,ef="Search streams...",tf="No streams match",of=f.div`
|
|
836
1250
|
position: relative;
|
|
837
1251
|
display: inline-flex;
|
|
838
|
-
`,
|
|
1252
|
+
`,nf=f.div`
|
|
839
1253
|
display: inline-flex;
|
|
840
1254
|
align-items: center;
|
|
841
1255
|
gap: 6px;
|
|
@@ -846,7 +1260,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
846
1260
|
&:hover {
|
|
847
1261
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
848
1262
|
}
|
|
849
|
-
`,
|
|
1263
|
+
`,af=f.div`
|
|
850
1264
|
position: absolute;
|
|
851
1265
|
top: calc(100% + 8px);
|
|
852
1266
|
left: 0;
|
|
@@ -860,18 +1274,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
860
1274
|
border-radius: 12px;
|
|
861
1275
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
862
1276
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
863
|
-
`,
|
|
1277
|
+
`,lf=f.div`
|
|
864
1278
|
display: flex;
|
|
865
1279
|
align-items: center;
|
|
866
1280
|
gap: 8px;
|
|
867
1281
|
width: 100%;
|
|
868
|
-
`,
|
|
1282
|
+
`,rf=f.div`
|
|
869
1283
|
display: flex;
|
|
870
1284
|
flex-direction: column;
|
|
871
1285
|
gap: 0;
|
|
872
1286
|
max-height: 240px;
|
|
873
1287
|
overflow-y: auto;
|
|
874
|
-
`,
|
|
1288
|
+
`,sf=f.div`
|
|
875
1289
|
display: flex;
|
|
876
1290
|
align-items: center;
|
|
877
1291
|
gap: 8px;
|
|
@@ -882,29 +1296,29 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
882
1296
|
&:hover {
|
|
883
1297
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
884
1298
|
}
|
|
885
|
-
`,
|
|
1299
|
+
`,cf=f.div`
|
|
886
1300
|
flex: 1;
|
|
887
1301
|
min-width: 0;
|
|
888
1302
|
overflow: hidden;
|
|
889
1303
|
text-overflow: ellipsis;
|
|
890
1304
|
white-space: nowrap;
|
|
891
|
-
`,
|
|
1305
|
+
`,df=f.div`
|
|
892
1306
|
display: flex;
|
|
893
1307
|
align-items: center;
|
|
894
1308
|
gap: 2px;
|
|
895
1309
|
flex-shrink: 0;
|
|
896
|
-
`,
|
|
1310
|
+
`,uf=f.div`
|
|
897
1311
|
display: flex;
|
|
898
1312
|
padding-top: 4px;
|
|
899
1313
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
900
|
-
`,
|
|
1314
|
+
`,pf=()=>{const n=b(),{isVm:r}=C(),{clearStore:c}=Yi(),{dataStreamsApi:d}=Nl();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=Qe(),m=l(null),[g,f]=s(!1),[v,y]=s(""),[S,x]=s(""),[w,T]=s(!1),[k,E]=s(!1),[I,O]=s(!1),[N,$]=s(""),[A,R]=s(!1);yo(m,()=>f(!1)),i(()=>{g||y("")},[g]);const D=a(()=>{if(!v)return u;const e=v.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,v]),_=g?Pa:La;return r?null:e(o,{children:[e(of,{ref:m,children:[e(nf,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(xl,{size:24}),t(ce,{size:ue.S,weight:500,nowrap:!0,children:Qg(p)}),t(Ke,{label:u.length,status:Pe.Unknown,textSize:ue.XXXS}),t(_,{size:20,fill:n.v2.colors.silver[200]})]}),g&&e(af,{children:[t(lf,{children:t(so,{value:v,onChange:y,placeholder:ef,width:"100%"})}),t(rf,{children:0===D.length?t(sf,{children:t(ce,{size:ue.XS,color:de.Secondary,children:tf})}):D.map(({name:o})=>{const n=o===Ji;return e(sf,{"data-id":`stream-row-${o}`,$selected:o===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),f(!1)})(o),children:[t(cf,{children:t(ce,{size:ue.XS,nowrap:!0,children:o})}),e(df,{children:[t(bt,{"data-id":`stream-edit-${o}`,icon:Na,size:vt.XS,onClick:e=>{e.stopPropagation(),f(!1),x(o),T(!0)}}),!n&&t(bt,{"data-id":`stream-delete-${o}`,icon:xa,size:vt.XS,onClick:e=>{e.stopPropagation(),f(!1),$(o),R(!0)}})]})]},`stream-${o}`)})}),t(uf,{children:t(he,{"data-id":"add-stream-trigger",variant:ge.Secondary,size:me.S,leftIcon:wa,label:`${Pt.NEW} ${Ze.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),c(),O(!0),E(!0)}})})]})]}),I&&t(vr,{defaultExcludeName:p,children:t(Bh,{isOpen:k,onClose:()=>E(!1),onCloseEnd:()=>O(!1)})}),S&&t(vr,{children:t(Xh,{isOpen:w,dataStreamName:S,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Gl,{target:`${Ze.STREAM_NAME.toLowerCase()} "${N}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{N&&await d.remove(N)}})]})},hf="multi-source-deselect",mf="multi-source-restart",gf="multi-source-uninstrument",ff="Selected sources",bf="Deselect",vf="Restart",yf="Uninstrument",Cf="Rollout Restart Workloads",Sf="Are you sure you want to rollout restart these workloads?",xf="Go Back",wf="Confirm",Tf=()=>{const{selectedStreamName:n}=Qe(),{selectedSources:l,setSelectedSources:c}=Fi(),{sourcesApi:d}=Nl(),[u,p]=s(!1),[h,m]=s(!1),g=a(()=>Object.values(l).reduce((e,t)=>e+t.length,0),[l]),f=r(()=>{c({})},[c]),b=r(()=>p(!1),[]),v=r(()=>m(!1),[]);i(()=>{f()},[n,f]);const y=r(()=>{d.restartWorkloads(Object.values(l).flat().filter(e=>e.id.kind!==fo.StaticPod).map(po)),f()},[d,l,f]),C=r(()=>{d.persistV2(Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,...e.region?{region:e.region}:{},selected:!1,currentStreamName:n}))]))),f()},[d,l,n,f]),S=a(()=>[{id:hf,type:ro.Button,buttonProps:{variant:ge.Text,size:me.S,label:bf,onClick:f}},{id:mf,type:ro.Button,buttonProps:{variant:ge.Secondary,size:me.S,label:vf,leftIcon:pl,onClick:()=>p(!0)}},{id:gf,type:ro.Button,buttonProps:{variant:ge.Primary,size:me.S,label:yf,leftIcon:xa,onClick:()=>m(!0)}}],[f]);return e(o,{children:[t(Oo,{isOpen:g>0,richTitle:{icon:Ba,title:ff,badge:{label:g}},actions:S}),t(qe,{isOpen:u,title:Cf,description:Sf,onClose:b,denyButton:{label:xf,variant:ge.Secondary,onClick:b},approveButton:{label:wf,variant:ge.Primary,onClick:()=>{y(),b()}}}),t(Gl,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},kf=y`
|
|
901
1315
|
0% {
|
|
902
1316
|
background-position: 200% 50%;
|
|
903
1317
|
}
|
|
904
1318
|
100% {
|
|
905
1319
|
background-position: 0% 50%;
|
|
906
1320
|
}
|
|
907
|
-
`,
|
|
1321
|
+
`,Ef=f.div`
|
|
908
1322
|
display: flex;
|
|
909
1323
|
align-items: center;
|
|
910
1324
|
justify-content: space-evenly;
|
|
@@ -915,50 +1329,76 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect
|
|
|
915
1329
|
|
|
916
1330
|
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%)`};
|
|
917
1331
|
background-size: 200% 100%;
|
|
918
|
-
animation: ${
|
|
919
|
-
`,
|
|
1332
|
+
animation: ${kf} 15s linear infinite;
|
|
1333
|
+
`,If=[za,Ba,Da,_a],Of=({onRedirectToSampling:o})=>{const n=b();return e(Ni,{children:[e(st,{fullHeight:!0,customTitle:t(pf,{}),customSearch:t(qg,{}),filters:t(vg,{}),children:[t(Ef,{children:If.map((o,i)=>e(c,{children:[t(o,{size:24}),i<If.length-1&&t(Ra,{fill:n.v2.colors.white[500]+dt["020"],size:24})]},o.name))}),t(Ug,{})]}),t(Zg,{onRedirectToSampling:o}),t(Tf,{})]})};var Nf;!function(e){e.Gateway="gateway",e.Node="node"}(Nf||(Nf={}));const $f=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:on(),type:ro.Button,buttonProps:{label:"Download Diagnose",leftIcon:ul,size:me.S,variant:ge.Text,onClick:o,disabled:l}}),n&&e.push({id:on(),type:ro.Button,buttonProps:{label:"Refresh",leftIcon:Ka,size:me.S,variant:ge.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(pe,{$alignItems:"center",$justifyContent:"space-between",children:[t(qi,{icon:wl,title:"Collectors Pipeline"}),t(Zi,{actions:r})]})},Af=({pod:o,onClose:n})=>{const{formatTimeAgo:i}=qt(),{collectorsApi:l}=Nl(),{data:r}=l.usePodInfo(o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),s=a(()=>[{id:on(),title:"Node",label:r?.node??"-",withCopy:!0},{id:on(),title:"Status",badge:{status:Qi(r?.status),label:r?.status??"-"}}],[r]),c=a(()=>r?.containers?.map(e=>({id:on(),items:[{id:on(),title:"Container",label:e.name??"-"},{id:on(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:on(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?ka:Ea,label:e.ready?"True":"False",invertColors:!0}},{id:on(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?ka:Ea,label:e.started?"True":"False",invertColors:!0}},{id:on(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:on(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:on(),title:Ze.RESTARTS,label:e.restarts.toString()},{id:on(),title:"State Reason",label:e.stateReason??"-"},{id:on(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:on(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(re,{isOpen:!!o,header:{icon:Ja,title:"Pod Information",onClose:n},children:r?e(zt,{bgTint:"1000",richTitle:{icon:Ja,title:r.name,withCopy:!0},children:[t(zt,{bgTint:"900",cellsPerRow:2,items:s}),e(zt,{bgTint:"900",richTitle:{icon:il,title:Ze.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(lo,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(lo,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(lo,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(zt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:o})=>t(zt,{bgTint:"800",cellsPerRow:2,items:o},e)):t($e,{title:"No containers",subTitle:"Pod has no containers"})}),t(Wl,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(mt,{$height:"50vh",children:t(yt,{withSpinner:!0})})})};var Rf;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(Rf||(Rf={}));const Df=e=>{const t=[{key:Rf.PodName,label:"Pod Name"},{key:Rf.Status,label:"Status"},{key:Rf.Restarts,label:Ze.RESTARTS},{key:Rf.NodeName,label:"Node Name"},{key:Rf.Age,label:"Age"},{key:Rf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Rf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},_f=({isLoading:o,pods:n,withSpanDropRate:i})=>{const l=b(),{formatTimeAgo:r}=qt(),[c,d]=s(null),u=a(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:Rf.PodName,rawValue:o.name},{key:Rf.Status,rawValue:o.status,component:()=>{return e=o.status,t(Ke,{status:Qi(e),label:e});var e}},{key:Rf.Restarts,rawValue:o.restartsCount.toString()},{key:Rf.NodeName,rawValue:o.nodeName},{key:Rf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(ce,{children:"-"});const i=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),a=i>0?Math.round((n?.metricsDroppedRps??0)/i*100):0,l=a>0?Pe.Error:Pe.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?Pe.Error:Pe.Success;return e(pe,{$gap:4,children:[t(Ie,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Ke,{status:l,label:`Receiver ${a}%`,leftIcon:l===Pe.Error?Tl:kl,useSecondaryTone:!0,invertColors:!0})}),t(Ie,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Ke,{status:c,label:`Exporter ${s}%`,leftIcon:c===Pe.Error?Tl:kl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Rf.Age,rawValue:r(o.creationTimestamp)},{key:Rf.DockerImage,rawValue:o.image}]})),[n,l]);return e(zt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Ja,title:"Pods"},children:[t(Eo,{variant:Io.Data,isLoading:o,columns:Df(i),rows:u}),t(Af,{pod:c,onClose:()=>d(null)})]})},Pf=({isOpen:e,onClose:o,title:n,yaml:i})=>t(re,{isOpen:e,header:{icon:El,title:n,onClose:o},children:t(Wl,{yaml:i,defaultOpen:!0})}),Lf=e=>{switch(e){case ea.Healthy:return"All desired replicas are updated, available, and ready";case ea.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ea.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ea.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ea.Down:return"No available replicas";case ea.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Ff;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Ff||(Ff={}));const Mf=f.div`
|
|
920
1334
|
flex: 0.5;
|
|
921
1335
|
padding: 12px;
|
|
922
1336
|
border-radius: 12px;
|
|
923
1337
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
924
|
-
`,
|
|
1338
|
+
`,zf=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=qt(),[c,d]=s(null),u=a(()=>(e=>{switch(e){case Nf.Gateway:return"Deployment";case Nf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=a(()=>((e,t,o,n)=>{const i={status:Pe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Nf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Nf.Node:a=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return i}return a?{status:Pe.Info,label:"Rollout in progress",rightIcon:Ka,useSecondaryTone:!0}:l?{status:Pe.Disabled,label:`Last Rollout: ${n(l)}`}:i})(o,n,i,r),[n,i,o,r]),h=a(()=>((e,t,o,n)=>{let i=n?Pe.Info:Pe.Unknown,a=n?"Loading":ea.Unknown,l=n?"Fetching data...":Lf(ea.Unknown);switch(e){case Nf.Gateway:i=t?.status?Qi(t?.status):i,a=t?.status??a,l=t?.status?Lf(t.status):l;break;case Nf.Node:i=o?.status?Qi(o?.status):i,a=o?.status??a,l=o?.status?Lf(o.status):l}return{status:i,title:a,description:l}})(o,n,i,l),[n,i,o,l]),m=a(()=>((e,t,o)=>{switch(e){case Nf.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 Nf.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),g=a(()=>((e,t,o,n)=>{switch(e){case Nf.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 Nf.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,i,l),[n,i,o,l]),f=a(()=>(o===Nf.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Nf.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(zt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:El,title:u,badge:p},actions:[{id:on(),type:ro.ButtonDropData,buttonProps:{variant:ge.Secondary,size:me.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Ff.ManifestYaml,label:u,icon:Il},{id:Ff.ConfigMapYaml,label:"ConfigMap",icon:Il}]}}],children:[e(pe,{$gap:16,children:[t("div",{children:t(ta,{...h})}),m.map(e=>t(Mf,{children:t("div",{children:t(oa,{...e})})},e.title)),g.map(e=>t(na,{...e},e.title))]}),t(Pf,{isOpen:c===Ff.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(Pf,{isOpen:c===Ff.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Bf=[{value:Nf.Gateway,label:"Gateway"},{value:Nf.Node,label:"Node Collector"}],Xf=({minSupportedVersion:o=0})=>{const{isVersionSupported:n,version:i}=C(o),[l,c]=s(Nf.Gateway),d=l===Nf.Gateway,u=l===Nf.Node,{collectorsApi:p,configApi:h}=Nl(),{data:m}=h.useEffectiveConfig(),{data:g,loading:f,refetch:b}=p.useGatewayInfo({skip:!d}),{data:v=[],loading:y,refetch:S}=p.useGatewayPods({skip:!d}),{data:x,loading:w,refetch:T}=p.useNodeCollectorInfo({skip:!u}),{data:k=[],loading:E,refetch:I}=p.useNodeCollectorPods({skip:!u}),O=d&&(f||y)||u&&(w||E),N=r(()=>{d?(b(),S()):u&&(T(),I())},[d,u,b,S,T,I]),$=a(()=>d?v:k,[v,k,d]);return e(Ni,{children:[t($f,{disabled:!n,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:N}),e(ia,{children:[e(Z,{children:[t(fe,{variant:To.Underline,size:Re.L,options:Bf,selected:l,setSelected:c}),t(zf,{selectedTab:l,gatewayInfo:g??null,nodeCollectorInfo:x??null,isLoading:O})]}),t(_f,{isLoading:O,pods:$,withSpanDropRate:!1===m?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(Jl,{minSupportedVersion:o,currentVersion:i||""})]})]})},Uf=f.div`
|
|
925
1339
|
display: inline-flex;
|
|
926
1340
|
align-items: center;
|
|
927
1341
|
min-width: 0;
|
|
928
1342
|
overflow: hidden;
|
|
929
1343
|
white-space: pre;
|
|
930
1344
|
text-overflow: ellipsis;
|
|
931
|
-
`,
|
|
1345
|
+
`,Vf=f.div`
|
|
932
1346
|
display: flex;
|
|
933
1347
|
flex-direction: column;
|
|
934
1348
|
gap: 4px;
|
|
935
1349
|
min-width: 0;
|
|
936
1350
|
flex: 1;
|
|
937
1351
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
938
|
-
`,
|
|
1352
|
+
`,Hf=f(pe)`
|
|
939
1353
|
flex-shrink: 0;
|
|
940
1354
|
gap: 6px;
|
|
941
1355
|
align-items: center;
|
|
942
1356
|
min-height: 22px;
|
|
943
|
-
`;const
|
|
1357
|
+
`;const jf=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Gf=[{value:"all",label:la},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Wf=({title:o,items:n,isLoading:i,showTypeFilter:l,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=b(),[m,g]=s(""),[f,v]=s("all"),y=a(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,f,l);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,m),e},[n,f,l,m]),C=a(()=>y.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(h,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(Vf,{$disabled:o.disabled,children:[t(Uf,{children:t(x,{parts:o.summary})}),o.name&&t(ce,{size:ue.XXS,color:de.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(Hf,{children:[o.disabled&&t(Ke,{label:aa,textSize:ue.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Ke,{label:o.typeBadge,textSize:ue.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),S=a(()=>{const e=e=>t(Oa,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),w=r(e=>{const t=C.indexOf(e);if(t<0)return[];const o=y[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:Do,leftIcon:Na,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(st,{fullHeight:!0,richTitle:{icon:ml,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:Gf,selected:f,setSelected:v}}:{}},children:t(Eo,{variant:Io.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:ra,subTitle:da(m)}:{hideIcon:!0,title:ca,button:{label:sa,onClick:d}},columns:jf,rows:C,getRowActions:w})})},Kf=({docsUrl:o})=>{const{samplingApi:n,sourcesApi:c}=Nl(),{items:d}=c.useSources(),u=a(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:m,refetch:g}=n.useSamplingRules(),f=r((e,t)=>n.createNoisy?.({samplingId:e,rule:t}),[n]),b=r((e,t,o)=>n.updateNoisy?.(t,{samplingId:e,rule:o}),[n]),v=r((e,t)=>n.createHighlyRelevant?.({samplingId:e,rule:t}),[n]),y=r((e,t,o)=>n.updateHighlyRelevant?.(t,{samplingId:e,rule:o}),[n]),C=r((e,t)=>n.createCostReduction?.({samplingId:e,rule:t}),[n]),S=r((e,t,o)=>n.updateCostReduction?.(t,{samplingId:e,rule:o}),[n]),x=r((e,t,o)=>"noisy"===o?n.deleteNoisy?.(t,e):"highlyRelevant"===o?n.deleteHighlyRelevant?.(t,e):"costReduction"===o?n.deleteCostReduction?.(t,e):void 0,[n]),w=r((e,t)=>n.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[n]),T=a(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[u]),k=a(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[E,I]=s(D.Noisy),[O,N]=s(null),[R,q]=s(!1),[Q,ee]=s(!1),[te,oe]=s(null),[ne,ie]=s(!1),[ae,le]=s(!1),[re,se]=s(!1),[ce,de]=s(!1);l(!1),i(()=>{},[h,p]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:be}=uo();i(()=>{if(!ue)return;if(h||0===p.length)return;be(null);const e=_(p,ue.ruleId,ue.category);e&&(I(P[ue.category]),q(!1),N(e))},[h,p,ue,be]);const ve=a(()=>$(m),[m]),ye=a(()=>L(p),[p]),Ce=a(()=>A(ye?.rule??null),[ye]),Se=a(()=>F(p),[p]),xe=a(()=>M(Se?.rule??null),[Se]),we=l(O);we.current=O,i(()=>{const e=we.current;if(!e)return;const t=z(p,e);t?N(t):(N(null),q(!1))},[p]);const Te=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),ke=a(()=>B(p,E,Te),[p,E,Te]),Ee=r(()=>ee(!0),[]),Ie=r(()=>ee(!1),[]);r(()=>de(!1),[]);const Oe=r(async e=>{const t=p[0]?.id??"default";switch(G[E]){case"noisy":await f(t,V(e));break;case"highlyRelevant":await v(t,U(e));break;case"costReduction":await C(t,X(e))}ee(!1)},[p,E,f,v,C]),Ne=r(e=>{const t=H(p,e);t&&(q(!1),N(t))},[p]),$e=r(()=>{N(null),q(!1)},[]),Ae=r((e,t)=>{const o=O;if(o&&o.rule.ruleId===e&&o.samplingId===t)q(!0),N({...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 q(!0),void N({category:n.category,rule:n.rule,samplingId:t,summary:j(n.category,n.rule)})}},[O,p]),De=r(async(e,t,o)=>{const n=O?.category;if(n){switch(n){case"noisy":await b(o,t,V(e));break;case"highlyRelevant":await y(o,t,U(e));break;case"costReduction":await S(o,t,X(e))}q(!1)}},[O,b,y,S]),Le=r((e,t)=>{oe({ruleId:e,samplingId:t})},[]),Fe=r(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=O?.category||G[E];await x(t,e,o),N(null),q(!1),oe(null)},[te,O,E,x]),Me=r(()=>oe(null),[]),ze=r(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=r(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=r(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=r(e=>{const t=G[E];let o=null;switch(t){case"noisy":{const n=V(e);o=W(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=U(e);o=W(p,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=X(e);o=W(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:ua,ruleId:o}:null},[p,E]),Ve=r(e=>{const t=O?.category,o=O?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=V(e);n=W(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=U(e);n=W(p,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=X(e);n=W(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:ua,ruleId:n}:null},[p,O]),He=r(e=>{ee(!1);for(const t of p){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return q(!0),void N({category:o.category,rule:o.rule,samplingId:t.id,summary:j(o.category,o.rule)})}},[p]),je=a(()=>{const e=[];return o&&e.push({id:on(),type:ro.Button,buttonProps:{"data-id":"sampling-btn-docs",label:pa,leftIcon:Ia,size:me.S,variant:ge.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:on(),type:ro.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:ha,leftIcon:Ka,size:me.S,variant:ge.Text,onClick:g,loading:h}}),e.push({id:on(),type:ro.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ma,rightIcon:wa,size:me.S,variant:ge.Primary,onClick:Ee}}),e},[o,g,h,Ee]);return e(Ni,{children:[e(pe,{$gap:12,$justifyContent:"space-between",children:[t(qi,{icon:ml,title:fa,subTitle:ga}),t(Zi,{actions:je})]}),e(Z,{$gap:12,$fullHeight:!0,children:[t(fe,{variant:To.Underline,size:Re.L,options:K,selected:E,setSelected:I}),e(pe,{$justifyContent:"space-between",children:[t(_e,{status:Pe.Default,message:Y[E]}),o&&t(he,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ia,size:me.S,variant:ge.Text,onClick:()=>window.open(o,"_blank")})]}),E===D.Noisy?t(_l,{title:at,summary:ve,onEdit:()=>ie(!0)}):E===D.HighlyRelevant?t(_l,{title:et,summary:Ce,onEdit:()=>le(!0)}):E===D.CostReduction?t(_l,{title:nt,summary:xe,onEdit:()=>se(!0)}):null,t(Wf,{title:J[E],items:ke,isLoading:h,showTypeFilter:E===D.HighlyRelevant,onRuleClick:Ne,onCreateRule:Ee,onEditRule:Ae,onDeleteRule:Le})]}),t($h,{formType:ir.View,data:O,defaultEditMode:R,onClose:$e,onDelete:Le,onSaveEdit:De,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t($h,{formType:ir.Create,isOpen:Q,category:G[E],onClose:Ie,onSubmit:Oe,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t($h,{formType:ir.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t($h,{formType:ir.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t($h,{formType:ir.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(qe,{title:Ca,description:ya,isOpen:!!te,onClose:Me,denyButton:{label:va,variant:ge.Secondary,onClick:Me},approveButton:{label:ba,variant:ge.Primary,onClick:()=>{Fe(),Me()}}}),false]})},Yf=f.div`
|
|
944
1358
|
display: flex;
|
|
945
1359
|
align-items: center;
|
|
946
1360
|
justify-content: space-between;
|
|
947
1361
|
padding: 0 12px;
|
|
948
|
-
`,
|
|
1362
|
+
`,Jf=f.div`
|
|
1363
|
+
display: flex;
|
|
1364
|
+
align-items: center;
|
|
1365
|
+
gap: 8px;
|
|
1366
|
+
`,qf=f.div`
|
|
1367
|
+
width: 1px;
|
|
1368
|
+
height: 20px;
|
|
1369
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1370
|
+
`,Zf=({disabled:o,loading:n,onClickShowYaml:i,onClickReset:l,onClickRefresh:r})=>{const c=b(),[d,u]=s(!1),p=a(()=>i?[{id:on(),type:ro.Button,buttonProps:{label:"Show Config YAML",leftIcon:Il,size:me.S,variant:ge.Secondary,onClick:i,disabled:o}}]:[],[i,o]),h=a(()=>{const e=[];return r&&e.push({id:on(),type:ro.Button,buttonProps:{leftIcon:Ka,tooltip:"Refresh",hideTooltipIcon:!0,size:me.S,variant:ge.Text,onClick:r,disabled:o,loading:n}}),l&&e.push({id:on(),type:ro.Button,buttonProps:{leftIcon:xa,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:me.S,variant:ge.Text,textColor:c.v2.colors.red[500],onClick:()=>u(!0),disabled:o}}),e},[o,n,l,r,c]),m=p.length>0,g=h.length>0;return e(Yf,{children:[t(qi,{icon:Ya,title:"Odigos Settings"}),e(Jf,{children:[m&&t(Zi,{actions:p}),m&&g&&t(qf,{}),g&&t(Zi,{actions:h})]}),t(qe,{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:ge.Secondary,onClick:()=>u(!1)},approveButton:{label:"Approve",variant:ge.Primary,onClick:()=>{l?.(),u(!1)}}})]})},Qf=f(Z)`
|
|
1371
|
+
width: 220px;
|
|
1372
|
+
flex-shrink: 0;
|
|
1373
|
+
height: 100%;
|
|
1374
|
+
gap: 4px;
|
|
1375
|
+
overflow-y: auto;
|
|
1376
|
+
`,eb=({options:e,selected:o,setSelected:n,disabled:i})=>t(Qf,{children:e.map(e=>t(Hs,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:o===e.id,disabled:i,onClick:()=>n(e.id)},e.id))}),tb=f(Z)`
|
|
1377
|
+
width: 100%;
|
|
1378
|
+
/* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
|
|
1379
|
+
max-width: 844px;
|
|
1380
|
+
/* Bias the content toward the left on wide screens: ~30% of the free space sits on the left, 70% on the right. */
|
|
1381
|
+
margin-left: max(0px, calc((100% - 844px) * 0.3));
|
|
1382
|
+
margin-right: auto;
|
|
1383
|
+
gap: 24px;
|
|
1384
|
+
flex: 1;
|
|
1385
|
+
min-height: 0;
|
|
1386
|
+
`,ob=f(pe)`
|
|
949
1387
|
flex: 1;
|
|
950
1388
|
min-height: 0;
|
|
951
1389
|
width: 100%;
|
|
952
1390
|
align-self: stretch;
|
|
953
|
-
`,
|
|
1391
|
+
`,nb=f(Z)`
|
|
954
1392
|
flex: 1;
|
|
955
1393
|
min-height: 0;
|
|
956
1394
|
height: 100%;
|
|
1395
|
+
max-width: 600px;
|
|
957
1396
|
overflow-y: auto;
|
|
958
|
-
`,
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1397
|
+
`,ib=f(pe)`
|
|
1398
|
+
gap: 8px;
|
|
1399
|
+
width: 100%;
|
|
1400
|
+
align-items: center;
|
|
1401
|
+
`,ab=f.div`
|
|
1402
|
+
flex: 1;
|
|
1403
|
+
min-width: 0;
|
|
1404
|
+
`,lb=e=>"general"===e.name?0:"advanced"===e.name?2:1,rb=({minSupportedVersion:n=0})=>{const{isVersionSupported:l,version:r,isEnterprise:c}=C(n),{configApi:d}=Nl(),{data:u,loading:p}=d.useConfigYamls(),{data:h,loading:m,refetch:g}=d.useEffectiveConfig(),f=u?.configYamls??[],[b,v]=s(!1),y=a(()=>{if(!h)return{};const{manifestYAML:e,provenance:t,...o}=h;return o},[h]),{formData:S,handleFormChange:x,getNestedValue:w,getFormDiff:T,isFormDirty:k}=Ut(y);i(()=>{"{}"!==JSON.stringify(y)&&"{}"===JSON.stringify(S)&&x(void 0,void 0,y)},[y,S]);const E=a(()=>[...f].sort((e,t)=>lb(e)-lb(t)),[f]),I=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(h?.provenance),[h?.provenance]),O=a(()=>{const e=new Set;for(const t of f)for(const o of t.fields)o.componentType===Te.Dropdown&&e.add(o.helmValuePath);return e},[f]),N=a(()=>f.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:w("formData",e.helmValuePath)}))),[f,S,w]),[$,A]=s(!1),[R,D]=s(!1),_=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})(T(y,S),O);await(async e=>{d.updateLocalUiConfig&&(v(!0),await d.updateLocalUiConfig(e),v(!1),await g())})(e),x(void 0,void 0,{})},P=a(()=>[{id:on(),type:ro.Button,buttonProps:{"data-id":"settings-save",variant:ge.Primary,size:me.S,label:"Save Changes",leftIcon:Fa,loading:b,onClick:()=>A(!0)}},{id:on(),type:ro.Button,buttonProps:{"data-id":"settings-cancel",variant:ge.Secondary,size:me.S,label:"Cancel",leftIcon:Ma,onClick:()=>x(void 0,void 0,y)}}],[b,T,y,S,x]),L=a(()=>E.map(e=>({id:e.name,label:e.displayName})),[E]),F=a(()=>E.map(e=>e.name),[E]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=Sa({sectionNames:F});return t(Ni,{$gap:24,children:e(tb,{children:[t(Zf,{disabled:!l,loading:p||m,onClickShowYaml:()=>D(!0),onClickReset:async()=>{await(async()=>{d.resetLocalUiConfigToDefaults&&await d.resetLocalUiConfigToDefaults()})(),await(g?.()),x(void 0,void 0,{})},onClickRefresh:g?()=>g():void 0}),e(ia,{children:[!l&&t(Jl,{minSupportedVersion:n,currentVersion:r||""}),t(Oo,{isOpen:k,richTitle:{icon:Ya,title:"Config Settings"},actions:P}),t(qe,{isOpen:$,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:()=>A(!1),denyButton:{label:"Keep editing",variant:ge.Secondary,onClick:()=>A(!1)},approveButton:{label:"Save changes",variant:ge.Primary,onClick:()=>{_(),A(!1)}}}),e(ob,{$gap:24,$alignItems:"stretch",children:[!!f.length&&t(eb,{options:L,selected:M,setSelected:z,disabled:!l}),t(nb,{ref:X,$gap:24,$width:"100%",children:f.length?E.map(n=>t(st,{id:n.name,bordered:!0,ref:e=>B(n.name,e),customTitle:t(ce,{size:ue.M,weight:500,color:de.Primary,children:n.displayName}),children:t(Z,{$gap:24,children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!c)return null;if(n.renderCondition&&!ke(n.renderCondition,[],N))return null;const i=Ee(n.componentProps||"{}",{}),a=I[n.helmValuePath],l=n.componentType===Te.Toggle,r=t(ce,{size:ue.XS,weight:500,color:de.Primary,children:n.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Pe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Pe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Pe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(Ke,{...s}):null,u=n.description?t(ce,{size:ue.XXS,color:de.Secondary,children:n.description}):null,p=e(Z,{$gap:4,children:[e(pe,{$gap:8,$alignItems:"center",children:[r,d]}),u]}),h=t($l,{componentType:n.componentType,inputType:i.type,name:n.helmValuePath,disabled:n.isHelmOnly||b,value:w("formData",n.helmValuePath),setValue:e=>x(n.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Et.S},n.helmValuePath),m=n.isHelmOnly?t(Ie,{text:"This field can only be updated via the Helm values.yaml file",children:t(Ol,{})}):null;return t(Z,{$gap:8,children:l?e(pe,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[p,e(pe,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(o,{children:[p,e(ib,{children:[t(ab,{children:h}),m]})]})},n.helmValuePath)})})},n.name)):p?t(mt,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(st,{richTitle:{icon:Ya,title:"Config Settings"},children:t($e,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(re,{isOpen:R,width:"40vw",minWidth:"480px",header:{icon:Il,title:"Effective Config YAML",onClose:()=>D(!1)},children:m&&!h?.manifestYAML?t(mt,{$height:"30vh",children:t(yt,{withSpinner:!0})}):t(Wl,{yaml:h?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})};export{js as AddActionDrawer,vs as AddActionForm,Bh as AddDataStreamModal,tc as AddDestinationDrawer,Ss as AddDestinationForm,oc as AddRuleDrawer,Ns as AddRuleForm,wc as AddSourceDrawer,Ym as CentralConnections,ou as CloudConnectorStep,au as CreateCloudConnectorDrawer,Xm as CreateNewType,As as DataStreamForm,$s as DataStreamMergeWarning,ru as EditActionDrawer,su as EditConfigDrawer,Xh as EditDataStreamModal,du as EditDestinationDrawer,pu as EditRuleDrawer,bh as EditSourceDrawer,Rs as EditSourceForm,Hh as ONBOARDING_DONE_MODAL_ID,cg as Onboarding,jh as OnboardingDone,Of as Overview,Xf as PipelineCollectors,Vr as RegexTesterDrawer,zm as SamplingOnboardingModal,$h as SamplingRuleDrawer,Ms as SamplingRuleForm,Kf as SamplingRules,rb as Settings,zh as SystemDrawer,Bf as TABS};
|