@odigos/ui-kit 0.0.296 → 0.0.298
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 +14 -0
- package/lib/chunks/{helpers-BV_MHw06.js → helpers-DIbaWh5d.js} +1 -1
- package/lib/chunks/index-BbgCENJM.js +358 -0
- package/lib/chunks/{source-instrument-form-context-CWv4NCRf.js → source-instrument-form-context-Be_f9jmB.js} +2 -2
- package/lib/chunks/ui-components-mqa1Nv5H.js +2163 -0
- package/lib/components/_cards/data-card/index.d.ts +3 -0
- package/lib/components/fullscreen/index.d.ts +21 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/info-row/index.d.ts +4 -0
- package/lib/components/ping/index.d.ts +2 -1
- package/lib/components/trace-view/index.d.ts +1 -1
- package/lib/components/trace-view/styled.d.ts +12 -5
- package/lib/components/trace-view/types.d.ts +7 -3
- package/lib/components.js +1 -1
- package/lib/constants/insights/system.d.ts +2 -2
- package/lib/constants/sources/index.d.ts +1 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/edit-source-drawer/profiling/flame-graph-canvas.d.ts +1 -1
- package/lib/containers/_drawers/edit-source-drawer/profiling/index.d.ts +0 -2
- package/lib/containers/insights/findings/drawer/anomaly/anomaly-trace-compare/helpers.d.ts +8 -0
- package/lib/containers/insights/findings/drawer/index.d.ts +2 -2
- package/lib/containers/insights/insights-context.d.ts +11 -6
- package/lib/containers.js +380 -380
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/useFullscreen.d.ts +14 -0
- package/lib/hooks.js +1 -1
- package/lib/icons/programming-languages/browser-logo/index.d.ts +2 -0
- package/lib/icons/programming-languages/index.d.ts +1 -0
- package/lib/icons.js +1 -1
- package/lib/snippets/graph-flow/types.d.ts +4 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme/palettes/index.d.ts +1 -0
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +1 -0
- package/lib/types/enum/index.d.ts +1 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +2 -2
- package/lib/chunks/index-vZsC8Ggg.js +0 -353
- package/lib/chunks/ui-components-BlmdA--F.js +0 -2115
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMemo as a,useEffect as o,useState as l,Fragment as r,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as g,useLayoutEffect as m,memo as b}from"react";import f,{useTheme as v,css as y,keyframes as S}from"styled-components";import{
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMemo as a,useEffect as o,useState as l,Fragment as r,forwardRef as s,useImperativeHandle as c,useCallback as d,useRef as p,Children as u,createContext as h,useContext as g,useLayoutEffect as m,memo as b}from"react";import f,{useTheme as v,css as y,keyframes as S}from"styled-components";import{x,e as w,g as C,f as k,h as T,c1 as I,F as $,c2 as N,c3 as A,c4 as O,c5 as E,by as D,d as z,k as R,I as P,c6 as X,r as L,s as _,G as M,a2 as F,c7 as B,c8 as V,ay as U,c9 as G,ca as j,B as H,i as W,j as K,H as Y,aa as J,bz as q,N as Z,cb as Q,z as ee,L as te,S as ie,cc as ne,bE as ae,bF as oe,bD as le,cd as re,am as se,T as ce,ak as de,al as pe,ai as ue,ah as he,aj as ge,ag as me,bc as be,af as fe,ce as ve,cf as ye,cg as Se,ch as xe,ci as we,W as Ce,p as ke,bg as Te,cj as Ie,ck as $e,cl as Ne,cm as Ae,cn as Oe,co as Ee,cp as De,cq as ze,a0 as Re,cr as Pe,a5 as Xe,cs as Le,ct as _e,y as Me,cu as Fe,cv as Be,b6 as Ve,bM as Ue,cw as Ge,cx as je,cy as He,cz as We,cA as Ke,cB as Ye,cC as Je,cD as qe,cE as Ze,cF as Qe,cG as et,cH as tt,cI as it,cJ as nt,cK as at,cL as ot,cM as lt,cN as rt,cO as st,cP as ct,cQ as dt,cR as pt,cS as ut,cT as ht,cU as gt,cV as mt,cW as bt,cX as ft,cY as vt,cZ as yt,A as St,c_ as xt,c$ as wt,d0 as Ct,d1 as kt,d2 as Tt,d3 as It,d4 as $t,d5 as Nt,bY as At,d6 as Ot,d7 as Et,d8 as Dt,d9 as zt,da as Rt,db as Pt,aE as Xt,dc as Lt,bX as _t,dd as Mt,J as Ft,de as Bt,df as Vt,dg as Ut,dh as Gt,di as jt,dj as Ht,dk as Wt,dl as Kt,dm as Yt,dn as Jt,bS as qt,ac as Zt,dp as Qt,dq as ei,dr as ti,ds as ii,dt as ni,bW as ai,C as oi,du as li,dv as ri,dw as si,dx as ci,dy as di,dz as pi,dA as ui,dB as hi,dC as gi,dD as mi,dE as bi,dF as fi,dG as vi,dH as yi,dI as Si,dJ as xi,dK as wi,dL as Ci,dM as ki,dN as Ti,dO as Ii,dP as $i,dQ as Ni,dR as Ai,dS as Oi,dT as Ei,dU as Di,dV as zi,dW as Ri,dX as Pi,Q as Xi,dY as Li,bG as _i,dZ as Mi,d_ as Fi,d$ as Bi,v as Vi,b_ as Ui,e0 as Gi,e1 as ji,e2 as Hi,e3 as Wi,e4 as Ki,e5 as Yi,e6 as Ji,e7 as qi,e8 as Zi,bT as Qi,e9 as en,ea as tn,eb as nn,ec as an,ed as on,D as ln,bL as rn,ee as sn,ef as cn,eg as dn,eh as pn,ei as un,ej as hn,ek as gn,bC as mn,el as bn,em as fn,en as vn,eo as yn,b3 as Sn,E as xn,b$ as wn,ep as Cn,bf as kn,eq as Tn,bh as In,er as $n,bl as Nn,bj as An,es as On,b8 as En,et as Dn,o as zn,eu as Rn,an as Pn,ev as Xn,ew as Ln,q as _n,K as Mn,bo as Fn,bx as Bn,ex as Vn,ey as Un,bw as Gn,ez as jn,a9 as Hn,eA as Wn,eB as Kn,bb as Yn,eC as Jn,eD as qn,eE as Zn,eF as Qn,eG as ea,eH as ta,eI as ia,eJ as na,eK as aa,eL as oa,$ as la,eM as ra,b7 as sa,b5 as ca,eN as da,eO as pa,eP as ua,eQ as ha,eR as ga,eS as ma,c0 as ba,eT as fa,eU as va,eV as ya,eW as Sa,eX as xa,b as wa,eY as Ca,eZ as ka,_ as Ta,e_ as Ia,e$ as $a,f0 as Na,f1 as Aa,f2 as Oa,f3 as Ea,u as Da,l as za,f4 as Ra,m as Pa,f5 as Xa,f6 as La,f7 as _a,f8 as Ma,f9 as Fa,fa as Ba,fb as Va,fc as Ua,fd as Ga,fe as ja,ff as Ha,fg as Wa,fh as Ka,fi as Ya,fj as Ja,fk as qa,fl as Za,fm as Qa,fn as eo,fo as to,fp as io,fq as no,fr as ao,fs as oo,ft as lo,fu as ro,fv as so,fw as co,fx as po,fy as uo,fz as ho,fA as go,fB as mo,fC as bo,fD as fo,fE as vo,fF as yo,aV as So,fG as xo,fH as wo,fI as Co,fJ as ko,fK as To,fL as Io,fM as $o,fN as No,fO as Ao,fP as Oo,fQ as Eo,fR as Do,fS as zo,fT as Ro,fU as Po,fV as Xo,fW as Lo,fX as _o,fY as Mo,fZ as Fo,f_ as Bo,f$ as Vo,g0 as Uo,g1 as Go,g2 as jo,g3 as Ho,g4 as Wo,g5 as Ko,g6 as Yo,g7 as Jo,g8 as qo,g9 as Zo,ga as Qo,gb as el,gc as tl,gd as il,ge as nl,gf as al,gg as ol,gh as ll,gi as rl,gj as sl,gk as cl,gl as dl,gm as pl,gn as ul,M as hl,O as gl,U as ml,X as bl,Y as fl,go as vl,gp as yl,gq as Sl,gr as xl,gs as wl,a6 as Cl,gt as kl,gu as Tl,gv as Il,gw as $l,gx as Nl,gy as Al,gz as Ol,gA as El,gB as Dl,gC as zl,gD as Rl,gE as Pl,gF as Xl,gG as Ll,gH as _l,gI as Ml,gJ as Fl,gK as Bl,gL as Vl,gM as Ul,gN as Gl,gO as jl,gP as Hl,gQ as Wl,gR as Kl,gS as Yl,gT as Jl,gU as ql,gV as Zl,gW as Ql,gX as er,gY as tr,gZ as ir,g_ as nr,g$ as ar,h0 as or,h1 as lr,h2 as rr,h3 as sr,h4 as cr,h5 as dr,h6 as pr,h7 as ur,h8 as hr,h9 as gr,ha as mr,hb as br,hc as fr,hd as vr,he as yr,hf as Sr,hg as xr,hh as wr,hi as Cr,hj as kr,hk as Tr,hl as Ir,hm as $r,hn as Nr,ho as Ar,hp as Or,hq as Er,hr as Dr,b9 as zr,hs as Rr,ht as Pr,hu as Xr,hv as Lr,hw as _r,hx as Mr,hy as Fr,hz as Br,hA as Vr,hB as Ur,hC as Gr,hD as jr,hE as Hr,hF as Wr,hG as Kr,hH as Yr,hI as Jr,hJ as qr,hK as Zr,hL as Qr,hM as es,hN as ts,hO as is,hP as ns,hQ as as,hR as os,hS as ls,hT as rs,hU as ss,hV as cs,hW as ds,hX as ps,hY as us,hZ as hs,h_ as gs,h$ as ms,i0 as bs,i1 as fs,i2 as vs,i3 as ys,i4 as Ss,i5 as xs,i6 as ws,i7 as Cs,i8 as ks,i9 as Ts,ia as Is,ib as $s,ic as Ns,id as As,ie as Os,ig as Es,ih as Ds,ii as zs,ij as Rs,ik as Ps,il as Xs,im as Ls,io as _s,ip as Ms,iq as Fs,ir as Bs,is as Vs,it as Us,iu as Gs,iv as js,iw as Hs,ix as Ws,iy as Ks,iz as Ys,iA as Js,iB as qs,iC as Zs,iD as Qs,iE as ec,iF as tc,iG as ic,P as nc,iH as ac,iI as oc,R as lc,a as rc,iJ as sc,iK as cc,iL as dc,iM as pc,iN as uc,iO as hc,iP as gc,iQ as mc,iR as bc,iS as fc,iT as vc,iU as yc,iV as Sc,iW as xc,iX as wc,iY as Cc,iZ as kc,i_ as Tc,n as Ic,ba as $c,i$ as Nc,j0 as Ac,j1 as Oc,j2 as Ec,j3 as Dc,j4 as zc,j5 as Rc,j6 as Pc,j7 as Xc,j8 as Lc,j9 as _c,ja as Mc,jb as Fc,bK as Bc,bJ as Vc,bI as Uc,bH as Gc,jc,jd as Hc,je as Wc,jf as Kc,jg as Yc,jh as Jc,ji as qc,jj as Zc,jk as Qc,jl as ed,jm as td,jn as id,jo as nd,jp as ad,jq as od,jr as ld,js as rd,jt as sd,ju as cd,jv as dd,b4 as pd,jw as ud,jx as hd,jy as gd,jz as md,jA as bd,jB as fd,jC as vd,jD as yd,jE as Sd,jF as xd,jG as wd,jH as Cd,jI as kd,bi as Td,jJ as Id,jK as $d,jL as Nd,jM as Ad,jN as Od,jO as Ed,jP as Dd,jQ as zd,jR as Rd,jS as Pd,jT as Xd,jU as Ld,jV as _d,jW as Md,jX as Fd,jY as Bd,jZ as Vd,j_ as Ud,j$ as Gd,k0 as jd,k1 as Hd,k2 as Wd,k3 as Kd,k4 as Yd,k5 as Jd,k6 as qd,k7 as Zd,k8 as Qd,k9 as ep,ka as tp,kb as ip,kc as np,kd as ap,ke as op,kf as lp,kg as rp,kh as sp,ki as cp,kj as dp,kk as pp,kl as up,km as hp,kn as gp,ko as mp,kp as bp,kq as fp,kr as vp,ks as yp,kt as Sp,ku as xp,kv as wp,kw as Cp,kx as kp,ky as Tp,kz as Ip,kA as $p,kB as Np,kC as Ap,kD as Op,kE as Ep,kF as Dp,kG as zp,kH as Rp,kI as Pp,kJ as Xp,kK as Lp,kL as _p,kM as Mp,kN as Fp,kO as Bp}from"./chunks/ui-components-mqa1Nv5H.js";import{u as Vp,n as Up,C as Gp,g as jp,f as Hp,e as Wp,q as Kp,h as Yp,j as Jp,k as qp,i as Zp,m as Qp,p as eu,l as tu,c as iu,r as nu,S as au,s as ou,R as lu,t as ru,w as su,o as cu,x as du,y as pu,z as uu,A as hu,B as gu,D as mu,E as bu,F as fu,G as vu,H as yu,I as Su,J as xu}from"./chunks/helpers-DIbaWh5d.js";import{ChevronRightIcon as wu,ActionIcon as Cu,TrashIcon as ku,PlusIcon as Tu,ArrowRightIcon as Iu,BookIcon as $u,DeleteIcon as Nu,EditIcon as Au,GoLogo as Ou,JavaLogo as Eu,PhpLogo as Du,VSquareIcon as zu,XSquareIcon as Ru,InboundIcon as Pu,OutboundIcon as Xu,DestinationIcon as Lu,InsightsTransactionsIcon as _u,XIcon as Mu,VIcon as Fu,ISquareIcon as Bu,ThreatDetectionIcon as Vu,ChevronUpIcon as Uu,ChevronDownIcon as Gu,InstrumentationRuleIcon as ju,SourceIcon as Hu,NamespacesIcon as Wu,AzureIcon as Ku,GoogleCloudPlatformLogo as Yu,AwsLogo as Ju,CloudConnectorIcon as qu,EyeOpenIcon as Zu,OdigosLogo as Qu,ArrowLeftIcon as eh,RefreshIcon as th,SettingsIcon as ih,PodIcon as nh,K8sLogo as ah,ExclamationCircleIcon as oh,QuestionCircleIcon as lh,UserIcon as rh,TerminalIcon as sh,RefreshLeftArrowIcon as ch,SearchIcon as dh,MinusIcon as ph,CopyIcon as uh,DotIcon as hh,ArrowDownIcon as gh,DownloadIcon as mh,ExpandIcon as bh,MetricsIcon as fh,EnrichmentIcon as vh,NormalizationIcon as yh,SamplingIcon as Sh,RecommendationsIcon as xh,UrlTemplatizationIcon as wh,ListIcon as Ch,StarIcon as kh,ReplicaIcon as Th,ExclamationTriangleIcon as Ih,KeyIcon as $h,DiagnoseIcon as Nh,ArrowIcon as Ah,ConnectionsIcon as Oh,InsightsFindingsIcon as Eh,LockIcon as Dh,EditedIcon as zh,DbIcon as Rh,FolderIcon as Ph,CodeIcon as Xh,TracesIcon as Lh,PrivacyIcon as _h,NotificationIcon as Mh,FilterIcon as Fh,DataStreamIcon as Bh,PipelineCollectorIcon as Vh,ArrowDownSquareIcon as Uh,ArrowUpSquareIcon as Gh,GatewayIcon as jh,YamlIcon as Hh,ImageErrorIcon as Wh,SelfLoopIcon as Kh}from"./icons.js";import{l as Yh,B as Jh,t as qh,E as Zh,s as Qh,H as eg,F as tg,S as ig,G as ng,x as ag,K as og,M as lg,e as rg,L as sg,z as cg,y as dg,N as pg,j as ug,J as hg,d as gg,c as mg,w as bg,P as fg,Q as vg,v as yg,T as Sg,U as xg,V as wg,W as Cg,X as kg,Y as Tg,I as Ig,q as $g,g as Ng,C as Ag,O as Og,i as Eg,Z as Dg,_ as zg,$ as Rg,a0 as Pg,a1 as Xg,a2 as Lg,a3 as _g,a4 as Mg,a5 as Fg,a6 as Bg,a7 as Vg,a8 as Ug,b as Gg,R as jg,A as Hg,h as Wg,D as Kg}from"./chunks/source-instrument-form-context-Be_f9jmB.js";import{u as Yg,i as Jg,E as qg,p as Zg,I as Qg,q as em,v as tm,n as im,P as nm,S as am,R as om,l as lm,o as rm,f as sm,m as cm,r as dm,W as pm,C as um,e as hm,Y as gm,A as mm,O as bm,c as fm,B as vm,j as ym,s as Sm,U as xm,t as wm,a as Cm,b as km,h as Tm}from"./chunks/index-BbgCENJM.js";import{Handle as Im,Position as $m,MarkerType as Nm,useNodesState as Am,useEdgesState as Om,BaseEdge as Em,ReactFlowProvider as Dm,ReactFlow as zm,Background as Rm,Controls as Pm,ControlButton as Xm}from"@xyflow/react";import{createPortal as Lm}from"react-dom";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";import"elkjs/lib/elk.bundled.js";const _m=f.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -11,24 +11,24 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
11
11
|
&:hover {
|
|
12
12
|
background-color: ${({$isSelected:e,$purpleColors:t,theme:i})=>i.v2.colors[t?"purple":"silver"][e?"700":"800"]};
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,Mm=f.div`
|
|
15
15
|
display: flex;
|
|
16
16
|
align-items: center;
|
|
17
17
|
justify-content: center;
|
|
18
18
|
padding: 8px;
|
|
19
19
|
border-radius: 8px;
|
|
20
20
|
background-color: ${({theme:e})=>e.v2.colors.white[500]+I["004"]};
|
|
21
|
-
`,
|
|
21
|
+
`,Fm=f(T)`
|
|
22
22
|
flex: 1;
|
|
23
23
|
min-width: 0;
|
|
24
|
-
`,
|
|
24
|
+
`,Bm=f($)`
|
|
25
25
|
flex: 1;
|
|
26
26
|
min-width: 0;
|
|
27
|
-
`,
|
|
27
|
+
`,Vm=f(T)`
|
|
28
28
|
flex-shrink: 0;
|
|
29
|
-
`,
|
|
29
|
+
`,Um=({dataId:i,icon:n,title:a,description:o,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:g})=>e(_m,{"data-id":i||`list-item-${a}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(Fm,{$gap:12,children:[g&&t(x,{partiallyChecked:h||!1,value:u||!1,onChange:e=>g(e)}),n&&t(Mm,{children:t(n,{size:20})}),e(Bm,{$gap:4,children:[t(w,{size:C.XS,nowrap:!0,children:a}),o&&t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:o})]})]}),(l||c)&&e(Vm,{$gap:8,children:[c,l&&t(wu,{size:18})]})]}),Gm="other",jm={...O,[Gm]:{TITLE:"Other",ICON:Cu}},Hm=f(T)`
|
|
30
30
|
padding: 8px 12px 4px 12px;
|
|
31
|
-
`,
|
|
31
|
+
`,Wm=({bucket:i,options:n,selectedType:a,onSelectOption:o})=>{const l=v(),{TITLE:r,ICON:s}=jm[i],c=l.v2.colors.purple[200];return e("div",{"data-id":`action-category-${i}`,children:[e(Hm,{$gap:8,children:[t(s,{fill:c}),t(w,{size:C.XXS,color:c,children:r}),t(E,{label:n.length})]}),n.map(e=>t(Um,{dataId:e.type?`option-${e.type}`:void 0,icon:e.icon,title:e.label,description:e.subtitle||e.description,withCarret:!0,isSelected:a===e.type,onClick:()=>o(e)},e.type))]})},Km=[{id:"CREDIT_CARD",label:"Credit card"}],Ym=[{id:D.CollectContainerAttributes,label:"Collect container attributes"},{id:D.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:D.CollectWorkloadId,label:"Collect workload ID"},{id:D.CollectClusterId,label:"Collect cluster ID"}],Jm=[{id:X.Pod,label:X.Pod},{id:X.Namespace,label:X.Namespace},{id:X.Node,label:X.Node}],qm=[{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:Jm}],Zm=[{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:Jm}],Qm=D.ExtractAttribute;var eb;(e=>{e.Preset="preset",e.Regex="regex"})(eb||(eb={}));const tb=[V.JSON,V.SQL,V.ResourcePath],ib=(e=V.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),nb=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,ab=f.div`
|
|
32
32
|
width: 100%;
|
|
33
33
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
34
34
|
border-radius: 8px;
|
|
@@ -36,13 +36,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
38
38
|
gap: 8px;
|
|
39
|
-
`,
|
|
39
|
+
`,ob=f.div`
|
|
40
40
|
flex: 1;
|
|
41
41
|
min-width: 0;
|
|
42
|
-
`,
|
|
42
|
+
`,lb=f.div`
|
|
43
43
|
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
44
44
|
padding-top: 24px;
|
|
45
|
-
`,
|
|
45
|
+
`,rb=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),sb=e=>{const t={};return e.forEach(({oldKey:e,newKey:i})=>{t[e]=i}),t},cb=D.UrlTemplatizationRulesGroups,db=[{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"}],pb={[q.K8sAttributes]:({value:n,setValue:a,formErrors:l})=>(o(()=>{n[D.CollectContainerAttributes]||n[D.CollectReplicaSetAttributes]||n[D.CollectWorkloadId]||n[D.CollectClusterId]||n[D.LabelsAttributes]?.length||n[D.AnnotationsAttributes]?.length||(a(D.CollectContainerAttributes,!0),a(D.CollectReplicaSetAttributes,!0),a(D.CollectWorkloadId,!0),a(D.CollectClusterId,!0),a(D.LabelsAttributes,[]),a(D.AnnotationsAttributes,[]))},[]),e(i,{children:[t($,{$gap:6,children:Ym.map(({id:i,label:o})=>e($,{children:[t(x,{label:o,value:n[i]||!1,onChange:e=>a(i,e)}),t(R,{errorMessage:l[i]})]},i))}),t(P,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:qm,values:n[D.LabelsAttributes]||[],setValues:e=>a(D.LabelsAttributes,e),errorMessage:l[D.LabelsAttributes]}),t(P,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Zm,values:n[D.AnnotationsAttributes]||[],setValues:e=>a(D.AnnotationsAttributes,e),errorMessage:l[D.AnnotationsAttributes]})]})),[q.AddClusterInfo]:({value:n,setValue:a,formErrors:o})=>{const l=v();return e(i,{children:[t(L,{label:"Overwrite existing values",labelAlign:_.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[D.OverwriteExistingValues]||!1,onChange:e=>a(D.OverwriteExistingValues,e)}),t(P,{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[D.ClusterAttributes]||[],setValues:e=>a(D.ClusterAttributes,e),errorMessage:o[D.ClusterAttributes]})]})},[q.DeleteAttributes]:({value:e,setValue:i,formErrors:n})=>t(M,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[D.AttributeNamesToDelete]||[],setValues:e=>i(D.AttributeNamesToDelete,e),errorMessage:n[D.AttributeNamesToDelete]}),[q.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=e[D.Renames],[r,s]=l(()=>rb(a));return o(()=>{((e,t)=>{const i=Object.keys(e),n=Object.keys(t);return i.length===n.length&&i.every(i=>Object.prototype.hasOwnProperty.call(t,i)&&t[i]===e[i])})(sb(r),a||{})||s(rb(a))},[a]),t(P,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:r,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),i(D.Renames,sb(t))},errorMessage:n[D.Renames]})},[q.PiiMasking]:({value:i,setValue:n,formErrors:a})=>(o(()=>{i[D.PiiCategories]?.length||n(D.PiiCategories,Km.map(({id:e})=>e))},[]),e($,{$gap:12,children:[t(z,{label:"Attributes to mask"}),t($,{$gap:6,children:Km.map(({id:e,label:a})=>t(x,{label:a,value:i[D.PiiCategories]?.includes(e)||!1,onChange:t=>{const a=i[D.PiiCategories]||[],o=t?[...a,e]:a.filter(t=>t!==e);n(D.PiiCategories,o)}},e))}),t(R,{errorMessage:a[D.PiiCategories]})]})),[q.URLTemplatization]:({value:n,setValue:a,formErrors:o})=>{const l=v(),s=n[cb]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(cb,e),d=(e,t)=>c(s.map((i,n)=>n===e?{...i,...t}:i));return e(i,{children:[s.map((i,n)=>e(r,{children:[t(J,{}),e($,{$gap:12,children:[e(T,{$justifyContent:"space-between",$alignItems:"center",children:[t(z,{label:`Rule Group ${n+1}`}),t(H,{leftIcon:()=>t(ku,{fill:l.v2.colors.red[500]}),variant:K.Secondary,size:W.S,onClick:()=>{return e=n,c(s.filter((t,i)=>i!==e));var e},disabled:1===s.length})]}),t(Y,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:i.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(P,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:db,values:i.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(M,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:i.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(R,{errorMessage:o[cb]})]},`url-templatization-group-${n}`)),t(H,{variant:K.Secondary,label:"Add rule group",leftIcon:Tu,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(J,{})]})},[q.ExtractAttribute]:({value:i,setValue:n,formErrors:a})=>{const r=v(),s=a[Qm],c=i[Qm]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(nb)?eb.Regex:eb.Preset)(c)),[u,h]=l(null),g=e=>n(Qm,{extractions:e});o(()=>{0===c.length&&g([d===eb.Preset?ib():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const m=(e,t)=>{g(c.map((i,n)=>n===e?{...i,...t}:i))},b=()=>{g([...c,d===eb.Preset?ib():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},f=d===eb.Preset,y=c.length?c:[f?ib():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],S=null!=u&&y[u]?.regex||"";return e($,{$gap:16,$width:"100%",children:[t(F,{options:[{value:eb.Preset,label:B.SEGMENT_PRESET_LABEL,tooltip:B.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:eb.Regex,label:B.SEGMENT_REGEX_LABEL,tooltip:B.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),g([e===eb.Preset?ib():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e($,{$gap:8,$width:"100%",children:[y.map((i,n)=>{const a=n===y.length-1,o=i.dataFormat||V.JSON,l=G[o];return e(ab,{"data-id":`extract-row-${n}`,children:[e(T,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e($,{$gap:10,children:[t(z,{label:f?B.PRESET_ROW_TITLE(n):B.REGEX_ROW_TITLE(n)}),f&&t(T,{$gap:24,children:tb.map(e=>t(U,{"data-id":`extract-row-${n}-fmt-${e}`,size:j.L,label:G[e].label,value:o===e,onChange:t=>t&&m(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(T,{$gap:4,$alignItems:"center",children:[!f&&t(H,{"data-id":`extract-row-${n}-test-regex`,label:B.TEST_REGEX_LABEL,variant:K.Secondary,size:W.S,onClick:()=>h(n),disabled:!i.regex?.trim()}),t(H,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(ku,{fill:r.v2.colors.red[500]}),variant:K.Secondary,size:W.S,onClick:()=>(e=>{const t=c.filter((t,i)=>i!==e);g(t.length?t:[d===eb.Preset?ib():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),a&&t(H,{"data-id":`extract-row-${n}-add`,leftIcon:Tu,variant:K.Secondary,size:W.S,onClick:b})]})]}),f?e(T,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(ob,{children:t(Y,{name:`extract-row-${n}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:i.lookupKey||"",onChange:e=>m(n,{lookupKey:e.target.value})})}),t(lb,{children:t(Iu,{size:24,fill:r.v2.colors.silver[200]})}),t(ob,{children:t(Y,{name:`extract-row-${n}-targetAttributeName`,label:B.TARGET_LABEL,placeholder:B.TARGET_PLACEHOLDER,helpMessage:B.TARGET_HELP,width:"100%",value:i.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})})]}):e($,{$gap:12,$width:"100%",children:[t(Y,{name:`extract-row-${n}-regex`,label:B.REGEX_LABEL,placeholder:B.REGEX_PLACEHOLDER,helpMessage:B.REGEX_HELP,width:"100%",value:i.regex||"",onChange:e=>m(n,{regex:e.target.value})}),t(Y,{name:`extract-row-${n}-targetAttributeName`,label:B.TARGET_LABEL,placeholder:B.TARGET_PLACEHOLDER,helpMessage:B.TARGET_HELP,width:"100%",value:i.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(R,{errorMessage:s})]}),t(Yg,{isOpen:null!=u,regex:S,onClose:()=>h(null)})]})},[q.DbQueryTemplatization]:null,[q.InferDbAttributes]:null},ub=({actionType:e,value:i,setValue:n,formErrors:a,dynamicFields:o,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(o?.length)return t(Jg,{fields:o,value:i||{},setValue:n,formErrors:a||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=pb[e];return c?t(c,{value:i,setValue:n,formErrors:a}):null},hb=()=>{const{selectedOption:i,genericForm:n,sourceOptions:a,namespaceOptions:o}=Yh();if(!n||!i)return t(Z,{title:"No active form"});const{formData:l,handleFormChange:r,formErrors:s}=n;return e($,{$gap:24,children:[e(T,{$gap:12,$justifyContent:"space-between",children:[t(Q,{size:C.XXXS,maxLines:2,children:i.description}),e(T,{$gap:12,children:[t(qg,{isEnabled:!l.disabled,setIsEnabled:e=>r("disabled",!e)}),t(H,{leftIcon:$u,variant:K.Secondary,size:W.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Zg,{title:"Signals for processing",allowedSignals:i.allowedSignals,selectedSignals:l.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:s.signals}),t(Y,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:l.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:s.name}),t(ub,{actionType:i.type,dynamicFields:i.fields,signals:l.signals||[],value:l.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:s,sourceOptions:a,namespaceOptions:o}),t(ee,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:l.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:s.notes})]})},gb=f(T)`
|
|
46
46
|
position: sticky;
|
|
47
47
|
bottom: 4px;
|
|
48
48
|
align-self: center;
|
|
@@ -53,51 +53,51 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
53
53
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
54
54
|
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
55
55
|
z-index: 1;
|
|
56
|
-
`,pb=s(({isEdit:i},n)=>{const a=v(),{isK8s:r}=Mp(),{destinationsApi:s}=Hh(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=Wh(),[f,y]=l(h?.testResult),[S,x]=l(!!h);o(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!p||!r)return;const e=await s.testConnection(re(p.formData));return y(e),e};return c(n,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e($,{$gap:24,style:{minHeight:"100%"},children:[e(T,{$gap:12,$justifyContent:"space-between",children:[f?f.succeeded?t(te,{status:ie.Success,message:f.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(te,{status:ie.Error,message:f.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(T,{$gap:12,children:[r&&t(Wg,{isEnabled:!p.formData.disabled,setIsEnabled:e=>p.handleFormChange("disabled",!e),fieldDisabled:S}),t(H,{"data-id":"dest-form-docs",leftIcon:ku,variant:K.Secondary,size:W.S,onClick:()=>window.open(`${ne}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(Kg,{title:"This connection will monitor:",allowedSignals:le(d.option.supportedSignals),selectedSignals:oe(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(ae.Logs),metrics:e.includes(ae.Metrics),traces:e.includes(ae.Traces),profiles:e.includes(ae.Profiles)}),disabled:S,errorMessage:p.formErrors.exportedSignals}),t(Y,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:p.formData.name,onChange:({target:{value:e}})=>p.handleFormChange("name",e),disabled:S,errorMessage:p.formErrors.name}),t(Hg,{signals:oe(p.formData.exportedSignals),fields:d.option.fields,disabled:S,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const i=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",i?p.formData.fields.map(i=>i.key===e?{...i,value:t}:i):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!i&&e(db,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(H,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Tu,variant:K.Secondary,textColor:a.v2.colors.red[500],onClick:()=>b(d.unsavedIdx)})}),r&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(H,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:K.Secondary,onClick:w})}),h&&t("div",S?{style:{width:"150px"},children:t(H,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Iu,variant:K.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(H,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:K.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),i=!!e&&!e.succeeded;m(d.unsavedIdx,{formData:t,testResult:e},i)}}})}),!h&&t("div",{style:{width:"150px"},children:t(H,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:K.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),i=!!e&&!e.succeeded;g({formData:t,testResult:e},i)}}})})]})]}):t(Z,{title:"No active form"})});pb.displayName="AddDestinationForm";const ub=[{id:se.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:se.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:se.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],hb=[{id:se.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:se.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:se.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],gb=["*"],mb=[{id:pe.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:pe.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:pe.DbQuery,label:"Collect DB query",tooltip:""},{id:pe.Messaging,label:"Collect messaging",tooltip:""}],bb={[me.Java]:[new he("","")],[me.Golang]:[new ue("")],[me.Php]:[new ge("","")]},fb={[fe.CodeAttributes]:({value:n,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=a(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);o(()=>{if(!d.length&&!c){const e={[se.FilePath]:!0,[se.Function]:!0,[se.LineNumber]:!0,[se.Column]:null,[se.Namespace]:null,[se.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(se).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});l("codeAttributes",n)};return e(i,{children:[e($,{$gap:12,children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:"Recommended data to collect"}),t($,{$gap:6,children:ub.map(({id:e,label:i,tooltip:n})=>t(ce,{text:n,withIcon:!0,children:t(x,{label:i,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(R,{errorMessage:c})]}),e($,{$gap:12,children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:"Verbose data to collect"}),t($,{$gap:6,children:hb.map(({id:e,label:i,tooltip:n})=>t(ce,{text:n,withIcon:!0,children:t(x,{label:i,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(R,{errorMessage:c})]})]})},[fe.CustomInstrumentation]:({value:n,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=a(()=>(n?.customInstrumentations?.[me.Golang]||[]).map(e=>new ue(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),p=a(()=>(n?.customInstrumentations?.[me.Java]||[]).map(e=>new he(e.className,e.methodName)),[n]),u=a(()=>(n?.customInstrumentations?.[me.Php]||[]).map(e=>new ge(e.className,e.functionName)),[n]);return o(()=>{n?.customInstrumentations||c||l("customInstrumentations",{[me.Golang]:bb[me.Golang],[me.Java]:bb[me.Java],[me.Php]:bb[me.Php]})},[]),e(i,{children:[e($,{children:[e(T,{$gap:8,children:[t($u,{}),t(z,{label:"Golang custom probes"})]}),t(P,{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:d,setValues:e=>{const t={};t[me.Golang]=e.map(e=>new ue(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[me.Java]=p,t[me.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e($,{children:[e(T,{$gap:8,children:[t(Nu,{}),t(z,{label:"Java custom probes"})]}),t(P,{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:p,setValues:e=>{const t={};t[me.Golang]=d,t[me.Java]=e.map(e=>new he(e.className,e.methodName)),t[me.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e($,{children:[e(T,{$gap:8,children:[t(Au,{}),t(z,{label:"PHP custom probes"})]}),t(te,{status:ie.Warning,message:be.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(P,{name:"phpProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. App\\Service\\OrderService",tooltip:"The fully qualified class name to instrument. Leave empty for a global function."},{keyName:"functionName",label:"Function name",placeholder:"e.g. processOrder",tooltip:"The name of the function or method to instrument."}],values:u,setValues:e=>{const t={};t[me.Golang]=d,t[me.Java]=p,t[me.Php]=e.map(e=>new ge(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[fe.HeadersCollection]:({value:e,setValue:i,formErrors:n,disabled:l})=>{const r=n.headersCollection,s=a(()=>e?.headersCollection?.[de.HeaderKeys]||[],[e]),c=e=>{const t={[de.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{s.length||r||c(gb)},[]),t(M,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:c,errorMessage:r,disabled:l})},[fe.PayloadCollection]:({value:i,setValue:n,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=a(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);return o(()=>{if(!c.length&&!s){const e={[pe.HttpRequest]:{},[pe.HttpResponse]:{},[pe.DbQuery]:{},[pe.Messaging]:{}};n("payloadCollection",e)}},[]),e($,{$gap:12,children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:"Type of data to collect"}),t($,{$gap:6,children:mb.map(({id:e,label:i,tooltip:a})=>t(ce,{text:a,withIcon:!0,children:t(x,{label:i,value:c.includes(e),onChange:t=>((e,t)=>{const i=t?[...c,e]:c.filter(t=>t!==e),a={[pe.HttpRequest]:i.includes(pe.HttpRequest)?{}:null,[pe.HttpResponse]:i.includes(pe.HttpResponse)?{}:null,[pe.DbQuery]:i.includes(pe.DbQuery)?{}:null,[pe.Messaging]:i.includes(pe.Messaging)?{}:null};n("payloadCollection",a)})(e,t),disabled:r})},e))}),t(R,{errorMessage:s})]})},[fe.NetworkMetrics]:null,[fe.UnknownType]:null},vb=({ruleType:e,value:i,setValue:n,formErrors:a,dynamicFields:o,disabled:l})=>{if(!e)return null;if(o?.length)return t(Hg,{fields:o,value:i||{},setValue:n,formErrors:a||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=fb[e];return r?t(r,{value:i,setValue:n,formErrors:a,disabled:l}):null},yb=()=>{const i=v(),{isEnterprise:n,platformType:o,version:l}=Mp(),r=ve(o,l),{selectedOption:s,genericForm:c,sourceOptions:d,namespaceOptions:p}=Kh(),u=a(()=>ye(s?.supportedLanguages),[s?.supportedLanguages]),h=a(()=>{if(s)return s.type===fe.CustomInstrumentation?[]:Se(s.supportedLanguages)},[s]);if(!c||!s)return t(Z,{title:"No active form"});const{formData:g,handleFormChange:m,formErrors:b}=c;return e($,{$gap:24,children:[e(T,{$gap:12,$justifyContent:"space-between",children:[t(Q,{size:C.XXXS,maxLines:2,children:s.description}),e(T,{$gap:12,children:[t(Wg,{isEnabled:!g.disabled,setIsEnabled:e=>m("disabled",!e),fieldDisabled:!n}),t(H,{leftIcon:ku,variant:K.Secondary,size:W.S,onClick:()=>s.docsUrl&&window.open(s.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Yg,{option:s,formState:g}),!!u.length&&e(T,{$gap:12,children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:"Supported Languages:"}),u.map(e=>t(E,{label:we(e),leftIcon:xe(e),backgroundColor:i.v2.colors.purple[900]},e))]}),r&&t(Jg,{scopes:g.sourceScopes,onChange:e=>m("sourceScopes",e),sourceOptions:d,namespaceOptions:p,supportedLanguages:h,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!n}),t(Y,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:g.ruleName,onChange:({target:{value:e}})=>m("ruleName",e),errorMessage:b.ruleName,disabled:!n}),t(vb,{ruleType:s.type,dynamicFields:s.fields,value:g,setValue:(e,t)=>m(e,t),formErrors:b,disabled:!n}),t(ee,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:g.notes,onChange:({target:{value:e}})=>m("notes",e),errorMessage:b.notes,disabled:!n})]})},Sb=()=>{const{pendingMerge:e,confirmMerge:i,cancelMerge:n}=Yh();if(!e)return null;const{existingName:a,editingName:o}=e;return t(Ce,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:ke.DATA_STREAM_MERGE_WARNING(o,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:K.Primary,onClick:i},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:K.Secondary,onClick:n}})},xb=({autoFocus:i})=>{const{dataStreams:n}=Te(),{genericForm:o,excludeName:l,editingName:r}=Yh(),{formData:s,formErrors:c,handleFormChange:d}=o,p=s.name,u=a(()=>n.find(e=>e.name===p&&e.name!==l),[n,p,l]);return e($,{$width:"100%",$gap:12,children:[t(Y,{name:"data-stream-name",label:ke.STREAM_NAME,placeholder:ke.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:ke.STREAM_DESCRIPTION,required:!0,autoFocus:i,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(te,{status:ie.Warning,message:ke.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},wb=()=>{const{selectedStreamName:e}=Te(),{genericForm:i}=Jh();if(!i)return t(Z,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:o}=i;return t(Y,{name:"sourceName",label:ke.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:o.otelServiceName})},Cb=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],kb=f.div`
|
|
56
|
+
`,mb=s(({isEdit:i},n)=>{const a=v(),{isK8s:r}=Vp(),{destinationsApi:s}=Jh(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=qh(),[f,y]=l(h?.testResult),[S,x]=l(!!h);o(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!d?.option.testConnectionSupported||!p||!r)return;const e=await s.testConnection(re(p.formData));return y(e),e};return c(n,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e($,{$gap:24,style:{minHeight:"100%"},children:[e(T,{$gap:12,$justifyContent:"space-between",children:[f?f.succeeded?t(te,{status:ie.Success,message:f.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(te,{status:ie.Error,message:f.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(T,{$gap:12,children:[r&&t(qg,{isEnabled:!p.formData.disabled,setIsEnabled:e=>p.handleFormChange("disabled",!e),fieldDisabled:S}),t(H,{"data-id":"dest-form-docs",leftIcon:$u,variant:K.Secondary,size:W.S,onClick:()=>window.open(`${ne}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(Zg,{title:"This connection will monitor:",allowedSignals:le(d.option.supportedSignals),selectedSignals:oe(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(ae.Logs),metrics:e.includes(ae.Metrics),traces:e.includes(ae.Traces),profiles:e.includes(ae.Profiles)}),disabled:S,errorMessage:p.formErrors.exportedSignals}),t(Y,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:p.formData.name,onChange:({target:{value:e}})=>p.handleFormChange("name",e),disabled:S,errorMessage:p.formErrors.name}),t(Jg,{signals:oe(p.formData.exportedSignals),fields:d.option.fields,disabled:S,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const i=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",i?p.formData.fields.map(i=>i.key===e?{...i,value:t}:i):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!i&&e(gb,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(H,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Nu,variant:K.Secondary,textColor:a.v2.colors.red[500],onClick:()=>b(d.unsavedIdx)})}),r&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(H,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:K.Secondary,onClick:w})}),h&&t("div",S?{style:{width:"150px"},children:t(H,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Au,variant:K.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(H,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:K.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),i=!!e&&!e.succeeded;m(d.unsavedIdx,{formData:t,testResult:e},i)}}})}),!h&&t("div",{style:{width:"150px"},children:t(H,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:K.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),i=!!e&&!e.succeeded;g({formData:t,testResult:e},i)}}})})]})]}):t(Z,{title:"No active form"})});mb.displayName="AddDestinationForm";const bb=[{id:se.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:se.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:se.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],fb=[{id:se.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:se.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:se.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],vb=["*"],yb=[{id:pe.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:pe.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:pe.DbQuery,label:"Collect DB query",tooltip:""},{id:pe.Messaging,label:"Collect messaging",tooltip:""}],Sb={[me.Java]:[new he("","")],[me.Golang]:[new ue("")],[me.Php]:[new ge("","")]},xb={[fe.CodeAttributes]:({value:n,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=a(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);o(()=>{if(!d.length&&!c){const e={[se.FilePath]:!0,[se.Function]:!0,[se.LineNumber]:!0,[se.Column]:null,[se.Namespace]:null,[se.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(se).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});l("codeAttributes",n)};return e(i,{children:[e($,{$gap:12,children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:"Recommended data to collect"}),t($,{$gap:6,children:bb.map(({id:e,label:i,tooltip:n})=>t(ce,{text:n,withIcon:!0,children:t(x,{label:i,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(R,{errorMessage:c})]}),e($,{$gap:12,children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:"Verbose data to collect"}),t($,{$gap:6,children:fb.map(({id:e,label:i,tooltip:n})=>t(ce,{text:n,withIcon:!0,children:t(x,{label:i,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(R,{errorMessage:c})]})]})},[fe.CustomInstrumentation]:({value:n,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=a(()=>(n?.customInstrumentations?.[me.Golang]||[]).map(e=>new ue(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),p=a(()=>(n?.customInstrumentations?.[me.Java]||[]).map(e=>new he(e.className,e.methodName)),[n]),u=a(()=>(n?.customInstrumentations?.[me.Php]||[]).map(e=>new ge(e.className,e.functionName)),[n]);return o(()=>{n?.customInstrumentations||c||l("customInstrumentations",{[me.Golang]:Sb[me.Golang],[me.Java]:Sb[me.Java],[me.Php]:Sb[me.Php]})},[]),e(i,{children:[e($,{children:[e(T,{$gap:8,children:[t(Ou,{}),t(z,{label:"Golang custom probes"})]}),t(P,{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:d,setValues:e=>{const t={};t[me.Golang]=e.map(e=>new ue(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[me.Java]=p,t[me.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e($,{children:[e(T,{$gap:8,children:[t(Eu,{}),t(z,{label:"Java custom probes"})]}),t(P,{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:p,setValues:e=>{const t={};t[me.Golang]=d,t[me.Java]=e.map(e=>new he(e.className,e.methodName)),t[me.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e($,{children:[e(T,{$gap:8,children:[t(Du,{}),t(z,{label:"PHP custom probes"})]}),t(te,{status:ie.Warning,message:be.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(P,{name:"phpProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. App\\Service\\OrderService",tooltip:"The fully qualified class name to instrument. Leave empty for a global function."},{keyName:"functionName",label:"Function name",placeholder:"e.g. processOrder",tooltip:"The name of the function or method to instrument."}],values:u,setValues:e=>{const t={};t[me.Golang]=d,t[me.Java]=p,t[me.Php]=e.map(e=>new ge(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[fe.HeadersCollection]:({value:e,setValue:i,formErrors:n,disabled:l})=>{const r=n.headersCollection,s=a(()=>e?.headersCollection?.[de.HeaderKeys]||[],[e]),c=e=>{const t={[de.HeaderKeys]:e};i("headersCollection",t)};return o(()=>{s.length||r||c(vb)},[]),t(M,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:s,setValues:c,errorMessage:r,disabled:l})},[fe.PayloadCollection]:({value:i,setValue:n,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=a(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);return o(()=>{if(!c.length&&!s){const e={[pe.HttpRequest]:{},[pe.HttpResponse]:{},[pe.DbQuery]:{},[pe.Messaging]:{}};n("payloadCollection",e)}},[]),e($,{$gap:12,children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:"Type of data to collect"}),t($,{$gap:6,children:yb.map(({id:e,label:i,tooltip:a})=>t(ce,{text:a,withIcon:!0,children:t(x,{label:i,value:c.includes(e),onChange:t=>((e,t)=>{const i=t?[...c,e]:c.filter(t=>t!==e),a={[pe.HttpRequest]:i.includes(pe.HttpRequest)?{}:null,[pe.HttpResponse]:i.includes(pe.HttpResponse)?{}:null,[pe.DbQuery]:i.includes(pe.DbQuery)?{}:null,[pe.Messaging]:i.includes(pe.Messaging)?{}:null};n("payloadCollection",a)})(e,t),disabled:r})},e))}),t(R,{errorMessage:s})]})},[fe.NetworkMetrics]:null,[fe.UnknownType]:null},wb=({ruleType:e,value:i,setValue:n,formErrors:a,dynamicFields:o,disabled:l})=>{if(!e)return null;if(o?.length)return t(Jg,{fields:o,value:i||{},setValue:n,formErrors:a||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=xb[e];return r?t(r,{value:i,setValue:n,formErrors:a,disabled:l}):null},Cb=()=>{const i=v(),{isEnterprise:n,platformType:o,version:l}=Vp(),r=ve(o,l),{selectedOption:s,genericForm:c,sourceOptions:d,namespaceOptions:p}=Zh(),u=a(()=>ye(s?.supportedLanguages),[s?.supportedLanguages]),h=a(()=>{if(s)return s.type===fe.CustomInstrumentation?[]:Se(s.supportedLanguages)},[s]);if(!c||!s)return t(Z,{title:"No active form"});const{formData:g,handleFormChange:m,formErrors:b}=c;return e($,{$gap:24,children:[e(T,{$gap:12,$justifyContent:"space-between",children:[t(Q,{size:C.XXXS,maxLines:2,children:s.description}),e(T,{$gap:12,children:[t(qg,{isEnabled:!g.disabled,setIsEnabled:e=>m("disabled",!e),fieldDisabled:!n}),t(H,{leftIcon:$u,variant:K.Secondary,size:W.S,onClick:()=>s.docsUrl&&window.open(s.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Qg,{option:s,formState:g}),!!u.length&&e(T,{$gap:12,children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:"Supported Languages:"}),u.map(e=>t(E,{label:we(e),leftIcon:xe(e),backgroundColor:i.v2.colors.purple[900]},e))]}),r&&t(em,{scopes:g.sourceScopes,onChange:e=>m("sourceScopes",e),sourceOptions:d,namespaceOptions:p,supportedLanguages:h,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!n}),t(Y,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:g.ruleName,onChange:({target:{value:e}})=>m("ruleName",e),errorMessage:b.ruleName,disabled:!n}),t(wb,{ruleType:s.type,dynamicFields:s.fields,value:g,setValue:(e,t)=>m(e,t),formErrors:b,disabled:!n}),t(ee,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:g.notes,onChange:({target:{value:e}})=>m("notes",e),errorMessage:b.notes,disabled:!n})]})},kb=()=>{const{pendingMerge:e,confirmMerge:i,cancelMerge:n}=Qh();if(!e)return null;const{existingName:a,editingName:o}=e;return t(Ce,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:ke.DATA_STREAM_MERGE_WARNING(o,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:K.Primary,onClick:i},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:K.Secondary,onClick:n}})},Tb=({autoFocus:i})=>{const{dataStreams:n}=Te(),{genericForm:o,excludeName:l,editingName:r}=Qh(),{formData:s,formErrors:c,handleFormChange:d}=o,p=s.name,u=a(()=>n.find(e=>e.name===p&&e.name!==l),[n,p,l]);return e($,{$width:"100%",$gap:12,children:[t(Y,{name:"data-stream-name",label:ke.STREAM_NAME,placeholder:ke.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:ke.STREAM_DESCRIPTION,required:!0,autoFocus:i,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(te,{status:ie.Warning,message:ke.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Ib=()=>{const{selectedStreamName:e}=Te(),{genericForm:i}=eg();if(!i)return t(Z,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:o}=i;return t(Y,{name:"sourceName",label:ke.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:o.otelServiceName})},$b=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Nb=f.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: column;
|
|
59
59
|
gap: 24px;
|
|
60
|
-
`,
|
|
60
|
+
`,Ab=f.div`
|
|
61
61
|
display: contents;
|
|
62
62
|
& > * {
|
|
63
63
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
64
64
|
transition: opacity 0.2s ease;
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,Ob=({value:e})=>{const i=v();return t(E,e?{status:ie.Success,label:De,leftIcon:zu}:{label:ze,leftIcon:Ru,backgroundColor:i.v2.colors.silver[500],textColor:i.v2.colors.white[500]})},Eb=({value:e,onChange:i})=>{const n=v(),o=a(()=>[{icon:zu,label:De,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:Ru,label:ze,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(F,{options:o,selected:e,setSelected:i??(()=>{}),disabled:!i})},Db=()=>{const e=tg();switch(e.formType){case ig.Create:return t(zb,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Eb,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case ig.View:return e.data?e.isEditing?t(zb,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Eb,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Rb,{data:e.data,renderAction:()=>t(Ob,{value:!e.data?.rule.disabled})}):null;case ig.EditAutoNoisy:return t(Pb,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ee,sectionTitle:Ne,sectionSubTitle:Oe,presetLabel:$e,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(Eb,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ig.EditAutoCostReduction:return t(Pb,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ae,sectionTitle:Ne,presetLabel:$e,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(Eb,{value:e.localEnabled,onChange:e.setLocalEnabled})});case ig.EditAutoHighlyRelevant:return t(Nb,{children:t(tm,{title:e.localEnabled?void 0:Ie,summary:e.summary,renderAction:()=>t(Eb,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},zb=({category:i,formData:n,onChange:a,sourceOptions:o,namespaceOptions:l,renderAction:r})=>e(Nb,{children:[t(am,{category:i,formState:n,renderAction:r}),e(Ab,{$faded:!!n.disabled,children:[t(om,{category:i,formState:n,onChange:a}),t(em,{scopes:n.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:o,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(lm,{category:i,formState:n,onChange:a}),"highlyRelevant"===i&&t(rm,{formState:n,onChange:a}),"highlyRelevant"===i&&t(sm,{ruleType:n.ruleType,formState:n,onChange:a}),t(cm,{category:i,formState:n,onChange:a})]})]}),Rb=({data:i,renderAction:n})=>e(Nb,{children:[t(am,{readOnly:!0,summary:i.summary,renderAction:n}),t(om,{readOnly:!0,data:i}),t(em,{readOnly:!0,scopes:Up(i.rule.sourceScopes)}),t(lm,{readOnly:!0,data:i}),t(cm,{readOnly:!0,data:i}),"highlyRelevant"===i.category&&t(sm,{readOnly:!0,rule:i.rule})]}),Pb=({enabled:i,summary:n,inactiveTitle:a,sectionTitle:o,sectionSubTitle:l,presetLabel:r,customInputName:s,showModeToggle:c=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:g,customPercentage:m,setCustomPercentage:b,renderAction:f})=>{const v=d(e=>u(e),[u]),y=d(e=>g(e),[g]),S=d(e=>b(e.target.value),[b]),x=!c||"sample"===p;return e(Nb,{children:[t(tm,{title:i?void 0:a,summary:n,renderAction:f}),t(Ab,{$faded:!i,children:e(Re,{richTitle:{title:o,subTitle:l},children:[c&&t($,{$alignItems:"flex-start",children:t(F,{options:$b,selected:p,setSelected:v})}),x&&t(im,{description:r,options:nm,selected:h,onSelect:y,customName:s,customLabel:Pe,customPlaceholder:"5%",customValue:m,onCustomChange:S})]})})]})},Xb=f($)`
|
|
67
67
|
width: 100%;
|
|
68
68
|
gap: 4px;
|
|
69
69
|
padding: 12px;
|
|
70
70
|
border-radius: 12px;
|
|
71
71
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
72
|
-
`,
|
|
72
|
+
`,Lb=f($)`
|
|
73
73
|
width: 100%;
|
|
74
74
|
gap: 4px;
|
|
75
|
-
`,
|
|
75
|
+
`,_b=f(T)`
|
|
76
76
|
width: 100%;
|
|
77
77
|
align-items: center;
|
|
78
78
|
gap: 4px;
|
|
79
|
-
`,
|
|
79
|
+
`,Mb=f.div`
|
|
80
80
|
margin-left: auto;
|
|
81
|
-
`,
|
|
81
|
+
`,Fb=f.div`
|
|
82
82
|
width: 100%;
|
|
83
83
|
min-height: 99px;
|
|
84
84
|
padding: 8px 16px;
|
|
85
85
|
border-radius: 12px;
|
|
86
86
|
overflow: hidden;
|
|
87
|
-
`,
|
|
87
|
+
`,Bb=f(T)`
|
|
88
88
|
width: 100%;
|
|
89
89
|
align-items: flex-start;
|
|
90
90
|
gap: 12px;
|
|
91
|
-
`,
|
|
91
|
+
`,Vb=f($)`
|
|
92
92
|
flex: 1;
|
|
93
93
|
min-width: 0;
|
|
94
94
|
gap: 4px;
|
|
95
|
-
`,
|
|
95
|
+
`,Ub=f.div`
|
|
96
96
|
display: flex;
|
|
97
97
|
align-items: center;
|
|
98
98
|
width: 100%;
|
|
99
99
|
min-height: 32px;
|
|
100
|
-
`,
|
|
100
|
+
`,Gb=f($)`
|
|
101
101
|
width: 100%;
|
|
102
102
|
min-height: 80px;
|
|
103
103
|
align-items: center;
|
|
@@ -105,7 +105,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
105
105
|
gap: 8px;
|
|
106
106
|
padding: 8px 0;
|
|
107
107
|
text-align: center;
|
|
108
|
-
`,
|
|
108
|
+
`,jb=f.div`
|
|
109
109
|
display: flex;
|
|
110
110
|
align-items: center;
|
|
111
111
|
justify-content: center;
|
|
@@ -114,16 +114,16 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
114
114
|
padding: 4px;
|
|
115
115
|
border-radius: 23px;
|
|
116
116
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
117
|
-
`,
|
|
117
|
+
`,Hb=f($)`
|
|
118
118
|
align-items: center;
|
|
119
119
|
gap: 0;
|
|
120
|
-
`,
|
|
120
|
+
`,Wb=e=>{const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e},Kb=({title:i,description:n,items:o,selected:l,onToggle:r,formatLabel:s=Wb,onToggleAll:c,emptyIcon:d,emptyTitle:p,emptyDescription:u})=>{const h=v(),g=a(()=>((e,t=3)=>{const i=Math.ceil(e.length/t)||1;return Array.from({length:t},(t,n)=>e.slice(n*i,(n+1)*i))})(o),[o]),m=a(()=>o.reduce((e,t)=>l.has(t)?e+1:e,0),[o,l]),b=o.length>0&&m===o.length,f=m>0&&!b;return e(Xb,{"data-id":`guardrail-facet-${i.toLowerCase()}`,children:[e(Lb,{children:[e(_b,{children:[t(w,{size:C.XXS,children:i}),t(E,{label:o.length,status:ie.Unknown,textSize:C.XXXS}),o.length>0&&c&&t(Mb,{children:t(x,{name:`guardrail-facet-${i}-select-all`,label:"Select all",size:Xe.S,value:b,partiallyChecked:f,onChange:e=>c(e)})})]}),t(w,{size:C.XXXS,color:k.Secondary,children:n})]}),t(Fb,{children:0===o.length?e(Gb,{children:[t(jb,{children:t(d,{size:32,fill:h.v2.colors.silver[400]})}),e(Hb,{children:[t(w,{size:C.XS,color:k.Secondary,align:"center",children:p}),t(w,{size:C.XXXS,color:k.Disable,align:"center",children:u})]})]}):t(Bb,{children:g.map((e,n)=>t(Vb,{children:e.map((e,a)=>t(Ub,{children:t(x,{name:`guardrail-facet-${i}-${n}-${a}`,label:s(e),size:Xe.S,value:l.has(e),onChange:t=>r(e,t)})},`${e}-${n}-${a}`))},`col-${n}`))})})]})},Yb=f($)`
|
|
121
121
|
width: 100%;
|
|
122
122
|
gap: 4px;
|
|
123
123
|
padding: 12px;
|
|
124
124
|
border-radius: 12px;
|
|
125
125
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
126
|
-
`,
|
|
126
|
+
`,Jb=({id:i,title:n,description:a,placeholder:o,values:l,setValues:r})=>e(Yb,{"data-id":`guardrail-facet-${i}-extra`,children:[t(w,{size:C.XXS,children:n}),t(w,{size:C.XXXS,color:k.Secondary,children:a}),t(M,{name:`guardrail-${i}-extra`,values:l,setValues:r,placeholder:o,plain:!0})]}),qb=f.div`
|
|
127
127
|
display: flex;
|
|
128
128
|
flex-direction: column;
|
|
129
129
|
flex: 1;
|
|
@@ -134,7 +134,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
134
134
|
overflow: hidden;
|
|
135
135
|
border-radius: 16px 0 16px 0;
|
|
136
136
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
137
|
-
`,
|
|
137
|
+
`,Zb=f.div`
|
|
138
138
|
display: flex;
|
|
139
139
|
flex-direction: column;
|
|
140
140
|
flex: 1;
|
|
@@ -143,28 +143,28 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
143
143
|
gap: 16px;
|
|
144
144
|
overflow-y: auto;
|
|
145
145
|
padding-bottom: 8px;
|
|
146
|
-
`,
|
|
146
|
+
`,Qb=f.div`
|
|
147
147
|
width: 100%;
|
|
148
148
|
padding: 0 16px;
|
|
149
|
-
`,
|
|
149
|
+
`,ef=f.div`
|
|
150
150
|
display: flex;
|
|
151
151
|
flex-direction: row;
|
|
152
152
|
align-items: flex-start;
|
|
153
153
|
flex-wrap: wrap;
|
|
154
154
|
width: 100%;
|
|
155
155
|
gap: 10px;
|
|
156
|
-
`,
|
|
156
|
+
`,tf=f.div`
|
|
157
157
|
flex: 0.5;
|
|
158
|
-
`,
|
|
158
|
+
`,nf=f(T)`
|
|
159
159
|
width: 100%;
|
|
160
160
|
justify-content: center;
|
|
161
161
|
padding: 48px 0;
|
|
162
|
-
`,
|
|
162
|
+
`,af=f(T)`
|
|
163
163
|
flex: 1;
|
|
164
164
|
min-width: 0;
|
|
165
165
|
align-items: center;
|
|
166
166
|
gap: 8px;
|
|
167
|
-
`,
|
|
167
|
+
`,of=f.button`
|
|
168
168
|
display: flex;
|
|
169
169
|
align-items: center;
|
|
170
170
|
gap: 8px;
|
|
@@ -179,9 +179,9 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
179
179
|
&:hover {
|
|
180
180
|
border-color: ${({theme:e})=>e.v2.colors.purple[400]};
|
|
181
181
|
}
|
|
182
|
-
`,
|
|
182
|
+
`,lf=f($)`
|
|
183
183
|
gap: 0;
|
|
184
|
-
`,
|
|
184
|
+
`,rf=e=>og(e),sf=({services:n=[],onNamespaceChange:o,onServiceChange:r})=>{const{profileLoading:s,isEdit:c,namespace:d,service:p,canCreate:u,canUpdate:h,canDiscard:g,isSubmitting:m,canDelete:b,handleDiscard:f,handleSubmit:v,handleDelete:y,setMode:S,genericForm:x,callerItems:T,calleeItems:I,egressItems:$,transactionItems:N,setExtraCallers:A,setExtraCallees:O,setExtraEgress:E,toggleCaller:D,toggleCallee:z,toggleEgress:R,toggleTransaction:P,toggleAllCallers:X,toggleAllCallees:L,toggleAllEgress:_,toggleAllTransactions:M}=ag(),{mode:F,callers:B,callees:V,egress:G,transactions:H,extraCallers:Y,extraCallees:J,extraEgress:q}=x.formData,Z=a(()=>new Set(B),[B]),Q=a(()=>new Set(V),[V]),ee=a(()=>new Set(G),[G]),te=a(()=>new Set(H),[H]),[ie,ne]=l(!1),ae=a(()=>{const e=new Set(n.map(e=>e.namespace).filter(Boolean));return d&&e.add(d),Array.from(e).sort()},[n,d]),oe=a(()=>{const e=n.filter(e=>e.namespace===d).map(e=>e.service);return p&&e.push(p),Array.from(new Set(e)).sort()},[n,d,p]),le=a(()=>ae.map(e=>({id:e,label:e})),[ae]),re=a(()=>oe.map(e=>({id:e,label:e})),[oe]);return e(qb,{"data-id":c?"guardrails-edit-panel":"guardrails-create-panel",children:[e(Zb,{children:[t(Qb,{children:t(w,{size:C.S,children:c?Le:_e})}),e(ef,{children:[t(tf,{children:t(Me,{label:Fe,options:le,values:d?[d]:[],setValues:e=>o?.(e[0]||""),placeholder:"Select namespace...",disabled:c})}),t(tf,{children:t(Me,{label:Be,options:re,values:p?[p]:[],setValues:e=>r?.(e[0]||""),placeholder:"Select service...",disabled:c||!d})})]}),s?t(nf,{children:t(Ve,{withSpinner:!0})}):e(i,{children:[e(af,{children:[e(of,{type:"button",$selected:F===Ue.Enforce,onClick:()=>S(Ue.Enforce),children:[t(U,{"data-id":c?"guardrail-edit-mode-enforce":"guardrail-mode-enforce",value:F===Ue.Enforce,onChange:()=>S(Ue.Enforce),size:j.S}),e(lf,{children:[t(w,{size:C.XXS,children:Ge}),t(w,{size:C.XXXS,color:k.Secondary,children:je})]})]}),e(of,{type:"button",$selected:F===Ue.Suggest,onClick:()=>S(Ue.Suggest),children:[t(U,{"data-id":c?"guardrail-edit-mode-suggest":"guardrail-mode-suggest",value:F===Ue.Suggest,onChange:()=>S(Ue.Suggest),size:j.S}),e(lf,{children:[t(w,{size:C.XXS,children:He}),t(w,{size:C.XXXS,color:k.Secondary,children:We})]})]})]}),t(Kb,{title:qe,description:Je,items:T,selected:Z,onToggle:D,onToggleAll:X,emptyIcon:Pu,emptyTitle:Ye,emptyDescription:Ke}),t(Jb,{id:"callers",title:et,description:Qe,placeholder:Ze,values:Y,setValues:A}),t(Kb,{title:at,description:nt,items:I,selected:Q,onToggle:z,onToggleAll:L,emptyIcon:Xu,emptyTitle:it,emptyDescription:tt}),t(Jb,{id:"callees",title:lt,description:ot,placeholder:Ze,values:J,setValues:O}),t(Kb,{title:dt,description:ct,items:$,selected:ee,onToggle:R,onToggleAll:_,emptyIcon:Lu,emptyTitle:st,emptyDescription:rt}),t(Jb,{id:"egress",title:ht,description:ut,placeholder:pt,values:q,setValues:E}),t(Kb,{title:ft,description:bt,items:N,selected:te,onToggle:P,formatLabel:rf,onToggleAll:M,emptyIcon:_u,emptyTitle:mt,emptyDescription:gt})]})]}),t(vt,{isOpen:!0,position:kt.BottomRight,actions:c?[...b?[{id:"delete-guardrail",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,label:yt,leftIcon:ku,onClick:()=>ne(!0),disabled:m}}]:[],{id:"discard-guardrail",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,label:xt,leftIcon:Mu,onClick:f,disabled:!g}},{id:"update-guardrail",type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:wt,leftIcon:Fu,onClick:v,disabled:!h}}]:[{id:"create-guardrail",type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:Ct,leftIcon:Fu,onClick:v,disabled:!u}}]}),b&&t(Ce,{isOpen:ie,onClose:()=>ne(!1),title:"Delete Guardrail",description:"Are you sure you want to delete this guardrail?",approveButton:{label:"Delete",onClick:async()=>{ne(!1),await y()}},denyButton:{label:"Cancel",onClick:()=>ne(!1),variant:K.Secondary}})]})},cf=({profile:e,profileLoading:i,serviceNames:n=[],guardrail:a=null,namespace:o="",service:l="",onSubmit:r,onDelete:s,...c})=>t(ng,{profile:e,profileLoading:i,serviceNames:n,guardrail:a,namespace:o,service:l,onSubmit:r,onDelete:s,children:t(sf,{...c})}),df=[{id:lg.Minutes,label:Tt},{id:lg.Hours,label:It},{id:lg.Days,label:$t}],pf=f($)`
|
|
185
185
|
flex: 1;
|
|
186
186
|
min-width: 0;
|
|
187
187
|
height: 100%;
|
|
@@ -190,37 +190,37 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
190
190
|
overflow: hidden;
|
|
191
191
|
border-radius: 16px 0 16px 0;
|
|
192
192
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
193
|
-
`,
|
|
193
|
+
`,uf=f($)`
|
|
194
194
|
flex: 1;
|
|
195
195
|
min-height: 0;
|
|
196
196
|
width: 100%;
|
|
197
197
|
gap: 12px;
|
|
198
198
|
overflow-y: auto;
|
|
199
|
-
`,
|
|
199
|
+
`,hf=f($)`
|
|
200
200
|
width: 100%;
|
|
201
201
|
gap: 4px;
|
|
202
202
|
padding: 12px;
|
|
203
|
-
`,
|
|
203
|
+
`,gf=f(T)`
|
|
204
204
|
width: 100%;
|
|
205
205
|
align-items: center;
|
|
206
206
|
gap: 4px;
|
|
207
|
-
`,
|
|
207
|
+
`,mf=f($)`
|
|
208
208
|
width: 100%;
|
|
209
209
|
gap: 12px;
|
|
210
210
|
padding: 12px;
|
|
211
211
|
border-radius: 12px;
|
|
212
212
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
213
|
-
`,
|
|
213
|
+
`,bf=f(T)`
|
|
214
214
|
width: 100%;
|
|
215
215
|
align-items: center;
|
|
216
216
|
gap: 12px;
|
|
217
217
|
flex-wrap: wrap;
|
|
218
|
-
`,
|
|
218
|
+
`,ff=f(T)`
|
|
219
219
|
width: 100%;
|
|
220
220
|
align-items: center;
|
|
221
221
|
gap: 8px;
|
|
222
222
|
flex-wrap: wrap;
|
|
223
|
-
`,
|
|
223
|
+
`,vf=f.button`
|
|
224
224
|
display: flex;
|
|
225
225
|
align-items: center;
|
|
226
226
|
gap: 8px;
|
|
@@ -234,7 +234,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
234
234
|
&:hover {
|
|
235
235
|
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
236
236
|
}
|
|
237
|
-
`,
|
|
237
|
+
`,yf=f.div`
|
|
238
238
|
height: 32px;
|
|
239
239
|
display: flex;
|
|
240
240
|
align-items: stretch;
|
|
@@ -250,23 +250,23 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
250
250
|
padding-top: 0;
|
|
251
251
|
padding-bottom: 0;
|
|
252
252
|
}
|
|
253
|
-
`,
|
|
253
|
+
`,Sf=f.div`
|
|
254
254
|
width: 100%;
|
|
255
255
|
display: flex;
|
|
256
256
|
align-items: center;
|
|
257
257
|
padding: 8px 16px;
|
|
258
258
|
border-radius: 4px;
|
|
259
259
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
260
|
-
`,
|
|
260
|
+
`,xf=f.p`
|
|
261
261
|
margin: 0;
|
|
262
262
|
font-family: ${({theme:e})=>e.font_family.primary};
|
|
263
263
|
font-size: 12px;
|
|
264
264
|
font-weight: 400;
|
|
265
265
|
line-height: normal;
|
|
266
266
|
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
267
|
-
`,
|
|
267
|
+
`,wf=f.span`
|
|
268
268
|
color: ${({theme:e})=>e.v2.colors.purple[400]};
|
|
269
|
-
`,
|
|
269
|
+
`,Cf=f(H)`
|
|
270
270
|
&&:enabled {
|
|
271
271
|
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
272
272
|
|
|
@@ -278,7 +278,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
278
278
|
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
`,
|
|
281
|
+
`,kf=f.button`
|
|
282
282
|
display: inline-flex;
|
|
283
283
|
align-items: center;
|
|
284
284
|
justify-content: center;
|
|
@@ -292,7 +292,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
292
292
|
&:hover {
|
|
293
293
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
294
294
|
}
|
|
295
|
-
`,
|
|
295
|
+
`,Tf=f($)`
|
|
296
296
|
flex: 1;
|
|
297
297
|
min-width: 0;
|
|
298
298
|
height: 100%;
|
|
@@ -301,41 +301,41 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
301
301
|
overflow: hidden;
|
|
302
302
|
border-radius: 16px 0 16px 0;
|
|
303
303
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
304
|
-
`,
|
|
304
|
+
`,If=f($)`
|
|
305
305
|
width: 100%;
|
|
306
306
|
gap: 4px;
|
|
307
|
-
|
|
307
|
+
`,$f=f(w)`
|
|
308
308
|
white-space: pre-line;
|
|
309
|
-
`,
|
|
309
|
+
`,Nf=f($)`
|
|
310
310
|
width: 100%;
|
|
311
311
|
gap: 32px;
|
|
312
312
|
padding: 12px;
|
|
313
313
|
border-radius: 16px;
|
|
314
314
|
align-items: center;
|
|
315
315
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
316
|
-
`,
|
|
316
|
+
`,Af=f($)`
|
|
317
317
|
width: 100%;
|
|
318
318
|
gap: 24px;
|
|
319
319
|
align-items: center;
|
|
320
320
|
padding: 0 12px;
|
|
321
|
-
`,
|
|
321
|
+
`,Of=f(T)`
|
|
322
322
|
width: 100%;
|
|
323
323
|
align-items: flex-end;
|
|
324
324
|
justify-content: center;
|
|
325
325
|
gap: 16px;
|
|
326
326
|
flex-wrap: wrap;
|
|
327
|
-
|
|
327
|
+
`,Ef=f($)`
|
|
328
328
|
gap: 4px;
|
|
329
|
-
`,
|
|
329
|
+
`,Df=f(Ef)`
|
|
330
330
|
width: 530px;
|
|
331
331
|
max-width: 100%;
|
|
332
|
-
`,
|
|
332
|
+
`,zf=f(Ef)`
|
|
333
333
|
width: 319px;
|
|
334
334
|
max-width: 100%;
|
|
335
|
-
`,
|
|
335
|
+
`,Rf="32px",Pf=f.div`
|
|
336
336
|
display: flex;
|
|
337
337
|
align-items: stretch;
|
|
338
|
-
height: ${
|
|
338
|
+
height: ${Rf};
|
|
339
339
|
|
|
340
340
|
& > div {
|
|
341
341
|
height: 100%;
|
|
@@ -345,16 +345,16 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
345
345
|
height: 100%;
|
|
346
346
|
box-sizing: border-box;
|
|
347
347
|
}
|
|
348
|
-
`,
|
|
348
|
+
`,Xf=f.div`
|
|
349
349
|
width: 100%;
|
|
350
350
|
|
|
351
351
|
& > div > div > div:first-child {
|
|
352
|
-
height: ${
|
|
352
|
+
height: ${Rf};
|
|
353
353
|
box-sizing: border-box;
|
|
354
354
|
padding-top: 0;
|
|
355
355
|
padding-bottom: 0;
|
|
356
356
|
}
|
|
357
|
-
`,
|
|
357
|
+
`,Lf=pg.map(e=>({id:e,label:At[e]})),_f=()=>{const o=v(),{policy:r,genericForm:s,isOverride:c,canUpdate:d,canDiscard:p,isSaving:u,isDeleting:h,promotesWhen:g,currently:m,handleModeChange:b,handleConditionTypeChange:f,handleConditionValueChange:y,handleDurationUnitChange:S,handleRemoveCondition:x,handleAddCondition:I,handleMinMatchesChange:$,handleSave:N,handleDiscard:A,handleDelete:O}=cg(),D=s.formData,[z,R]=l(!1),P=a(()=>Nt.find(e=>e.id===D.mode),[D.mode]),X=D.scope===qt.Service?Ot:D.scope===qt.Transaction?Et:Dt,L=`${At[D.class]} · `,_=D.name.startsWith(L)?D.name.slice(L.length):D.scopeKey;return e(pf,{"data-id":`learning-policy-editor-${r.id}`,children:[e(uf,{children:[e(hf,{children:[e(gf,{children:[e(i,c?{children:[t(E,{label:X,status:ie.Info,invertColors:!0}),t(w,{size:C.XS,nowrap:!0,children:_})]}:{children:[t(w,{size:C.XS,nowrap:!0,children:D.name}),t(E,{label:Dt,status:ie.Warning,invertColors:!0})]}),t(E,{label:zt[D.mode],invertColors:!0,backgroundColor:o.v2.colors.blue[900],textColor:o.v2.colors.blue[300]})]}),e(w,{size:C.XXXS,color:k.Secondary,children:[Rt," ",m]})]}),e(mf,{children:[e(bf,{children:[t(w,{size:C.XS,children:Pt}),t(Xt,{items:[...Nt],selectedIds:[D.mode],setSelectedIds:b,alignX:Lt.Left,children:({ChevronIcon:i,handleClick:n})=>e(vf,{type:"button",onClick:n,"data-id":"learning-policy-combine-mode",children:[t(w,{size:C.XXS,children:P?.label||D.mode}),t(i,{size:18})]})}),D.mode===_t.KOf&&e(T,{$gap:8,style:{alignItems:"center"},children:[t(w,{size:C.XS,children:Mt}),t(yf,{children:t(Y,{"data-id":"learning-policy-min-matches",type:Ft.Number,value:String(D.minMatches??1),onChange:e=>$(Number(e.target.value)),width:"72px",small:!0,min:1})})]})]}),D.conditions.map(i=>{const n=Bt.find(e=>e.id===i.type),a=df.find(e=>e.id===i.durationUnit),l=ai(i.type);return e(ff,{"data-id":`learning-condition-${i.key}`,children:[t(Xt,{items:[...Bt],selectedIds:[i.type],setSelectedIds:e=>f(i.key,e[0]||i.type),alignX:Lt.Left,children:({ChevronIcon:a,handleClick:o})=>e(vf,{type:"button",onClick:o,"data-id":`learning-condition-type-${i.key}`,children:[t(w,{size:C.XXS,children:n?.label||i.type}),t(a,{size:18})]})}),t(yf,{children:t(Y,{"data-id":`learning-condition-value-${i.key}`,type:Ft.Number,value:String(i.value),onChange:e=>y(i.key,e.target.value),width:"79px",small:!0,min:0})}),l&&t(Xt,{items:[...df],selectedIds:[i.durationUnit],setSelectedIds:e=>S(i.key,e[0]||i.durationUnit),alignX:Lt.Left,children:({ChevronIcon:n,handleClick:o})=>e(vf,{type:"button",onClick:o,"data-id":`learning-condition-unit-${i.key}`,children:[t(w,{size:C.XXS,children:a?.label||i.durationUnit}),t(n,{size:18})]})}),t(kf,{type:"button","data-id":`learning-condition-remove-${i.key}`,onClick:()=>x(i.key),children:t(ku,{size:16,fill:o.v2.colors.red[500]})})]},i.key)}),t(Sf,{children:e(xf,{children:[Vt," ",g.parts[0],g.joiner&&g.parts.slice(1).map((i,a)=>e(n.Fragment,{children:[" ",t(wf,{children:g.joiner})," ",i]},`${g.joiner}-${a}`))]})}),t(Cf,{"data-id":"learning-add-condition",label:Ut,rightIcon:Tu,variant:K.Primary,size:W.M,fullWidth:!0,textColor:o.v2.colors.purple[300],onClick:I})]})]}),t(vt,{isOpen:!0,position:kt.BottomRight,richTitle:{icon:Bu,iconWithWrapper:!0,title:jt,titleSize:C.XXXS},actions:[...c?[{id:"delete-learning-policy",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,label:Gt,leftIcon:ku,onClick:()=>R(!0),disabled:h||u}}]:[],{id:"discard-learning-policy",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,label:xt,leftIcon:Mu,onClick:A,disabled:!p}},{id:"save-learning-policy",type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:wt,leftIcon:Fu,onClick:N,disabled:!d}}]}),c&&t(Ce,{isOpen:z,onClose:()=>R(!1),title:"Delete Override",description:"Are you sure you want to delete this learning policy override?",approveButton:{label:"Delete",onClick:async()=>{R(!1),await O()}},denyButton:{label:"Cancel",onClick:()=>R(!1),variant:K.Secondary}})]})},Mf=()=>{const i=v(),{genericForm:n,options:a,canCreate:o,handleSubmit:l}=dg(),{deviationClass:r,scopeType:s,selectedKey:c}=n.formData,d=s===qt.Service?Qt:ei,p=s===qt.Service?ti:ii;return e(Tf,{"data-id":"learning-create-override-panel",children:[e(If,{children:[t(w,{size:C.S,children:Ht}),t($f,{size:C.XXS,color:k.Secondary,children:Wt})]}),t(Nf,{children:e(Af,{children:[e(Df,{children:[t(w,{size:C.XS,color:k.Secondary,children:Kt}),t(Xf,{children:t(Me,{"data-id":"learning-override-class",options:Lf,values:[r],setValues:e=>{return t=e[0]||pg[0],n.handleFormChange("deviationClass",t);var t},placeholder:Yt})})]}),e(Of,{children:[e(Ef,{children:[t(w,{size:C.XS,color:k.Secondary,children:Jt}),t(Pf,{children:t(F,{"data-id":"learning-override-type",size:Zt.L,selected:s,setSelected:e=>{return t=e,n.handleFormChange("scopeType",t);var t},options:[{value:qt.Service,label:Ot,selectedBgColor:i.v2.colors.purple[500],selectedBorderColor:i.v2.colors.purple[500]},{value:qt.Transaction,label:Et,selectedBgColor:i.v2.colors.purple[500],selectedBorderColor:i.v2.colors.purple[500]}]})})]}),e(zf,{children:[t(w,{size:C.XS,color:k.Secondary,children:d}),t(Xf,{children:t(Me,{"data-id":"learning-override-target",options:a,values:c?[c]:[],setValues:e=>{return t=e[0]||"",n.handleFormChange("selectedKey",t);var t},placeholder:p,withSearch:!0,disabled:!a.length})})]})]})]})}),t(vt,{isOpen:!0,position:kt.BottomRight,actions:[{id:"create-learning-override-policy",type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:ni,leftIcon:Fu,onClick:l,disabled:!o}}]})]})},Ff=e=>{if(e.policy){const{policy:i,onSave:n,onDelete:a}=e;return t(rg,{policy:i,onSave:n,onDelete:a,children:t(_f,{})})}const{services:i,transactions:n,existingOverrides:a,initialClass:o,onSubmit:l}=e;return t(sg,{services:i,transactions:n,existingOverrides:a,initialClass:o,onSubmit:l,children:t(Mf,{})})},Bf="260px",Vf=f.div`
|
|
358
358
|
display: flex;
|
|
359
359
|
flex-direction: column;
|
|
360
360
|
flex: 1;
|
|
@@ -364,22 +364,22 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
364
364
|
gap: 0;
|
|
365
365
|
padding: 4px 12px 8px;
|
|
366
366
|
overflow: hidden;
|
|
367
|
-
`,
|
|
367
|
+
`,Uf=f($)`
|
|
368
368
|
flex: 1;
|
|
369
369
|
min-height: 0;
|
|
370
370
|
width: 100%;
|
|
371
371
|
overflow-y: auto;
|
|
372
372
|
gap: 20px;
|
|
373
373
|
padding: 0 4px 32px;
|
|
374
|
-
`,
|
|
374
|
+
`,Gf=f($)`
|
|
375
375
|
width: 100%;
|
|
376
376
|
min-width: 0;
|
|
377
377
|
gap: 4px;
|
|
378
|
-
`,
|
|
378
|
+
`,jf=f($)`
|
|
379
379
|
width: 100%;
|
|
380
380
|
min-width: 0;
|
|
381
381
|
gap: 0;
|
|
382
|
-
`,
|
|
382
|
+
`,Hf=f.div`
|
|
383
383
|
display: flex;
|
|
384
384
|
flex-wrap: wrap;
|
|
385
385
|
align-items: flex-start;
|
|
@@ -387,7 +387,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
387
387
|
gap: 16px;
|
|
388
388
|
width: 100%;
|
|
389
389
|
padding: 10px 0;
|
|
390
|
-
`,
|
|
390
|
+
`,Wf=f.label`
|
|
391
391
|
display: flex;
|
|
392
392
|
flex-direction: column;
|
|
393
393
|
gap: 4px;
|
|
@@ -395,93 +395,93 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
395
395
|
max-width: 420px;
|
|
396
396
|
min-width: 0;
|
|
397
397
|
cursor: pointer;
|
|
398
|
-
`,
|
|
398
|
+
`,Kf=f.div`
|
|
399
399
|
display: flex;
|
|
400
400
|
flex-direction: column;
|
|
401
401
|
gap: 4px;
|
|
402
|
-
flex: 0 0 ${
|
|
403
|
-
width: ${
|
|
402
|
+
flex: 0 0 ${Bf};
|
|
403
|
+
width: ${Bf};
|
|
404
404
|
max-width: 100%;
|
|
405
405
|
box-sizing: border-box;
|
|
406
|
-
`,
|
|
406
|
+
`,Yf=f($)`
|
|
407
407
|
width: 100%;
|
|
408
408
|
gap: 8px;
|
|
409
409
|
margin-top: 8px;
|
|
410
|
-
`,
|
|
410
|
+
`,Jf=f(T)`
|
|
411
411
|
width: 100%;
|
|
412
412
|
gap: 12px;
|
|
413
413
|
align-items: center;
|
|
414
414
|
flex-wrap: wrap;
|
|
415
|
-
`,
|
|
415
|
+
`,qf=f.div`
|
|
416
416
|
flex: 1 1 280px;
|
|
417
417
|
min-width: 0;
|
|
418
418
|
max-width: 420px;
|
|
419
|
-
`,
|
|
419
|
+
`,Zf=f(T)`
|
|
420
420
|
width: 100%;
|
|
421
421
|
gap: 12px;
|
|
422
422
|
align-items: center;
|
|
423
423
|
margin-top: 8px;
|
|
424
424
|
flex-wrap: wrap;
|
|
425
|
-
`,
|
|
425
|
+
`,Qf=({title:i,tooltip:n,children:a})=>e(Gf,{"data-id":`insights-system-section-${i}`,children:[e(T,{$width:"100%",$gap:6,$alignItems:"center",children:[t(w,{size:C.S,children:i}),n?t(ce,{text:n,withIcon:!0}):null]}),a]}),ev=({id:i,label:n,helper:a,hint:o,value:l,unit:r,disabled:s,onChange:c})=>{const d=`${i}-helper`,p=o?`${i}-hint`:void 0,u=p?`${d} ${p}`:d;return e(Hf,{"data-id":`insights-system-row-${i}`,children:[e(Wf,{htmlFor:i,children:[t(w,{size:C.XXS,children:n}),t("span",{id:d,children:t(w,{size:C.XXXS,color:k.Secondary,children:a})})]}),e(Kf,{children:[t(Y,{id:i,name:i,"aria-label":n,"aria-describedby":u,type:Ft.Number,inputMode:"numeric",autoComplete:"off",value:Number.isFinite(l)?String(l):"",onChange:e=>{const t=Number(e.target.value);c(Number.isFinite(t)?t:0)},width:"100%",disabled:s,suffix:r}),o?t("span",{id:p,children:t(w,{size:C.XXXS,color:k.Secondary,children:o})}):null]})]})},tv=({id:i,label:n,helper:a,value:o,disabled:l,onChange:r})=>{const s=`${i}-helper`;return e(Hf,{"data-id":`insights-system-row-${i}`,children:[e(Wf,{children:[t(w,{size:C.XXS,children:n}),t("span",{id:s,children:t(w,{size:C.XXXS,color:k.Secondary,children:a})})]}),t(Kf,{children:t(L,{name:i,value:o,onChange:r,size:Vi.S,disabled:l})})]})},iv=({unsupported:i=!1,error:n=null})=>{const{settings:a,genericForm:o,canUpdate:l,canDiscard:r,isSaving:s,enabledDimCount:c,identityConfirmOpen:d,setIdentityConfirmOpen:p,handleSave:u,handleDiscard:h,persist:g,updateDim:m,removeDim:b,addDim:f}=hg(),v=o.formData,y=e=>t=>o.handleFormChange(e,t);if(i||!a)return t(Vf,{children:t(oi,{$height:"100%",children:t(Z,{hideIcon:!0,title:li,subTitle:n?.message})})});const S=s;return e(Vf,{"data-id":"insights-system-settings-form",children:[e(Uf,{"data-id":"insights-system-panel",children:[t(Qf,{title:si,tooltip:ri,children:e(jf,{children:[t(ev,{id:"system-examples-per-transaction",label:pi,helper:di,value:v.examplesPerTransaction,unit:ci,disabled:S,onChange:y("examplesPerTransaction")}),t(ev,{id:"system-example-sample-interval",label:gi,helper:hi,value:v.exampleSampleIntervalSeconds,unit:ui,disabled:S,onChange:y("exampleSampleIntervalSeconds")})]})}),t(Qf,{title:mi,children:t(jf,{children:t(ev,{id:"system-observation-retention-days",label:yi,helper:vi,hint:fi,value:v.observationRetentionDays,unit:bi,disabled:S,onChange:y("observationRetentionDays")})})}),t(Qf,{title:Si,children:e(jf,{children:[t(ev,{id:"system-max-resident-transactions",label:Ci,helper:wi,value:v.maxResidentTransactions,unit:xi,disabled:S,onChange:y("maxResidentTransactions")}),t(ev,{id:"system-max-baseline-set-members",label:Ii,helper:Ti,value:v.maxBaselineSetMembers,unit:ki,disabled:S,onChange:y("maxBaselineSetMembers")})]})}),t(Qf,{title:$i,children:t(jf,{children:t(ev,{id:"system-flush-interval-seconds",label:Oi,helper:Ai,hint:Ni,value:v.flushIntervalSeconds,unit:ui,disabled:S,onChange:y("flushIntervalSeconds")})})}),t(Qf,{title:Ei,children:t(jf,{children:t(tv,{id:"system-auto-transaction-guardrail",label:zi,helper:Di,value:v.autoTransactionGuardrail,disabled:S,onChange:e=>o.handleFormChange("autoTransactionGuardrail",e)})})}),e(Qf,{title:Ri,children:[t(w,{size:C.XXXS,color:k.Secondary,children:Pi}),e(T,{$gap:4,children:[t(Xi,{label:"Good",variant:_i.Green,size:Li.Small,minWidth:"50px"}),Mi.map(e=>t(Xi,{label:e,variant:_i.Default,size:Li.Small},e))]}),e(T,{$gap:4,children:[t(Xi,{label:"Bad",variant:_i.Red,size:Li.Small,minWidth:"50px"}),Fi.map(e=>t(Xi,{label:e,variant:_i.Default,size:Li.Small},e))]}),t(Yf,{"data-id":"insights-system-identity-dims",children:0===v.identityDimensions.length?t(w,{size:C.XXXS,color:k.Secondary,children:Bi}):v.identityDimensions.map((i,n)=>e(Jf,{children:[t(L,{name:`system-identity-enabled-${n}`,value:i.enabled,onChange:e=>m(n,{enabled:e}),size:Vi.S,disabled:S||!i.enabled&&c>=Ui}),t(w,{size:C.XXXS,color:k.Secondary,children:Gi}),t(qf,{children:t(Y,{id:`system-identity-key-${n}`,name:`system-identity-key-${n}`,placeholder:ji,value:i.key,onChange:e=>m(n,{key:e.target.value}),width:"100%",disabled:S,spellCheck:!1})}),t(H,{"data-id":`insights-system-identity-remove-${n}`,variant:K.Secondary,size:W.S,leftIcon:ku,disabled:S,onClick:()=>b(n)})]},`dim-${n}`))}),e(Zf,{children:[t(H,{"data-id":"insights-system-identity-add",label:Hi,variant:K.Secondary,size:W.S,disabled:S,onClick:f}),t(w,{size:C.XXXS,color:k.Secondary,children:Wi})]})]})]}),t(vt,{isOpen:!0,position:kt.BottomRight,actions:[{id:"discard-system-settings",type:St.Button,buttonProps:{"data-id":"insights-system-discard",variant:K.Secondary,size:W.S,label:xt,leftIcon:Mu,disabled:!r,onClick:h}},{id:"save-system-settings",type:St.Button,buttonProps:{"data-id":"insights-system-save",variant:K.Primary,size:W.S,label:Ki,leftIcon:Fu,disabled:!l,loading:s,onClick:u}}]}),t(Ce,{isOpen:d,onClose:()=>p(!1),title:Zi,description:qi,denyButton:{label:Ji,variant:K.Secondary,disabled:s,onClick:()=>g(!1)},approveButton:{label:Yi,variant:K.Primary,disabled:s,loading:s,onClick:()=>g(!0)}})]})},nv=({settings:e,unsupported:i,error:n,onSave:a})=>t(ug,{settings:e,onSave:a,children:t(iv,{unsupported:i,error:n})}),av=[{severity:en.Critical,minScore:75},{severity:en.High,minScore:50},{severity:en.Medium,minScore:35},{severity:en.Low,minScore:20},{severity:en.Info,minScore:0}],ov={[en.Info]:"Info",[en.Low]:"Low",[en.Medium]:"Medium",[en.High]:"High",[en.Critical]:"Critical"},lv=(e,t=av)=>{const i=[...t].sort((e,t)=>t.minScore-e.minScore);for(const t of i)if(e>=t.minScore)return t.severity;return en.Info},rv=e=>e.join(", "),sv=e=>e.split(/[\n,]+/).map(e=>e.trim()).filter(Boolean),cv=(e,t)=>e.length===t.length&&e.every((e,i)=>e===t[i]),dv=(e,t)=>e.enrichers.filter(e=>e.parentClass===t),pv=e=>{const t=Object.values(Qi);return[...e.deviationClasses].sort((e,i)=>{const n=t.indexOf(e.id),a=t.indexOf(i.id);return-1===n&&-1===a?e.id.localeCompare(i.id):-1===n?1:-1===a?-1:n-a})},uv=f($)`
|
|
426
426
|
width: 100%;
|
|
427
427
|
gap: 12px;
|
|
428
428
|
padding: 0 4px 8px 4px;
|
|
429
|
-
`,
|
|
429
|
+
`,hv=f(w)`
|
|
430
430
|
white-space: pre-line;
|
|
431
|
-
`,
|
|
431
|
+
`,gv=f($)`
|
|
432
432
|
width: 100%;
|
|
433
433
|
gap: 12px;
|
|
434
434
|
padding: 12px;
|
|
435
435
|
border-radius: 12px;
|
|
436
436
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
437
|
-
`,
|
|
437
|
+
`,mv=f(T)`
|
|
438
438
|
width: 100%;
|
|
439
439
|
align-items: center;
|
|
440
440
|
gap: 8px;
|
|
441
441
|
flex-wrap: wrap;
|
|
442
|
-
`,
|
|
442
|
+
`,bv=f(T)`
|
|
443
443
|
width: 100%;
|
|
444
444
|
align-items: center;
|
|
445
445
|
gap: 8px;
|
|
446
446
|
flex-wrap: wrap;
|
|
447
|
-
`,
|
|
447
|
+
`,fv=f(T)`
|
|
448
448
|
align-items: center;
|
|
449
449
|
gap: 8px;
|
|
450
|
-
`,
|
|
450
|
+
`,vv=f($)`
|
|
451
451
|
width: 100%;
|
|
452
452
|
gap: 16px;
|
|
453
453
|
padding: 8px 12px;
|
|
454
454
|
border-radius: 8px;
|
|
455
455
|
border-left: 2px solid ${({theme:e})=>e.v2.colors.purple[400]};
|
|
456
456
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
457
|
-
`,
|
|
457
|
+
`,yv=f($)`
|
|
458
458
|
width: 100%;
|
|
459
459
|
gap: 8px;
|
|
460
460
|
padding: 8px 12px;
|
|
461
461
|
border-radius: 12px;
|
|
462
462
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
463
|
-
`,
|
|
463
|
+
`,Sv=f(T)`
|
|
464
464
|
align-items: center;
|
|
465
465
|
gap: 8px;
|
|
466
|
-
`,
|
|
466
|
+
`,xv=({label:i,source:n,value:a,tooltip:o,onChange:l})=>{const r=v(),s=lv(a),c=((e,t)=>{switch(e){case en.Info:return{backgroundColor:t.v2.colors.blue[900],textColor:t.v2.colors.white[500]};case en.Low:return{backgroundColor:t.v2.colors.green[900],textColor:t.v2.colors.white[500]};case en.Medium:return{backgroundColor:t.v2.colors.yellow[550],textColor:t.v2.colors.black[500]};case en.High:return{backgroundColor:t.v2.colors.orange[500],textColor:t.v2.colors.white[500]};case en.Critical:return{backgroundColor:t.v2.colors.red[800],textColor:t.v2.colors.white[500]}}})(s,r);return e(bv,{children:[e(Sv,{children:[t(w,{size:C.XS,children:i}),o?t(ce,{text:o,withIcon:!0}):null]}),t(Y,{"data-id":`detection-weight-${n}`,type:Ft.Number,value:String(a),onChange:e=>{const t=Number(e.target.value);Number.isFinite(t)&&l(n,Math.max(0,Math.min(100,Math.round(t))))},width:"79px",small:!0,min:0,max:100}),e(fv,{children:[e(w,{size:C.XXXS,color:k.Secondary,children:[on," ",a]}),t(E,{label:ov[s],backgroundColor:c.backgroundColor,textColor:c.textColor})]})]})},wv=({enricher:n,weight:a,listText:o,onWeightChange:l,onListChange:r})=>e(yv,{children:[t(xv,{label:n.label,source:n.source,value:a,tooltip:n.description,onChange:l}),n.list?e(i,{children:[t(ee,{"data-id":`detection-list-${n.list.key}`,label:n.list.label,value:o,onChange:e=>r(n.list.key,e.target.value),minHeight:64}),n.list.hint?t(w,{size:C.XXXS,color:k.Secondary,children:n.list.hint}):null]}):null]}),Cv=({catalog:i,signalWeights:n,enricherLists:o,onChange:r})=>{const s=v(),c=a(()=>pv(i),[i]),[d,p]=l(()=>((e,t)=>{const i=(e=>{if(!e)return{};try{const t=JSON.parse(e);if(!t||"object"!=typeof t||Array.isArray(t))return{};const i={};for(const[e,n]of Object.entries(t)){const t="number"==typeof n?n:Number(n);Number.isFinite(t)&&(i[e]=Math.max(0,Math.min(100,Math.round(t))))}return i}catch{return{}}})(t),n={};for(const t of e.deviationClasses)n[t.id]=i[t.id]??t.weight;for(const t of e.enrichers)n[t.source]=i[t.source]??t.weight;return n})(i,n)),[u,h]=l(()=>{const e=((e,t)=>{const i=(e=>{if(!e)return{};try{const t=JSON.parse(e);if(!t||"object"!=typeof t||Array.isArray(t))return{};const i={};for(const[e,n]of Object.entries(t))Array.isArray(n)&&(i[e]=n.map(String).map(e=>e.trim()).filter(Boolean));return i}catch{return{}}})(t),n={};for(const t of e.enrichers)t.list&&(n[t.list.key]=i[t.list.key]??t.list.default??[]);return n})(i,o);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,rv(t)]))}),g=(e,t)=>{const n=Object.fromEntries(Object.entries(t).map(([e,t])=>[e,sv(t)])),a=((e,t)=>{const i={};for(const n of e.deviationClasses){const e=t[n.id];void 0!==e&&e!==n.weight&&(i[n.id]=e)}for(const n of e.enrichers){const e=t[n.source];void 0!==e&&e!==n.weight&&(i[n.source]=e)}return Object.keys(i).length?JSON.stringify(i):null})(i,e),o=((e,t)=>{const i={};for(const n of e.enrichers){if(!n.list)continue;const e=n.list.key,a=t[e]??n.list.default??[],o=n.list.default??[];cv(a,o)||(i[e]=a)}return Object.keys(i).length?JSON.stringify(i):null})(i,n);r({signalWeights:a,enricherLists:o,overrideCount:a?Object.keys(JSON.parse(a)).length:0})},m=(e,t)=>{const i={...d,[e]:t};p(i),g(i,u)},b=(e,t)=>{const i={...u,[e]:t};h(i),g(d,i)};return e(uv,{"data-id":"detection-signal-weights-panel",children:[t(hv,{size:C.XXXS,color:k.Secondary,children:tn}),c.map(n=>{const a=dv(i,n.id);return e(gv,{"data-id":`detection-signal-card-${n.id}`,children:[e($,{$gap:4,children:[e(mv,{children:[t(w,{size:C.XS,children:n.label}),t(w,{size:C.XXXS,color:k.Secondary,children:n.id}),t(E,{label:n.categoryLabel||n.category,backgroundColor:s.v2.colors.silver[750]})]}),n.description?t(w,{size:C.XXXS,color:k.Secondary,children:n.description}):null]}),t(xv,{label:nn,source:n.id,value:d[n.id]??n.weight,onChange:m}),a.length>0?e(vv,{children:[t(w,{size:C.XXXS,color:s.v2.colors.purple[300],children:an}),a.map(e=>t(wv,{enricher:e,weight:d[e.source]??e.weight,listText:u[e.list?.key||""]??rv(e.list?.default??[]),onWeightChange:m,onListChange:b},e.source))]}):null]},n.id)})]})},kv=e=>`A trace whose signals span two or more kill-chain categories gets a +${e} correlation bonus on top of the summed weights — coordinated behavior across stages is riskier than any single novelty on its own.`,Tv=(e,t)=>{const i=lv(e.weight,t);return{id:e.id,signal:e.label,source:e.id,weight:e.weight,weightLabel:String(e.weight),band:i,bandLabel:ov[i],category:e.categoryLabel||e.category,description:e.description||"",isSubCase:!1}},Iv=(e,t,i)=>{const n=Math.min(100,t+e.weight),a=lv(n,i);return{id:e.source,signal:e.label,source:e.source,weight:e.weight,weightLabel:`${t} + ${e.weight} = ${n}`,band:a,bandLabel:ov[a],category:"",description:e.description||"",isSubCase:!0}},$v=f($)`
|
|
467
467
|
width: 100%;
|
|
468
468
|
gap: 24px;
|
|
469
469
|
padding: 0 2px 24px;
|
|
470
|
-
`,
|
|
470
|
+
`,Nv=f(w)`
|
|
471
471
|
max-width: 820px;
|
|
472
472
|
line-height: 1.45;
|
|
473
|
-
`,
|
|
473
|
+
`,Av=f(T)`
|
|
474
474
|
flex-wrap: wrap;
|
|
475
475
|
align-items: center;
|
|
476
476
|
gap: 6px;
|
|
477
|
-
`,
|
|
477
|
+
`,Ov=f($)`
|
|
478
478
|
width: 100%;
|
|
479
479
|
gap: 10px;
|
|
480
480
|
padding: 14px 16px;
|
|
481
481
|
border-radius: 10px;
|
|
482
482
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
483
483
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
484
|
-
|
|
484
|
+
`,Ev=f.div`
|
|
485
485
|
width: fit-content;
|
|
486
486
|
max-width: 100%;
|
|
487
487
|
padding: 8px 10px;
|
|
@@ -492,25 +492,25 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
492
492
|
font-size: 12px;
|
|
493
493
|
font-weight: 500;
|
|
494
494
|
line-height: 1.4;
|
|
495
|
-
`,
|
|
495
|
+
`,Dv=f($)`
|
|
496
496
|
gap: 3px;
|
|
497
|
-
`,
|
|
497
|
+
`,zv=f(T)`
|
|
498
498
|
align-items: center;
|
|
499
499
|
flex-wrap: wrap;
|
|
500
500
|
gap: 6px;
|
|
501
501
|
font-variant-numeric: tabular-nums;
|
|
502
|
-
`,
|
|
502
|
+
`,Rv=f.div`
|
|
503
503
|
width: 100%;
|
|
504
504
|
overflow: auto;
|
|
505
505
|
max-height: calc(100vh - 280px);
|
|
506
506
|
border-radius: 10px;
|
|
507
507
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
508
|
-
`,
|
|
508
|
+
`,Pv=f.table`
|
|
509
509
|
width: 100%;
|
|
510
510
|
min-width: 760px;
|
|
511
511
|
border-collapse: collapse;
|
|
512
512
|
table-layout: fixed;
|
|
513
|
-
`,
|
|
513
|
+
`,Xv=f.th`
|
|
514
514
|
position: sticky;
|
|
515
515
|
top: 0;
|
|
516
516
|
z-index: 1;
|
|
@@ -520,14 +520,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
520
520
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
521
521
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
522
522
|
white-space: nowrap;
|
|
523
|
-
`,
|
|
523
|
+
`,Lv=f.tr`
|
|
524
524
|
background-color: ${({theme:e,$sub:t})=>t?e.v2.colors.silver[1e3]:"transparent"};
|
|
525
525
|
transition: background-color 0.12s ease;
|
|
526
526
|
|
|
527
527
|
&:hover {
|
|
528
528
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
529
529
|
}
|
|
530
|
-
`,
|
|
530
|
+
`,_v=f.td`
|
|
531
531
|
padding: 14px;
|
|
532
532
|
vertical-align: middle;
|
|
533
533
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[800]};
|
|
@@ -536,27 +536,27 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
536
536
|
tr:last-child > & {
|
|
537
537
|
border-bottom: none;
|
|
538
538
|
}
|
|
539
|
-
`,
|
|
539
|
+
`,Mv=f(_v)`
|
|
540
540
|
padding-left: ${({$sub:e})=>e?"32px":"14px"};
|
|
541
541
|
position: relative;
|
|
542
542
|
|
|
543
543
|
${({$sub:e,theme:t})=>e&&`\n &::before {\n content: '•';\n position: absolute;\n left: 18px;\n top: 50%;\n transform: translateY(-50%);\n line-height: 1;\n color: ${t.v2.colors.silver[300]};\n }\n `}
|
|
544
|
-
`,
|
|
544
|
+
`,Fv=f.code`
|
|
545
545
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
|
546
546
|
font-size: 10.5px;
|
|
547
547
|
line-height: 1.35;
|
|
548
548
|
color: ${({theme:e})=>e.v2.colors.silver[200]};
|
|
549
|
-
`,
|
|
549
|
+
`,Bv=f(w)`
|
|
550
550
|
font-variant-numeric: tabular-nums;
|
|
551
551
|
white-space: nowrap;
|
|
552
|
-
`,
|
|
552
|
+
`,Vv=f($)`
|
|
553
553
|
width: 100%;
|
|
554
554
|
gap: 6px;
|
|
555
555
|
padding: 14px 16px;
|
|
556
556
|
border-radius: 10px;
|
|
557
557
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
558
558
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
559
|
-
`,Mv=(e,t)=>{switch(e){case en.Info:return{backgroundColor:t.v2.colors.blue[900],textColor:t.v2.colors.white[500]};case en.Low:return{backgroundColor:t.v2.colors.green[900],textColor:t.v2.colors.white[500]};case en.Medium:return{backgroundColor:t.v2.colors.yellow[550],textColor:t.v2.colors.black[500]};case en.High:return{backgroundColor:t.v2.colors.orange[500],textColor:t.v2.colors.white[500]};case en.Critical:return{backgroundColor:t.v2.colors.red[800],textColor:t.v2.colors.white[500]}}},Fv=({isOpen:i,onClose:n,catalog:a})=>{const o=v(),l=(e=>{const t=e.severityBands?.length?e.severityBands:void 0,i=[];for(const n of rv(e)){i.push(xv(n,t));for(const a of lv(e,n.id))i.push(wv(a,n.weight,t))}return i})(a),r=(e=>{const t=e.severityBands?.length?e.severityBands:void 0,i=[...e.enrichers].sort((e,t)=>t.weight-e.weight)[0],n=i?e.deviationClasses.find(e=>e.id===i.parentClass):void 0;if(!n||!i)return null;const a=Math.min(100,n.weight+i.weight),o=iv(a,t);return{baseLabel:n.label,baseScore:n.weight,modifierLabel:i.label,modifierWeight:i.weight,finalScore:a,finalBand:o,finalBandLabel:tv[o]}})(a),s=(e=>[...e.severityBands?.length?e.severityBands:[]].filter(e=>e.severity!==en.Info).sort((e,t)=>e.minScore-t.minScore).map(e=>({severity:e.severity,label:tv[e.severity],minScore:e.minScore})))(a),c=a.correlationBonus??15,d=r?Mv(r.finalBand,o):null;return t(ln,{isOpen:i,width:"960px",minWidth:"720px",header:{icon:Mu,title:"Risk model",onClose:n},children:e(Cv,{"data-id":"insights-risk-model-drawer",children:[e($,{$gap:6,children:[t(kv,{size:C.XXXS,color:k.Secondary,children:"The default risk model every anomaly policy builds on. Each signal adds its weight (points) to a 0–100 risk score; dangerous sub-cases add on top of a class’s base novelty. Read-only reference — tune the weights per scope in this Detection policy."}),s.length?e(Tv,{children:[t(w,{size:C.XXXS,color:k.Secondary,children:"A signal alone lands at"}),s.map(e=>{const i=Mv(e.severity,o);return t(E,{label:`${e.label.toLowerCase()} ${e.minScore}`,backgroundColor:i.backgroundColor,textColor:i.textColor},e.label)})]}):null]}),e(Iv,{children:[t(w,{size:C.XXS,children:"How scoring works"}),t($v,{children:"Base signal + modifiers + cross-category bonus = final risk score"}),e(Nv,{children:[t(w,{size:C.XXXS,color:k.Secondary,children:"Modifiers are not independent signals. They are added only when their parent base signal occurs."}),t(w,{size:C.XXXS,color:k.Secondary,children:(p=c,`Signals spanning two or more kill-chain categories receive a +${p} correlation bonus. The final risk score is capped at 100.`)})]}),r&&d?e(Av,{children:[t(w,{size:C.XXXS,children:`${r.baseLabel} ${r.baseScore}`}),t(w,{size:C.XXXS,color:k.Secondary,children:"+"}),t(w,{size:C.XXXS,children:`${r.modifierLabel} ${r.modifierWeight}`}),t(w,{size:C.XXXS,color:k.Secondary,children:"="}),t(E,{label:`${r.finalScore} · ${r.finalBandLabel}`,backgroundColor:d.backgroundColor,textColor:d.textColor})]}):null]}),t(Ov,{children:e(Ev,{children:[t("thead",{children:e("tr",{children:[t(Dv,{style:{width:"17%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"Signal"})}),t(Dv,{style:{width:"15%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"Class / source"})}),t(Dv,{style:{width:"13%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"Weight"})}),t(Dv,{style:{width:"9%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"Band"})}),t(Dv,{style:{width:"13%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"Category"})}),t(Dv,{style:{width:"33%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"What it means"})})]})}),t("tbody",{children:l.map(i=>{const n=Mv(i.band,o);return e(zv,{"data-id":`risk-model-row-${i.id}`,$sub:i.isSubCase,children:[t(Pv,{$sub:i.isSubCase,children:t(w,{size:C.XXXS,children:i.isSubCase?i.signal:t("strong",{children:i.signal})})}),t(Rv,{children:t(Xv,{children:i.source})}),t(Rv,{children:t(Lv,{size:C.XXXS,children:i.weightLabel})}),t(Rv,{children:t(E,{label:i.bandLabel.toLowerCase(),backgroundColor:n.backgroundColor,textColor:n.textColor})}),t(Rv,{children:t(w,{size:C.XXXS,color:k.Secondary,children:i.isSubCase?"Modifier":i.category})}),t(Rv,{children:t(w,{size:C.XXXS,color:k.Secondary,children:i.description})})]},i.id)})})]})}),e(_v,{children:[t(w,{size:C.XXS,children:"Cross-class correlation"}),t(w,{size:C.XXXS,color:k.Secondary,children:Sv(c)})]})]})});var p},Bv={deviationClasses:[{id:Qi.D1_call_edges,label:"New call edge",description:"A service→service call path not seen during learning.",baselineLabel:"Service call edges",baselineDescription:"Learned set of service→service call paths for this transaction.",category:"lateral_movement",categoryLabel:"Lateral movement",weight:20,mitre:"TA0008",owasp:null},{id:Qi.D2_egress,label:"New egress destination",description:"An outbound destination (host/port) not seen during learning.",baselineLabel:"Outbound peers",baselineDescription:"Learned set of external destinations (host:port) this transaction reaches.",category:"exfiltration",categoryLabel:"Exfiltration",weight:35,mitre:"TA0010",owasp:null},{id:Qi.D3_latency,label:"Latency above baseline",description:"Request latency well above the learned p99.",baselineLabel:"Request latency",baselineDescription:"Learned latency distribution for this transaction's entry request (e.g. p99).",category:"resource_abuse",categoryLabel:"Resource abuse",weight:10,mitre:"T1499",owasp:null},{id:Qi.D4_args_returns,label:"Argument / return anomaly",description:"Arguments or return values outside the learned shape.",baselineLabel:"Args & returns",baselineDescription:"Learned shape of captured arguments and return values.",category:"injection",categoryLabel:"Injection",weight:40,mitre:"T1190",owasp:"A03"},{id:Qi.D5_libraries,label:"New instrumentation library",description:"An instrumentation library/runtime not seen during learning.",baselineLabel:"Libraries",baselineDescription:"Learned set of instrumentation libraries and runtimes seen on this transaction.",category:"supply_chain",categoryLabel:"Supply chain",weight:30,mitre:"T1195",owasp:"A06"},{id:Qi.D6_attr_relations,label:"Attribute-relation anomaly",description:"Span attribute relationships outside the learned pattern.",baselineLabel:"Attribute relations",baselineDescription:"Learned relationships between span attributes for this transaction.",category:"access_anomaly",categoryLabel:"Access anomaly",weight:35,mitre:"TA0004",owasp:"A01"},{id:Qi.D7_db_access,label:"New database access",description:"A database table/operation not accessed during learning.",baselineLabel:"Database access",baselineDescription:"Learned set of database systems, tables, and operations touched.",category:"lateral_movement",categoryLabel:"Lateral movement",weight:25,mitre:"TA0008",owasp:null},{id:Qi.D8_payload_size,label:"Payload size above baseline",description:"Request/response payload larger than the learned baseline.",baselineLabel:"Payload size",baselineDescription:"Learned request/response body-size distribution for this transaction.",category:"resource_abuse",categoryLabel:"Resource abuse",weight:20,mitre:"T1499",owasp:null}],enrichers:[{source:"d1_edge_fanout",parentClass:Qi.D1_call_edges,category:"lateral_movement",weight:30,label:"Call fan-out",description:"One request reached many new services at once — possible lateral movement / enumeration."},{source:"d2_metadata_endpoint",parentClass:Qi.D2_egress,category:"exfiltration",weight:50,label:"Cloud metadata endpoint",description:"New egress to a cloud metadata address (e.g. 169.254.169.254) — a hallmark of SSRF / credential theft.",list:{key:"metadata_endpoints",label:"Cloud metadata addresses",hint:"Comma- or newline-separated hosts/IPs. A new egress to any of these is flagged.",default:["169.254.169.254","fd00:ec2::254","metadata.google.internal","100.100.100.200"]}},{source:"d2_dangerous_port",parentClass:Qi.D2_egress,category:"exfiltration",weight:45,label:"Suspicious egress port",description:"New egress on a port commonly used by reverse shells, C2, or tunneling (e.g. 4444, 1337).",list:{key:"dangerous_ports",label:"Suspicious ports",hint:"Comma- or newline-separated port numbers. New egress to any of these is flagged.",default:["23","1080","1337","2323","4444","6667","6697","9050","12345","31337"]}},{source:"d7_destructive_op",parentClass:Qi.D7_db_access,category:"impact",weight:45,label:"Destructive operation",description:"New DELETE/DROP/TRUNCATE/ALTER/UPDATE not seen during learning."},{source:"d7_sensitive_table",parentClass:Qi.D7_db_access,category:"exfiltration",weight:30,label:"Sensitive table access",description:"New access to a table whose name looks sensitive (credentials, payment, token…).",list:{key:"sensitive_tables",label:"Sensitive keywords",hint:"Comma- or newline-separated substrings. A newly-accessed table whose name contains any of these is flagged.",default:["credential","password","passwd","secret","token","apikey","api_key","payment","card","ssn","account","auth","session","admins","users"]}},{source:"d7_injection_shape",parentClass:Qi.D7_db_access,category:"injection",weight:35,label:"Multi-table / join shape",description:"A new query joining several tables — a classic injection / data-harvesting shape."},{source:"d7_schema_recon",parentClass:Qi.D7_db_access,category:"injection",weight:30,label:"Database schema recon",description:"New access to a DB system-catalog / metadata table (e.g. information_schema) — classic SQL-injection enumeration.",list:{key:"schema_catalog_tables",label:"Schema-catalog tables",hint:"Comma- or newline-separated names/substrings. A newly-accessed table matching any is flagged as schema reconnaissance.",default:["information_schema","pg_catalog","pg_class","pg_tables","pg_attribute","pg_shadow","pg_user","mysql.user","mysql.db","sqlite_master","sys.tables","sys.columns","sys.databases","all_tables","dba_tables","user_tables"]}},{source:"d8_response_exfil",parentClass:Qi.D8_payload_size,category:"exfiltration",weight:40,label:"Oversized response (bulk data)",description:"Response body far larger than the learned baseline — possible bulk data extraction."}],categories:[{id:"impact",label:"Impact",base:45,mitre:"TA0040",owasp:null},{id:"injection",label:"Injection",base:40,mitre:"T1190",owasp:"A03"},{id:"exfiltration",label:"Exfiltration",base:35,mitre:"TA0010",owasp:null},{id:"access_anomaly",label:"Access anomaly",base:35,mitre:"TA0004",owasp:"A01"},{id:"supply_chain",label:"Supply chain",base:30,mitre:"T1195",owasp:"A06"},{id:"lateral_movement",label:"Lateral movement",base:25,mitre:"TA0008",owasp:null},{id:"recon",label:"Recon",base:15,mitre:"TA0043",owasp:null},{id:"resource_abuse",label:"Resource abuse",base:10,mitre:"T1499",owasp:null}],guardrailRules:[{key:"allowed_callers",label:"Allowed callers",description:"Restrict which services may call this service",category:"lateral_movement",weight:25,hint:"namespace/service"}],severityBands:[{severity:en.Info,minScore:0},{severity:en.Low,minScore:20},{severity:en.Medium,minScore:35},{severity:en.High,minScore:50},{severity:en.Critical,minScore:75}],correlationBonus:15,tags:JSON.stringify({T1190:"Exploit Public-Facing Application",T1195:"Supply Chain Compromise",T1499:"Endpoint Denial of Service",TA0004:"Privilege Escalation (tactic)",TA0008:"Lateral Movement (tactic)",TA0010:"Exfiltration (tactic)",TA0040:"Impact (tactic)",TA0043:"Reconnaissance (tactic)",A01:"Broken Access Control",A03:"Injection",A06:"Vulnerable and Outdated Components"})},Vv=f($)`
|
|
559
|
+
`,Uv=(e,t)=>{switch(e){case en.Info:return{backgroundColor:t.v2.colors.blue[900],textColor:t.v2.colors.white[500]};case en.Low:return{backgroundColor:t.v2.colors.green[900],textColor:t.v2.colors.white[500]};case en.Medium:return{backgroundColor:t.v2.colors.yellow[550],textColor:t.v2.colors.black[500]};case en.High:return{backgroundColor:t.v2.colors.orange[500],textColor:t.v2.colors.white[500]};case en.Critical:return{backgroundColor:t.v2.colors.red[800],textColor:t.v2.colors.white[500]}}},Gv=({isOpen:i,onClose:n,catalog:a})=>{const o=v(),l=(e=>{const t=e.severityBands?.length?e.severityBands:void 0,i=[];for(const n of pv(e)){i.push(Tv(n,t));for(const a of dv(e,n.id))i.push(Iv(a,n.weight,t))}return i})(a),r=(e=>{const t=e.severityBands?.length?e.severityBands:void 0,i=[...e.enrichers].sort((e,t)=>t.weight-e.weight)[0],n=i?e.deviationClasses.find(e=>e.id===i.parentClass):void 0;if(!n||!i)return null;const a=Math.min(100,n.weight+i.weight),o=lv(a,t);return{baseLabel:n.label,baseScore:n.weight,modifierLabel:i.label,modifierWeight:i.weight,finalScore:a,finalBand:o,finalBandLabel:ov[o]}})(a),s=(e=>[...e.severityBands?.length?e.severityBands:[]].filter(e=>e.severity!==en.Info).sort((e,t)=>e.minScore-t.minScore).map(e=>({severity:e.severity,label:ov[e.severity],minScore:e.minScore})))(a),c=a.correlationBonus??15,d=r?Uv(r.finalBand,o):null;return t(ln,{isOpen:i,width:"960px",minWidth:"720px",header:{icon:Vu,title:"Risk model",onClose:n},children:e($v,{"data-id":"insights-risk-model-drawer",children:[e($,{$gap:6,children:[t(Nv,{size:C.XXXS,color:k.Secondary,children:"The default risk model every anomaly policy builds on. Each signal adds its weight (points) to a 0–100 risk score; dangerous sub-cases add on top of a class’s base novelty. Read-only reference — tune the weights per scope in this Detection policy."}),s.length?e(Av,{children:[t(w,{size:C.XXXS,color:k.Secondary,children:"A signal alone lands at"}),s.map(e=>{const i=Uv(e.severity,o);return t(E,{label:`${e.label.toLowerCase()} ${e.minScore}`,backgroundColor:i.backgroundColor,textColor:i.textColor},e.label)})]}):null]}),e(Ov,{children:[t(w,{size:C.XXS,children:"How scoring works"}),t(Ev,{children:"Base signal + modifiers + cross-category bonus = final risk score"}),e(Dv,{children:[t(w,{size:C.XXXS,color:k.Secondary,children:"Modifiers are not independent signals. They are added only when their parent base signal occurs."}),t(w,{size:C.XXXS,color:k.Secondary,children:(p=c,`Signals spanning two or more kill-chain categories receive a +${p} correlation bonus. The final risk score is capped at 100.`)})]}),r&&d?e(zv,{children:[t(w,{size:C.XXXS,children:`${r.baseLabel} ${r.baseScore}`}),t(w,{size:C.XXXS,color:k.Secondary,children:"+"}),t(w,{size:C.XXXS,children:`${r.modifierLabel} ${r.modifierWeight}`}),t(w,{size:C.XXXS,color:k.Secondary,children:"="}),t(E,{label:`${r.finalScore} · ${r.finalBandLabel}`,backgroundColor:d.backgroundColor,textColor:d.textColor})]}):null]}),t(Rv,{children:e(Pv,{children:[t("thead",{children:e("tr",{children:[t(Xv,{style:{width:"17%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"Signal"})}),t(Xv,{style:{width:"15%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"Class / source"})}),t(Xv,{style:{width:"13%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"Weight"})}),t(Xv,{style:{width:"9%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"Band"})}),t(Xv,{style:{width:"13%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"Category"})}),t(Xv,{style:{width:"33%"},children:t(w,{size:C.XXXS,color:k.Secondary,children:"What it means"})})]})}),t("tbody",{children:l.map(i=>{const n=Uv(i.band,o);return e(Lv,{"data-id":`risk-model-row-${i.id}`,$sub:i.isSubCase,children:[t(Mv,{$sub:i.isSubCase,children:t(w,{size:C.XXXS,children:i.isSubCase?i.signal:t("strong",{children:i.signal})})}),t(_v,{children:t(Fv,{children:i.source})}),t(_v,{children:t(Bv,{size:C.XXXS,children:i.weightLabel})}),t(_v,{children:t(E,{label:i.bandLabel.toLowerCase(),backgroundColor:n.backgroundColor,textColor:n.textColor})}),t(_v,{children:t(w,{size:C.XXXS,color:k.Secondary,children:i.isSubCase?"Modifier":i.category})}),t(_v,{children:t(w,{size:C.XXXS,color:k.Secondary,children:i.description})})]},i.id)})})]})}),e(Vv,{children:[t(w,{size:C.XXS,children:"Cross-class correlation"}),t(w,{size:C.XXXS,color:k.Secondary,children:kv(c)})]})]})});var p},jv={deviationClasses:[{id:Qi.D1_call_edges,label:"New call edge",description:"A service→service call path not seen during learning.",baselineLabel:"Service call edges",baselineDescription:"Learned set of service→service call paths for this transaction.",category:"lateral_movement",categoryLabel:"Lateral movement",weight:20,mitre:"TA0008",owasp:null},{id:Qi.D2_egress,label:"New egress destination",description:"An outbound destination (host/port) not seen during learning.",baselineLabel:"Outbound peers",baselineDescription:"Learned set of external destinations (host:port) this transaction reaches.",category:"exfiltration",categoryLabel:"Exfiltration",weight:35,mitre:"TA0010",owasp:null},{id:Qi.D3_latency,label:"Latency above baseline",description:"Request latency well above the learned p99.",baselineLabel:"Request latency",baselineDescription:"Learned latency distribution for this transaction's entry request (e.g. p99).",category:"resource_abuse",categoryLabel:"Resource abuse",weight:10,mitre:"T1499",owasp:null},{id:Qi.D4_args_returns,label:"Argument / return anomaly",description:"Arguments or return values outside the learned shape.",baselineLabel:"Args & returns",baselineDescription:"Learned shape of captured arguments and return values.",category:"injection",categoryLabel:"Injection",weight:40,mitre:"T1190",owasp:"A03"},{id:Qi.D5_libraries,label:"New instrumentation library",description:"An instrumentation library/runtime not seen during learning.",baselineLabel:"Libraries",baselineDescription:"Learned set of instrumentation libraries and runtimes seen on this transaction.",category:"supply_chain",categoryLabel:"Supply chain",weight:30,mitre:"T1195",owasp:"A06"},{id:Qi.D6_attr_relations,label:"Attribute-relation anomaly",description:"Span attribute relationships outside the learned pattern.",baselineLabel:"Attribute relations",baselineDescription:"Learned relationships between span attributes for this transaction.",category:"access_anomaly",categoryLabel:"Access anomaly",weight:35,mitre:"TA0004",owasp:"A01"},{id:Qi.D7_db_access,label:"New database access",description:"A database table/operation not accessed during learning.",baselineLabel:"Database access",baselineDescription:"Learned set of database systems, tables, and operations touched.",category:"lateral_movement",categoryLabel:"Lateral movement",weight:25,mitre:"TA0008",owasp:null},{id:Qi.D8_payload_size,label:"Payload size above baseline",description:"Request/response payload larger than the learned baseline.",baselineLabel:"Payload size",baselineDescription:"Learned request/response body-size distribution for this transaction.",category:"resource_abuse",categoryLabel:"Resource abuse",weight:20,mitre:"T1499",owasp:null}],enrichers:[{source:"d1_edge_fanout",parentClass:Qi.D1_call_edges,category:"lateral_movement",weight:30,label:"Call fan-out",description:"One request reached many new services at once — possible lateral movement / enumeration."},{source:"d2_metadata_endpoint",parentClass:Qi.D2_egress,category:"exfiltration",weight:50,label:"Cloud metadata endpoint",description:"New egress to a cloud metadata address (e.g. 169.254.169.254) — a hallmark of SSRF / credential theft.",list:{key:"metadata_endpoints",label:"Cloud metadata addresses",hint:"Comma- or newline-separated hosts/IPs. A new egress to any of these is flagged.",default:["169.254.169.254","fd00:ec2::254","metadata.google.internal","100.100.100.200"]}},{source:"d2_dangerous_port",parentClass:Qi.D2_egress,category:"exfiltration",weight:45,label:"Suspicious egress port",description:"New egress on a port commonly used by reverse shells, C2, or tunneling (e.g. 4444, 1337).",list:{key:"dangerous_ports",label:"Suspicious ports",hint:"Comma- or newline-separated port numbers. New egress to any of these is flagged.",default:["23","1080","1337","2323","4444","6667","6697","9050","12345","31337"]}},{source:"d7_destructive_op",parentClass:Qi.D7_db_access,category:"impact",weight:45,label:"Destructive operation",description:"New DELETE/DROP/TRUNCATE/ALTER/UPDATE not seen during learning."},{source:"d7_sensitive_table",parentClass:Qi.D7_db_access,category:"exfiltration",weight:30,label:"Sensitive table access",description:"New access to a table whose name looks sensitive (credentials, payment, token…).",list:{key:"sensitive_tables",label:"Sensitive keywords",hint:"Comma- or newline-separated substrings. A newly-accessed table whose name contains any of these is flagged.",default:["credential","password","passwd","secret","token","apikey","api_key","payment","card","ssn","account","auth","session","admins","users"]}},{source:"d7_injection_shape",parentClass:Qi.D7_db_access,category:"injection",weight:35,label:"Multi-table / join shape",description:"A new query joining several tables — a classic injection / data-harvesting shape."},{source:"d7_schema_recon",parentClass:Qi.D7_db_access,category:"injection",weight:30,label:"Database schema recon",description:"New access to a DB system-catalog / metadata table (e.g. information_schema) — classic SQL-injection enumeration.",list:{key:"schema_catalog_tables",label:"Schema-catalog tables",hint:"Comma- or newline-separated names/substrings. A newly-accessed table matching any is flagged as schema reconnaissance.",default:["information_schema","pg_catalog","pg_class","pg_tables","pg_attribute","pg_shadow","pg_user","mysql.user","mysql.db","sqlite_master","sys.tables","sys.columns","sys.databases","all_tables","dba_tables","user_tables"]}},{source:"d8_response_exfil",parentClass:Qi.D8_payload_size,category:"exfiltration",weight:40,label:"Oversized response (bulk data)",description:"Response body far larger than the learned baseline — possible bulk data extraction."}],categories:[{id:"impact",label:"Impact",base:45,mitre:"TA0040",owasp:null},{id:"injection",label:"Injection",base:40,mitre:"T1190",owasp:"A03"},{id:"exfiltration",label:"Exfiltration",base:35,mitre:"TA0010",owasp:null},{id:"access_anomaly",label:"Access anomaly",base:35,mitre:"TA0004",owasp:"A01"},{id:"supply_chain",label:"Supply chain",base:30,mitre:"T1195",owasp:"A06"},{id:"lateral_movement",label:"Lateral movement",base:25,mitre:"TA0008",owasp:null},{id:"recon",label:"Recon",base:15,mitre:"TA0043",owasp:null},{id:"resource_abuse",label:"Resource abuse",base:10,mitre:"T1499",owasp:null}],guardrailRules:[{key:"allowed_callers",label:"Allowed callers",description:"Restrict which services may call this service",category:"lateral_movement",weight:25,hint:"namespace/service"}],severityBands:[{severity:en.Info,minScore:0},{severity:en.Low,minScore:20},{severity:en.Medium,minScore:35},{severity:en.High,minScore:50},{severity:en.Critical,minScore:75}],correlationBonus:15,tags:JSON.stringify({T1190:"Exploit Public-Facing Application",T1195:"Supply Chain Compromise",T1499:"Endpoint Denial of Service",TA0004:"Privilege Escalation (tactic)",TA0008:"Lateral Movement (tactic)",TA0010:"Exfiltration (tactic)",TA0040:"Impact (tactic)",TA0043:"Reconnaissance (tactic)",A01:"Broken Access Control",A03:"Injection",A06:"Vulnerable and Outdated Components"})},Hv=f($)`
|
|
560
560
|
flex: 1;
|
|
561
561
|
min-width: 0;
|
|
562
562
|
height: 100%;
|
|
@@ -565,34 +565,34 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
565
565
|
overflow: hidden;
|
|
566
566
|
border-radius: 16px 0 16px 0;
|
|
567
567
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
568
|
-
`,
|
|
568
|
+
`,Wv=f($)`
|
|
569
569
|
flex: 1;
|
|
570
570
|
min-height: 0;
|
|
571
571
|
width: 100%;
|
|
572
572
|
gap: 12px;
|
|
573
573
|
overflow-y: auto;
|
|
574
|
-
`,
|
|
574
|
+
`,Kv=f($)`
|
|
575
575
|
width: 100%;
|
|
576
576
|
gap: 4px;
|
|
577
577
|
padding: 12px;
|
|
578
|
-
`,
|
|
578
|
+
`,Yv=f(T)`
|
|
579
579
|
width: 100%;
|
|
580
580
|
align-items: center;
|
|
581
581
|
gap: 4px;
|
|
582
|
-
`,
|
|
582
|
+
`,Jv=f(T)`
|
|
583
583
|
flex: 1;
|
|
584
584
|
justify-content: flex-end;
|
|
585
|
-
`,
|
|
585
|
+
`,qv=f(T)`
|
|
586
586
|
width: 100%;
|
|
587
587
|
align-items: center;
|
|
588
588
|
gap: 16px;
|
|
589
589
|
padding: 8px 16px;
|
|
590
590
|
flex-wrap: wrap;
|
|
591
|
-
`,
|
|
591
|
+
`,Zv=f(T)`
|
|
592
592
|
align-items: center;
|
|
593
593
|
gap: 8px;
|
|
594
594
|
flex-shrink: 0;
|
|
595
|
-
`,
|
|
595
|
+
`,Qv=f.button`
|
|
596
596
|
display: flex;
|
|
597
597
|
align-items: center;
|
|
598
598
|
gap: 8px;
|
|
@@ -606,10 +606,10 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
606
606
|
&:hover {
|
|
607
607
|
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
608
608
|
}
|
|
609
|
-
`,
|
|
609
|
+
`,ey=f($)`
|
|
610
610
|
width: 100%;
|
|
611
611
|
gap: 8px;
|
|
612
|
-
`,
|
|
612
|
+
`,ty=f.button`
|
|
613
613
|
display: flex;
|
|
614
614
|
align-items: center;
|
|
615
615
|
gap: 4px;
|
|
@@ -621,11 +621,11 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
621
621
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
622
622
|
cursor: pointer;
|
|
623
623
|
text-align: left;
|
|
624
|
-
`,
|
|
624
|
+
`,iy=f.span`
|
|
625
625
|
display: inline-flex;
|
|
626
626
|
transform: rotate(${({$open:e})=>e?90:0}deg);
|
|
627
627
|
transition: transform 0.15s ease;
|
|
628
|
-
`,
|
|
628
|
+
`,ny=f($)`
|
|
629
629
|
flex: 1;
|
|
630
630
|
min-width: 0;
|
|
631
631
|
height: 100%;
|
|
@@ -634,43 +634,43 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
634
634
|
overflow: hidden;
|
|
635
635
|
border-radius: 16px 0 16px 0;
|
|
636
636
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
637
|
-
`,
|
|
637
|
+
`,ay=f($)`
|
|
638
638
|
width: 100%;
|
|
639
639
|
gap: 4px;
|
|
640
|
-
`,
|
|
640
|
+
`,oy=f(w)`
|
|
641
641
|
white-space: pre-line;
|
|
642
|
-
`,
|
|
642
|
+
`,ly=f($)`
|
|
643
643
|
width: 100%;
|
|
644
644
|
gap: 32px;
|
|
645
645
|
padding: 12px;
|
|
646
646
|
border-radius: 16px;
|
|
647
647
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
648
|
-
`,
|
|
648
|
+
`,ry=f(T)`
|
|
649
649
|
width: 100%;
|
|
650
650
|
align-items: flex-end;
|
|
651
651
|
justify-content: center;
|
|
652
652
|
gap: 16px;
|
|
653
653
|
padding: 0 12px;
|
|
654
654
|
flex-wrap: wrap;
|
|
655
|
-
`,
|
|
655
|
+
`,sy=f($)`
|
|
656
656
|
gap: 4px;
|
|
657
|
-
`,
|
|
657
|
+
`,cy=f(sy)`
|
|
658
658
|
width: 319px;
|
|
659
659
|
max-width: 100%;
|
|
660
|
-
`,
|
|
660
|
+
`,dy=()=>{const i=v(),{insightsApi:n}=Jh(),r=n.useCatalog(),s=r.data?.deviationClasses?.length?r.data:jv,{policy:c,genericForm:d,canUpdate:p,canDiscard:u,isSaving:h,isDeleting:g,handleSave:m,handleDiscard:b,handleDelete:f,handleRiskLevelChange:y,handleSignalWeightsChange:S}=bg(),x=d.formData,[T,I]=l(!1),[$,N]=l(!1),[A,O]=l(!1);o(()=>{I(!1)},[c]);const D=a(()=>fg.find(e=>e.id===x.riskLevel),[x.riskLevel]),z=((e,t)=>{switch(e){case xg.Low:return{backgroundColor:t.v2.colors.green[900],textColor:t.v2.colors.white[500]};case xg.Medium:return{backgroundColor:t.v2.colors.yellow[1e3],textColor:t.v2.colors.yellow[500]};case xg.High:return{backgroundColor:t.v2.colors.orange[500],textColor:t.v2.colors.white[500]};case xg.Critical:return{backgroundColor:t.v2.colors.red[800],textColor:t.v2.colors.white[500]}}})(x.riskLevel,i),R=!vg(x);return e(Hv,{"data-id":`detection-policy-editor-${c.id}`,children:[e(Wv,{children:[e(Kv,{children:[e(Yv,{children:[t(w,{size:C.XS,nowrap:!0,children:x.name}),vg(x)&&t(E,{label:Dt,status:ie.Warning,invertColors:!0}),t(Jv,{children:t(H,{"data-id":"detection-view-risk-model",label:"View risk model",leftIcon:$u,variant:K.Text,size:W.S,onClick:()=>N(!0)})})]}),t(w,{size:C.XXXS,color:k.Secondary,children:rn(x.fireAtScore,x.signalWeightOverrideCount)}),e(qv,{children:[e(Zv,{children:[t(w,{size:C.XS,children:sn}),t(Y,{value:x.name,onChange:e=>d.handleFormChange("name",e.target.value),width:"205px",small:!0})]}),e(Zv,{children:[t(w,{size:C.XS,children:cn}),t(Xt,{items:[...fg],selectedIds:[x.riskLevel],setSelectedIds:y,alignX:Lt.Left,children:({ChevronIcon:i,handleClick:n})=>e(Qv,{type:"button",onClick:n,"data-id":"detection-policy-risk-level",children:[t(E,{label:D?.label||x.riskLevel,backgroundColor:z.backgroundColor,textColor:z.textColor}),t(i,{size:18})]})})]})]})]}),e(ey,{children:[e(ty,{type:"button",onClick:e=>{e.preventDefault(),I(e=>!e)},"data-id":"detection-policy-advanced-toggle",children:[t(iy,{$open:T,children:t(wu,{size:18})}),t(w,{size:C.XXS,children:dn})]}),T?t(Cv,{catalog:s,signalWeights:x.signalWeights,enricherLists:x.enricherLists,onChange:S},c.id):null]})]}),t(vt,{isOpen:!0,position:kt.BottomRight,actions:[...R?[{id:"delete-detection-policy",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,label:Gt,leftIcon:ku,onClick:()=>O(!0),disabled:g||h}}]:[],{id:"discard-detection-policy",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,label:xt,leftIcon:Mu,onClick:b,disabled:!u}},{id:"save-detection-policy",type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:wt,leftIcon:Fu,onClick:m,disabled:!p}}]}),R&&t(Ce,{isOpen:A,onClose:()=>O(!1),title:"Delete Override",description:"Are you sure you want to delete this detection policy override?",approveButton:{label:"Delete",onClick:async()=>{O(!1),await f()}},denyButton:{label:"Cancel",onClick:()=>O(!1),variant:K.Secondary}}),t(Gv,{isOpen:$,onClose:()=>N(!1),catalog:s})]})},py=()=>{const i=v(),{genericForm:n,options:a,canCreate:o,handleSubmit:l}=yg(),{scopeType:r,selectedKey:s}=n.formData,c=r===Sg.Service?Qt:ei,d=r===Sg.Service?ti:ii;return e(ny,{"data-id":"detection-create-override-panel",children:[e(ay,{children:[t(w,{size:C.S,children:Ht}),t(oy,{size:C.XXS,color:k.Secondary,children:pn})]}),t(ly,{children:e(ry,{children:[e(sy,{children:[t(w,{size:C.XS,color:k.Secondary,children:Jt}),t(F,{"data-id":"detection-override-type",size:Zt.L,selected:r,setSelected:e=>{return t=e,n.handleFormChange("scopeType",t);var t},options:[{value:Sg.Service,label:Ot,selectedBgColor:i.v2.colors.purple[500],selectedBorderColor:i.v2.colors.purple[500]},{value:Sg.Transaction,label:Et,selectedBgColor:i.v2.colors.purple[500],selectedBorderColor:i.v2.colors.purple[500]}]})]}),t(cy,{children:t(Me,{"data-id":"detection-override-target",label:c,options:a,values:s?[s]:[],setValues:e=>{return t=e[0]||"",n.handleFormChange("selectedKey",t);var t},placeholder:d,withSearch:!0,disabled:!a.length})})]})}),t(vt,{isOpen:!0,position:kt.BottomRight,actions:[{id:"create-detection-override-policy",type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:un,leftIcon:Fu,onClick:l,disabled:!o}}]})]})},uy=e=>{if(e.policy){const{policy:i,onSave:n,onDelete:a}=e;return t(gg,{policy:i,onSave:n,onDelete:a,children:t(dy,{})})}const{services:i,transactions:n,existingScopeKeys:a,onSubmit:o}=e;return t(mg,{services:i,transactions:n,existingScopeKeys:a,onSubmit:o,children:t(py,{})})},hy=({onClose:i,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:r})=>{const{actionsApi:s}=Jh(),{platformType:c,version:u}=Vp(),[h,g]=l(""),[m,b]=l(null),f=p(null),{selectedOption:v,onSelectOption:y,genericForm:S,validateFormData:x}=Yh(),{options:I,loading:$}=s.useActionTypes(),E=a(()=>I.length?I:hn(c,u),[I,c,u]),D=a(()=>(h?E.filter(e=>e?.label?.toLowerCase().includes(h.toLowerCase())):E).filter(e=>!!e),[E,h]),z=d(e=>{f.current?.clearErrors(),y(e)},[y]),R=(({isLoading:e,options:i,selectedCategory:n,selectedType:o,onSelectOption:l})=>({width:"40%",list:a(()=>{if(e)return[t(N,{$padding:"8px 12px",children:t(A,{size:6})},"loading")];const a=i.reduce((e,t)=>{const i=t.category&&t.category in jm?t.category:Gm;return(e[i]||=[]).push(t),e},{});return Object.keys(jm).filter(e=>a[e]?.length&&(!n||n===e)).map(e=>t(Wm,{bucket:e,options:a[e],selectedType:o,onSelectOption:l},e))},[e,i,n,o,l])}))({isLoading:$,options:D,selectedCategory:m,selectedType:v?.type,onSelectOption:z}),P=a(()=>{const e=new Set(E.map(e=>e.category));return[{value:null,label:"All Actions"},...Object.values(gn).filter(t=>e.has(t)).map(e=>({value:e,label:O[e].TITLE}))]},[E]),X=a(()=>$?[t(N,{$padding:"8px 12px",children:t(A,{size:4})},"loading")]:v?[t(hb,{},v.type)]:[t(oi,{$height:"100%",children:t(Z,{icon:Cu,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[$,v]);return t(dm,{ref:f,isOpen:!0,withOverlay:r,onClose:i,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=x();if(e)return!1;await s.create(t)},disableSave:!v||!S?.isFormDirty,isFormDirty:S?.isFormDirty,hideDirtyNote:!0,progress:{title:ke.CREATING_ACTION,subTitle:ke.CREATING_ACTION_SUBTITLE},header:{icon:Cu,title:ke.ADD_ACTION,subTitle:ke.ADD_ACTION_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:h,onChange:g,placeholder:"Search by action name",width:"370px"},filters:e(T,{$gap:8,children:[t(w,{size:C.XXS,color:k.Secondary,nowrap:!0,children:"Show"}),t(F,{options:P,selected:m,setSelected:b})]}),leftColumn:R,rightColumn:{width:"60%",list:X}})},gy=({destinationsByCategory:n,filters:o,setFilters:l})=>{const r=a(()=>Object.values(mn).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(ae).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(i,{children:[t(Me,{placeholder:"Select category",options:r,values:o.categoryType?[o.categoryType]:[],setValues:e=>l({...o,categoryType:o.categoryType===e[0]?null:e[0]})}),t(F,{options:s,selected:o.signalType,setSelected:e=>l({...o,signalType:e})})]})},my=f.div`
|
|
661
661
|
display: flex;
|
|
662
662
|
flex-direction: column;
|
|
663
663
|
padding: 8px;
|
|
664
664
|
border-radius: 16px;
|
|
665
665
|
border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
|
|
666
666
|
background-color: ${({$noBgColor:e,$purpleColors:t,theme:i})=>e?"transparent":t?i.v2.colors.purple[900]:i.v2.colors.silver[800]};
|
|
667
|
-
`,
|
|
667
|
+
`,by=f.div`
|
|
668
668
|
display: flex;
|
|
669
669
|
align-items: center;
|
|
670
670
|
justify-content: space-between;
|
|
671
671
|
gap: 12px;
|
|
672
672
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
673
|
-
`,
|
|
673
|
+
`,fy=({title:i,tooltip:n,list:a,noBgColor:o,purpleColors:r})=>{const[s,c]=l(!0);return e(my,{"data-id":`collapse-${i}`,$noBgColor:o,$purpleColors:r,children:[e(by,{$isOpen:s,children:[e(T,{$gap:10,children:[t(w,{size:C.XS,children:i}),n&&t(ce,{text:n,withIcon:!0}),t(E,{label:a.length,status:r?ie.Default:void 0})]}),t(bn,{icon:s?Uu:Gu,size:fn.M,onClick:()=>c(e=>!e)})]}),s?t($,{children:a.length?u.toArray(a):t(oi,{$padding:"12px 0",children:t(Z,{})})}):null]})},vy=(e,t,i)=>t||i.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!i.signalType||le(e.supportedSignals).includes(i.signalType))):e,yy=({option:e,formData:i,testResult:n,isSelected:a,onSelect:o})=>t(Um,{icon:yn(e.type).icon,title:i?.name||e.displayName,withCarret:!0,purpleColors:!!i,isSelected:a,onClick:()=>o(),children:n&&t(E,{status:n.succeeded?ie.Success:ie.Error,leftIcon:n.succeeded?Fu:Mu})}),Sy=({listType:e,destinationOptions:i,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:o}=qh();return i?.length?t(fy,{title:vn[e].TITLE,tooltip:vn[e].DESCRIPTION,list:i.map((i,n)=>t(yy,{option:i,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=i.id&&""!==i.id?a?.option.id===i.id:a?.option.type===i.type),onSelect:()=>o({listType:e,option:i})},`${e}-${i.id??i.type}-${n}`))}):n?.length?t(fy,{purpleColors:!0,title:vn[e].TITLE,tooltip:vn[e].DESCRIPTION,list:n.map(({option:i,formData:n,testResult:l},r)=>t(yy,{option:i,formData:n,testResult:l,isSelected:a?.unsavedIdx===r&&a?.listType===e,onSelect:()=>o({listType:e,option:i,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var xy;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(xy||(xy={}));const wy=(e,t)=>{const i=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===xy.SELF_HOSTED?n.push(...e.items):e.name===xy.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=Sn(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=xn(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),i.push(e.items[a]))}}}),{[mn.DETECTED]:i,[mn.SELF_HOSTED]:n,[mn.MANAGED]:a}},Cy=({onClose:e,onBack:i,onNext:n,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Jh(),[g,m]=l(""),[b,f]=l({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:S}=h.useDestinationCategories(),{data:x,loading:w}=h.usePotentialDestinations(),{activeForm:C,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:I}=qh();o(()=>{c&&I(c)},[c]);const $=S||w,N=a(()=>y?.destinationCategories?.categories??[],[y]),[A,O]=l({[mn.ALL]:[],[mn.UNSAVED]:[],[mn.EXISTS]:[],[mn.DETECTED]:[],[mn.SELF_HOSTED]:[],[mn.MANAGED]:[]});o(()=>{const e=v.map(e=>{let t;for(const i of N){const n=i.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const i=xn(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:i[e.name]??e.initialValue})):[]}});O(t=>({...t,[mn.EXISTS]:e}))},[v,N]),o(()=>{(y||x)&&O(e=>({...e,...wy(y,x)}))},[y,x]);const E=d(async()=>{for(const{option:e,formData:t}of T){const i=re(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(i.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e])){await h.update(e.id,i);continue}}await h.create(i)}},[T,h]),D=(({isFetching:e,destinationsByCategory:i,searchText:n,filters:o})=>{const{unsavedDestinations:l}=qh();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(Sy,{listType:mn.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(mn)){if(o.categoryType&&o.categoryType!==e)continue;const l=vy(i[e],n,o);l.length&&a.push(t(Sy,{listType:e,destinationOptions:l},e))}return e&&a.push(t(oi,{$height:"100%",children:t(Ve,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,i,n,o,e])}})({isFetching:$,destinationsByCategory:A,searchText:g,filters:b}),z=(()=>{const{activeForm:e}=qh();return{width:"60%",list:e?[t(mb,{},e.option.type)]:[t(oi,{$height:"100%",children:t(Z,{icon:Lu,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(dm,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:i?()=>i(T):void 0,onNext:n?()=>n(T):void 0,nextIsSkip:!T.length,onSave:E,disableSave:!C&&!T.length,isFetching:$,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:ke.CREATING_DESTINATION,subTitle:ke.CREATING_DESTINATION_SUBTITLE},header:{icon:Lu,title:ke.ADD_DESTINATIONS,subTitle:ke.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:g,onChange:m},filters:t(gy,{destinationsByCategory:A,filters:b,setFilters:f}),leftColumn:D,rightColumn:z})},ky=({onClose:e,selectedConnectionIds:i,setSelectedConnectionIds:n,withOverlay:o})=>{const{isEnterprise:r}=Vp(),{instrumentationRulesApi:s}=Jh(),[c,d]=l(""),u=p(null),{selectedOption:h,onSelectOption:g,genericForm:m,validateFormData:b}=Zh(),{options:f,loading:v}=s.useRuleTypes(),y=a(()=>f.length?f:wn,[f]),S=a(()=>c?y.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):y,[y,c]),x=a(()=>v?[t(N,{$padding:"8px 12px",children:t(A,{size:4})},"loading")]:S.map(e=>{const i=h?.type===e.type;return t(Um,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:i,onClick:()=>{u.current?.clearErrors(),g(e)}},e.type)}),[v,h?.type,S,g]),w=a(()=>v?[t(N,{$padding:"8px 12px",children:t(A,{size:4})},"loading")]:h?[t(Cb,{},h.type)]:[t(oi,{$height:"100%",children:t(Z,{icon:ju,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(dm,{ref:u,isOpen:!0,withOverlay:o,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await s.create(t,h?.type)},disableSave:!h||!r||Cn(h.type)&&!m?.isFormDirty,isFormDirty:m?.isFormDirty,allowSaveWhenPristine:!!h&&!Cn(h.type),hideDirtyNote:!0,forcedNote:r?void 0:{fullWidth:!0,status:ie.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:ke.CREATING_INSTRUMENTATION_RULE,subTitle:ke.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:ju,title:ke.ADD_INSTRUMENTATION_RULE,subTitle:ke.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:i&&n?{value:i,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:w}})},Ty={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:ke.FETCHING_NAMESPACES,subTitle:ke.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:ke.SELECT_NAMESPACE,subTitle:ke.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Iy={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===kn.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"},$y=e=>e?Iy:Ty,Ny="No matches",Ay=e=>(e?"Unselect":"Select")+" all",Oy="Selected",Ey=f.div``,Dy=f.div`
|
|
674
674
|
visibility: hidden;
|
|
675
675
|
|
|
676
676
|
transition: visibility 0s;
|
|
@@ -678,17 +678,17 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
678
678
|
transition-duration: 0s;
|
|
679
679
|
}
|
|
680
680
|
|
|
681
|
-
${
|
|
681
|
+
${Ey}:hover & {
|
|
682
682
|
visibility: visible;
|
|
683
683
|
}
|
|
684
|
-
`,
|
|
684
|
+
`,zy=({workloadName:e,workloadKind:i,isChecked:n,onToggle:a,disabled:o})=>{const l=v(),r=()=>{};return t(Ey,{children:t(Um,{dataId:`source-${e}`,title:e,disabled:o,onClick:o?r:a,isChecked:n,onCheckboxChange:o?r:a,children:o?t(ce,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(E,{label:"Enterprise only",status:ie.Default,textSize:C.XXXS})}):t(Dy,{children:t(E,{label:i,status:ie.Info,textSize:C.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},Ry=f.div``,Py=f.div`
|
|
685
685
|
display: grid;
|
|
686
686
|
/* Auto: "Auto" label + S toggle ≈ 72px. Selected: label + count badge ≈ 110px. */
|
|
687
687
|
grid-template-columns: ${({$withAuto:e})=>e?"72px 110px":"110px"};
|
|
688
688
|
align-items: center;
|
|
689
689
|
column-gap: 12px;
|
|
690
690
|
flex-shrink: 0;
|
|
691
|
-
`,
|
|
691
|
+
`,Xy=f.div`
|
|
692
692
|
display: flex;
|
|
693
693
|
justify-content: flex-end;
|
|
694
694
|
align-items: center;
|
|
@@ -703,17 +703,17 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
703
703
|
transition: visibility 0s;
|
|
704
704
|
${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
|
|
705
705
|
|
|
706
|
-
${
|
|
706
|
+
${Ry}:hover & {
|
|
707
707
|
visibility: visible;
|
|
708
708
|
pointer-events: auto;
|
|
709
709
|
}
|
|
710
|
-
`,
|
|
710
|
+
`,Ly=f(T)`
|
|
711
711
|
width: 100%;
|
|
712
712
|
gap: 8px;
|
|
713
713
|
justify-content: flex-end;
|
|
714
714
|
align-items: center;
|
|
715
715
|
min-width: 0;
|
|
716
|
-
`,
|
|
716
|
+
`,_y=({clusterId:i,namespaceName:n,checkbox:a,isFutureApps:o,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Jh(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:i,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Ry,{children:t(Um,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(Py,{$withAuto:p,children:[p&&t(Xy,{$visible:r||o,children:t(ce,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(L,{label:"Auto",labelAlign:_.Left,size:Vi.S,value:o,onChange:e=>u({auto:e,all:e||void 0})})})}),e(Ly,{children:[t(w,{variant:Tn.Span,size:C.XXXS,color:k.Secondary,align:"right",nowrap:!0,children:Oy}),t(E,{label:`${l.sourced}/${l.total}`,status:r?ie.Default:ie.Unknown,minWidth:"42px"})]})]})})})},My=({withCollapse:e,clusterId:i,clusterName:n,namespaces:o,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>o.map(({name:e,totalWorkloads:a,selectedCount:o,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(_y,{clusterId:i,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:o,total:a},isActive:l.clusterId===i&&l.namespaceName===e,onActive:()=>r({clusterId:i,clusterName:n,namespaceName:e}),handleSourceChange:s},`${i}#${e}`)),[i,n,o,l]);return e?t(fy,{title:n,list:c,noBgColor:!0}):c},Fy=({onClose:i,onBack:n,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=Vp(),{sourcesApi:h,snapshotsApi:g,namespacesApi:m}=Jh(),{data:b,loading:f,pending:v,refetch:y}=g.useSnapshots(),{items:S,loading:x}=m.useNamespaces({skip:v||!!b}),I=$y(!u),{selectedStreamName:$}=Te(),{progress:N,resetProgress:A}=In(),{isFetching:O,setIsFetching:D,setSnapshots:z,formData:R,handleSourceChange:P,handleSelectAll:X,formDiff:_,isFormDirty:M}=Ig();o(()=>{y()},[]);const F=a(()=>{if(b)return b;const e=S;return e.length?{clusters:[{clusterId:Nn,clusterName:$n,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes($),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes($)??!1)}))||[]}))}]}:null},[b,S,$]);o(()=>{D(f||x),F&&z(F)},[F,f,x,D,z]);const[B,V]=l(""),[U,G]=l(kn.Namespace),[j,H]=l({showOnlySelected:!1}),[W,K]=l({clusterId:"",clusterName:"",namespaceName:""}),Y=(({isFetching:i,formData:n,handleSourceChange:o,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isK8s:u}=Vp(),h=$y(!u),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>kg(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Tg(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,p]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:i,selectedCount:n}of t)if(e=!0,n!==i)return!1;return e},[g]),{list:b,withFilterCount:f,filteredCount:v,totalCount:y}=a(()=>{const e=g.map(({clusterId:e,clusterName:i,visibleNamespaces:n})=>n.length?t(My,{withCollapse:g.length>1,clusterId:e,clusterName:i,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:o},e):null).filter(e=>null!==e),i=g.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=n.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:i!==a,filteredCount:i,totalCount:a}},[g,n,r]);return{width:"60%",header:e(T,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(T,{$gap:8,children:[t(w,{size:C.XS,nowrap:!0,children:h.groupColumnHeader}),t(ce,{text:f?ke.FILTERED_COUNT_TOOLTIP:void 0,children:t(E,{label:`${f?`${v} / ${y}`:y}`,status:ie.Unknown})})]}),t(w,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:p}),disabled:!b.length,size:C.XS,children:Ay(m)})]}),list:b.length?b:i?[t(oi,{$height:"100%",children:t(Ve,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(oi,{$height:"100%",children:t(Z,c?{icon:Wu,title:Ny,subTitle:h.noGroupMatchedFilter(c)}:{icon:Wu,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:O,formData:R,handleSourceChange:P,handleSelectAll:X,selectedArea:W,setSelectedArea:K,searchText:U===kn.Namespace?B:"",searchBy:U,filters:j}),J=(({formData:i,handleSourceChange:n,handleSelectAll:o,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=Vp(),u=$y(!d),h=a(()=>l.value.namespaceName?i.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[i,l.value.clusterId,l.value.namespaceName]),g=a(()=>h?[...h.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>wg(e,r,c)):[],[h,r,c]),m=a(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=a(()=>{if(!h)return[];const{clusterId:e}=l.value,{name:i}=h;return g.map(({name:a,selected:o,kind:l,region:r})=>{const s=d&&!p&&Cg.has(l);return t(zy,{workloadName:a,workloadKind:l,isChecked:!s&&(o||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:i,name:a,kind:l,region:r}}),disabled:s},`${e}#${i}#${a}#${l}#${r??""}`)})},[g,h,l.value.clusterId,n,d,p]),{withFilterCount:f,filteredCount:v,totalCount:y}=a(()=>{const e=h?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,h]);return{width:"40%",header:e(T,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(T,{$gap:8,children:[t(w,{size:C.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${u.itemColumnHeader}`:u.itemColumnHeader}),t(ce,{text:f?ke.FILTERED_COUNT_TOOLTIP:void 0,children:t(E,{label:`${f?`${v} / ${y}`:y}`,status:ie.Unknown})})]}),t(w,{"data-id":"workloads-select-all",onClick:()=>o({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!m,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:C.XS,children:Ay(m)})]}),list:b.length?b:[t(oi,{$height:"100%",children:t(Z,h?r?{icon:Hu,title:Ny,subTitle:(S=r,`No sources matched the filter '${S}'`)}:{icon:Hu,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:Hu,title:u.selectGroupPrompt.title,subTitle:u.selectGroupPrompt.subTitle})},"no-data")]};var S})({formData:R,handleSourceChange:P,handleSelectAll:X,selectedArea:{value:W},searchText:U===kn.Source?B:"",searchBy:U,filters:j});return t(dm,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:i?()=>{A(An.BulkInstrumenting),i()}:void 0,onBack:n?()=>n(_):void 0,onNext:r?()=>r(_):void 0,nextIsSkip:!M,onSave:()=>h.persistV2(_),header:{icon:Hu,title:ke.ADD_SOURCE,subTitle:ke.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:B,onChange:e=>{V(e),U===kn.Namespace&&K({clusterId:"",clusterName:"",namespaceName:""})},placeholder:I.searchPlaceholder(U),segment:{options:[{label:I.groupSegmentLabel,value:kn.Namespace},{label:I.itemSegmentLabel,value:kn.Source}],selected:U,setSelected:G}},filters:e(T,{$gap:8,children:[t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:"Show only:"}),t(L,{name:"filter-selected",size:Vi.S,label:Oy,value:j.showOnlySelected,onChange:e=>H(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:M,isFetching:O,progress:{title:ke.CREATING_SOURCES,subTitle:ke.CREATING_SOURCES_SUBTITLE,percentage:N[An.BulkInstrumenting]?.percentage||0},leftColumn:Y,rightColumn:J})},By={aws:Ju,gcp:Yu,azure:Ku},Vy={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Uy=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Gy=e=>e.provider.toUpperCase(),jy=f.div`
|
|
717
717
|
display: flex;
|
|
718
718
|
flex-direction: column;
|
|
719
719
|
gap: 8px;
|
|
@@ -721,7 +721,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
721
721
|
padding: 8px 12px;
|
|
722
722
|
border-radius: 16px 0 0 16px;
|
|
723
723
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
724
|
-
`,
|
|
724
|
+
`,Hy=f.button`
|
|
725
725
|
display: flex;
|
|
726
726
|
align-items: center;
|
|
727
727
|
gap: 12px;
|
|
@@ -737,7 +737,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
737
737
|
&:hover {
|
|
738
738
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
739
739
|
}
|
|
740
|
-
`,
|
|
740
|
+
`,Wy=f.div`
|
|
741
741
|
display: flex;
|
|
742
742
|
align-items: center;
|
|
743
743
|
justify-content: center;
|
|
@@ -746,13 +746,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
746
746
|
border-radius: 8px;
|
|
747
747
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
748
748
|
flex-shrink: 0;
|
|
749
|
-
`,
|
|
749
|
+
`,Ky=f.div`
|
|
750
750
|
display: flex;
|
|
751
751
|
flex-direction: column;
|
|
752
752
|
gap: 2px;
|
|
753
753
|
flex: 1;
|
|
754
754
|
min-width: 0;
|
|
755
|
-
`,
|
|
755
|
+
`,Yy=({providers:i,selectedProvider:n,onSelect:a})=>{const o=v();return i.length?t(jy,{children:i.map(i=>{const l=(e=>By[e.provider]??qu)(i),r=i.provider===n,s=(e=>{const t=e.features.find(e=>e.key===On.Discovery);if(!t)return"";const i=[],n=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,a=Vy[t]??Uy(t);n.has(a)||(n.add(a),i.push(a))}return i.join(", ")})(i);return e(Hy,{type:"button",$selected:r,onClick:()=>a(i.provider),"data-id":`cloud-connector-provider-${i.provider}`,children:[t(Wy,{children:t(l,{size:24})}),e(Ky,{children:[t(w,{size:C.S,weight:400,lineHeight:"24px",color:k.Primary,children:Gy(i)}),s&&t(w,{size:C.XXXS,weight:400,lineHeight:"normal",color:k.Secondary,children:s})]}),t(wu,{size:18,fill:o.v2.colors.silver[300]})]},i.provider)})}):t(w,{size:C.XS,color:k.Secondary,children:"No providers available."})},Jy=f.div`
|
|
756
756
|
display: flex;
|
|
757
757
|
flex-direction: column;
|
|
758
758
|
gap: 8px;
|
|
@@ -762,15 +762,15 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
762
762
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
763
763
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
764
764
|
cursor: default;
|
|
765
|
-
`,
|
|
765
|
+
`,qy=f.div`
|
|
766
766
|
display: flex;
|
|
767
767
|
align-items: center;
|
|
768
768
|
gap: 4px;
|
|
769
769
|
width: 100%;
|
|
770
|
-
`,
|
|
770
|
+
`,Zy=f.div`
|
|
771
771
|
flex: 1;
|
|
772
772
|
min-width: 0;
|
|
773
|
-
`,
|
|
773
|
+
`,Qy=f.div`
|
|
774
774
|
width: 100%;
|
|
775
775
|
max-height: 145px;
|
|
776
776
|
overflow: auto;
|
|
@@ -792,43 +792,43 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
792
792
|
transition: background-color 0.2s ease;
|
|
793
793
|
}
|
|
794
794
|
|
|
795
|
-
${
|
|
795
|
+
${Jy}:hover & {
|
|
796
796
|
scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
|
|
797
797
|
}
|
|
798
798
|
|
|
799
|
-
${
|
|
799
|
+
${Jy}:hover &::-webkit-scrollbar-thumb {
|
|
800
800
|
background-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
801
801
|
}
|
|
802
|
-
`,
|
|
802
|
+
`,eS=f.pre`
|
|
803
803
|
margin: 0;
|
|
804
804
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
805
805
|
font-size: 12px;
|
|
806
806
|
line-height: 20px;
|
|
807
807
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
808
808
|
white-space: pre;
|
|
809
|
-
`,
|
|
809
|
+
`,tS=({policy:i})=>{const n=v(),{CopyButton:a}=En();return e(Jy,{children:[e(qy,{children:[t(Zu,{size:16,fill:n.v2.colors.silver[200]}),t(Zy,{children:t(w,{size:C.XXS,color:k.Primary,children:ke.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(a,{value:i})]}),t(Qy,{children:t(eS,{children:i})})]})},iS="{{permissions}}",nS=/\{\{(\w+)\}\}/g,aS="create-role",oS=(e,t,i)=>(e?.setup?.artifacts??[]).find(e=>e.section===t&&(!i||e.id===i)),lS=(e,t)=>(e?.setup?.artifacts??[]).filter(e=>e.section===t),rS=(e,t)=>{const i=new Set,n=[];return lS(e,t).forEach(e=>{e.variant&&!i.has(e.variant)&&(i.add(e.variant),n.push({id:e.variant,label:e.variantLabel||e.variant}))}),n},sS=(e,t,i)=>lS(e,t).find(e=>e.variant===i),cS=(e,t={})=>{const i=((e,t,i)=>{const n=e.split("\n"),a=n.findIndex(e=>e.includes(iS));if(-1===a)return e;const o=n[a],l=o.slice(0,o.indexOf(iS)),r=t.itemTemplate||"{{permission}}",s=t.itemSeparator??"\n";return 0===i.length?n.splice(a,1):n[a]=i.map(e=>{return l+(t=e,r.split("{{permission}}").join(t));var t}).join(s),n.join("\n")})(e.template??"",e,t.permissions??[]);return((e,t)=>e.replace(nS,(e,i)=>Object.prototype.hasOwnProperty.call(t,i)?t[i]:e))(i,t.vars??{})};var dS;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(dS||(dS={}));const pS=[{id:dS.DiscoveryOnly,title:ke.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:ke.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[On.Discovery]},{id:dS.DiscoveryInstrumentation,title:ke.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:ke.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[On.Discovery,On.Instrumentation]},{id:dS.Custom,title:ke.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:ke.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],uS=(e,t)=>e.features?.find(e=>e.key===t),hS=e=>{if(!e)return[];const t=uS(e,On.Discovery),i=uS(e,On.Instrumentation);return t?t.types.map(e=>{const t=i?.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}}):[]},gS=()=>{const e=new Set,t=[];return{out:t,add:i=>i?.forEach(i=>{i&&!e.has(i)&&(e.add(i),t.push(i))})}},mS=(e,t)=>{if(!e)return[];const i=pS.find(e=>e.id===t)?.featureKeys??[],{out:n,add:a}=gS();return a(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&i.includes(e.key)&&(a(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&a(e.permissions)}))}),n},bS=(e,t)=>{if(!e)return[];const i=hS(e),n=uS(e,On.Discovery),a=i.some(e=>t[e.typeName]?.discovery),{out:o,add:l}=gS();return l(e.auth?.permissions),a&&l(n?.permissions),i.forEach(e=>{const i=t[e.typeName];i?.discovery&&l(e.discoveryPermissions),i?.instrumentation&&l(e.instrumentationPermissions)}),o},fS=(e,t,i)=>{const n=t===dS.Custom?bS(e,i??{}):mS(e,t),a=oS(e,"permissions","policy-preview");return a?cS(a,{permissions:n}):""},vS=f.div`
|
|
810
810
|
width: 100%;
|
|
811
811
|
padding: 12px 16px;
|
|
812
812
|
border-radius: 12px;
|
|
813
813
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
814
814
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
815
|
-
`,
|
|
815
|
+
`,yS=f.div`
|
|
816
816
|
display: grid;
|
|
817
817
|
grid-template-columns: minmax(0, 1fr) 100px minmax(200px, 1.4fr);
|
|
818
818
|
align-items: center;
|
|
819
819
|
row-gap: 16px;
|
|
820
820
|
column-gap: 8px;
|
|
821
|
-
`,
|
|
821
|
+
`,SS=f.div`
|
|
822
822
|
display: flex;
|
|
823
823
|
align-items: center;
|
|
824
824
|
min-width: 0;
|
|
825
|
-
`,
|
|
825
|
+
`,xS=f(SS)`
|
|
826
826
|
justify-content: center;
|
|
827
|
-
`,
|
|
827
|
+
`,wS=f(SS)`
|
|
828
828
|
justify-content: flex-start;
|
|
829
|
-
`,
|
|
829
|
+
`,CS=f(SS)`
|
|
830
830
|
gap: 4px;
|
|
831
|
-
`,
|
|
831
|
+
`,kS={discovery:!1,instrumentation:!1},TS=({provider:i,capabilities:a,onCapabilitiesChange:o})=>{const l=v(),r=hS(i),s=(e,t)=>{o({...a,[e]:t})};return r.length?t(vS,{children:e(yS,{children:[t(SS,{children:t(w,{size:C.XXS,color:k.Secondary,children:ke.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(xS,{children:t(w,{size:C.XXS,color:k.Secondary,children:ke.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),e(CS,{children:[t(w,{size:C.XXS,color:k.Secondary,children:ke.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION}),t(ce,{text:ke.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION_TOOLTIP,withIcon:!0})]}),r.map(i=>{const o=a[i.typeName]??kS,r=void 0!==i.instrumentationPermissions,c=o.instrumentation||o.discovery;return e(n.Fragment,{children:[t(SS,{children:t(w,{size:C.XXS,weight:400,lineHeight:"normal",color:k.Primary,children:i.displayName})}),t(xS,{children:t(L,{name:`cloud-connector-custom-${i.typeName}-discovery`,size:Vi.S,value:c,disabled:o.instrumentation,onChange:e=>s(i.typeName,{discovery:e,instrumentation:o.instrumentation})})}),t(wS,{children:t(L,{name:`cloud-connector-custom-${i.typeName}-instrumentation`,size:Vi.S,value:o.instrumentation,disabled:!r,label:o.instrumentation?ke.CLOUD_CONNECTOR_INSTRUMENTATION_MANAGED_BY_ODIGOS:ke.CLOUD_CONNECTOR_INSTRUMENTATION_SELF_MANAGED,labelColor:o.instrumentation?l.v2.colors.purple[400]:l.v2.colors.silver[200],onChange:e=>s(i.typeName,{discovery:!!e||o.discovery,instrumentation:e})})})]},i.typeName)})]})}):null},IS=f.div`
|
|
832
832
|
display: flex;
|
|
833
833
|
flex-direction: column;
|
|
834
834
|
gap: 8px;
|
|
@@ -837,12 +837,12 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
837
837
|
padding: 8px;
|
|
838
838
|
border-radius: 0 16px 16px 0;
|
|
839
839
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
840
|
-
|
|
840
|
+
`,$S=f.div`
|
|
841
841
|
display: flex;
|
|
842
842
|
flex-direction: column;
|
|
843
843
|
gap: 8px;
|
|
844
844
|
width: 100%;
|
|
845
|
-
`,
|
|
845
|
+
`,NS=f.div`
|
|
846
846
|
display: flex;
|
|
847
847
|
align-items: center;
|
|
848
848
|
gap: 10px;
|
|
@@ -850,7 +850,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
850
850
|
padding: 4px 12px 4px 4px;
|
|
851
851
|
border-radius: 8px;
|
|
852
852
|
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
853
|
-
`,
|
|
853
|
+
`,AS=f.div`
|
|
854
854
|
display: flex;
|
|
855
855
|
align-items: center;
|
|
856
856
|
justify-content: center;
|
|
@@ -859,30 +859,30 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
859
859
|
border-radius: 6px;
|
|
860
860
|
flex-shrink: 0;
|
|
861
861
|
background-color: ${({theme:e})=>e.v2.colors.purple[800]};
|
|
862
|
-
`,
|
|
862
|
+
`,OS=({message:i})=>{const n=v();return e(NS,{children:[t(AS,{children:t(Qu,{fill:"#B08BFD",size:24})}),t(w,{size:C.XXS,color:n.v2.colors.purple[300],children:i})]})},ES=({provider:i,selectedPermission:n,onSelect:a,capabilities:o,onCapabilitiesChange:l})=>t(IS,{children:pS.map(r=>{const s=r.id===n,c=r.id===dS.Custom,d=s?e($S,{children:[c&&t(TS,{provider:i,capabilities:o,onCapabilitiesChange:l}),t(tS,{policy:fS(i,r.id,o)})]}):void 0,p=s?t(OS,{message:c?ke.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:ke.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Dn,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>a(r.id),body:d,footerNote:p},r.id)})}),DS=f.div`
|
|
863
863
|
display: flex;
|
|
864
864
|
flex-direction: column;
|
|
865
865
|
padding: 16px;
|
|
866
|
-
`,
|
|
866
|
+
`,zS=f.div`
|
|
867
867
|
display: flex;
|
|
868
868
|
flex-direction: column;
|
|
869
869
|
gap: 16px;
|
|
870
870
|
padding: 16px;
|
|
871
871
|
border-radius: 16px;
|
|
872
872
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
873
|
-
`,
|
|
873
|
+
`,RS=f.div`
|
|
874
874
|
display: flex;
|
|
875
875
|
flex-direction: column;
|
|
876
876
|
gap: 4px;
|
|
877
|
-
`,
|
|
877
|
+
`,PS=f.div`
|
|
878
878
|
display: flex;
|
|
879
879
|
align-items: stretch;
|
|
880
880
|
width: 100%;
|
|
881
|
-
`,
|
|
881
|
+
`,XS=f.div`
|
|
882
882
|
display: flex;
|
|
883
883
|
flex: 0 0 40%;
|
|
884
884
|
min-width: 0;
|
|
885
|
-
`,
|
|
885
|
+
`,LS=()=>{const{providers:i,genericForm:n}=$g(),[r,s]=l(!0),c=a(()=>i.find(e=>e.provider===n.formData.provider),[i,n.formData.provider]),p=d(e=>{e!==n.formData.provider&&n.handleFormChange(void 0,void 0,{...n.formData,provider:e,authMethod:"",setupMethod:"",accountId:"",credentials:{},customCapabilities:{}})},[n]);return o(()=>{!n.formData.provider&&i.length>0&&p(i[0].provider)},[i,n.formData.provider,p]),o(()=>{n.formData.permission||n.handleFormChange("permission",dS.DiscoveryInstrumentation)},[n.formData.permission,n]),t(DS,{children:e(zS,{children:[e(RS,{children:[t(w,{size:C.S,weight:500,lineHeight:"24px",color:k.Primary,children:ke.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(w,{size:C.XXS,weight:400,lineHeight:"normal",color:k.Secondary,children:ke.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),r&&t(te,{fullWidth:!0,maxWidth:"800px",smallIcon:!0,status:ie.Info,message:ke.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:zn.CLOSE,onClick:()=>s(!1)}}),e(PS,{children:[t(XS,{children:t(Yy,{providers:i,selectedProvider:n.formData.provider,onSelect:p})}),t(ES,{provider:c,selectedPermission:n.formData.permission,onSelect:e=>n.handleFormChange("permission",e),capabilities:n.formData.customCapabilities,onCapabilitiesChange:e=>n.handleFormChange("customCapabilities",e)})]})]})})},_S=f.div`
|
|
886
886
|
display: flex;
|
|
887
887
|
flex-direction: column;
|
|
888
888
|
gap: 16px;
|
|
@@ -890,12 +890,12 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
890
890
|
padding: 12px;
|
|
891
891
|
border-radius: 8px;
|
|
892
892
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
893
|
-
`,
|
|
893
|
+
`,MS=f.div`
|
|
894
894
|
display: flex;
|
|
895
895
|
align-items: center;
|
|
896
896
|
gap: 12px;
|
|
897
897
|
width: 100%;
|
|
898
|
-
`,
|
|
898
|
+
`,FS=f.div`
|
|
899
899
|
display: flex;
|
|
900
900
|
align-items: center;
|
|
901
901
|
justify-content: center;
|
|
@@ -904,41 +904,41 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
904
904
|
height: 24px;
|
|
905
905
|
border-radius: 16px;
|
|
906
906
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
907
|
-
`,
|
|
907
|
+
`,BS=f.div`
|
|
908
908
|
display: flex;
|
|
909
909
|
flex: 1;
|
|
910
910
|
flex-direction: column;
|
|
911
911
|
gap: 2px;
|
|
912
912
|
min-width: 0;
|
|
913
|
-
`,
|
|
913
|
+
`,VS=f.div`
|
|
914
914
|
display: flex;
|
|
915
915
|
flex-direction: column;
|
|
916
916
|
gap: 10px;
|
|
917
917
|
width: 100%;
|
|
918
918
|
padding-left: 32px;
|
|
919
|
-
`,
|
|
919
|
+
`,US=({"data-id":i,step:n,title:a,description:o,children:l})=>e(_S,{"data-id":i,children:[e(MS,{children:[t(FS,{children:t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Primary,children:n})}),e(BS,{children:[t(w,{size:C.S,weight:400,lineHeight:"24px",color:k.Primary,children:a}),t(w,{size:C.XXS,weight:400,lineHeight:"normal",color:k.Secondary,children:o})]})]}),l&&t(VS,{children:l})]}),GS=f.div`
|
|
920
920
|
display: flex;
|
|
921
921
|
align-items: stretch;
|
|
922
922
|
gap: 10px;
|
|
923
923
|
width: 100%;
|
|
924
|
-
`,
|
|
924
|
+
`,jS=f.div`
|
|
925
925
|
display: flex;
|
|
926
926
|
flex: 2 1 0;
|
|
927
927
|
flex-direction: column;
|
|
928
928
|
gap: 12px;
|
|
929
929
|
min-width: 0;
|
|
930
930
|
padding: 12px 0;
|
|
931
|
-
`,
|
|
931
|
+
`,HS=f.div`
|
|
932
932
|
display: flex;
|
|
933
933
|
flex-direction: column;
|
|
934
934
|
gap: 8px;
|
|
935
935
|
width: 100%;
|
|
936
|
-
`,
|
|
936
|
+
`,WS=f.div`
|
|
937
937
|
display: flex;
|
|
938
938
|
align-items: center;
|
|
939
939
|
gap: 12px;
|
|
940
940
|
width: 100%;
|
|
941
|
-
`,
|
|
941
|
+
`,KS=f.div`
|
|
942
942
|
display: flex;
|
|
943
943
|
align-items: center;
|
|
944
944
|
justify-content: center;
|
|
@@ -947,7 +947,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
947
947
|
height: 24px;
|
|
948
948
|
border-radius: 16px;
|
|
949
949
|
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
950
|
-
`,
|
|
950
|
+
`,YS=f.div`
|
|
951
951
|
display: flex;
|
|
952
952
|
flex: 3 1 0;
|
|
953
953
|
flex-direction: column;
|
|
@@ -956,42 +956,42 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
956
956
|
border-radius: 12px;
|
|
957
957
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
958
958
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
959
|
-
`,
|
|
959
|
+
`,JS=f.div`
|
|
960
960
|
display: flex;
|
|
961
961
|
align-items: center;
|
|
962
962
|
justify-content: flex-end;
|
|
963
963
|
width: 100%;
|
|
964
|
-
`,
|
|
964
|
+
`,qS=f.div`
|
|
965
965
|
flex: 1;
|
|
966
966
|
width: 100%;
|
|
967
967
|
min-height: 200px;
|
|
968
968
|
max-height: 260px;
|
|
969
969
|
overflow: auto;
|
|
970
970
|
padding: 0 12px 12px;
|
|
971
|
-
`,
|
|
971
|
+
`,ZS=f.pre`
|
|
972
972
|
margin: 0;
|
|
973
973
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
974
974
|
font-size: 12px;
|
|
975
975
|
line-height: 20px;
|
|
976
976
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
977
977
|
white-space: pre;
|
|
978
|
-
`,
|
|
978
|
+
`,QS=({step:i,artifact:n,code:a})=>{const o=v(),{CopyButton:l}=En(),r=n.steps??[];return t(US,{"data-id":"cloud-connector-create-role",step:i,title:n.title||ke.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:n.description,children:e(GS,{children:[r.length>0&&e(jS,{children:[t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Primary,children:ke.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(HS,{children:r.map((i,a)=>e(WS,{children:[t(KS,{children:t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:o.v2.colors.purple[200],children:a+1})}),t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Primary,children:i})]},`${n.id}-step-${a}`))})]}),a&&e(YS,{children:[t(JS,{children:t(l,{value:a})}),t(qS,{children:t(ZS,{children:a})})]})]})})},ex=e=>!1!==e.showInUi,tx=e=>[...e.fields,...e.advancedFields],ix=(e,t)=>{const i=e?.auth?.methods?.find(e=>e.id===t);if(!i)return[];const n=(e=>new Map((e?.auth?.methods??[]).map(e=>[e.id,e])))(e),a=new Set,o=[],l=e=>{const t=e?.fields?.filter(e=>e.name&&!a.has(e.name))??[];e&&t.length&&(t.forEach(e=>a.add(e.name)),o.push({method:e,fields:t.filter(ex),advancedFields:t.filter(e=>!ex(e))}))};return((e,t)=>!!e.baseMethods?.some(e=>{const i=t.get(e);return!!i&&!i.fields?.length}))(i,n)||i.baseMethods?.forEach(e=>l(n.get(e))),l(i),o},nx=f.div`
|
|
979
979
|
display: flex;
|
|
980
980
|
flex-direction: column;
|
|
981
981
|
padding: 16px;
|
|
982
|
-
`,
|
|
982
|
+
`,ax=f.div`
|
|
983
983
|
display: flex;
|
|
984
984
|
flex-direction: column;
|
|
985
985
|
gap: 12px;
|
|
986
986
|
padding: 16px 16px 12px;
|
|
987
987
|
border-radius: 16px;
|
|
988
988
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
989
|
-
`,
|
|
989
|
+
`,ox=f.div`
|
|
990
990
|
display: flex;
|
|
991
991
|
align-items: center;
|
|
992
992
|
gap: 8px;
|
|
993
993
|
width: 100%;
|
|
994
|
-
`,
|
|
994
|
+
`,lx=f.button`
|
|
995
995
|
display: flex;
|
|
996
996
|
align-items: center;
|
|
997
997
|
justify-content: center;
|
|
@@ -1008,42 +1008,42 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1008
1008
|
&:hover {
|
|
1009
1009
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1010
1010
|
}
|
|
1011
|
-
`,
|
|
1011
|
+
`,rx=f.div`
|
|
1012
1012
|
display: flex;
|
|
1013
1013
|
flex: 1;
|
|
1014
1014
|
flex-direction: column;
|
|
1015
1015
|
gap: 4px;
|
|
1016
1016
|
min-width: 0;
|
|
1017
|
-
`,
|
|
1017
|
+
`,sx=f.div`
|
|
1018
1018
|
display: flex;
|
|
1019
1019
|
align-items: center;
|
|
1020
1020
|
gap: 4px;
|
|
1021
1021
|
padding: 8px 0 8px 2px;
|
|
1022
|
-
`,
|
|
1022
|
+
`,cx=f.div`
|
|
1023
1023
|
display: flex;
|
|
1024
1024
|
flex-direction: column;
|
|
1025
1025
|
gap: 16px;
|
|
1026
1026
|
width: 100%;
|
|
1027
|
-
`,
|
|
1027
|
+
`,dx=f.div`
|
|
1028
1028
|
display: flex;
|
|
1029
1029
|
flex-wrap: wrap;
|
|
1030
1030
|
gap: 24px;
|
|
1031
1031
|
width: 100%;
|
|
1032
|
-
`,
|
|
1032
|
+
`,px=f.div`
|
|
1033
1033
|
display: flex;
|
|
1034
1034
|
flex: 1 1 calc(50% - 12px);
|
|
1035
1035
|
min-width: 0;
|
|
1036
|
-
`,
|
|
1036
|
+
`,ux=f.div`
|
|
1037
1037
|
display: flex;
|
|
1038
1038
|
flex-direction: column;
|
|
1039
1039
|
gap: 8px;
|
|
1040
1040
|
width: 100%;
|
|
1041
|
-
`,
|
|
1041
|
+
`,hx=f.div`
|
|
1042
1042
|
display: flex;
|
|
1043
1043
|
flex-wrap: wrap;
|
|
1044
1044
|
align-items: baseline;
|
|
1045
1045
|
gap: 6px;
|
|
1046
|
-
`,
|
|
1046
|
+
`,gx=f.button`
|
|
1047
1047
|
align-self: flex-start;
|
|
1048
1048
|
padding: 2px 0;
|
|
1049
1049
|
border: none;
|
|
@@ -1053,13 +1053,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1053
1053
|
font-size: 12px;
|
|
1054
1054
|
text-decoration: underline;
|
|
1055
1055
|
cursor: pointer;
|
|
1056
|
-
`,
|
|
1056
|
+
`,mx=({field:e,value:i,onChange:n})=>{const a=`cloud-connector-credential-${e.name}`,o=e.displayName||e.name,l={name:a,label:o,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:o,value:i};return"textarea"===e.componentType||"credentialsJson"===e.name?t(ee,{...l,minHeight:"120px",onChange:e=>n(e.target.value)}):t(Y,{...l,width:"100%",type:e.secret?Ft.Password:Ft.Text,onChange:e=>n(e.target.value)})},bx=({group:n,labelled:a,credentials:o,onChange:r})=>{const[s,c]=l(!1),d=e=>{const i="textarea"===e.componentType||"credentialsJson"===e.name;return t(px,{style:i?{flex:"1 1 100%"}:void 0,children:t(mx,{field:e,value:o[e.name]??"",onChange:t=>r(e.name,t)})},e.name)};return e(ux,{"data-id":`cloud-connector-credential-group-${n.method.id}`,children:[a&&t(hx,{children:t(w,{size:C.XXXS,weight:500,lineHeight:"normal",color:k.Primary,children:n.method.displayName||n.method.id})}),t(dx,{children:n.fields.map(d)}),n.advancedFields.length>0&&e(i,{children:[t(gx,{"data-id":`cloud-connector-credential-advanced-${n.method.id}`,type:"button",onClick:()=>c(e=>!e),children:s?ke.CLOUD_CONNECTOR_CREDENTIALS_HIDE_ADVANCED:ke.CLOUD_CONNECTOR_CREDENTIALS_SHOW_ADVANCED}),s&&t(dx,{children:n.advancedFields.map(d)})]})]})},fx=({onBack:i})=>{const n=v(),{providers:l,genericForm:r}=$g(),{provider:s,authMethod:c,setupMethod:d,accountId:p,credentials:u,permission:h,customCapabilities:g}=r.formData,m=a(()=>l.find(e=>e.provider===s),[l,s]),b=m?.connectorFields?.[0],f=a(()=>(e=>{const t=e?.auth?.defaultMethod?.trim();return t&&e?.auth?.methods?.some(e=>e.id===t)?t:e?.auth?.methods?.find(e=>e.fields?.some(e=>e.required))?.id??e?.auth?.methods?.[0]?.id??""})(m),[m]),y=a(()=>m?.auth?.methods?.find(e=>e.id===c),[m,c]),S=a(()=>ix(m,c),[m,c]),x=a(()=>rS(m,aS),[m]),T=x.length>0,I=a(()=>{if(T)return sS(m,aS,d)??(e=>{const t=rS(e,aS);return t[0]?sS(e,aS,t[0].id):void 0})(m)},[m,d,T]),$=a(()=>oS(m,"credentials"),[m]),N=a(()=>{const e=h;return e===dS.Custom?bS(m,g??{}):mS(m,e)},[m,h,g]),A=a(()=>I?cS(I,{permissions:N,vars:{accountId:p??"",externalId:u.externalId?.trim()||"odigos-connector",projectId:p??"",subscriptionId:p??"",...u}}):"",[I,N,p,u]);o(()=>{if(!m)return;const e=m.auth?.methods?.some(e=>e.id===c);e||r.handleFormChange("authMethod",f)},[m,c,f,r]),o(()=>{T&&(x.some(e=>e.id===d)||r.handleFormChange("setupMethod",x[0].id))},[T,x,d,r]);const O=(e,t)=>{r.handleFormChange("credentials",{...u,[e]:t})};let E=1;const D=b?E++:0,z=E++,R=T?E++:0,P=T?E++:0,X=E,L=m?.setup?.subtitle||(m?.displayName?`Configure the ${m.displayName} account and authentication details.`:"Configure the account and authentication details."),_=b?`Enter ${b.displayName||b.name}`:"Enter account details",M=b?.tooltip||"Enter the provider account identifier that contains the resources Odigos should discover.",B=$?.title||"Enter credentials",V=$?.description||y?.description||"Enter the credentials required by the selected authentication method.";return t(nx,{children:e(ax,{children:[e(ox,{children:[t(lx,{"data-id":"cloud-connector-setup-back",type:"button",onClick:i,"aria-label":ke.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(eh,{size:24})}),e(rx,{children:[t(w,{size:C.S,weight:500,lineHeight:"24px",color:k.Primary,children:ke.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(w,{size:C.XXS,weight:400,lineHeight:"normal",color:k.Secondary,children:L})]})]}),b&&t(US,{"data-id":"cloud-connector-account",step:D,title:_,description:M,children:t(Y,{name:`cloud-connector-account-${b.name}`,width:"100%",label:b.displayName||b.name,required:b.required,tooltip:b.tooltip||void 0,helpMessage:b.tooltip||void 0,placeholder:b.displayName||b.name,value:p,onChange:e=>r.handleFormChange("accountId",e.target.value)})}),e(US,{"data-id":"cloud-connector-auth-method",step:z,title:ke.CLOUD_CONNECTOR_AUTH_TITLE,description:"Choose how the connector authenticates with this provider.",children:[t(F,{"data-id":"cloud-connector-auth-method-segment",size:Zt.S,selected:c,setSelected:e=>{r.handleFormChange(void 0,void 0,{...r.formData,authMethod:e,credentials:{}})},options:(m?.auth?.methods??[]).map(e=>({value:e.id,label:e.displayName}))}),y?.description&&e(sx,{children:[t(Bu,{size:16,fill:n.v2.colors.silver[200]}),t(w,{size:C.XXXS,weight:400,lineHeight:"normal",color:k.Secondary,children:y.description})]})]}),T&&t(US,{"data-id":"cloud-connector-setup-method",step:R,title:ke.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:ke.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(F,{"data-id":"cloud-connector-setup-method-segment",size:Zt.S,selected:d,setSelected:e=>r.handleFormChange("setupMethod",e),options:x.map(e=>({value:e.id,label:e.label}))})}),T&&I&&t(QS,{step:P,artifact:I,code:A}),t(US,{"data-id":"cloud-connector-credentials",step:X,title:B,description:V,children:S.length>0?t(cx,{children:S.map(e=>t(bx,{group:e,labelled:S.length>1,credentials:u,onChange:O},e.method.id))}):t(w,{size:C.XXXS,weight:400,lineHeight:"normal",color:k.Secondary,children:"No stored credentials are required for this authentication method."})})]})})},vx=f.div`
|
|
1057
1057
|
display: flex;
|
|
1058
1058
|
flex-direction: column;
|
|
1059
1059
|
flex: 1;
|
|
1060
1060
|
min-height: 0;
|
|
1061
1061
|
padding: 16px;
|
|
1062
|
-
`,
|
|
1062
|
+
`,yx=f.div`
|
|
1063
1063
|
display: flex;
|
|
1064
1064
|
flex-direction: column;
|
|
1065
1065
|
flex: 1;
|
|
@@ -1067,13 +1067,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1067
1067
|
padding: 16px;
|
|
1068
1068
|
border-radius: 16px;
|
|
1069
1069
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1070
|
-
`,
|
|
1070
|
+
`,Sx=f.div`
|
|
1071
1071
|
display: flex;
|
|
1072
1072
|
flex: 1;
|
|
1073
1073
|
align-items: center;
|
|
1074
1074
|
justify-content: center;
|
|
1075
1075
|
width: 100%;
|
|
1076
|
-
`,
|
|
1076
|
+
`,xx=f.div`
|
|
1077
1077
|
display: flex;
|
|
1078
1078
|
flex-direction: column;
|
|
1079
1079
|
align-items: center;
|
|
@@ -1083,7 +1083,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1083
1083
|
padding: 24px 8px;
|
|
1084
1084
|
border-radius: 8px;
|
|
1085
1085
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1086
|
-
`,
|
|
1086
|
+
`,wx=f.div`
|
|
1087
1087
|
display: flex;
|
|
1088
1088
|
flex-direction: column;
|
|
1089
1089
|
align-items: center;
|
|
@@ -1092,7 +1092,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1092
1092
|
padding: 16px;
|
|
1093
1093
|
border-radius: 12px;
|
|
1094
1094
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1095
|
-
`,
|
|
1095
|
+
`,Cx=f.div`
|
|
1096
1096
|
display: flex;
|
|
1097
1097
|
align-items: center;
|
|
1098
1098
|
justify-content: center;
|
|
@@ -1101,7 +1101,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1101
1101
|
height: 39px;
|
|
1102
1102
|
border-radius: 20px;
|
|
1103
1103
|
background-color: ${({theme:e})=>e.v2.colors.red[500]};
|
|
1104
|
-
`,
|
|
1104
|
+
`,kx=f.div`
|
|
1105
1105
|
display: flex;
|
|
1106
1106
|
align-items: flex-start;
|
|
1107
1107
|
gap: 8px;
|
|
@@ -1111,7 +1111,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1111
1111
|
padding: 12px;
|
|
1112
1112
|
border-radius: 8px;
|
|
1113
1113
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1114
|
-
`,
|
|
1114
|
+
`,Tx=f.pre`
|
|
1115
1115
|
flex: 1;
|
|
1116
1116
|
min-width: 0;
|
|
1117
1117
|
margin: 0;
|
|
@@ -1121,25 +1121,25 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1121
1121
|
color: ${({theme:e})=>e.v2.colors.silver[200]};
|
|
1122
1122
|
white-space: pre-wrap;
|
|
1123
1123
|
word-break: break-word;
|
|
1124
|
-
`,
|
|
1124
|
+
`,Ix=f.div`
|
|
1125
1125
|
display: flex;
|
|
1126
1126
|
flex-direction: column;
|
|
1127
1127
|
gap: 12px;
|
|
1128
1128
|
width: 100%;
|
|
1129
|
-
|
|
1129
|
+
`,$x=f.div`
|
|
1130
1130
|
display: flex;
|
|
1131
1131
|
flex-wrap: wrap;
|
|
1132
1132
|
gap: 24px;
|
|
1133
1133
|
padding: 0 2px;
|
|
1134
|
-
`,
|
|
1134
|
+
`,Nx=f.div`
|
|
1135
1135
|
display: flex;
|
|
1136
1136
|
gap: 6px;
|
|
1137
1137
|
min-width: 0;
|
|
1138
|
-
`,
|
|
1138
|
+
`,Ax=f.div`
|
|
1139
1139
|
display: flex;
|
|
1140
1140
|
flex-direction: column;
|
|
1141
1141
|
gap: 8px;
|
|
1142
|
-
`,
|
|
1142
|
+
`,Ox=f.div`
|
|
1143
1143
|
display: flex;
|
|
1144
1144
|
flex-direction: column;
|
|
1145
1145
|
gap: 6px;
|
|
@@ -1147,7 +1147,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1147
1147
|
border-radius: 12px;
|
|
1148
1148
|
border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
|
|
1149
1149
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1150
|
-
`,$x=({isTesting:i,error:n,result:o})=>{const l=v(),{CopyButton:r}=En(),s=a(()=>o?.checks.filter(e=>!e.passed)??[],[o]),c=!(i||!n&&(!o||o.success)),d=n?ke.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||ke.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=n||s.map(e=>e.message).filter(Boolean).join("\n");return t(gx,{children:t(mx,{children:i?t(bx,{children:t(fx,{children:t(Ve,{withVisual:!0,withGradient:!0,title:ke.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:C.XS})})}):c?t(bx,{children:e(vx,{children:[t(yx,{children:t(Xu,{size:20,fill:l.v2.colors.black[500]})}),t(w,{size:C.XS,weight:400,lineHeight:"20px",color:k.Primary,children:ke.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(w,{align:"center",size:C.XXXS,weight:400,lineHeight:"normal",color:k.Secondary,children:d}),p&&e(Sx,{children:[t(xx,{children:p}),t(r,{value:p})]})]})}):o?e(wx,{children:[t(E,{status:ie.Success,label:ke.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Lu,fullWidth:!0}),(o.accountId||o.identity)&&e(Cx,{children:[o.accountId&&e(kx,{children:[e(w,{size:C.XXS,weight:500,color:k.Secondary,children:[ke.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(w,{size:C.XXS,weight:400,color:k.Primary,children:o.accountId})]}),o.identity&&e(kx,{children:[e(w,{size:C.XXS,weight:500,color:k.Secondary,children:[ke.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(w,{size:C.XXS,weight:400,color:k.Primary,children:o.identity})]})]}),o.checks.length>0&&t(Tx,{children:o.checks.map(i=>e(Ix,{$passed:i.passed,children:[t(E,{status:i.passed?ie.Success:ie.Error,label:i.displayName,leftIcon:i.passed?Lu:Xu}),i.message&&t(w,{size:C.XXS,weight:400,lineHeight:"normal",color:k.Secondary,children:i.message}),!i.passed&&i.remediation&&t(w,{size:C.XXS,weight:400,lineHeight:"normal",color:k.Primary,children:i.remediation})]},i.name))})]}):t(bx,{children:t(w,{size:C.XXS,weight:400,color:k.Secondary,children:ke.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var Nx;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(Nx||(Nx={}));const Ax=Nx.SelectProvider,Ox=Nx.Validate,Ex=({onClose:i,withOverlay:n,onCreateCloudConnector:o,onCreated:r})=>{const{providers:s,genericForm:c}=Cg(),[p,u]=l(Ax),[h,g]=l(!1),[m,b]=l(!1),[f,v]=l(void 0),[y,S]=l(void 0),[x,w]=l(void 0),C=c.isFormDirty,k=p===Ax,T=p===Ox,I=d(()=>{C&&!h?g(!0):(g(!1),i?.())},[C,h,i]),$=d(()=>{w(void 0),S(void 0),v(void 0),u(e=>e>Ax?e-1:e)},[]),N=d(()=>{if(w(void 0),p===Nx.SelectProvider){if(!c.formData.provider)return void w("Please select a cloud provider");if(!c.formData.permission)return void w("Please select a permission level")}u(e=>e<Ox?e+1:e)},[p,c.formData.provider,c.formData.permission]),A=d(async()=>{if(w(void 0),S(void 0),v(void 0),!o)return;const{provider:e,permission:t,customCapabilities:i,accountId:n,authMethod:a,credentials:l,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!n.trim())return void w(`Please enter ${h.displayName||h.name}`);if(!a)return void w("Please select an authentication method");const g=((e,t,i)=>{const n=ZS(e,t),a=n.filter(e=>e.method.id===t),o=n.filter(e=>e.method.id!==t);for(const e of[...a,...o]){const t=qS(e).find(e=>{return e.required&&(t=e.name,!i[t]?.trim());var t});if(t)return t}})(p,a,l);if(g)return void w(`Please enter ${g.displayName||g.name}`);const m=((e,t,i)=>{const n=cS(e),a=[];return n.forEach(e=>{const n=void 0!==e.instrumentationPermissions;let o=!1,l=!1;switch(t){case lS.DiscoveryOnly:o=!0;break;case lS.DiscoveryInstrumentation:o=!0,l=n;break;case lS.Custom:{const t=i[e.typeName];o=!!t?.discovery,l=!!t?.instrumentation;break}}(o||l)&&a.push({type:e.typeName,discovery:o,instrumentation:l,computePlatforms:!1})}),a})(p,t,i);u(Nx.Validate),b(!0);try{const t=await o({provider:e,displayName:d,credentials:l,expectedAccountId:n.trim(),capabilities:m});if(t.created)return void r?.(t.connectorId);v(t.test)}catch(e){S(e instanceof Error?e.message:"Failed to create connector")}finally{b(!1)}},[o,r,c.formData,s]),O=m,E=T&&!m&&(!!y||!!f&&!f.success),D=a(()=>x?{status:ie.Error,message:x}:void 0,[x]),z=a(()=>k?{"data-id":"cloud-connector-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:I,disabled:O}:{"data-id":"cloud-connector-back",label:zn.BACK,variant:K.Text,leftIcon:qu,onClick:$,disabled:O},[k,I,$,O]),R=a(()=>{if(T){if(m)return;return E?{"data-id":"cloud-connector-retry",label:zn.RETRY,variant:K.Primary,rightIcon:Zu,onClick:A}:void 0}return p===Nx.Config?{"data-id":"cloud-connector-verify",label:zn.VERIFY_AND_CREATE_CONNECTOR,variant:K.Primary,onClick:A,disabled:O}:{"data-id":"cloud-connector-next",label:zn.NEXT,variant:K.Primary,onClick:N,disabled:O}},[T,m,E,p,A,N,O]),P=a(()=>[z,R].filter(Boolean),[z,R]);return e(ln,{width:rm,isOpen:!0,hideOverlay:!O&&!n,header:{icon:Ku,title:ke.CREATE_CLOUD_CONNECTOR,onClose:i?I:void 0,onCloseDisabled:O},footer:{note:D,actions:P},children:[p===Nx.SelectProvider&&t(zS,{}),p===Nx.Config&&t(hx,{onBack:$}),p===Nx.Validate&&t($x,{isTesting:m,error:y,result:f}),t(sm,{isOpen:h,onClose:()=>g(!1),onApprove:()=>i?.()})]})},Dx=({statuses:e})=>{const i=a(()=>Rn(e).map(({status:e,type:t,reason:i,message:n})=>({status:e,title:Pn(i||t),subTitle:n??void 0})),[e]);return i.length?t($,{$gap:12,children:i.map(e=>t(Xn,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},zx=(e,t)=>{const i=[{id:"type",title:ke.TYPE,label:t.label},{id:"status",title:ke.STATUS,badge:{status:e.disabled?ie.Unknown:ie.Success,label:e.disabled?ke.DISABLED:ke.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&i.push({id:"signals",title:ke.SIGNALS_FOR_PROCESSING,label:n}),e.name&&i.push({id:"name",title:ke.NAME,label:e.name}),e.notes&&i.push({id:"notes",title:ke.NOTES,label:e.notes}),i},Rx=e=>e.map(e=>"cells"===e.kind?t(Mn,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):"list"===e.kind||"pairs"===e.kind?t(Mn,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id):t(Mn,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:e.items?.length?2:void 0,items:e.items,children:e.segments?.length?Rx(e.segments):null},e.id)),Px=({onClose:n,actionId:r})=>{const s=v(),{isK8s:c,platformType:u,version:h}=Mp(),{actionsApi:g}=Hh(),{items:m,refetch:b}=g.useActions(),{options:f}=g.useActionTypes(),{selectedOption:y,loadAction:S,validateFormData:x,genericForm:w}=jh(),C=p(b);C.current=b,o(()=>{C.current()},[]);const[k,T]=l(!1),[I,A]=l(!1),[O,E]=l(null),z=k&&!!w?.isFormDirty;o(()=>{if(k)return;const e=setInterval(()=>C.current(),3e3);return()=>clearInterval(e)},[k]);const R=a(()=>m?.find(e=>Fn(e)===r),[r,m]),P=a(()=>f.find(({type:e})=>e===R?.type)??hn(u,h).find(({type:e})=>e===R?.type)??Bn.find(({type:e})=>e===R?.type)??null,[f,R?.type,u,h]),X=R?.statuses&&Array.isArray(R.statuses)?R.statuses:null;o(()=>{R&&S(R,P)},[R,P]);const L=d(()=>{R&&T(!0)},[R]),_=d(()=>{R&&(S(R,P),T(!1))},[R,P,S]),M=d(()=>{z?E("close"):n()},[z,n]),F=d(()=>{z?E("cancel"):_()},[z,_]),B=d(()=>{const e=O;E(null),"close"===e?(_(),n()):_()},[O,_,n]),V=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await g.update(R.id,t),T(!1))}},[R,x,g]),U=d(()=>{R&&A(!0)},[R]),G=d(async()=>{R&&(await g.remove(R.id,R.type),n())},[R,g,n]);if(!R||!P)return t(ln,{isOpen:!0,header:{onClose:M},children:t(oi,{$height:"50vh",children:t(Ve,{withSpinner:!0})})});const j=(H=R,W=P,W?.fields?.length?Ln(H.fields||{},W.fields,{signals:H.signals||[],skipComponentTypes:[_n.SourceScopes]}):[]);var H,W;const Y=P.fields?.find(e=>e.componentType===_n.SourceScopes),J=Y?.name||D.Scopes,q=R.fields?.[J]??null,Z=c&&(!!Y||void 0!==R.fields?.scopes);return e(i,{children:[t(ln,{isOpen:!0,header:{icon:Un(R.type),title:P.label,onClose:M,actions:[{id:"edit-action-btn-edit",label:zn.EDIT,icon:Iu,active:k,onClick:L},{id:"edit-action-btn-delete",label:zn.DELETE,icon:xu,color:s.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:k?[{"data-id":"edit-action-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:F},{"data-id":"edit-action-btn-save",label:zn.SAVE,variant:K.Primary,onClick:V}]:[]},children:t(N,{$padding:"4px 12px 12px",children:k&&y?t(cb,{}):t($,{$gap:16,children:e(Mn,{bgTint:"1000",children:[c&&(X?t(Dx,{statuses:X}):t(Vn,{conditions:R.conditions||[]})),t(Mn,{bgTint:"800",cellsPerRow:2,items:zx(R,P)}),Z&&t(Jg,{readOnly:!0,scopes:q}),!!j.length&&t(Mn,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:Rx(j)})]})})})}),t(cm,{target:"action",isOpen:I,onClose:()=>A(!1),onApprove:G}),t(sm,{isOpen:null!==O,onClose:()=>E(null),onApprove:B})]})},Xx=({onClose:i,connections:n,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Hh(),[d,p]=l(""),[u,h]=l({showOnlySelected:!1}),g=a(()=>n.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),i=!u.showOnlySelected||u.showOnlySelected&&r.includes(e.id);return t&&i}),[n.length,r.length,d,u]),m=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:f,loading:v}=c.useEffectiveConfig({id:b},{skip:!b}),y=a(()=>({rollout:{automaticRolloutDisabled:f?.rollout?.automaticRolloutDisabled??!1}}),[f]),{formData:S,areFormValuesEqual:x,handleFormChange:I,resetFormData:$}=Gn(y);o(()=>{y&&$(y)},[y]);const N=a(()=>r.length>1||!x(y,S),[r.length,y,S]);return t(lm,{isOpen:!0,onClose:i,onSave:async()=>await(c.applyConfigurations?.(S,r))??void 0,header:{icon:Qu,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:p},filters:e(T,{$gap:8,children:[t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:"Show only:"}),t(L,{size:Vi.S,label:"Selected",value:u.showOnlySelected,onChange:e=>h(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:N,isFetching:v,leftColumn:{width:"35%",header:e(T,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(T,{$gap:8,children:[t(w,{size:C.XS,children:"Clusters"}),t(E,{label:g.length,status:ie.Unknown})]}),e(T,{$gap:8,children:[t(w,{size:C.XXXS,color:k.Secondary,align:"right",children:"Selected clusters"}),t(E,{label:`${r.length}/${g.length}`,status:ie.Unknown})]})]}),list:g.map(e=>t(Mm,{title:e.name,isChecked:r.includes(e.id),onClick:()=>m(e.id),onCheckboxChange:()=>m(e.id)},e.id))},rightColumn:{width:"65%",header:t(w,{size:C.XS,children:"Configurations"}),list:[t(L,{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=>I("rollout.automaticRolloutDisabled",e),size:Vi.S},"automatic-rollout-disabled")]}})},Lx=e=>{const t=[{id:"type",title:ke.TYPE,label:e.destinationType.displayName},{id:"status",title:ke.STATUS,badge:{status:e.disabled?ie.Unknown:ie.Success,label:e.disabled?ke.DISABLED:ke.ENABLED}}],i=oe(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return i&&t.push({id:"monitors",title:ke.MONITORS,label:i}),e.name&&t.push({id:"name",title:ke.NAME,label:e.name}),t},_x=({onClose:n,destinationId:r})=>{const s=v(),{isK8s:c}=Mp(),{destinationsApi:u}=Hh(),{selectedStreamName:h}=Te(),{items:g,refetch:m}=u.useDestinations(),{data:b,loading:f}=u.useDestinationCategories(),{activeForm:y,loadDestination:S,validateFormData:x,genericForm:w}=Wh();o(()=>{m()},[]);const C=p(null),[k,T]=l(!1),[I,A]=l(!1),[O,E]=l(null),D=k&&!!w?.isFormDirty,z=a(()=>Wn(g,h),[g,h]),R=a(()=>z?.find(e=>Fn(e)===r),[r,z]),P=b?.destinationCategories?.categories??null;o(()=>{R&&P&&S(R,P)},[R,P]);const X=a(()=>R&&P?Kn(P,R):[],[R,P]),L=d(()=>{R&&T(!0)},[R]),_=d(()=>{R&&P&&(S(R,P),T(!1))},[R,P,S]),M=d(()=>{D?E("close"):n()},[D,n]),F=d(()=>{D?E("cancel"):_()},[D,_]),B=d(()=>{const e=O;E(null),"close"===e?(_(),n()):_()},[O,_,n]),V=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(R.id,re(t)),T(!1))}},[R,x,u]),U=d(()=>{R&&A(!0)},[R]),G=d(async()=>{R&&(await u.remove(R.id),n())},[R,u,n]);if(!R)return t(ln,{isOpen:!0,header:{onClose:M},children:t(oi,{$height:"50vh",children:t(Ve,{withSpinner:!0})})});const{icon:j,iconSrc:H}=yn(R.destinationType.type),W=((e,t)=>{const i=[],n=jn(e,t),a=n.map(e=>({name:e.key,value:e.value})),o=oe(e.exportedSignals);let l=[];const r=()=>{l.length&&(i.push({kind:"cells",id:`cells-${i.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&Hn(h,o,a))return;const{type:m}=xn(u,{type:""}),b=d||"password"===m;if(g?.length)g.forEach(({condition:t,...i},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:i.title,label:i.value})});else if(s)if(b)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(p===_n.MultiInput){const t=xn(s,null);if(Array.isArray(t)&&t.length)return r(),void i.push({kind:"list",id:e,title:n,items:t.map((t,i)=>({id:`${e}-${i}`,label:String(t)}))})}if(p===_n.KeyValuePair){const t=xn(s,null);if(Array.isArray(t)&&t.length)return r(),void i.push({kind:"pairs",id:e,title:n,items:t.map((t,i)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${i}`,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(),i})(R,X);return e(i,{children:[t(ln,{isOpen:!0,header:{icon:j,iconSrc:H,title:R.name||R.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:zn.EDIT,icon:Iu,active:k,onClick:L},{id:"edit-destination-btn-delete",label:zn.DELETE,icon:xu,color:s.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:F},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:zn.TEST_CONNECTION,variant:K.Secondary,onClick:()=>C.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:zn.SAVE,variant:K.Primary,onClick:V}]:[]},children:t(N,{$padding:"4px 12px 12px",children:f?t(oi,{$height:"50vh",children:t(Ve,{withSpinner:!0})}):k&&y?t(pb,{ref:C,isEdit:!0}):e($,{$gap:16,children:[c&&t(Vn,{conditions:R.conditions||[]}),t(Mn,{bgTint:"900",cellsPerRow:2,items:Lx(R)}),!!W.length&&t(Mn,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:W.map(e=>"cells"===e.kind?t(Mn,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Mn,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})}),t(cm,{target:"destination",isOpen:I,onClose:()=>A(!1),onApprove:G}),t(sm,{isOpen:null!==O,onClose:()=>E(null),onApprove:B})]})},Mx=(e,t)=>{const i=[{id:"type",title:ke.TYPE,label:t.label},{id:"status",title:ke.STATUS,badge:{status:e.disabled?ie.Unknown:ie.Success,label:e.disabled?ke.DISABLED:ke.ENABLED}}];return e.ruleName&&i.push({id:"name",title:ke.NAME,label:e.ruleName}),e.profileName&&i.push({id:"profile",title:ke.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&i.push({id:"notes",title:ke.NOTES,label:e.notes}),i},Fx=({onClose:n,ruleId:r})=>{const s=v(),{addNotification:c}=Yn(),{isK8s:p,platformType:u,version:h}=Mp(),g=ve(u,h),{instrumentationRulesApi:m}=Hh(),{items:b,refetch:f}=m.useRules(),{selectedOption:y,loadRule:S,validateFormData:x,genericForm:w}=Kh();o(()=>{f()},[]);const[C,k]=l(!1),[I,A]=l(!1),[O,E]=l(null),D=C&&!!w?.isFormDirty,{options:z}=m.useRuleTypes(),R=a(()=>z.length?z:wn,[z]),P=a(()=>b?.find(e=>Fn(e)===r),[r,b]),X=a(()=>R.find(({type:e})=>e===P?.type)??null,[R,P?.type]),L=a(()=>ye(X?.supportedLanguages),[X?.supportedLanguages]);o(()=>{P&&X&&S(P,X)},[P,X]);const _=d(()=>{if(P){if(!P.mutable)return void c({type:ie.Warning,title:be.FORBIDDEN,message:be.CANNOT_EDIT_RULE,crdType:kn.InstrumentationRule,target:P.ruleId,hideFromHistory:!0});k(!0)}},[P,c]),M=d(()=>{P&&X&&(S(P,X),k(!1))},[P,X,S]),F=d(()=>{D?E("close"):n()},[D,n]),B=d(()=>{D?E("cancel"):M()},[D,M]),V=d(()=>{const e=O;E(null),"close"===e?(M(),n()):M()},[O,M,n]),U=d(async()=>{if(P){const{errorMessage:e,preparedFormData:t}=x();e||(await m.update(P.ruleId,t,P.type),k(!1))}},[P,x,m]),G=d(()=>{if(P){if(!P.mutable)return void c({type:ie.Warning,title:be.FORBIDDEN,message:be.CANNOT_DELETE_RULE,crdType:kn.InstrumentationRule,target:P.ruleId,hideFromHistory:!0});A(!0)}},[P,c]),j=d(async()=>{P&&(await m.remove(P.ruleId,P.type),n())},[P,m,n]);if(!P||!X)return t(ln,{isOpen:!0,header:{onClose:F},children:t(oi,{$height:"50vh",children:t(Ve,{withSpinner:!0})})});const H=(W=P,Y=X,Y?.fields?.length?Ln(W,Y.fields,{skipComponentTypes:[_n.SourceScopes]}):[]);var W,Y;return e(i,{children:[t(ln,{isOpen:!0,header:{icon:Jn(P.type),title:X.label,onClose:F,actions:[{id:"edit-rule-btn-edit",label:zn.EDIT,icon:Iu,active:C,onClick:_},{id:"edit-rule-btn-delete",label:zn.DELETE,icon:xu,color:s.v2.colors.red[500],active:I,onClick:G}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:B},{"data-id":"edit-rule-btn-save",label:zn.SAVE,variant:K.Primary,onClick:U}]:[]},children:t(N,{$padding:"4px 12px 12px",children:C&&y?t(yb,{}):t($,{$gap:16,children:e(Mn,{bgTint:"1000",children:[p&&!!P.conditions?.length&&t(Vn,{conditions:P.conditions}),t(Mn,{bgTint:"800",cellsPerRow:2,items:Mx(P,X)}),g&&t(Jg,{readOnly:!0,scopes:P.sourceScopes??null}),X.type===fe.CustomInstrumentation&&!!P.customInstrumentations?.[me.Php]?.length&&t(te,{status:ie.Warning,message:be.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!H.length&&t(Mn,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:Rx(H)}),!!L.length&&t(Mn,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Mn,{bgTint:"800",children:t(T,{$gap:12,$wrap:"wrap",children:L.map(e=>t(Xi,{label:we(e),leftIcon:xe(e),flex:L.length>1?"0.5":"1"},e))})})})]})})})}),t(cm,{target:"instrumentation rule",isOpen:I,onClose:()=>A(!1),onApprove:j}),t(sm,{isOpen:null!==O,onClose:()=>E(null),onApprove:V})]})};var Bx;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Bx||(Bx={}));const Vx=({collapseIsDefaultOpen:e,isJumpToTarget:i,onClickRestartPod:n,namespace:o,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=qn(),{platformType:g,version:m}=Mp(),b=Zn(g,m),f=Qn(!!i),v=a(()=>({title:l,icon:eh,withCopy:!0}),[l]),y=a(()=>{const e=[],t=ea(c);t&&e.push(t);const i=ea(d,Ju,"health");i&&e.push(i);const n=ea(p,th,"health");return n&&e.push(n),e},[c,d,p]),S=a(()=>n?[{id:`restart-pod-${l}`,icon:Zu,label:zn.RESTART_POD,onClick:()=>n(o,l)}]:void 0,[n,o,l]),x=a(()=>[{id:"nodeName",title:ke.NODE,label:r,withCopy:!0},{id:"age",title:ke.AGE,label:s?h(s,{style:"short"}):b?ke.NOT_RUNNING:ke.UNKNOWN_VALUE,labelTooltip:s||(b?void 0:ke.START_TIME_UNAVAILABLE)}],[r,s,h,b]);return t("div",{ref:f,children:t(Mn,{bgTint:"900",richTitle:v,badges:y,dropDataActions:S,items:x,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Ux=f.div`
|
|
1150
|
+
`,Ex=({isTesting:i,error:n,result:o})=>{const l=v(),{CopyButton:r}=En(),s=a(()=>o?.checks.filter(e=>!e.passed)??[],[o]),c=!(i||!n&&(!o||o.success)),d=n?ke.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||ke.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=n||s.map(e=>e.message).filter(Boolean).join("\n");return t(vx,{children:t(yx,{children:i?t(Sx,{children:t(xx,{children:t(Ve,{withVisual:!0,withGradient:!0,title:ke.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:C.XS})})}):c?t(Sx,{children:e(wx,{children:[t(Cx,{children:t(Mu,{size:20,fill:l.v2.colors.black[500]})}),t(w,{size:C.XS,weight:400,lineHeight:"20px",color:k.Primary,children:ke.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(w,{align:"center",size:C.XXXS,weight:400,lineHeight:"normal",color:k.Secondary,children:d}),p&&e(kx,{children:[t(Tx,{children:p}),t(r,{value:p})]})]})}):o?e(Ix,{children:[t(E,{status:ie.Success,label:ke.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Fu,fullWidth:!0}),(o.accountId||o.identity)&&e($x,{children:[o.accountId&&e(Nx,{children:[e(w,{size:C.XXS,weight:500,color:k.Secondary,children:[ke.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(w,{size:C.XXS,weight:400,color:k.Primary,children:o.accountId})]}),o.identity&&e(Nx,{children:[e(w,{size:C.XXS,weight:500,color:k.Secondary,children:[ke.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(w,{size:C.XXS,weight:400,color:k.Primary,children:o.identity})]})]}),o.checks.length>0&&t(Ax,{children:o.checks.map(i=>e(Ox,{$passed:i.passed,children:[t(E,{status:i.passed?ie.Success:ie.Error,label:i.displayName,leftIcon:i.passed?Fu:Mu}),i.message&&t(w,{size:C.XXS,weight:400,lineHeight:"normal",color:k.Secondary,children:i.message}),!i.passed&&i.remediation&&t(w,{size:C.XXS,weight:400,lineHeight:"normal",color:k.Primary,children:i.remediation})]},i.name))})]}):t(Sx,{children:t(w,{size:C.XXS,weight:400,color:k.Secondary,children:ke.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var Dx;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(Dx||(Dx={}));const zx=Dx.SelectProvider,Rx=Dx.Validate,Px=({onClose:i,withOverlay:n,onCreateCloudConnector:o,onCreated:r})=>{const{providers:s,genericForm:c}=$g(),[p,u]=l(zx),[h,g]=l(!1),[m,b]=l(!1),[f,v]=l(void 0),[y,S]=l(void 0),[x,w]=l(void 0),C=c.isFormDirty,k=p===zx,T=p===Rx,I=d(()=>{C&&!h?g(!0):(g(!1),i?.())},[C,h,i]),$=d(()=>{w(void 0),S(void 0),v(void 0),u(e=>e>zx?e-1:e)},[]),N=d(()=>{if(w(void 0),p===Dx.SelectProvider){if(!c.formData.provider)return void w("Please select a cloud provider");if(!c.formData.permission)return void w("Please select a permission level")}u(e=>e<Rx?e+1:e)},[p,c.formData.provider,c.formData.permission]),A=d(async()=>{if(w(void 0),S(void 0),v(void 0),!o)return;const{provider:e,permission:t,customCapabilities:i,accountId:n,authMethod:a,credentials:l,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!n.trim())return void w(`Please enter ${h.displayName||h.name}`);if(!a)return void w("Please select an authentication method");const g=((e,t,i)=>{const n=ix(e,t),a=n.filter(e=>e.method.id===t),o=n.filter(e=>e.method.id!==t);for(const e of[...a,...o]){const t=tx(e).find(e=>{return e.required&&(t=e.name,!i[t]?.trim());var t});if(t)return t}})(p,a,l);if(g)return void w(`Please enter ${g.displayName||g.name}`);const m=((e,t,i)=>{const n=hS(e),a=[];return n.forEach(e=>{const n=void 0!==e.instrumentationPermissions;let o=!1,l=!1;switch(t){case dS.DiscoveryOnly:o=!0;break;case dS.DiscoveryInstrumentation:o=!0,l=n;break;case dS.Custom:{const t=i[e.typeName];o=!!t?.discovery,l=!!t?.instrumentation;break}}(o||l)&&a.push({type:e.typeName,discovery:o,instrumentation:l,computePlatforms:!1})}),a})(p,t,i);u(Dx.Validate),b(!0);try{const t=await o({provider:e,displayName:d,credentials:l,expectedAccountId:n.trim(),capabilities:m});if(t.created)return void r?.(t.connectorId);v(t.test)}catch(e){S(e instanceof Error?e.message:"Failed to create connector")}finally{b(!1)}},[o,r,c.formData,s]),O=m,E=T&&!m&&(!!y||!!f&&!f.success),D=a(()=>x?{status:ie.Error,message:x}:void 0,[x]),z=a(()=>k?{"data-id":"cloud-connector-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:I,disabled:O}:{"data-id":"cloud-connector-back",label:zn.BACK,variant:K.Text,leftIcon:eh,onClick:$,disabled:O},[k,I,$,O]),R=a(()=>{if(T){if(m)return;return E?{"data-id":"cloud-connector-retry",label:zn.RETRY,variant:K.Primary,rightIcon:th,onClick:A}:void 0}return p===Dx.Config?{"data-id":"cloud-connector-verify",label:zn.VERIFY_AND_CREATE_CONNECTOR,variant:K.Primary,onClick:A,disabled:O}:{"data-id":"cloud-connector-next",label:zn.NEXT,variant:K.Primary,onClick:N,disabled:O}},[T,m,E,p,A,N,O]),P=a(()=>[z,R].filter(Boolean),[z,R]);return e(ln,{width:pm,isOpen:!0,hideOverlay:!O&&!n,header:{icon:qu,title:ke.CREATE_CLOUD_CONNECTOR,onClose:i?I:void 0,onCloseDisabled:O},footer:{note:D,actions:P},children:[p===Dx.SelectProvider&&t(LS,{}),p===Dx.Config&&t(fx,{onBack:$}),p===Dx.Validate&&t(Ex,{isTesting:m,error:y,result:f}),t(um,{isOpen:h,onClose:()=>g(!1),onApprove:()=>i?.()})]})},Xx=({statuses:e})=>{const i=a(()=>Rn(e).map(({status:e,type:t,reason:i,message:n})=>({status:e,title:Pn(i||t),subTitle:n??void 0})),[e]);return i.length?t($,{$gap:12,children:i.map(e=>t(Xn,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},Lx=(e,t)=>{const i=[{id:"type",title:ke.TYPE,label:t.label},{id:"status",title:ke.STATUS,badge:{status:e.disabled?ie.Unknown:ie.Success,label:e.disabled?ke.DISABLED:ke.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&i.push({id:"signals",title:ke.SIGNALS_FOR_PROCESSING,label:n}),e.name&&i.push({id:"name",title:ke.NAME,label:e.name}),e.notes&&i.push({id:"notes",title:ke.NOTES,label:e.notes}),i},_x=e=>e.map(e=>"cells"===e.kind?t(Mn,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):"list"===e.kind||"pairs"===e.kind?t(Mn,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id):t(Mn,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:e.items?.length?2:void 0,items:e.items,children:e.segments?.length?_x(e.segments):null},e.id)),Mx=({onClose:n,actionId:r})=>{const s=v(),{isK8s:c,platformType:u,version:h}=Vp(),{actionsApi:g}=Jh(),{items:m,refetch:b}=g.useActions(),{options:f}=g.useActionTypes(),{selectedOption:y,loadAction:S,validateFormData:x,genericForm:w}=Yh(),C=p(b);C.current=b,o(()=>{C.current()},[]);const[k,T]=l(!1),[I,A]=l(!1),[O,E]=l(null),z=k&&!!w?.isFormDirty;o(()=>{if(k)return;const e=setInterval(()=>C.current(),3e3);return()=>clearInterval(e)},[k]);const R=a(()=>m?.find(e=>Fn(e)===r),[r,m]),P=a(()=>f.find(({type:e})=>e===R?.type)??hn(u,h).find(({type:e})=>e===R?.type)??Bn.find(({type:e})=>e===R?.type)??null,[f,R?.type,u,h]),X=R?.statuses&&Array.isArray(R.statuses)?R.statuses:null;o(()=>{R&&S(R,P)},[R,P]);const L=d(()=>{R&&T(!0)},[R]),_=d(()=>{R&&(S(R,P),T(!1))},[R,P,S]),M=d(()=>{z?E("close"):n()},[z,n]),F=d(()=>{z?E("cancel"):_()},[z,_]),B=d(()=>{const e=O;E(null),"close"===e?(_(),n()):_()},[O,_,n]),V=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await g.update(R.id,t),T(!1))}},[R,x,g]),U=d(()=>{R&&A(!0)},[R]),G=d(async()=>{R&&(await g.remove(R.id,R.type),n())},[R,g,n]);if(!R||!P)return t(ln,{isOpen:!0,header:{onClose:M},children:t(oi,{$height:"50vh",children:t(Ve,{withSpinner:!0})})});const j=(H=R,W=P,W?.fields?.length?Ln(H.fields||{},W.fields,{signals:H.signals||[],skipComponentTypes:[_n.SourceScopes]}):[]);var H,W;const Y=P.fields?.find(e=>e.componentType===_n.SourceScopes),J=Y?.name||D.Scopes,q=R.fields?.[J]??null,Z=c&&(!!Y||void 0!==R.fields?.scopes);return e(i,{children:[t(ln,{isOpen:!0,header:{icon:Un(R.type),title:P.label,onClose:M,actions:[{id:"edit-action-btn-edit",label:zn.EDIT,icon:Au,active:k,onClick:L},{id:"edit-action-btn-delete",label:zn.DELETE,icon:ku,color:s.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:k?[{"data-id":"edit-action-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:F},{"data-id":"edit-action-btn-save",label:zn.SAVE,variant:K.Primary,onClick:V}]:[]},children:t(N,{$padding:"4px 12px 12px",children:k&&y?t(hb,{}):t($,{$gap:16,children:e(Mn,{bgTint:"1000",children:[c&&(X?t(Xx,{statuses:X}):t(Vn,{conditions:R.conditions||[]})),t(Mn,{bgTint:"800",cellsPerRow:2,items:Lx(R,P)}),Z&&t(em,{readOnly:!0,scopes:q}),!!j.length&&t(Mn,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:_x(j)})]})})})}),t(hm,{target:"action",isOpen:I,onClose:()=>A(!1),onApprove:G}),t(um,{isOpen:null!==O,onClose:()=>E(null),onApprove:B})]})},Fx=({onClose:i,connections:n,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Jh(),[d,p]=l(""),[u,h]=l({showOnlySelected:!1}),g=a(()=>n.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),i=!u.showOnlySelected||u.showOnlySelected&&r.includes(e.id);return t&&i}),[n.length,r.length,d,u]),m=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:f,loading:v}=c.useEffectiveConfig({id:b},{skip:!b}),y=a(()=>({rollout:{automaticRolloutDisabled:f?.rollout?.automaticRolloutDisabled??!1}}),[f]),{formData:S,areFormValuesEqual:x,handleFormChange:I,resetFormData:$}=Gn(y);o(()=>{y&&$(y)},[y]);const N=a(()=>r.length>1||!x(y,S),[r.length,y,S]);return t(dm,{isOpen:!0,onClose:i,onSave:async()=>await(c.applyConfigurations?.(S,r))??void 0,header:{icon:ih,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:p},filters:e(T,{$gap:8,children:[t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:"Show only:"}),t(L,{size:Vi.S,label:"Selected",value:u.showOnlySelected,onChange:e=>h(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:N,isFetching:v,leftColumn:{width:"35%",header:e(T,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(T,{$gap:8,children:[t(w,{size:C.XS,children:"Clusters"}),t(E,{label:g.length,status:ie.Unknown})]}),e(T,{$gap:8,children:[t(w,{size:C.XXXS,color:k.Secondary,align:"right",children:"Selected clusters"}),t(E,{label:`${r.length}/${g.length}`,status:ie.Unknown})]})]}),list:g.map(e=>t(Um,{title:e.name,isChecked:r.includes(e.id),onClick:()=>m(e.id),onCheckboxChange:()=>m(e.id)},e.id))},rightColumn:{width:"65%",header:t(w,{size:C.XS,children:"Configurations"}),list:[t(L,{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=>I("rollout.automaticRolloutDisabled",e),size:Vi.S},"automatic-rollout-disabled")]}})},Bx=e=>{const t=[{id:"type",title:ke.TYPE,label:e.destinationType.displayName},{id:"status",title:ke.STATUS,badge:{status:e.disabled?ie.Unknown:ie.Success,label:e.disabled?ke.DISABLED:ke.ENABLED}}],i=oe(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return i&&t.push({id:"monitors",title:ke.MONITORS,label:i}),e.name&&t.push({id:"name",title:ke.NAME,label:e.name}),t},Vx=({onClose:n,destinationId:r})=>{const s=v(),{isK8s:c}=Vp(),{destinationsApi:u}=Jh(),{selectedStreamName:h}=Te(),{items:g,refetch:m}=u.useDestinations(),{data:b,loading:f}=u.useDestinationCategories(),{activeForm:y,loadDestination:S,validateFormData:x,genericForm:w}=qh();o(()=>{m()},[]);const C=p(null),[k,T]=l(!1),[I,A]=l(!1),[O,E]=l(null),D=k&&!!w?.isFormDirty,z=a(()=>Wn(g,h),[g,h]),R=a(()=>z?.find(e=>Fn(e)===r),[r,z]),P=b?.destinationCategories?.categories??null;o(()=>{R&&P&&S(R,P)},[R,P]);const X=a(()=>R&&P?Kn(P,R):[],[R,P]),L=d(()=>{R&&T(!0)},[R]),_=d(()=>{R&&P&&(S(R,P),T(!1))},[R,P,S]),M=d(()=>{D?E("close"):n()},[D,n]),F=d(()=>{D?E("cancel"):_()},[D,_]),B=d(()=>{const e=O;E(null),"close"===e?(_(),n()):_()},[O,_,n]),V=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(R.id,re(t)),T(!1))}},[R,x,u]),U=d(()=>{R&&A(!0)},[R]),G=d(async()=>{R&&(await u.remove(R.id),n())},[R,u,n]);if(!R)return t(ln,{isOpen:!0,header:{onClose:M},children:t(oi,{$height:"50vh",children:t(Ve,{withSpinner:!0})})});const{icon:j,iconSrc:H}=yn(R.destinationType.type),W=((e,t)=>{const i=[],n=jn(e,t),a=n.map(e=>({name:e.key,value:e.value})),o=oe(e.exportedSignals);let l=[];const r=()=>{l.length&&(i.push({kind:"cells",id:`cells-${i.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&Hn(h,o,a))return;const{type:m}=xn(u,{type:""}),b=d||"password"===m;if(g?.length)g.forEach(({condition:t,...i},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:i.title,label:i.value})});else if(s)if(b)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(p===_n.MultiInput){const t=xn(s,null);if(Array.isArray(t)&&t.length)return r(),void i.push({kind:"list",id:e,title:n,items:t.map((t,i)=>({id:`${e}-${i}`,label:String(t)}))})}if(p===_n.KeyValuePair){const t=xn(s,null);if(Array.isArray(t)&&t.length)return r(),void i.push({kind:"pairs",id:e,title:n,items:t.map((t,i)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${i}`,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(),i})(R,X);return e(i,{children:[t(ln,{isOpen:!0,header:{icon:j,iconSrc:H,title:R.name||R.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:zn.EDIT,icon:Au,active:k,onClick:L},{id:"edit-destination-btn-delete",label:zn.DELETE,icon:ku,color:s.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:F},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:zn.TEST_CONNECTION,variant:K.Secondary,onClick:()=>C.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:zn.SAVE,variant:K.Primary,onClick:V}]:[]},children:t(N,{$padding:"4px 12px 12px",children:f?t(oi,{$height:"50vh",children:t(Ve,{withSpinner:!0})}):k&&y?t(mb,{ref:C,isEdit:!0}):e($,{$gap:16,children:[c&&t(Vn,{conditions:R.conditions||[]}),t(Mn,{bgTint:"900",cellsPerRow:2,items:Bx(R)}),!!W.length&&t(Mn,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:W.map(e=>"cells"===e.kind?t(Mn,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Mn,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})}),t(hm,{target:"destination",isOpen:I,onClose:()=>A(!1),onApprove:G}),t(um,{isOpen:null!==O,onClose:()=>E(null),onApprove:B})]})},Ux=(e,t)=>{const i=[{id:"type",title:ke.TYPE,label:t.label},{id:"status",title:ke.STATUS,badge:{status:e.disabled?ie.Unknown:ie.Success,label:e.disabled?ke.DISABLED:ke.ENABLED}}];return e.ruleName&&i.push({id:"name",title:ke.NAME,label:e.ruleName}),e.profileName&&i.push({id:"profile",title:ke.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&i.push({id:"notes",title:ke.NOTES,label:e.notes}),i},Gx=({onClose:n,ruleId:r})=>{const s=v(),{addNotification:c}=Yn(),{isK8s:p,platformType:u,version:h}=Vp(),g=ve(u,h),{instrumentationRulesApi:m}=Jh(),{items:b,refetch:f}=m.useRules(),{selectedOption:y,loadRule:S,validateFormData:x,genericForm:w}=Zh();o(()=>{f()},[]);const[C,k]=l(!1),[I,A]=l(!1),[O,E]=l(null),D=C&&!!w?.isFormDirty,{options:z}=m.useRuleTypes(),R=a(()=>z.length?z:wn,[z]),P=a(()=>b?.find(e=>Fn(e)===r),[r,b]),X=a(()=>R.find(({type:e})=>e===P?.type)??null,[R,P?.type]),L=a(()=>ye(X?.supportedLanguages),[X?.supportedLanguages]);o(()=>{P&&X&&S(P,X)},[P,X]);const _=d(()=>{if(P){if(!P.mutable)return void c({type:ie.Warning,title:be.FORBIDDEN,message:be.CANNOT_EDIT_RULE,crdType:kn.InstrumentationRule,target:P.ruleId,hideFromHistory:!0});k(!0)}},[P,c]),M=d(()=>{P&&X&&(S(P,X),k(!1))},[P,X,S]),F=d(()=>{D?E("close"):n()},[D,n]),B=d(()=>{D?E("cancel"):M()},[D,M]),V=d(()=>{const e=O;E(null),"close"===e?(M(),n()):M()},[O,M,n]),U=d(async()=>{if(P){const{errorMessage:e,preparedFormData:t}=x();e||(await m.update(P.ruleId,t,P.type),k(!1))}},[P,x,m]),G=d(()=>{if(P){if(!P.mutable)return void c({type:ie.Warning,title:be.FORBIDDEN,message:be.CANNOT_DELETE_RULE,crdType:kn.InstrumentationRule,target:P.ruleId,hideFromHistory:!0});A(!0)}},[P,c]),j=d(async()=>{P&&(await m.remove(P.ruleId,P.type),n())},[P,m,n]);if(!P||!X)return t(ln,{isOpen:!0,header:{onClose:F},children:t(oi,{$height:"50vh",children:t(Ve,{withSpinner:!0})})});const H=(W=P,Y=X,Y?.fields?.length?Ln(W,Y.fields,{skipComponentTypes:[_n.SourceScopes]}):[]);var W,Y;return e(i,{children:[t(ln,{isOpen:!0,header:{icon:Jn(P.type),title:X.label,onClose:F,actions:[{id:"edit-rule-btn-edit",label:zn.EDIT,icon:Au,active:C,onClick:_},{id:"edit-rule-btn-delete",label:zn.DELETE,icon:ku,color:s.v2.colors.red[500],active:I,onClick:G}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:B},{"data-id":"edit-rule-btn-save",label:zn.SAVE,variant:K.Primary,onClick:U}]:[]},children:t(N,{$padding:"4px 12px 12px",children:C&&y?t(Cb,{}):t($,{$gap:16,children:e(Mn,{bgTint:"1000",children:[p&&!!P.conditions?.length&&t(Vn,{conditions:P.conditions}),t(Mn,{bgTint:"800",cellsPerRow:2,items:Ux(P,X)}),g&&t(em,{readOnly:!0,scopes:P.sourceScopes??null}),X.type===fe.CustomInstrumentation&&!!P.customInstrumentations?.[me.Php]?.length&&t(te,{status:ie.Warning,message:be.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!H.length&&t(Mn,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:_x(H)}),!!L.length&&t(Mn,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Mn,{bgTint:"800",children:t(T,{$gap:12,$wrap:"wrap",children:L.map(e=>t(Xi,{label:we(e),leftIcon:xe(e),flex:L.length>1?"0.5":"1"},e))})})})]})})})}),t(hm,{target:"instrumentation rule",isOpen:I,onClose:()=>A(!1),onApprove:j}),t(um,{isOpen:null!==O,onClose:()=>E(null),onApprove:V})]})};var jx;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(jx||(jx={}));const Hx=({collapseIsDefaultOpen:e,isJumpToTarget:i,onClickRestartPod:n,namespace:o,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=qn(),{platformType:g,version:m}=Vp(),b=Zn(g,m),f=Qn(!!i),v=a(()=>({title:l,icon:nh,withCopy:!0}),[l]),y=a(()=>{const e=[],t=ea(c);t&&e.push(t);const i=ea(d,Qu,"health");i&&e.push(i);const n=ea(p,ah,"health");return n&&e.push(n),e},[c,d,p]),S=a(()=>n?[{id:`restart-pod-${l}`,icon:th,label:zn.RESTART_POD,onClick:()=>n(o,l)}]:void 0,[n,o,l]),x=a(()=>[{id:"nodeName",title:ke.NODE,label:r,withCopy:!0},{id:"age",title:ke.AGE,label:s?h(s,{style:"short"}):b?ke.NOT_RUNNING:ke.UNKNOWN_VALUE,labelTooltip:s||(b?void 0:ke.START_TIME_UNAVAILABLE)}],[r,s,h,b]);return t("div",{ref:f,children:t(Mn,{bgTint:"900",richTitle:v,badges:y,dropDataActions:S,items:x,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Wx=f.div`
|
|
1151
1151
|
display: flex;
|
|
1152
1152
|
align-items: center;
|
|
1153
1153
|
justify-content: space-between;
|
|
@@ -1155,7 +1155,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1155
1155
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
1156
1156
|
border-radius: 12px;
|
|
1157
1157
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1158
|
-
`,
|
|
1158
|
+
`,Kx=({podsOdigosHealthStatus:i,pods:n,noPadding:o})=>{const l=ia(i?.status),r=Pn(i?.name),s=i?.message,{totalPodsCount:c,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===ta.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===ta.Success?1:0),0)||0}),[n]);return n?.length&&i&&l?e(Wx,{$noPadding:o,children:[t(Xn,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(T,{$gap:8,children:[t(Jx,{label:ke.PODS,count:c}),t(Jx,{label:ke.ODIGOS_HEALTHY,icon:Qu,count:d,total:c}),t(Jx,{label:ke.KUBERNETES_HEALTHY,icon:ah,count:p,total:c})]})]}):null},Yx=f.div`
|
|
1159
1159
|
display: flex;
|
|
1160
1160
|
flex-direction: column;
|
|
1161
1161
|
justify-content: center;
|
|
@@ -1166,14 +1166,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1166
1166
|
width: fit-content;
|
|
1167
1167
|
border-radius: 8px;
|
|
1168
1168
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1169
|
-
`,
|
|
1169
|
+
`,Jx=({count:i,total:n,label:a,icon:o})=>{const l=v(),r=void 0===n?void 0:i===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Yx,{children:[e(T,{$gap:0,$alignItems:"flex-end",children:[t(w,{size:C.L,color:r,weight:500,nowrap:!0,children:i}),void 0!==n&&t(w,{size:C.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(T,{$alignItems:"center",$gap:4,children:[o&&t(o,{size:16}),t(w,{size:C.XXXS,nowrap:!0,children:a})]})]})},qx=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===na.PID)??e.identifyingAttributes?.find(({name:e})=>e===na.VPID);return t?.value??null};var Zx;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Zx||(Zx={}));const Qx=({overrideProcessNum:i,healthy:n,healthStatus:r,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=l(Zx.IdentifyingAttributes),g=Qn(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:f}=a(()=>{const e=c?.some(e=>!1===e.healthy),i=[{value:Zx.IdentifyingAttributes,label:ke.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:Zx.InstrumentationLibraries,label:ke.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(oh,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.v2.colors.purple[500]}];return{tabOptions:i,firstTabValue:i.find(e=>!e.disabled)?.value||i[0].value,bothTabsDisabled:i.every(e=>e.disabled)}},[s,c]);o(()=>{b&&h(b)},[b]);const y=a(()=>{switch(u){case Zx.IdentifyingAttributes:return t($,{children:s?.map((e,i)=>t(aa,{label:e.name,value:e.value},`attr-${i}-${e.name}`))});case Zx.InstrumentationLibraries:return t($,{children:c?.map((e,i)=>t(aa,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${i}-${e.name}`))});default:return null}},[u,s,c]),S=a(()=>qx({overrideProcessNum:i,identifyingAttributes:s}),[i,s]);return t("div",{ref:g,children:e(Mn,{bgTint:"800",richTitle:{title:S?`${ke.PROCESS} ${ke.PID(S)}`:ke.PROCESS_FALLBACK_NAME},renderOnRightSide:t(w,{color:n?k.Success:k.Error,size:C.XXXS,children:r?.message}),badges:[{key:"odigos-healthy",status:n?ie.Success:ie.Error,leftIcon:Qu,label:n?ke.HEALTHY:ke.NOT_HEALTHY,textSize:C.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!f,collapseIsDefaultOpen:d,children:[!f&&t(F,{options:m,selected:u,setSelected:h}),!f&&y]})})},ew=h(null),tw=({value:e,children:i})=>t(ew.Provider,{value:e,children:i}),iw=({podContainers:e,sourceContainers:i,jumpToTarget:n})=>{const o=e??[],l=a(()=>({title:ke.CONTAINERS,titleSize:C.XS,badge:{label:o.length}}),[o.length]),r=a(()=>{const e=new Map;return i?.forEach(t=>e.set(t.containerName,t)),e},[i]);return t(Mn,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t($,{$gap:8,children:o.map(e=>{const i=n?.containerName===e.containerName;return t(aw,{...e,language:oa(r.get(e.containerName)),jumpToTarget:i?n:null},`pod-container-${e.containerName}`)})})})},nw=f.div`
|
|
1170
1170
|
display: flex;
|
|
1171
1171
|
flex-direction: column;
|
|
1172
1172
|
gap: 12px;
|
|
1173
1173
|
padding: 8px 12px;
|
|
1174
1174
|
border-radius: 8px;
|
|
1175
1175
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1176
|
-
`,
|
|
1176
|
+
`,aw=({language:i,containerName:n,otelDistroName:o,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:g,processes:m,jumpToTarget:b})=>{const f=!!b,v=f&&!b?.processPid,{formatDurationAgo:y}=qn(),{platformType:S,version:x}=Vp(),I=Zn(S,x),$=Qn(v),N=a(()=>({title:n,icon:i?la(i):lh,iconWithWrapper:!0}),[n,i]),A=a(()=>{const e=[],t=ea({status:o?ta.Success:ta.Disabled,reasonEnum:o?ke.INSTRUMENTED_WITH_DISTRO(o):ke.UNINSTRUMENTED,message:""});t&&e.push(t);const i=ea(h,Qu,"health");i&&e.push(i);const n=ea(g,ah,"health");return n&&e.push(n),e},[g,h,o]),O=a(()=>{const e=[{id:"runningTime",title:ke.RUNNING_TIME,label:l?y(l,{style:"short"}):I?ke.NOT_RUNNING:ke.UNKNOWN_VALUE,labelTooltip:l?`${ke.RUNNING_TIME_TOOLTIP}. (${l})`:I?ke.RUNNING_TIME_TOOLTIP:ke.START_TIME_UNAVAILABLE},{id:"blank",spacer:!0},{id:"started",badge:{status:r?ie.Success:ie.Disabled,leftIcon:r?zu:Ru,label:r?ke.STARTED:ke.NOT_STARTED,textSize:C.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?ie.Success:ie.Disabled,leftIcon:s?zu:Ru,label:s?ke.READY:ke.NOT_READY,textSize:C.XXXS,invertColors:!0,useSecondaryTone:!0}}];return d&&e.push({id:"isCrashLoop",badge:{status:ie.Error,leftIcon:Ru,label:ke.CRASHLOOP,textSize:C.XXXS,invertColors:!0,useSecondaryTone:!0}}),e.push({id:"restartCount",title:ke.RESTARTS,badge:{status:c?ie.Error:void 0,label:c||0,textSize:C.XXXS}}),e},[l,y,r,s,d,c,I]),E=a(()=>u?Pn(p):"",[u,p]);return t("div",{ref:$,children:e(Mn,{bgTint:"750",richTitle:N,badges:A,items:O,withCollapse:!0,collapseIsDefaultOpen:f,children:[u&&t(nw,{children:e(T,{$gap:10,$alignItems:"center",children:[t(Xi,{variant:_i.Pink,leftIcon:ah,label:E}),t(w,{size:C.XXXS,color:k.Error,children:u})]})}),(m??[]).map((e,i)=>{const a=i+1,o=f&&(l=b,r=e,!!l?.processPid&&qx({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Qx,{...e,overrideProcessNum:a,isJumpToTarget:o},`pod-container-${n}-process-${a}`)})]})})},ow=({podName:e,namespace:i,hasRestarted:n})=>{const o=a(()=>({title:ke.DEBUG_COMMANDS,titleSize:C.XS}),[]),l=a(()=>[{label:ke.GET_POD_YAML,value:`kubectl get pod ${e} -n ${i} -o yaml`},{label:ke.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${i}`},{label:ke.GET_POD_LOGS,value:`kubectl logs ${e} -n ${i}${n?" -p":""}`}],[e,i,n]);return t(Mn,{bgTint:"800",richTitle:o,withCollapse:!0,children:l.map(({label:e,value:i})=>t(ra,{bgTint:"700",label:e,value:i},e))})},lw=({source:n,onClickRestartPod:o})=>{const{jumpToTarget:l}=(()=>{const e=g(ew);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===jx.Pods?l:null,s=n?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),p=a(()=>({title:ke.PODS,badge:{label:s.length}}),[s.length]);return t($,{$gap:12,children:c?e(i,{children:[t(Kx,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(Mn,{bgTint:"1000",richTitle:p,children:s.map(i=>{const a=r?.podName===i.podName,l=a&&!r?.containerName;return e(Hx,{...i,namespace:n.id.namespace,onClickRestartPod:o,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(ow,{podName:i.podName,namespace:n.id.namespace,hasRestarted:d}),t(iw,{podContainers:i.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${i.podName}`)})})]}):t(oi,{$height:"70vh",children:t(Z,{title:ke.NO_RUNNING_PODS,subTitle:ke.NO_RUNNING_PODS_SUBTITLE})})})},rw="user",sw=({source:i})=>{const n=a(()=>i.serviceName||i.id.name,[i]),{sourcesApi:o}=Jh(),{data:l,loading:r,refetch:s}=o.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(oi,r?{$height:"70vh",children:t(Ve,{withSpinner:!0})}:{$height:"70vh",children:t(Z,{subTitle:ke.COULD_NOT_FETCH_PEER_SOURCES})}):e(T,{$gap:16,$alignItems:"flex-start",children:[t(cw,{icon:Pu,title:ke.INBOUND,subTitle:ke.INBOUND_DESCRIPTION(n),onRefresh:s,items:c?.inbound??[]}),t(cw,{icon:Xu,title:ke.OUTBOUND,subTitle:ke.OUTBOUND_DESCRIPTION(n),onRefresh:s,items:c?.outbound??[]})]})},cw=({icon:i,title:n,subTitle:o,onRefresh:r,items:s})=>{const[c,d]=l(""),p=a(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Mn,{bgTint:"1000",richTitle:{icon:i,title:n,titleSize:C.XS,subTitle:o,subTitleSize:C.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,leftIcon:th,onClick:r}}],children:[t(sa,{value:c,onChange:d,width:"100%"}),t(ca,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(oi,{$height:"50vh",children:t(Z,{icon:i,title:ke.NO_RESULTS,subTitle:ke.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(pw,{...e},`${n}-${e.serviceName}`)):[t(oi,{$height:"50vh",children:t(Z,{icon:i,title:`No ${n} connections yet`,subTitle:n===ke.INBOUND?ke.NO_INBOUND_CONNECTIONS_DESCRIPTION:ke.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},dw=f.div`
|
|
1177
1177
|
display: flex;
|
|
1178
1178
|
align-items: center;
|
|
1179
1179
|
justify-content: space-between;
|
|
@@ -1187,9 +1187,9 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1187
1187
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1188
1188
|
}
|
|
1189
1189
|
`}
|
|
1190
|
-
`,
|
|
1190
|
+
`,pw=({serviceName:i,isVirtual:n,nodeAttributes:o})=>{const l=da(e=>e.drawerEntityId),{items:r}=Jh().sourcesApi.useSources(),s=a(()=>r.find(e=>e.id.name===i||e.serviceName===i),[r,i]),c=a(()=>s&&JSON.stringify(pa(s))!==JSON.stringify(pa(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((o??[]).map(({key:e,value:t})=>[e,t]));return[ua({serviceName:i,attributes:e})]}if(i?.toLowerCase()===rw)return[rh];const e=s?ha(s):void 0;return e?.length?e:[lh]},[n,o,i,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=da.getState();e(ma(kn.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(dw,{onClick:p,$withClick:!!p,children:[e(T,{$gap:8,children:[t(ga,{icons:d}),t(w,{size:C.XXS,children:i})]}),n&&t(E,{status:ie.Info,label:ke.VIRTUAL,textSize:C.XXXS,invertColors:!0,tooltip:ke.VIRTUAL_TOOLTIP})]})},uw=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}},hw=({source:i})=>{const n=v(),{k8sManifestApi:r}=Jh(),[s,c]=l(!0),[d,u]=l(void 0),[h,g]=l(!0),[m,b]=l(void 0),[f,y]=l(!0),[S,x]=l({}),w=p(r);w.current=r,o(()=>{w.current.fetch({namespace:i.id.namespace,kind:i.id.kind,name:i.id.name}).then(({data:e})=>u(uw(e))).finally(()=>c(!1)),w.current.fetch({namespace:i.id.namespace,kind:ba.InstrumentationConfig,name:`${i.id.kind}-${i.id.name}`.toLowerCase()}).then(({data:e})=>b(uw(e))).finally(()=>g(!1))},[i.id.namespace,i.id.kind,i.id.name]);const C=a(()=>(i.pods??[]).map(e=>e.podName).join(","),[i.pods]);o(()=>{if(Object.keys(S).length>0)return;const e=C?C.split(","):[];if(0===e.length)return x({}),void y(!1);let t=!1;return y(!0),Promise.all(e.map(async e=>{const{data:t}=await w.current.fetch({namespace:i.id.namespace,kind:ba.Pod,name:e});return[e,uw(t)]})).then(e=>{t||x(Object.fromEntries(e))}).finally(()=>{t||y(!1)}),()=>{t=!0}},[S,C,i.id.namespace]);const k=a(()=>[{label:ke.DESCRIBE_POD,value:`kubectl describe ${i.id.kind} ${i.id.name} -n ${i.id.namespace}`},{label:ke.GET_POD_YAML,value:`kubectl get ${i.id.kind} ${i.id.name} -n ${i.id.namespace} -o yaml`},{label:ke.GET_POD_YAML,value:`kubectl get ${ba.InstrumentationConfig} ${i.id.kind}-${i.id.name} -n ${i.id.namespace} -o yaml`}],[i.id.kind,i.id.name,i.id.namespace]);return e(Mn,{bgTint:"1000",children:[t(Mn,{bgTint:"900",richTitle:{icon:sh,title:ke.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:k.map(({label:e,value:i},n)=>t(ra,{label:e,value:i},`debug-cmd-${n}-${e}`))}),s?t(A,{size:1}):t(gm,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`${i.id.kind} YAML`,yaml:d}),h?t(A,{size:1}):t(gm,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m}),i.pods?.map(e=>f?t(A,{size:1},e.podName):t(gm,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:S[e.podName]},e.podName))]})},gw=({title:i,children:n})=>e($,{$gap:8,children:[t(w,{size:C.XXXS,color:k.Secondary,children:i}),n]}),mw=({source:i})=>{const n=a(()=>{const[e,t]=va(i.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[i]);return t(gw,{title:ke.THROUGHPUT_LAST_10_SECONDS,children:e(T,{$alignItems:"flex-end",$gap:4,children:[t(w,{size:C.L,children:n.value}),t(w,{size:C.XS,variant:Tn.Span,children:n.units})]})})},bw=({source:i})=>{const{CopyButton:n}=En();return t(gw,{title:ke.NAMESPACE,children:e(T,{children:[t(Xi,{variant:_i.Blue,label:i.id.namespace}),t(n,{value:i.id.namespace})]})})},fw=({source:i})=>{const{CopyButton:n}=En(),a=i.id.region;return a?t(gw,{title:ke.REGION,children:e(T,{children:[t(Xi,{variant:_i.Blue,label:a}),t(n,{value:a})]})}):null},vw=({source:e})=>{const i=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(gw,{title:ke.ENABLED,children:t(T,{children:t(Xi,{variant:i?_i.Green:_i.Default,label:i?ke.ENABLED:ke.DISABLED})})})},yw=({source:e,label:i})=>t(gw,{title:ke.KIND,children:t(T,{children:t(Xi,{variant:_i.Blue,label:i||e.id.kind})})}),Sw=({source:i})=>{const{CopyButton:n}=En();return t(gw,{title:ke.NAME,children:e(T,{children:[t(Xi,{variant:_i.Blue,label:i.id.name}),t(n,{value:i.id.name})]})})},xw=({source:i})=>{const{CopyButton:n}=En(),a=i.serviceName||i.id.name;return t(gw,{title:ke.SERVICE_NAME,children:e(T,{children:[t(Xi,{variant:_i.Blue,label:a}),t(n,{value:a})]})})},ww=({source:i})=>{const{isK8s:n,isConnector:o}=Vp(),l=a(()=>fa(i.id.kind),[i.id.kind]);return t(Mn,{children:e(T,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[n&&t(mw,{source:i}),t(vw,{source:i}),o&&t(fw,{source:i}),n&&t(bw,{source:i}),t(yw,{source:i,label:l}),t(Sw,{source:i}),!n&&t(xw,{source:i})]})})},Cw=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Mn,{bgTint:"900",children:t(Kx,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,kw=({source:e})=>{const i=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?ya(e.workloadOdigosHealthStatus.status):ie.Unknown,title:Pn(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return i?t(Xn,{...i,width:"100%"}):null},Tw=h(null),Iw=f.div`
|
|
1191
1191
|
position: relative;
|
|
1192
|
-
|
|
1192
|
+
`,$w=({children:e})=>{const i=p(null);return t(Iw,{ref:i,children:t(Tw.Provider,{value:i,children:e})})},Nw=f.div`
|
|
1193
1193
|
position: fixed;
|
|
1194
1194
|
top: ${({$coords:e})=>e.top}px;
|
|
1195
1195
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -1203,25 +1203,25 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1203
1203
|
padding: 12px 16px;
|
|
1204
1204
|
border-radius: 12px;
|
|
1205
1205
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
1206
|
-
`,
|
|
1206
|
+
`,Aw=f.div`
|
|
1207
1207
|
display: flex;
|
|
1208
1208
|
align-items: flex-end;
|
|
1209
1209
|
justify-content: space-between;
|
|
1210
1210
|
gap: 8px;
|
|
1211
|
-
`,
|
|
1211
|
+
`,Ow=f.div`
|
|
1212
1212
|
flex: 1;
|
|
1213
|
-
|
|
1213
|
+
`,Ew=({width:i,onClose:n,onSave:a,saveTooltip:o,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const b=v(),f=g(Tw),[y,S]=l(null);return Sa(f??{current:null},n),m(()=>{const e=f?.current?.getBoundingClientRect();e&&S({top:e.bottom+4,right:window.innerWidth-e.left-24})},[f]),y?Lm(e(Nw,{$coords:y,$width:i,"data-ignore-outside-click":"true",children:[e($,{$gap:4,children:[t(w,{size:C.XXS,children:c}),t(w,{size:C.XXXS,color:k.Secondary,children:d})]}),e(Aw,{children:[t(Ow,{children:u}),e(T,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(H,{variant:K.Secondary,onClick:r,leftIcon:ku,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:W.S,textColor:b.v2.colors.red[500]}),t(H,{variant:K.Primary,onClick:a,leftIcon:Fu,tooltip:o,hideTooltipIcon:!0,iconSize:16,size:W.S})]})]}),t("div",{children:t(te,{status:ie.Warning,message:p})})]}),document.body):null},Dw=({language:i,overridden:n,onOverride:o,defaultValues:r})=>{const{tier:s}=Vp(),{formData:c,handleFormChange:d,resetFormData:p}=Gn(r),u=a(()=>{if(!i)return[];const e=xa[i].community,t=s===wa.Onprem?xa[i].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))},[i,s]),[h,g]=l(!1),[m,b]=l(!1),f=()=>{h||(m&&p(),b(e=>!e))};return e(T,{$gap:4,$alignItems:"center",children:[n?t(E,{status:ie.Info,invertColors:!0,label:ke.OVERIDDEN}):null,e($w,{children:[t(ce,{text:ke.OVERRIDE_OTEL_DISTRO_NAME,children:t(bn,{icon:Au,onClick:f})}),m&&t(Ew,{width:"500px",onClose:f,onSave:async()=>{g(!0),await o(c),g(!1),f()},saveTooltip:ke.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await o({otelDistroName:null}),g(!1),f()},deleteTooltip:ke.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:ke.OVERRIDE_OTEL_DISTRO_NAME,subTitle:ke.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:ke.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(Me,{label:ke.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},zw=({overridden:i,onOverride:n,defaultValues:o,originalValues:r})=>{const{addNotification:s}=Yn(),{formData:c,handleFormChange:d,resetFormData:p}=Gn(o),u=a(()=>Ca.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,g]=l(!1),[m,b]=l(!1),f=()=>{h||(m&&p(),b(e=>!e))};return e(T,{children:[i?t(E,{status:ie.Info,invertColors:!0,label:ke.OVERIDDEN}):null,e($w,{children:[t(ce,{text:ke.OVERRIDE_RUNTIME_DETAILS,children:t(bn,{icon:Au,onClick:f})}),m&&t(Ew,{width:"500px",onClose:f,onSave:async()=>{!c.version||ka(c.version)?(g(!0),await n(c),g(!1),f()):s({type:ie.Warning,message:be.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:ke.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await n({language:null,version:""}),g(!1),f()},deleteTooltip:ke.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:ke.OVERRIDE_RUNTIME_DETAILS,subTitle:ke.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:ke.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(T,{$gap:8,children:[t(Me,{label:ke.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${r.language||"none"}`}),t(Y,{label:ke.RUNTIME_VERSION,placeholder:ke.VERSION_PLACEHOLDER,value:c.version??"",onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},Rw=f.div`
|
|
1214
1214
|
display: flex;
|
|
1215
1215
|
flex-direction: column;
|
|
1216
1216
|
gap: 10px;
|
|
1217
1217
|
padding: 10px 12px 10px 20px;
|
|
1218
1218
|
border-radius: 8px;
|
|
1219
1219
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1220
|
-
`,
|
|
1220
|
+
`,Pw=f.div`
|
|
1221
1221
|
display: flex;
|
|
1222
1222
|
flex-wrap: wrap;
|
|
1223
1223
|
gap: 12px 24px;
|
|
1224
|
-
`,
|
|
1224
|
+
`,Xw=({title:i,children:n})=>e($,{$gap:4,children:[t(w,{size:C.XXXS,color:k.Secondary,children:i}),n]}),Lw=({processes:i})=>{const n=a(()=>[...i].sort((e,t)=>e.pid-t.pid),[i]);return n.length?e($,{$gap:6,children:[t(w,{size:C.XXXS,color:k.Secondary,children:`${ke.PROCESSES} (${n.length})`}),n.map(i=>{const n=i.exe?.trim()||null,a=i.cmdline?.trim()||null;return e(Rw,{children:[t(Pw,{children:t(Xw,{title:ke.PROCESS_PID,children:t(w,{size:C.XS,children:String(i.pid)})})}),n?t(ra,{label:ke.EXECUTABLE,value:n,bgTint:"900"}):null,a&&a!==n?t(ra,{label:ke.COMMAND,value:a,bgTint:"900"}):null]},i.pid)})]}):null},_w=f.div`
|
|
1225
1225
|
display: flex;
|
|
1226
1226
|
flex-direction: column;
|
|
1227
1227
|
align-self: stretch;
|
|
@@ -1229,14 +1229,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1229
1229
|
padding: 8px 12px;
|
|
1230
1230
|
border-radius: 8px;
|
|
1231
1231
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1232
|
-
`,
|
|
1232
|
+
`,Mw=f.div`
|
|
1233
1233
|
display: flex;
|
|
1234
1234
|
align-items: center;
|
|
1235
1235
|
justify-content: center;
|
|
1236
1236
|
padding: 8px;
|
|
1237
1237
|
border-radius: 10px;
|
|
1238
1238
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1239
|
-
`,
|
|
1239
|
+
`,Fw=e=>{if(!e)return Ta.Unknown;const t=e.trim().toLowerCase();return{go:Ta.Go,golang:Ta.Go,javascript:Ta.JavaScript,js:Ta.JavaScript,node:Ta.JavaScript,nodejs:Ta.JavaScript,typescript:Ta.JavaScript,python:Ta.Python,java:Ta.Java,dotnet:Ta.DotNet,csharp:Ta.CSharp,php:Ta.Php,ruby:Ta.Ruby,rust:Ta.Rust,swift:Ta.Swift,elixir:Ta.Elixir}[t]??Ta.Unknown},Bw=({source:i})=>{const n=v(),{isK8s:o,isVm:l}=Vp(),{sourcesApi:r}=Jh(),s=i.instrumentationReport,c=i.sourceConfig,d=l?s?.processes:null,p=a(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=a(()=>{const e=Fw(s?.runtimeLanguage);return e!==Ta.Unknown?e:i.runtimeInfo?.detectedLanguages?.[0]??Ta.Unknown},[s?.runtimeLanguage,i.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",g=a(()=>{const e=Fw(c?.runtimeOverride?.language);return{language:e!==Ta.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||h||void 0}},[c,u,h]),m=a(()=>!!c?.distroOverride?.otelDistroName,[c]),b=a(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),f=a(()=>{const{language:e,version:t}=g;return e!==Ta.Unknown||t?e!==Ta.Unknown&&t?`${e} • ${t}`:e!==Ta.Unknown?e:t||null:null},[g]),y=!f&&!p&&"Instrumenting"===s?.state,S=a(()=>y||g.language===Ta.Unknown?lh:la(g.language),[y,g.language]),x=a(()=>{const e=s?.state??"",t=s?.instrumented||"Instrumented"===e,i=c?.distroOverride?.otelDistroName?.trim()||s?.sdkType?.trim();return"Instrumenting"===e?{status:ie.Loading,label:Pn(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:ie.Disabled,leftIcon:Ru,label:Pn(e)||e}:"Error"===e?{status:ie.Error,leftIcon:Ru,label:"Error"}:t?{status:ie.Success,leftIcon:zu,label:i?`Instrumented | ${i}`:"Instrumented"}:{status:ie.Disabled,leftIcon:Ru,label:ke.UNINSTRUMENTED}},[s,c]),k=e=>r.update(i.id,{...m?b:{},...p?{language:g.language!==Ta.Unknown?g.language:void 0,version:g.version}:{},...e});return o?null:s?t(Mn,{bgTint:"1000",richTitle:{title:ke.INSTRUMENTATION,tooltip:ke.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t($,{$gap:8,children:e(_w,{children:[e(T,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(T,{$gap:8,$alignItems:"center",children:[t(Mw,{children:t(S,{size:24,fill:y||g.language===Ta.Unknown?n.v2.colors.grey[400]:void 0})}),t(w,{children:i.id.name}),y?t(Xi,{variant:_i.Loader,label:ke.DETECTING_RUNTIME_INFO}):f?t(Xi,{variant:_i.Blue,label:f}):null,t(zw,{overridden:p,onOverride:k,defaultValues:{language:g.language!==Ta.Unknown?g.language:void 0,version:g.version||""},originalValues:{language:u!==Ta.Unknown?u:void 0,version:h}})]}),e(T,{$gap:8,$alignItems:"center",children:[t(E,{...x,textSize:C.XXXS}),t(Dw,{language:g.language!==Ta.Unknown?g.language:null,overridden:m,onOverride:k,defaultValues:b})]})]}),d?.length?t(Lw,{processes:d}):null]})})}):null},Vw="100%",Uw=f(T)`
|
|
1240
1240
|
@media (max-width: 1099px) {
|
|
1241
1241
|
flex-direction: column;
|
|
1242
1242
|
|
|
@@ -1244,12 +1244,12 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1244
1244
|
width: 100%;
|
|
1245
1245
|
}
|
|
1246
1246
|
}
|
|
1247
|
-
`,
|
|
1247
|
+
`,Gw=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Pn(e):`${t} ${Pn(e)}`:t,jw=f(T)`
|
|
1248
1248
|
width: fit-content;
|
|
1249
1249
|
padding: 2px 6px;
|
|
1250
1250
|
border-radius: 8px;
|
|
1251
1251
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
1252
|
-
`,
|
|
1252
|
+
`,Hw=({overview:i,status:n})=>{const a=v(),o=i?[{id:"applied",count:i.totalAgentAppliedPods,ok:i.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:i.totalAgentOutOfDatePods,ok:i.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:i.totalAgentNotAppliedPods,ok:i.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return o.length?t(jw,{$gap:12,$wrap:"wrap",children:o.map(({id:o,count:l,ok:r,label:s})=>{const c=r?ie.Success:n,d=$a(c,a);return e(T,{$gap:2,children:[t(d,{size:16,fill:Ia(a,c,"300")}),t(w,{size:C.XXXS,color:k.Secondary,children:`${l}/${i?.totalPods??0} ${s}`})]},o)})}):null},Ww=({changedTime:e})=>{const{formatTimeAgo:i}=qn();return t(w,{size:C.XXXS,color:k.Disable,nowrap:!0,children:`Agent Assignment Updated · ${i(e)}`})},Kw=({source:i,onClickRollout:n,onClickRollback:o})=>{const l=i.rollout?.podsManifestInjectionStatus??i.conditions?.rollout,r=a(()=>{const{status:e,reasonEnum:a,message:o,actionItems:r}=l||{},s=ia(e);if(!s)return null;const c=Gw(a,ke.ROLLOUT),d=o,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:ch,onClick:n}]);return{status:s,title:c,subTitle:d,details:t(Hw,{overview:i.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:i.rollout?.agentsMetaHashChangedTime?t(Ww,{changedTime:i.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[i.rollout,l,n]),s=a(()=>{const{status:e,reasonEnum:t,message:n,actionItems:a}=i.autoRollback?.autoRollbackStatus||{},l=ia(e);if(!l)return null;const r=Gw(t,ke.ROLLBACK),s=n,c=(a??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:th,onClick:o}]);return c.length||l===ie.Success||c.push({"data-id":"rollback-action",label:ke.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:th,onClick:o}),{status:l,title:r,subTitle:s,actionButtons:c}},[i,o]);return r||s?e(Uw,{$gap:12,$alignItems:"stretch",children:[r&&t(Xn,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":Vw,...r}),s&&t(Xn,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":Vw,...s})]}):null},Yw="Instrumented",Jw=({source:e})=>{const{isK8s:i}=Vp(),{containers:n,containersRichTitle:o}=a(()=>{const t=e?.conditions?.runtimeDetection,n=i?`${e.id.kind} ${ke.CONTAINERS}`:ke.CONTAINERS;return{containers:e?.containers??[],containersRichTitle:{title:n,tooltip:t?.message||ke.DETECTED_CONTAINERS_DESCRIPTION,badge:ia(t?.status)===ie.Loading?{status:ie.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,i]);return n.length?t(Mn,{bgTint:"1000",richTitle:o,withCollapse:!0,collapseIsDefaultOpen:!0,children:t($,{$gap:8,children:n.map(i=>i&&t(eC,{...i,sourceId:e.id},`source-container-${i.containerName}`))})}):null},qw=f.div`
|
|
1253
1253
|
display: flex;
|
|
1254
1254
|
flex-direction: column;
|
|
1255
1255
|
align-self: stretch;
|
|
@@ -1257,48 +1257,48 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1257
1257
|
padding: 8px 12px;
|
|
1258
1258
|
border-radius: 8px;
|
|
1259
1259
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1260
|
-
`,
|
|
1260
|
+
`,Zw=f.div`
|
|
1261
1261
|
display: flex;
|
|
1262
1262
|
align-items: center;
|
|
1263
1263
|
justify-content: center;
|
|
1264
1264
|
padding: 8px;
|
|
1265
1265
|
border-radius: 10px;
|
|
1266
1266
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1267
|
-
`,
|
|
1267
|
+
`,Qw=f.div`
|
|
1268
1268
|
display: flex;
|
|
1269
1269
|
flex-direction: column;
|
|
1270
1270
|
gap: 12px;
|
|
1271
1271
|
padding: 8px 12px;
|
|
1272
1272
|
border-radius: 8px;
|
|
1273
1273
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1274
|
-
`,
|
|
1274
|
+
`,eC=({sourceId:i,...n})=>{const{containerName:o,runtimeInfo:r,agentEnabled:s,overrides:c}=n,d=v(),{isK8s:p}=Vp(),{sourcesApi:u}=Jh(),[h,g]=l(!1),m=a(()=>!!c?.runtimeInfo?.language||!!c?.runtimeInfo?.runtimeVersion,[c]),b=a(()=>({language:oa(n),version:Na(n)||""}),[n]),f=a(()=>!!c?.otelDistroName,[c]),y=a(()=>({otelDistroName:c?.otelDistroName||n.agentEnabled?.otelDistroName}),[c,n]),S=a(()=>!r&&!m,[r,m]),x=a(()=>S?lh:la(b.language),[S,b]),I=a(()=>{if(S)return"";const{language:e,version:t}=b;return`${e}${t?` • ${t}`:""}`},[S,b]),$=a(()=>{if(S)return{status:ie.Loading,label:ke.WAITING_FOR_RUNTIME_DETECTION};const e=s?.otelDistroName?.trim(),t=p?!!e:!!s?.agentEnabled;return{status:t?ie.Success:ie.Disabled,leftIcon:t?zu:Ru,label:t?e?`${Yw} | ${e}`:Yw:"Uninstrumented",tooltip:s?.agentEnabledStatus?.message}},[S,s,p]),N=e=>u.update(i,{containerName:o,...f?y:{},...m?b:{},...null!=c?.allowConcurrentAgents?{allowConcurrentAgents:c.allowConcurrentAgents}:{},...e}),A=(s?.agentEnabledStatus?.actionItems??[]).flatMap(e=>{let t;if(e.type===Aa.AllowConcurrentAgentsForContainer)t=!0;else{if(e.type!==Aa.DisallowConcurrentAgentsForContainer)return[];t=!1}return[{type:e.type,label:e.buttonText,onClick:t?()=>g(!0):()=>N({allowConcurrentAgents:!1})}]}),O=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(ke.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(ke.TAIL_SAMPLING),e},[n]);return e(qw,{children:[e(T,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(T,{$gap:8,$alignItems:"center",children:[t(Zw,{children:t(x,{size:24,fill:r?void 0:d.v2.colors.grey[400]})}),t(w,{children:o}),t(Xi,I?{variant:_i.Blue,label:I}:{variant:_i.Loader,label:ke.DETECTING_RUNTIME_INFO}),t(zw,{overridden:m,onOverride:N,defaultValues:b,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(T,{$gap:8,$alignItems:"center",children:[t(E,{...$,textSize:C.XXXS}),t(Dw,{language:b.language,overridden:f,onOverride:N,defaultValues:y})]})]}),s&&(!s.agentEnabled||A.length>0)&&!S?t(Qw,{children:e(T,{$gap:10,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(T,{$gap:10,$alignItems:"center",children:[t(Xi,{variant:_i.Pink,label:Pn(s.agentEnabledStatus?.reasonEnum)||ke.NO_AVAILABLE_AGENT}),t(w,{size:C.XXXS,color:k.Secondary,children:s?.agentEnabledStatus?.message})]}),A.map(e=>t(H,{"data-id":`container-action-${e.type}`,label:e.label,variant:K.Secondary,size:W.S,onClick:e.onClick},e.type))]})}):null,O.length>0&&t(Qw,{children:t(T,{$gap:16,$wrap:"wrap",children:O.map((e,i)=>t(E,{label:e,leftIcon:zu,status:ie.Success,invertColors:!0,useSecondaryTone:!0},`${o}-rule-${i}`))})}),t(Ce,{isOpen:h,title:"Run Odigos with other agents?",description:"Running multiple instrumentation agents in the same container is not recommended and may affect performance or reliability.",onClose:()=>g(!1),denyButton:{label:"Cancel",variant:K.Secondary,onClick:()=>g(!1)},approveButton:{label:"Run Odigos With Other Agents",variant:K.Primary,onClick:async()=>{await N({allowConcurrentAgents:!0}),g(!1)}}})]})},tC=f($)`
|
|
1275
1275
|
gap: 12px;
|
|
1276
1276
|
width: 100%;
|
|
1277
1277
|
min-width: 0;
|
|
1278
|
-
`,
|
|
1278
|
+
`,iC=f.div`
|
|
1279
1279
|
display: flex;
|
|
1280
1280
|
align-items: stretch;
|
|
1281
1281
|
gap: 10px;
|
|
1282
1282
|
width: 100%;
|
|
1283
1283
|
min-width: 0;
|
|
1284
|
-
`,
|
|
1284
|
+
`,nC=f.div`
|
|
1285
1285
|
display: flex;
|
|
1286
1286
|
flex: 2 1 0;
|
|
1287
1287
|
flex-direction: column;
|
|
1288
1288
|
gap: 12px;
|
|
1289
1289
|
min-width: 0;
|
|
1290
1290
|
padding: 12px 0;
|
|
1291
|
-
`,
|
|
1291
|
+
`,aC=f.div`
|
|
1292
1292
|
display: flex;
|
|
1293
1293
|
flex-direction: column;
|
|
1294
1294
|
gap: 8px;
|
|
1295
1295
|
width: 100%;
|
|
1296
|
-
`,
|
|
1296
|
+
`,oC=f.div`
|
|
1297
1297
|
display: flex;
|
|
1298
1298
|
align-items: center;
|
|
1299
1299
|
gap: 12px;
|
|
1300
1300
|
width: 100%;
|
|
1301
|
-
`,
|
|
1301
|
+
`,lC=f.div`
|
|
1302
1302
|
display: flex;
|
|
1303
1303
|
align-items: center;
|
|
1304
1304
|
justify-content: center;
|
|
@@ -1307,7 +1307,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1307
1307
|
height: 24px;
|
|
1308
1308
|
border-radius: 16px;
|
|
1309
1309
|
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
1310
|
-
`,
|
|
1310
|
+
`,rC=f.div`
|
|
1311
1311
|
display: flex;
|
|
1312
1312
|
flex: 3 1 0;
|
|
1313
1313
|
flex-direction: column;
|
|
@@ -1316,26 +1316,26 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1316
1316
|
border-radius: 12px;
|
|
1317
1317
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1318
1318
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1319
|
-
`,
|
|
1319
|
+
`,sC=f.div`
|
|
1320
1320
|
display: flex;
|
|
1321
1321
|
align-items: center;
|
|
1322
1322
|
justify-content: flex-end;
|
|
1323
1323
|
width: 100%;
|
|
1324
|
-
`,
|
|
1324
|
+
`,cC=f.div`
|
|
1325
1325
|
flex: 1;
|
|
1326
1326
|
width: 100%;
|
|
1327
1327
|
min-height: 160px;
|
|
1328
1328
|
max-height: 320px;
|
|
1329
1329
|
overflow: auto;
|
|
1330
1330
|
padding: 0 12px 12px;
|
|
1331
|
-
`,
|
|
1331
|
+
`,dC=f.pre`
|
|
1332
1332
|
margin: 0;
|
|
1333
1333
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
1334
1334
|
font-size: 12px;
|
|
1335
1335
|
line-height: 20px;
|
|
1336
1336
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
1337
1337
|
white-space: pre;
|
|
1338
|
-
`,
|
|
1338
|
+
`,pC=f.div`
|
|
1339
1339
|
display: flex;
|
|
1340
1340
|
flex-direction: column;
|
|
1341
1341
|
gap: 8px;
|
|
@@ -1343,14 +1343,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1343
1343
|
padding: 8px 12px;
|
|
1344
1344
|
border-radius: 8px;
|
|
1345
1345
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1346
|
-
`,
|
|
1346
|
+
`,uC=f.div`
|
|
1347
1347
|
display: flex;
|
|
1348
1348
|
flex-direction: column;
|
|
1349
1349
|
gap: 2px;
|
|
1350
1350
|
width: 100%;
|
|
1351
|
-
`,
|
|
1351
|
+
`,hC=f.span`
|
|
1352
1352
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
1353
|
-
`,
|
|
1353
|
+
`,gC=f.a`
|
|
1354
1354
|
color: ${({theme:e})=>e.v2.colors.purple[400]};
|
|
1355
1355
|
text-decoration: underline;
|
|
1356
1356
|
word-break: break-all;
|
|
@@ -1358,12 +1358,12 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1358
1358
|
&:hover {
|
|
1359
1359
|
color: ${({theme:e})=>e.v2.colors.purple[300]};
|
|
1360
1360
|
}
|
|
1361
|
-
`,pC=/(https?:\/\/[^\s)]+)/g,uC=e=>{const i=e.split(pC);return 1===i.length?e:i.map((e,i)=>/^https?:\/\//.test(e)?t(dC,{href:e,target:"_blank",rel:"noopener noreferrer",children:e},`note-link-${i}`):e)},hC=({source:i})=>{const n=v(),{CopyButton:o}=En(),{sourcesApi:r}=Hh(),[s,c]=l(null),{data:d,unsupported:p}=r.useInstrumentationInstructions(i.id),u=d?.instrumentationInstructions??null,h=a(()=>u?.documents??[],[u]),g=a(()=>h.find(e=>e.variant===s)??h[0],[h,s]);if(p||!u||!g)return null;const m="manual"===u.mode?.trim().toLowerCase(),b=g.unresolved??[];return t(Mn,{bgTint:"1000",withCollapse:!0,collapseIsDefaultOpen:m,richTitle:{title:ke.INSTRUMENTATION_INSTRUCTIONS_TITLE,subTitle:m?ke.INSTRUMENTATION_INSTRUCTIONS_MANUAL_SUBTITLE:ke.INSTRUMENTATION_INSTRUCTIONS_AUTOMATIC_SUBTITLE,subTitleWrap:!0},children:e(qw,{children:[h.length>1&&t(F,{"data-id":"instrumentation-instructions-variant",size:Zt.S,options:h.map(e=>({value:e.variant,label:e.variantLabel})),selected:g.variant,setSelected:c}),!!g.description&&t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Secondary,children:g.description}),e(Zw,{children:[g.steps.length>0&&e(Qw,{children:[t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Primary,children:ke.INSTRUMENTATION_INSTRUCTIONS_STEPS_HEADING}),t(eC,{children:g.steps.map((i,a)=>e(tC,{children:[t(iC,{children:t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:n.v2.colors.purple[200],children:a+1})}),t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Primary,children:i})]},`${g.id}-step-${a}`))})]}),!!g.content&&e(nC,{children:[t(aC,{children:t(o,{value:g.content})}),t(oC,{children:t(lC,{children:g.content})})]})]}),b.length>0&&e(rC,{children:[t(w,{size:C.XXS,weight:600,lineHeight:"20px",color:k.Primary,children:ke.INSTRUMENTATION_INSTRUCTIONS_INPUTS_HEADING}),b.map(i=>e(sC,{children:[t(w,{size:C.XXS,weight:600,lineHeight:"20px",color:k.Primary,children:t(cC,{children:i.placeholder})}),t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Secondary,children:i.description})]},`${g.id}-input-${i.placeholder}`))]}),u.notes.length>0&&e(rC,{children:[t(w,{size:C.XXS,weight:600,lineHeight:"20px",color:k.Primary,children:ke.INSTRUMENTATION_INSTRUCTIONS_NOTES_HEADING}),u.notes.map((e,i)=>t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Secondary,children:uC(e)},`instrumentation-note-${i}`))]})]})})},gC=({source:i,onClickRollout:n,onClickRollback:o})=>{const{isK8s:l,platformType:r,version:s}=Mp(),c=a(()=>Oa(r,s)?Rn(Ea(i.conditions)):[],[r,s,i.conditions]);return e($,{$gap:12,children:[t(vw,{source:i}),t(Sw,{source:i}),l&&t(Gw,{source:i,onClickRollout:n,onClickRollback:o}),!!c.length&&t(Vn,{conditions:c,title:ke.INSTRUMENTATION_LIFECYCLE}),t(Hw,{source:i}),!l&&!i.containers?.length&&t(Lw,{source:i}),!l&&t(hC,{source:i}),l&&t(yw,{source:i})]})},mC=({source:e})=>{const i=e.containers||[];return t(Mn,{bgTint:"1000",richTitle:{title:ke.INSTRUMENTED_LIBRARIES},children:i.length?i.map(e=>{const i=e.instrumentations||[];return t(Mn,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:i.length}},withCollapse:!0,collapseIsDefaultOpen:!!i?.length,children:i?.length?t($,{children:i.map((e,i)=>t(aa,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${i}-${e.name}`))}):t(Z,{title:"No libraries found"})},e.containerName)}):t(Z,{title:"No containers found"})})};function bC(e,t){const i=e.names[t];if(null==i)return"";if("string"==typeof i)return i;if("object"==typeof i&&"name"in i){const e=i.name;if("string"==typeof e)return e}return"number"==typeof i||"boolean"==typeof i?String(i):""}function fC(e){const t=Math.abs(e);return t>=1e9?`${vC(e/1e9)}s`:t>=1e6?`${vC(e/1e6)}ms`:t>=1e3?`${vC(e/1e3)}μs`:String(Math.round(e))}function vC(e){return e.toFixed(2).replace(/\.?0+$/,"")}function yC(e){const t=[];for(let i=0;i<e.levels.length;i++){const n=e.levels[i];let a=0;for(let e=0;e+3<n.length;e+=4){const o=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=a+o;t.push({level:i,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function SC(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function xC(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function wC(e,t,i){return((e,t)=>{const i=[];for(let n=0;n<=t.level;n++){let a;for(const i of e)if(i.level===n&&t.offset>=i.offset&&t.offset+t.size<=i.offset+i.size){a=i;break}if(!a)return i;i.push(a)}return i})(t,i).map(t=>bC(e,t.nameIndex))}function CC(e,t,i){if(0===i.length)return null;let n=null,a=null;for(let o=0;o<i.length;o++){const l=i[o];let r=null;for(const i of t)i.level===o&&bC(e,i.nameIndex)===l&&(n&&(i.offset<n.offset||i.offset+i.size>n.offset+n.size)||(!r||i.size>r.size)&&(r=i));if(!r)return null;n=r,a=r}return a}function kC(e,t){const i=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=i;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const i=n.get(e);if(i?.length)for(const e of i)for(const i of t)if(e.offset>=i.offset&&e.offset+e.size<=i.offset+i.size){a.push(e);break}}return a}function TC(e,t){const i=t.trim().toLowerCase();return!i||e.toLowerCase().includes(i)}function IC(e,t){let i=0;for(let t=0;t<e.length;t++)i=31*i+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[i%a.length]}var $C,NC;function AC(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function OC(e,t,i){for(const n of i)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function EC(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})($C||($C={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(NC||(NC={}));const DC=({flamebearer:i,maxRowPx:n,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:b,onResetZoom:f})=>{const y=v(),S=p(null),x=p(null),I=p({x:0,y:0}),[$,N]=l({w:0,h:0}),[A,O]=l(""),[E,D]=l(null),[z,R]=l([]),[P,X]=l(!1),[M,B]=l($C.Fit),[V,U]=l(NC.Fit),[G,j]=l(!1),Y=Math.max(1,Math.min(Math.floor($.w*M),8192)),J=Math.max(1,Math.min(Math.floor($.h*V),8192)),q=z.length>0?z[z.length-1]:null,Z=q?.size??i.numTicks,Q=a(()=>yC(i),[i]),ee=p({fb:i,rects:Q});o(()=>{const e=ee.current;e.fb!==i&&(ee.current={fb:i,rects:Q},R(t=>{if(0===t.length)return t;const n=((e,t,i,n,a)=>{const o=[];for(const l of a){const a=wC(e,t,l);if(0===a.length)break;const r=CC(i,n,a);if(!r)break;o.push(r)}return o})(e.fb,e.rects,i,Q,t);return n.length===t.length&&n.every((e,i)=>xC(e,t[i]))?t:n}))},[i,Q]),o(()=>{if(!b)return;if(!q)return void b(null);const e=kC(Q,q),t=new Set;for(const n of e){const e=bC(i,n.nameIndex);e&&t.add(e)}b([...t])},[q,i,Q,b]),m(()=>{const e=S.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();N({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),o(()=>{if(!P)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[P]),o(()=>(u?.(P),()=>{P&&u?.(!1)}),[P,u]);const te=a(()=>function(e,t,i,n,a,o={}){if(0===e.levels.length||t<2||i<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=o,d=c??yC(e);let p=l?kC(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(bC(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const i=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of i){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of i){const i=n.get(t.level+1);if(!i)continue;const o=i.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==o.length)continue;const l=o[0];l.size===t.size&&bC(e,l.nameIndex)===bC(e,t.nameIndex)&&a.add(SC(l))}if(0===a.size)return i;const o=[];for(const e of i){if(a.has(SC(e)))continue;let t=0;for(let i=0;i<e.level;i++){const o=n.get(i);if(!o)continue;const l=o.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(SC(l))&&t++}o.push({...e,level:e.level-t})}return o})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,g=l?.size??e.numTicks;if(g<=0)return null;const m=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,b=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(i/m,b)),v=a.trim(),y=f>8?1:0;return p.map(i=>{const n=i.level-u,a=(i.offset-h)/g*t,o=Math.max(i.size/g*t,1),l=n*f,r=Math.max(f-y,1),s=bC(e,i.nameIndex);return{...i,x:a,y:l,w:o,h:r,name:s,matchesSearch:TC(s,v)}})}(i,Y,J,n,r,{zoomRoot:q,shouldKeepName:s,collapseRecursive:G,allRects:Q}),[i,n,r,J,Y,q,s,G,Q]),ie=a(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(te?.length?r.trim()?te.filter(e=>e.matchesSearch):te:[]),[te,r]),ne=d(e=>{if(Y<2||J<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=OC((e.clientX-t.left)/t.width*Y,(e.clientY-t.top)/t.height*J,ie);if(n){const e=SC(n);D(e);const t=Z>0?(100*n.size/Z).toFixed(1):"0",a=i.numTicks>0?(100*n.size/i.numTicks).toFixed(1):"0";O(`${n.name}\ntotal ${fC(n.size)} (${t}% of view, ${a}% of profile) · self ${fC(n.self)}`)}else D(null),O("")},[ie,i.numTicks,J,Y,Z]),ae=d(e=>{ne(e)},[ne]),oe=d(()=>{D(null),O("")},[]),le=d(e=>{I.current={x:e.clientX,y:e.clientY}},[]),re=d(e=>{const{x:t,y:i}=I.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-i)>3)return;if(Y<2||J<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=OC((e.clientX-n.left)/n.width*Y,(e.clientY-n.top)/n.height*J,ie);if(!a)return;g?.(a.name);const o=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(a);R(e=>{const t=e.length>0?e[e.length-1]:null;return t&&xC(o,t)?e.slice(0,-1):[...e,o]})},[ie,J,Y,g]);m(()=>{const e=x.current;if(!e||Y<2||J<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(Y,J),a=Math.min(t,16384/n);e.width=Math.floor(Y*a),e.height=Math.floor(J*a),e.style.width=`${Y}px`,e.style.height=`${J}px`;const o=e.getContext("2d");o&&(o.setTransform(a,0,0,a,0,0),o.clearRect(0,0,Y,J),te?.length?((e,t,i,n,a,o,l,r)=>{const s=o.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,i);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:i,y:n,w:a,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=IC(s,o);e.fillStyle=u,e.fillRect(i,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(i+.5,n+.5),e.lineTo(i+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(i+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=AC(d,r),m=`${s} (${fC(d)}, ${g}%)`,b=o.v2.text.size.xs,f=8,v=5,y=26,S=Math.min(b,Math.floor(l-2));if(a>=y&&S>=f){e.font=`${S}px ${o.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,i+v,n+l/2),e.fillStyle=h,e.fillText(t,i+v,n+l/2))}}if(l)for(const t of n){if(SC(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:i,y:n,w:a,h:o}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(i+1,n+1,Math.max(a-2,0),Math.max(o-2,0));break}})(o,Y,J,te,r,y,E,i.numTicks):(o.fillStyle=y.v2.colors.silver[900],o.fillRect(0,0,Y,J)))},[te,i.numTicks,E,r,J,Y,y]);const se=d(()=>X(e=>!e),[]),de=i.numTicks>0?Math.max(0,Math.min(100,Math.round(Z/i.numTicks*100))):100,pe=a(()=>((e,t,i)=>{const n=i??yC(e),a=t?.offset??0,o=a+(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<a||e.offset+e.size>o||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(i,q,Q),[i,q,Q]),ue=null!==pe,he=z.length>0,ge=q?bC(i,q.nameIndex):"",me=d(()=>{R([]),f?.()},[f]),be=d(()=>R(e=>e.slice(0,-1)),[]),fe=d(()=>{pe&&R(e=>[...e,pe])},[pe]);return e("div",{style:P?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(T,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(L,{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:_.Left,size:Vi.S,value:G,onChange:j}),e(T,{$gap:8,children:[e(T,{children:[t(H,{variant:K.Secondary,size:W.S,label:"Reset zoom",leftIcon:rh,onClick:me,disabled:!z.length}),t(H,{variant:K.Secondary,size:W.S,iconSize:20,leftIcon:sh,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!he,onClick:be}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(w,{size:C.XXS,color:k.Secondary,nowrap:!0,align:"center",children:`${de}%`})}),t(H,{variant:K.Secondary,size:W.S,iconSize:20,leftIcon:wu,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ue,onClick:fe})]}),e(T,{children:[t(ce,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(F,{variant:Da.Filled,options:[{value:$C.Fit,label:"W: Fit"},{value:$C.X10,label:"10x"}],selected:M,setSelected:B})}),t(ce,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(F,{variant:Da.Filled,options:[{value:NC.Fit,label:"H: Fit"},{value:NC.X10,label:"10x"}],selected:V,setSelected:U})})]}),t(H,{variant:K.Secondary,size:W.S,iconSize:24,leftIcon:P?Xu:ch,tooltip:P?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:se})]})]}),t(ce,{fullWidth:!0,keepAlive:!0,text:A,children:t("div",{ref:S,style:{flex:1,minWidth:0,width:"100%",height:P?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:M>1?"auto":"hidden",overflowY:V>1?"auto":"hidden"},children:t("div",{style:{width:Y||"100%",height:J||"100%",position:"relative"},children:t("canvas",{ref:x,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:le,onPointerMove:ae,onPointerLeave:oe,onClick:re})})})})}),e(T,{$justifyContent:"space-between",children:[t(w,q?{size:C.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ge} • ${fC(Z)} samples in view`}:{size:C.XXXS,color:y.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(w,{size:C.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${EC(h.totalBytesUsed)} / ${EC(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},zC=f($)`
|
|
1361
|
+
`,mC=/(https?:\/\/[^\s)]+)/g,bC=e=>{const i=e.split(mC);return 1===i.length?e:i.map((e,i)=>/^https?:\/\//.test(e)?t(gC,{href:e,target:"_blank",rel:"noopener noreferrer",children:e},`note-link-${i}`):e)},fC=({source:i})=>{const n=v(),{CopyButton:o}=En(),{sourcesApi:r}=Jh(),[s,c]=l(null),{data:d,unsupported:p}=r.useInstrumentationInstructions(i.id),u=d?.instrumentationInstructions??null,h=a(()=>u?.documents??[],[u]),g=a(()=>h.find(e=>e.variant===s)??h[0],[h,s]);if(p||!u||!g)return null;const m="manual"===u.mode?.trim().toLowerCase(),b=g.unresolved??[];return t(Mn,{bgTint:"1000",withCollapse:!0,collapseIsDefaultOpen:m,richTitle:{title:ke.INSTRUMENTATION_INSTRUCTIONS_TITLE,subTitle:m?ke.INSTRUMENTATION_INSTRUCTIONS_MANUAL_SUBTITLE:ke.INSTRUMENTATION_INSTRUCTIONS_AUTOMATIC_SUBTITLE,subTitleWrap:!0},children:e(tC,{children:[h.length>1&&t(F,{"data-id":"instrumentation-instructions-variant",size:Zt.S,options:h.map(e=>({value:e.variant,label:e.variantLabel})),selected:g.variant,setSelected:c}),!!g.description&&t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Secondary,children:g.description}),e(iC,{children:[g.steps.length>0&&e(nC,{children:[t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Primary,children:ke.INSTRUMENTATION_INSTRUCTIONS_STEPS_HEADING}),t(aC,{children:g.steps.map((i,a)=>e(oC,{children:[t(lC,{children:t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:n.v2.colors.purple[200],children:a+1})}),t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Primary,children:i})]},`${g.id}-step-${a}`))})]}),!!g.content&&e(rC,{children:[t(sC,{children:t(o,{value:g.content})}),t(cC,{children:t(dC,{children:g.content})})]})]}),b.length>0&&e(pC,{children:[t(w,{size:C.XXS,weight:600,lineHeight:"20px",color:k.Primary,children:ke.INSTRUMENTATION_INSTRUCTIONS_INPUTS_HEADING}),b.map(i=>e(uC,{children:[t(w,{size:C.XXS,weight:600,lineHeight:"20px",color:k.Primary,children:t(hC,{children:i.placeholder})}),t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Secondary,children:i.description})]},`${g.id}-input-${i.placeholder}`))]}),u.notes.length>0&&e(pC,{children:[t(w,{size:C.XXS,weight:600,lineHeight:"20px",color:k.Primary,children:ke.INSTRUMENTATION_INSTRUCTIONS_NOTES_HEADING}),u.notes.map((e,i)=>t(w,{size:C.XXS,weight:400,lineHeight:"20px",color:k.Secondary,children:bC(e)},`instrumentation-note-${i}`))]})]})})},vC=({source:i,onClickRollout:n,onClickRollback:o})=>{const{isK8s:l,platformType:r,version:s}=Vp(),c=a(()=>Oa(r,s)?Rn(Ea(i.conditions)):[],[r,s,i.conditions]);return e($,{$gap:12,children:[t(ww,{source:i}),t(kw,{source:i}),l&&t(Kw,{source:i,onClickRollout:n,onClickRollback:o}),!!c.length&&t(Vn,{conditions:c,title:ke.INSTRUMENTATION_LIFECYCLE}),t(Jw,{source:i}),!l&&!i.containers?.length&&t(Bw,{source:i}),!l&&t(fC,{source:i}),l&&t(Cw,{source:i})]})},yC=({source:e})=>{const i=e.containers||[];return t(Mn,{bgTint:"1000",richTitle:{title:ke.INSTRUMENTED_LIBRARIES},children:i.length?i.map(e=>{const i=e.instrumentations||[];return t(Mn,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:i.length}},withCollapse:!0,collapseIsDefaultOpen:!!i?.length,children:i?.length?t($,{children:i.map((e,i)=>t(aa,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${i}-${e.name}`))}):t(Z,{title:"No libraries found"})},e.containerName)}):t(Z,{title:"No containers found"})})};function SC(e,t){const i=e.names[t];if(null==i)return"";if("string"==typeof i)return i;if("object"==typeof i&&"name"in i){const e=i.name;if("string"==typeof e)return e}return"number"==typeof i||"boolean"==typeof i?String(i):""}function xC(e){const t=Math.abs(e);return t>=1e9?`${wC(e/1e9)}s`:t>=1e6?`${wC(e/1e6)}ms`:t>=1e3?`${wC(e/1e3)}μs`:String(Math.round(e))}function wC(e){return e.toFixed(2).replace(/\.?0+$/,"")}function CC(e){const t=[];for(let i=0;i<e.levels.length;i++){const n=e.levels[i];let a=0;for(let e=0;e+3<n.length;e+=4){const o=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=a+o;t.push({level:i,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function kC(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function TC(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function IC(e,t,i){return((e,t)=>{const i=[];for(let n=0;n<=t.level;n++){let a;for(const i of e)if(i.level===n&&t.offset>=i.offset&&t.offset+t.size<=i.offset+i.size){a=i;break}if(!a)return i;i.push(a)}return i})(t,i).map(t=>SC(e,t.nameIndex))}function $C(e,t,i){if(0===i.length)return null;let n=null,a=null;for(let o=0;o<i.length;o++){const l=i[o];let r=null;for(const i of t)i.level===o&&SC(e,i.nameIndex)===l&&(n&&(i.offset<n.offset||i.offset+i.size>n.offset+n.size)||(!r||i.size>r.size)&&(r=i));if(!r)return null;n=r,a=r}return a}function NC(e,t){const i=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=i;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const i=n.get(e);if(i?.length)for(const e of i)for(const i of t)if(e.offset>=i.offset&&e.offset+e.size<=i.offset+i.size){a.push(e);break}}return a}function AC(e,t){const i=t.trim().toLowerCase();return!i||e.toLowerCase().includes(i)}function OC(e,t){let i=0;for(let t=0;t<e.length;t++)i=31*i+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[i%a.length]}var EC,DC;function zC(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function RC(e,t,i){for(const n of i)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function PC(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(EC||(EC={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(DC||(DC={}));const XC=({flamebearer:i,maxRowPx:n,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:b,onResetZoom:f})=>{const y=v(),S=p(null),x=p(null),I=p({x:0,y:0}),[$,N]=l({w:0,h:0}),[A,O]=l(""),[E,D]=l(null),[z,R]=l([]),{isFullscreen:P,toggle:X}=Da({onChange:u}),[M,B]=l(EC.Fit),[V,U]=l(DC.Fit),[G,j]=l(!1),Y=Math.max(1,Math.min(Math.floor($.w*M),8192)),J=Math.max(1,Math.min(Math.floor($.h*V),8192)),q=z.length>0?z[z.length-1]:null,Z=q?.size??i.numTicks,Q=a(()=>CC(i),[i]),ee=p({fb:i,rects:Q});o(()=>{const e=ee.current;e.fb!==i&&(ee.current={fb:i,rects:Q},R(t=>{if(0===t.length)return t;const n=((e,t,i,n,a)=>{const o=[];for(const l of a){const a=IC(e,t,l);if(0===a.length)break;const r=$C(i,n,a);if(!r)break;o.push(r)}return o})(e.fb,e.rects,i,Q,t);return n.length===t.length&&n.every((e,i)=>TC(e,t[i]))?t:n}))},[i,Q]),o(()=>{if(!b)return;if(!q)return void b(null);const e=NC(Q,q),t=new Set;for(const n of e){const e=SC(i,n.nameIndex);e&&t.add(e)}b([...t])},[q,i,Q,b]),m(()=>{const e=S.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect();N({w:Math.floor(t.width),h:Math.floor(t.height)})};t();const i=new ResizeObserver(t);return i.observe(e),()=>i.disconnect()},[P]);const te=a(()=>function(e,t,i,n,a,o={}){if(0===e.levels.length||t<2||i<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=o,d=c??CC(e);let p=l?NC(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(SC(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const i=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of i){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of i){const i=n.get(t.level+1);if(!i)continue;const o=i.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==o.length)continue;const l=o[0];l.size===t.size&&SC(e,l.nameIndex)===SC(e,t.nameIndex)&&a.add(kC(l))}if(0===a.size)return i;const o=[];for(const e of i){if(a.has(kC(e)))continue;let t=0;for(let i=0;i<e.level;i++){const o=n.get(i);if(!o)continue;const l=o.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(kC(l))&&t++}o.push({...e,level:e.level-t})}return o})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,g=l?.size??e.numTicks;if(g<=0)return null;const m=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,b=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(i/m,b)),v=a.trim(),y=f>8?1:0;return p.map(i=>{const n=i.level-u,a=(i.offset-h)/g*t,o=Math.max(i.size/g*t,1),l=n*f,r=Math.max(f-y,1),s=SC(e,i.nameIndex);return{...i,x:a,y:l,w:o,h:r,name:s,matchesSearch:AC(s,v)}})}(i,Y,J,n,r,{zoomRoot:q,shouldKeepName:s,collapseRecursive:G,allRects:Q}),[i,n,r,J,Y,q,s,G,Q]),ie=a(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(te?.length?r.trim()?te.filter(e=>e.matchesSearch):te:[]),[te,r]),ne=d(e=>{if(Y<2||J<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=RC((e.clientX-t.left)/t.width*Y,(e.clientY-t.top)/t.height*J,ie);if(n){const e=kC(n);D(e);const t=Z>0?(100*n.size/Z).toFixed(1):"0",a=i.numTicks>0?(100*n.size/i.numTicks).toFixed(1):"0";O(`${n.name}\ntotal ${xC(n.size)} (${t}% of view, ${a}% of profile) · self ${xC(n.self)}`)}else D(null),O("")},[ie,i.numTicks,J,Y,Z]),ae=d(e=>{ne(e)},[ne]),oe=d(()=>{D(null),O("")},[]),le=d(e=>{I.current={x:e.clientX,y:e.clientY}},[]),re=d(e=>{const{x:t,y:i}=I.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-i)>3)return;if(Y<2||J<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=RC((e.clientX-n.left)/n.width*Y,(e.clientY-n.top)/n.height*J,ie);if(!a)return;g?.(a.name);const o=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(a);R(e=>{const t=e.length>0?e[e.length-1]:null;return t&&TC(o,t)?e.slice(0,-1):[...e,o]})},[ie,J,Y,g]);m(()=>{const e=x.current;if(!e||Y<2||J<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(Y,J),a=Math.min(t,16384/n);e.width=Math.floor(Y*a),e.height=Math.floor(J*a),e.style.width=`${Y}px`,e.style.height=`${J}px`;const o=e.getContext("2d");o&&(o.setTransform(a,0,0,a,0,0),o.clearRect(0,0,Y,J),te?.length?((e,t,i,n,a,o,l,r)=>{const s=o.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,i);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:i,y:n,w:a,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=OC(s,o);e.fillStyle=u,e.fillRect(i,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(i+.5,n+.5),e.lineTo(i+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(i+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=zC(d,r),m=`${s} (${xC(d)}, ${g}%)`,b=o.v2.text.size.xs,f=8,v=5,y=26,S=Math.min(b,Math.floor(l-2));if(a>=y&&S>=f){e.font=`${S}px ${o.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,i+v,n+l/2),e.fillStyle=h,e.fillText(t,i+v,n+l/2))}}if(l)for(const t of n){if(kC(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:i,y:n,w:a,h:o}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(i+1,n+1,Math.max(a-2,0),Math.max(o-2,0));break}})(o,Y,J,te,r,y,E,i.numTicks):(o.fillStyle=y.v2.colors.silver[900],o.fillRect(0,0,Y,J)))},[te,i.numTicks,E,r,J,Y,y]);const se=i.numTicks>0?Math.max(0,Math.min(100,Math.round(Z/i.numTicks*100))):100,de=a(()=>((e,t,i)=>{const n=i??CC(e),a=t?.offset??0,o=a+(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<a||e.offset+e.size>o||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(i,q,Q),[i,q,Q]),pe=null!==de,ue=z.length>0,he=q?SC(i,q.nameIndex):"",ge=d(()=>{R([]),f?.()},[f]),me=d(()=>R(e=>e.slice(0,-1)),[]),be=d(()=>{de&&R(e=>[...e,de])},[de]);return t(za,{isFullscreen:P,spacerHeight:c,children:e("div",{style:{flex:1,minHeight:P?0:c,minWidth:0,width:"100%",height:P?"calc(100vh - 32px)":void 0,display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(T,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(L,{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:_.Left,size:Vi.S,value:G,onChange:j}),e(T,{$gap:8,children:[e(T,{children:[t(H,{variant:K.Secondary,size:W.S,label:"Reset zoom",leftIcon:dh,onClick:ge,disabled:!z.length}),t(H,{variant:K.Secondary,size:W.S,iconSize:20,leftIcon:ph,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ue,onClick:me}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(w,{size:C.XXS,color:k.Secondary,nowrap:!0,align:"center",children:`${se}%`})}),t(H,{variant:K.Secondary,size:W.S,iconSize:20,leftIcon:Tu,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!pe,onClick:be})]}),e(T,{children:[t(ce,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(F,{variant:Ra.Filled,options:[{value:EC.Fit,label:"W: Fit"},{value:EC.X10,label:"10x"}],selected:M,setSelected:B})}),t(ce,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(F,{variant:Ra.Filled,options:[{value:DC.Fit,label:"H: Fit"},{value:DC.X10,label:"10x"}],selected:V,setSelected:U})})]}),t(Pa,{isFullscreen:P,onToggle:X})]})]}),t(ce,{fullWidth:!0,keepAlive:!0,text:A,children:t("div",{ref:S,style:{flex:1,minWidth:0,width:"100%",height:P?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:M>1?"auto":"hidden",overflowY:V>1?"auto":"hidden"},children:t("div",{style:{width:Y||"100%",height:J||"100%",position:"relative"},children:t("canvas",{ref:x,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:le,onPointerMove:ae,onPointerLeave:oe,onClick:re})})})})}),e(T,{$justifyContent:"space-between",children:[t(w,q?{size:C.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${he} • ${xC(Z)} samples in view`}:{size:C.XXXS,color:y.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(w,{size:C.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${PC(h.totalBytesUsed)} / ${PC(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})})},LC=f($)`
|
|
1362
1362
|
width: 100%;
|
|
1363
1363
|
max-height: 320px;
|
|
1364
1364
|
overflow-y: auto;
|
|
1365
1365
|
gap: 8px;
|
|
1366
|
-
`,
|
|
1366
|
+
`,_C=f(T)`
|
|
1367
1367
|
width: 100%;
|
|
1368
1368
|
align-items: center;
|
|
1369
1369
|
gap: 8px;
|
|
@@ -1373,14 +1373,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1373
1373
|
& > * {
|
|
1374
1374
|
font-family: monospace !important;
|
|
1375
1375
|
}
|
|
1376
|
-
`,
|
|
1376
|
+
`,MC=({pendingModify:i,onClose:n,onConfirm:a})=>{const o=v();return t(Ce,{isOpen:!!i,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:K.Secondary,label:"Cancel",onClick:n},approveButton:{variant:K.Primary,label:"Confirm",onClick:a},children:i&&e(LC,{children:[i.add.map(i=>e(_C,{children:[t(E,{leftIcon:Tu,status:ie.Success,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:C.XXS}),t(w,{size:C.XS,color:k.Primary,children:i})]},`add-${i}`)),i.remove.map(i=>e(_C,{children:[t(E,{leftIcon:ph,status:ie.Error,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:C.XXS}),t(w,{size:C.XS,color:k.Primary,children:i})]},`remove-${i}`))]})})},FC=[Ta.Go,Ta.Java],BC="Profiling Symbols";function VC(e,t){if(0===t.length)return null;const i=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Ta.Go:e.includes(" ")||e.includes("(")?Ta.Java:Ta.Go)(e);if(i===Ta.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const i=t.lastIndexOf("/"),n=t.indexOf(".",i+1);if(-1===n)return null;const a=t.slice(0,n),o=t.slice(n+1);if(!a||!o)return null;const l=o.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new ue(a,"",l[1],l[2]);return e.Verify()?e:null}const r=new ue(a,o);return r.Verify()?r:null})(e);return t?{language:i,golang:t}:null}if(i===Ta.Java){const t=(e=>{let t=e.trim();if(!t)return null;const i=t.indexOf("(");-1!==i&&(t=t.slice(0,i).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const a=t.lastIndexOf(".");if(-1===a)return null;const o=t.slice(0,a),l=t.slice(a+1),r=new he(o,l);return r.Verify()?r:null})(e);return t?{language:i,java:t}:null}return null}function UC(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function GC(e,t,i){if(!e)return!0;const{sources:n=[],namespaces:a=[],languages:o=[]}=e,l=!n.length||n.some(e=>UC(e,t.id)),r=!a.length||a.includes(t.id.namespace),s=!o.length||null==i||o.includes(i);return l&&r&&s}function jC(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function HC(e,t){return e.className===t.className&&e.methodName===t.methodName}function WC(e,t,i,n){const a=VC(e,i);if(!a)return[];const o=[];for(const e of n){const i=e.customInstrumentations;if(!i)continue;if(!GC(e.sourceScopes,t,a.language))continue;const n=!!a.golang&&!!i[me.Golang]?.some(e=>jC(e,a.golang)),l=!!a.java&&!!i[me.Java]?.some(e=>HC(e,a.java));(n||l)&&o.push({rule:e,resolved:a})}return o}var KC,YC,JC;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(KC||(KC={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(YC||(YC={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(JC||(JC={}));const qC=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function ZC(e,t){const i=(e=>e.split(" ")[0]??"")(e);return(!t.includes(JC.FilterOutVoid)||"void"!==i)&&!!(!t.includes(JC.OnlyWithReturnValues)||e.includes(" ")&&"void"!==i&&qC.test(i))}const QC=({rows:e,languages:i,instrumentation:n,searchQuery:o,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!i?.includes(Ta.Java),h=a(()=>{const t=s?new Set(s):null,i=o?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!i||e.name.toLowerCase().includes(i)))},[e,o,s]),g=a(()=>{const e=[];if(n.selectionEnabled&&e.push({id:YC.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:JC.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:JC.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const i=e.cells.find(e=>e.key===KC.Symbol)?.rawValue?.toString()??"";return!(t.includes(YC.OnlyInstrumentable)&&!n.getSymbolState(i).showCheckbox)&&ZC(i,t)}}},[n,u]),m=a(()=>[{key:KC.Symbol,label:"Symbol",autoWidth:!1,filterOverride:g,noFilter:!g},{key:KC.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:KC.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[g]),b=a(()=>h.map(e=>{const t=n.getSymbolState(e.name),i=t.showCheckbox;return{id:e.name,cells:[{key:KC.Symbol,rawValue:e.name},{key:KC.Self,rawValue:xC(e.self)},{key:KC.Total,rawValue:xC(e.total)}],isSelected:i?n.isSelected(e.name):void 0,onSelect:i?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:i?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!i,checkboxDisabled:i?t.checkboxDisabled:void 0,checkboxTooltip:i?t.checkboxTooltip:void 0}}),[h,n]),f=d(e=>{const t=e.cells[0].rawValue,i=n.getSymbolState(t),a=[];return i.inManagedRule?a.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:ku,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):a.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Tu,tooltip:i.addTooltip,disabled:!i.addEnabled,onClick:()=>n.onAdd(t)}),a.push({id:`copy-${t}`,label:"",leftIcon:uh,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),a},[n]);return t(Xa,{variant:La.Data,maxHeight:"calc(100vh - 306px)",columns:m,rows:b,withCheckboxes:n.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:f})};var ek;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(ek||(ek={}));const tk=f($)`
|
|
1377
1377
|
width: 100%;
|
|
1378
1378
|
flex: 1;
|
|
1379
1379
|
border-radius: 16px;
|
|
1380
1380
|
overflow: hidden;
|
|
1381
1381
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1382
1382
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
1383
|
-
`,
|
|
1383
|
+
`,ik=f.div`
|
|
1384
1384
|
display: flex;
|
|
1385
1385
|
align-items: center;
|
|
1386
1386
|
gap: 10px;
|
|
@@ -1388,11 +1388,11 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1388
1388
|
padding: 12px 12px 8px;
|
|
1389
1389
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1390
1390
|
border-radius: 16px 16px 0 0;
|
|
1391
|
-
`,
|
|
1391
|
+
`,nk=f(T)`
|
|
1392
1392
|
flex-shrink: 0;
|
|
1393
1393
|
align-items: center;
|
|
1394
1394
|
gap: 4px;
|
|
1395
|
-
`,
|
|
1395
|
+
`,ak=f.div`
|
|
1396
1396
|
flex: 1;
|
|
1397
1397
|
min-width: 0;
|
|
1398
1398
|
min-height: 0;
|
|
@@ -1402,7 +1402,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1402
1402
|
padding: 16px;
|
|
1403
1403
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1404
1404
|
border-radius: 0 0 16px 16px;
|
|
1405
|
-
`,
|
|
1405
|
+
`,ok=f($)`
|
|
1406
1406
|
/* min-width: 0 so measured/wide symbol columns scroll inside the panel instead of
|
|
1407
1407
|
* expanding past the flex basis and pushing the flame graph off-screen (PLAT-1472). */
|
|
1408
1408
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
@@ -1410,16 +1410,16 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1410
1410
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
1411
1411
|
min-width: 0;
|
|
1412
1412
|
gap: 10px;
|
|
1413
|
-
`,
|
|
1413
|
+
`,lk=f($)`
|
|
1414
1414
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
1415
1415
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
1416
1416
|
min-width: 0;
|
|
1417
1417
|
gap: 10px;
|
|
1418
|
-
`,
|
|
1418
|
+
`,rk=f(T)`
|
|
1419
1419
|
width: 100%;
|
|
1420
1420
|
min-height: 32px;
|
|
1421
1421
|
flex-shrink: 0;
|
|
1422
|
-
`,ak=({source:i,onFlameFullscreenChange:n})=>{const s=v(),{profilingApi:c}=Hh(),u=a(()=>({namespace:i.id.namespace,name:i.id.name,kind:i.id.kind,region:i.id.region,serviceName:i.serviceName}),[i.id.namespace,i.id.name,i.id.kind,i.id.region,i.serviceName]),[h,g]=l(!0),[m,b]=l(JC.Both),[f,y]=l(""),[S,x]=l({}),[I,N]=l(!1),A=p(!1);o(()=>{A.current||(A.current=!0,c.enableProfiling?.(u),N(!0))},[c,u]);const{data:O}=c.useSlots({skip:!I,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:D,loading:z,refetch:R}=c.useSourceProfiling(u,{skip:!I,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),P=D?.profileJson??null,X=a(()=>(e=>{if(!e?.trim())return null;try{const t=JSON.parse(e),i=t.flamebearer;return!i?.names?.length||!Array.isArray(i.levels)||"number"!=typeof i.numTicks||i.numTicks<=0?null:{flamebearer:i,units:t.metadata?.units}}catch{return null}})(P),[P]),M=a(()=>X?(e=>{const t=new Map;for(let i=0;i<e.levels.length;i++){const n=e.levels[i];for(let i=0;i+3<n.length;i+=4){const a=n[i+1],o=n[i+2],l=bC(e,n[i+3]);if(!l)continue;const r=t.get(l);(!r||a>r.total)&&t.set(l,{self:o,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})(X.flamebearer):[],[X]),B=m===JC.Table||m===JC.Both,V=m===JC.Flame||m===JC.Both,U=B&&V,G=i.runtimeInfo?.detectedLanguages?.join("\0")??"",j=i.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",Y=a(()=>G?G.split("\0"):j?j.split("\0"):void 0,[G,j]),J=a(()=>((e,t)=>{if(!t?.includes(Ta.Java))return;const i=(e?.[GC.Symbol]?.filter(Boolean)??[]).filter(e=>e===HC.FilterOutVoid||e===HC.OnlyWithReturnValues);return 0!==i.length?e=>KC(e,i):void 0})(S,Y),[S,Y]),{instrumentation:q,pendingCount:Q,pendingModify:ee,closeModify:te,openBulkModify:ie,resetSelection:ae,confirmModify:oe}=function({source:e,languages:t,rows:i}){const{instrumentationRulesApi:n,capabilities:o}=Hh(),{items:r}=n.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,g]=l(null),m=a(()=>(e=>{const t=new Set(e??[]);return XC.filter(e=>t.has(e))})(t),[t]),b=o.canCreateInstrumentationRule,f=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=a(()=>((e,t)=>{const i=e.filter(e=>e.type===fe.CustomInstrumentation&&e.ruleName===LC&&FC(e.sourceScopes,t));return i.find(e=>e.sourceScopes?.sources?.some(e=>MC(e,t.id)))??i[0]??null})(r,e),[r,f]),y=b&&m.length>0,S=a(()=>{const t=new Map;for(const n of i){const i=!!_C(n.name,m),a=UC(n.name,e,m,r),o=!!v&&a.some(e=>e.rule.ruleId===v.ruleId),l=a.filter(e=>e.rule.ruleId!==v?.ruleId),s=!o&&l.length>0,c=y&&i,d=s;let p;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];p=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===a.length&&(0===m.length?h="Custom instrumentation is only available for Go and Java sources":b?i?u=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(n.name,{parsable:i,inManagedRule:o,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[i,r,f,m,b,y,v]),x=a(()=>{const e=new Set;return S.forEach((t,i)=>{t.inManagedRule&&e.add(i)}),e},[S]),w=a(()=>[...s].filter(e=>S.get(e)?.addEnabled&&!x.has(e)),[s,S,x]),C=a(()=>[...p].filter(e=>x.has(e)),[p,x]),k=w.length+C.length,T=d(e=>{const t=S.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||s.has(e)},[S,p,s]),I=d((e,t)=>{const i=S.get(e);i&&!i.checkboxDisabled&&(i.inManagedRule?u(i=>{const n=new Set(i);return t?n.delete(e):n.add(e),n}):c(i=>{const n=new Set(i);return t?n.add(e):n.delete(e),n}))},[S]),$=d(()=>{c(new Set),u(new Set)},[]),N=d(t=>{(async()=>{const i=t.add.map(e=>_C(e,m)).filter(e=>!!e),a=t.remove.map(e=>_C(e,m)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,i)=>{const n=e.customInstrumentations??{};let a=[...n[me.Golang]??[]],o=[...n[me.Java]??[]];for(const e of i)e.golang&&(a=a.filter(t=>!BC(t,e.golang))),e.java&&(o=o.filter(t=>!VC(t,e.java)));for(const e of t)e.golang&&!a.some(t=>BC(t,e.golang))&&a.push(e.golang),e.java&&!o.some(t=>VC(t,e.java))&&o.push(e.java);return{customInstrumentations:{[me.Golang]:a,[me.Java]:o},isEmpty:0===a.length&&0===o.length}})(v,i,a);t?await n.remove(v.ruleId,fe.CustomInstrumentation):await n.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),fe.CustomInstrumentation)}else i.length>0&&await n.create(((e,t)=>{const i=e.map(e=>e.golang).filter(e=>!!e),n=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:LC,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:a,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[me.Golang]:i,[me.Java]:n}}})(i,e),fe.CustomInstrumentation)})()},[v,m,e,n]),A=d(()=>{k&&g({add:w,remove:C})},[k,w,C]),O=d(e=>g({add:[e],remove:[]}),[]),E=d(e=>g({add:[],remove:[e]}),[]),D=d(()=>g(null),[]),z=d(()=>{h&&(N(h),g(null),$())},[h,N,$]),R=d(e=>S.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[S]);return{instrumentation:a(()=>({getSymbolState:R,onAdd:O,onRemove:E,selectionEnabled:y,isSelected:T,onToggleSymbol:I}),[R,O,E,y,T,I]),pendingCount:k,pendingModify:h,closeModify:D,openBulkModify:A,resetSelection:$,confirmModify:z}}({source:i,languages:Y,rows:M}),[le,re]=l(null),[se,de]=l(0),[pe,ue]=l(null),he=d(e=>{re(e),de(e=>e+1),b(e=>e===JC.Flame?JC.Both:e)},[]),ge=d(e=>{ue(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const i=new Set(t);if(e.every(e=>i.has(e)))return t}return e})},[]),be=d(()=>re(null),[]);return!P&&z?t(oi,{$height:"70vh",children:t(Ve,{withSpinner:!0})}):e(qC,{$gap:0,$width:"100%",children:[e(ZC,{children:[t(ce,{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(QC,{children:t(w,{size:C.S,weight:500,color:k.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(T,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(sa,{value:f,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:s.v2.colors.silver[900],emphasizeBackgroundColor:s.v2.colors.silver[800]})}),t(F,{variant:Da.Filled,options:[{value:JC.Table,label:"Top table"},{value:JC.Flame,label:"Flame graph"},{value:JC.Both,label:"Both"}],selected:m,setSelected:b}),t(H,h?{variant:K.Secondary,size:W.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(ph,{...e,size:8,fill:s.v2.colors.green[500]})}:{variant:K.Secondary,size:W.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(ph,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(ek,{$gap:B&&V?16:0,children:X?e(r,{children:[B&&e(tk,{$splitWithFlame:U,children:[e(nk,{$justifyContent:"space-between",children:[e($,{$margin:"0 0 0 20px",children:[t(w,{size:C.XXXS,nowrap:!0,children:"Please select symbols to"}),e(T,{$gap:8,children:[e(T,{children:[t(uh,{size:24}),t(w,{size:C.S,color:k.Success,nowrap:!0,children:"Custom Instrument"})]}),t(H,{leftIcon:ku,variant:K.Secondary,size:W.S,onClick:()=>window.open(`${ne}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(T,{$gap:8,children:[pe&&t(ce,{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(E,{label:`Zoomed: ${pe.length} symbols`,backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:C.XXS})}),t(H,{variant:K.Secondary,size:W.S,label:"Download snapshot",rightIcon:hh,onClick:()=>{if(!P)return;const e=new Blob([P],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${i.id.namespace}-${i.id.kind}-${i.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!P})]})]}),t(YC,{rows:M,languages:Y,instrumentation:q,searchQuery:f,filters:S,onFiltersChange:x,zoomedSymbols:pe,highlightSymbol:le,scrollSignal:se})]}),V&&e(ik,{$splitWithTable:U,children:[e(nk,{$justifyContent:"space-between",children:[t(E,{label:X?`Total in view ${fC(X.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:C.XXS}),e(T,{$gap:12,children:[!h&&t(H,{variant:K.Secondary,size:W.S,label:"Refresh",leftIcon:Zu,onClick:R}),t(L,{label:"Auto refresh",labelAlign:_.Left,size:Vi.S,value:h,onChange:g})]})]}),t(DC,{flamebearer:X.flamebearer,maxRowPx:24,searchQuery:f,shouldKeepName:J,minHostHeight:280,onFullscreenChange:n,profilingSlots:O??null,onFrameClick:he,onZoomedSymbolsChange:ge,onResetZoom:be})]})]}):t(oi,{children:t(Z,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(PC,{pendingModify:ee,onClose:te,onConfirm:oe}),t(vt,{isOpen:Q>0,richTitle:{icon:Vu,title:"Profiling Symbols",badge:{label:Q}},actions:[{id:"profiling-bulk-cancel",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,label:"Cancel",onClick:ae}},{id:"profiling-bulk-apply",type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:"Modify Rule",leftIcon:Iu,onClick:ie}}]})]})},ok=f.div`
|
|
1422
|
+
`,sk=({source:i})=>{const n=v(),{profilingApi:s}=Jh(),c=a(()=>({namespace:i.id.namespace,name:i.id.name,kind:i.id.kind,region:i.id.region,serviceName:i.serviceName}),[i.id.namespace,i.id.name,i.id.kind,i.id.region,i.serviceName]),[u,h]=l(!0),[g,m]=l(ek.Both),[b,f]=l(""),[y,S]=l({}),[x,I]=l(!1),N=p(!1);o(()=>{N.current||(N.current=!0,s.enableProfiling?.(c),I(!0))},[s,c]);const{data:A}=s.useSlots({skip:!x,pollInterval:u?3e3:0,fetchPolicy:"network-only"}),{data:O,loading:D,refetch:z}=s.useSourceProfiling(c,{skip:!x,pollInterval:u?3e3:0,fetchPolicy:"network-only"}),R=O?.profileJson??null,P=a(()=>(e=>{if(!e?.trim())return null;try{const t=JSON.parse(e),i=t.flamebearer;return!i?.names?.length||!Array.isArray(i.levels)||"number"!=typeof i.numTicks||i.numTicks<=0?null:{flamebearer:i,units:t.metadata?.units}}catch{return null}})(R),[R]),X=a(()=>P?(e=>{const t=new Map;for(let i=0;i<e.levels.length;i++){const n=e.levels[i];for(let i=0;i+3<n.length;i+=4){const a=n[i+1],o=n[i+2],l=SC(e,n[i+3]);if(!l)continue;const r=t.get(l);(!r||a>r.total)&&t.set(l,{self:o,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})(P.flamebearer):[],[P]),M=g===ek.Table||g===ek.Both,B=g===ek.Flame||g===ek.Both,V=M&&B,U=i.runtimeInfo?.detectedLanguages?.join("\0")??"",G=i.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",j=a(()=>U?U.split("\0"):G?G.split("\0"):void 0,[U,G]),Y=a(()=>((e,t)=>{if(!t?.includes(Ta.Java))return;const i=(e?.[KC.Symbol]?.filter(Boolean)??[]).filter(e=>e===JC.FilterOutVoid||e===JC.OnlyWithReturnValues);return 0!==i.length?e=>ZC(e,i):void 0})(y,j),[y,j]),{instrumentation:J,pendingCount:q,pendingModify:Q,closeModify:ee,openBulkModify:te,resetSelection:ie,confirmModify:ae}=function({source:e,languages:t,rows:i}){const{instrumentationRulesApi:n,capabilities:o}=Jh(),{items:r}=n.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,g]=l(null),m=a(()=>(e=>{const t=new Set(e??[]);return FC.filter(e=>t.has(e))})(t),[t]),b=o.canCreateInstrumentationRule,f=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=a(()=>((e,t)=>{const i=e.filter(e=>e.type===fe.CustomInstrumentation&&e.ruleName===BC&&GC(e.sourceScopes,t));return i.find(e=>e.sourceScopes?.sources?.some(e=>UC(e,t.id)))??i[0]??null})(r,e),[r,f]),y=b&&m.length>0,S=a(()=>{const t=new Map;for(const n of i){const i=!!VC(n.name,m),a=WC(n.name,e,m,r),o=!!v&&a.some(e=>e.rule.ruleId===v.ruleId),l=a.filter(e=>e.rule.ruleId!==v?.ruleId),s=!o&&l.length>0,c=y&&i,d=s;let p;if(s){const e=[...new Set(l.map(e=>e.rule.ruleName))];p=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===a.length&&(0===m.length?h="Custom instrumentation is only available for Go and Java sources":b?i?u=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(n.name,{parsable:i,inManagedRule:o,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[i,r,f,m,b,y,v]),x=a(()=>{const e=new Set;return S.forEach((t,i)=>{t.inManagedRule&&e.add(i)}),e},[S]),w=a(()=>[...s].filter(e=>S.get(e)?.addEnabled&&!x.has(e)),[s,S,x]),C=a(()=>[...p].filter(e=>x.has(e)),[p,x]),k=w.length+C.length,T=d(e=>{const t=S.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||s.has(e)},[S,p,s]),I=d((e,t)=>{const i=S.get(e);i&&!i.checkboxDisabled&&(i.inManagedRule?u(i=>{const n=new Set(i);return t?n.delete(e):n.add(e),n}):c(i=>{const n=new Set(i);return t?n.add(e):n.delete(e),n}))},[S]),$=d(()=>{c(new Set),u(new Set)},[]),N=d(t=>{(async()=>{const i=t.add.map(e=>VC(e,m)).filter(e=>!!e),a=t.remove.map(e=>VC(e,m)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,i)=>{const n=e.customInstrumentations??{};let a=[...n[me.Golang]??[]],o=[...n[me.Java]??[]];for(const e of i)e.golang&&(a=a.filter(t=>!jC(t,e.golang))),e.java&&(o=o.filter(t=>!HC(t,e.java)));for(const e of t)e.golang&&!a.some(t=>jC(t,e.golang))&&a.push(e.golang),e.java&&!o.some(t=>HC(t,e.java))&&o.push(e.java);return{customInstrumentations:{[me.Golang]:a,[me.Java]:o},isEmpty:0===a.length&&0===o.length}})(v,i,a);t?await n.remove(v.ruleId,fe.CustomInstrumentation):await n.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),fe.CustomInstrumentation)}else i.length>0&&await n.create(((e,t)=>{const i=e.map(e=>e.golang).filter(e=>!!e),n=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:BC,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:a,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[me.Golang]:i,[me.Java]:n}}})(i,e),fe.CustomInstrumentation)})()},[v,m,e,n]),A=d(()=>{k&&g({add:w,remove:C})},[k,w,C]),O=d(e=>g({add:[e],remove:[]}),[]),E=d(e=>g({add:[],remove:[e]}),[]),D=d(()=>g(null),[]),z=d(()=>{h&&(N(h),g(null),$())},[h,N,$]),R=d(e=>S.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[S]);return{instrumentation:a(()=>({getSymbolState:R,onAdd:O,onRemove:E,selectionEnabled:y,isSelected:T,onToggleSymbol:I}),[R,O,E,y,T,I]),pendingCount:k,pendingModify:h,closeModify:D,openBulkModify:A,resetSelection:$,confirmModify:z}}({source:i,languages:j,rows:X}),[oe,le]=l(null),[re,se]=l(0),[de,pe]=l(null),ue=d(e=>{le(e),se(e=>e+1),m(e=>e===ek.Flame?ek.Both:e)},[]),he=d(e=>{pe(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const i=new Set(t);if(e.every(e=>i.has(e)))return t}return e})},[]),ge=d(()=>le(null),[]);return!R&&D?t(oi,{$height:"70vh",children:t(Ve,{withSpinner:!0})}):e(tk,{$gap:0,$width:"100%",children:[e(ik,{children:[t(ce,{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(nk,{children:t(w,{size:C.S,weight:500,color:k.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(T,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(sa,{value:b,onChange:f,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:n.v2.colors.silver[900],emphasizeBackgroundColor:n.v2.colors.silver[800]})}),t(F,{variant:Ra.Filled,options:[{value:ek.Table,label:"Top table"},{value:ek.Flame,label:"Flame graph"},{value:ek.Both,label:"Both"}],selected:g,setSelected:m}),t(H,u?{variant:K.Secondary,size:W.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(hh,{...e,size:8,fill:n.v2.colors.green[500]})}:{variant:K.Secondary,size:W.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(hh,{...e,size:8,fill:n.v2.colors.red[500]})})]})]}),t(ak,{$gap:M&&B?16:0,children:P?e(r,{children:[M&&e(ok,{$splitWithFlame:V,children:[e(rk,{$justifyContent:"space-between",children:[e($,{$margin:"0 0 0 20px",children:[t(w,{size:C.XXXS,nowrap:!0,children:"Please select symbols to"}),e(T,{$gap:8,children:[e(T,{children:[t(gh,{size:24}),t(w,{size:C.S,color:k.Success,nowrap:!0,children:"Custom Instrument"})]}),t(H,{leftIcon:$u,variant:K.Secondary,size:W.S,onClick:()=>window.open(`${ne}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(T,{$gap:8,children:[de&&t(ce,{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(E,{label:`Zoomed: ${de.length} symbols`,backgroundColor:n.v2.colors.silver[750],textColor:n.v2.colors.silver[200],textSize:C.XXS})}),t(H,{variant:K.Secondary,size:W.S,label:"Download snapshot",rightIcon:mh,onClick:()=>{if(!R)return;const e=new Blob([R],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${i.id.namespace}-${i.id.kind}-${i.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!R})]})]}),t(QC,{rows:X,languages:j,instrumentation:J,searchQuery:b,filters:y,onFiltersChange:S,zoomedSymbols:de,highlightSymbol:oe,scrollSignal:re})]}),B&&e(lk,{$splitWithTable:V,children:[e(rk,{$justifyContent:"space-between",children:[t(E,{label:P?`Total in view ${xC(P.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:n.v2.colors.silver[750],textColor:n.v2.colors.silver[200],textSize:C.XXS}),e(T,{$gap:12,children:[!u&&t(H,{variant:K.Secondary,size:W.S,label:"Refresh",leftIcon:th,onClick:z}),t(L,{label:"Auto refresh",labelAlign:_.Left,size:Vi.S,value:u,onChange:h})]})]}),t(XC,{flamebearer:P.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:Y,minHostHeight:280,profilingSlots:A??null,onFrameClick:ue,onZoomedSymbolsChange:he,onResetZoom:ge})]})]}):t(oi,{children:t(Z,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(MC,{pendingModify:Q,onClose:ee,onConfirm:ae}),t(vt,{isOpen:q>0,richTitle:{icon:ju,title:"Profiling Symbols",badge:{label:q}},actions:[{id:"profiling-bulk-cancel",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,label:"Cancel",onClick:ie}},{id:"profiling-bulk-apply",type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:"Modify Rule",leftIcon:Au,onClick:te}}]})]})},ck=f.div`
|
|
1423
1423
|
position: relative;
|
|
1424
1424
|
display: flex;
|
|
1425
1425
|
align-items: center;
|
|
@@ -1427,23 +1427,23 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1427
1427
|
padding: 8px 16px;
|
|
1428
1428
|
border-radius: 12px;
|
|
1429
1429
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1430
|
-
`,
|
|
1430
|
+
`,dk=f.div`
|
|
1431
1431
|
display: flex;
|
|
1432
1432
|
flex-direction: column;
|
|
1433
1433
|
gap: 4px;
|
|
1434
1434
|
flex: 1;
|
|
1435
1435
|
min-width: 0;
|
|
1436
1436
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
1437
|
-
`,
|
|
1437
|
+
`,pk=f.div`
|
|
1438
1438
|
flex-shrink: 0;
|
|
1439
1439
|
display: flex;
|
|
1440
1440
|
align-items: center;
|
|
1441
1441
|
margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
|
|
1442
|
-
`,
|
|
1442
|
+
`,uk=f.div`
|
|
1443
1443
|
min-width: 0;
|
|
1444
1444
|
white-space: pre;
|
|
1445
1445
|
overflow-x: auto;
|
|
1446
|
-
`,
|
|
1446
|
+
`,hk=f.div`
|
|
1447
1447
|
position: absolute;
|
|
1448
1448
|
top: 50%;
|
|
1449
1449
|
right: 8px;
|
|
@@ -1452,41 +1452,41 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1452
1452
|
pointer-events: none;
|
|
1453
1453
|
transition: opacity 0.15s ease;
|
|
1454
1454
|
|
|
1455
|
-
${
|
|
1455
|
+
${ck}:hover & {
|
|
1456
1456
|
opacity: 1;
|
|
1457
1457
|
pointer-events: auto;
|
|
1458
1458
|
}
|
|
1459
|
-
`,
|
|
1459
|
+
`,gk=({name:i,summary:n,disabled:a=!1,onJumpToRule:o})=>{const l=v();return e(ck,{children:[e(dk,{$disabled:a,children:[i&&t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:i}),t(uk,{children:t(Gp,{parts:n})})]}),a&&t(pk,{$reserveJumpSpace:!!o,children:t(E,{label:_a,textSize:C.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),o&&t(hk,{children:t(ce,{text:ke.OPEN_IN_SAMPLING_PAGE,children:t(H,{"data-id":"sampling-rule-jump",variant:K.Primary,size:W.S,leftIcon:bh,onClick:o})})})]})},mk=f.div`
|
|
1460
1460
|
opacity: 0;
|
|
1461
1461
|
pointer-events: none;
|
|
1462
1462
|
transition: opacity 0.15s ease;
|
|
1463
|
-
`,
|
|
1464
|
-
&:hover ${
|
|
1463
|
+
`,bk=f.div`
|
|
1464
|
+
&:hover ${mk} {
|
|
1465
1465
|
opacity: 1;
|
|
1466
1466
|
pointer-events: auto;
|
|
1467
1467
|
}
|
|
1468
|
-
`,
|
|
1468
|
+
`,fk=f.div`
|
|
1469
1469
|
display: flex;
|
|
1470
1470
|
align-items: center;
|
|
1471
1471
|
padding: 4px 12px;
|
|
1472
|
-
`,gk=({source:e,onRedirectToSampling:i})=>t(Mn,{bgTint:"1000",richTitle:{title:ke.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(fk,{container:e,onRedirectToSampling:i},e.containerName))});var mk;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(mk||(mk={}));const bk=e=>"noisy"===e.type?Vp(e.rule,"source"):"highlyRelevant"===e.type?Up(e.rule,"source"):"costReduction"===e.type?Gp(e.rule,"source"):[],fk=({container:i,onRedirectToSampling:n})=>{const[o,r]=l(mk.All),s=da(e=>e.setPendingViewSamplingRule),c=i.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(i.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[i.agentConfig?.traces?.headSampling?.noisyOperations]),p=a(()=>(i.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[i.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=a(()=>(i.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[i.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>o===mk.Noisy?d:o===mk.HighlyRelevant?p:o===mk.CostReduction?u:[...d,...p,...u],[o,p,u]),g=d.length+p.length+u.length,m=a(()=>(e,t)=>{s({ruleId:e,category:t}),n()},[n,s]),b=t(pk,{children:t(H,{"data-id":"sampling-container-create-rule",variant:K.Secondary,size:W.S,label:Xa,rightIcon:wu,onClick:e=>{e.stopPropagation(),n()}})});return t(uk,{children:e(Mn,{bgTint:"900",richTitle:{title:i.containerName},renderOnRightSide:b,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Mn,{bgTint:"800",richTitle:{title:ke.HEAD_SAMPLING,badge:{label:c.length}},children:[t(w,{size:C.XXS,children:ke.NOISY_OPERATIONS}),t($,{$gap:4,children:c.map(e=>t(dk,{name:e.name,summary:Vp(e),disabled:e.disabled,onJumpToRule:()=>m(e.ruleId,"noisy")},e.ruleId))})]}):t(hk,{children:t(w,{size:C.XS,color:k.Secondary,children:ke.HEAD_SAMPLING})}),g?e(Mn,{bgTint:"800",richTitle:{title:ke.TAIL_SAMPLING,badge:{label:g}},children:[t(F,{options:(f=d.length,v=p.length,y=u.length,[{value:mk.All,label:"All",badge:{label:f+v+y,textSize:C.XXXS}},{value:mk.Noisy,label:ke.NOISY_OPERATIONS,badge:{label:f,textSize:C.XXXS}},{value:mk.HighlyRelevant,label:ke.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:C.XXXS}},{value:mk.CostReduction,label:ke.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:C.XXXS}}]),selected:o,setSelected:r}),t($,{$gap:4,children:h.length?h.map(e=>t(dk,{name:e.rule.name,summary:bk(e),disabled:e.rule.disabled,onJumpToRule:()=>m(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Z,{title:`No ${o===mk.All?`${mk.Noisy}, ${mk.HighlyRelevant} and ${mk.CostReduction}`:o} operations`})})]}):t(hk,{children:t(w,{size:C.XS,color:k.Secondary,children:ke.TAIL_SAMPLING})})]})});var f,v,y},vk=[ba.Deployment,ba.StatefulSet,ba.DaemonSet,ba.DeploymentConfig,ba.Rollout,ba.Pod];var yk;(e=>{e.Workload="Workload",e.Pod="Pod"})(yk||(yk={}));const Sk=e=>!!e&&ia(e.status)===ie.Error,xk=e=>Sk(e.healthStatus),wk=e=>Sk(e.odigosHealthStatus)||(e.processes??[]).some(xk),Ck=e=>Sk(e.agentInjectedStatus)||Sk(e.odigosHealthStatus)||(e.containers??[]).some(wk),kk=({onClose:i,sourceId:n,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,isVm:u,platformType:h}=Mp(),{selectedStreamName:g}=Te(),{sourcesApi:m,configApi:b,capabilities:f}=Hh(),{genericForm:y,loadSource:S,validateFormData:x}=Jh(),{data:w}=b.useEffectiveConfig(),[k,T]=l(!1),[I,A]=l(!1),[O,E]=l(!1),[D,z]=l(Bx.Overview),[R,P]=l(null),[X,L]=l({openFor:null}),_=(()=>{const[e,t]=l(null),i=d(e=>{t({tab:Bx.Pods,podName:e.podName})},[]),n=d((e,i)=>{t({tab:Bx.Pods,podName:e.podName,containerName:i.containerName})},[]),o=d((e,i,n)=>{const a=Wx({identifyingAttributes:n.identifyingAttributes});t({tab:Bx.Pods,podName:e.podName,containerName:i.containerName,processPid:a})},[]),r=d(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:i,jumpToContainer:n,jumpToProcess:o,clearJumpToTarget:r}),[e,i,n,o,r])})();o(()=>{_.jumpToTarget&&z(_.jumpToTarget.tab)},[_.jumpToTarget]),o(()=>{R&&JSON.stringify(pa(n))!==JSON.stringify(pa(R))&&P(null)},[n,R]);const M=p(!1),B=d(async()=>P(await m.fetchById(n)||null),[n,m]);o(()=>{if(M.current||(B(),M.current=!0),!k){const e=setInterval(()=>B(),3e3);return()=>clearInterval(e)}},[B,k]),o(()=>{R&&S(R)},[R]);const V=R&&vk.includes(R.id.kind),U=a(()=>{const e=[],i=(R?.pods??[]).some(Ck),n=(a=R,(a?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var a;const o=e=>t(ih,{...e,fill:s.v2.colors.red[500]});return e.push({value:Bx.Overview,label:ke.OVERVIEW}),c?(e.push({value:Bx.Pods,label:ke.PODS,icon:i?o:void 0}),e.push({value:Bx.Libraries,label:ke.LIBRARIES,icon:n?o:void 0}),e.push({value:Bx.PeerSources,label:ke.PEER_SOURCES}),w?.profiling?.enabled&&e.push({value:Bx.Profiling,label:ke.PROFILING}),e.push({value:Bx.Sampling,label:ke.SAMPLING}),e.push({value:Bx.Debug,label:ke.DEBUG}),e):(u&&f.canFetchProfiling&&e.push({value:Bx.Profiling,label:ke.PROFILING}),e)},[c,u,f.canFetchProfiling,w,R?.pods,s]),G=d(()=>T(!0),[]),j=a(()=>()=>{i(),r()},[i,r]),H=d(()=>{R&&S(R),T(!1)},[R]),W=d(async()=>{if(!R||!y)return;const{errorMessage:e,preparedFormData:t}=x();if(e)return;const i=t.otelServiceName!==R.id.name?t.otelServiceName:"";await m.update(n,{...t,otelServiceName:i}),T(!1)},[R,y,x,n,m]),Y=!1===R?.markedForInstrumentation?.markedForInstrumentation,J=d(()=>A(!0),[]),q=d(async()=>{if(!R)return;const e=!1===R.markedForInstrumentation?.markedForInstrumentation;await m.persistV2({[Nn]:[{namespace:R.id.namespace,name:R.id.name,kind:R.id.kind,...R.id.region?{region:R.id.region}:{},selected:e,currentStreamName:g}]}),A(!1),e||i()},[R,m,g,i]),Z=d(()=>{L({openFor:yk.Workload})},[]),Q=d(e=>{z(e),_.clearJumpToTarget()},[_]),ee=d(async()=>{await m.recoverFromRollback(n)},[m,n]),te=d(()=>L({openFor:null}),[]),ie=d(()=>{Q(Bx.Overview),P(null),E(!1),i()},[Q,i]),ne=d(async()=>{X.openFor===yk.Workload?await m.restartWorkloads([n]):X.openFor===yk.Pod&&X.podNamespace&&X.podName&&await m.restartPod(X.podNamespace,X.podName),te()},[X,m,n,te]),ae=a(()=>{const{kind:e,name:t}=n;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[n]),oe=a(()=>{const e=[];return k||D===Bx.Overview&&(e.push({id:"edit-source-btn-edit",label:zn.EDIT,icon:Iu,active:k,onClick:G}),c&&V&&e.push({id:"edit-source-btn-restart",label:ke.ROLLOUT_RESTART,icon:lh,onClick:Z}),e.push(Y?{id:"edit-source-btn-instrument",label:zn.INSTRUMENT,icon:wu,color:s.v2.colors.green[500],active:I,onClick:J}:{id:"edit-source-btn-delete",label:zn.UNINSTRUMENT,icon:xu,color:s.v2.colors.red[500],active:I,onClick:J})),e},[D,k,I,Y,c,V,G,Z,J,s]),le=a(()=>{if(!R)return[];const e=[],t={backgroundColor:"transparent",textSize:C.S};return e.push({...t,label:R.id.name,leftIcon:c?th:void 0}),R.serviceName&&R.serviceName!==R.id.name&&e.push({...t,label:R.serviceName,leftIcon:Ju,textColor:s.v2.colors.silver[200]}),e},[R,s,c]);if(!R)return t(ln,{isOpen:!0,header:{onClose:ie},children:t(oi,{$height:"80vh",children:t(Ve,{withSpinner:!0})})});const re=D===Bx.Profiling?O?"95vw":"fit-content":k?void 0:"60vw",se=c?_a(R.containers)[0]:La(h);return e(qx,{value:_,children:[t(ln,{isOpen:!0,width:re,minWidth:"min(1100px, 100vw)",header:{icon:se,titleBadges:le,onClose:ie,actions:oe},footer:{actions:k?[{"data-id":"edit-source-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:H},{"data-id":"edit-source-btn-save",label:zn.SAVE,variant:K.Primary,onClick:W}]:[]},children:t(N,{$padding:"4px 12px 12px",children:e($,{$gap:16,children:[!k&&U.length>1&&t(F,{options:U,selected:D,setSelected:Q}),(()=>{switch(D){case Bx.Overview:return k?t(wb,{}):t(gC,{source:R,onClickRollout:Z,onClickRollback:ee});case Bx.Pods:return t(iw,{source:R,onClickRestartPod:V?(e,t)=>L({openFor:yk.Pod,podNamespace:e,podName:t}):void 0});case Bx.Libraries:return t(mC,{source:R});case Bx.PeerSources:return t(aw,{source:R});case Bx.Profiling:return t(ak,{source:R,onFlameFullscreenChange:E});case Bx.Sampling:return t(gk,{source:R,onRedirectToSampling:j});case Bx.Debug:return t(cw,{source:R});default:return null}})()]})})}),t(cm,{target:"source",action:Y?"instrument":"uninstrument",isOpen:I,onClose:()=>A(!1),onApprove:q}),t(Ce,{isOpen:X.openFor===yk.Workload,title:ae.title,description:ae.description,onClose:te,denyButton:{label:"Go back",variant:K.Secondary,onClick:te},approveButton:{label:zn.CONFIRM,variant:K.Primary,onClick:ne}}),t(cm,{target:"pod",action:"restart",description:ke.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:X.openFor===yk.Pod,onClose:te,onApprove:ne,overrideApproveButtonLabel:ke.DELETE_POD_TO_RESTART})]})},Tk={"Cost Optimization":{icon:fh,status:ie.Warning},Normalization:{icon:bh,status:ie.Default},Enrichment:{icon:mh,status:ie.Info},Maintenance:{icon:Zu,status:ie.Warning},Reliability:{icon:Vu,status:ie.Success},Usability:{icon:gh,status:ie.Info}},Ik={icon:vh,status:ie.Unknown},$k={[Ma.Recommended]:ie.Info,[Ma.Applied]:ie.Success,[Ma.Dismissed]:ie.Disabled,[Ma.NotApplicable]:ie.Unknown},Nk="Created from recommendation",Ak={[Ba.EnableUrlTemplatization]:()=>({type:q.URLTemplatization,name:"URL Templatization",notes:Nk,disabled:!1,signals:[ae.Traces],fields:{}}),[Ba.EnableInferDbAttributes]:()=>({type:q.InferDbAttributes,name:"Infer DB Attributes",notes:Nk,disabled:!1,signals:[ae.Traces],fields:{}})},Ok=e=>e.applyExamples.some(({type:e})=>e===Fa.OdigosAction),Ek=e=>Ok(e)?Ak[e.type]?.():void 0,Dk=e=>e.applied?Ma.Applied:e.conditionsMet?e.dismissed?Ma.Dismissed:Ma.Recommended:Ma.NotApplicable,zk=e=>{const t={[Ma.Recommended]:[],[Ma.Applied]:[],[Ma.Dismissed]:[],[Ma.NotApplicable]:[]};for(const i of e)t[Dk(i)].push(i);return t},Rk=e=>{let t=0;for(const i of e)Dk(i)===Ma.Recommended&&(t+=1);return t},Pk=[Ma.Recommended,Ma.Applied,Ma.Dismissed,Ma.NotApplicable],Xk={[Fa.HelmValues]:"Helm values",[Fa.OdigosAction]:"Odigos Action"},Lk=({remediations:i})=>{const n=i.flatMap(e=>e.applyExamples.map((t,n)=>({key:`${e.type}-${t.type}-${n}`,title:i.length>1?`${Xk[t.type]||t.type} — ${e.buttonText}`:Xk[t.type]||t.type,content:t.content})));return n.length?e($,{$gap:8,children:[e($,{$gap:2,children:[t(w,{size:C.XS,color:k.Primary,weight:500,children:Va}),t(w,{size:C.XXS,color:k.Secondary,children:Ua})]}),n.map(e=>t(dm,{title:e.title,yaml:e.content,compact:!0},e.key))]}):null},_k=({recommendation:i,onApplyServerRemediation:n,onCreateAction:a,onApplied:o})=>{const[r,s]=l(),c=i.remediations.filter(e=>Ok(e)?!!Ek(e)&&!!a:!!n);return c.length?e($,{$gap:8,children:[e($,{$gap:2,children:[t(w,{size:C.XS,color:k.Primary,weight:500,children:Ga}),t(w,{size:C.XXS,color:k.Secondary,children:ja})]}),t(te,{status:ie.Default,message:Ha,fullWidth:!0,smallIcon:!0}),t(T,{$gap:8,$wrap:"wrap",children:c.map(e=>t(H,{"data-id":`apply-recommendation-${e.type}`,label:e.buttonText,tooltip:e.tooltip,size:W.S,variant:K.Primary,loading:r===e.type,disabled:!!r,onClick:()=>(async e=>{if(!r){s(e.type);try{(Ok(e)?await(a?.(e)):await(n?.(e.type)))&&o?.()}finally{s(void 0)}}})(e)},e.type))})]}):null};var Mk;(e=>{e.Ui="ui",e.GitOps="gitops"})(Mk||(Mk={}));const Fk=({recommendation:i,onDismiss:n,onAcceptedChange:a,onApplyServerRemediation:r,onCreateAction:s,onApplied:c})=>{const p=!i.requireOdigosDeployment&&i.remediations.some(e=>Ok(e)?!!Ek(e)&&!!s:!!r),u=i.remediations.some(({applyExamples:e})=>e.length>0),[h,g]=l(!1),[m,b]=l(!1),[f,v]=l(()=>p?Mk.Ui:Mk.GitOps),y=[...p?[{value:Mk.Ui,label:Za}]:[],...u?[{value:Mk.GitOps,label:Qa}]:[]],S=y.length>1;o(()=>()=>a?.(!1),[a]);const x=d(()=>{g(!0),a?.(!0)},[a]),I=d(async()=>{if(n&&!m){b(!0);try{await n(i.name,!0)}finally{b(!1)}}},[m,n,i.name]);return p||u?e($,{$gap:0,children:[t(pm,{open:!h,gapCancelPx:0,children:e($,{$gap:12,children:[e($,{$gap:4,children:[t(w,{size:C.XS,color:k.Primary,weight:500,children:Wa}),t(w,{size:C.XXS,color:k.Secondary,children:Ka})]}),e(T,{$gap:8,children:[t(H,{"data-id":"recommendation-accept",label:Ya,size:W.S,variant:K.Primary,onClick:x}),n&&t(H,{"data-id":"recommendation-dismiss",label:Ja,size:W.S,variant:K.Secondary,disabled:m,onClick:I})]})]})}),t(pm,{open:h,delayInMs:40,children:e($,{$gap:20,children:[S&&e($,{$gap:4,children:[t(w,{size:C.XS,color:k.Primary,weight:500,children:Wa}),t(w,{size:C.XXS,color:k.Secondary,children:qa}),t(F,{"data-id":"recommendation-installation-method",size:Zt.S,fullWidth:!0,selected:f,setSelected:v,options:y})]}),f===Mk.Ui&&p?t(_k,{recommendation:i,onApplyServerRemediation:r,onCreateAction:s,onApplied:c}):t(Lk,{remediations:i.remediations})]})})]}):null},Bk=f.ul`
|
|
1472
|
+
`,vk=({source:e,onRedirectToSampling:i})=>t(Mn,{bgTint:"1000",richTitle:{title:ke.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(xk,{container:e,onRedirectToSampling:i},e.containerName))});var yk;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(yk||(yk={}));const Sk=e=>"noisy"===e.type?jp(e.rule,"source"):"highlyRelevant"===e.type?Hp(e.rule,"source"):"costReduction"===e.type?Wp(e.rule,"source"):[],xk=({container:i,onRedirectToSampling:n})=>{const[o,r]=l(yk.All),s=da(e=>e.setPendingViewSamplingRule),c=i.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(i.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[i.agentConfig?.traces?.headSampling?.noisyOperations]),p=a(()=>(i.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[i.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=a(()=>(i.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[i.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>o===yk.Noisy?d:o===yk.HighlyRelevant?p:o===yk.CostReduction?u:[...d,...p,...u],[o,p,u]),g=d.length+p.length+u.length,m=a(()=>(e,t)=>{s({ruleId:e,category:t}),n()},[n,s]),b=t(mk,{children:t(H,{"data-id":"sampling-container-create-rule",variant:K.Secondary,size:W.S,label:Ma,rightIcon:Tu,onClick:e=>{e.stopPropagation(),n()}})});return t(bk,{children:e(Mn,{bgTint:"900",richTitle:{title:i.containerName},renderOnRightSide:b,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Mn,{bgTint:"800",richTitle:{title:ke.HEAD_SAMPLING,badge:{label:c.length}},children:[t(w,{size:C.XXS,children:ke.NOISY_OPERATIONS}),t($,{$gap:4,children:c.map(e=>t(gk,{name:e.name,summary:jp(e),disabled:e.disabled,onJumpToRule:()=>m(e.ruleId,"noisy")},e.ruleId))})]}):t(fk,{children:t(w,{size:C.XS,color:k.Secondary,children:ke.HEAD_SAMPLING})}),g?e(Mn,{bgTint:"800",richTitle:{title:ke.TAIL_SAMPLING,badge:{label:g}},children:[t(F,{options:(f=d.length,v=p.length,y=u.length,[{value:yk.All,label:"All",badge:{label:f+v+y,textSize:C.XXXS}},{value:yk.Noisy,label:ke.NOISY_OPERATIONS,badge:{label:f,textSize:C.XXXS}},{value:yk.HighlyRelevant,label:ke.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:C.XXXS}},{value:yk.CostReduction,label:ke.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:C.XXXS}}]),selected:o,setSelected:r}),t($,{$gap:4,children:h.length?h.map(e=>t(gk,{name:e.rule.name,summary:Sk(e),disabled:e.rule.disabled,onJumpToRule:()=>m(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Z,{title:`No ${o===yk.All?`${yk.Noisy}, ${yk.HighlyRelevant} and ${yk.CostReduction}`:o} operations`})})]}):t(fk,{children:t(w,{size:C.XS,color:k.Secondary,children:ke.TAIL_SAMPLING})})]})});var f,v,y},wk=[ba.Deployment,ba.StatefulSet,ba.DaemonSet,ba.DeploymentConfig,ba.Rollout,ba.Pod];var Ck;(e=>{e.Workload="Workload",e.Pod="Pod"})(Ck||(Ck={}));const kk=e=>!!e&&ia(e.status)===ie.Error,Tk=e=>kk(e.healthStatus),Ik=e=>kk(e.odigosHealthStatus)||(e.processes??[]).some(Tk),$k=e=>kk(e.agentInjectedStatus)||kk(e.odigosHealthStatus)||(e.containers??[]).some(Ik),Nk=({onClose:i,sourceId:n,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,isVm:u,platformType:h}=Vp(),{selectedStreamName:g}=Te(),{sourcesApi:m,configApi:b,capabilities:f}=Jh(),{genericForm:y,loadSource:S,validateFormData:x}=eg(),{data:w}=b.useEffectiveConfig(),[k,T]=l(!1),[I,A]=l(!1),[O,E]=l(jx.Overview),[D,z]=l(null),[R,P]=l({openFor:null}),X=(()=>{const[e,t]=l(null),i=d(e=>{t({tab:jx.Pods,podName:e.podName})},[]),n=d((e,i)=>{t({tab:jx.Pods,podName:e.podName,containerName:i.containerName})},[]),o=d((e,i,n)=>{const a=qx({identifyingAttributes:n.identifyingAttributes});t({tab:jx.Pods,podName:e.podName,containerName:i.containerName,processPid:a})},[]),r=d(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:i,jumpToContainer:n,jumpToProcess:o,clearJumpToTarget:r}),[e,i,n,o,r])})();o(()=>{X.jumpToTarget&&E(X.jumpToTarget.tab)},[X.jumpToTarget]),o(()=>{D&&JSON.stringify(pa(n))!==JSON.stringify(pa(D))&&z(null)},[n,D]);const L=p(!1),_=d(async()=>z(await m.fetchById(n)||null),[n,m]);o(()=>{if(L.current||(_(),L.current=!0),!k){const e=setInterval(()=>_(),3e3);return()=>clearInterval(e)}},[_,k]),o(()=>{D&&S(D)},[D]);const M=D&&wk.includes(D.id.kind),B=a(()=>{const e=[],i=(D?.pods??[]).some($k),n=(a=D,(a?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var a;const o=e=>t(oh,{...e,fill:s.v2.colors.red[500]});return e.push({value:jx.Overview,label:ke.OVERVIEW}),c?(e.push({value:jx.Pods,label:ke.PODS,icon:i?o:void 0}),e.push({value:jx.Libraries,label:ke.LIBRARIES,icon:n?o:void 0}),e.push({value:jx.PeerSources,label:ke.PEER_SOURCES}),w?.profiling?.enabled&&e.push({value:jx.Profiling,label:ke.PROFILING}),e.push({value:jx.Sampling,label:ke.SAMPLING}),e.push({value:jx.Debug,label:ke.DEBUG}),e):(u&&f.canFetchProfiling&&e.push({value:jx.Profiling,label:ke.PROFILING}),e)},[c,u,f.canFetchProfiling,w,D?.pods,s]),V=d(()=>T(!0),[]),U=a(()=>()=>{i(),r()},[i,r]),G=d(()=>{D&&S(D),T(!1)},[D]),j=d(async()=>{if(!D||!y)return;const{errorMessage:e,preparedFormData:t}=x();if(e)return;const i=t.otelServiceName!==D.id.name?t.otelServiceName:"";await m.update(n,{...t,otelServiceName:i}),T(!1)},[D,y,x,n,m]),H=!1===D?.markedForInstrumentation?.markedForInstrumentation,W=d(()=>A(!0),[]),Y=d(async()=>{if(!D)return;const e=!1===D.markedForInstrumentation?.markedForInstrumentation;await m.persistV2({[Nn]:[{namespace:D.id.namespace,name:D.id.name,kind:D.id.kind,...D.id.region?{region:D.id.region}:{},selected:e,currentStreamName:g}]}),A(!1),e||i()},[D,m,g,i]),J=d(()=>{P({openFor:Ck.Workload})},[]),q=d(e=>{E(e),X.clearJumpToTarget()},[X]),Z=d(async()=>{await m.recoverFromRollback(n)},[m,n]),Q=d(()=>P({openFor:null}),[]),ee=d(()=>{q(jx.Overview),z(null),i()},[q,i]),te=d(async()=>{R.openFor===Ck.Workload?await m.restartWorkloads([n]):R.openFor===Ck.Pod&&R.podNamespace&&R.podName&&await m.restartPod(R.podNamespace,R.podName),Q()},[R,m,n,Q]),ie=a(()=>{const{kind:e,name:t}=n;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[n]),ne=a(()=>{const e=[];return k||O===jx.Overview&&(e.push({id:"edit-source-btn-edit",label:zn.EDIT,icon:Au,active:k,onClick:V}),c&&M&&e.push({id:"edit-source-btn-restart",label:ke.ROLLOUT_RESTART,icon:ch,onClick:J}),e.push(H?{id:"edit-source-btn-instrument",label:zn.INSTRUMENT,icon:Tu,color:s.v2.colors.green[500],active:I,onClick:W}:{id:"edit-source-btn-delete",label:zn.UNINSTRUMENT,icon:ku,color:s.v2.colors.red[500],active:I,onClick:W})),e},[O,k,I,H,c,M,V,J,W,s]),ae=a(()=>{if(!D)return[];const e=[],t={backgroundColor:"transparent",textSize:C.S};return e.push({...t,label:D.id.name,leftIcon:c?ah:void 0}),D.serviceName&&D.serviceName!==D.id.name&&e.push({...t,label:D.serviceName,leftIcon:Qu,textColor:s.v2.colors.silver[200]}),e},[D,s,c]);if(!D)return t(ln,{isOpen:!0,header:{onClose:ee},children:t(oi,{$height:"80vh",children:t(Ve,{withSpinner:!0})})});const oe=O===jx.Profiling?"fit-content":k?void 0:"60vw",le=c?Ba(D.containers)[0]:Fa(h);return e(tw,{value:X,children:[t(ln,{isOpen:!0,width:oe,minWidth:"min(1100px, 100vw)",header:{icon:le,titleBadges:ae,onClose:ee,actions:ne},footer:{actions:k?[{"data-id":"edit-source-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:G},{"data-id":"edit-source-btn-save",label:zn.SAVE,variant:K.Primary,onClick:j}]:[]},children:t(N,{$padding:"4px 12px 12px",children:e($,{$gap:16,children:[!k&&B.length>1&&t(F,{options:B,selected:O,setSelected:q}),(()=>{switch(O){case jx.Overview:return k?t(Ib,{}):t(vC,{source:D,onClickRollout:J,onClickRollback:Z});case jx.Pods:return t(lw,{source:D,onClickRestartPod:M?(e,t)=>P({openFor:Ck.Pod,podNamespace:e,podName:t}):void 0});case jx.Libraries:return t(yC,{source:D});case jx.PeerSources:return t(sw,{source:D});case jx.Profiling:return t(sk,{source:D});case jx.Sampling:return t(vk,{source:D,onRedirectToSampling:U});case jx.Debug:return t(hw,{source:D});default:return null}})()]})})}),t(hm,{target:"source",action:H?"instrument":"uninstrument",isOpen:I,onClose:()=>A(!1),onApprove:Y}),t(Ce,{isOpen:R.openFor===Ck.Workload,title:ie.title,description:ie.description,onClose:Q,denyButton:{label:"Go back",variant:K.Secondary,onClick:Q},approveButton:{label:zn.CONFIRM,variant:K.Primary,onClick:te}}),t(hm,{target:"pod",action:"restart",description:ke.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:R.openFor===Ck.Pod,onClose:Q,onApprove:te,overrideApproveButtonLabel:ke.DELETE_POD_TO_RESTART})]})},Ak={"Cost Optimization":{icon:Sh,status:ie.Warning},Normalization:{icon:yh,status:ie.Default},Enrichment:{icon:vh,status:ie.Info},Maintenance:{icon:th,status:ie.Warning},Reliability:{icon:ju,status:ie.Success},Usability:{icon:fh,status:ie.Info}},Ok={icon:xh,status:ie.Unknown},Ek={[Va.Recommended]:ie.Info,[Va.Applied]:ie.Success,[Va.Dismissed]:ie.Disabled,[Va.NotApplicable]:ie.Unknown},Dk="Created from recommendation",zk={[Ga.EnableUrlTemplatization]:()=>({type:q.URLTemplatization,name:"URL Templatization",notes:Dk,disabled:!1,signals:[ae.Traces],fields:{}}),[Ga.EnableInferDbAttributes]:()=>({type:q.InferDbAttributes,name:"Infer DB Attributes",notes:Dk,disabled:!1,signals:[ae.Traces],fields:{}})},Rk=e=>e.applyExamples.some(({type:e})=>e===Ua.OdigosAction),Pk=e=>Rk(e)?zk[e.type]?.():void 0,Xk=e=>e.applied?Va.Applied:e.conditionsMet?e.dismissed?Va.Dismissed:Va.Recommended:Va.NotApplicable,Lk=e=>{const t={[Va.Recommended]:[],[Va.Applied]:[],[Va.Dismissed]:[],[Va.NotApplicable]:[]};for(const i of e)t[Xk(i)].push(i);return t},_k=e=>{let t=0;for(const i of e)Xk(i)===Va.Recommended&&(t+=1);return t},Mk=[Va.Recommended,Va.Applied,Va.Dismissed,Va.NotApplicable],Fk={[Ua.HelmValues]:"Helm values",[Ua.OdigosAction]:"Odigos Action"},Bk=({remediations:i})=>{const n=i.flatMap(e=>e.applyExamples.map((t,n)=>({key:`${e.type}-${t.type}-${n}`,title:i.length>1?`${Fk[t.type]||t.type} — ${e.buttonText}`:Fk[t.type]||t.type,content:t.content})));return n.length?e($,{$gap:8,children:[e($,{$gap:2,children:[t(w,{size:C.XS,color:k.Primary,weight:500,children:ja}),t(w,{size:C.XXS,color:k.Secondary,children:Ha})]}),n.map(e=>t(gm,{title:e.title,yaml:e.content,compact:!0},e.key))]}):null},Vk=({recommendation:i,onApplyServerRemediation:n,onCreateAction:a,onApplied:o})=>{const[r,s]=l(),c=i.remediations.filter(e=>Rk(e)?!!Pk(e)&&!!a:!!n);return c.length?e($,{$gap:8,children:[e($,{$gap:2,children:[t(w,{size:C.XS,color:k.Primary,weight:500,children:Wa}),t(w,{size:C.XXS,color:k.Secondary,children:Ka})]}),t(te,{status:ie.Default,message:Ya,fullWidth:!0,smallIcon:!0}),t(T,{$gap:8,$wrap:"wrap",children:c.map(e=>t(H,{"data-id":`apply-recommendation-${e.type}`,label:e.buttonText,tooltip:e.tooltip,size:W.S,variant:K.Primary,loading:r===e.type,disabled:!!r,onClick:()=>(async e=>{if(!r){s(e.type);try{(Rk(e)?await(a?.(e)):await(n?.(e.type)))&&o?.()}finally{s(void 0)}}})(e)},e.type))})]}):null};var Uk;(e=>{e.Ui="ui",e.GitOps="gitops"})(Uk||(Uk={}));const Gk=({recommendation:i,onDismiss:n,onAcceptedChange:a,onApplyServerRemediation:r,onCreateAction:s,onApplied:c})=>{const p=!i.requireOdigosDeployment&&i.remediations.some(e=>Rk(e)?!!Pk(e)&&!!s:!!r),u=i.remediations.some(({applyExamples:e})=>e.length>0),[h,g]=l(!1),[m,b]=l(!1),[f,v]=l(()=>p?Uk.Ui:Uk.GitOps),y=[...p?[{value:Uk.Ui,label:to}]:[],...u?[{value:Uk.GitOps,label:io}]:[]],S=y.length>1;o(()=>()=>a?.(!1),[a]);const x=d(()=>{g(!0),a?.(!0)},[a]),I=d(async()=>{if(n&&!m){b(!0);try{await n(i.name,!0)}finally{b(!1)}}},[m,n,i.name]);return p||u?e($,{$gap:0,children:[t(mm,{open:!h,gapCancelPx:0,children:e($,{$gap:12,children:[e($,{$gap:4,children:[t(w,{size:C.XS,color:k.Primary,weight:500,children:Ja}),t(w,{size:C.XXS,color:k.Secondary,children:qa})]}),e(T,{$gap:8,children:[t(H,{"data-id":"recommendation-accept",label:Za,size:W.S,variant:K.Primary,onClick:x}),n&&t(H,{"data-id":"recommendation-dismiss",label:Qa,size:W.S,variant:K.Secondary,disabled:m,onClick:I})]})]})}),t(mm,{open:h,delayInMs:40,children:e($,{$gap:20,children:[S&&e($,{$gap:4,children:[t(w,{size:C.XS,color:k.Primary,weight:500,children:Ja}),t(w,{size:C.XXS,color:k.Secondary,children:eo}),t(F,{"data-id":"recommendation-installation-method",size:Zt.S,fullWidth:!0,selected:f,setSelected:v,options:y})]}),f===Uk.Ui&&p?t(Vk,{recommendation:i,onApplyServerRemediation:r,onCreateAction:s,onApplied:c}):t(Bk,{remediations:i.remediations})]})})]}):null},jk=f.ul`
|
|
1473
1473
|
margin: 0;
|
|
1474
1474
|
padding-left: 18px;
|
|
1475
1475
|
display: flex;
|
|
1476
1476
|
flex-direction: column;
|
|
1477
1477
|
gap: 4px;
|
|
1478
|
-
`,
|
|
1478
|
+
`,Hk=f.li`
|
|
1479
1479
|
color: ${({theme:e})=>e.v2.colors.grey[300]};
|
|
1480
|
-
`,
|
|
1480
|
+
`,Wk=f.div`
|
|
1481
1481
|
display: grid;
|
|
1482
1482
|
grid-template-columns: 1fr;
|
|
1483
1483
|
gap: 16px;
|
|
1484
1484
|
width: 100%;
|
|
1485
1485
|
padding-top: 16px;
|
|
1486
1486
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1487
|
-
`,
|
|
1487
|
+
`,Kk=f($)`
|
|
1488
1488
|
min-width: 0;
|
|
1489
|
-
`,
|
|
1489
|
+
`,Yk=f.div`
|
|
1490
1490
|
display: flex;
|
|
1491
1491
|
align-items: center;
|
|
1492
1492
|
justify-content: center;
|
|
@@ -1495,7 +1495,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1495
1495
|
flex-shrink: 0;
|
|
1496
1496
|
border: 1px solid ${({theme:e})=>e.v2.colors.green[600]};
|
|
1497
1497
|
border-radius: 50%;
|
|
1498
|
-
`,
|
|
1498
|
+
`,Jk=f.div`
|
|
1499
1499
|
width: 100%;
|
|
1500
1500
|
min-width: 0;
|
|
1501
1501
|
|
|
@@ -1512,28 +1512,28 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1512
1512
|
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
|
|
1513
1513
|
transform: translateY(-1px);
|
|
1514
1514
|
}
|
|
1515
|
-
`,
|
|
1515
|
+
`,qk=f(T)`
|
|
1516
1516
|
width: 100%;
|
|
1517
1517
|
padding-top: 4px;
|
|
1518
|
-
`,
|
|
1518
|
+
`,Zk=({recommendation:i,state:n,onDismiss:a,onApplyServerRemediation:o,onCreateAction:r,onRemediationApplied:s})=>{const c=v(),[p,u]=l(!1),[h,g]=l(!1),m=n===Va.NotApplicable?no:i.summary,b=i.description.trim().split(/\n\s*\n/).map(e=>e.replace(/\s+/g," ").trim()).filter(Boolean),f=(y=i.categories[0])&&Ak[y]||Ok;var y;const S=n===Va.Recommended&&i.conditionsMet,x=S&&!h,I=n===Va.Recommended&&!!a&&!x,N=n===Va.Dismissed&&!!a,A=n===Va.Recommended?void 0:{key:n,label:ao[n],status:Ek[n],useSecondaryTone:!0,textSize:C.XXXS},O=d(async()=>{if(a&&!p){u(!0);try{await a(i.name,n!==Va.Dismissed)}finally{u(!1)}}},[a,p,i.name,n]);return t(Jk,{children:t(Mn,{bgTint:"900",moreSpacing:!0,withCollapse:!0,badges:A?[A]:[],richTitle:{icon:f.icon,title:i.title,titleSize:C.S,titleWrap:!0,titleMeta:i.categories.join(" · "),subTitle:m,subTitleSize:C.XXS,subTitleWrap:!0,textGap:6,alignItems:"flex-start"},children:e($,{$gap:16,children:[t(mm,{open:!h,gapCancelPx:16,children:e($,{$gap:16,children:[b.length>0&&t($,{$gap:8,children:b.map(e=>t(w,{size:C.XS,color:k.Secondary,lineHeight:"20px",children:e},e))}),(i.pros.length>0||i.cons.length>0)&&e(Wk,{children:[i.pros.length>0&&e(Kk,{$gap:8,children:[e(T,{$gap:8,children:[t(Yk,{children:t(Fu,{size:10,fill:c.v2.colors.green[600]})}),t(w,{size:C.XS,weight:400,color:k.Primary,children:oo})]}),t(jk,{children:i.pros.slice(0,3).map(e=>t(Hk,{children:t(w,{size:C.XXS,color:k.Secondary,variant:Tn.Span,children:e})},e))})]}),i.cons.length>0&&e(Kk,{$gap:8,children:[e(T,{$gap:8,children:[t(oh,{size:18,fill:c.v2.colors.orange[500]}),t(w,{size:C.XS,weight:400,color:k.Primary,children:lo})]}),t(jk,{children:i.cons.slice(0,3).map(e=>t(Hk,{children:t(w,{size:C.XXS,color:k.Secondary,variant:Tn.Span,children:e})},e))})]})]})]})}),S&&t(Gk,{recommendation:i,onDismiss:a,onAcceptedChange:g,onApplyServerRemediation:o,onCreateAction:r,onApplied:s}),e(qk,{$gap:8,$justifyContent:"flex-end",children:[i.docsUrl&&t(H,{label:ro,leftIcon:$u,size:W.S,variant:K.Text,onClick:()=>window.open(i.docsUrl,"_blank","noopener noreferrer")}),I&&t(H,{label:Qa,size:W.S,variant:K.Secondary,disabled:p,onClick:O}),N&&t(H,{label:so,size:W.S,variant:K.Secondary,disabled:p,onClick:O})]})]})})})},Qk=f.div`
|
|
1519
1519
|
width: 100%;
|
|
1520
1520
|
min-width: 0;
|
|
1521
1521
|
max-width: 100%;
|
|
1522
1522
|
padding: 8px 16px 20px;
|
|
1523
|
-
`,
|
|
1524
|
-
opacity: ${({$state:e})=>e===
|
|
1523
|
+
`,eT=f($)`
|
|
1524
|
+
opacity: ${({$state:e})=>e===Va.Applied?.78:1};
|
|
1525
1525
|
transition: opacity 0.15s ease;
|
|
1526
1526
|
|
|
1527
1527
|
&:hover {
|
|
1528
1528
|
opacity: 1;
|
|
1529
1529
|
}
|
|
1530
|
-
`,
|
|
1530
|
+
`,tT=f(T)`
|
|
1531
1531
|
width: 100%;
|
|
1532
1532
|
min-height: 28px;
|
|
1533
1533
|
padding-left: 10px;
|
|
1534
1534
|
border-left: 2px solid
|
|
1535
|
-
${({theme:e,$state:t})=>t===
|
|
1536
|
-
`,
|
|
1535
|
+
${({theme:e,$state:t})=>t===Va.Recommended?e.v2.colors.purple[500]:t===Va.Applied?e.v2.colors.green[500]:e.v2.colors.grey[500]};
|
|
1536
|
+
`,iT=({isOpen:i,onClose:n})=>{const{actionsApi:l,capabilities:r,recommendationsApi:s}=Jh(),{items:c,loading:u,refetch:h}=s.useRecommendations(),g=p([]),m=p(h);m.current=h,o(()=>{i&&m.current()},[i]),o(()=>()=>{g.current.forEach(clearTimeout)},[]);const b=d(()=>{g.current.forEach(clearTimeout),g.current=[2e3,5e3,1e4].map(e=>setTimeout(()=>{m.current()},e))},[]),f=d(async(e,t)=>{if(!s.applyRemediation)return!1;const i=await s.applyRemediation(e,t);return!i?.error},[s]),v=d(async e=>{const t=Pk(e);if(!t)return!1;const i=await l.create(t);return!i?.error},[l]),y=a(()=>Lk(c),[c]),S=c.length>0;return t(ln,{isOpen:i,width:"min(700px, 100vw)",header:{icon:xh,title:po,subTitle:co,onClose:n},children:t(Qk,{children:u&&!S?t(A,{size:3}):S?t($,{$gap:28,$width:"100%",children:Mk.map(i=>{const n=y[i];return 0===n.length?null:e(eT,{$state:i,$gap:12,$width:"100%",children:[e(tT,{$state:i,$gap:8,$justifyContent:"space-between",children:[t(w,{size:C.XS,weight:600,color:i===Va.Recommended?k.Primary:k.Secondary,children:ao[i]}),t(E,{label:n.length,status:Ek[i],useSecondaryTone:!0,textSize:C.XXXS})]}),t($,{$gap:12,$width:"100%",children:n.map(e=>t(Zk,{recommendation:e,state:i,onDismiss:s.setDismissed,onApplyServerRemediation:s.applyRemediation?t=>f(e.type,t):void 0,onCreateAction:r.canCreateAction?v:void 0,onRemediationApplied:b},e.name))})]},i)})}):t(Z,{icon:xh,title:ho,subTitle:uo})})})},nT=f.div`
|
|
1537
1537
|
display: flex;
|
|
1538
1538
|
align-items: center;
|
|
1539
1539
|
gap: 8px;
|
|
@@ -1543,13 +1543,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1543
1543
|
&:hover {
|
|
1544
1544
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1545
1545
|
}
|
|
1546
|
-
`,
|
|
1546
|
+
`,aT=f.div`
|
|
1547
1547
|
flex: 1;
|
|
1548
|
-
`,
|
|
1548
|
+
`,oT=({onClick:i})=>{const n=v().v2.colors.red[500];return e(nT,{"data-id":"sampling-view-btn-delete",onClick:i,children:[t(w,{size:C.XS,weight:500,color:n,children:fo}),t(ku,{size:16,fill:n})]})};const lT={[ig.EditAutoNoisy]:{title:Eo,subTitle:Oo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[ig.EditAutoCostReduction]:{title:Ao,subTitle:No,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[ig.EditAutoHighlyRelevant]:{title:$o,subTitle:Io,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},rT=({isOpen:e,title:i,subTitle:n,onClose:a,footer:o,renderBody:l})=>t(ln,{isOpen:e,width:zo,header:{icon:Sh,title:i,subTitle:n,onClose:a},footer:o,children:l?l():t(N,{$padding:"12px",children:t(Db,{})})}),sT=({isOpen:n,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:g,duplicateWarning:m,setDuplicateWarning:b}=tg(ig.Create),[f,v]=l(!1);o(()=>{n&&(g(),v(!1))},[n]);const y=d(()=>{v(!1),s(h)},[h,s]),S=d(()=>{if(c){const e=c(h);if(e)return void b(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(Kp(t)))(h,u)?v(!0):y()},[h,u,c,b,y]),x=a(()=>f?((e,t)=>{switch(e){case"noisy":return jp(qp(t));case"highlyRelevant":return Hp(Jp(t));case"costReduction":return Wp(Yp(t))}})(u,h):[],[f,u,h]),T={note:m?{status:ie.Warning,message:m.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(m.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:go,variant:K.Secondary,size:W.S,onClick:r},{"data-id":"sampling-create-btn-submit",label:Ma,variant:K.Primary,size:W.S,onClick:S,disabled:!!m}]};return e(i,{children:[t(rT,{isOpen:n,title:xo[u],subTitle:vo[u],onClose:r,footer:T}),t(Ce,{isOpen:f,title:ko,description:Co,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:wo,variant:K.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Ma,variant:K.Primary,onClick:y},children:e($,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(w,{size:C.XS,weight:500,color:k.Secondary,children:To}),t("div",{style:{width:"100%"},children:t(tm,{summary:x})})]})})]})},cT=({onClose:n,onDelete:o,onSaveEdit:l,validateForm:r,onNavigateToDuplicate:s})=>{const{data:c,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:g,duplicateWarning:m,setDuplicateWarning:b}=tg(ig.View),f=c?.rule.name||So,v=p&&c?yo[c.category]:`${f} preview`,y=d(()=>{if(c&&p){if(r){const e=r(u);if(e)return void b(e)}l(u,c.rule.ruleId,c.samplingId),g()}},[c,p,u,l,r,b,g]),S=d(()=>{c&&o(c.rule.ruleId,c.samplingId)},[c,o]),x=a(()=>{if(!c)return;const a=m?{message:m.message,onViewRule:s?()=>s(m.ruleId):void 0}:null;return function(n){if(n.isEditing){const{onCancelEdit:a,onSave:o,onDelete:l,duplicateWarning:r}=n;return{children:e(i,{children:[t(oT,{onClick:l}),r&&t(te,{status:ie.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(aT,{}),t(H,{"data-id":"sampling-view-edit-btn-cancel",label:go,variant:K.Secondary,size:W.S,onClick:a}),t(H,{"data-id":"sampling-view-edit-btn-save",label:mo,variant:K.Primary,size:W.S,onClick:o,disabled:!!r})]})}}const{onDelete:a,onCancel:o,onEdit:l}=n;return{children:e(i,{children:[t(oT,{onClick:a}),t(aT,{}),t(H,{"data-id":"sampling-view-btn-cancel",label:go,variant:K.Secondary,size:W.S,onClick:o}),t(H,{"data-id":"sampling-view-btn-edit",label:bo,variant:K.Primary,size:W.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:g,onSave:y,onDelete:S,duplicateWarning:a}:{isEditing:!1,onDelete:S,onCancel:n,onEdit:h})},[c,p,m,g,y,S,h,n,s]);return t(rT,{isOpen:!!c,title:v,subTitle:c?vo[c.category]:"",onClose:n,footer:x})},dT=({isOpen:e,onClose:i,onSave:n})=>{const{localEnabled:a,resolvedPercentage:o}=tg(ig.EditAutoNoisy),l=d(()=>n(a,o),[n,a,o]);return t(hT,{formType:ig.EditAutoNoisy,isOpen:e,onClose:i,onSave:l})},pT=({isOpen:e,onClose:i,onSave:n})=>{const{localEnabled:a,resolvedPercentage:o}=tg(ig.EditAutoCostReduction),l=d(()=>n(a,o),[n,a,o]);return t(hT,{formType:ig.EditAutoCostReduction,isOpen:e,onClose:i,onSave:l})},uT=({isOpen:e,onClose:i,onSave:n})=>{const{localEnabled:a}=tg(ig.EditAutoHighlyRelevant),o=d(()=>n(a),[n,a]);return t(hT,{formType:ig.EditAutoHighlyRelevant,isOpen:e,onClose:i,onSave:o})},hT=({formType:e,isOpen:i,onClose:n,onSave:a})=>{const o=lT[e];return t(rT,{isOpen:i,title:o.title,subTitle:o.subTitle,onClose:n,footer:{actions:[{"data-id":o.cancelId,label:go,variant:K.Secondary,size:W.S,onClick:n},{"data-id":o.saveId,label:Do,variant:K.Primary,size:W.S,onClick:a}]}})},gT=e=>{switch(e.formType){case ig.Create:return t(Ng,{formType:ig.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(sT,{...e})});case ig.View:return t(Ng,{formType:ig.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(cT,{...e})});case ig.EditAutoNoisy:return t(Ng,{formType:ig.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(dT,{...e})});case ig.EditAutoCostReduction:return t(Ng,{formType:ig.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(pT,{...e})});case ig.EditAutoHighlyRelevant:return t(Ng,{formType:ig.EditAutoHighlyRelevant,enabled:e.enabled,children:t(uT,{...e})})}};function mT(){return{scopes:Qp(),enabled:!0,skipForNonSuccessCodes:!1,skipSelectedHttpStatusCodes:!1,skipHttpStatusCodesInput:""}}function bT(e){const t=e.trim();if(!t)return[];const i=[];for(const e of t.split(",")){const t=e.trim();if(!t)continue;if(!/^\d+$/.test(t))return null;const n=Number(t);if(n<100||n>599)return null;i.push(n)}return i}function fT(e){const t=e.skipSelectedHttpStatusCodes?bT(e.skipHttpStatusCodesInput)??[]:[],i=e.skipForNonSuccessCodes||t.length>0;return{scopes:Zp(e.scopes)?null:e.scopes,disabled:!e.enabled,skipPolicy:i?{skipForNonSuccessCodes:e.skipForNonSuccessCodes,skipHttpStatusCodes:t}:null}}function vT(e){return{destination:"template-group",groupMode:e?.hasExistingGroups?"existing":"new",existingGroupIndex:null,targetActionId:e?.defaultActionId??null,createNewAction:!1,newActionName:"",scopes:Qp(),templates:[""],replaceExistingGroupTemplates:!1}}function yT(e){if(e.scopes&&!Zp(e.scopes))return Up(e.scopes);const t=Qp();return e.filterK8sNamespace&&(t.namespaces=[e.filterK8sNamespace]),e.filterProgrammingLanguage&&(t.languages=[e.filterProgrammingLanguage]),e.workloadFilters?.length?t.sources=e.workloadFilters.filter(e=>!!e.name).map(t=>({namespace:e.filterK8sNamespace||"",kind:t.kind||"Deployment",name:t.name||""})):e.filterK8sWorkloadName&&(t.sources=[{namespace:e.filterK8sNamespace||"",kind:e.filterK8sWorkloadKind||"Deployment",name:e.filterK8sWorkloadName}]),t}function ST(e){return[...e].sort((e,t)=>e.localeCompare(t))}function xT(e,t,i){return e.map((e,t)=>({option:e,index:t})).filter(({option:e})=>(!i?.uiManagedOnly||e.actionName===Ro)&&((e,t)=>{const i=Up(e),n=Up(t),a=ST(i.sources.map(e=>`${e.namespace}/${e.kind}/${e.name}`)),o=ST(n.sources.map(e=>`${e.namespace}/${e.kind}/${e.name}`));if(a.length!==o.length||a.some((e,t)=>e!==o[t]))return!1;const l=ST(i.namespaces),r=ST(n.namespaces);if(l.length!==r.length||l.some((e,t)=>e!==r[t]))return!1;const s=ST(i.languages),c=ST(n.languages);return s.length===c.length&&s.every((e,t)=>e===c[t])})(yT(e.group),t))}function wT(e,t){const i=t?.defaultActionName??Ro,n=t?.defaultActionId??null;return e.findIndex(e=>(n&&e.actionId===n||e.actionName===i)&&Zp(yT(e.group)))}const CT=f.span`
|
|
1549
1549
|
color: ${({$color:e})=>e};
|
|
1550
|
-
`,
|
|
1550
|
+
`,kT=f.span`
|
|
1551
1551
|
padding-inline: 0.125em;
|
|
1552
|
-
`,
|
|
1552
|
+
`,TT=f(T)`
|
|
1553
1553
|
min-width: 0;
|
|
1554
1554
|
|
|
1555
1555
|
.url-templatization-template-copy {
|
|
@@ -1562,14 +1562,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1562
1562
|
opacity: 1;
|
|
1563
1563
|
pointer-events: auto;
|
|
1564
1564
|
}
|
|
1565
|
-
`,
|
|
1565
|
+
`,IT=({template:i,size:n=C.XXS,copyable:a,"data-id":o})=>{const l=v(),{clickCopy:r,isCopied:s}=En(),c=i.split(/(\/|\{[^}]+\}|\*)/g).filter(Boolean),d=t(w,{size:n,nowrap:!0,children:c.map((e,i)=>"/"===e?t(kT,{children:"/"},`slash-${i}`):e.startsWith("{")&&e.endsWith("}")?t(CT,{$color:l.v2.colors.purple[300],children:e},`${e}-${i}`):"*"===e?t(CT,{$color:l.v2.colors.orange[500],children:e},`${e}-${i}`):t("span",{children:e},`${e}-${i}`))});return a?e(TT,{$gap:4,$alignItems:"center",children:[d,t("span",{className:"url-templatization-template-copy",children:t(bn,{"data-id":o?`${o}-copy`:"url-templatization-copy-template",icon:s?Fu:uh,size:fn.XS,onClick:e=>{e.stopPropagation(),r(i)}})})]}):d},$T=e=>e.filter(e=>e.type===q.URLTemplatization);function NT(e){return{matched:!1,captures:[],templatedPath:"",mismatchReason:e}}function AT(e){return""===e?'""':`"${e}"`}function OT(e,t){const i=(e=>{const t=e.trim();if(!t)return"";if(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(t))try{return new URL(t).pathname}catch{return t.split("?")[0].split("#")[0]}return t.split("?")[0].split("#")[0]})(t);if(!e.trim())return NT("Template is empty.");if(!i)return NT("URL path is empty.");const n=(e=>{let t=e.split("/");return e.startsWith("/")&&(t=t.slice(1)),t.map(e=>"*"===e?{kind:"wildcard"}:e.startsWith("{")&&e.endsWith("}")?{kind:"param",name:e.slice(1,-1).trim()||"id"}:{kind:"static",value:e})})(e.trim()),{segments:a,hadLeadingSlash:o}=(e=>{const t=e.startsWith("/"),i=t?e.slice(1):e;return""===i?{segments:[""],hadLeadingSlash:t}:{segments:i.split("/"),hadLeadingSlash:t}})(i);if(n.length!==a.length)return NT(`Different number of path segments: template has ${n.length}, URL has ${a.length}.`);const l=[],r=[];for(let e=0;e<n.length;e++){const t=n[e],i=a[e];if("static"!==t.kind)"param"!==t.kind?r.push(i):(l.push({name:t.name,value:i}),r.push(`{${t.name}}`));else{if(t.value!==i)return NT(`Static segment at position ${e+1} does not match: expected ${AT(t.value)}, got ${AT(i)}.`);r.push(t.value)}}const s=r.join("/");return{matched:!0,captures:l,templatedPath:o?`/${s}`:s}}const ET=f($)`
|
|
1566
1566
|
width: 100%;
|
|
1567
1567
|
gap: ${({$open:e})=>e?"16px":"0"};
|
|
1568
1568
|
padding: 12px;
|
|
1569
1569
|
border-radius: 12px;
|
|
1570
1570
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1571
1571
|
background: transparent;
|
|
1572
|
-
`,
|
|
1572
|
+
`,DT=f.button`
|
|
1573
1573
|
display: flex;
|
|
1574
1574
|
align-items: ${({$alignStart:e})=>e?"flex-start":"center"};
|
|
1575
1575
|
gap: 8px;
|
|
@@ -1579,55 +1579,55 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1579
1579
|
background: transparent;
|
|
1580
1580
|
cursor: pointer;
|
|
1581
1581
|
text-align: left;
|
|
1582
|
-
`,
|
|
1582
|
+
`,zT=f(T)`
|
|
1583
1583
|
align-items: flex-start;
|
|
1584
1584
|
gap: 4px;
|
|
1585
1585
|
flex: 1;
|
|
1586
1586
|
min-width: 0;
|
|
1587
|
-
`,
|
|
1587
|
+
`,RT=f($)`
|
|
1588
1588
|
gap: 2px;
|
|
1589
1589
|
min-width: 0;
|
|
1590
|
-
`,
|
|
1590
|
+
`,PT=f.span`
|
|
1591
1591
|
display: inline-flex;
|
|
1592
1592
|
flex-shrink: 0;
|
|
1593
1593
|
transform: rotate(${({$open:e})=>e?90:0}deg);
|
|
1594
1594
|
transition: transform 0.15s ease;
|
|
1595
|
-
`,
|
|
1595
|
+
`,XT=f.div`
|
|
1596
1596
|
width: 100%;
|
|
1597
|
-
`,
|
|
1597
|
+
`,LT=({label:i,summary:n,description:a,children:o,defaultOpen:r=!1,"data-id":s})=>{const[c,d]=l(r),p=!c&&!!a;return e(ET,{"data-id":s,$open:c,children:[e(DT,{type:"button","aria-expanded":c,$alignStart:p,onClick:()=>d(e=>!e),children:[e(zT,{children:[t(PT,{$open:c,children:t(wu,{size:18})}),e(RT,{children:[t(w,{size:C.XXS,children:i}),p&&t(w,{size:C.XXXS,color:k.Secondary,children:a})]})]}),!c&&!!n&&t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:n})]}),c?t(XT,{children:o}):null]})},_T=f($)`
|
|
1598
1598
|
gap: 16px;
|
|
1599
1599
|
width: 100%;
|
|
1600
|
-
`,
|
|
1600
|
+
`,MT=f.div`
|
|
1601
1601
|
display: grid;
|
|
1602
1602
|
grid-template-columns: 1fr 1fr;
|
|
1603
1603
|
gap: 12px;
|
|
1604
1604
|
width: 100%;
|
|
1605
|
-
`,
|
|
1605
|
+
`,FT=f($)`
|
|
1606
1606
|
gap: 12px;
|
|
1607
1607
|
width: 100%;
|
|
1608
|
-
`,
|
|
1608
|
+
`,BT=f($)`
|
|
1609
1609
|
gap: 12px;
|
|
1610
1610
|
width: 100%;
|
|
1611
|
-
`,
|
|
1611
|
+
`,VT=f($)`
|
|
1612
1612
|
gap: 8px;
|
|
1613
1613
|
width: 100%;
|
|
1614
|
-
`,
|
|
1614
|
+
`,UT=f.div`
|
|
1615
1615
|
display: flex;
|
|
1616
1616
|
align-items: center;
|
|
1617
1617
|
flex-wrap: wrap;
|
|
1618
1618
|
gap: 8px;
|
|
1619
1619
|
min-width: 0;
|
|
1620
|
-
`,
|
|
1620
|
+
`,GT=f.div`
|
|
1621
1621
|
display: flex;
|
|
1622
1622
|
align-items: center;
|
|
1623
1623
|
gap: 6px;
|
|
1624
1624
|
min-width: 0;
|
|
1625
|
-
`,
|
|
1625
|
+
`,jT=f.span`
|
|
1626
1626
|
width: 1px;
|
|
1627
1627
|
height: 12px;
|
|
1628
1628
|
flex-shrink: 0;
|
|
1629
1629
|
background: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1630
|
-
`,
|
|
1630
|
+
`,HT=({formState:n,existingGroups:o,templatizationActions:l=[],defaultActionId:r=null,defaultActionName:s=Ro,onChange:c,onAddToExistingGroup:d,sourceOptions:p=[],namespaceOptions:u=[]})=>{const h=v(),g="template-group"===n.destination,m=!Zp(n.scopes),b=a(()=>m?xT(o,n.scopes,{uiManagedOnly:!0}):[],[o,n.scopes,m]),f=a(()=>b.length?b.find(({index:e})=>n.existingGroupIndex===e)??b[0]:null,[n.existingGroupIndex,b]),y="existing"===n.groupMode&&null!==n.existingGroupIndex,S="new"===n.groupMode&&!!b.length,x=m&&0===b.length,T=a(()=>l.filter(e=>(e.name||s)!==s).map(e=>({id:e.id,label:e.name||s})),[s,l]),I=a(()=>[...T,{id:Xo,label:Po}],[T]),N=x&&(!n.createNewAction||n.newActionName.trim()===Ro)&&(!n.targetActionId||n.targetActionId===r),A=x&&!N,O=A&&n.createNewAction,D=a(()=>A?n.createNewAction?[Xo]:n.targetActionId&&T.some(e=>e.id===n.targetActionId)?[n.targetActionId]:T[0]?[T[0].id]:[Xo]:[],[n.createNewAction,n.targetActionId,A,T]),z=a(()=>n.createNewAction?n.newActionName.trim()||Lo:T.find(e=>e.id===n.targetActionId)?.label??_o,[n.createNewAction,n.newActionName,n.targetActionId,T]),R=()=>r?{createNewAction:!1,newActionName:"",targetActionId:r}:{createNewAction:!0,newActionName:Ro,targetActionId:null},P=e=>{if("entire-cluster"===e){const e=wT(o,{defaultActionId:r,defaultActionName:s});return e>=0?void d(e,{destination:"entire-cluster"}):void c({destination:"entire-cluster",groupMode:"new",existingGroupIndex:null,replaceExistingGroupTemplates:!1,scopes:vT().scopes,...R()})}c({destination:e,groupMode:"new",existingGroupIndex:null,replaceExistingGroupTemplates:!1,scopes:vT().scopes,...R()})},X=f?(f.option.group.templatizationRules??[]).filter(e=>!!e.template?.trim()).length:0,L=f?.option.actionName||s,_=y?h.v2.colors.purple[200]:h.v2.colors.silver[200],M=N?il:O?Lo:z;return t(Re,{richTitle:{title:Mo,alignItems:"flex-start"},children:e(_T,{children:[e(MT,{"data-id":"url-templatization-custom-destination",children:[t(Dn,{"data-id":"url-templatization-custom-destination-specific-scope",title:Bo,description:Fo,checked:g,onChange:()=>P("template-group")}),t(Dn,{"data-id":"url-templatization-custom-destination-entire-cluster",title:Uo,description:Vo,badge:t(E,{label:Go,backgroundColor:h.v2.colors.purple[700],textColor:h.v2.colors.white[500],textSize:C.XXXS}),checked:!g,onChange:()=>P("entire-cluster")})]}),g&&e(i,{children:[t(em,{scopes:n.scopes,onChange:e=>{const t=xT(o,e,{uiManagedOnly:!0});t.length>=1?c({scopes:e,groupMode:"existing",existingGroupIndex:t[0].index,createNewAction:!1,newActionName:"",targetActionId:t[0].option.actionId,replaceExistingGroupTemplates:!1}):c({scopes:e,groupMode:"new",existingGroupIndex:null,replaceExistingGroupTemplates:!1,...R()})},sourceOptions:p,namespaceOptions:u,dataIdPrefix:"url-templatization-custom-destination-scope",title:Ho,subTitle:jo,icon:Hu,hideLogicNote:!0,hideEntireClusterNote:!0,defaultScopeTab:"source"}),!!b.length&&f&&t(Re,{richTitle:{icon:e=>t(zu,{...e,fill:h.v2.colors.green[500]}),title:Ko,subTitle:Wo,subTitleWrap:!0,alignItems:"flex-start"},children:e(FT,{"data-id":"url-templatization-custom-scope-conflict",children:[t(Dn,{"data-id":"url-templatization-custom-add-to-existing-group",title:Yo,badge:t(E,{label:qo,leftIcon:kh,backgroundColor:h.v2.colors.purple[700],textColor:h.v2.colors.white[500],textSize:C.XXXS}),description:e(UT,{children:[e(GT,{children:[t(wh,{size:14,fill:_}),t(w,{size:C.XXS,color:_,nowrap:!0,children:L})]}),t(jT,{}),e(GT,{children:[t(Ch,{size:14,fill:_}),t(w,{size:C.XXS,color:_,nowrap:!0,children:Jo(X)})]})]}),checked:y,onChange:()=>{f&&c({groupMode:"existing",existingGroupIndex:f.index,createNewAction:!1,newActionName:"",targetActionId:f.option.actionId,replaceExistingGroupTemplates:!1})}}),t(Dn,{"data-id":"url-templatization-custom-create-separate-group",title:Qo,description:Zo,checked:S,onChange:()=>{c({groupMode:"new",existingGroupIndex:null,replaceExistingGroupTemplates:!1,createNewAction:!0,newActionName:"",targetActionId:null})},body:S?e($,{$gap:4,children:[t(w,{size:C.XXXS,color:k.Secondary,children:el}),t(Y,{"data-id":"url-templatization-custom-separate-action-name",width:"100%",placeholder:tl,value:n.newActionName,hideFocusOutline:!0,onChange:e=>c({newActionName:e.target.value})})]}):void 0})]})}),x&&t(LT,{"data-id":"url-templatization-custom-advanced-settings",label:nl,description:M,children:e(BT,{children:[t(Dn,{"data-id":"url-templatization-custom-use-default-action",title:ol,description:al,badge:t(E,{label:qo,leftIcon:kh,backgroundColor:h.v2.colors.purple[700],textColor:h.v2.colors.white[500],textSize:C.XXXS}),checked:N,onChange:()=>{c({groupMode:"new",existingGroupIndex:null,replaceExistingGroupTemplates:!1,...R()})}}),t(Dn,{"data-id":"url-templatization-custom-select-action",title:rl,description:ll,checked:A,onChange:()=>{if(A)return;const e=T[0];c(e?{groupMode:"new",existingGroupIndex:null,replaceExistingGroupTemplates:!1,createNewAction:!1,newActionName:"",targetActionId:e.id}:{groupMode:"new",existingGroupIndex:null,replaceExistingGroupTemplates:!1,createNewAction:!0,newActionName:"",targetActionId:null})},body:A?e(VT,{children:[t(w,{size:C.XXXS,color:k.Secondary,children:sl}),t(Me,{"data-id":"url-templatization-custom-advanced-action",width:"100%",placeholder:rl,options:I,values:D,hideFocusOutline:!0,setValues:e=>{return t=e[0]??null,void c(t&&t!==Xo?{groupMode:"new",existingGroupIndex:null,replaceExistingGroupTemplates:!1,createNewAction:!1,newActionName:"",targetActionId:t}:{groupMode:"new",existingGroupIndex:null,replaceExistingGroupTemplates:!1,createNewAction:!0,newActionName:"",targetActionId:null});var t}}),O&&e(i,{children:[t(w,{size:C.XXXS,color:k.Secondary,children:el}),t(Y,{"data-id":"url-templatization-custom-advanced-action-name",width:"100%",placeholder:tl,value:n.newActionName,hideFocusOutline:!0,onChange:e=>c({newActionName:e.target.value})})]})]}):void 0})]})})]})]})})},WT=f.span`
|
|
1631
1631
|
display: inline-flex;
|
|
1632
1632
|
align-items: center;
|
|
1633
1633
|
align-self: center;
|
|
@@ -1638,13 +1638,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1638
1638
|
& > div > div {
|
|
1639
1639
|
border-radius: 6px;
|
|
1640
1640
|
}
|
|
1641
|
-
`;function
|
|
1641
|
+
`;function KT(e,t,i){const n=i??(e=>e===Ro)(e);return{label:n?pl:ul,tooltip:n?cl:dl,backgroundColor:n?"#062A31":t.v2.colors.silver[600],textColor:n?"#4CD1F2":t.v2.colors.white[500],textSize:C.XXXS}}const YT=({actionName:e,uiManaged:i})=>{const n=KT(e,v(),i);return t(WT,{onClick:e=>e.stopPropagation(),children:t(E,{...n})})},JT=f($)`
|
|
1642
1642
|
width: 100%;
|
|
1643
1643
|
gap: ${({$open:e})=>e?"12px":"0"};
|
|
1644
1644
|
padding: 12px 16px;
|
|
1645
1645
|
border-radius: 12px;
|
|
1646
1646
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1647
|
-
`,
|
|
1647
|
+
`,qT=f.button`
|
|
1648
1648
|
display: flex;
|
|
1649
1649
|
align-items: center;
|
|
1650
1650
|
gap: 12px;
|
|
@@ -1654,48 +1654,48 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1654
1654
|
background: transparent;
|
|
1655
1655
|
cursor: pointer;
|
|
1656
1656
|
text-align: left;
|
|
1657
|
-
`,
|
|
1657
|
+
`,ZT=f(T)`
|
|
1658
1658
|
align-items: center;
|
|
1659
1659
|
gap: 8px;
|
|
1660
1660
|
min-width: 0;
|
|
1661
1661
|
flex: 1;
|
|
1662
|
-
`,
|
|
1662
|
+
`,QT=f(T)`
|
|
1663
1663
|
align-items: center;
|
|
1664
1664
|
gap: 8px;
|
|
1665
1665
|
flex-shrink: 0;
|
|
1666
|
-
`,
|
|
1666
|
+
`,eI=f.span`
|
|
1667
1667
|
width: 1px;
|
|
1668
1668
|
height: 16px;
|
|
1669
1669
|
flex-shrink: 0;
|
|
1670
1670
|
background: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1671
|
-
`,
|
|
1671
|
+
`,tI=f($)`
|
|
1672
1672
|
gap: 12px;
|
|
1673
1673
|
width: 100%;
|
|
1674
1674
|
padding-top: 4px;
|
|
1675
|
-
`,
|
|
1675
|
+
`,iI=f.div`
|
|
1676
1676
|
display: flex;
|
|
1677
1677
|
flex-wrap: wrap;
|
|
1678
1678
|
gap: 8px;
|
|
1679
|
-
`,
|
|
1679
|
+
`,nI=({title:i,count:n,children:a})=>e($,{$gap:6,children:[e(T,{$gap:8,$alignItems:"center",children:[t(w,{size:C.XS,color:k.Primary,nowrap:!0,children:i}),n>1&&t(w,{size:C.XXS,color:k.Secondary,nowrap:!0,children:`(${Cl})`})]}),t(iI,{children:a})]}),aI=({actionName:n,uiManaged:o,scopes:r,"data-id":s})=>{const c=v(),[d,p]=l(!1),u=a(()=>(e=>{if(Zp(e))return vl;const t=e.sources?.length??0,i=e.namespaces?.length??0,n=e.languages?.length??0;return[t>0,i>0,n>0].filter(Boolean).length>1?yl(t+i+n):t>0?Sl(t):i>0?xl(i):wl(n)})(r),[r]),h=Zp(r),g=r.sources??[],m=r.namespaces??[],b=r.languages??[],f=c.v2.colors.silver[200];return e(JT,{"data-id":s,$open:d,children:[e(qT,{type:"button","aria-expanded":d,onClick:()=>p(e=>!e),children:[e(ZT,{children:[t(bh,{size:16,fill:f}),t(w,{size:C.S,nowrap:!0,children:n}),t(YT,{actionName:n,uiManaged:o})]}),t(eI,{}),e(QT,{children:[t(Th,{size:16,fill:f}),t(w,{size:C.XXS,color:k.Secondary,nowrap:!0,children:u}),t(d?Uu:Gu,{size:16,fill:f})]})]}),d&&t(tI,{children:h?t(w,{size:C.XXS,color:k.Secondary,children:hl}):e(i,{children:[!!g.length&&t(nI,{title:gl,count:g.length,children:g.map((e,i)=>{const n=[e.namespace,e.kind,e.name].filter(Boolean),a=n.length?n.join(" / "):ml;return t(Xi,{label:a},`src-${i}-${a}`)})}),!!m.length&&t(nI,{title:bl,count:m.length,children:m.map((e,i)=>t(Xi,{label:e},`ns-${i}-${e}`))}),!!b.length&&t(nI,{title:fl,count:b.length,children:b.map((e,i)=>t(Xi,{label:e},`lang-${i}-${e}`))})]})})]})},oI=f($)`
|
|
1680
1680
|
gap: 16px;
|
|
1681
1681
|
width: 100%;
|
|
1682
|
-
`,
|
|
1682
|
+
`,lI=f.div`
|
|
1683
1683
|
display: flex;
|
|
1684
1684
|
align-items: center;
|
|
1685
1685
|
gap: 8px;
|
|
1686
1686
|
flex-wrap: wrap;
|
|
1687
1687
|
min-width: 0;
|
|
1688
|
-
`,
|
|
1688
|
+
`,rI=f($)`
|
|
1689
1689
|
gap: 12px;
|
|
1690
1690
|
width: 100%;
|
|
1691
|
-
`,
|
|
1691
|
+
`,sI=f($)`
|
|
1692
1692
|
width: 100%;
|
|
1693
1693
|
gap: 8px;
|
|
1694
|
-
`,
|
|
1694
|
+
`,cI=f(T)`
|
|
1695
1695
|
width: 100%;
|
|
1696
1696
|
justify-content: space-between;
|
|
1697
1697
|
align-items: center;
|
|
1698
|
-
`,
|
|
1698
|
+
`,dI=f.div`
|
|
1699
1699
|
flex: 1;
|
|
1700
1700
|
min-width: 0;
|
|
1701
1701
|
display: flex;
|
|
@@ -1706,16 +1706,16 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1706
1706
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1707
1707
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1708
1708
|
cursor: pointer;
|
|
1709
|
-
`,
|
|
1709
|
+
`,pI=f.div`
|
|
1710
1710
|
flex: 1;
|
|
1711
1711
|
min-width: 0;
|
|
1712
|
-
`,
|
|
1712
|
+
`,uI=f($)`
|
|
1713
1713
|
gap: 10px;
|
|
1714
1714
|
width: 100%;
|
|
1715
1715
|
padding-left: 2px;
|
|
1716
|
-
`,
|
|
1716
|
+
`,hI=f.div`
|
|
1717
1717
|
flex: 1;
|
|
1718
|
-
`,
|
|
1718
|
+
`,gI=f.div`
|
|
1719
1719
|
display: flex;
|
|
1720
1720
|
align-items: center;
|
|
1721
1721
|
gap: 8px;
|
|
@@ -1727,65 +1727,65 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1727
1727
|
&:hover {
|
|
1728
1728
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1729
1729
|
}
|
|
1730
|
-
`;function
|
|
1730
|
+
`;function mI(e){const t=[...e];for(;t.length>1&&""===t[t.length-1]?.trim()&&""===t[t.length-2]?.trim();)t.pop();return t.length?(""!==t[t.length-1]?.trim()&&t.push(""),t):[""]}const bI=({isOpen:n,submitting:r,prefill:s,templatizationActions:c=[],existingGroups:p=[],onClose:u,onSubmit:h,onDelete:g,sourceOptions:m=[],namespaceOptions:b=[]})=>{const f=v(),y=c.find(e=>e.name===Ro)??null,[S,x]=l(1),[I,$]=l(!1),[N,A]=l(0),[O,E]=l(null),[D,z]=l(""),[R,P]=l(!1),[X,L]=l(()=>vT({hasExistingGroups:p.length>0,defaultActionId:y?.id??null}));o(()=>{if(!n)return;const e=vT({hasExistingGroups:p.length>0,defaultActionId:y?.id??null});if(s&&(e.destination=s.destination??e.destination,e.groupMode=s.groupMode??e.groupMode,e.existingGroupIndex=void 0!==s.existingGroupIndex?s.existingGroupIndex:e.existingGroupIndex,e.targetActionId=void 0!==s.targetActionId?s.targetActionId:e.targetActionId,e.createNewAction=s.createNewAction??e.createNewAction,e.replaceExistingGroupTemplates=s.replaceExistingGroupTemplates??e.replaceExistingGroupTemplates),null!==e.existingGroupIndex){const t=p[e.existingGroupIndex];if(t)if(e.scopes=yT(t.group),e.targetActionId=t.actionId,e.createNewAction=!1,s?.loadExistingGroupTemplates){const i=(t.group.templatizationRules??[]).map(e=>e.template?.trim()||"").filter(Boolean);e.templates=mI(i),e.replaceExistingGroupTemplates=!0,A(i.length);const n=s.focusTemplate?.trim(),a=n?i.findIndex(e=>e===n):-1;E(a>=0?a:null)}else A(0),E(null);else E(null)}else A(0),E(null);const t=s?.step??1;x(t),$(2===t),z(""),P(!1),L(e)},[n,p.length,y?.id,s]);const _=d(e=>{L(t=>({...t,...e}))},[]),M=a(()=>{if(X.createNewAction)return X.newActionName.trim()||kl;const e=c.find(e=>e.id===X.targetActionId);return e?.name||y?.name||Ro},[y?.name,X.createNewAction,X.newActionName,X.targetActionId,c]),F=a(()=>2===S?Tl:Il,[S]),B=a(()=>2===S?$l(M):kl,[M,S]),V="template-group"===X.destination&&"existing"===X.groupMode,U="existing"===X.groupMode&&null!==X.existingGroupIndex&&!!g,G=a(()=>{if(null===X.existingGroupIndex)return 0;const e=p[X.existingGroupIndex];return(e?.group.templatizationRules??[]).map(e=>e.template?.trim()||"").filter(Boolean).length},[p,X.existingGroupIndex]),j="entire-cluster"===X.destination||V&&null!==X.existingGroupIndex||!I&&"template-group"===X.destination,J=a(()=>X.templates.slice(0,N),[N,X.templates]),q=a(()=>mI(X.templates.slice(N)),[N,X.templates]),Z=a(()=>null===O?"":O<N?X.templates[O]?.trim()??"":q[O-N]?.trim()??"",[N,X.templates,q,O]),Q=a(()=>"entire-cluster"===X.destination||!Zp(X.scopes)&&("new"===X.groupMode||null!==X.existingGroupIndex),[X.destination,X.existingGroupIndex,X.groupMode,X.scopes]),ee=(X.existingGroupIndex,!0),te=d(e=>{const t=p[e];if(!t)return null;const i=(t.group.templatizationRules??[]).map(e=>e.template?.trim()||"").filter(Boolean);return A(i.length),E(null),z(""),{groupMode:"existing",existingGroupIndex:e,scopes:yT(t.group),targetActionId:t.actionId,createNewAction:!1,newActionName:"",templates:mI(i),replaceExistingGroupTemplates:!0}},[p]),ie=d((e,t)=>{const i=te(e);i&&(_({...i,...t}),x(2))},[te,_]),ne=d(()=>{L(e=>({...e,destination:"template-group",groupMode:"new",existingGroupIndex:null,replaceExistingGroupTemplates:!1,templates:[""],...e.targetActionId||e.createNewAction?{}:{createNewAction:!y?.id,newActionName:"",targetActionId:y?.id??null}})),A(0),E(null),z(""),x(2)},[y?.id]),ae=d(()=>{if("entire-cluster"===X.destination){const e=wT(p,{defaultActionId:y?.id??null,defaultActionName:y?.name||Ro});if(e>=0){const t=te(e);return t&&_({...t,destination:"entire-cluster"}),void x(2)}_({existingGroupIndex:null,groupMode:"new",replaceExistingGroupTemplates:!1,templates:[""],scopes:vT().scopes,createNewAction:!y?.id,newActionName:"",targetActionId:y?.id??null}),A(0),E(null)}else if("existing"===X.groupMode&&null!==X.existingGroupIndex){const e=te(X.existingGroupIndex);e&&_(e)}else _({...X.createNewAction?{}:{targetActionId:X.targetActionId??y?.id??null,createNewAction:!1},replaceExistingGroupTemplates:!1,templates:[""]}),A(0),E(null);x(2)},[y?.id,y?.name,p,X.createNewAction,X.destination,X.existingGroupIndex,X.groupMode,X.targetActionId,te,_]),oe=d(()=>{ee&&h(X)},[ee,X,h]),le=d(()=>{g&&"existing"===X.groupMode&&null!==X.existingGroupIndex&&g(X)},[X,g]),re=d(()=>{g&&"existing"===X.groupMode&&null!==X.existingGroupIndex&&!r&&(G>0?P(!0):g(X))},[G,X,g,r]);o(()=>{if(null===O)return;const e=N+q.length;O>=e&&E(e>0?e-1:null)},[N,q.length,O]),o(()=>{z("")},[O]);const se=a(()=>Z.trim()&&D.trim()?OT(Z,D):null,[Z,D]),ce=d(e=>{E(e)},[]),de=d(e=>{_({templates:[...J,...mI(e)]})},[J,_]),pe=()=>e(uI,{$gap:10,children:[e(T,{$gap:12,$alignItems:"center",$width:"100%",children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:Fl}),t(pI,{children:t(Y,{name:"url-templatization-custom-try-url","data-id":"url-templatization-custom-try-url",placeholder:Bl,value:D,hideFocusOutline:!0,onChange:e=>z(e.target.value),width:"100%"})})]}),se&&e(lI,{children:[se.matched?t(zu,{size:20,fill:f.v2.colors.green[500]}):t(Ru,{size:20,fill:f.v2.colors.orange[500]}),se.matched?e(i,{children:[t(w,{size:C.XS,color:k.Secondary,children:Vl}),t(IT,{template:se.templatedPath,size:C.XS})]}):t(w,{size:C.XXS,color:k.Secondary,children:se.mismatchReason||Ul})]})]}),ue=1===S?{actions:[{"data-id":"url-templatization-custom-btn-cancel",label:Dl,variant:K.Secondary,size:W.S,onClick:u,disabled:r},{"data-id":"url-templatization-custom-btn-next",label:zl,variant:K.Primary,size:W.S,onClick:ae,disabled:!Q||r}]}:{children:e(i,{children:[U&&e(gI,{"data-id":"url-templatization-custom-btn-delete",onClick:re,children:[t(w,{size:C.XS,weight:500,color:f.v2.colors.red[500],children:Nl}),t(ku,{size:16,fill:f.v2.colors.red[500]})]}),t(hI,{}),!I&&t(H,{"data-id":"url-templatization-custom-btn-back",label:Al,leftIcon:eh,variant:K.Secondary,size:W.S,onClick:()=>x(1),disabled:r}),t(H,{"data-id":"url-templatization-custom-btn-cancel-without-saving",label:Ol,variant:K.Secondary,size:W.S,onClick:u,disabled:r}),t(H,{"data-id":"url-templatization-custom-btn-save",label:El,variant:K.Primary,size:W.S,onClick:oe,loading:r,disabled:!ee||r})]})};return e(i,{children:[t(ln,{isOpen:n,width:Rl,header:{icon:wh,title:F,subTitle:B,onClose:u},footer:ue,children:t(oI,{"data-id":"url-templatization-custom-template-drawer",children:1===S?t(HT,{formState:X,existingGroups:p,templatizationActions:c,defaultActionName:y?.name||Ro,defaultActionId:y?.id??null,onChange:_,onAddToExistingGroup:ie,onCreateNewGroup:ne,sourceOptions:m,namespaceOptions:b}):e(i,{children:[j?t(aI,{"data-id":"url-templatization-custom-templates-summary",actionName:M,uiManaged:X.createNewAction,scopes:X.scopes}):t(em,{scopes:X.scopes,onChange:e=>_({scopes:e}),sourceOptions:m,namespaceOptions:b,dataIdPrefix:"url-templatization-custom-scope",title:Ho,subTitle:jo,icon:Hu,hideLogicNote:!0,hideEntireClusterNote:!0,entireClusterWarningMessage:Pl,defaultScopeTab:"source"}),t(Re,{richTitle:{title:Xl,alignItems:"flex-start"},children:e(rI,{"data-id":"url-templatization-custom-templates",children:[J.map((i,n)=>{const a=O===n;return e(sI,{children:[e(cI,{$gap:8,children:[t(dI,{onClick:()=>ce(n),children:t(IT,{copyable:!0,template:i,size:C.XS,"data-id":`url-templatization-custom-template-${n}`})}),t(bn,{"data-id":`url-templatization-custom-delete-template-${n}`,icon:ku,size:fn.S,onClick:()=>{_({templates:X.templates.filter((e,t)=>t!==n)}),A(e=>Math.max(0,e-1)),O===n?E(null):null!==O&&O>n&&E(O-1)}})]}),a&&pe()]},`existing-${n}-${i}`)}),q.map((i,n)=>{const a=N+n,o=O===a,l=q.length>1;return e(sI,{children:[e(cI,{$gap:8,children:[t(pI,{children:t(Y,{"data-id":`url-templatization-custom-new-template-${n}`,width:"100%",placeholder:Ll,value:i,hideFocusOutline:!0,onFocus:()=>ce(a),onChange:e=>{const t=[...q];t[n]=e.target.value,de(t),E(a)}})}),l&&t(bn,{"data-id":`url-templatization-custom-delete-new-template-${n}`,icon:ku,size:fn.S,onClick:()=>{const e=q.filter((e,t)=>t!==n);de(e.length?e:[""]),O===a?E(null):null!==O&&O>a&&E(O-1)}})]}),o&&pe()]},`new-${n}`)})]})})]})})}),t(hm,{isOpen:R,onClose:()=>P(!1),onApprove:le,target:_l,description:Ml(G),overrideApproveButtonLabel:Nl})]})},fI=f($)`
|
|
1731
1731
|
gap: 16px;
|
|
1732
1732
|
width: 100%;
|
|
1733
|
-
`,
|
|
1733
|
+
`,vI=f.div`
|
|
1734
1734
|
display: flex;
|
|
1735
1735
|
flex-direction: column;
|
|
1736
1736
|
gap: 24px;
|
|
1737
1737
|
padding: 16px;
|
|
1738
1738
|
border-radius: 12px;
|
|
1739
1739
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1740
|
-
`,
|
|
1740
|
+
`,yI=f.div`
|
|
1741
1741
|
display: flex;
|
|
1742
1742
|
align-items: center;
|
|
1743
1743
|
gap: 16px;
|
|
1744
|
-
`,
|
|
1744
|
+
`,SI=f.div`
|
|
1745
1745
|
display: flex;
|
|
1746
1746
|
align-items: flex-start;
|
|
1747
1747
|
gap: 16px;
|
|
1748
1748
|
width: 100%;
|
|
1749
|
-
`,
|
|
1749
|
+
`,xI=f.div`
|
|
1750
1750
|
display: flex;
|
|
1751
1751
|
flex: 1;
|
|
1752
1752
|
flex-direction: column;
|
|
1753
1753
|
gap: 4px;
|
|
1754
1754
|
min-width: 0;
|
|
1755
|
-
`,
|
|
1755
|
+
`,wI=f($)`
|
|
1756
1756
|
gap: 8px;
|
|
1757
1757
|
width: 100%;
|
|
1758
|
-
`,
|
|
1758
|
+
`,CI=({isOpen:n,submitting:r,mode:s="create",disableForScope:c=!1,skipPolicyForScope:p=!1,initialFormState:u,onClose:h,onSubmit:g,sourceOptions:m=[],namespaceOptions:b=[]})=>{const f="edit"===s,[v,y]=l(mT),[S,x]=l(),[I,$]=l(!1);o(()=>{if(n){const e=u??mT();y(c?{...e,enabled:!1}:p?{...e,enabled:!0}:e),x(void 0),$(!1)}},[n,u,c,p]);const N=d(e=>{y(t=>({...t,...e}))},[]),A=a(()=>{if(c)return!0;if(p){if(v.skipForNonSuccessCodes)return!0;if(!v.skipSelectedHttpStatusCodes)return!1;const e=bT(v.skipHttpStatusCodesInput);return null!==e&&e.length>0}if(v.skipSelectedHttpStatusCodes){const e=bT(v.skipHttpStatusCodesInput);if(null===e||0===e.length)return!1}return!0},[c,p,v.skipForNonSuccessCodes,v.skipSelectedHttpStatusCodes,v.skipHttpStatusCodesInput]),O=d(()=>{if(!c&&v.skipSelectedHttpStatusCodes){const e=bT(v.skipHttpStatusCodesInput);if(null===e||0===e.length)return void x(Gl)}x(void 0),c?$(!0):g(p?{...v,enabled:!0}:v)},[c,p,v,g]),D=d(()=>{g({...v,enabled:!1})},[v,g]),z=c?Jl:p?ql:f?Zl:Ql,R=p?Kl:Yl,P={note:{status:ie.Warning,message:f?Hl:Wl,fullWidth:!1,smallIcon:!0},actions:[{"data-id":"url-templatization-default-rule-btn-cancel",label:Dl,variant:K.Secondary,size:W.S,onClick:h,disabled:r},{"data-id":f?"url-templatization-default-rule-btn-save":"url-templatization-default-rule-btn-add",label:f?El:jl,variant:K.Primary,size:W.S,onClick:O,loading:r,disabled:!A||r}]};return e(i,{children:[t(ln,{isOpen:n,width:Rl,header:{icon:wh,title:z,subTitle:R,onClose:h},footer:P,children:e(fI,{"data-id":"url-templatization-default-rule-drawer",children:[t(em,{scopes:v.scopes,onChange:e=>N({scopes:e}),sourceOptions:m,namespaceOptions:b,dataIdPrefix:"url-templatization-default-rule-scope"}),!p&&t(Re,{richTitle:{title:tr,...c?{}:{subTitle:er,subTitleWrap:!0}},children:c?e(wI,{children:[t(T,{$gap:12,$alignItems:"center",children:t(E,{label:ir,status:ie.Warning,textSize:C.XXXS})}),nr.map(e=>t(w,{size:C.XXS,color:k.Secondary,children:e},e))]}):e(yI,{children:[t(L,{name:"url-templatization-default-rule-enabled",value:v.enabled,onChange:e=>N({enabled:e}),size:Vi.S,variant:ar.SuccessError,withIcon:!0}),t(w,{size:C.XS,children:or})]})}),!c&&t(Mn,{bgTint:"1000",withCollapse:!p,collapseIsDefaultOpen:p,richTitle:{title:rr},badges:[{key:"advanced",label:lr,status:ie.Info}],children:e(vI,{children:[t(wI,{children:sr.map(e=>t(w,{size:C.XXS,color:k.Secondary,children:e},e))}),e(yI,{children:[t(L,{name:"url-templatization-default-rule-skip-non-2xx",value:v.skipForNonSuccessCodes,onChange:e=>{N({skipForNonSuccessCodes:e,...e?{skipSelectedHttpStatusCodes:!1}:{}}),e&&x(void 0)},size:Vi.S}),t(w,{size:C.XS,children:cr})]}),e(SI,{children:[t(L,{name:"url-templatization-default-rule-skip-status-codes",value:v.skipSelectedHttpStatusCodes,onChange:e=>{N({skipSelectedHttpStatusCodes:e,...e?{skipForNonSuccessCodes:!1}:{}}),e||x(void 0)},size:Vi.S}),e(xI,{children:[t(w,{size:C.XS,color:v.skipSelectedHttpStatusCodes?k.Primary:k.Secondary,children:dr}),t(Y,{"data-id":"url-templatization-default-rule-status-codes",placeholder:ur,value:v.skipHttpStatusCodesInput,onChange:e=>{N({skipHttpStatusCodesInput:e.target.value}),S&&x(void 0)},disabled:!v.skipSelectedHttpStatusCodes,hasError:!!S,errorMessage:S,helpMessage:pr})]})]})]})})]})}),t(hm,{isOpen:I,onClose:()=>$(!1),onApprove:D,action:"disable",target:mr,description:gr,overrideApproveButtonLabel:hr})]})},kI=f($)`
|
|
1759
1759
|
gap: 16px;
|
|
1760
1760
|
width: 100%;
|
|
1761
|
-
`,
|
|
1761
|
+
`,TI=f($)`
|
|
1762
1762
|
gap: 12px;
|
|
1763
1763
|
width: 100%;
|
|
1764
1764
|
min-width: 0;
|
|
1765
|
-
`,
|
|
1765
|
+
`,II=f($)`
|
|
1766
1766
|
padding: 10px;
|
|
1767
1767
|
border-radius: 8px;
|
|
1768
1768
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1769
|
-
|
|
1769
|
+
`,$I=f.div`
|
|
1770
1770
|
display: flex;
|
|
1771
1771
|
align-items: center;
|
|
1772
1772
|
gap: 8px;
|
|
1773
1773
|
flex-wrap: wrap;
|
|
1774
1774
|
min-width: 0;
|
|
1775
|
-
`,
|
|
1775
|
+
`,NI=f.div`
|
|
1776
1776
|
flex: 1;
|
|
1777
1777
|
min-width: 0;
|
|
1778
|
-
`,
|
|
1778
|
+
`,AI=f($)`
|
|
1779
1779
|
gap: 8px;
|
|
1780
1780
|
width: 100%;
|
|
1781
|
-
`,
|
|
1781
|
+
`,OI=f.div`
|
|
1782
1782
|
display: flex;
|
|
1783
1783
|
align-items: center;
|
|
1784
1784
|
width: 100%;
|
|
1785
1785
|
padding: 8px 10px;
|
|
1786
1786
|
border-radius: 8px;
|
|
1787
1787
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1788
|
-
|
|
1788
|
+
`,EI=({isOpen:n,template:r,actionName:s,actionId:c,scopes:d,groupTemplates:p,onClose:u,onEdit:h,onEditGroup:g})=>{const m=v(),[b,f]=l(""),y=d??Qp();o(()=>{n&&f("")},[n,r,c]);const S=a(()=>((e,t)=>{const i=t.trim();let n=!1;return e.filter(e=>!(!n&&e===i&&(n=!0,1)))})((p??[]).map(e=>e.trim()).filter(Boolean),r),[p,r]),x=a(()=>r.trim()&&b.trim()?OT(r,b):null,[r,b]),I={actions:[{"data-id":"url-templatization-view-btn-close",label:br,variant:K.Secondary,size:W.S,onClick:u}]},$=s||Ro,N=KT(s,m);return t(ln,{isOpen:n,width:Rl,header:{icon:wh,title:vr,onClose:u,actions:h?[{id:"url-templatization-view-btn-edit",label:fr,icon:Au,onClick:()=>h(r)}]:void 0},footer:I,children:e(kI,{"data-id":"url-templatization-template-view-drawer",children:[t(Re,{richTitle:{icon:wh,title:Sr,subTitle:yr,alignItems:"flex-start"},children:e(TI,{children:[t(IT,{template:r,size:C.S}),e(II,{$gap:10,children:[e(T,{$gap:12,$alignItems:"center",$width:"100%",children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:Fl}),t(NI,{children:t(Y,{name:"url-templatization-try-url","data-id":"url-templatization-try-url",placeholder:Bl,value:b,onChange:e=>f(e.target.value),width:"100%"})})]}),x&&e($I,{children:[x.matched?t(zu,{size:20,fill:m.v2.colors.green[500]}):t(Ru,{size:20,fill:m.v2.colors.orange[500]}),x.matched?e(i,{children:[t(w,{size:C.XS,color:k.Secondary,children:Vl}),t(IT,{template:x.templatedPath,size:C.XS})]}):t(w,{size:C.XXS,color:k.Secondary,children:x.mismatchReason||Ul})]})]})]})}),t(em,{readOnly:!0,scopes:y,title:Ho,subTitle:xr,icon:Hu,bgTint:"1000"}),t(Mn,{bgTint:"1000",richTitle:{icon:Cu,title:Ir,subTitle:Tr,alignItems:"flex-start"},cellsPerRow:3,items:[{id:"origin",title:wr,badge:N},{id:"display-name",title:Cr,label:$},{id:"resource-name",title:kr,label:c||"—"}]}),S.length>0&&t(Re,{richTitle:{icon:wh,title:Ar,subTitle:Nr,alignItems:"flex-start"},actions:g?[{id:"url-templatization-view-btn-edit-group",type:St.Button,buttonProps:{"data-id":"url-templatization-view-btn-edit-group",label:$r,variant:K.Secondary,size:W.S,leftIcon:Au,onClick:g}}]:void 0,children:t(AI,{children:S.map((e,i)=>t(OI,{"data-id":`url-templatization-view-other-template-${i}`,children:t(IT,{template:e,size:C.XS})},`${e}-${i}`))})})]})})},DI=({token:n,isLoading:a,isEditing:o,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=En(),g=!o||a||!c.newToken;return Or({key:"Enter",active:!g},s),e(T,o?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Y,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(T,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(Ve,{title:"Saving...",withGradient:!0}):e(i,{children:[t(H,{variant:K.Secondary,size:W.S,leftIcon:Mu,onClick:r,disabled:a}),t(H,{variant:K.Primary,size:W.S,leftIcon:Fu,onClick:s,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(w,{size:C.XS,children:new Array(55).fill("•").join("")}),e(T,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(bn,{icon:Au,onClick:l})]})]})},zI=({expiresAt:e,callbackValid:i,callbackExpired:n})=>{const{formatTimeAgo:l}=qn(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Er(e,0)?ie.Error:Er(e,2592e6)?ie.Warning:ie.Success,[e]),d=a(()=>c===ie.Success?Fu:c===ie.Warning?Ih:oh,[c]);return o(()=>{c===ie.Success?i():c===ie.Error&&n()},[c]),t(ce,{text:s,children:t(E,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},RI=f.div`
|
|
1789
1789
|
display: flex;
|
|
1790
1790
|
flex-direction: column;
|
|
1791
1791
|
gap: 12px;
|
|
@@ -1793,7 +1793,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1793
1793
|
border-radius: 12px;
|
|
1794
1794
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
1795
1795
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
1796
|
-
`,
|
|
1796
|
+
`,PI=({children:e})=>{const i=v();return t(w,{size:C.XXXS,color:i.v2.colors.grey[150],children:e})},XI=({token:i})=>{const{tokensApi:n}=Jh(),[a,o]=l(!1),[r,s]=l(!1),[c,d]=l(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:g,resetFormData:m}=Gn({newToken:""});return t(Re,{richTitle:{icon:$h,title:"Odigos Pro Token"},children:e(RI,{$isExpired:c,children:[e(T,{$justifyContent:"space-between",children:[e($,{$gap:4,children:[t(PI,{children:"Issued for"}),t(w,{size:C.XS,children:i.name||"N/A"})]}),e($,{$gap:4,children:[t(PI,{children:"Expiration"}),t(zI,{expiresAt:i.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t($,{})]}),t(T,{children:e($,{children:[t(PI,{children:"Token"}),t(DI,{token:i.token,newToken:p.newToken,isLoading:a,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;o(!0);const e=await n.updateToken(p.newToken.trim());o(!1),e?.error?g("newToken",e.error):(s(!1),m())})(),formData:p,handleFormChange:u,handleErrorChange:g,formErrors:h})]})})]})})},LI=f.div`
|
|
1797
1797
|
display: flex;
|
|
1798
1798
|
flex-direction: column;
|
|
1799
1799
|
align-items: center;
|
|
@@ -1802,23 +1802,23 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1802
1802
|
padding: 12px 24px;
|
|
1803
1803
|
border-radius: 8px;
|
|
1804
1804
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1805
|
-
`,RI=()=>{const{progress:i}=In(),{describeApi:n,namespacesApi:a}=Hh(),{items:o}=a.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=Gn({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Re,{richTitle:{icon:Th,title:"Diagnose"},children:r?e(zI,{children:[t(Ve,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof i[An.DownloadingDiagnose]?.percentage,percentage:i[An.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof i[An.DownloadingDiagnose]?.percentage,visualIcon:hh,startedAt:r}),i[An.DownloadingDiagnose]?.list?.length&&t($,{$width:"100%",children:i[An.DownloadingDiagnose].list.map((i,n)=>e(T,{$gap:4,$alignItems:"center",children:[i.status===ie.Success?t(Lu,{size:16}):i.status===ie.Error?t(Xu,{size:16}):t(Ve,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(w,{size:C.XXXS,color:k.Secondary,children:i.label})]},`diagnose-item-${n}-${i.label}`))})]}):e($,{$gap:24,children:[t(w,{size:C.XXS,color:k.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($,{$gap:16,children:[e(T,{$gap:8,children:[t(x,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(w,{size:C.XXXS,color:k.Secondary,children:"Include pprof profiles"})]}),e(T,{$gap:8,children:[t(x,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(w,{size:C.XXXS,color:k.Secondary,children:"Include Prometheus metrics"})]}),e(T,{$gap:8,children:[t(x,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(w,{size:C.XXXS,color:k.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Xt,{alignX:Lt.Left,alignY:Ar.Bottom,items:o.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:K.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(E,{label:c.sourceWorkloadNamespaces.length,status:ie.Default}):void 0}}),t(T,{$justifyContent:"flex-end",children:t(H,{label:"Download Diagnose",rightIcon:hh,variant:K.Primary,onClick:async()=>{n.downloadDiagnose&&(s(Date.now()),await n.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},PI=()=>{const{platformType:e,version:i,tier:n}=Mp(),{describeApi:a}=Hh(),[r,s]=l(null);return o(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(Re,{richTitle:{icon:oh,title:"General Information"},children:t(Mn,{cellsPerRow:2,items:[{id:Or(),title:"Odigos Version",label:i},{id:Or(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:Or(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:Or(),title:"Tier",label:n}]})})},XI=({isOpen:i,onClose:n})=>{const{describeApi:a,tokensApi:o}=Hh(),l=o.useTokens().items[0];return e(ln,{isOpen:i,header:{icon:oh,title:"System Overview",onClose:n},children:[a.fetchDescribeOdigos&&t(PI,{}),o.updateToken&&l&&t(DI,{token:l}),a.downloadDiagnose&&t(RI,{})]})},LI=({isOpen:n,onClose:a,onCloseEnd:o})=>{const{addDataStreams:l,setSelectedStreamName:r}=Te(),{dataStreamsApi:s}=Hh(),{requestSubmit:c}=Yh(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),a()},[s,l,r,a]),u=d(()=>c(p),[c,p]);return $r({key:"Enter",active:n},u),e(i,{children:[t(Ce,{isOpen:n,onClose:a,onCloseEnd:o,title:ke.NAME_YOUR_STREAM,description:ke.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:zn.DONE,variant:K.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:a},children:t(xb,{autoFocus:!0})}),t(Sb,{})]})},_I=({isOpen:n,onClose:a,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Hh(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Yh();o(()=>{n&&r&&p(r)},[n,r]);const h=!!c?.isFormDirty,g=d(async e=>{await s.update(r,e),a()},[s,r,a]),m=d(()=>u(g),[u,g]);return $r({key:"Enter",active:n},m),e(i,{children:[t(Ce,{isOpen:n,onClose:a,onCloseEnd:l,title:ke.RENAME_STREAM(r),description:ke.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:zn.SAVE,variant:K.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:a},children:t(xb,{autoFocus:!0})}),t(Sb,{})]})},MI=({scale:i=1})=>e("svg",{width:742*i,height:533*i,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)"})})]})]}),FI=f.div`
|
|
1805
|
+
`,_I=()=>{const{progress:i}=In(),{describeApi:n,namespacesApi:a}=Jh(),{items:o}=a.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=Gn({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Re,{richTitle:{icon:Nh,title:"Diagnose"},children:r?e(LI,{children:[t(Ve,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof i[An.DownloadingDiagnose]?.percentage,percentage:i[An.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof i[An.DownloadingDiagnose]?.percentage,visualIcon:mh,startedAt:r}),i[An.DownloadingDiagnose]?.list?.length&&t($,{$width:"100%",children:i[An.DownloadingDiagnose].list.map((i,n)=>e(T,{$gap:4,$alignItems:"center",children:[i.status===ie.Success?t(Fu,{size:16}):i.status===ie.Error?t(Mu,{size:16}):t(Ve,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(w,{size:C.XXXS,color:k.Secondary,children:i.label})]},`diagnose-item-${n}-${i.label}`))})]}):e($,{$gap:24,children:[t(w,{size:C.XXS,color:k.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($,{$gap:16,children:[e(T,{$gap:8,children:[t(x,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(w,{size:C.XXXS,color:k.Secondary,children:"Include pprof profiles"})]}),e(T,{$gap:8,children:[t(x,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(w,{size:C.XXXS,color:k.Secondary,children:"Include Prometheus metrics"})]}),e(T,{$gap:8,children:[t(x,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(w,{size:C.XXXS,color:k.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Xt,{alignX:Lt.Left,alignY:Dr.Bottom,items:o.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:K.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(E,{label:c.sourceWorkloadNamespaces.length,status:ie.Default}):void 0}}),t(T,{$justifyContent:"flex-end",children:t(H,{label:"Download Diagnose",rightIcon:mh,variant:K.Primary,onClick:async()=>{n.downloadDiagnose&&(s(Date.now()),await n.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},MI=()=>{const{platformType:e,version:i,tier:n}=Vp(),{describeApi:a}=Jh(),[r,s]=l(null);return o(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(Re,{richTitle:{icon:sh,title:"General Information"},children:t(Mn,{cellsPerRow:2,items:[{id:zr(),title:"Odigos Version",label:i},{id:zr(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:zr(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:zr(),title:"Tier",label:n}]})})},FI=({isOpen:i,onClose:n})=>{const{describeApi:a,tokensApi:o}=Jh(),l=o.useTokens().items[0];return e(ln,{isOpen:i,header:{icon:sh,title:"System Overview",onClose:n},children:[a.fetchDescribeOdigos&&t(MI,{}),o.updateToken&&l&&t(XI,{token:l}),a.downloadDiagnose&&t(_I,{})]})},BI=({isOpen:n,onClose:a,onCloseEnd:o})=>{const{addDataStreams:l,setSelectedStreamName:r}=Te(),{dataStreamsApi:s}=Jh(),{requestSubmit:c}=Qh(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),a()},[s,l,r,a]),u=d(()=>c(p),[c,p]);return Or({key:"Enter",active:n},u),e(i,{children:[t(Ce,{isOpen:n,onClose:a,onCloseEnd:o,title:ke.NAME_YOUR_STREAM,description:ke.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:zn.DONE,variant:K.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:a},children:t(Tb,{autoFocus:!0})}),t(kb,{})]})},VI=({isOpen:n,onClose:a,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Jh(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Qh();o(()=>{n&&r&&p(r)},[n,r]);const h=!!c?.isFormDirty,g=d(async e=>{await s.update(r,e),a()},[s,r,a]),m=d(()=>u(g),[u,g]);return Or({key:"Enter",active:n},m),e(i,{children:[t(Ce,{isOpen:n,onClose:a,onCloseEnd:l,title:ke.RENAME_STREAM(r),description:ke.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:zn.SAVE,variant:K.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:zn.CANCEL,variant:K.Secondary,onClick:a},children:t(Tb,{autoFocus:!0})}),t(kb,{})]})},UI=({scale:i=1})=>e("svg",{width:742*i,height:533*i,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)"})})]})]}),GI=f.div`
|
|
1806
1806
|
position: absolute;
|
|
1807
1807
|
top: 50%;
|
|
1808
1808
|
left: 50%;
|
|
1809
1809
|
transform: translate(-50%, -50%);
|
|
1810
1810
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
1811
|
-
`,
|
|
1811
|
+
`,jI=()=>{const{drawerType:i,setDrawerType:n}=da(),a=i===Pr.OnboardingDone,o=()=>n(null);return e(Rr,{isOpen:a,onClose:o,children:[t(UI,{}),t(GI,{children:e($,{$gap:32,$alignItems:"center",children:[e($,{$gap:24,$alignItems:"center",children:[t(w,{size:C.L,weight:500,children:"Welcome to"}),t(bm,{size:260}),t(w,{size:C.S,weight:400,children:"Your observability control plane is ready."})]}),t(H,{label:"Get Started",rightIcon:Iu,onClick:o})]})})]})},HI=f.div`
|
|
1812
1812
|
display: flex;
|
|
1813
1813
|
flex-direction: column;
|
|
1814
1814
|
gap: 8px;
|
|
1815
1815
|
padding: 4px 8px;
|
|
1816
1816
|
border-radius: 8px;
|
|
1817
1817
|
width: 100%;
|
|
1818
|
-
`,
|
|
1818
|
+
`,WI=f.div`
|
|
1819
1819
|
white-space: pre;
|
|
1820
1820
|
overflow-x: auto;
|
|
1821
|
-
`,
|
|
1821
|
+
`,KI=({name:i,recommended:n,toggleLabel:a,enabled:o,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(HI,{children:[e(T,{$gap:8,$justifyContent:"space-between",children:[e(T,{$gap:4,children:[t(w,{size:C.XS,color:c.v2.colors.white[500],nowrap:!0,children:i}),n&&t(E,{label:Xr,leftIcon:kh,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:C.XXXS})]}),t(L,{name:s??`sampling-onboarding-toggle-${i}`,label:a,labelAlign:_.Left,value:o,onChange:l,size:Vi.S})]}),t(WI,{children:t(Gp,{parts:r})})]})},YI=f.div`
|
|
1822
1822
|
position: relative;
|
|
1823
1823
|
display: flex;
|
|
1824
1824
|
align-items: center;
|
|
@@ -1828,18 +1828,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1828
1828
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
1829
1829
|
border-top-left-radius: 18px;
|
|
1830
1830
|
border-top-right-radius: 18px;
|
|
1831
|
-
`,
|
|
1831
|
+
`,JI=f.div`
|
|
1832
1832
|
position: absolute;
|
|
1833
1833
|
left: 16px;
|
|
1834
1834
|
top: 50%;
|
|
1835
1835
|
transform: translateY(-50%);
|
|
1836
|
-
`,
|
|
1836
|
+
`,qI=f.div`
|
|
1837
1837
|
height: 16px;
|
|
1838
1838
|
width: 100%;
|
|
1839
1839
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
1840
1840
|
border-top-left-radius: 18px;
|
|
1841
1841
|
border-top-right-radius: 18px;
|
|
1842
|
-
`,
|
|
1842
|
+
`,ZI=f.div`
|
|
1843
1843
|
width: ${({$width:e})=>e}px;
|
|
1844
1844
|
display: flex;
|
|
1845
1845
|
flex-direction: column;
|
|
@@ -1847,7 +1847,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1847
1847
|
gap: 22px;
|
|
1848
1848
|
padding: 8px 32px 32px 32px;
|
|
1849
1849
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
1850
|
-
`,
|
|
1850
|
+
`,QI=e=>t(Ah,{rotate:90,...e}),e$=({children:i,center:n,onNext:a,nextLabel:o=Lr,nextLoading:l})=>e(T,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[i,a&&t(H,{"data-id":"sampling-onboarding-btn-next",label:o,rightIcon:QI,variant:K.Primary,size:W.M,onClick:a,loading:l})]}),t$=e=>t(Ah,{rotate:-90,...e}),i$=({title:i,onBack:n})=>{const a=v();return e(YI,{$hasBack:!!n,children:[n&&t(JI,{children:t(bn,{"data-id":"sampling-onboarding-back",icon:t$,size:fn.M,onClick:n})}),t(w,{size:C.M,weight:500,color:a.v2.colors.white[500],align:"center",children:i})]})},n$=f.div`
|
|
1851
1851
|
box-sizing: border-box;
|
|
1852
1852
|
width: ${({$width:e})=>e??"100%"};
|
|
1853
1853
|
${({$fillHeight:e})=>e&&y`
|
|
@@ -1860,16 +1860,16 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1860
1860
|
padding: 16px;
|
|
1861
1861
|
border-radius: 16px;
|
|
1862
1862
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1863
|
-
`,
|
|
1863
|
+
`,a$=({children:e,fillHeight:i,width:n})=>t(n$,{$fillHeight:i,$width:n,children:e}),o$=f.ul`
|
|
1864
1864
|
margin: 0;
|
|
1865
1865
|
padding: 0;
|
|
1866
1866
|
list-style: disc;
|
|
1867
|
-
`,
|
|
1867
|
+
`,l$=f.li`
|
|
1868
1868
|
margin-left: 18px;
|
|
1869
1869
|
& + & {
|
|
1870
1870
|
margin-top: 6px;
|
|
1871
1871
|
}
|
|
1872
|
-
`,
|
|
1872
|
+
`,r$=({items:e,color:i})=>{const n=v(),a=i||n.v2.colors.silver[200];return t(o$,{children:e.map((e,i)=>t(l$,{style:{color:a},children:t(w,{size:C.XXS,color:a,children:e})},i))})},s$=({items:i})=>{const n=v();return t($,{$gap:16,children:i.map((i,a)=>e(T,{$gap:8,$alignItems:"flex-start",children:[e(w,{size:C.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e($,{$gap:2,children:[t(w,{size:C.XS,color:n.v2.colors.white[500],weight:500,children:i.title}),t(w,{size:C.XS,color:n.v2.colors.silver[200],children:i.description})]})]},a))})},c$=({message:e})=>t(te,{status:ie.Default,message:e,fullWidth:!0,smallIcon:!0}),d$=f.div`
|
|
1873
1873
|
width: 100%;
|
|
1874
1874
|
padding: 8px;
|
|
1875
1875
|
display: flex;
|
|
@@ -1877,12 +1877,12 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1877
1877
|
gap: 4px;
|
|
1878
1878
|
border-radius: 16px;
|
|
1879
1879
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1880
|
-
`,
|
|
1880
|
+
`,p$=f.div`
|
|
1881
1881
|
display: flex;
|
|
1882
1882
|
align-items: center;
|
|
1883
1883
|
gap: 8px;
|
|
1884
1884
|
padding: 4px 8px 12px 8px;
|
|
1885
|
-
`,
|
|
1885
|
+
`,u$=f.div`
|
|
1886
1886
|
width: 100%;
|
|
1887
1887
|
display: flex;
|
|
1888
1888
|
flex-direction: column;
|
|
@@ -1890,20 +1890,20 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1890
1890
|
padding: 8px;
|
|
1891
1891
|
border-radius: 12px;
|
|
1892
1892
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1893
|
-
`,
|
|
1893
|
+
`,h$=({children:e})=>{const i=v();return t(w,{size:C.S,weight:500,color:i.v2.colors.white[500],align:"center",children:e})},g$=f.div`
|
|
1894
1894
|
white-space: pre-line;
|
|
1895
|
-
`,
|
|
1895
|
+
`,m$=({enabled:n,onEnabledChange:o,onBack:l,onNext:r})=>{const s=v(),c=a(()=>eu({enabled:n,keepPercentage:0}),[n]);return e(i,{children:[t(i$,{title:_r,onBack:l}),e(ZI,{$width:854,children:[t(h$,{children:Mr}),e($,{$gap:8,$width:"100%",children:[t(a$,{children:t(g$,{children:t(w,{size:C.XXS,color:s.v2.colors.silver[200],children:Fr})})}),e($,{$gap:8,$width:"100%",children:[e(d$,{children:[t(p$,{children:t(w,{size:C.S,weight:500,color:s.v2.colors.white[500],children:Br})}),t(u$,{children:t(KI,{name:Ur,recommended:!0,toggleLabel:Vr,enabled:n,onEnabledChange:o,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(c$,{message:Gr})]})]})]}),t(e$,{onNext:r})]})},b$=e=>t(Ah,{rotate:90,...e}),f$=({onClose:n})=>{const a=v();return e(i,{children:[t(qI,{}),e(ZI,{$width:732,children:[t(jr,{icon:Sh}),e($,{$gap:16,$alignItems:"center",$width:"100%",children:[t(w,{size:C.M,weight:500,color:a.v2.colors.white[500],children:Hr}),Wr.split("\n").map((e,i)=>t(h$,{children:e},`subtitle-${i}-${e}`)),e(a$,{children:[t(w,{size:C.XS,color:a.v2.colors.silver[200],children:Kr}),t(r$,{color:a.v2.colors.white[500],items:[Yr,Jr,qr]})]})]})]}),t(e$,{center:!0,children:t(H,{"data-id":"sampling-onboarding-btn-go-to",label:Zr,rightIcon:b$,variant:K.Primary,size:W.M,onClick:n})})]})},v$=e=>t(Ah,{rotate:90,...e}),y$=f.div`
|
|
1896
1896
|
display: flex;
|
|
1897
1897
|
flex-direction: column;
|
|
1898
1898
|
align-items: center;
|
|
1899
1899
|
gap: 8px;
|
|
1900
1900
|
width: 100%;
|
|
1901
|
-
`,
|
|
1901
|
+
`,S$=({onSkip:n,onNext:a})=>{const o=v();return e(i,{children:[t(qI,{}),e(ZI,{$width:732,children:[t(jr,{icon:Sh}),e($,{$gap:16,$alignItems:"center",$width:"100%",children:[e(y$,{children:[t(w,{size:C.M,weight:500,color:o.v2.colors.white[500],children:Qr}),t(h$,{children:es})]}),e(a$,{children:[t(w,{size:C.XS,color:o.v2.colors.silver[200],children:ts}),t(s$,{items:[{title:ns,description:is},{title:os,description:as},{title:rs,description:ls}]}),t(c$,{message:ss})]})]})]}),e(e$,{center:!0,children:[t(H,{"data-id":"sampling-onboarding-btn-skip",label:cs,variant:K.Secondary,onClick:n}),t(H,{"data-id":"sampling-onboarding-btn-start",label:ds,rightIcon:v$,variant:K.Primary,onClick:a})]})]})},x$=f.div`
|
|
1902
1902
|
display: flex;
|
|
1903
1903
|
align-items: stretch;
|
|
1904
1904
|
gap: 16px;
|
|
1905
1905
|
width: 100%;
|
|
1906
|
-
`,
|
|
1906
|
+
`,w$=f.div`
|
|
1907
1907
|
flex: 1;
|
|
1908
1908
|
display: flex;
|
|
1909
1909
|
flex-direction: column;
|
|
@@ -1923,18 +1923,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1923
1923
|
background-color: ${t.v2.colors.silver[700]};
|
|
1924
1924
|
}
|
|
1925
1925
|
`}
|
|
1926
|
-
`,
|
|
1926
|
+
`,C$=f.div`
|
|
1927
1927
|
display: flex;
|
|
1928
1928
|
align-items: center;
|
|
1929
1929
|
gap: 8px;
|
|
1930
1930
|
padding: 12px 16px;
|
|
1931
|
-
`,
|
|
1931
|
+
`,k$=f.div`
|
|
1932
1932
|
flex: 1;
|
|
1933
1933
|
padding: 8px;
|
|
1934
1934
|
display: flex;
|
|
1935
1935
|
flex-direction: column;
|
|
1936
1936
|
gap: 8px;
|
|
1937
|
-
`,
|
|
1937
|
+
`,T$=f.div`
|
|
1938
1938
|
flex: 1;
|
|
1939
1939
|
display: flex;
|
|
1940
1940
|
flex-direction: column;
|
|
@@ -1942,17 +1942,17 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1942
1942
|
padding: 12px;
|
|
1943
1943
|
border-radius: 12px;
|
|
1944
1944
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
1945
|
-
`,
|
|
1945
|
+
`,I$=f.div`
|
|
1946
1946
|
display: flex;
|
|
1947
1947
|
justify-content: flex-end;
|
|
1948
|
-
|
|
1948
|
+
`,$$=f.div`
|
|
1949
1949
|
display: flex;
|
|
1950
1950
|
align-items: center;
|
|
1951
1951
|
gap: 8px;
|
|
1952
1952
|
padding: 4px 12px 4px 4px;
|
|
1953
1953
|
border-radius: 8px;
|
|
1954
1954
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
1955
|
-
`,
|
|
1955
|
+
`,N$=f.div`
|
|
1956
1956
|
display: flex;
|
|
1957
1957
|
align-items: center;
|
|
1958
1958
|
justify-content: center;
|
|
@@ -1960,13 +1960,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1960
1960
|
height: 24px;
|
|
1961
1961
|
border-radius: 6px;
|
|
1962
1962
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
1963
|
-
`,
|
|
1963
|
+
`,A$=({selected:i,onSelect:n,name:a,description:o,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),p=i?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(w$,{$selected:i,onClick:n,children:[e(C$,{children:[t(U,{"data-id":`sampling-onboarding-radio-${a}`,value:i,onChange:n,size:j.L}),t(Sh,{size:24,fill:d.v2.colors.white[500]}),t(w,{size:C.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(k$,{children:[e(T$,{$selected:i,children:[e($,{$gap:8,children:[t(E,{...l,textSize:C.XXXS}),t(w,{size:C.XXS,color:p,children:o})]}),r&&r.length>0&&t(r$,{color:p,items:r}),s&&e($$,{children:[t(N$,{children:t(Ih,{size:18,fill:d.v2.colors.yellow[500]})}),t(w,{size:C.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(I$,{children:t(H,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:$s,rightIcon:$u,variant:K.Text,size:W.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},O$=({strategy:n,onStrategyChange:a,onBack:o,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(i,{children:[t(i$,{title:ps,onBack:o}),e(ZI,{$width:854,children:[t(h$,{children:us}),e(x$,{children:[t(A$,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:vs,description:fs,badgeProps:{label:bs,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[gs,ms],warning:hs,onReadMore:c}),t(A$,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:Cs,description:ws,badgeProps:{label:xs,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[ys,Ss],onReadMore:c}),t(A$,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:Is,description:Ts,badgeProps:{label:ks,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(e$,{onNext:l})]})},E$=({onBack:n,onNext:o,submitting:l})=>{const r=v(),s=a(()=>[{title:Es,bullets:[Ns,As,Os]},{title:Ls,bullets:[Ds,zs,Rs,Ps,Xs]}],[]);return e(i,{children:[t(i$,{title:_s,onBack:n}),e(ZI,{$width:854,children:[t(h$,{children:Ms}),t(T,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((i,n)=>e(a$,{fillHeight:!0,width:"50%",children:[t(w,{size:C.XS,color:r.v2.colors.white[500],children:i.title}),t(r$,{items:i.bullets})]},n))}),t(c$,{message:Fs})]}),t(e$,{onNext:o,nextLoading:l})]})},D$=f.div`
|
|
1964
1964
|
white-space: pre-line;
|
|
1965
|
-
`,
|
|
1965
|
+
`,z$=({errorPresetEnabled:n,onErrorPresetChange:o,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=a(()=>tu(n?{disabled:!1}:null),[n]);return e(i,{children:[t(i$,{title:Bs,onBack:l}),e(ZI,{$width:854,children:[t(h$,{children:Vs}),e($,{$gap:8,$width:"100%",children:[e(a$,{children:[t(D$,{children:t(w,{size:C.XXS,color:c.v2.colors.silver[200],children:Us})}),t(c$,{message:Fs})]}),e(d$,{children:[e(p$,{children:[t(w,{size:C.S,weight:500,color:c.v2.colors.white[500],children:Gs}),t(lh,{size:16,fill:c.v2.colors.silver[200]})]}),t(u$,{children:t(KI,{name:Hs,recommended:!0,toggleLabel:js,enabled:n,onEnabledChange:o,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(e$,{onNext:r,nextLoading:s})]})},R$=f.div`
|
|
1966
1966
|
white-space: pre-line;
|
|
1967
|
-
`,
|
|
1967
|
+
`,P$=f.div`
|
|
1968
1968
|
width: fit-content;
|
|
1969
|
-
`,D$=["50","25","10","1","0.1"],z$=({value:i,onChange:n,label:o})=>{const l=v(),r=a(()=>D$.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e($,{$gap:8,children:[t(w,{size:C.XS,color:l.v2.colors.white[500],children:o}),t(E$,{children:t(F,{"data-id":"sampling-onboarding-ambient",options:r,selected:i,setSelected:n})})]})},R$=({errorPresetEnabled:n,onErrorPresetChange:o,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=a(()=>Zp(n?{disabled:!1}:null),[n]);return e(i,{children:[t(ZI,{title:Gs,onBack:s}),e(KI,{$width:854,children:[t(c$,{children:js}),e($,{$gap:8,$width:"100%",children:[e(e$,{children:[t(O$,{children:t(w,{size:C.XXS,color:p.v2.colors.silver[200],children:Hs})}),t(n$,{items:[Ws,Ks,Ys,Js,qs]}),t(o$,{message:Ls})]}),e(l$,{children:[e(r$,{children:[t(w,{size:C.S,weight:500,color:p.v2.colors.white[500],children:Zs}),t(nh,{size:16,fill:p.v2.colors.silver[200]})]}),t(s$,{children:t(GI,{name:Us,recommended:!0,toggleLabel:Vs,enabled:n,onEnabledChange:o,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(s$,{children:t(z$,{value:l,onChange:r,label:Qs})})]})]})]}),t(JI,{onNext:c,nextLoading:d})]})},P$=({isOpen:e,onClose:i,k8sHealthProbesConfig:n,samplingId:a,docsUrl:r})=>{const{samplingApi:s}=Hh(),[c,p]=l("welcome"),[u,h]=l(!0),[g,m]=l("keep-list"),[b,f]=l(!0),[v,y]=l("25"),[S,x]=l(!1);o(()=>{e&&(p("welcome"),h(n?.enabled??!0),m("keep-list"),f(!0),y("25"),x(!1))},[e,n?.enabled]);const w=d(async()=>{const e=a??"default",t=[];if(u!==(n?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:n?.keepPercentage??0}))}if("advanced"!==g&&b){const i=s.createHighlyRelevant;i&&t.push(i({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===g){const i=s.createCostReduction;i&&t.push(i({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}x(!0);try{await Promise.all(t),p("success")}catch{}finally{x(!1)}},[a,s,u,n?.enabled,n?.keepPercentage,g,b,v]);let C=null;switch(c){case"welcome":C=t(b$,{onSkip:i,onNext:()=>p("noisy")});break;case"noisy":C=t(p$,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":C=t(I$,{strategy:g,onStrategyChange:m,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===g?"keep-list":"drop-list"===g?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":C=t(R$,{errorPresetEnabled:b,onErrorPresetChange:f,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:w,submitting:S});break;case"drop-list":C=t(A$,{errorPresetEnabled:b,onErrorPresetChange:f,onBack:()=>p("strategy"),onNext:w,submitting:S});break;case"advanced":C=t($$,{onBack:()=>p("strategy"),onNext:w,submitting:S});break;case"success":C=t(h$,{onClose:i})}return t(Er,{isOpen:e,onClose:i,children:C})};var X$,L$;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.Delete="delete"})(X$||(X$={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(L$||(L$={}));const _$=[{id:L$.CloudConnector,label:ke.CLOUD_CONNECTOR}];var M$;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(M$||(M$={}));const F$=[{key:M$.Name,label:ke.NAME},{key:M$.Type,label:ke.TYPE},{key:M$.Status,label:ke.STATUS},{key:M$.OdigosVersion,label:ke.ODIGOS_VERSION},{key:M$.ConnectedSince,label:ke.CONNECTED_SINCE},{key:M$.LastActivity,label:ke.LAST_ACTIVITY}],B$=(e,t)=>{const i=e.find(e=>e.key===M$.Id)?.rawValue;return t(i?.toString()||"")},V$={[ie.Success]:"Connected",[ie.Warning]:"Degraded",[ie.Error]:"Error",[ie.Disabled]:"Disabled",[ie.Info]:"Pending"},U$={[ec.K8s]:_i.Purple,[ec.Vm]:_i.Blue,[ec.Connector]:_i.Green,[ec.AwsEcs]:_i.Yellow},G$=({connections:i,getConnections:n,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:g=0})=>{const m=v(),{formatTimeAgo:b}=qn(),{capabilities:f}=Hh(),[y,S]=l(!i?.length),[x,w]=l(i||[]),C=d(async()=>{try{S(!0),w(await n()??[])}catch(e){}finally{S(!1)}},[]);o(()=>{x.length||C()},[]);const[k,T]=l(""),[I,$]=l(null),[N,A]=l([]),[O,D]=l(!1),[z,R]=l(!1),P=d(()=>{D(!1),R(!0),C()},[C]),X=d(e=>{e===L$.CloudConnector?D(!0):c?.(e)},[c]),L=a(()=>I===X$.BulkConfig?h:I===X$.BulkSource?g:0,[I,h,g]),{supportedConnections:_,supportedConnectionIds:M}=a(()=>{const e=((e,t)=>e.filter(e=>{const i=e.status===ie.Success,n=Qp(e.odigosVersion,t,e.type);return i&&n}))(x,L);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[x,L]),F=a(()=>N.map(e=>x.find(t=>t.id===e)).filter(e=>!!e),[x,N]);o(()=>{if(!I||I===X$.Delete)return;const e=N.filter(e=>!M.includes(e));e.length&&A(t=>t.filter(t=>!e.includes(t)))},[I,N.length,M.length]);const B=a(()=>x.filter(e=>!k||e.name.toLowerCase().includes(k.toLowerCase())).map(e=>{const i=Qp(e.odigosVersion,h,e.type),n=Qp(e.odigosVersion,g,e.type),a=I===X$.BulkConfig?!i:!(I!==X$.BulkSource&&i||n);return{cells:[{key:M$.Id,rawValue:e.id},{key:M$.Name,rawValue:e.name},{key:M$.Type,rawValue:e.type,component:()=>t(Xi,{variant:U$[e.type]??_i.Default,label:tc(e.type),leftIcon:La(e.type)})},{key:M$.Status,rawValue:e.status,component:()=>(e=>{if(e.type===ec.Connector){const i=V$[e.status]??"Pending",n=e.status===ie.Success?Lu:e.status===ie.Error?Xu:void 0;return t(E,{status:e.status,label:i,leftIcon:n})}const i=e.status===ie.Success?ke.CONNECTION_LIVE:ke.CONNECTION_LOST,n=e.status===ie.Success?Lu:Xu;return t(E,{status:e.status,label:i,leftIcon:n})})(e)},{key:M$.OdigosVersion,rawValue:e.odigosVersion},{key:M$.ConnectedSince,rawValue:e.connectedAt?b(e.connectedAt):"-"},{key:M$.LastActivity,rawValue:e.lastSeenAt?b(e.lastSeenAt):"-"}],onClick:e.status!==ie.Success||I?void 0:()=>r(e),isSelected:N.includes(e.id),onSelect:()=>A(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>A(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.type!==ec.K8s||e.status!==ie.Success||a}}),[x,N,k,I,h,g,b,r]),V=a(()=>{const e=(e,t)=>{A([e]),$(t)};return(e=>{const{connections:t,configMinSupportedVersion:i,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:o,onEditConfiguration:l}=e;return({cells:e})=>{const r=B$(e,e=>t.find(t=>t.id===e)),s={id:Or(),label:ke.DELETE_CONNECTION,rightIcon:Tu,onClick:()=>B$(e,a)};if(!(e=>e.find(e=>e.key===M$.Status)?.rawValue===ie.Success)(e)||r?.type===ec.Connector)return[s];if(r?.type!==ec.K8s)return[];const c=!!r&&Qp(r.odigosVersion,i,r.type),d=!!r&&Qp(r.odigosVersion,n,r.type),p=eu(i,r?.type),u=eu(n,r?.type),h=[];return o&&h.push({id:Or(),tooltip:d?ke.ADD_SOURCE:ke.UPGRADE_TO_USE_FEATURE(u),rightIcon:Uu,disabled:!d,onClick:()=>B$(e,o)}),l&&h.push({id:Or(),tooltip:c?ke.EDIT_CONFIGURATION:ke.UPGRADE_TO_USE_FEATURE(p),rightIcon:Qu,disabled:!c,onClick:()=>B$(e,l)}),h}})({connections:x,configMinSupportedVersion:h,snapshotMinSupportedVersion:g,onDelete:t=>e(t,X$.Delete),onAddSource:f.canFetchSnapshots&&f.canBulkPersistSources?t=>e(t,X$.BulkSource):void 0,onEditConfiguration:t=>e(t,X$.BulkConfig)})},[x,h,g,f]),U=a(()=>F.some(e=>e.type===ec.K8s&&e.status===ie.Success&&Qp(e.odigosVersion,g,e.type)),[F,g]),G=a(()=>F.some(e=>e.type===ec.K8s&&e.status===ie.Success&&Qp(e.odigosVersion,h,e.type)),[F,h]),j=a(()=>{const e=f.canFetchSnapshots&&f.canBulkPersistSources,t=eu(g,ec.K8s),i=eu(h,ec.K8s);return(e=>{const{onCancel:t,onAddSource:i,addSourceDisabled:n,addSourceTooltip:a,onManageConfigurations:o,manageConfigDisabled:l,manageConfigTooltip:r}=e,s=[];return i&&s.push({id:X$.BulkSource,type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:ke.ADD_SOURCES,rightIcon:Uu,disabled:n,tooltip:a,onClick:i}}),o&&s.push({id:X$.BulkConfig,type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,leftIcon:Qu,label:ke.MANAGE_CONFIGURATIONS,disabled:l,tooltip:r,onClick:o}}),s.push({id:Or(),type:St.Button,buttonProps:{variant:K.Text,size:W.S,label:zn.CANCEL,onClick:t}}),s})({onCancel:()=>A([]),onAddSource:e?()=>$(X$.BulkSource):void 0,addSourceDisabled:e&&!U,addSourceTooltip:e&&!U?ke.UPGRADE_TO_USE_FEATURE(t):void 0,onManageConfigurations:()=>$(X$.BulkConfig),manageConfigDisabled:!G,manageConfigTooltip:G?void 0:ke.UPGRADE_TO_USE_FEATURE(i)})},[f,U,G,g,h]),H=a(()=>t(Xt,{items:_$,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>X(e[0]),buttonProps:{variant:K.Primary,size:W.S,label:zn.CREATE_NEW}}),[X]),Y=a(()=>k.trim()&&x.length>0?{hideIcon:!0,title:ke.NO_RESULTS,subTitle:ke.NO_RESULTS_FOR_FILTER(k)}:{icon:$h,title:ke.NO_CONNECTIONS,action:H},[k,x.length,H]);return t(ic,{children:e(Re,{fullHeight:!0,richTitle:{icon:$h,title:ke.CONNECTIONS,badge:{label:x.length.toString(),status:ie.Unknown}},search:{placeholder:ke.SEARCH_BY_CLUSTER_NAME,value:k,onChange:e=>T(e),width:"300px"},actions:[{id:"connections-refresh",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,leftIcon:Zu,onClick:C,disabled:y}},{id:"connections-create-new",type:St.DropDataButton,buttonProps:{variant:K.Primary,size:W.S,label:zn.CREATE_NEW,onClick:e=>X(e)},dropDataProps:{alignX:Lt.Right,items:_$}}],children:[t(za,{variant:Ra.Pretty,headerBackgroundColor:m.v2.colors.silver[1e3],isLoading:y,withCheckboxes:!0,columns:F$,rows:B,noDataProps:Y,rowActionsPushRightPosition:I?`calc(${rm} - 24px)`:void 0,getRowActions:V}),O&&t(Tg,{providers:p,children:t(Ex,{onClose:()=>D(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:P})}),t(hm,{isOpen:z,onClose:()=>R(!1)}),t(vt,{isOpen:!!N.length&&!I,richTitle:{icon:Ou,title:ke.SELECTED_CLUSTERS,badge:{label:N.length}},actions:j}),I===X$.BulkConfig&&t(Ig,{connections:F,children:t(Xx,{onClose:()=>$(null),connections:_,selectedConnectionIds:N,setSelectedConnectionIds:A})}),I===X$.BulkSource&&f.canFetchSnapshots&&f.canBulkPersistSources&&t(Ig,{connections:F,children:t($g,{selectedConnectionIds:N,children:t(Xy,{onClose:()=>$(null),selectedConnectionIds:N,setSelectedConnectionIds:A})})}),t(cm,{target:"connection",isOpen:I===X$.Delete,onClose:()=>{A([]),$(null)},onApprove:async()=>{const e=N[0];e&&(await s(e),await C())}})]})})};var j$,H$;(e=>{e.Overview="overview",e.Findings="findings",e.Transactions="transactions",e.SettingsAndConfigurations="settings-and-configurations"})(j$||(j$={})),(e=>{e.Anomaly="anomaly",e.Violation="violation",e.Transaction="transaction"})(H$||(H$={}));const W$={drawerIsOpenFor:{type:null,id:null},openDrawer:()=>{},closeDrawer:()=>{}},K$=h(W$),Y$=({children:e})=>{const[i,n]=l(W$.drawerIsOpenFor),o=d((e,t)=>n({type:e,id:t}),[]),r=d(()=>n(W$.drawerIsOpenFor),[]),s=a(()=>({drawerIsOpenFor:i,openDrawer:o,closeDrawer:r}),[i,o,r]);return t(K$.Provider,{value:s,children:e})},J$=()=>g(K$),q$=f.div`
|
|
1969
|
+
`,X$=["50","25","10","1","0.1"],L$=({value:i,onChange:n,label:o})=>{const l=v(),r=a(()=>X$.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e($,{$gap:8,children:[t(w,{size:C.XS,color:l.v2.colors.white[500],children:o}),t(P$,{children:t(F,{"data-id":"sampling-onboarding-ambient",options:r,selected:i,setSelected:n})})]})},_$=({errorPresetEnabled:n,onErrorPresetChange:o,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=a(()=>tu(n?{disabled:!1}:null),[n]);return e(i,{children:[t(i$,{title:Ws,onBack:s}),e(ZI,{$width:854,children:[t(h$,{children:Ks}),e($,{$gap:8,$width:"100%",children:[e(a$,{children:[t(R$,{children:t(w,{size:C.XXS,color:p.v2.colors.silver[200],children:Ys})}),t(r$,{items:[Js,qs,Zs,Qs,ec]}),t(c$,{message:Fs})]}),e(d$,{children:[e(p$,{children:[t(w,{size:C.S,weight:500,color:p.v2.colors.white[500],children:tc}),t(lh,{size:16,fill:p.v2.colors.silver[200]})]}),t(u$,{children:t(KI,{name:Hs,recommended:!0,toggleLabel:js,enabled:n,onEnabledChange:o,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(u$,{children:t(L$,{value:l,onChange:r,label:ic})})]})]})]}),t(e$,{onNext:c,nextLoading:d})]})},M$=({isOpen:e,onClose:i,k8sHealthProbesConfig:n,samplingId:a,docsUrl:r})=>{const{samplingApi:s}=Jh(),[c,p]=l("welcome"),[u,h]=l(!0),[g,m]=l("keep-list"),[b,f]=l(!0),[v,y]=l("25"),[S,x]=l(!1);o(()=>{e&&(p("welcome"),h(n?.enabled??!0),m("keep-list"),f(!0),y("25"),x(!1))},[e,n?.enabled]);const w=d(async()=>{const e=a??"default",t=[];if(u!==(n?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:n?.keepPercentage??0}))}if("advanced"!==g&&b){const i=s.createHighlyRelevant;i&&t.push(i({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===g){const i=s.createCostReduction;i&&t.push(i({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}x(!0);try{await Promise.all(t),p("success")}catch{}finally{x(!1)}},[a,s,u,n?.enabled,n?.keepPercentage,g,b,v]);let C=null;switch(c){case"welcome":C=t(S$,{onSkip:i,onNext:()=>p("noisy")});break;case"noisy":C=t(m$,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":C=t(O$,{strategy:g,onStrategyChange:m,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===g?"keep-list":"drop-list"===g?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":C=t(_$,{errorPresetEnabled:b,onErrorPresetChange:f,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:w,submitting:S});break;case"drop-list":C=t(z$,{errorPresetEnabled:b,onErrorPresetChange:f,onBack:()=>p("strategy"),onNext:w,submitting:S});break;case"advanced":C=t(E$,{onBack:()=>p("strategy"),onNext:w,submitting:S});break;case"success":C=t(f$,{onClose:i})}return t(Rr,{isOpen:e,onClose:i,children:C})};var F$,B$;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.Delete="delete"})(F$||(F$={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(B$||(B$={}));const V$=[{id:B$.CloudConnector,label:ke.CLOUD_CONNECTOR}];var U$;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(U$||(U$={}));const G$=[{key:U$.Name,label:ke.NAME},{key:U$.Type,label:ke.TYPE},{key:U$.Status,label:ke.STATUS},{key:U$.OdigosVersion,label:ke.ODIGOS_VERSION},{key:U$.ConnectedSince,label:ke.CONNECTED_SINCE},{key:U$.LastActivity,label:ke.LAST_ACTIVITY}],j$=(e,t)=>{const i=e.find(e=>e.key===U$.Id)?.rawValue;return t(i?.toString()||"")},H$={[ie.Success]:"Connected",[ie.Warning]:"Degraded",[ie.Error]:"Error",[ie.Disabled]:"Disabled",[ie.Info]:"Pending"},W$={[nc.K8s]:_i.Purple,[nc.Vm]:_i.Blue,[nc.Connector]:_i.Green,[nc.AwsEcs]:_i.Yellow},K$=({connections:i,getConnections:n,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:g=0})=>{const m=v(),{formatTimeAgo:b}=qn(),{capabilities:f}=Jh(),[y,S]=l(!i?.length),[x,w]=l(i||[]),C=d(async()=>{try{S(!0),w(await n()??[])}catch(e){}finally{S(!1)}},[]);o(()=>{x.length||C()},[]);const[k,T]=l(""),[I,$]=l(null),[N,A]=l([]),[O,D]=l(!1),[z,R]=l(!1),P=d(()=>{D(!1),R(!0),C()},[C]),X=d(e=>{e===B$.CloudConnector?D(!0):c?.(e)},[c]),L=a(()=>I===F$.BulkConfig?h:I===F$.BulkSource?g:0,[I,h,g]),{supportedConnections:_,supportedConnectionIds:M}=a(()=>{const e=((e,t)=>e.filter(e=>{const i=e.status===ie.Success,n=iu(e.odigosVersion,t,e.type);return i&&n}))(x,L);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[x,L]),F=a(()=>N.map(e=>x.find(t=>t.id===e)).filter(e=>!!e),[x,N]);o(()=>{if(!I||I===F$.Delete)return;const e=N.filter(e=>!M.includes(e));e.length&&A(t=>t.filter(t=>!e.includes(t)))},[I,N.length,M.length]);const B=a(()=>x.filter(e=>!k||e.name.toLowerCase().includes(k.toLowerCase())).map(e=>{const i=iu(e.odigosVersion,h,e.type),n=iu(e.odigosVersion,g,e.type),a=I===F$.BulkConfig?!i:!(I!==F$.BulkSource&&i||n);return{cells:[{key:U$.Id,rawValue:e.id},{key:U$.Name,rawValue:e.name},{key:U$.Type,rawValue:e.type,component:()=>t(Xi,{variant:W$[e.type]??_i.Default,label:ac(e.type),leftIcon:Fa(e.type)})},{key:U$.Status,rawValue:e.status,component:()=>(e=>{if(e.type===nc.Connector){const i=H$[e.status]??"Pending",n=e.status===ie.Success?Fu:e.status===ie.Error?Mu:void 0;return t(E,{status:e.status,label:i,leftIcon:n})}const i=e.status===ie.Success?ke.CONNECTION_LIVE:ke.CONNECTION_LOST,n=e.status===ie.Success?Fu:Mu;return t(E,{status:e.status,label:i,leftIcon:n})})(e)},{key:U$.OdigosVersion,rawValue:e.odigosVersion},{key:U$.ConnectedSince,rawValue:e.connectedAt?b(e.connectedAt):"-"},{key:U$.LastActivity,rawValue:e.lastSeenAt?b(e.lastSeenAt):"-"}],onClick:e.status!==ie.Success||I?void 0:()=>r(e),isSelected:N.includes(e.id),onSelect:()=>A(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>A(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.type!==nc.K8s||e.status!==ie.Success||a}}),[x,N,k,I,h,g,b,r]),V=a(()=>{const e=(e,t)=>{A([e]),$(t)};return(e=>{const{connections:t,configMinSupportedVersion:i,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:o,onEditConfiguration:l}=e;return({cells:e})=>{const r=j$(e,e=>t.find(t=>t.id===e)),s={id:zr(),label:ke.DELETE_CONNECTION,rightIcon:Nu,onClick:()=>j$(e,a)};if(!(e=>e.find(e=>e.key===U$.Status)?.rawValue===ie.Success)(e)||r?.type===nc.Connector)return[s];if(r?.type!==nc.K8s)return[];const c=!!r&&iu(r.odigosVersion,i,r.type),d=!!r&&iu(r.odigosVersion,n,r.type),p=nu(i,r?.type),u=nu(n,r?.type),h=[];return o&&h.push({id:zr(),tooltip:d?ke.ADD_SOURCE:ke.UPGRADE_TO_USE_FEATURE(u),rightIcon:Hu,disabled:!d,onClick:()=>j$(e,o)}),l&&h.push({id:zr(),tooltip:c?ke.EDIT_CONFIGURATION:ke.UPGRADE_TO_USE_FEATURE(p),rightIcon:ih,disabled:!c,onClick:()=>j$(e,l)}),h}})({connections:x,configMinSupportedVersion:h,snapshotMinSupportedVersion:g,onDelete:t=>e(t,F$.Delete),onAddSource:f.canFetchSnapshots&&f.canBulkPersistSources?t=>e(t,F$.BulkSource):void 0,onEditConfiguration:t=>e(t,F$.BulkConfig)})},[x,h,g,f]),U=a(()=>F.some(e=>e.type===nc.K8s&&e.status===ie.Success&&iu(e.odigosVersion,g,e.type)),[F,g]),G=a(()=>F.some(e=>e.type===nc.K8s&&e.status===ie.Success&&iu(e.odigosVersion,h,e.type)),[F,h]),j=a(()=>{const e=f.canFetchSnapshots&&f.canBulkPersistSources,t=nu(g,nc.K8s),i=nu(h,nc.K8s);return(e=>{const{onCancel:t,onAddSource:i,addSourceDisabled:n,addSourceTooltip:a,onManageConfigurations:o,manageConfigDisabled:l,manageConfigTooltip:r}=e,s=[];return i&&s.push({id:F$.BulkSource,type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:ke.ADD_SOURCES,rightIcon:Hu,disabled:n,tooltip:a,onClick:i}}),o&&s.push({id:F$.BulkConfig,type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,leftIcon:ih,label:ke.MANAGE_CONFIGURATIONS,disabled:l,tooltip:r,onClick:o}}),s.push({id:zr(),type:St.Button,buttonProps:{variant:K.Text,size:W.S,label:zn.CANCEL,onClick:t}}),s})({onCancel:()=>A([]),onAddSource:e?()=>$(F$.BulkSource):void 0,addSourceDisabled:e&&!U,addSourceTooltip:e&&!U?ke.UPGRADE_TO_USE_FEATURE(t):void 0,onManageConfigurations:()=>$(F$.BulkConfig),manageConfigDisabled:!G,manageConfigTooltip:G?void 0:ke.UPGRADE_TO_USE_FEATURE(i)})},[f,U,G,g,h]),H=a(()=>t(Xt,{items:V$,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>X(e[0]),buttonProps:{variant:K.Primary,size:W.S,label:zn.CREATE_NEW}}),[X]),Y=a(()=>k.trim()&&x.length>0?{hideIcon:!0,title:ke.NO_RESULTS,subTitle:ke.NO_RESULTS_FOR_FILTER(k)}:{icon:Oh,title:ke.NO_CONNECTIONS,action:H},[k,x.length,H]);return t(oc,{children:e(Re,{fullHeight:!0,richTitle:{icon:Oh,title:ke.CONNECTIONS,badge:{label:x.length.toString(),status:ie.Unknown}},search:{placeholder:ke.SEARCH_BY_CLUSTER_NAME,value:k,onChange:e=>T(e),width:"300px"},actions:[{id:"connections-refresh",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,leftIcon:th,onClick:C,disabled:y}},{id:"connections-create-new",type:St.DropDataButton,buttonProps:{variant:K.Primary,size:W.S,label:zn.CREATE_NEW,onClick:e=>X(e)},dropDataProps:{alignX:Lt.Right,items:V$}}],children:[t(Xa,{variant:La.Pretty,headerBackgroundColor:m.v2.colors.silver[1e3],isLoading:y,withCheckboxes:!0,columns:G$,rows:B,noDataProps:Y,rowActionsPushRightPosition:I?`calc(${pm} - 24px)`:void 0,getRowActions:V}),O&&t(Ag,{providers:p,children:t(Px,{onClose:()=>D(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:P})}),t(fm,{isOpen:z,onClose:()=>R(!1)}),t(vt,{isOpen:!!N.length&&!I,richTitle:{icon:zu,title:ke.SELECTED_CLUSTERS,badge:{label:N.length}},actions:j}),I===F$.BulkConfig&&t(Og,{connections:F,children:t(Fx,{onClose:()=>$(null),connections:_,selectedConnectionIds:N,setSelectedConnectionIds:A})}),I===F$.BulkSource&&f.canFetchSnapshots&&f.canBulkPersistSources&&t(Og,{connections:F,children:t(Eg,{selectedConnectionIds:N,children:t(Fy,{onClose:()=>$(null),selectedConnectionIds:N,setSelectedConnectionIds:A})})}),t(hm,{target:"connection",isOpen:I===F$.Delete,onClose:()=>{A([]),$(null)},onApprove:async()=>{const e=N[0];e&&(await s(e),await C())}})]})})};var Y$,J$;(e=>{e.Overview="overview",e.Findings="findings",e.Transactions="transactions",e.SettingsAndConfigurations="settings-and-configurations"})(Y$||(Y$={})),(e=>{e.Anomaly="anomaly",e.Violation="violation",e.Transaction="transaction"})(J$||(J$={}));const q$={type:null,id:null},Z$=h({findingDrawer:q$,transactionDrawerId:null,openDrawer:()=>{},closeFindingDrawer:()=>{},closeTransactionDrawer:()=>{}}),Q$=({children:e})=>{const[i,n]=l(q$),[o,r]=l(null),s=d((e,t)=>{e!==J$.Transaction?n({type:e,id:t}):r(t)},[]),c=d(()=>n(q$),[]),p=d(()=>r(null),[]),u=a(()=>({findingDrawer:i,transactionDrawerId:o,openDrawer:s,closeFindingDrawer:c,closeTransactionDrawer:p}),[i,o,s,c,p]);return t(Z$.Provider,{value:u,children:e})},eN=()=>g(Z$),tN=f.div`
|
|
1970
1970
|
display: flex;
|
|
1971
1971
|
flex-direction: column;
|
|
1972
1972
|
align-self: stretch;
|
|
@@ -1975,7 +1975,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1975
1975
|
padding: 16px;
|
|
1976
1976
|
border-radius: 16px;
|
|
1977
1977
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1978
|
-
`,
|
|
1978
|
+
`,iN=f.div`
|
|
1979
1979
|
display: flex;
|
|
1980
1980
|
flex-direction: column;
|
|
1981
1981
|
align-self: stretch;
|
|
@@ -1983,7 +1983,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1983
1983
|
min-height: 0;
|
|
1984
1984
|
gap: 16px;
|
|
1985
1985
|
padding: 16px;
|
|
1986
|
-
`,
|
|
1986
|
+
`,nN=f.div`
|
|
1987
1987
|
display: flex;
|
|
1988
1988
|
flex-direction: column;
|
|
1989
1989
|
align-self: stretch;
|
|
@@ -1992,14 +1992,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
1992
1992
|
padding: 8px;
|
|
1993
1993
|
border-radius: 12px;
|
|
1994
1994
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1995
|
-
`,
|
|
1995
|
+
`,aN=({richTitle:i,textCards:n,tableColumns:a,tableRows:o,getRowActions:l,tableKey:r,tableMaxHeight:s,tableWithCheckboxes:c,tableNoDataProps:d,isLoading:p,actions:u,children:h})=>{const g=v();return t(tN,{children:e(iN,{children:[e(T,{$justifyContent:"space-between",children:[t(lc,{...i}),u&&t(rc,{actions:u})]}),t(T,{$gap:22,children:n.map(e=>t(sc,{...e},e.title))}),h,!!a.length&&t(nN,{children:t(Xa,{maxHeight:s,headerBackgroundColor:g.v2.colors.silver[800],variant:La.Data,columns:a,rows:o,isLoading:p,getRowActions:l,withCheckboxes:c,noDataProps:d},r)})]})})},oN=(e,t)=>{const{items:i}=Jh().sourcesApi.useSources();return a(()=>{const n=cc(i,e,t);if(!n)return[lh];const a=ha(n);return a.length?a:[lh]},[i,e,t])},lN=({service:i,namespace:n,size:a=24,typographySize:o=C.XXS})=>{const l=oN(i,n);return e(T,{children:[t(ga,{icons:l,size:a}),t(w,{size:o,nowrap:!0,children:i})]})};var rN;(e=>{e.Title="title",e.TransactionId="transactionId",e.LastSeen="lastSeen",e.StartTime="startTime",e.EndTime="endTime",e.Namespace="namespace",e.Service="service",e.Kind="kind",e.Status="status",e.Score="score",e.Severity="severity",e.Occurrences="occurrences",e.Offending="offending",e.Signature="signature",e.RuleKey="ruleKey",e.ScopeKey="scopeKey"})(rN||(rN={}));const sN=e=>e.firstSeen||e.lastSeen,cN=e=>e.kind===uc.Anomaly?["anomaly",e.transactionId??"",e.signature??""].join("\0"):["violation",e.scopeKey??"",e.ruleKey??"",e.offending??""].join("\0"),dN=(e,t)=>cN(e)===cN(t);var pN;(e=>{e.Dismiss="dismiss",e.Accept="accept"})(pN||(pN={}));const uN={[pN.Dismiss]:[dc.Dismissed,pc.Dismissed],[pN.Accept]:[dc.Accepted,pc.Accepted]},hN=(e,t)=>[{id:`${e.id}-investigate`,label:"Investigate",tooltip:"Open the investigation view for this finding",rightIcon:Iu,variant:K.Primary,onClick:()=>{if(!e.id)return;const i=e.cells.find(e=>e.key===rN.Kind)?.rawValue;t(i===uc.Anomaly?J$.Anomaly:J$.Violation,e.id)}}],gN=[{label:"Severity",key:rN.Severity},{label:"Namespace",key:rN.Namespace},{label:"Service",key:rN.Service,noFilter:!0},{label:"Finding",key:rN.Title,noFilter:!0},{label:"Type",key:rN.Kind},{label:"Matched traces",key:rN.Occurrences,noFilter:!0},{label:"Status",key:rN.Status},{label:"Last seen",key:rN.LastSeen,noFilter:!0}],mN=[{label:"Namespace",key:rN.Namespace},{label:"Service",key:rN.Service,noFilter:!0},{label:"Events",key:rN.Occurrences,noFilter:!0},{label:"Last seen",key:rN.LastSeen,noFilter:!0}],bN=[{label:"",key:rN.Title,noSort:!0,noFilter:!0}],fN=e=>e.status===dc.Open||e.status===pc.Open,vN=e=>{const t={open:0,violations:0,anomalies:0,critical:0,high:0,medium:0,low:0};return e?.forEach(e=>{switch(fN(e)&&(t.open+=1),e.kind===uc.Violation?t.violations+=1:e.kind===uc.Anomaly&&(t.anomalies+=1),e.severity){case en.Critical:t.critical+=1;break;case en.High:t.high+=1;break;case en.Medium:t.medium+=1;break;case en.Low:t.low+=1}}),t},yN=(e,t)=>({label:t,backgroundColor:(()=>{switch(t){case en.Low:return e.v2.colors.purple[900];case en.Medium:return e.v2.colors.yellow[550];case en.High:return e.v2.colors.orange[500];case en.Critical:return e.v2.colors.red[800];default:return}})(),textColor:(()=>{switch(t){case en.Low:case en.Critical:return e.v2.colors.white[500];case en.Medium:case en.High:return e.v2.colors.black[500];default:return}})()}),SN=(e,t)=>({label:t,backgroundColor:(()=>{switch(t){case dc.Open:case pc.Open:return e.v2.colors.beige[600];case dc.Accepted:case pc.Accepted:return e.v2.colors.green[500];case dc.Dismissed:case pc.Dismissed:default:return e.v2.colors.silver[500]}})(),textColor:(()=>{switch(t){case dc.Open:case pc.Open:case dc.Accepted:case pc.Accepted:return e.v2.colors.black[500];case dc.Dismissed:case pc.Dismissed:default:return e.v2.colors.white[500]}})()}),xN={[en.Info]:0,[en.Low]:1,[en.Medium]:2,[en.High]:3,[en.Critical]:4},wN=e=>{let t=en.Info;for(const i of e)xN[i.severity]>xN[t]&&(t=i.severity);return t},CN=(e,i,n,a,o,l)=>{const r=[...n??[]].sort((e,t)=>xN[t.severity]-xN[e.severity]);return r.slice(0,a||r.length).map(n=>({id:cN(n),isSelected:!!o?.find(e=>dN(e,n)),onSelect:()=>l?.(n,!0),onDeselect:()=>l?.(n,!1),cells:[{key:rN.Title,rawValue:n.kind===uc.Anomaly&&zg(n)||n.title,component:()=>n.kind===uc.Anomaly?t(Dg,{operationName:n.operationName||n.title,identityDimensions:n.identityDimensions}):t(Xi,{label:n.title,variant:_i.Blue})},{key:rN.TransactionId,rawValue:n.transactionId??"-"},{key:rN.LastSeen,rawValue:i(n.lastSeen,{style:"short"})},{key:rN.Namespace,rawValue:n.namespace},{key:rN.Service,rawValue:n.service,component:()=>t(lN,{service:n.service,namespace:n.namespace})},{key:rN.Kind,rawValue:n.kind,component:()=>t(E,{label:n.kind,backgroundColor:e.v2.colors.pink[1e3],textColor:e.v2.colors.pink[500]})},{key:rN.Status,rawValue:n.status,component:()=>t(E,{...SN(e,n.status)})},{key:rN.Score,rawValue:Number(n.score).toLocaleString()},{key:rN.Severity,rawValue:n.severity,component:()=>t(E,{...yN(e,n.severity)})},{key:rN.Occurrences,rawValue:Number(n.occurrences).toLocaleString()},{key:rN.Offending,rawValue:n.offending??"-"},{key:rN.Signature,rawValue:n.signature??"-"},{key:rN.RuleKey,rawValue:n.ruleKey??"-",component:n.ruleKey?()=>t(Xi,{label:n.ruleKey,variant:_i.Blue}):void 0},{key:rN.ScopeKey,rawValue:n.scopeKey??"-",component:n.scopeKey?()=>t(Xi,{label:n.scopeKey,variant:_i.Default}):void 0}]}))},kN=(e,t)=>`(${t(e.startTime,{style:"short",units:1})} ago)`,TN=e=>{const t=new Date(e.startTime).getTime(),i=new Date(e.endTime).getTime(),n=Math.max(0,Math.round((i-t)/1e3)),a=new Date(e.startTime).toLocaleString();return n<=0?`at ${a}`:`starting at ${a} for ${n} ${1===n?"second":"seconds"}`},IN=(e,t)=>{const i=e.findings.length,n=wN(e.findings),a=[...new Set(e.findings.map(e=>e.service))],o=1===i?"finding":"findings",l=i>1?"possibly related ":"",r=1===i?n:`up to ${n}`,s=1===a.length?`service ${a[0]}`:`services ${a.join(", ")}`;return`${kN(e,t)} ${i} ${l}suspicious ${o} ${r} found in ${s} ${TN(e)}`};var $N;(e=>{e.TransactionId="transactionId",e.Class="class",e.Status="status",e.Learning="learning",e.Data="data",e.ObservationCount="observationCount",e.ObservationCountAtLastChange="observationCountAtLastChange",e.LearningStartedAt="learningStartedAt",e.LastChangedAt="lastChangedAt"})($N||($N={}));const NN=(e,i)=>i?.map((e,i)=>({id:`${e.transactionId}-${i}`,cells:[{key:$N.TransactionId,rawValue:e.transactionId},{key:$N.Class,rawValue:e.class,component:()=>t(ce,{text:e.classDescription,children:t(w,{size:C.XXS,children:e.classLabel})})},{key:$N.Status,rawValue:e.learning?.phase||"",component:e.learning?.phase?()=>t(zN,{phase:e.learning.phase,readyToPromote:e.learning.readyToPromote}):void 0},{key:$N.Learning,rawValue:e.learning?.phase||"",component:e.learning?()=>t(RN,{learning:e.learning}):void 0},{key:$N.LearningStartedAt,rawValue:e.learningStartedAt?new Date(e.learningStartedAt).toLocaleString():""},{key:$N.ObservationCount,rawValue:Number(e.observationCount).toLocaleString()},{key:$N.ObservationCountAtLastChange,rawValue:Number(e.observationCountAtLastChange??0).toLocaleString()},{key:$N.LastChangedAt,rawValue:e.lastChangedAt?new Date(e.lastChangedAt).toLocaleString():""},{key:$N.Data,rawValue:e.data??""}]}))??[],AN=f.div`
|
|
1996
1996
|
position: relative;
|
|
1997
1997
|
width: 100%;
|
|
1998
1998
|
height: 6px;
|
|
1999
1999
|
border-radius: 3px;
|
|
2000
2000
|
overflow: hidden;
|
|
2001
2001
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
2002
|
-
`,
|
|
2002
|
+
`,ON=f.div`
|
|
2003
2003
|
position: absolute;
|
|
2004
2004
|
left: 0;
|
|
2005
2005
|
top: 0;
|
|
@@ -2007,7 +2007,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2007
2007
|
width: ${({$pct:e})=>`${Math.max(0,Math.min(100,e))}%`};
|
|
2008
2008
|
border-radius: 3px;
|
|
2009
2009
|
background-color: ${({$color:e})=>e};
|
|
2010
|
-
`,$N="Locked: this class is promoted - its baseline is frozen and no longer changes.",NN="Learning: progress toward the resolved stability targets. A full bar is not promotion - Locked is only when phase is promoted.",AN=({phase:e,readyToPromote:i})=>{const n=v();if(i)return t(E,{label:"Ready to promote",backgroundColor:n.v2.colors.green[800],textColor:n.v2.colors.green[300],textSize:C.XXXS});switch(e){case uc.Empty:case uc.Learning:return t(E,{label:"Learning",backgroundColor:n.v2.colors.beige[600],textColor:n.v2.colors.black[500],textSize:C.XXXS});case uc.Promoted:return t(E,{label:"Promoted",leftIcon:Lu,status:ie.Success,textSize:C.XXXS});default:return null}},ON=({learning:i})=>{const n=v();if(!i)return null;switch(i.phase){case uc.Empty:return t(ce,{text:"No data yet: this class has not grown a baseline structure. Stability does not apply until it learns something.",children:t(w,{size:C.XXXS,color:k.Secondary,children:"No baseline data yet"})});case uc.Promoted:return t(ce,{text:$N,children:t(w,{size:C.XXXS,color:k.Secondary,children:"Baseline locked"})});case uc.Learning:{const{observations:l,duration:r}=i.stability;return t(ce,{text:i.readyToPromote?"Ready to promote: the learning policy gate is already satisfied, but the engine has not graduated the class yet.":NN,children:e($,{$gap:4,children:[e(w,{size:C.XXXS,color:k.Primary,children:[l.current.toLocaleString()," / ",l.target.toLocaleString()," observations"]}),t(TN,{children:t(IN,{$pct:(a=l.current,o=l.target,o<=0?0:a/o*100),$color:n.v2.colors.blue[400]})}),t(w,{size:C.XXXS,color:k.Secondary,children:r.current<=0?"grew just now":`grew ${hc(r.current,{units:2,style:"long",suffix:!0})}`})]})})}default:return null}var a,o};var EN;(e=>{e.TransactionId="transactionId",e.LastSeen="lastSeen",e.Namespace="namespace",e.Service="service",e.Kind="kind",e.Operation="operation",e.Baseline="baseline",e.Guardrail="guardrail",e.Volume="volume",e.TransactionCount="transactionCount"})(EN||(EN={}));const DN=(e,t,i,n)=>{const a=e.cells.find(e=>e.key===EN.TransactionId)?.rawValue,o="Promoted"===e.cells.find(e=>e.key===EN.Baseline)?.rawValue,l=[{id:`${e.id}-open-baseline`,label:"View more",tooltip:"Open this transaction's details and baselines",rightIcon:Cu,variant:K.Primary,onClick:()=>t(H$.Transaction,a)}];return i&&l.push({id:`${e.id}-promote-baselines`,label:"Promote baselines",leftIcon:Ou,variant:K.Secondary,disabled:o||!i.canPromote,onClick:()=>i.onPromote(a)}),n&&l.push({id:`${e.id}-delete`,label:"Delete",leftIcon:xu,variant:K.Secondary,disabled:!n.canDelete,onClick:()=>n.onDelete(a)}),l},zN=[{label:"Namespace",key:EN.Namespace},{label:"Service",key:EN.Service,noFilter:!0},{label:"Operation",key:EN.Operation,noFilter:!0},{label:"Kind",key:EN.Kind},{label:"Volume",key:EN.Volume,noFilter:!0},{label:"Baseline",key:EN.Baseline},{label:"Last seen",key:EN.LastSeen,noFilter:!0}],RN=[{label:"Namespace",key:EN.Namespace},{label:"Service",key:EN.Service,noFilter:!0},{label:"Baseline",key:EN.Baseline},{label:"Auto guardrail",key:EN.Guardrail,tooltip:"Once every transaction on a service is promoted, Odigos enforces only the transaction identities already learned - new ones are flagged."},{label:"Transactions",key:EN.TransactionCount,noFilter:!0},{label:"Volume",key:EN.Volume,noFilter:!0}],PN=e=>({total:e?.length||0,services:Array.from(new Set(e?.map(e=>e.service))).length,volume:e?.reduce((e,t)=>e+Number(t.volume),0)||0,promoted:e?.filter(e=>e.promoted).length||0,learning:e?.filter(e=>!e.promoted).length||0}),XN=(e,i,n,a,o)=>n?.slice(0,a||n.length).map(n=>({id:n.id,isSelected:o?o.selectedIds.includes(n.id):void 0,onSelect:o?()=>o.toggleSelection(n.id,!0):void 0,onDeselect:o?()=>o.toggleSelection(n.id,!1):void 0,cells:[{key:EN.TransactionId,rawValue:n.id},{key:EN.LastSeen,rawValue:i(n.lastSeen,{style:"short"})},{key:EN.Namespace,rawValue:n.namespace},{key:EN.Service,rawValue:n.service,component:()=>t(iN,{service:n.service,namespace:n.namespace})},{key:EN.Kind,rawValue:n.kind,component:()=>t(E,{label:n.kind,backgroundColor:e.v2.colors.blue[900]})},{key:EN.Operation,rawValue:Ag(n),component:()=>t(Ng,{operationName:n.operationName,identityDimensions:n.identityDimensions})},{key:EN.Baseline,rawValue:n.promoted?"Promoted":"Learning",component:()=>n.promoted?t(E,{label:"Promoted",leftIcon:Lu,status:ie.Success,textSize:C.XXXS,tooltip:$N}):t(E,{label:"Learning",backgroundColor:e.v2.colors.beige[600],textColor:e.v2.colors.black[500],textSize:C.XXXS,tooltip:NN})},{key:EN.Volume,rawValue:Number(n.volume).toLocaleString()}]}))||[],LN=({setSelectedTab:i})=>{const n=v(),{openDrawer:o}=J$(),{formatDurationAgo:r}=qn(),{insightsApi:s}=Hh(),[c,d]=l(gc),[p,u]=l(gc),{data:h,loading:g,refetch:m}=s.useFindings({windowHours:c}),{data:b,loading:f,refetch:y}=s.useTransactions({windowHours:p}),S=a(()=>(e=>e?.filter(hN)??[])(h),[h]),x=a(()=>gN(h),[h]),k=a(()=>yN(n,r,S,5),[S,n,r]),I=a(()=>PN(b),[b]),N=a(()=>XN(n,r,b,5),[b,n,r]);return e($,{children:[e(T,{$padding:"12px 0",$justifyContent:"space-between",children:[t(w,{size:C.M,children:"Runtime Trace Security (Insights)"}),t(H,{variant:K.Text,size:W.S,leftIcon:Zu,label:"Refresh",onClick:()=>{m(),y()},disabled:g||f})]}),e($,{$gap:24,children:[t(eN,{tableMaxHeight:"380px",richTitle:{title:"Top 5 Open Findings",titleSize:C.M,icon:Nh,badge:{label:S.length}},textCards:[{bgTint:"900",title:"Open findings",cells:[{value:x.open.toLocaleString()}]},{bgTint:"900",title:"Critical / High",cells:[{value:(x.critical+x.high).toLocaleString()}]},{bgTint:"900",title:"Policy violations",cells:[{value:x.violations.toLocaleString()}]},{bgTint:"900",title:"Anomalies",cells:[{value:x.anomalies.toLocaleString()}]}],tableColumns:dN,tableRows:k,tableNoDataProps:{icon:Nh,title:"No findings found",subTitle:""},isLoading:g,actions:[{id:"search-by-time",type:St.PopupButton,buttonProps:bc(c),popupProps:{children:({close:e})=>t(mc,{defaultValue:c,onApply:d,onClose:e})}},{id:"view-all",type:St.Button,buttonProps:{label:"View all",rightIcon:Cu,variant:K.Secondary,size:W.S,onClick:()=>i(j$.Findings)}}],getRowActions:e=>cN(e,o)}),t(eN,{tableMaxHeight:"380px",richTitle:{title:"Top 5 Transactions",titleSize:C.M,icon:Pu,badge:{label:b?.length||0}},textCards:[{bgTint:"900",title:"Transactions",cells:[{value:I.total.toLocaleString()}]},{bgTint:"900",title:"Services",cells:[{value:I.services.toLocaleString()}]},{bgTint:"900",title:"Volume",cells:[{value:I.volume.toLocaleString()}]},{bgTint:"900",title:"Baselines promoted",tooltip:'Share of learned baseline classes that have finished the learning phase (graduated), and are now enforced for anomaly detection. The rest are still learning what "normal" looks like.',cells:[{value:((I.promoted||0)/(I.total||1)*100).toFixed(1)+"%"}]}],tableColumns:zN,tableRows:N,tableNoDataProps:{icon:Pu,title:"No transactions found",subTitle:""},isLoading:f,actions:[{id:"search-by-time",type:St.PopupButton,buttonProps:bc(p),popupProps:{children:({close:e})=>t(mc,{defaultValue:p,onApply:u,onClose:e})}},{id:"view-all",type:St.Button,buttonProps:{label:"View all",rightIcon:Cu,variant:K.Secondary,size:W.S,onClick:()=>i(j$.Transactions)}}],getRowActions:e=>DN(e,o)})]})]})},_N={[rN.Dismiss]:{label:"Dismiss",title:e=>`Dismiss selected findings (${e})`,description:"Are you sure you want to dismiss the selected findings?"},[rN.Accept]:{label:"Accept",title:e=>`Accept selected findings (${e})`,description:"Are you sure you want to accept the selected findings?"}},MN=({actionType:i,selectedFindings:n,onDone:o,buttonProps:s})=>{const[c,d]=l(!1),[p,u]=l(!1),h=()=>u(!1),{insightsApi:g}=Hh(),m=_N[i],b=a(()=>{return!n.length||(t=i,(e=n).length>0&&e.every(e=>((e,t)=>sN[t].includes(e.status))(e,t)));var e,t},[n,i]);return e(r,{children:[t(H,{label:m.label,variant:K.Secondary,onClick:()=>u(!0),disabled:b,loading:c,...s}),t(Ce,{isOpen:p,onClose:h,title:m.title(n.length),description:m.description,denyButton:{label:"Cancel",variant:K.Secondary,onClick:h,loading:c},approveButton:{label:m.label,variant:K.Primary,disabled:!n.length,onClick:async()=>{d(!0),await(async(e,t,i)=>{const n=t.filter(e=>e.kind===cc.Anomaly&&e.transactionId&&e.signature),a=t.filter(e=>e.kind===cc.Violation),o=[],l=i===rN.Accept;if(n.length){const t=n.map(e=>({transactionId:e.transactionId,signature:e.signature}));if(e.bulkResolveAnomalies)o.push(e.bulkResolveAnomalies(l?dc.Accept:dc.Dismiss,t));else{const i=l?pc.Accept:pc.Dismiss;o.push(...t.map(t=>e.resolveAnomaly?.({...t,resolution:i})))}}if(a.length){const t=l?e.acceptViolation:e.dismissViolation;o.push(...a.map(e=>t?.({scopeKey:e.scopeKey||"",ruleKey:e.ruleKey||"",offending:e.offending||""})))}await Promise.all(o.filter(Boolean))})(g,n,i),d(!1),u(!1),o?.()},loading:c}})]})};var FN;(e=>{e.All="all",e.GroupByService="groupByService",e.GroupByTime="groupByTime"})(FN||(FN={}));const BN=[{label:"All findings",value:FN.All},{label:"Group by service",value:FN.GroupByService},{label:"Related findings",value:FN.GroupByTime}];var VN;(e=>{e.Open="open",e.Dismissed="dismissed",e.Accepted="accepted"})(VN||(VN={}));const UN=[{label:"Open",value:VN.Open},{label:"Dismissed",value:VN.Dismissed},{label:"Accepted",value:VN.Accepted}],GN=()=>{const i=v(),{openDrawer:n}=J$(),{formatDurationAgo:o}=qn(),{insightsApi:r}=Hh(),[s,c]=l(gc),{data:p,loading:u,refetch:h}=r.useFindings({windowHours:s}),[g,m]=l([]),b=d((e,t)=>{m(i=>t?-1===i.findIndex(t=>lN(t,e))?[...i,e]:i:i.filter(t=>!lN(t,e)))},[]),[f,y]=l(""),[S,x]=l(FN.All),[I,$]=l(VN.Open),{openFindings:A,dismissedFindings:O,acceptedFindings:D}=a(()=>{const e=[],t=[],i=[];return p?.forEach(n=>{hN(n)&&e.push(n),[rc.Dismissed,sc.Dismissed].includes(n.status)&&t.push(n),[rc.Accepted,sc.Accepted].includes(n.status)&&i.push(n)}),{openFindings:e,dismissedFindings:t,acceptedFindings:i}},[p]),z=a(()=>I===VN.Open?A:I===VN.Dismissed?O:I===VN.Accepted?D:[],[I,A,O,D]),R=a(()=>f?z?.filter(e=>{const t=f.toLowerCase();return e.namespace?.toLowerCase().includes(t)||e.service?.toLowerCase().includes(t)||e.kind?.toLowerCase().includes(t)||e.title.toLowerCase().includes(t)||e.operationName?.toLowerCase().includes(t)||e.identityDimensions?.some(e=>e.key.toLowerCase().includes(t)||e.value.toLowerCase().includes(t))}):z,[z,f]),P=a(()=>gN(z),[z]),X=a(()=>{if(S===FN.GroupByService){const e=[];return R?.forEach(t=>{const i=e.find(e=>e.service===t.service);i?(i.findings.push(t),i.occurrences+=t.occurrences,new Date(i.lastSeen)<new Date(t.lastSeen)&&(i.lastSeen=t.lastSeen)):e.push({service:t.service,namespace:t.namespace,occurrences:t.occurrences,lastSeen:t.lastSeen,findings:[t]})}),((e,i,n,a,o,l)=>a.map(a=>({id:`${a.namespace}/${a.service}`,cells:[{key:nN.Namespace,rawValue:a.namespace},{key:nN.Service,rawValue:a.service,component:()=>t(iN,{service:a.service,namespace:a.namespace})},{key:nN.Occurrences,rawValue:Number(a.occurrences).toLocaleString()},{key:nN.LastSeen,rawValue:new Date(a.lastSeen).toLocaleString()}],expandedContent:({maxHeight:r})=>t(za,{fitContent:!0,variant:Ra.DataSecondary,maxHeight:r,columns:dN,rows:yN(e,i,a.findings,void 0,o,l),getRowActions:e=>cN(e,n),withCheckboxes:!0})})))(i,o,n,e,g,b)}if(S===FN.GroupByTime){const a=(e=>{const t=[...e].sort((e,t)=>new Date(aN(e)).getTime()-new Date(aN(t)).getTime()),i=[];return t.forEach(e=>{const t=aN(e),n=new Date(t).getTime(),a=i[i.length-1];!a||n-new Date(a.endTime).getTime()>3e4?i.push({startTime:t,endTime:t,occurrences:e.occurrences,findings:[e]}):(a.findings.push(e),a.occurrences+=e.occurrences,a.endTime=t)}),i.reverse()})(R??[]);return((i,n,a,o,l,r)=>[...o].sort((e,t)=>fN[vN(t.findings)]-fN[vN(e.findings)]).map((o,s)=>({id:`time-${s}-${o.startTime}-${o.endTime}`,cells:[{key:nN.Title,rawValue:wN(o,n),component:()=>{const a=o.findings.length,l=vN(o.findings),r=[...new Set(o.findings.map(e=>e.service))],s=1===r.length?"service":"services",c=SN(o,n),d=xN(o);return e(T,{$gap:6,$alignItems:"center",$wrap:"nowrap",children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:c}),t(w,{size:C.XS,color:k.Primary,weight:600,nowrap:!0,children:a}),e(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:[a>1?"possibly related ":"","suspicious ",1===a?"finding":"findings",a>1?" up to":""]}),t(E,{...mN(i,l)}),e(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:["found in ",s]}),t(w,{size:C.XS,color:k.Primary,weight:600,nowrap:!0,children:r.join(", ")}),t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:d})]})}}],expandedContent:({maxHeight:e})=>t(za,{fitContent:!0,variant:Ra.DataSecondary,maxHeight:e,columns:dN,rows:yN(i,n,o.findings,void 0,l,r),getRowActions:e=>cN(e,a),withCheckboxes:!0})})))(i,o,n,a,g,b)}return yN(i,o,R,void 0,g,b)},[i,R,S,o,n,g,b]);return t(eN,{richTitle:{title:"Findings",titleSize:C.M,icon:Nh,badge:{label:z?.length||0},children:t(N,{$padding:"0 0 0 32px",children:t(F,{options:UN,selected:I,setSelected:$,size:Zt.L})})},textCards:[{bgTint:"900",title:(I===VN.Open?"Open":I===VN.Dismissed?"Dismissed":"Accepted")+" findings",cells:[{value:P.open.toLocaleString()}]},{bgTint:"900",title:"Critical / High",cells:[{value:(P.critical+P.high).toLocaleString()}]},{bgTint:"900",title:"Policy violations",cells:[{value:P.violations.toLocaleString()}]},{bgTint:"900",title:"Anomalies",cells:[{value:P.anomalies.toLocaleString()}]}],tableKey:S,tableColumns:S===FN.GroupByService?pN:S===FN.GroupByTime?uN:dN,tableRows:X,tableWithCheckboxes:S===FN.All,tableNoDataProps:{icon:Nh,title:f?"No matched findings":"No findings found",subTitle:f?`No findings matched your search criteria: ${f}`:""},isLoading:u,actions:[{id:"search-by-time",type:St.PopupButton,buttonProps:bc(s),popupProps:{children:({close:e})=>t(mc,{defaultValue:s,onApply:c,onClose:e})}},{id:"refresh",type:St.Button,buttonProps:{label:"Refresh",leftIcon:Zu,variant:K.Secondary,size:W.S,disabled:u,onClick:()=>h()}}],getRowActions:S===FN.All?e=>cN(e,n):void 0,children:e(T,{$width:"100%",$gap:24,$justifyContent:"space-between",children:[e(T,{$gap:12,children:[t(nc,{title:"Findings list",titleSize:C.S,badge:{label:R?.length||0}}),t(sa,{width:"400px",value:f,onChange:y}),t(F,{options:BN,selected:S,setSelected:x,size:Zt.L})]}),e(T,{$gap:12,children:[t(MN,{actionType:rN.Dismiss,selectedFindings:g,onDone:()=>{m([]),h()},buttonProps:{label:"Dismiss selection"}}),t(MN,{actionType:rN.Accept,selectedFindings:g,onDone:()=>{m([]),h()},buttonProps:{label:"Accept selection",variant:K.Primary}})]})]})})};var jN;(e=>{e.All="all",e.GroupByService="groupByService"})(jN||(jN={}));const HN=[{label:"Group by service",value:jN.GroupByService},{label:"All transactions",value:jN.All}],WN=()=>{const i=v(),{openDrawer:n}=J$(),{formatDurationAgo:o}=qn(),{insightsApi:r}=Hh(),[s,c]=l(""),[p,u]=l(gc),{data:h,loading:g,refetch:m}=r.useTransactions({windowHours:p}),{data:b}=r.useGuardrails(),[f,y]=l(jN.GroupByService),[S,x]=l([]),[w,k]=l(null),[I,$]=l(null),[N,A]=l(!1),[O,D]=l(!1),[z,R]=l(null),[P,X]=l(null),[L,_]=l(null),M=d((e,t)=>{x(i=>t?i.includes(e)?i:[...i,e]:i.filter(t=>t!==e))},[]),B=a(()=>({selectedIds:S,toggleSelection:M}),[S,M]),V=a(()=>({onPromote:k,canPromote:!!r.promoteTransactionBaselines}),[r.promoteTransactionBaselines]),U=a(()=>({onDelete:$,canDelete:!!r.deleteTransaction}),[r.deleteTransaction]),G=a(()=>{const e=new Set;return b?.forEach(t=>{t.rules.some(e=>"allowed_transactions"===e.key&&e.mode===Ue.Enforce)&&e.add(t.scopeKey)}),e},[b]),j=a(()=>s?h?.filter(e=>{const t=s.toLowerCase();return e.id?.toLowerCase().includes(t)||e.namespace?.toLowerCase().includes(t)||e.service?.toLowerCase().includes(t)||e.kind?.toLowerCase().includes(t)||e.operationName?.toLowerCase().includes(t)||e.identityDimensions?.some(e=>e.key.toLowerCase().includes(t)||e.value.toLowerCase().includes(t))}):h,[h,s]),Y=a(()=>PN(h),[h]),J=a(()=>{if(!S.length||!h?.length)return[];const e=new Set(S);return h.filter(t=>e.has(t.id)&&!t.promoted).map(e=>e.id)},[h,S]),q=a(()=>{if(f===jN.GroupByService){const e=[];return j?.forEach(t=>{const i=e.find(e=>e.service===t.service);i?(i.transactions.push(t),i.volume+=t.volume):e.push({namespace:t.namespace,service:t.service,volume:t.volume,transactions:[t]})}),((e,i,n,a,o,l,r,s)=>a.map(a=>{const c=a.transactions.length,d=a.transactions.filter(e=>e.promoted).length,p=d===c,u=`${a.namespace}/${a.service}`,h=o?.has(u)??!1;return{id:u,cells:[{key:EN.Namespace,rawValue:a.namespace},{key:EN.Service,rawValue:a.service,component:()=>t(iN,{service:a.service,namespace:a.namespace})},{key:EN.Baseline,rawValue:p?"Promoted":"Learning",component:()=>t(E,p?{label:`${d}/${c} Promoted`,rightIcon:Lu,status:ie.Success,textSize:C.XXXS,tooltip:$N}:{label:`${d}/${c} Learning`,backgroundColor:e.v2.colors.beige[600],textColor:e.v2.colors.black[500],textSize:C.XXXS,tooltip:NN})},{key:EN.Guardrail,rawValue:h?"Enabled":"Disabled",component:()=>t(E,h?{label:"Enabled",leftIcon:Lu,status:ie.Success,invertColors:!0,textSize:C.XXXS}:{label:"Disabled",leftIcon:Xu,status:ie.Disabled,invertColors:!0,textSize:C.XXXS})},{key:EN.TransactionCount,rawValue:a.transactions.length.toLocaleString()},{key:EN.Volume,rawValue:a.volume.toLocaleString()}],expandedContent:({maxHeight:o})=>t(za,{fitContent:!0,variant:Ra.DataSecondary,maxHeight:o,columns:zN,rows:XN(e,i,a.transactions,void 0,l),getRowActions:e=>DN(e,n,r,s),withCheckboxes:!!l})}}))(i,o,n,e,G,B,V,U)}return XN(i,o,j,void 0,B)},[i,j,f,o,n,G,B,V,U]);return e(eN,{richTitle:{title:"Transactions",titleSize:C.M,icon:Pu,badge:{label:h?.length||0}},textCards:[{bgTint:"900",title:"Transactions",cells:[{value:Y.total.toLocaleString()}]},{bgTint:"900",title:"Services",cells:[{value:Y.services.toLocaleString()}]},{bgTint:"900",title:"Volume",cells:[{value:Y.volume.toLocaleString()}]},{bgTint:"900",title:"Baseline Promoted",cells:[{value:((Y.promoted||0)/(Y.total||1)*100).toFixed(1)+"%"}]}],tableKey:f,tableColumns:f===jN.GroupByService?RN:zN,tableRows:q,tableWithCheckboxes:f===jN.All,tableNoDataProps:{icon:Pu,title:s?"No matched transactions":"No transactions found",subTitle:s?`No transactions matched your search criteria: ${s}`:""},isLoading:g,actions:[{id:"search-by-time",type:St.PopupButton,buttonProps:bc(p),popupProps:{children:({close:e})=>t(mc,{defaultValue:p,onApply:u,onClose:e})}},{id:"refresh",type:St.Button,buttonProps:{label:"Refresh",leftIcon:Zu,variant:K.Secondary,size:W.S,disabled:g,onClick:()=>m()}}],getRowActions:e=>{if(f===jN.All)return DN(e,n,V,U);const t=e.cells.find(e=>e.key===EN.Namespace)?.rawValue,i=e.cells.find(e=>e.key===EN.Service)?.rawValue,a="Promoted"===e.cells.find(e=>e.key===EN.Baseline)?.rawValue,o=G.has(((e,t)=>`${e}/${t}`)(t,i)),l={namespace:t,service:i},s=[];return o?s.push({id:`${e.id}-disable-txn-guardrail`,label:"Disable transaction guardrail",leftIcon:Ah,variant:K.Secondary,disabled:!r.disableTransactionGuardrail,onClick:()=>_(l)}):s.push({id:`${e.id}-enable-txn-guardrail`,label:"Enable transaction guardrail",leftIcon:Ah,variant:K.Primary,disabled:!r.enableTransactionGuardrail,onClick:()=>X(l)}),s.push({id:`${e.id}-promote-service`,label:"Promote service",leftIcon:Ou,variant:K.Primary,disabled:a||!r.forcePromoteService,onClick:()=>R(l)}),s},children:[e(T,{$width:"100%",$gap:24,$justifyContent:"space-between",children:[e(T,{$gap:12,children:[t(nc,{title:"Transactions list",titleSize:C.S,badge:{label:j?.length||0}}),t(sa,{width:"400px",value:s,onChange:c}),t(F,{options:HN,selected:f,setSelected:y,size:Zt.L})]}),e(T,{$gap:12,children:[t(H,{label:"Delete selection",leftIcon:xu,variant:K.Secondary,disabled:!S.length||!r.bulkDeleteTransactions,onClick:()=>D(!0)}),t(H,{label:"Promote selection",leftIcon:Ou,variant:K.Primary,disabled:!J.length||!r.bulkPromoteTransactions,onClick:()=>A(!0)})]})]}),t(Ce,{isOpen:null!==w,onClose:()=>k(null),title:"Promote transaction",description:"Promote every scored baseline class on this transaction? Learning gates will be skipped and baselines will freeze.",approveButton:{label:"Promote now",onClick:()=>(async()=>{if(!w)return;const e=w;k(null),await(r.promoteTransactionBaselines?.(e))})()},denyButton:{label:"Cancel",onClick:()=>k(null),variant:K.Secondary}}),t(Ce,{isOpen:null!==I,onClose:()=>$(null),title:"Delete transaction",description:"Permanently delete this transaction and its related baselines, samples, issues, and transaction-scoped policies?",approveButton:{label:"Delete",onClick:()=>(async()=>{if(!I)return;const e=I;$(null),x(t=>t.filter(t=>t!==e)),await(r.deleteTransaction?.(e))})()},denyButton:{label:"Cancel",onClick:()=>$(null),variant:K.Secondary}}),t(Ce,{isOpen:N,onClose:()=>A(!1),title:`Promote selected transactions (${J.length})`,description:"Promote every scored baseline class on each selected transaction that is not already promoted? Learning gates will be skipped and baselines will freeze.",approveButton:{label:"Promote selection",onClick:()=>(async()=>{A(!1);const e=J;x([]),e.length&&await(r.bulkPromoteTransactions?.(e))})()},denyButton:{label:"Cancel",onClick:()=>A(!1),variant:K.Secondary}}),t(Ce,{isOpen:O,onClose:()=>D(!1),title:`Delete selected transactions (${S.length})`,description:"Permanently delete each selected transaction and its related baselines, samples, issues, and transaction-scoped policies?",approveButton:{label:"Delete selection",onClick:()=>(async()=>{D(!1);const e=S;x([]),await(r.bulkDeleteTransactions?.(e))})()},denyButton:{label:"Cancel",onClick:()=>D(!1),variant:K.Secondary}}),t(Ce,{isOpen:null!==z,onClose:()=>R(null),title:"Force promote service",description:`Promote every scored baseline class on every transaction of ${z?.service??"this service"}? This skips learning gates and may auto-enable the transaction guardrail.`,approveButton:{label:"Force promote",onClick:()=>(async()=>{if(!z)return;const e=z;R(null),await(r.forcePromoteService?.(e))})()},denyButton:{label:"Cancel",onClick:()=>R(null),variant:K.Secondary}}),t(Ce,{isOpen:null!==P,onClose:()=>X(null),title:"Enable transaction guardrail",description:`Create an allowed_transactions guardrail for ${P?.service??"this service"} from its current operations? New operations will become findings.`,approveButton:{label:"Enable",onClick:()=>(async()=>{if(!P)return;const e=P;X(null),await(r.enableTransactionGuardrail?.(e))})()},denyButton:{label:"Cancel",onClick:()=>X(null),variant:K.Secondary}}),t(Ce,{isOpen:null!==L,onClose:()=>_(null),title:"Disable transaction guardrail",description:`Disable the allowed_transactions guardrail for ${L?.service??"this service"}? New operations will no longer create findings until the guardrail is enabled again.`,approveButton:{label:"Disable",onClick:()=>(async()=>{if(!L)return;const e=L;_(null),await(r.disableTransactionGuardrail?.(e))})()},denyButton:{label:"Cancel",onClick:()=>_(null),variant:K.Secondary}})]})},KN=(e,t,i)=>({title:e,titleSize:C.S,subTitle:t,subTitleWrap:!0,subTitleSize:C.XXXS,textGap:4,icon:i}),YN=f.div`
|
|
2010
|
+
`,EN="Locked: this class is promoted - its baseline is frozen and no longer changes.",DN="Learning: progress toward the resolved stability targets. A full bar is not promotion - Locked is only when phase is promoted.",zN=({phase:e,readyToPromote:i})=>{const n=v();if(i)return t(E,{label:"Ready to promote",backgroundColor:n.v2.colors.green[800],textColor:n.v2.colors.green[300],textSize:C.XXXS});switch(e){case mc.Empty:case mc.Learning:return t(E,{label:"Learning",backgroundColor:n.v2.colors.beige[600],textColor:n.v2.colors.black[500],textSize:C.XXXS});case mc.Promoted:return t(E,{label:"Promoted",leftIcon:Fu,status:ie.Success,textSize:C.XXXS});default:return null}},RN=({learning:i})=>{const n=v();if(!i)return null;switch(i.phase){case mc.Empty:return t(ce,{text:"No data yet: this class has not grown a baseline structure. Stability does not apply until it learns something.",children:t(w,{size:C.XXXS,color:k.Secondary,children:"No baseline data yet"})});case mc.Promoted:return t(ce,{text:EN,children:t(w,{size:C.XXXS,color:k.Secondary,children:"Baseline locked"})});case mc.Learning:{const{observations:l,duration:r}=i.stability;return t(ce,{text:i.readyToPromote?"Ready to promote: the learning policy gate is already satisfied, but the engine has not graduated the class yet.":DN,children:e($,{$gap:4,children:[e(w,{size:C.XXXS,color:k.Primary,children:[l.current.toLocaleString()," / ",l.target.toLocaleString()," observations"]}),t(AN,{children:t(ON,{$pct:(a=l.current,o=l.target,o<=0?0:a/o*100),$color:n.v2.colors.blue[400]})}),t(w,{size:C.XXXS,color:k.Secondary,children:r.current<=0?"grew just now":`grew ${bc(r.current,{units:2,style:"long",suffix:!0})}`})]})})}default:return null}var a,o};var PN;(e=>{e.TransactionId="transactionId",e.LastSeen="lastSeen",e.Namespace="namespace",e.Service="service",e.Kind="kind",e.Operation="operation",e.Baseline="baseline",e.Guardrail="guardrail",e.Volume="volume",e.TransactionCount="transactionCount"})(PN||(PN={}));const XN=(e,t,i,n)=>{const a=e.cells.find(e=>e.key===PN.TransactionId)?.rawValue,o="Promoted"===e.cells.find(e=>e.key===PN.Baseline)?.rawValue,l=[{id:`${e.id}-open-baseline`,label:"View more",tooltip:"Open this transaction's details and baselines",rightIcon:Iu,variant:K.Primary,onClick:()=>t(J$.Transaction,a)}];return i&&l.push({id:`${e.id}-promote-baselines`,label:"Promote baselines",leftIcon:zu,variant:K.Secondary,disabled:o||!i.canPromote,onClick:()=>i.onPromote(a)}),n&&l.push({id:`${e.id}-delete`,label:"Delete",leftIcon:ku,variant:K.Secondary,disabled:!n.canDelete,onClick:()=>n.onDelete(a)}),l},LN=[{label:"Namespace",key:PN.Namespace},{label:"Service",key:PN.Service,noFilter:!0},{label:"Operation",key:PN.Operation,noFilter:!0},{label:"Kind",key:PN.Kind},{label:"Volume",key:PN.Volume,noFilter:!0},{label:"Baseline",key:PN.Baseline},{label:"Last seen",key:PN.LastSeen,noFilter:!0}],_N=[{label:"Namespace",key:PN.Namespace},{label:"Service",key:PN.Service,noFilter:!0},{label:"Baseline",key:PN.Baseline},{label:"Auto guardrail",key:PN.Guardrail,tooltip:"Once every transaction on a service is promoted, Odigos enforces only the transaction identities already learned - new ones are flagged."},{label:"Transactions",key:PN.TransactionCount,noFilter:!0},{label:"Volume",key:PN.Volume,noFilter:!0}],MN=e=>({total:e?.length||0,services:Array.from(new Set(e?.map(e=>e.service))).length,volume:e?.reduce((e,t)=>e+Number(t.volume),0)||0,promoted:e?.filter(e=>e.promoted).length||0,learning:e?.filter(e=>!e.promoted).length||0}),FN=(e,i,n,a,o)=>n?.slice(0,a||n.length).map(n=>({id:n.id,isSelected:o?o.selectedIds.includes(n.id):void 0,onSelect:o?()=>o.toggleSelection(n.id,!0):void 0,onDeselect:o?()=>o.toggleSelection(n.id,!1):void 0,cells:[{key:PN.TransactionId,rawValue:n.id},{key:PN.LastSeen,rawValue:i(n.lastSeen,{style:"short"})},{key:PN.Namespace,rawValue:n.namespace},{key:PN.Service,rawValue:n.service,component:()=>t(lN,{service:n.service,namespace:n.namespace})},{key:PN.Kind,rawValue:n.kind,component:()=>t(E,{label:n.kind,backgroundColor:e.v2.colors.blue[900]})},{key:PN.Operation,rawValue:zg(n),component:()=>t(Dg,{operationName:n.operationName,identityDimensions:n.identityDimensions})},{key:PN.Baseline,rawValue:n.promoted?"Promoted":"Learning",component:()=>n.promoted?t(E,{label:"Promoted",leftIcon:Fu,status:ie.Success,textSize:C.XXXS,tooltip:EN}):t(E,{label:"Learning",backgroundColor:e.v2.colors.beige[600],textColor:e.v2.colors.black[500],textSize:C.XXXS,tooltip:DN})},{key:PN.Volume,rawValue:Number(n.volume).toLocaleString()}]}))||[],BN=({setSelectedTab:i})=>{const n=v(),{openDrawer:o}=eN(),{formatDurationAgo:r}=qn(),{insightsApi:s}=Jh(),[c,d]=l(fc),[p,u]=l(fc),{data:h,loading:g,refetch:m}=s.useFindings({windowHours:c}),{data:b,loading:f,refetch:y}=s.useTransactions({windowHours:p}),S=a(()=>(e=>e?.filter(fN)??[])(h),[h]),x=a(()=>vN(h),[h]),k=a(()=>CN(n,r,S,5),[S,n,r]),I=a(()=>MN(b),[b]),N=a(()=>FN(n,r,b,5),[b,n,r]);return e($,{children:[e(T,{$padding:"12px 0",$justifyContent:"space-between",children:[t(w,{size:C.M,children:"Runtime Trace Security (Insights)"}),t(H,{variant:K.Text,size:W.S,leftIcon:th,label:"Refresh",onClick:()=>{m(),y()},disabled:g||f})]}),e($,{$gap:24,children:[t(aN,{tableMaxHeight:"380px",richTitle:{title:"Top 5 Open Findings",titleSize:C.M,icon:Eh,badge:{label:S.length}},textCards:[{bgTint:"900",title:"Open findings",cells:[{value:x.open.toLocaleString()}]},{bgTint:"900",title:"Critical / High",cells:[{value:(x.critical+x.high).toLocaleString()}]},{bgTint:"900",title:"Policy violations",cells:[{value:x.violations.toLocaleString()}]},{bgTint:"900",title:"Anomalies",cells:[{value:x.anomalies.toLocaleString()}]}],tableColumns:gN,tableRows:k,tableNoDataProps:{icon:Eh,title:"No findings found",subTitle:""},isLoading:g,actions:[{id:"search-by-time",type:St.PopupButton,buttonProps:yc(c),popupProps:{children:({close:e})=>t(vc,{defaultValue:c,onApply:d,onClose:e})}},{id:"view-all",type:St.Button,buttonProps:{label:"View all",rightIcon:Iu,variant:K.Secondary,size:W.S,onClick:()=>i(Y$.Findings)}}],getRowActions:e=>hN(e,o)}),t(aN,{tableMaxHeight:"380px",richTitle:{title:"Top 5 Transactions",titleSize:C.M,icon:_u,badge:{label:b?.length||0}},textCards:[{bgTint:"900",title:"Transactions",cells:[{value:I.total.toLocaleString()}]},{bgTint:"900",title:"Services",cells:[{value:I.services.toLocaleString()}]},{bgTint:"900",title:"Volume",cells:[{value:I.volume.toLocaleString()}]},{bgTint:"900",title:"Baselines promoted",tooltip:'Share of learned baseline classes that have finished the learning phase (graduated), and are now enforced for anomaly detection. The rest are still learning what "normal" looks like.',cells:[{value:((I.promoted||0)/(I.total||1)*100).toFixed(1)+"%"}]}],tableColumns:LN,tableRows:N,tableNoDataProps:{icon:_u,title:"No transactions found",subTitle:""},isLoading:f,actions:[{id:"search-by-time",type:St.PopupButton,buttonProps:yc(p),popupProps:{children:({close:e})=>t(vc,{defaultValue:p,onApply:u,onClose:e})}},{id:"view-all",type:St.Button,buttonProps:{label:"View all",rightIcon:Iu,variant:K.Secondary,size:W.S,onClick:()=>i(Y$.Transactions)}}],getRowActions:e=>XN(e,o)})]})]})},VN={[pN.Dismiss]:{label:"Dismiss",title:e=>`Dismiss selected findings (${e})`,description:"Are you sure you want to dismiss the selected findings?"},[pN.Accept]:{label:"Accept",title:e=>`Accept selected findings (${e})`,description:"Are you sure you want to accept the selected findings?"}},UN=({actionType:i,selectedFindings:n,onDone:o,buttonProps:s})=>{const[c,d]=l(!1),[p,u]=l(!1),h=()=>u(!1),{insightsApi:g}=Jh(),m=VN[i],b=a(()=>{return!n.length||(t=i,(e=n).length>0&&e.every(e=>((e,t)=>uN[t].includes(e.status))(e,t)));var e,t},[n,i]);return e(r,{children:[t(H,{label:m.label,variant:K.Secondary,onClick:()=>u(!0),disabled:b,loading:c,...s}),t(Ce,{isOpen:p,onClose:h,title:m.title(n.length),description:m.description,denyButton:{label:"Cancel",variant:K.Secondary,onClick:h,loading:c},approveButton:{label:m.label,variant:K.Primary,disabled:!n.length,onClick:async()=>{d(!0),await(async(e,t,i)=>{const n=t.filter(e=>e.kind===uc.Anomaly&&e.transactionId&&e.signature),a=t.filter(e=>e.kind===uc.Violation),o=[],l=i===pN.Accept;if(n.length){const t=n.map(e=>({transactionId:e.transactionId,signature:e.signature}));if(e.bulkResolveAnomalies)o.push(e.bulkResolveAnomalies(l?hc.Accept:hc.Dismiss,t));else{const i=l?gc.Accept:gc.Dismiss;o.push(...t.map(t=>e.resolveAnomaly?.({...t,resolution:i})))}}if(a.length){const t=l?e.acceptViolation:e.dismissViolation;o.push(...a.map(e=>t?.({scopeKey:e.scopeKey||"",ruleKey:e.ruleKey||"",offending:e.offending||""})))}await Promise.all(o.filter(Boolean))})(g,n,i),d(!1),u(!1),o?.()},loading:c}})]})};var GN;(e=>{e.All="all",e.GroupByService="groupByService",e.GroupByTime="groupByTime"})(GN||(GN={}));const jN=[{label:"All findings",value:GN.All},{label:"Group by service",value:GN.GroupByService},{label:"Related findings",value:GN.GroupByTime}];var HN;(e=>{e.Open="open",e.Dismissed="dismissed",e.Accepted="accepted"})(HN||(HN={}));const WN=[{label:"Open",value:HN.Open},{label:"Dismissed",value:HN.Dismissed},{label:"Accepted",value:HN.Accepted}],KN=()=>{const i=v(),{openDrawer:n}=eN(),{formatDurationAgo:o}=qn(),{insightsApi:r}=Jh(),[s,c]=l(fc),{data:p,loading:u,refetch:h}=r.useFindings({windowHours:s}),[g,m]=l([]),b=d((e,t)=>{m(i=>t?-1===i.findIndex(t=>dN(t,e))?[...i,e]:i:i.filter(t=>!dN(t,e)))},[]),[f,y]=l(""),[S,x]=l(GN.All),[I,$]=l(HN.Open),{openFindings:A,dismissedFindings:O,acceptedFindings:D}=a(()=>{const e=[],t=[],i=[];return p?.forEach(n=>{fN(n)&&e.push(n),[dc.Dismissed,pc.Dismissed].includes(n.status)&&t.push(n),[dc.Accepted,pc.Accepted].includes(n.status)&&i.push(n)}),{openFindings:e,dismissedFindings:t,acceptedFindings:i}},[p]),z=a(()=>I===HN.Open?A:I===HN.Dismissed?O:I===HN.Accepted?D:[],[I,A,O,D]),R=a(()=>f?z?.filter(e=>{const t=f.toLowerCase();return e.namespace?.toLowerCase().includes(t)||e.service?.toLowerCase().includes(t)||e.kind?.toLowerCase().includes(t)||e.title.toLowerCase().includes(t)||e.operationName?.toLowerCase().includes(t)||e.identityDimensions?.some(e=>e.key.toLowerCase().includes(t)||e.value.toLowerCase().includes(t))}):z,[z,f]),P=a(()=>vN(z),[z]),X=a(()=>{if(S===GN.GroupByService){const e=[];return R?.forEach(t=>{const i=e.find(e=>e.service===t.service);i?(i.findings.push(t),i.occurrences+=t.occurrences,new Date(i.lastSeen)<new Date(t.lastSeen)&&(i.lastSeen=t.lastSeen)):e.push({service:t.service,namespace:t.namespace,occurrences:t.occurrences,lastSeen:t.lastSeen,findings:[t]})}),((e,i,n,a,o,l)=>a.map(a=>({id:`${a.namespace}/${a.service}`,cells:[{key:rN.Namespace,rawValue:a.namespace},{key:rN.Service,rawValue:a.service,component:()=>t(lN,{service:a.service,namespace:a.namespace})},{key:rN.Occurrences,rawValue:Number(a.occurrences).toLocaleString()},{key:rN.LastSeen,rawValue:new Date(a.lastSeen).toLocaleString()}],expandedContent:({maxHeight:r})=>t(Xa,{fitContent:!0,variant:La.DataSecondary,maxHeight:r,columns:gN,rows:CN(e,i,a.findings,void 0,o,l),getRowActions:e=>hN(e,n),withCheckboxes:!0})})))(i,o,n,e,g,b)}if(S===GN.GroupByTime){const a=(e=>{const t=[...e].sort((e,t)=>new Date(sN(e)).getTime()-new Date(sN(t)).getTime()),i=[];return t.forEach(e=>{const t=sN(e),n=new Date(t).getTime(),a=i[i.length-1];!a||n-new Date(a.endTime).getTime()>3e4?i.push({startTime:t,endTime:t,occurrences:e.occurrences,findings:[e]}):(a.findings.push(e),a.occurrences+=e.occurrences,a.endTime=t)}),i.reverse()})(R??[]);return((i,n,a,o,l,r)=>[...o].sort((e,t)=>xN[wN(t.findings)]-xN[wN(e.findings)]).map((o,s)=>({id:`time-${s}-${o.startTime}-${o.endTime}`,cells:[{key:rN.Title,rawValue:IN(o,n),component:()=>{const a=o.findings.length,l=wN(o.findings),r=[...new Set(o.findings.map(e=>e.service))],s=1===r.length?"service":"services",c=kN(o,n),d=TN(o);return e(T,{$gap:6,$alignItems:"center",$wrap:"nowrap",children:[t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:c}),t(w,{size:C.XS,color:k.Primary,weight:600,nowrap:!0,children:a}),e(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:[a>1?"possibly related ":"","suspicious ",1===a?"finding":"findings",a>1?" up to":""]}),t(E,{...yN(i,l)}),e(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:["found in ",s]}),t(w,{size:C.XS,color:k.Primary,weight:600,nowrap:!0,children:r.join(", ")}),t(w,{size:C.XS,color:k.Secondary,nowrap:!0,children:d})]})}}],expandedContent:({maxHeight:e})=>t(Xa,{fitContent:!0,variant:La.DataSecondary,maxHeight:e,columns:gN,rows:CN(i,n,o.findings,void 0,l,r),getRowActions:e=>hN(e,a),withCheckboxes:!0})})))(i,o,n,a,g,b)}return CN(i,o,R,void 0,g,b)},[i,R,S,o,n,g,b]);return t(aN,{richTitle:{title:"Findings",titleSize:C.M,icon:Eh,badge:{label:z?.length||0},children:t(N,{$padding:"0 0 0 32px",children:t(F,{options:WN,selected:I,setSelected:$,size:Zt.L})})},textCards:[{bgTint:"900",title:(I===HN.Open?"Open":I===HN.Dismissed?"Dismissed":"Accepted")+" findings",cells:[{value:P.open.toLocaleString()}]},{bgTint:"900",title:"Critical / High",cells:[{value:(P.critical+P.high).toLocaleString()}]},{bgTint:"900",title:"Policy violations",cells:[{value:P.violations.toLocaleString()}]},{bgTint:"900",title:"Anomalies",cells:[{value:P.anomalies.toLocaleString()}]}],tableKey:S,tableColumns:S===GN.GroupByService?mN:S===GN.GroupByTime?bN:gN,tableRows:X,tableWithCheckboxes:S===GN.All,tableNoDataProps:{icon:Eh,title:f?"No matched findings":"No findings found",subTitle:f?`No findings matched your search criteria: ${f}`:""},isLoading:u,actions:[{id:"search-by-time",type:St.PopupButton,buttonProps:yc(s),popupProps:{children:({close:e})=>t(vc,{defaultValue:s,onApply:c,onClose:e})}},{id:"refresh",type:St.Button,buttonProps:{label:"Refresh",leftIcon:th,variant:K.Secondary,size:W.S,disabled:u,onClick:()=>h()}}],getRowActions:S===GN.All?e=>hN(e,n):void 0,children:e(T,{$width:"100%",$gap:24,$justifyContent:"space-between",children:[e(T,{$gap:12,children:[t(lc,{title:"Findings list",titleSize:C.S,badge:{label:R?.length||0}}),t(sa,{width:"400px",value:f,onChange:y}),t(F,{options:jN,selected:S,setSelected:x,size:Zt.L})]}),e(T,{$gap:12,children:[t(UN,{actionType:pN.Dismiss,selectedFindings:g,onDone:()=>{m([]),h()},buttonProps:{label:"Dismiss selection"}}),t(UN,{actionType:pN.Accept,selectedFindings:g,onDone:()=>{m([]),h()},buttonProps:{label:"Accept selection",variant:K.Primary}})]})]})})};var YN;(e=>{e.All="all",e.GroupByService="groupByService"})(YN||(YN={}));const JN=[{label:"Group by service",value:YN.GroupByService},{label:"All transactions",value:YN.All}],qN=()=>{const i=v(),{openDrawer:n}=eN(),{formatDurationAgo:o}=qn(),{insightsApi:r}=Jh(),[s,c]=l(""),[p,u]=l(fc),{data:h,loading:g,refetch:m}=r.useTransactions({windowHours:p}),{data:b}=r.useGuardrails(),[f,y]=l(YN.GroupByService),[S,x]=l([]),[w,k]=l(null),[I,$]=l(null),[N,A]=l(!1),[O,D]=l(!1),[z,R]=l(null),[P,X]=l(null),[L,_]=l(null),M=d((e,t)=>{x(i=>t?i.includes(e)?i:[...i,e]:i.filter(t=>t!==e))},[]),B=a(()=>({selectedIds:S,toggleSelection:M}),[S,M]),V=a(()=>({onPromote:k,canPromote:!!r.promoteTransactionBaselines}),[r.promoteTransactionBaselines]),U=a(()=>({onDelete:$,canDelete:!!r.deleteTransaction}),[r.deleteTransaction]),G=a(()=>{const e=new Set;return b?.forEach(t=>{t.rules.some(e=>"allowed_transactions"===e.key&&e.mode===Ue.Enforce)&&e.add(t.scopeKey)}),e},[b]),j=a(()=>s?h?.filter(e=>{const t=s.toLowerCase();return e.id?.toLowerCase().includes(t)||e.namespace?.toLowerCase().includes(t)||e.service?.toLowerCase().includes(t)||e.kind?.toLowerCase().includes(t)||e.operationName?.toLowerCase().includes(t)||e.identityDimensions?.some(e=>e.key.toLowerCase().includes(t)||e.value.toLowerCase().includes(t))}):h,[h,s]),Y=a(()=>MN(h),[h]),J=a(()=>{if(!S.length||!h?.length)return[];const e=new Set(S);return h.filter(t=>e.has(t.id)&&!t.promoted).map(e=>e.id)},[h,S]),q=a(()=>{if(f===YN.GroupByService){const e=[];return j?.forEach(t=>{const i=e.find(e=>e.service===t.service);i?(i.transactions.push(t),i.volume+=t.volume):e.push({namespace:t.namespace,service:t.service,volume:t.volume,transactions:[t]})}),((e,i,n,a,o,l,r,s)=>a.map(a=>{const c=a.transactions.length,d=a.transactions.filter(e=>e.promoted).length,p=d===c,u=`${a.namespace}/${a.service}`,h=o?.has(u)??!1;return{id:u,cells:[{key:PN.Namespace,rawValue:a.namespace},{key:PN.Service,rawValue:a.service,component:()=>t(lN,{service:a.service,namespace:a.namespace})},{key:PN.Baseline,rawValue:p?"Promoted":"Learning",component:()=>t(E,p?{label:`${d}/${c} Promoted`,rightIcon:Fu,status:ie.Success,textSize:C.XXXS,tooltip:EN}:{label:`${d}/${c} Learning`,backgroundColor:e.v2.colors.beige[600],textColor:e.v2.colors.black[500],textSize:C.XXXS,tooltip:DN})},{key:PN.Guardrail,rawValue:h?"Enabled":"Disabled",component:()=>t(E,h?{label:"Enabled",leftIcon:Fu,status:ie.Success,invertColors:!0,textSize:C.XXXS}:{label:"Disabled",leftIcon:Mu,status:ie.Disabled,invertColors:!0,textSize:C.XXXS})},{key:PN.TransactionCount,rawValue:a.transactions.length.toLocaleString()},{key:PN.Volume,rawValue:a.volume.toLocaleString()}],expandedContent:({maxHeight:o})=>t(Xa,{fitContent:!0,variant:La.DataSecondary,maxHeight:o,columns:LN,rows:FN(e,i,a.transactions,void 0,l),getRowActions:e=>XN(e,n,r,s),withCheckboxes:!!l})}}))(i,o,n,e,G,B,V,U)}return FN(i,o,j,void 0,B)},[i,j,f,o,n,G,B,V,U]);return e(aN,{richTitle:{title:"Transactions",titleSize:C.M,icon:_u,badge:{label:h?.length||0}},textCards:[{bgTint:"900",title:"Transactions",cells:[{value:Y.total.toLocaleString()}]},{bgTint:"900",title:"Services",cells:[{value:Y.services.toLocaleString()}]},{bgTint:"900",title:"Volume",cells:[{value:Y.volume.toLocaleString()}]},{bgTint:"900",title:"Baseline Promoted",cells:[{value:((Y.promoted||0)/(Y.total||1)*100).toFixed(1)+"%"}]}],tableKey:f,tableColumns:f===YN.GroupByService?_N:LN,tableRows:q,tableWithCheckboxes:f===YN.All,tableNoDataProps:{icon:_u,title:s?"No matched transactions":"No transactions found",subTitle:s?`No transactions matched your search criteria: ${s}`:""},isLoading:g,actions:[{id:"search-by-time",type:St.PopupButton,buttonProps:yc(p),popupProps:{children:({close:e})=>t(vc,{defaultValue:p,onApply:u,onClose:e})}},{id:"refresh",type:St.Button,buttonProps:{label:"Refresh",leftIcon:th,variant:K.Secondary,size:W.S,disabled:g,onClick:()=>m()}}],getRowActions:e=>{if(f===YN.All)return XN(e,n,V,U);const t=e.cells.find(e=>e.key===PN.Namespace)?.rawValue,i=e.cells.find(e=>e.key===PN.Service)?.rawValue,a="Promoted"===e.cells.find(e=>e.key===PN.Baseline)?.rawValue,o=G.has(((e,t)=>`${e}/${t}`)(t,i)),l={namespace:t,service:i},s=[];return o?s.push({id:`${e.id}-disable-txn-guardrail`,label:"Disable transaction guardrail",leftIcon:Dh,variant:K.Secondary,disabled:!r.disableTransactionGuardrail,onClick:()=>_(l)}):s.push({id:`${e.id}-enable-txn-guardrail`,label:"Enable transaction guardrail",leftIcon:Dh,variant:K.Primary,disabled:!r.enableTransactionGuardrail,onClick:()=>X(l)}),s.push({id:`${e.id}-promote-service`,label:"Promote service",leftIcon:zu,variant:K.Primary,disabled:a||!r.forcePromoteService,onClick:()=>R(l)}),s},children:[e(T,{$width:"100%",$gap:24,$justifyContent:"space-between",children:[e(T,{$gap:12,children:[t(lc,{title:"Transactions list",titleSize:C.S,badge:{label:j?.length||0}}),t(sa,{width:"400px",value:s,onChange:c}),t(F,{options:JN,selected:f,setSelected:y,size:Zt.L})]}),e(T,{$gap:12,children:[t(H,{label:"Delete selection",leftIcon:ku,variant:K.Secondary,disabled:!S.length||!r.bulkDeleteTransactions,onClick:()=>D(!0)}),t(H,{label:"Promote selection",leftIcon:zu,variant:K.Primary,disabled:!J.length||!r.bulkPromoteTransactions,onClick:()=>A(!0)})]})]}),t(Ce,{isOpen:null!==w,onClose:()=>k(null),title:"Promote transaction",description:"Promote every scored baseline class on this transaction? Learning gates will be skipped and baselines will freeze.",approveButton:{label:"Promote now",onClick:()=>(async()=>{if(!w)return;const e=w;k(null),await(r.promoteTransactionBaselines?.(e))})()},denyButton:{label:"Cancel",onClick:()=>k(null),variant:K.Secondary}}),t(Ce,{isOpen:null!==I,onClose:()=>$(null),title:"Delete transaction",description:"Permanently delete this transaction and its related baselines, samples, issues, and transaction-scoped policies?",approveButton:{label:"Delete",onClick:()=>(async()=>{if(!I)return;const e=I;$(null),x(t=>t.filter(t=>t!==e)),await(r.deleteTransaction?.(e))})()},denyButton:{label:"Cancel",onClick:()=>$(null),variant:K.Secondary}}),t(Ce,{isOpen:N,onClose:()=>A(!1),title:`Promote selected transactions (${J.length})`,description:"Promote every scored baseline class on each selected transaction that is not already promoted? Learning gates will be skipped and baselines will freeze.",approveButton:{label:"Promote selection",onClick:()=>(async()=>{A(!1);const e=J;x([]),e.length&&await(r.bulkPromoteTransactions?.(e))})()},denyButton:{label:"Cancel",onClick:()=>A(!1),variant:K.Secondary}}),t(Ce,{isOpen:O,onClose:()=>D(!1),title:`Delete selected transactions (${S.length})`,description:"Permanently delete each selected transaction and its related baselines, samples, issues, and transaction-scoped policies?",approveButton:{label:"Delete selection",onClick:()=>(async()=>{D(!1);const e=S;x([]),await(r.bulkDeleteTransactions?.(e))})()},denyButton:{label:"Cancel",onClick:()=>D(!1),variant:K.Secondary}}),t(Ce,{isOpen:null!==z,onClose:()=>R(null),title:"Force promote service",description:`Promote every scored baseline class on every transaction of ${z?.service??"this service"}? This skips learning gates and may auto-enable the transaction guardrail.`,approveButton:{label:"Force promote",onClick:()=>(async()=>{if(!z)return;const e=z;R(null),await(r.forcePromoteService?.(e))})()},denyButton:{label:"Cancel",onClick:()=>R(null),variant:K.Secondary}}),t(Ce,{isOpen:null!==P,onClose:()=>X(null),title:"Enable transaction guardrail",description:`Create an allowed_transactions guardrail for ${P?.service??"this service"} from its current operations? New operations will become findings.`,approveButton:{label:"Enable",onClick:()=>(async()=>{if(!P)return;const e=P;X(null),await(r.enableTransactionGuardrail?.(e))})()},denyButton:{label:"Cancel",onClick:()=>X(null),variant:K.Secondary}}),t(Ce,{isOpen:null!==L,onClose:()=>_(null),title:"Disable transaction guardrail",description:`Disable the allowed_transactions guardrail for ${L?.service??"this service"}? New operations will no longer create findings until the guardrail is enabled again.`,approveButton:{label:"Disable",onClick:()=>(async()=>{if(!L)return;const e=L;_(null),await(r.disableTransactionGuardrail?.(e))})()},denyButton:{label:"Cancel",onClick:()=>_(null),variant:K.Secondary}})]})},ZN=(e,t,i)=>({title:e,titleSize:C.S,subTitle:t,subTitleWrap:!0,subTitleSize:C.XXXS,textGap:4,icon:i}),QN=f.div`
|
|
2011
2011
|
display: flex;
|
|
2012
2012
|
flex-direction: column;
|
|
2013
2013
|
gap: 8px;
|
|
@@ -2015,14 +2015,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2015
2015
|
border-radius: 12px;
|
|
2016
2016
|
border-left: 2px solid ${({theme:e})=>e.v2.colors.red[500]};
|
|
2017
2017
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
2018
|
-
`,
|
|
2018
|
+
`,eA=({classFindings:i})=>{const n=v();return i?.length?t(r,{children:i?.map((i,a)=>e(QN,{children:[e(T,{$gap:8,children:[t(w,{size:C.XS,color:k.Primary,children:i.title}),t(E,{label:i.class,status:ie.Info,invertColors:!0}),t(E,{label:i.kind,status:ie.Info,invertColors:!0})]}),t(w,{size:C.XXS,color:n.v2.colors.red[400],children:i.summary||"-"}),i.spanHighlights?t($,{children:i.spanHighlights?.map((t,i)=>e(w,{size:C.XXXS,color:k.Secondary,children:["• ",t.reason," - ",t.spanId]},`span-highlight--${i}`))}):null,i.attrHighlights?t($,{children:i.attrHighlights?.map((t,i)=>e(w,{size:C.XXXS,color:k.Secondary,children:["• ",t.value," - ",t.key," - ",t.spanId]},`attribute-highlight--${i}`))}):null]},`${i.class}-${a}`))}):null},tA=["thread.id","messaging.kafka.message.key","messaging.kafka.offset","arg.*","return.value","url.full","url.path"],iA=e=>!!e&&tA.some(t=>((e,t)=>{if(!t.includes("*"))return e===t;const i=e.split("."),n=t.split(".");return i.length===n.length&&n.every((e,t)=>"*"===e||e===i[t])})(e,t)),nA=e=>`${e.service??""}::${e.name??""}::${e.scope??""}`,aA=e=>null==e||Number.isNaN(e)?null:Sc(1e6*Math.max(0,e)),oA=e=>(e.attrs??[]).filter(e=>!!e?.key).map(e=>({key:e.key??null,value:e.value??null})),lA=(e,t,i,n)=>({id:t,index:i,service:e.service??null,name:e.name??null,durationLabel:aA(e.durationMs),depth:e.depth??0,scope:e.scope??null,attributes:oA(e),variant:"default",...n}),rA=f(T)`
|
|
2019
2019
|
width: 100%;
|
|
2020
2020
|
min-width: 0;
|
|
2021
2021
|
align-items: flex-start;
|
|
2022
2022
|
`,sA=f.div`
|
|
2023
2023
|
flex: 1;
|
|
2024
2024
|
min-width: 0;
|
|
2025
|
-
`,cA=e=>{let t=0;return(e.scope||e.scopePlaceholder)&&(t+=1),t+=e.attributes?.filter(e=>!!e?.key||!!e?.placeholder).length??0,t},dA=(e,t)=>
|
|
2025
|
+
`,cA=e=>{let t=0;return(e.scope||e.scopePlaceholder)&&(t+=1),t+=e.attributes?.filter(e=>!!e?.key||!!e?.placeholder).length??0,t},dA=(e,t,i)=>{const n="removed"===i?.variant;return{id:e,variant:n?"removed":"placeholder",depth:t,badges:[{icon:n?ph:Tu}]}},pA=e=>"placeholder"===e?.variant||"removed"===e?.variant,uA=({baselineTrace:i,anomalyTrace:n})=>{const o=a(()=>((e,t)=>{const i=e?.spans??[],n=t?.spans??[],a=e?.error||t?.error||null;if(!i.length&&!n.length)return{baselineRows:[],observedRows:[],newSpanCount:0,timingChangeCount:0,fieldChangeCount:0,observedDurationLabel:null,error:a};const o=((e,t)=>{const i=e.length,n=t.length,a=Array.from({length:i+1},()=>Array(n+1).fill(0));for(let o=i-1;o>=0;o--)for(let i=n-1;i>=0;i--)nA(e[o])===nA(t[i])?a[o][i]=1+(a[o+1][i+1]??0):a[o][i]=Math.max(a[o+1][i]??0,a[o][i+1]??0);const o=[];let l=0,r=0;for(;l<i&&r<n;)nA(e[l])===nA(t[r])?(o.push({baselineIdx:l,observedIdx:r}),l+=1,r+=1):(a[l+1][r]??0)>=(a[l][r+1]??0)?(o.push({baselineIdx:l,observedIdx:null}),l+=1):(o.push({baselineIdx:null,observedIdx:r}),r+=1);for(;l<i;)o.push({baselineIdx:l,observedIdx:null}),l+=1;for(;r<n;)o.push({baselineIdx:null,observedIdx:r}),r+=1;return o})(i,n),l=[],r=[];let s=0,c=0,d=0,p=0,u=0,h=0;const g=(e,t)=>{const i=((e,t)=>{const i=e.filter(e=>!!e.key),n=t.filter(e=>!!e.key),a=i.length,o=n.length,l=Array.from({length:a+1},()=>Array(o+1).fill(0));for(let e=a-1;e>=0;e--)for(let t=o-1;t>=0;t--)i[e].key===n[t].key?l[e][t]=1+(l[e+1][t+1]??0):l[e][t]=Math.max(l[e+1][t]??0,l[e][t+1]??0);const r={baseline:[],observed:[],changeCount:0},s=(e,t)=>{const i=!iA(e.key)&&(e.value??"")!==(t.value??"");i&&(r.changeCount+=1),r.baseline.push(i?{...e,diff:"changed"}:e),r.observed.push(i?{...t,diff:"changed"}:t)},c=e=>{if(iA(e.key))return r.baseline.push(e),void r.observed.push({placeholder:!0});r.changeCount+=1,r.baseline.push({...e,diff:"removed"}),r.observed.push({placeholder:!0,diff:"removed"})},d=e=>{if(iA(e.key))return r.baseline.push({placeholder:!0}),void r.observed.push(e);r.changeCount+=1,r.baseline.push({placeholder:!0,diff:"added"}),r.observed.push({...e,diff:"added"})};let p=0,u=0;for(;p<a&&u<o;)i[p].key===n[u].key?(s(i[p],n[u]),p+=1,u+=1):(l[p+1][u]??0)>=(l[p][u+1]??0)?(c(i[p]),p+=1):(d(n[u]),u+=1);for(;p<a;)c(i[p]),p+=1;for(;u<o;)d(n[u]),u+=1;return r})(e.attributes??[],t.attributes??[]);var n;u+=i.changeCount,l.push({...e,attributes:i.baseline}),r.push({...t,attributes:i.observed,badges:i.changeCount?[...t.badges??[],(n=i.changeCount,{label:`${n} field change${1===n?"":"s"}`,tone:"info",icon:zh})]:t.badges})};for(const e of o){const t=null!=e.baselineIdx?i[e.baselineIdx]:void 0,a=null!=e.observedIdx?n[e.observedIdx]:void 0;if(t&&a){const i=`pair-${e.baselineIdx}-${e.observedIdx}`;s+=1,c+=1;const n=t.durationMs??0,o=a.durationMs??0;if(n>0&&o/n>=2){p+=1;const e=Math.max(1,Math.round(o/n));g(lA(t,i,s,{variant:"timing"}),lA(a,i,c,{variant:"timing",badges:[{label:`${e}x Slower`,tone:"warning",icon:Ih}]}))}else g(lA(t,i,s),lA(a,i,c));continue}if(a&&!t){d+=1,c+=1,h+=1;const t=`new-${e.observedIdx}`;l.push({id:`placeholder-${h}`,variant:"placeholder",depth:a.depth??0,badges:[{icon:Tu}]}),r.push(lA(a,t,c,{variant:"new",badges:[{label:"New",tone:"danger",icon:Tu}]}));continue}if(t&&!a){s+=1,h+=1;const i=`baseline-only-${e.baselineIdx}`;l.push(lA(t,i,s)),r.push({id:`removed-${h}`,variant:"removed",depth:t.depth??0,badges:[{icon:ph}]})}}const m=n.find(e=>0===(e.depth??0))??n[0],b=aA(m?.durationMs??null);return{baselineRows:l,observedRows:r,newSpanCount:d,timingChangeCount:p,fieldChangeCount:u,observedDurationLabel:b,error:a}})(i,n),[i,n]),[r,s]=l([]),c=a(()=>new Set(r),[r]),p=a(()=>((e,t,i)=>{const n=[],a=[],o=Math.max(e.length,t.length);for(let l=0;l<o;l++){const o=e[l],r=t[l];o&&n.push(o),r&&a.push(r);const s=!!o&&!pA(o)&&i.has(o.id),c=!!r&&!pA(r)&&i.has(r.id),d=s?cA(o):0,p=c?cA(r):0,u=Math.max(d,p),h=r?.depth??o?.depth??0;for(let e=0;e<u-d;e++)n.push(dA(`expand-filler-baseline-${r?.id??o?.id}-${l}-${e}`,h,o));for(let e=0;e<u-p;e++)a.push(dA(`expand-filler-observed-${o?.id??r?.id}-${l}-${e}`,h,r))}return{baseline:n,observed:a}})(o.baselineRows,o.observedRows,c),[o.baselineRows,o.observedRows,c]),u=d(e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),h=a(()=>[],[]),g=a(()=>{const e=[];return o.observedDurationLabel&&e.push({label:o.observedDurationLabel}),o.newSpanCount>0&&e.push({label:`${o.newSpanCount} new span${1===o.newSpanCount?"":"s"}`}),o.timingChangeCount>0&&e.push({label:`${o.timingChangeCount} timing change${1===o.timingChangeCount?"":"s"}`}),o.fieldChangeCount>0&&e.push({label:`${o.fieldChangeCount} field change${1===o.fieldChangeCount?"":"s"}`}),e},[o.fieldChangeCount,o.newSpanCount,o.observedDurationLabel,o.timingChangeCount]);return e(rA,{children:[t(sA,{children:o.baselineRows.length?t(xc,{traceId:i?.traceId,title:"Baseline trace",titleIcon:zu,headerBadge:{label:"Baseline",tone:"success"},meta:h,rows:p.baseline,expandedRowIds:r,onToggleRow:u,corner:"left"}):t(oi,{children:t(Z,{title:"No trace available",subTitle:o.error?`Unable to compare traces: ${o.error}`:"No baseline spans available"})})}),t(sA,{children:o.observedRows.length?t(xc,{traceId:n?.traceId,title:"Observed trace",titleIcon:Ih,headerBadge:{label:"Flagged",tone:"danger"},meta:g,rows:p.observed,expandedRowIds:r,onToggleRow:u,corner:"right"}):t(oi,{children:t(Z,{title:"No trace available",subTitle:o.error?`Unable to compare traces: ${o.error}`:"No observed spans available"})})})]})},hA=e=>e.split("_").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),gA=(e,t)=>{const i=t?.deviationClasses.find(t=>t.id===e.source);if(i)return{name:i.label||e.source,isEnricher:!1};const n=t?.enrichers.find(t=>t.source===e.source);return n?{name:n.label||e.source,isEnricher:!0}:{name:e.source,isEnricher:!1}},mA=(e,t,i=[])=>{const n=t?.categories.find(t=>t.id===e);if(n)return{label:n.label||hA(e),mitre:n.mitre,owasp:n.owasp};const a=t?.deviationClasses.find(t=>t.category===e);if(a)return{label:a.categoryLabel||hA(e),mitre:a.mitre??i.find(e=>e.mitre)?.mitre,owasp:a.owasp??i.find(e=>e.owasp)?.owasp};const o=i[0];return{label:hA(e),mitre:o?.mitre,owasp:o?.owasp}};var bA;(e=>{e.Signal="signal",e.Category="category",e.Weight="weight",e.Confidence="confidence",e.Contribution="contribution"})(bA||(bA={}));const fA=[{key:bA.Signal,label:"Signal",flex:2.2},{key:bA.Category,label:"Category (MITRE/OWASP)",flex:1.4},{key:bA.Weight,label:"Weight",flex:.7},{key:bA.Confidence,label:"Confidence",flex:.8},{key:bA.Contribution,label:"Contribution",flex:.9}],vA=f.div`
|
|
2026
2026
|
display: flex;
|
|
2027
2027
|
flex-direction: column;
|
|
2028
2028
|
width: 100%;
|
|
@@ -2084,14 +2084,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2084
2084
|
height: 100%;
|
|
2085
2085
|
width: ${({$widthPct:e})=>`${Math.max(0,Math.min(100,e))}%`};
|
|
2086
2086
|
background-color: ${({$color:e})=>e};
|
|
2087
|
-
`,$A=(e,t)=>e>=50?t.v2.colors.red[500]:e>=35?t.v2.colors.orange[500]:t.v2.colors.blue[500],NA=({risk:i,catalog:n})=>{const o=v(),l=n?.deviationClasses?.length?n:
|
|
2087
|
+
`,$A=(e,t)=>e>=50?t.v2.colors.red[500]:e>=35?t.v2.colors.orange[500]:t.v2.colors.blue[500],NA=({risk:i,catalog:n})=>{const o=v(),l=n?.deviationClasses?.length?n:jv,r=a(()=>i?((e,t)=>{const i=new Map,n=[];(e.categories?.filter(Boolean)??[]).forEach(e=>{i.has(e)||(i.set(e,[]),n.push(e))}),e.signals.forEach(e=>{const t=e.category||"unknown";i.has(t)||(i.set(t,[]),n.push(t)),i.get(t).push(e)});const a=[];for(const e of n){const n=i.get(e)??[];if(!n.length)continue;const o=mA(e,t,n);a.push({categoryId:e,label:o.label,mitre:o.mitre,owasp:o.owasp,signals:n.map(e=>{const{name:i,isEnricher:n}=gA(e,t);return{source:e.source,name:i,rationale:e.rationale,category:e.category,weight:e.weight,confidence:e.confidence,contribution:e.contribution,isEnricher:n}})})}return a})(i,l):[],[i,l]);return i&&r.length?e(vA,{children:[t(yA,{children:fA.map(e=>t(SA,{children:t(w,{size:C.XS,color:k.Primary,children:e.label})},e.key))}),r.map(i=>e($,{$gap:0,$width:"100%",children:[e(xA,{children:[e(w,{size:C.XS,color:k.Primary,children:[i.label,i.mitre?` ${i.mitre}`:""]}),i.owasp?t(E,{label:i.owasp,backgroundColor:o.v2.colors.grey[500],textColor:o.v2.colors.white[500],textSize:C.XXXS}):null]}),i.signals.map(n=>{return e(yA,{children:[e(wA,{children:[e(T,{$gap:4,$alignItems:"center",children:[t(w,{size:C.XS,color:k.Primary,children:n.name}),n.isEnricher?t(Xi,{label:"Enricher",variant:_i.Purple}):null,t(E,{label:n.source,backgroundColor:o.v2.colors.grey[500],textColor:o.v2.colors.white[500],textSize:C.XXXS})]}),n.rationale?t(w,{size:C.XXS,color:k.Secondary,children:n.rationale}):null]}),t(wA,{children:t(w,{size:C.XS,color:k.Primary,children:n.category})}),t(wA,{children:t(w,{size:C.XXS,color:k.Primary,children:n.weight})}),t(wA,{children:t(w,{size:C.XXS,color:k.Primary,children:(a=n.confidence,Number.isInteger(a)?a.toFixed(1):String(Number(a.toFixed(2))))})}),t(wA,{children:t(w,{size:C.XXS,color:k.Primary,children:n.contribution})})]},`${i.categoryId}-${n.source}`);var a})]},i.categoryId)),i.correlated&&i.correlationBonus>0?e(yA,{children:[t(wA,{children:e(T,{$gap:4,$alignItems:"center",children:[t(w,{size:C.XS,color:k.Primary,children:"Correlation bonus"}),t(E,{label:"multi-category",backgroundColor:o.v2.colors.grey[500],textColor:o.v2.colors.white[500],textSize:C.XXXS})]})}),t(wA,{}),t(wA,{}),t(wA,{}),t(wA,{children:e(w,{size:C.XXS,color:k.Primary,children:["+",i.correlationBonus]})})]}):null,e(CA,{children:[e(kA,{children:[e(w,{size:C.S,color:k.Primary,children:["Total risk score ",i.score]}),t(TA,{children:t(IA,{$widthPct:i.score,$color:$A(i.score,o)})})]}),e(w,{size:C.XXS,color:k.Secondary,children:["fires at ≥ ",i.fireAtScore," (policy threshold)"]})]})]}):t(w,{size:C.XXS,color:k.Secondary,children:"No risk signals for this anomaly."})},AA=(e,t,i,n)=>t?[{id:"severity",title:"Severity",badge:yN(e,t.severity)},{id:"status",title:"Status",badge:SN(e,t.status)},{id:"operation",title:"Operation",tag:{label:t.operationName||"-"}},...t.identityDimensions.map((e,t)=>({id:`identity-dim-${t}`,title:e.key,badge:{label:Rg(e.key,e.value),tooltip:e.key}})),{id:"transaction-id",title:"Transaction ID",label:t.transactionId,withCopy:!0,button:{tooltip:"Open this transaction's details",hideTooltipIcon:!0,leftIcon:xh,onClick:()=>n(t.transactionId)}},{id:"signature",title:"Signature",label:t.signature,withCopy:!0},{id:"matched-traces",title:"Matched traces",label:t.occurrences.toString()},{id:"last-seen",title:"Last seen",label:t.lastSeen?i(t.lastSeen,{style:"short"}):"-"}]:[],OA=[{id:"alert-only",title:"Alert only",description:"Notify when this behavior appears again. No runtime action is taken. Safe."},{id:"kill-thread",title:"Kill thread",description:"Stop the matching execution thread when this behavior appears again."},{id:"kill-process",title:"Kill process",description:"Terminate the affected process on the next match. This may interrupt service availability."}],EA=({finding:i,onClose:n})=>{const o=v(),{formatDurationAgo:l}=qn(),{insightsApi:s}=Jh(),{openDrawer:c}=eN(),d=i.transactionId||"",p=i.signature||"",u=!!d&&!!p,{data:h,loading:g}=s.useAnomaly({transactionId:d,signature:p},{skip:!u}),{data:m}=s.useCatalog(),b=a(()=>wc(h?.anomalyTrace?.traceId,h?.anomalyTrace?.rawOtlp),[h?.anomalyTrace?.traceId,h?.anomalyTrace?.rawOtlp]),f=a(()=>wc(h?.baselineTrace?.traceId,h?.baselineTrace?.rawOtlp),[h?.baselineTrace?.traceId,h?.baselineTrace?.rawOtlp]),{data:y,loading:S}=s.useBlastRadius({namespace:i.namespace,service:i.service},{skip:!i.namespace||!i.service}),{formData:x,handleFormChange:w}=Gn({responseOnNextMatch:""});return e(Mn,{bgTint:"1000",moreSpacing:!0,children:[t(Mn,{bgTint:"900",moreSpacing:!0,richTitle:{icon:Eh,title:i?.title},renderOnRightSide:e(r,{children:[t(UN,{actionType:pN.Dismiss,selectedFindings:[i],onDone:n,buttonProps:{size:W.S}}),t(UN,{actionType:pN.Accept,selectedFindings:[i],onDone:n,buttonProps:{label:"Accept (Add to baseline)",variant:K.Primary,size:W.S}})]}),items:AA(o,h||null,l,e=>c(J$.Transaction,e))}),t(Mn,{bgTint:"900",richTitle:{title:"Why this fired",icon:oh},withCollapse:!0,children:t(eA,{classFindings:h?.classFindings})}),t(Mn,{bgTint:"900",richTitle:{title:"Risk breakdown",titleSize:C.S,tooltip:"How this anomaly score was computed from weighted signals, confidence, and optional multi-category correlation."},withCollapse:!0,children:g&&!h?t(oi,{children:t(Ve,{withSpinner:!0})}):t(NA,{risk:h?.risk,catalog:m})}),t(Mn,{bgTint:"900",richTitle:ZN("Baseline vs observed trace","Compare the learned normal trace with the observed trace that triggered this anomaly."),withCollapse:!0,collapseIsDefaultOpen:!0,children:g&&!h?t(oi,{children:t(Ve,{withSpinner:!0})}):t(uA,{baselineTrace:f,anomalyTrace:b})}),t(Mn,{bgTint:"900",richTitle:ZN("Blast Radius","Services and resources touched by traces matching this anomaly."),withCollapse:!0,collapseIsDefaultOpen:!0,children:S&&!y?t(oi,{children:t(Ve,{withSpinner:!0})}):t(vm,{blastRadius:y})}),t(Mn,{bgTint:"900",richTitle:{...ZN("Response on next match","This action will be applied only when a future trace matches this anomaly pattern again."),badge:{label:kc,tooltip:Cc,backgroundColor:o.v2.colors.pink[500],textColor:o.v2.colors.black[500]}},actions:[{id:"apply",type:St.Button,buttonProps:{label:"Apply on next match",rightIcon:Iu,variant:K.Primary,size:W.S,disabled:!0,onClick:()=>{}}}],withCollapse:!0,children:t(T,{$gap:16,children:t(DA,{options:OA,selectedId:x.responseOnNextMatch,setSelectedId:e=>w("responseOnNextMatch",e)})})})]})},DA=({options:i,selectedId:n,setSelectedId:a})=>i.map(i=>{const o=n===i.id,l=()=>a(i.id);return t(Mn,{bgTint:"800",moreSpacing:!0,onClick:l,clickStylesRemainActive:o,children:e(T,{$gap:16,children:[t(U,{value:o,onChange:l}),e($,{$gap:4,children:[t(w,{size:C.S,color:k.Primary,children:i.title}),t(w,{size:C.XXS,color:k.Secondary,children:i.description})]})]})},i.id)}),zA=f(T)`
|
|
2088
2088
|
width: 100%;
|
|
2089
2089
|
min-width: 0;
|
|
2090
2090
|
align-items: flex-start;
|
|
2091
2091
|
`,RA=f.div`
|
|
2092
2092
|
flex: 1;
|
|
2093
2093
|
min-width: 0;
|
|
2094
|
-
`,PA=e=>(e.attrs??[]).filter(e=>!!e?.key).map(e=>({key:e.key??null,value:e.value??null})),XA=({evidenceTrace:e,spanHighlights:i})=>{const n=a(()=>((e,t)=>{const i=e?.spans??[],n=new Map((t??[]).map(e=>[e.spanId,e]));return i.map((e,t)=>{const i=e.spanId?n.get(e.spanId):void 0;return{id:e.spanId||`span-${t}`,index:t+1,service:e.service??null,name:e.name??null,durationLabel:(a=e.durationMs,null==a||Number.isNaN(a)?null:
|
|
2094
|
+
`,PA=e=>(e.attrs??[]).filter(e=>!!e?.key).map(e=>({key:e.key??null,value:e.value??null})),XA=({evidenceTrace:e,spanHighlights:i})=>{const n=a(()=>((e,t)=>{const i=e?.spans??[],n=new Map((t??[]).map(e=>[e.spanId,e]));return i.map((e,t)=>{const i=e.spanId?n.get(e.spanId):void 0;return{id:e.spanId||`span-${t}`,index:t+1,service:e.service??null,name:e.name??null,durationLabel:(a=e.durationMs,null==a||Number.isNaN(a)?null:Sc(1e6*Math.max(0,a))),depth:e.depth??0,scope:e.scope??null,attributes:PA(e),variant:i?"new":"default",badge:i?{icon:Ih,tone:"danger",label:i.reason}:null};var a})})(e,i),[e,i]),[o,r]=l([]);return e&&e.spans?.length?t(zA,{children:t(RA,{children:e&&e.spans?.length?t(xc,{traceId:e.traceId,title:"Evidence trace",rows:n,expandedRowIds:o,onToggleRow:e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}}):t(oi,{children:t(Z,{title:"No evidence retained",subTitle:e?.error?`Unable to parse traces: ${e.error}`:"No sample trace was captured for this violation."})})})}):t(oi,{children:t(Z,{title:"No evidence retained",subTitle:e?.error?`Unable to parse traces: ${e.error}`:"No sample trace was captured for this violation."})})},LA=(e,t,i,n)=>[{id:"severity",title:"Severity",badge:yN(e,t.severity)},{id:"status",title:"Status",badge:SN(e,t.status)},{id:"rule-key",title:"Rule key",tag:{label:t.ruleKey||"-"}},{id:"offending",title:"Offending",label:t.offending||"-",withCopy:!0},{id:"transaction-id",title:"Transaction ID",label:t.transactionId||"-",withCopy:!!t.transactionId,button:t.transactionId?{tooltip:"Open this transaction's details",hideTooltipIcon:!0,leftIcon:xh,onClick:()=>n(t.transactionId)}:void 0},{id:"matched-traces",title:"Matched traces",label:t.occurrences.toString()},{id:"last-seen",title:"Last seen",label:t.lastSeen?i(t.lastSeen,{style:"short"}):"-"}],_A=({finding:i,onClose:n})=>{const o=v(),{formatDurationAgo:l}=qn(),{insightsApi:s}=Jh(),{openDrawer:c}=eN(),d=i.scopeKey||"",p=i.ruleKey||"",u=i.offending||"",h=!!d&&!!p&&!!u,{data:g,loading:m}=s.useGuardrailViolation({scopeKey:d,ruleKey:p,offending:u},{skip:!h}),b=a(()=>wc(g?.evidenceTrace?.traceId,g?.evidenceTrace?.rawOtlp),[g?.evidenceTrace?.traceId,g?.evidenceTrace?.rawOtlp]),{data:f,loading:y}=s.useBlastRadius({namespace:i.namespace,service:i.service},{skip:!i.namespace||!i.service});return e(Mn,{bgTint:"1000",moreSpacing:!0,children:[t(Mn,{bgTint:"900",moreSpacing:!0,richTitle:{icon:Eh,title:i?.title},renderOnRightSide:e(r,{children:[t(UN,{actionType:pN.Dismiss,selectedFindings:[i],onDone:n,buttonProps:{size:W.S}}),t(UN,{actionType:pN.Accept,selectedFindings:[i],onDone:n,buttonProps:{label:"Accept (Add to guardrails)",variant:K.Primary,size:W.S}})]}),items:LA(o,i,l,e=>c(J$.Transaction,e)),children:t(Mn,{bgTint:"800",items:[{id:"summary",title:"Summary",label:g?.summary||"-"}]})}),t(Mn,{bgTint:"900",richTitle:ZN("Evidence trace","The trace that triggered this violation."),withCollapse:!0,collapseIsDefaultOpen:!0,children:m&&!g?t(oi,{children:t(Ve,{withSpinner:!0})}):t(XA,{evidenceTrace:b,spanHighlights:g?.spanHighlights})}),t(Mn,{bgTint:"900",richTitle:ZN("Blast Radius","Services and resources touched by traces matching this violation."),withCollapse:!0,collapseIsDefaultOpen:!0,children:y&&!f?t(oi,{children:t(Ve,{withSpinner:!0})}):t(vm,{blastRadius:f})})]})},MA=({type:i})=>{const n=v(),{findingDrawer:o,closeFindingDrawer:l}=eN(),{insightsApi:s}=Jh(),{data:c,loading:d}=s.useFindings(void 0,{fetchPolicy:"cache-first"}),p=a(()=>{if(o.id)return((e,t)=>e?.find(e=>cN(e)===t))(c,o.id)},[c,o.id]);return t(ln,{width:o.type===J$.Anomaly?"90vw":"60vw",isOpen:!0,header:{onClose:l,icon:Hu,title:p?.service||"-",titleBadges:[{label:p?.namespace||"-",tooltip:"Namespace"},{label:p?.kind||"-",tooltip:"Finding kind",backgroundColor:n.v2.colors.blue[900]}],subTitleTags:[{label:`Captured ${p?.lastSeen?new Date(p.lastSeen).toLocaleString():"-"}`,disabled:!0}]},children:p?e(r,{children:[i===J$.Anomaly&&t(EA,{finding:p,onClose:l}),i===J$.Violation&&t(_A,{finding:p,onClose:l})]}):t(ln,{width:"95vw",isOpen:!0,header:{onClose:l},children:t(oi,{children:d?t(Ve,{withSpinner:!0}):t(Z,{title:"No finding found",subTitle:`No finding found for this ID ${o.id}`})})})})},FA=({histogram:e,classDescription:i})=>e.series.map(e=>t(Mn,{bgTint:"900",richTitle:ZN(e.label,i),withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Tc,{bars:e.bars.map(e=>({label:e.label,value:e.count}))})},e.name));var BA;(e=>{e.Namespace="namespace",e.Version="version"})(BA||(BA={}));const VA=[{key:BA.Namespace,label:"Namespace"},{key:BA.Version,label:"Version"}],UA=({libraries:e})=>{const i=a(()=>(e=>e.map((e,t)=>({id:`${e.ns}-${t}`,cells:[{key:BA.Namespace,rawValue:e.ns||"-"},{key:BA.Version,rawValue:e.ver||"-"}]})))(e),[e]);return t(Mn,{bgTint:"900",richTitle:ZN("Libraries","Learned libraries used in this transaction"),withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xa,{maxHeight:"420px",variant:La.Data,columns:VA,rows:i})})};var GA,jA,HA;(e=>{e.System="system",e.Namespace="namespace",e.TableAccess="tableAccess"})(GA||(GA={})),(e=>{e.Access="db-access"})(jA||(jA={})),(e=>{e.Animated="db-access-animated"})(HA||(HA={}));const WA=f.div`
|
|
2095
2095
|
min-width: ${({$isScope:e})=>e?"unset":"200px"};
|
|
2096
2096
|
padding: 12px;
|
|
2097
2097
|
border-radius: 8px;
|
|
@@ -2106,7 +2106,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2106
2106
|
padding: 4px;
|
|
2107
2107
|
border-radius: 4px;
|
|
2108
2108
|
background-color: ${({theme:e})=>e.v2.colors.blue[900]};
|
|
2109
|
-
`,YA={visibility:"hidden"},JA=b(({data:n})=>{const a=v(),{kind:o,system:l,ns:r,table:s,op:c}=n,d=o===GA.System||o===GA.Namespace,p=o===GA.System?l:o===GA.Namespace?r:s,u=a.v2.colors.blue[200];return e(i,{children:[t(
|
|
2109
|
+
`,YA={visibility:"hidden"},JA=b(({data:n})=>{const a=v(),{kind:o,system:l,ns:r,table:s,op:c}=n,d=o===GA.System||o===GA.Namespace,p=o===GA.System?l:o===GA.Namespace?r:s,u=a.v2.colors.blue[200];return e(i,{children:[t(Im,{type:"source",position:$m.Right,style:YA}),t(Im,{type:"target",position:$m.Left,style:YA}),t(WA,{$isScope:d,children:e(T,{$gap:24,$justifyContent:"space-between",children:[e($,{$gap:4,children:[d&&e($,{$gap:8,children:[t(KA,{children:o===GA.System?t(Rh,{size:16,fill:u}):o===GA.Namespace?t(Ph,{size:16,fill:u}):null}),t(w,{transform:"uppercase",fontFamily:"code",size:C.XXXS,color:k.Secondary,nowrap:!0,children:o})]}),t(w,{size:C.XXS,color:k.Primary,nowrap:!0,children:p})]}),!!c&&t(Xi,{label:c,variant:_i.Green})]})})]})});JA.displayName=JA.name;const qA=140,ZA=e=>`system:${e}`,QA=(e,t)=>`ns:${e}:${t}`,eO=(e,t,i,n)=>`table:${e}:${t}:${i}:${n}`,tO={[jA.Access]:JA},iO=({accesses:e})=>{const i=v(),[n,r]=l([]),[s,c]=l([]),[d,p]=l(0),u=a(()=>e.map(e=>`${e.system}|${e.ns}|${e.table}|${e.op}`).join("::"),[e]);return o(()=>{let t=!1;return(async()=>{const{nodes:n,edges:a,rootIds:o}=((e,t)=>{const i=new Map,n=new Set,a=[],o=[],l=t.v2.colors.silver[400],r=e=>{i.has(e.id)||i.set(e.id,e)},s=(e,t)=>{const i=`${e}->${t}`;n.has(i)||(n.add(i),a.push({id:i,type:"smoothstep",source:e,target:t,markerEnd:{type:Nm.ArrowClosed,color:l,width:16,height:16},style:{stroke:l,strokeWidth:1}}))};for(const t of e){const e=t.system?.trim();if(!e)continue;const i=ZA(e);r({id:i,type:jA.Access,position:{x:0,y:0},data:{kind:GA.System,system:e,ns:"",table:"",op:""},measured:{width:qA,height:58}}),o.includes(i)||o.push(i);const n=t.ns?.trim();if(!n)continue;const a=QA(e,n);r({id:a,type:jA.Access,position:{x:0,y:0},data:{kind:GA.Namespace,system:e,ns:n,table:"",op:""},measured:{width:qA,height:58}}),s(i,a);const l=t.table?.trim()??"",c=t.op?.trim()??"";if(!l&&!c)continue;const d=eO(e,n,l,c);r({id:d,type:jA.Access,position:{x:0,y:0},data:{kind:GA.TableAccess,system:e,ns:n,table:l,op:c},measured:{width:qA,height:58}}),s(a,d)}return{nodes:Array.from(i.values()),edges:a,rootIds:o}})(e,i);if(!n.length)return void(t||(r([]),c([])));const l=await Sm(n,a,{direction:"RIGHT",nodeWidth:qA,nodeHeight:58,rootIds:o,rootLayerConstraint:"FIRST",spacing:{betweenLayers:120,nodeNode:12,edgeEdge:24,edgeNode:32}});t||(r(l.nodes),c(l.edges),p(e=>e+1))})(),()=>{t=!0}},[u,e,i]),t(ym,{height:420,interactive:!1,nodeTypes:tO,nodes:n,edges:s,fitViewTrigger:d,minZoom:.4,maxZoom:1.5})},nO=({accesses:e})=>e.length?t(iO,{accesses:e}):t(oi,{children:t(Z,{subTitle:"No access footprint to visualize."})});var aO;(e=>{e.Table="table",e.Map="map"})(aO||(aO={}));const oO=[{label:"Table",value:aO.Table},{label:"Map",value:aO.Map}];var lO;(e=>{e.Type="type",e.Operation="operation",e.Table="table",e.Namespace="namespace"})(lO||(lO={}));const rO=[{key:lO.Type,label:"Type"},{key:lO.Operation,label:"Operation"},{key:lO.Table,label:"Table"},{key:lO.Namespace,label:"Namespace"}],sO=(i,n)=>i.map(i=>{const a=!i.table&&!i.op,o=a?"Namespace level":"Table access";return{id:i.system+i.ns+i.table+i.op,cells:[{key:lO.Type,rawValue:o,component:()=>e(T,{$gap:4,children:[t(Ic,{color:a?n.v2.colors.orange[500]:n.v2.colors.blue[500]}),t(w,{size:C.XXS,children:o})]})},{key:lO.Operation,rawValue:i.op||"-",component:()=>t(Xi,{label:i.op||"-",variant:i.op?_i.Green:void 0})},{key:lO.Table,rawValue:i.table||"-",component:()=>t(Xi,{label:i.table||"-"})},{key:lO.Namespace,rawValue:i.ns||"-",component:()=>t(Xi,{label:i.ns||"-"})}]}}),cO=({parsedJson:e})=>{const i=v(),[n,a]=l(aO.Map),o=d(()=>n===aO.Table?t(Xa,{maxHeight:"420px",variant:La.Data,columns:rO,rows:sO(e.accesses||[],i)}):t(nO,{accesses:e.accesses||[]}),[n,e,i]);return t(Mn,{bgTint:"900",richTitle:ZN("Observed access footprint",""),withCollapse:!0,collapseIsDefaultOpen:!0,renderOnRightSide:t(F,{options:oO,selected:n,setSelected:a,size:Zt.L}),children:o()})};var dO,pO;(e=>{e.Owner="owner",e.Peer="peer"})(dO||(dO={})),(e=>{e.Peer="outbound-peer"})(pO||(pO={}));const uO=f.div`
|
|
2110
2110
|
padding: 12px;
|
|
2111
2111
|
border-radius: 8px;
|
|
2112
2112
|
background-color: ${({theme:e,$isOwner:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
@@ -2120,12 +2120,12 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2120
2120
|
padding: 4px;
|
|
2121
2121
|
border-radius: 4px;
|
|
2122
2122
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
2123
|
-
`,gO={visibility:"hidden"},mO=b(({data:n})=>{const a=v(),{kind:o,label:l,port:r,external:s}=n,c=o===dO.Owner,d=!c&&!!s,p=
|
|
2123
|
+
`,gO={visibility:"hidden"},mO=b(({data:n})=>{const a=v(),{kind:o,label:l,port:r,external:s}=n,c=o===dO.Owner,d=!c&&!!s,p=oN(c?l:"");return e(i,{children:[t(Im,{type:"source",position:$m.Bottom,style:gO}),t(Im,{type:"target",position:$m.Top,style:gO}),t(uO,{$isOwner:c,children:e($,{$gap:8,children:[e(T,{$gap:8,children:[c?t(ga,{icons:p,size:20}):t(hO,{children:t(Xu,{size:14,fill:a.v2.colors.silver[200]})}),t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:l})]}),!c&&e(T,{$gap:8,children:[null!=r&&t(Xi,{label:String(r),variant:_i.Blue}),d&&t(Xi,{label:"External",variant:_i.Yellow})]})]})})]})});mO.displayName=mO.name;const bO=e=>`owner:${e}`,fO=(e,t)=>`peer:${e}:${t}`,vO={[pO.Peer]:mO},yO=({peers:e})=>{const i=v(),[n,r]=l([]),[s,c]=l([]),[d,p]=l(0),u=a(()=>e.map(e=>`${e.owner??""}|${e.host}:${e.port}|${e.external?1:0}`).join("::"),[e]);return o(()=>{let t=!1;return(async()=>{const{nodes:n,edges:a,rootIds:o}=((e,t)=>{const i=new Map,n=new Set,a=[],o=[],l=t.v2.colors.silver[400],r=e=>{const t=bO(e);return i.has(t)||(i.set(t,{id:t,type:pO.Peer,position:{x:0,y:0},data:{kind:dO.Owner,label:e},measured:{width:200,height:64}}),o.push(t)),t},s=(e,t,n)=>{const a=fO(e,t),o=i.get(a);return o?(n&&(o.data={...o.data,external:!0}),a):(i.set(a,{id:a,type:pO.Peer,position:{x:0,y:0},data:{kind:dO.Peer,label:e,port:t,external:!!n},measured:{width:200,height:64}}),a)},c=(e,t)=>{const i=`${e}->${t}`;n.has(i)||(n.add(i),a.push({id:i,type:"smoothstep",source:e,target:t,markerEnd:{type:Nm.ArrowClosed,color:l,width:16,height:16},style:{stroke:l,strokeWidth:1}}))};for(const t of e){const e=t.host?.trim()??"",i=t.port;if(!e||null==i||Number.isNaN(Number(i)))continue;const n=s(e,Number(i),t.external),a=t.owner?.trim()??"";a?c(r(a),n):o.includes(n)||o.push(n)}return{nodes:Array.from(i.values()),edges:a,rootIds:o}})(e,i);if(!n.length)return void(t||(r([]),c([])));const l=await Sm(n,a,{direction:"DOWN",nodeWidth:200,nodeHeight:64,rootIds:o,rootLayerConstraint:"FIRST_SEPARATE",rootAlignCenter:!1,spacing:{betweenLayers:80,nodeNode:32,edgeEdge:24,edgeNode:32},extraOptions:{"elk.separateConnectedComponents":"false"}});t||(r(l.nodes),c(l.edges),p(e=>e+1))})(),()=>{t=!0}},[u,e,i]),t(ym,{height:420,interactive:!1,nodeTypes:vO,nodes:n,edges:s,fitViewTrigger:d,minZoom:.2,maxZoom:1.5})},SO=({peers:e})=>(a(()=>{const t=new Set;for(const i of e)i.owner?.trim()&&t.add(bO(i.owner.trim())),i.host?.trim()&&null!=i.port&&t.add(fO(i.host.trim(),Number(i.port)));return t.size},[e]),e.length?t(yO,{peers:e}):t(oi,{children:t(Z,{subTitle:"No outbound peers to visualize."})}));var xO;(e=>{e.Table="table",e.Map="map"})(xO||(xO={}));const wO=[{label:"Table",value:xO.Table},{label:"Map",value:xO.Map}];var CO;(e=>{e.Owner="owner",e.Host="host",e.Port="port",e.External="external"})(CO||(CO={}));const kO=[{key:CO.Owner,label:"Owner"},{key:CO.Host,label:"Host"},{key:CO.Port,label:"Port"},{key:CO.External,label:"External"}],TO=({peers:e})=>{const[i,n]=l(xO.Map),o=a(()=>(e=>e.map((e,i)=>({id:`${e.owner??""}-${e.host}:${e.port}-${i}`,cells:[{key:CO.Owner,rawValue:e.owner||"-",component:e.owner?()=>t(lN,{service:e.owner}):void 0},{key:CO.Host,rawValue:e.host||"-"},{key:CO.Port,rawValue:e.port??"-",component:()=>t(Xi,{label:null!=e.port?String(e.port):"-",variant:null!=e.port?_i.Blue:void 0})},{key:CO.External,rawValue:e.external?"yes":"no",component:()=>e.external?t(Xi,{label:"External",variant:_i.Yellow}):t("span",{children:"-"})}]})))(e),[e]),r=d(()=>i===xO.Table?t(Xa,{maxHeight:"420px",variant:La.Data,columns:kO,rows:o}):t(SO,{peers:e}),[i,e,o]);return t(Mn,{bgTint:"900",richTitle:ZN("Outbound peers","Learned egress destinations (host:port) reached by this transaction"),withCollapse:!0,collapseIsDefaultOpen:!0,renderOnRightSide:t(F,{options:wO,selected:i,setSelected:n,size:Zt.L}),children:r()})},IO=f.div`
|
|
2124
2124
|
padding: 12px;
|
|
2125
2125
|
border-radius: 8px;
|
|
2126
2126
|
background-color: ${({theme:e,$withService:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
2127
2127
|
border: 1px solid ${({theme:e,$withService:t})=>t?e.v2.colors.purple[400]:e.v2.colors.silver[400]};
|
|
2128
|
-
`,$O={visibility:"hidden"},NO=b(({data:n})=>{const{svc:a,op:o,sameServiceAsSource:l}=n,r=!l,s=tN(a);return e(i,{children:[t(wm,{type:"source",position:Cm.Right,style:$O}),t(wm,{type:"target",position:Cm.Left,style:$O}),t(IO,{$withService:r,children:e($,{$gap:8,children:[r&&e(T,{$gap:8,children:[t(ga,{icons:s,size:20}),t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:a})]}),t(Xi,{label:o,variant:_i.Green})]})})]})});var AO;NO.displayName=NO.name,(e=>{e.Call="service-call"})(AO||(AO={}));const OO={[AO.Call]:NO},EO=({callEdges:e})=>{const i=v(),[n,r]=l([]),[s,c]=l([]),[d,p]=l(0),u=a(()=>e.map(e=>`${e.from.svc}|${e.from.op}->${e.to.svc}|${e.to.op}`).join("::"),[e]);return o(()=>{let t=!1;return(async()=>{const{nodes:n,edges:a,rootIds:o}=((e,t)=>{const i=new Map,n=new Set,a=[],o=new Map,l=new Map,r=t.v2.colors.silver[400],s=(e,t)=>{const n=((e,t)=>`${e}::${t}`)(e,t);return i.has(n)||(i.set(n,{id:n,type:AO.Call,position:{x:0,y:0},data:{svc:e,op:t,isRoot:!1,sameServiceAsSource:!1},measured:{width:220,height:64}}),o.set(n,0),l.set(n,new Set)),n};for(const t of e){const e=t.from?.svc?.trim()??"",i=t.from?.op?.trim()??"",c=t.to?.svc?.trim()??"",d=t.to?.op?.trim()??"";if(!(e&&i&&c&&d))continue;const p=s(e,i),u=s(c,d);if(p===u)continue;const h=`${p}->${u}`;n.has(h)||(n.add(h),o.set(u,(o.get(u)??0)+1),l.get(u)?.add(e),a.push({id:h,type:"smoothstep",source:p,target:u,markerEnd:{type:km.ArrowClosed,color:r,width:16,height:16},style:{stroke:r,strokeWidth:1}}))}const c=[];for(const[e,t]of i){const i=0===(o.get(e)??0),n=l.get(e)??new Set,a=!i&&n.size>0&&[...n].every(e=>e===t.data.svc);t.data={...t.data,isRoot:i,sameServiceAsSource:a},i&&c.push(e)}return{nodes:Array.from(i.values()),edges:a,rootIds:c}})(e,i);if(!n.length)return void(t||(r([]),c([])));const l=await bm(n,a,{direction:"RIGHT",nodeWidth:220,nodeHeight:64,rootIds:o,rootLayerConstraint:"FIRST",spacing:{betweenLayers:120,nodeNode:24,edgeEdge:24,edgeNode:32}});t||(r(l.nodes),c(l.edges),p(e=>e+1))})(),()=>{t=!0}},[u,e,i]),t(mm,{height:420,interactive:!1,nodeTypes:OO,nodes:n,edges:s,fitViewTrigger:d,minZoom:.2,maxZoom:1.5})},DO=({edges:e})=>(a(()=>{const t=new Set;for(const i of e)t.add(`${i.from.svc}::${i.from.op}`),t.add(`${i.to.svc}::${i.to.op}`);return t.size},[e]),e.length?t(EO,{callEdges:e}):t(oi,{children:t(Z,{subTitle:"No service call edges to visualize."})}));var zO;(e=>{e.Table="table",e.Map="map"})(zO||(zO={}));const RO=[{label:"Table",value:zO.Table},{label:"Map",value:zO.Map}];var PO;(e=>{e.FromService="fromService",e.FromOperation="fromOperation",e.ToService="toService",e.ToOperation="toOperation"})(PO||(PO={}));const XO=[{key:PO.FromService,label:"From service"},{key:PO.FromOperation,label:"From operation"},{key:PO.ToService,label:"To service"},{key:PO.ToOperation,label:"To operation"}],LO=({edges:e})=>{const[i,n]=l(zO.Map),o=a(()=>(e=>e.map((e,i)=>({id:`${e.from.svc}-${e.from.op}->${e.to.svc}-${e.to.op}-${i}`,cells:[{key:PO.FromService,rawValue:e.from.svc||"-",component:e.from.svc?()=>t(iN,{service:e.from.svc}):void 0},{key:PO.FromOperation,rawValue:e.from.op||"-",component:()=>t(Xi,{label:e.from.op||"-",variant:e.from.op?_i.Green:void 0})},{key:PO.ToService,rawValue:e.to.svc||"-",component:e.to.svc?()=>t(iN,{service:e.to.svc}):void 0},{key:PO.ToOperation,rawValue:e.to.op||"-",component:()=>t(Xi,{label:e.to.op||"-",variant:e.to.op?_i.Green:void 0})}]})))(e),[e]),r=d(()=>i===zO.Table?t(za,{maxHeight:"420px",variant:Ra.Data,columns:XO,rows:o}):t(DO,{edges:e}),[i,e,o]);return t(Mn,{bgTint:"900",richTitle:KN("Service call edges","Observed call graph between operations"),withCollapse:!0,collapseIsDefaultOpen:!0,renderOnRightSide:t(F,{options:RO,selected:i,setSelected:n,size:Zt.L}),children:r()})},_O=({isOpen:i,onClose:n,baseline:o})=>{const{CopyButton:l}=En(),{histogram:r,data:s}=o||{},c=!!r?.series?.length,d=!!s,p=c||d,{parsedJson:u,jsonIsDbAccess:h,jsonIsServiceCalls:g,jsonIsOutboundPeers:m,jsonIsLibraries:b}=a(()=>{const e=xn(s,{});return{parsedJson:e,jsonIsDbAccess:!!e?.accesses?.length&&!!e?.query_shapes?.length,jsonIsServiceCalls:!!e?.edges?.length,jsonIsOutboundPeers:!!e?.peers?.length,jsonIsLibraries:!!e?.libs?.length}},[o]),f=!(c||h||g||m||b);return t(ln,{isOpen:i,width:c||h||g||m?"90vw":"40vw",header:{icon:Dh,title:"Baseline data",subTitle:`Deviation class: ${o?.class}`,onClose:n},children:o&&p?e($,{$gap:12,children:[g&&t(LO,{edges:u.edges||[]}),m&&t(TO,{peers:u.peers||[]}),b&&t(UA,{libraries:u.libs||[]}),h&&t(cO,{parsedJson:u}),c&&t(FA,{histogram:r,classDescription:o.classDescription}),d&&t(Mn,{bgTint:"900",richTitle:KN("JSON data","Raw baseline payload"),withCollapse:!0,collapseIsDefaultOpen:f,children:t(Mn,{bgTint:"800",overflow:"auto",children:e(T,{$width:"100%",$alignItems:"flex-start",$justifyContent:"space-between",children:[t(kc,{language:"json",code:s}),t(l,{value:s})]})})})]}):t(Z,{})})},MO=({transactionId:i})=>{const n=v(),{insightsApi:o}=Hh(),{data:r,loading:s,refetch:c}=o.useBaseline({transactionId:i},{pollInterval:3e4}),{baselinesColumns:d,baselinesRows:p}=a(()=>({baselinesColumns:[{key:CN.Class,label:"Class"},{key:CN.Status,label:"Status"},{key:CN.Learning,label:"Learning stability",noFilter:!0,noSort:!0},{key:CN.ObservationCount,label:"Observations",noFilter:!0},{key:CN.LearningStartedAt,label:"First observed",noFilter:!0}],baselinesRows:kN(0,r)}),[n,r]),u=a(()=>!!r?.length&&r.every(e=>e.promoted),[r]),[h,g]=l(!1),[m,b]=l(!1),[f,y]=l(null),[S,x]=l(null),[w,C]=l(null);return t(Mn,{bgTint:"900",richTitle:KN("Baseline (One row per deviation class)",'"Learning stability" shows how converged each class\'s baseline is. Locked means the class is promoted and frozen. While learning, progress shows observations and quiet time toward the resolved policy — a full bar is not promotion until the engine graduates the class.'),actions:[{id:"promote-all-baselines",type:St.Button,buttonProps:{label:"Promote all baselines",leftIcon:Ou,variant:K.Primary,disabled:u||!o.promoteTransactionBaselines,onClick:()=>b(!0)}},{id:"reset-all-baselines",type:St.Button,buttonProps:{label:"Reset all baselines",leftIcon:lh,variant:K.Secondary,onClick:()=>g(!0)}},{id:"refetch-baselines",type:St.Button,buttonProps:{tooltip:"Refetch",hideTooltipIcon:!0,leftIcon:Zu,variant:K.Secondary,onClick:c,loading:s}}],children:e(Mn,{bgTint:"800",children:[t(za,{maxHeight:"35vh",variant:Ra.Data,isLoading:s,columns:d,rows:p,getRowActions:e=>{const t=e.cells.find(e=>e.key===CN.Class)?.rawValue,i=r?.find(e=>e.class===t),n=i?.learning?.phase,a=n===uc.Promoted;return[{id:`${e.id}-view-data`,label:"View data",leftIcon:Yu,variant:K.Primary,onClick:()=>C(i??null)},{id:`${e.id}-promote-now`,label:"Promote now",leftIcon:Ou,disabled:a||!o.promoteBaselineClass,onClick:()=>x(t)},{id:`${e.id}-re-learn`,label:"Re-learn (reset)",leftIcon:lh,onClick:()=>y(t)}]}}),t(_O,{isOpen:!!w,onClose:()=>C(null),baseline:w}),t(Ce,{isOpen:m,onClose:()=>b(!1),title:"Promote all baseline classes",description:"Promote every scored baseline class on this transaction? Learning gates will be skipped and baselines will freeze.",approveButton:{label:"Promote all",onClick:()=>(async()=>{b(!1),await(o?.promoteTransactionBaselines?.(i)),c()})()},denyButton:{label:"Cancel",onClick:()=>b(!1),variant:K.Secondary}}),t(Ce,{isOpen:h,onClose:()=>g(!1),title:"Reset transaction baselines",description:"Are you sure you want to reset all baselines for this transaction?",approveButton:{label:"Reset all baselines",onClick:()=>(async()=>{g(!1),await(o?.resetTransactionBaselines?.(i)),c()})()},denyButton:{label:"Cancel",onClick:()=>g(!1),variant:K.Secondary}}),t(Ce,{isOpen:null!==f,onClose:()=>y(null),title:"Reset baseline class",description:"Are you sure you want to reset the baseline class?",approveButton:{label:"Reset baseline class",onClick:()=>(async e=>{y(null),await(o?.resetBaselineClass?.(i,e)),c()})(f)},denyButton:{label:"Cancel",onClick:()=>y(null),variant:K.Secondary}}),t(Ce,{isOpen:null!==S,onClose:()=>x(null),title:"Promote baseline class",description:"Promote this class now? Learning gates will be skipped and the baseline will freeze.",approveButton:{label:"Promote now",onClick:()=>(async e=>{x(null),await(o?.promoteBaselineClass?.({transactionId:i,class:e})),c()})(S)},denyButton:{label:"Cancel",onClick:()=>x(null),variant:K.Secondary}})]})})},FO=e=>(e.attrs??[]).filter(e=>!!e?.key).map(e=>({key:e.key??null,value:e.value??null})),BO=({isOpen:e,onClose:i,observation:n})=>{const o=n?.transactionId,r=n?.traceId,{insightsApi:s}=Hh(),{data:c,loading:d}=s.useObservation({transactionId:o,traceId:r},{skip:!e||!o||!r}),p=a(()=>(e=>e?.spans?.map((e,t)=>{return{id:e.spanId||`span-${t}`,index:t+1,service:e.service??null,name:e.name,duration:(i=e.durationMs,null==i||Number.isNaN(i)?null:fc(1e6*Math.max(0,i))),depth:e.depth??0,scope:e.scope??null,attributes:FO(e),variant:"default",badge:null};var i})??[])(yc(r,c?.rawOtlp)),[r,c?.rawOtlp]),[u,h]=l([]);return t(ln,{isOpen:e,width:"40vw",header:{icon:Pu,title:"Observation data",subTitle:`Trace ID: ${n?.traceId}`,onClose:i},children:n&&c?t($,{$gap:12,children:t(Mn,{bgTint:"900",richTitle:KN("Trace view","Spans for this observation",zh),withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Mn,{bgTint:"800",overflow:"auto",children:t(vc,{traceId:r,rows:p,expandedRowIds:u,onToggleRow:e=>h(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])})})})}):t(oi,{children:d?t(Ve,{withSpinner:!0}):t(Z,{})})})};var VO;(e=>{e.TraceId="traceId",e.TransactionId="transactionId",e.ObservedAt="observedAt",e.DurationMs="durationMs",e.SampleReason="sampleReason"})(VO||(VO={}));const UO=e=>e?.map((e,i)=>({id:`${e.transactionId}-${e.traceId}-${i}`,cells:[{key:VO.TraceId,rawValue:e.traceId},{key:VO.TransactionId,rawValue:e.transactionId},{key:VO.ObservedAt,rawValue:e.observedAt?new Date(e.observedAt).toLocaleString():""},{key:VO.DurationMs,rawValue:`${e.durationMs}ms`},{key:VO.SampleReason,rawValue:e.sampleReason,component:()=>t(E,{label:e.sampleReason})}]}))??[];var GO;(e=>{e.Examples="examples",e.Anomalies="anomalies"})(GO||(GO={}));const jO=({transactionId:i})=>{const{insightsApi:n}=Hh(),{data:o,loading:r,refetch:s}=n.useObservations({transactionId:i},{pollInterval:3e4}),{observationsColumns:c,observationsRows:d}=a(()=>({observationsColumns:[{key:VO.TraceId,label:"Trace ID",noFilter:!0},{key:VO.ObservedAt,label:"Observed at",noFilter:!0},{key:VO.DurationMs,label:"Duration",noFilter:!0},{key:VO.SampleReason,label:"Sample reason"}],observationsRows:UO(o)}),[o]),[p,u]=l(GO.Examples),[h,g]=l(null),{examplesRows:m,anomaliesRows:b}=a(()=>{const e=[],t=[];return d.forEach(i=>{const n=i.cells.find(e=>e.key===VO.SampleReason)?.rawValue;[Tc.Example].includes(n)&&e.push(i),[Tc.AnomalyEvidence,Tc.GuardrailEvidence].includes(n)&&t.push(i)}),{examplesRows:e,anomaliesRows:t}},[d]);return e(Mn,{bgTint:"900",richTitle:KN("Trace observations","Representative sample of normal traffic - up to 10 collected while learning, then collection stops."),actions:[{id:"refetch-observations",type:St.Button,buttonProps:{tooltip:"Refetch",hideTooltipIcon:!0,leftIcon:Zu,variant:K.Secondary,onClick:s,loading:r}}],renderOnRightSide:t(F,{options:(f=m.length,v=b.length,[{label:"Examples",value:GO.Examples,badge:{label:f.toString()}},{label:"Anomaly issues",value:GO.Anomalies,badge:{label:v.toString()}}]),selected:p,setSelected:u,size:Zt.L}),children:[t(Mn,{bgTint:"800",children:t(za,{maxHeight:"35vh",variant:Ra.Data,isLoading:r,columns:c,rows:p===GO.Examples?m:b,getRowActions:e=>[{id:`${e.id}-view-trace`,label:"View trace",rightIcon:Yu,variant:K.Primary,onClick:()=>{const t=e.cells.find(e=>e.key===VO.TransactionId)?.rawValue,i=e.cells.find(e=>e.key===VO.TraceId)?.rawValue,n=o?.find(e=>e.transactionId===t&&e.traceId===i)??null;g(n)}}]})}),t(BO,{isOpen:!!h,onClose:()=>g(null),observation:h})]});var f,v},HO=()=>{const{drawerIsOpenFor:e,closeDrawer:i}=J$(),{insightsApi:n}=Hh(),a=e.id??"",{data:o,loading:l}=n.useTransaction({id:a},{skip:!a});return t(ln,{width:"60vw",isOpen:!0,header:{onClose:i,icon:Pu,title:"Transaction data",subTitle:`Transaction ID: ${o?.id}`},children:o?t(WO,{transaction:o}):t(oi,{children:l?t(Ve,{withSpinner:!0}):t(Z,{title:"No transaction found",subTitle:`No transaction found for this ID ${e.id}`})})})},WO=({transaction:i})=>{const n=v();return e(Mn,{bgTint:"1000",moreSpacing:!0,children:[e(T,{$gap:8,children:[t(iN,{service:i.service,namespace:i.namespace,typographySize:C.M,size:28}),t(Ng,{operationName:i.operationName,identityDimensions:i.identityDimensions}),t(E,{backgroundColor:n.v2.colors.blue[900],label:i.kind}),t(Xi,{disabled:!0,label:`Transaction ID: ${i.id}`})]}),t(MO,{transactionId:i.id}),t(jO,{transactionId:i.id})]})},KO=f($)`
|
|
2128
|
+
`,$O={visibility:"hidden"},NO=b(({data:n})=>{const{svc:a,op:o,sameServiceAsSource:l}=n,r=!l,s=oN(a);return e(i,{children:[t(Im,{type:"source",position:$m.Right,style:$O}),t(Im,{type:"target",position:$m.Left,style:$O}),t(IO,{$withService:r,children:e($,{$gap:8,children:[r&&e(T,{$gap:8,children:[t(ga,{icons:s,size:20}),t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:a})]}),t(Xi,{label:o,variant:_i.Green})]})})]})});var AO;NO.displayName=NO.name,(e=>{e.Call="service-call"})(AO||(AO={}));const OO={[AO.Call]:NO},EO=({callEdges:e})=>{const i=v(),[n,r]=l([]),[s,c]=l([]),[d,p]=l(0),u=a(()=>e.map(e=>`${e.from.svc}|${e.from.op}->${e.to.svc}|${e.to.op}`).join("::"),[e]);return o(()=>{let t=!1;return(async()=>{const{nodes:n,edges:a,rootIds:o}=((e,t)=>{const i=new Map,n=new Set,a=[],o=new Map,l=new Map,r=t.v2.colors.silver[400],s=(e,t)=>{const n=((e,t)=>`${e}::${t}`)(e,t);return i.has(n)||(i.set(n,{id:n,type:AO.Call,position:{x:0,y:0},data:{svc:e,op:t,isRoot:!1,sameServiceAsSource:!1},measured:{width:220,height:64}}),o.set(n,0),l.set(n,new Set)),n};for(const t of e){const e=t.from?.svc?.trim()??"",i=t.from?.op?.trim()??"",c=t.to?.svc?.trim()??"",d=t.to?.op?.trim()??"";if(!(e&&i&&c&&d))continue;const p=s(e,i),u=s(c,d);if(p===u)continue;const h=`${p}->${u}`;n.has(h)||(n.add(h),o.set(u,(o.get(u)??0)+1),l.get(u)?.add(e),a.push({id:h,type:"smoothstep",source:p,target:u,markerEnd:{type:Nm.ArrowClosed,color:r,width:16,height:16},style:{stroke:r,strokeWidth:1}}))}const c=[];for(const[e,t]of i){const i=0===(o.get(e)??0),n=l.get(e)??new Set,a=!i&&n.size>0&&[...n].every(e=>e===t.data.svc);t.data={...t.data,isRoot:i,sameServiceAsSource:a},i&&c.push(e)}return{nodes:Array.from(i.values()),edges:a,rootIds:c}})(e,i);if(!n.length)return void(t||(r([]),c([])));const l=await Sm(n,a,{direction:"RIGHT",nodeWidth:220,nodeHeight:64,rootIds:o,rootLayerConstraint:"FIRST",spacing:{betweenLayers:120,nodeNode:24,edgeEdge:24,edgeNode:32}});t||(r(l.nodes),c(l.edges),p(e=>e+1))})(),()=>{t=!0}},[u,e,i]),t(ym,{height:420,interactive:!1,nodeTypes:OO,nodes:n,edges:s,fitViewTrigger:d,minZoom:.2,maxZoom:1.5})},DO=({edges:e})=>(a(()=>{const t=new Set;for(const i of e)t.add(`${i.from.svc}::${i.from.op}`),t.add(`${i.to.svc}::${i.to.op}`);return t.size},[e]),e.length?t(EO,{callEdges:e}):t(oi,{children:t(Z,{subTitle:"No service call edges to visualize."})}));var zO;(e=>{e.Table="table",e.Map="map"})(zO||(zO={}));const RO=[{label:"Table",value:zO.Table},{label:"Map",value:zO.Map}];var PO;(e=>{e.FromService="fromService",e.FromOperation="fromOperation",e.ToService="toService",e.ToOperation="toOperation"})(PO||(PO={}));const XO=[{key:PO.FromService,label:"From service"},{key:PO.FromOperation,label:"From operation"},{key:PO.ToService,label:"To service"},{key:PO.ToOperation,label:"To operation"}],LO=({edges:e})=>{const[i,n]=l(zO.Map),o=a(()=>(e=>e.map((e,i)=>({id:`${e.from.svc}-${e.from.op}->${e.to.svc}-${e.to.op}-${i}`,cells:[{key:PO.FromService,rawValue:e.from.svc||"-",component:e.from.svc?()=>t(lN,{service:e.from.svc}):void 0},{key:PO.FromOperation,rawValue:e.from.op||"-",component:()=>t(Xi,{label:e.from.op||"-",variant:e.from.op?_i.Green:void 0})},{key:PO.ToService,rawValue:e.to.svc||"-",component:e.to.svc?()=>t(lN,{service:e.to.svc}):void 0},{key:PO.ToOperation,rawValue:e.to.op||"-",component:()=>t(Xi,{label:e.to.op||"-",variant:e.to.op?_i.Green:void 0})}]})))(e),[e]),r=d(()=>i===zO.Table?t(Xa,{maxHeight:"420px",variant:La.Data,columns:XO,rows:o}):t(DO,{edges:e}),[i,e,o]);return t(Mn,{bgTint:"900",richTitle:ZN("Service call edges","Observed call graph between operations"),withCollapse:!0,collapseIsDefaultOpen:!0,renderOnRightSide:t(F,{options:RO,selected:i,setSelected:n,size:Zt.L}),children:r()})},_O=({isOpen:i,onClose:n,baseline:o})=>{const{CopyButton:l}=En(),{histogram:r,data:s}=o||{},c=!!r?.series?.length,d=!!s,p=c||d,{parsedJson:u,jsonIsDbAccess:h,jsonIsServiceCalls:g,jsonIsOutboundPeers:m,jsonIsLibraries:b}=a(()=>{const e=xn(s,{});return{parsedJson:e,jsonIsDbAccess:!!e?.accesses?.length&&!!e?.query_shapes?.length,jsonIsServiceCalls:!!e?.edges?.length,jsonIsOutboundPeers:!!e?.peers?.length,jsonIsLibraries:!!e?.libs?.length}},[o]),f=!(c||h||g||m||b);return t(ln,{isOpen:i,width:c||h||g||m?"90vw":"40vw",header:{icon:Xh,title:"Baseline data",subTitle:`Deviation class: ${o?.class}`,onClose:n},children:o&&p?e($,{$gap:12,children:[g&&t(LO,{edges:u.edges||[]}),m&&t(TO,{peers:u.peers||[]}),b&&t(UA,{libraries:u.libs||[]}),h&&t(cO,{parsedJson:u}),c&&t(FA,{histogram:r,classDescription:o.classDescription}),d&&t(Mn,{bgTint:"900",richTitle:ZN("JSON data","Raw baseline payload"),withCollapse:!0,collapseIsDefaultOpen:f,children:t(Mn,{bgTint:"800",overflow:"auto",children:e(T,{$width:"100%",$alignItems:"flex-start",$justifyContent:"space-between",children:[t($c,{language:"json",code:s}),t(l,{value:s})]})})})]}):t(Z,{})})},MO=({transactionId:i})=>{const n=v(),{insightsApi:o}=Jh(),{data:r,loading:s,refetch:c}=o.useBaseline({transactionId:i},{pollInterval:3e4}),{baselinesColumns:d,baselinesRows:p}=a(()=>({baselinesColumns:[{key:$N.Class,label:"Class"},{key:$N.Status,label:"Status"},{key:$N.Learning,label:"Learning stability",noFilter:!0,noSort:!0},{key:$N.ObservationCount,label:"Observations",noFilter:!0},{key:$N.LearningStartedAt,label:"First observed",noFilter:!0}],baselinesRows:NN(0,r)}),[n,r]),u=a(()=>!!r?.length&&r.every(e=>e.promoted),[r]),[h,g]=l(!1),[m,b]=l(!1),[f,y]=l(null),[S,x]=l(null),[w,C]=l(null);return t(Mn,{bgTint:"900",richTitle:ZN("Baseline (One row per deviation class)",'"Learning stability" shows how converged each class\'s baseline is. Locked means the class is promoted and frozen. While learning, progress shows observations and quiet time toward the resolved policy — a full bar is not promotion until the engine graduates the class.'),actions:[{id:"promote-all-baselines",type:St.Button,buttonProps:{label:"Promote all baselines",leftIcon:zu,variant:K.Primary,disabled:u||!o.promoteTransactionBaselines,onClick:()=>b(!0)}},{id:"reset-all-baselines",type:St.Button,buttonProps:{label:"Reset all baselines",leftIcon:ch,variant:K.Secondary,onClick:()=>g(!0)}},{id:"refetch-baselines",type:St.Button,buttonProps:{tooltip:"Refetch",hideTooltipIcon:!0,leftIcon:th,variant:K.Secondary,onClick:c,loading:s}}],children:e(Mn,{bgTint:"800",children:[t(Xa,{maxHeight:"35vh",variant:La.Data,isLoading:s,columns:d,rows:p,getRowActions:e=>{const t=e.cells.find(e=>e.key===$N.Class)?.rawValue,i=r?.find(e=>e.class===t),n=i?.learning?.phase,a=n===mc.Promoted;return[{id:`${e.id}-view-data`,label:"View data",leftIcon:Zu,variant:K.Primary,onClick:()=>C(i??null)},{id:`${e.id}-promote-now`,label:"Promote now",leftIcon:zu,disabled:a||!o.promoteBaselineClass,onClick:()=>x(t)},{id:`${e.id}-re-learn`,label:"Re-learn (reset)",leftIcon:ch,onClick:()=>y(t)}]}}),t(_O,{isOpen:!!w,onClose:()=>C(null),baseline:w}),t(Ce,{isOpen:m,onClose:()=>b(!1),title:"Promote all baseline classes",description:"Promote every scored baseline class on this transaction? Learning gates will be skipped and baselines will freeze.",approveButton:{label:"Promote all",onClick:()=>(async()=>{b(!1),await(o?.promoteTransactionBaselines?.(i)),c()})()},denyButton:{label:"Cancel",onClick:()=>b(!1),variant:K.Secondary}}),t(Ce,{isOpen:h,onClose:()=>g(!1),title:"Reset transaction baselines",description:"Are you sure you want to reset all baselines for this transaction?",approveButton:{label:"Reset all baselines",onClick:()=>(async()=>{g(!1),await(o?.resetTransactionBaselines?.(i)),c()})()},denyButton:{label:"Cancel",onClick:()=>g(!1),variant:K.Secondary}}),t(Ce,{isOpen:null!==f,onClose:()=>y(null),title:"Reset baseline class",description:"Are you sure you want to reset the baseline class?",approveButton:{label:"Reset baseline class",onClick:()=>(async e=>{y(null),await(o?.resetBaselineClass?.(i,e)),c()})(f)},denyButton:{label:"Cancel",onClick:()=>y(null),variant:K.Secondary}}),t(Ce,{isOpen:null!==S,onClose:()=>x(null),title:"Promote baseline class",description:"Promote this class now? Learning gates will be skipped and the baseline will freeze.",approveButton:{label:"Promote now",onClick:()=>(async e=>{x(null),await(o?.promoteBaselineClass?.({transactionId:i,class:e})),c()})(S)},denyButton:{label:"Cancel",onClick:()=>x(null),variant:K.Secondary}})]})})},FO=e=>(e.attrs??[]).filter(e=>!!e?.key).map(e=>({key:e.key??null,value:e.value??null})),BO=({isOpen:e,onClose:i,observation:n})=>{const o=n?.transactionId,r=n?.traceId,{insightsApi:s}=Jh(),{data:c,loading:d}=s.useObservation({transactionId:o,traceId:r},{skip:!e||!o||!r}),p=a(()=>(e=>e?.spans?.map((e,t)=>{return{id:e.spanId||`span-${t}`,index:t+1,service:e.service??null,name:e.name,duration:(i=e.durationMs,null==i||Number.isNaN(i)?null:Sc(1e6*Math.max(0,i))),depth:e.depth??0,scope:e.scope??null,attributes:FO(e),variant:"default",badge:null};var i})??[])(wc(r,c?.rawOtlp)),[r,c?.rawOtlp]),[u,h]=l([]);return t(ln,{isOpen:e,width:"40vw",header:{icon:_u,title:"Observation data",subTitle:`Trace ID: ${n?.traceId}`,onClose:i},children:n&&c?t($,{$gap:12,children:t(Mn,{bgTint:"900",richTitle:ZN("Trace view","Spans for this observation",Lh),withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Mn,{bgTint:"800",overflow:"auto",children:t(xc,{traceId:r,rows:p,expandedRowIds:u,onToggleRow:e=>h(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])})})})}):t(oi,{children:d?t(Ve,{withSpinner:!0}):t(Z,{})})})};var VO;(e=>{e.TraceId="traceId",e.TransactionId="transactionId",e.ObservedAt="observedAt",e.DurationMs="durationMs",e.SampleReason="sampleReason"})(VO||(VO={}));const UO=e=>e?.map((e,i)=>({id:`${e.transactionId}-${e.traceId}-${i}`,cells:[{key:VO.TraceId,rawValue:e.traceId},{key:VO.TransactionId,rawValue:e.transactionId},{key:VO.ObservedAt,rawValue:e.observedAt?new Date(e.observedAt).toLocaleString():""},{key:VO.DurationMs,rawValue:`${e.durationMs}ms`},{key:VO.SampleReason,rawValue:e.sampleReason,component:()=>t(E,{label:e.sampleReason})}]}))??[];var GO;(e=>{e.Examples="examples",e.Anomalies="anomalies"})(GO||(GO={}));const jO=({transactionId:i})=>{const{insightsApi:n}=Jh(),{data:o,loading:r,refetch:s}=n.useObservations({transactionId:i},{pollInterval:3e4}),{observationsColumns:c,observationsRows:d}=a(()=>({observationsColumns:[{key:VO.TraceId,label:"Trace ID",noFilter:!0},{key:VO.ObservedAt,label:"Observed at",noFilter:!0},{key:VO.DurationMs,label:"Duration",noFilter:!0},{key:VO.SampleReason,label:"Sample reason"}],observationsRows:UO(o)}),[o]),[p,u]=l(GO.Examples),[h,g]=l(null),{examplesRows:m,anomaliesRows:b}=a(()=>{const e=[],t=[];return d.forEach(i=>{const n=i.cells.find(e=>e.key===VO.SampleReason)?.rawValue;[Nc.Example].includes(n)&&e.push(i),[Nc.AnomalyEvidence,Nc.GuardrailEvidence].includes(n)&&t.push(i)}),{examplesRows:e,anomaliesRows:t}},[d]);return e(Mn,{bgTint:"900",richTitle:ZN("Trace observations","Representative sample of normal traffic - up to 10 collected while learning, then collection stops."),actions:[{id:"refetch-observations",type:St.Button,buttonProps:{tooltip:"Refetch",hideTooltipIcon:!0,leftIcon:th,variant:K.Secondary,onClick:s,loading:r}}],renderOnRightSide:t(F,{options:(f=m.length,v=b.length,[{label:"Examples",value:GO.Examples,badge:{label:f.toString()}},{label:"Anomaly issues",value:GO.Anomalies,badge:{label:v.toString()}}]),selected:p,setSelected:u,size:Zt.L}),children:[t(Mn,{bgTint:"800",children:t(Xa,{maxHeight:"35vh",variant:La.Data,isLoading:r,columns:c,rows:p===GO.Examples?m:b,getRowActions:e=>[{id:`${e.id}-view-trace`,label:"View trace",rightIcon:Zu,variant:K.Primary,onClick:()=>{const t=e.cells.find(e=>e.key===VO.TransactionId)?.rawValue,i=e.cells.find(e=>e.key===VO.TraceId)?.rawValue,n=o?.find(e=>e.transactionId===t&&e.traceId===i)??null;g(n)}}]})}),t(BO,{isOpen:!!h,onClose:()=>g(null),observation:h})]});var f,v},HO=()=>{const{transactionDrawerId:e,closeTransactionDrawer:i}=eN(),{insightsApi:n}=Jh(),a=e??"",{data:o,loading:l}=n.useTransaction({id:a},{skip:!a});return t(ln,{width:"60vw",isOpen:!0,header:{onClose:i,icon:_u,title:"Transaction data",subTitle:`Transaction ID: ${o?.id}`},children:o?t(WO,{transaction:o}):t(oi,{children:l?t(Ve,{withSpinner:!0}):t(Z,{title:"No transaction found",subTitle:`No transaction found for this ID ${e}`})})})},WO=({transaction:i})=>{const n=v();return e(Mn,{bgTint:"1000",moreSpacing:!0,children:[e(T,{$gap:8,children:[t(lN,{service:i.service,namespace:i.namespace,typographySize:C.M,size:28}),t(Dg,{operationName:i.operationName,identityDimensions:i.identityDimensions}),t(E,{backgroundColor:n.v2.colors.blue[900],label:i.kind}),t(Xi,{disabled:!0,label:`Transaction ID: ${i.id}`})]}),t(MO,{transactionId:i.id}),t(jO,{transactionId:i.id})]})},KO=f($)`
|
|
2129
2129
|
flex: 1;
|
|
2130
2130
|
min-width: 0;
|
|
2131
2131
|
min-height: 0;
|
|
@@ -2206,7 +2206,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2206
2206
|
flex-direction: column;
|
|
2207
2207
|
border-radius: 16px 0 16px 0;
|
|
2208
2208
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
2209
|
-
`,lE=({id:i,selectedId:n,onSelect:a,header:o,subDivisions:l})=>e(aE,{type:"button","data-id":`menu-item-${i}`,$isSelected:n===i,onClick:()=>a(i),children:[e($,{$gap:8,children:[e(T,{$gap:4,children:[t(w,{size:C.XXS,nowrap:!0,children:o.label}),o.badges?.map(e=>e&&t(E,{...e,textSize:C.XXS},`${i}-${e.label}`))]}),t(T,{$gap:6,$wrap:"wrap",children:l?.length?l.map(n=>e(T,{$gap:4,children:[t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:n.label}),n.badges?.map(e=>e&&t(E,{...e,textSize:C.XXXS},`${i}-${e.label}`))]},n.label)):t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:"No rules"})})]}),t(
|
|
2209
|
+
`,lE=({id:i,selectedId:n,onSelect:a,header:o,subDivisions:l})=>e(aE,{type:"button","data-id":`menu-item-${i}`,$isSelected:n===i,onClick:()=>a(i),children:[e($,{$gap:8,children:[e(T,{$gap:4,children:[t(w,{size:C.XXS,nowrap:!0,children:o.label}),o.badges?.map(e=>e&&t(E,{...e,textSize:C.XXS},`${i}-${e.label}`))]}),t(T,{$gap:6,$wrap:"wrap",children:l?.length?l.map(n=>e(T,{$gap:4,children:[t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:n.label}),n.badges?.map(e=>e&&t(E,{...e,textSize:C.XXXS},`${i}-${e.label}`))]},n.label)):t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:"No rules"})})]}),t(wu,{size:18})]}),rE=({loading:i,sections:n})=>{const a=v();return t(eE,{"data-id":"menu-root",children:n.map((o,l)=>e(r,{children:[e(tE,{"data-id":`menu-${o.id}-section`,children:[o.addButton&&t(nE,{"data-id":`menu-${o.id}-add-button`,fullWidth:!0,leftIcon:Tu,size:W.M,variant:K.Primary,textColor:a.v2.colors.purple[300],...o.addButton}),e(iE,{children:[t(w,{size:C.XXS,color:a.v2.colors.purple[300],children:o.title}),t(E,{label:o.titleCount})]}),o.list.length?o.list.map(e=>t(lE,{...e},e.id)):i?t(A,{size:3}):t(Z,{hideIcon:!0,...o.noData})]}),l<n.length-1&&t(J,{})]},`menu-${o.id}-section`))})},sE=({loading:e,showDetail:n=!0,emptyTitle:a,emptySubTitle:o,children:l})=>n?t(i,{children:l}):e?t(oi,{$height:"100%",children:t(Ve,{withSpinner:!0})}):a?t(oi,{$height:"100%",children:t(Z,{hideIcon:!0,title:a,subTitle:o})}):null,cE=({icon:i,title:n,count:a,description:o,loading:l,sections:r,showDetail:s=!0,emptyTitle:c,emptySubTitle:d,children:p})=>{const u=v();return e(KO,{"data-id":`settings-content-panel-${n}`,children:[e(YO,{children:[(i||n||"number"==typeof a)&&e(JO,{children:[i&&t(i,{size:18}),n&&t(w,{size:C.S,children:n}),"number"==typeof a&&t(E,{label:a})]}),o&&t(qO,{size:C.XXS,color:u.v2.colors.silver[300],children:o})]}),t(ZO,{children:e(QO,{children:[r&&t(rE,{loading:l,sections:r}),t(oE,{children:t(sE,{loading:l,showDetail:s,emptyTitle:c,emptySubTitle:d,children:p})})]})})]})},dE="System",pE="Storage";var uE;(e=>{e.Detection="detection",e.Guardrails="guardrails",e.Learning="learning",e.System="system",e.Storage="storage"})(uE||(uE={}));const hE=uE.Guardrails,gE=[{id:"threat-detection",title:"Threat detection",icon:Vu,items:[{id:uE.Detection,title:"Detection",description:"When a finding fires",panelIcon:Vu,panelDescription:Ac},{id:uE.Guardrails,title:"Guardrails",description:"L7 allowlist rules (Enforce / Suggest)",panelIcon:_h,panelDescription:Oc}]},{id:"learning",title:"Learning",icon:$u,items:[{id:uE.Learning,title:"Learning",description:"Control baseline learning",panelIcon:$u,panelDescription:Ec}]},{id:"advanced",title:"Advanced",icon:Mh,items:[{id:uE.System,title:dE,description:"Sampling, retention, capacity",panelIcon:Mh,panelDescription:"Engine-wide operational configuration. Detection thresholds and learning rules live on their own tabs."},{id:uE.Storage,title:pE,description:"ClickHouse health",panelIcon:Ph}]}],mE=e=>gE.flatMap(e=>e.items).find(t=>t.id===e),bE=()=>{const e=mE(uE.System),{insightsApi:i}=Jh(),{data:n,loading:a,unsupported:o,error:l}=i.useSystemSettings();return t(cE,{icon:e?.panelIcon,title:e?.title||dE,description:e?.panelDescription,loading:a&&!n&&!o,showDetail:!!n||o||!a,children:t(nv,{settings:n??null,unsupported:o,error:l,onSave:async e=>{i.updateSystemSettings&&await i.updateSystemSettings(e)}})})},fE=f(T)`
|
|
2210
2210
|
padding: 8px 12px 4px 12px;
|
|
2211
2211
|
`,vE=({icon:i,title:n,count:a})=>{const o=v().v2.colors.purple[200];return e(fE,{$gap:8,children:[t(i,{size:14,fill:o}),t(w,{size:C.XXS,color:o,children:n}),t(E,{label:a})]})},yE=f($)`
|
|
2212
2212
|
width: 280px;
|
|
@@ -2218,7 +2218,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2218
2218
|
padding: 4px 12px;
|
|
2219
2219
|
`,xE=f($)`
|
|
2220
2220
|
gap: 0;
|
|
2221
|
-
`,wE=({selected:i,onSelect:n})=>{const a=v();return e(yE,{"data-id":"insights-settings-menu",children:[e(SE,{$gap:8,children:[t(Qu,{size:16,fill:a.v2.colors.silver[200]}),t(w,{size:C.XS,children:"Settings Menu"})]}),gE.map(a=>e(xE,{"data-id":`settings-menu-category-${a.id}`,children:[t(vE,{icon:a.icon,title:a.title,count:a.items.length}),a.items.map(e=>t(Mm,{dataId:`settings-menu-item-${e.id}`,title:e.title,description:e.description,withCarret:!0,isSelected:i===e.id,onClick:()=>n(e.id)},e.id))]},a.id))]})},CE=e=>{const t={invertColors:!0};switch(e){case qt.Global:return{...t,label:Dt,status:ie.Warning};case qt.Service:return{...t,label:Ot,status:ie.Info};case qt.Transaction:return{...t,label:Et,status:ie.Info};default:return t}},kE=()=>{const e=v(),i=mE(uE.Learning),{insightsApi:n}=Hh(),{data:r,loading:s,refetch:c}=n.useLearningPolicies(),d=n.useServices(),p=n.useTransactions(),u=Array.isArray(r)?r:[],[h,g]=l(!1),[m,b]=l(null),[f,y]=l(null),S=a(()=>Array.isArray(d.data)?d.data:[],[d.data]),x=a(()=>Array.isArray(p.data)?p.data:[],[p.data]),w=a(()=>Rg(u.map(Pg),x),[u,x]),{defaultPolicies:C,overridePolicies:k,allPolicies:T}=a(()=>(e=>{const t=(e=>{const t=new Map(rg.map((e,t)=>[e,t]));return[...e].sort((e,i)=>(t.get(e.class)??99)-(t.get(i.class)??99))})(e.filter(Eg)),i=e.filter(e=>!Eg(e));return{defaultPolicies:t,overridePolicies:i,allPolicies:[...t,...i]}})(w),[w]);o(()=>{b(e=>((e,t,i)=>e||!t.length?null:i&&t.some(e=>e.id===i)?i:t[0].id)(h,T,e))},[h,T]);const I=a(()=>T.find(e=>e.id===m)??null,[T,m]),$=a(()=>((e,t,i,n,a)=>e?i.find(e=>e.id===t)??a[0]??null:n??a[0]??null)(h,f,T,I,C),[h,f,T,I,C]),N=a(()=>(e=>e.map(e=>({class:e.class,scopeKey:e.scopeKey})))(k),[k]),A=()=>{y(m??C[0]?.id??null),g(!0),b(null)},O=e=>{g(!1),y(null),b(e)},E=a(()=>(({defaultPolicies:e,overridePolicies:t,selectedId:i,onSelect:n,onAddOverride:a,modeBadgeColors:o})=>{const l=e.map(e=>({id:e.id,selectedId:i,onSelect:n,header:{label:e.name,badges:[Eg(e)?CE(e.scope):null,{label:zt[e.mode],invertColors:!0,backgroundColor:o.backgroundColor,textColor:o.textColor}]},subDivisions:[{label:e.summary}]})),r=t.map(e=>({id:e.id,selectedId:i,onSelect:n,header:{label:e.name},subDivisions:[{label:e.summary}]}));return[{id:"default-policies",title:Ec,titleCount:l.length,noData:{title:Oc,subTitle:Ac},list:l},{id:"override-policies",title:Pc,titleCount:r.length,addButton:{label:Rc,onClick:a},noData:{title:zc,subTitle:Dc},list:r}]})({defaultPolicies:C,overridePolicies:k,selectedId:h?null:m,onSelect:O,onAddOverride:A,modeBadgeColors:{backgroundColor:e.v2.colors.blue[900],textColor:e.v2.colors.blue[300]}}),[C,k,h,m,e]);return t(cE,{icon:i?.panelIcon,title:Lc,count:T.length,description:i?.panelDescription||Nc,loading:s,sections:E,showDetail:h||!!I,emptyTitle:Xc,children:h?t(Xf,{services:S,transactions:x,existingOverrides:N,initialClass:$?.class,onSubmit:async e=>{if(!n.upsertLearningPolicy)return;const t=((e,t,i)=>t.find(t=>t.class===e.class)??i.find(t=>t.class===e.class&&Eg(t))??Dg(e.class))(e,C,T),i=((e,t)=>e.find(e=>e.class===t.class&&e.scope===t.scope&&e.scopeKey===t.scopeKey)??null)(k,e);if(i)return g(!1),void b(i.id);const a=(e=>zg({scope:e.scope,scopeKey:e.scopeKey,source:{...e.source,class:e.class},displayName:e.name}))({...e,source:t}),o=await n.upsertLearningPolicy(Xg(a));o&&!o.error&&(await c(),g(!1),y(null),b(o.data?Pg(o.data).id:a.id))}}):I?t(Xf,{policy:I,onSave:async e=>{if(!n.upsertLearningPolicy)return;const t=await n.upsertLearningPolicy(Xg(e));t&&!t.error&&await c()},onDelete:Eg(I)?void 0:()=>(async e=>{if(!n.deleteLearningPolicy)return;const t=await n.deleteLearningPolicy(e.class,e.scope,e.scopeKey);t?.error||(await c(),b(null))})(I)},I.id):null})},TE={[fg.Low]:Bc,[fg.Medium]:Fc,[fg.High]:Mc,[fg.Critical]:_c},IE=e=>{let t=fg.Medium,i=Number.POSITIVE_INFINITY;for(const[n,a]of Object.entries(Lg)){const o=Math.abs(a-e);o<i&&(t=n,i=o)}return t},$E=e=>`Triggers at ${TE[e]} risk or higher`,NE=e=>{const t=(e=>{switch(e){case bg.Global:return bg.Global;case bg.Transaction:return bg.Transaction;case bg.Service:default:return bg.Service}})(e.scope),i=IE(e.fireAtScore),n=(e=>{if(!e)return 0;try{const t=JSON.parse(e);if(t&&"object"==typeof t&&!Array.isArray(t))return Object.keys(t).length}catch{}return 0})(e.signalWeights);return{id:e.id,name:e.name,scope:t,scopeKey:e.scopeKey,enabled:e.enabled,summary:t===bg.Global?$E(i):rn(e.fireAtScore,n),fireAtScore:e.fireAtScore,riskLevel:i,signalWeightOverrideCount:n,signalWeights:e.signalWeights??null,enricherLists:e.enricherLists??null}},AE=e=>({id:e.id,name:e.name,enabled:e.enabled,fireAtScore:e.fireAtScore,signalWeights:e.signalWeights,enricherLists:e.enricherLists,scope:e.scope,scopeKey:e.scopeKey}),OE=e=>{const t={invertColors:!0};switch(e){case bg.Global:return{...t,label:Dt,status:ie.Warning};case bg.Service:return{...t,label:Ot,status:ie.Info};case bg.Transaction:return{...t,label:Et,status:ie.Info};default:return t}},EE=(e,t,i)=>{return{id:e.id,selectedId:t,onSelect:i,header:{label:e.name,badges:[OE(e.scope),(n=e.enabled,{label:n?De:ze,status:n?ie.Success:ie.Error,invertColors:!0})]},subDivisions:[{label:e.summary}]};var n},DE=()=>{const e=mE(uE.Detection),{insightsApi:i}=Hh(),{data:n,loading:r,refetch:s}=i.usePolicies(),c=i.useServices(),d=i.useTransactions(),p=Array.isArray(n)?n:[],[u,h]=l(!1),[g,m]=l(null),b=a(()=>p.map(NE),[p]),{defaultPolicies:f,overridePolicies:v,allPolicies:y}=a(()=>(e=>{const t=e.filter(gg),i=e.filter(e=>!gg(e));return{defaultPolicies:t,overridePolicies:i,allPolicies:[...t,...i]}})(b),[b]),S=a(()=>Array.isArray(c.data)?c.data:[],[c.data]),x=a(()=>Array.isArray(d.data)?d.data:[],[d.data]),w=a(()=>v.map(e=>e.scopeKey),[v]);o(()=>{m(e=>((e,t,i)=>e||!t.length?null:i&&t.some(e=>e.id===i)?i:t[0].id)(u,y,e))},[u,y]);const C=a(()=>y.find(e=>e.id===g)??null,[y,g]),k=f[0]??null,T=()=>{h(!0),m(null)},I=e=>{h(!1),m(e)},$=a(()=>(({defaultPolicies:e,overridePolicies:t,selectedId:i,onSelect:n,onAddOverride:a})=>{const o=e.map(e=>EE(e,i,n)),l=t.map(e=>EE(e,i,n));return[{id:"default-policies",title:Ec,titleCount:o.length,noData:{title:Oc,subTitle:Vc},list:o},{id:"override-policies",title:Pc,titleCount:l.length,addButton:{label:un,onClick:a},noData:{title:zc,subTitle:Uc},list:l}]})({defaultPolicies:f,overridePolicies:v,selectedId:u?null:g,onSelect:I,onAddOverride:T}),[f,v,u,g]);return t(cE,{icon:e?.panelIcon,title:Gc,count:y.length,description:e?.panelDescription,loading:r,sections:$,showDetail:u||!!C,emptyTitle:Xc,children:u?t(sy,{services:S,transactions:x,existingScopeKeys:w,onSubmit:async e=>{if(!i.upsertPolicy)return;const t=((e,t,i)=>e.find(e=>e.scope===t&&e.scopeKey===i)??null)(v,e.scope,e.scopeKey);if(t)return h(!1),void m(t.id);const n=((e,t)=>(({scope:e,scopeKey:t,name:i,defaults:n})=>{const a=n?.fireAtScore??Lg[fg.Medium],o=IE(a),l=n?.signalWeightOverrideCount??0;return{id:`${e}:${t}`,name:i,scope:e,scopeKey:t,enabled:!0,summary:rn(a,l),fireAtScore:a,riskLevel:o,signalWeightOverrideCount:l,signalWeights:n?.signalWeights??null,enricherLists:n?.enricherLists??null}})({scope:e.scope,scopeKey:e.scopeKey,name:e.name,defaults:t}))(e,k),a=await i.upsertPolicy({...AE(n),id:null});a?.error||(await s(),h(!1),m(a?.data?NE(a.data).id:n.id))}}):C?t(sy,{policy:C,onSave:async e=>{if(!i.upsertPolicy)return;const t=await i.upsertPolicy(AE(e));t?.error||await s()},onDelete:gg(C)?void 0:()=>(async e=>{if(!i.deletePolicy)return;const t=await i.deletePolicy(e.scope,e.scopeKey);t?.error||(await s(),m(null))})(C)},`${C.id}-${C.name}-${C.enabled}-${C.fireAtScore}-${C.summary}`):null})},zE=()=>{const e=mE(uE.Guardrails),{insightsApi:i}=Hh(),{data:n,loading:r,unsupported:s,refetch:c}=i.useGuardrails(),d=i.useServices(),p=i.useServiceNames(),u=Array.isArray(n)?n:[],[h,g]=l([]),[m,b]=l(!1),[f,v]=l(null),[y,S]=l(""),[x,w]=l(""),C=a(()=>s?h:u,[s,h,u]),k=a(()=>(e=>e.map(_g))(C),[C]),T=a(()=>C.find(e=>e.scopeKey===f)??null,[C,f]),I=a(()=>Array.isArray(d.data)?d.data:[],[d.data]),$=a(()=>Array.isArray(p.data)?p.data:[],[p.data]),{namespace:N,service:A}=((e,t,i,n)=>{const a=n?Mg(n.scopeKey):null;return{namespace:e?t:a?.namespace||"",service:e?i:a?.service||""}})(m,y,x,T),O=i.useServiceProfile({namespace:N||null,service:A||""},{skip:!(m||T)||!A}),E=A?O.data??null:null;o(()=>{v(e=>((e,t,i)=>e||!t.length?null:i&&t.some(e=>e.id===i)?i:t[0].id)(m,k,e))},[m,k]),o(()=>{if(!m||!I.length)return;const e=((e,t,i)=>{if(!e.length)return{namespace:t,service:i};if(!t){const t=e[0]?.namespace||"";return{namespace:t,service:e.find(e=>e.namespace===t)?.service||""}}return i&&e.some(e=>e.namespace===t&&e.service===i)?{namespace:t,service:i}:{namespace:t,service:e.find(e=>e.namespace===t)?.service||""}})(I,y,x);e.namespace!==y&&S(e.namespace),e.service!==x&&w(e.service)},[m,I,y,x]);const D=()=>{b(!0),v(null)},z=e=>{b(!1),v(e)},R=async e=>{if(s)return g(t=>((e,t)=>[...e.filter(e=>e.scopeKey!==t.scopeKey),t])(t,e)),b(!1),void v(e.scopeKey);const t=await(i.upsertGuardrail?.(e));t?.error||(await c(),b(!1),v(e.scopeKey))},P=a(()=>(({guardrails:e,selectedId:t,onSelect:i,onCreate:n})=>{const a=e.map(e=>{const n=e.mode===Ue.Enforce;return{id:e.id,selectedId:t,onSelect:i,header:{label:e.scopeKey,badges:[{label:n?jc:Hc,status:n?ie.Error:ie.Default,useSecondaryTone:n,invertColors:!0}]},subDivisions:e.rules.map(e=>({label:e.label,badges:[{label:e.allowlistCount,status:ie.Unknown},e.isAuto?{label:Wc,tooltip:"Created automatically when this service finished learning. You can edit the allowlist or turn the rule off anytime.",status:ie.Info,invertColors:!0}:null]}))}});return[{id:"guardrails",title:Jc,titleCount:e.length,addButton:{label:Ct,onClick:n},noData:{title:Yc,subTitle:Kc},list:a}]})({guardrails:k,selectedId:m?null:f,onSelect:z,onCreate:D}),[k,m,f]);return t(cE,{icon:e?.panelIcon,title:Zc,count:k.length,description:$c,loading:r,sections:P,showDetail:m||!!T,emptyTitle:qc,children:m?t(of,{services:I,serviceNames:$,profile:E,profileLoading:!!x&&O.loading,namespace:y,service:x,onNamespaceChange:e=>{S(e),w(((e,t)=>e.find(e=>e.namespace===t)?.service||"")(I,e))},onServiceChange:w,onSubmit:R}):T?t(of,{guardrail:T,profile:E,profileLoading:!!A&&O.loading,services:I,serviceNames:$,onSubmit:R,onDelete:async e=>{if(s)return g(t=>((e,t)=>e.filter(e=>e.scopeKey!==t))(t,e)),void v(null);const t=await(i.deleteGuardrail?.(e));t?.error||(await c(),v(null))}},T.scopeKey):null})},RE=f($)`
|
|
2221
|
+
`,wE=({selected:i,onSelect:n})=>{const a=v();return e(yE,{"data-id":"insights-settings-menu",children:[e(SE,{$gap:8,children:[t(ih,{size:16,fill:a.v2.colors.silver[200]}),t(w,{size:C.XS,children:"Settings Menu"})]}),gE.map(a=>e(xE,{"data-id":`settings-menu-category-${a.id}`,children:[t(vE,{icon:a.icon,title:a.title,count:a.items.length}),a.items.map(e=>t(Um,{dataId:`settings-menu-item-${e.id}`,title:e.title,description:e.description,withCarret:!0,isSelected:i===e.id,onClick:()=>n(e.id)},e.id))]},a.id))]})},CE=e=>{const t={invertColors:!0};switch(e){case qt.Global:return{...t,label:Dt,status:ie.Warning};case qt.Service:return{...t,label:Ot,status:ie.Info};case qt.Transaction:return{...t,label:Et,status:ie.Info};default:return t}},kE=()=>{const e=v(),i=mE(uE.Learning),{insightsApi:n}=Jh(),{data:r,loading:s,refetch:c}=n.useLearningPolicies(),d=n.useServices(),p=n.useTransactions(),u=Array.isArray(r)?r:[],[h,g]=l(!1),[m,b]=l(null),[f,y]=l(null),S=a(()=>Array.isArray(d.data)?d.data:[],[d.data]),x=a(()=>Array.isArray(p.data)?p.data:[],[p.data]),w=a(()=>_g(u.map(Mg),x),[u,x]),{defaultPolicies:C,overridePolicies:k,allPolicies:T}=a(()=>(e=>{const t=(e=>{const t=new Map(pg.map((e,t)=>[e,t]));return[...e].sort((e,i)=>(t.get(e.class)??99)-(t.get(i.class)??99))})(e.filter(Pg)),i=e.filter(e=>!Pg(e));return{defaultPolicies:t,overridePolicies:i,allPolicies:[...t,...i]}})(w),[w]);o(()=>{b(e=>((e,t,i)=>e||!t.length?null:i&&t.some(e=>e.id===i)?i:t[0].id)(h,T,e))},[h,T]);const I=a(()=>T.find(e=>e.id===m)??null,[T,m]),$=a(()=>((e,t,i,n,a)=>e?i.find(e=>e.id===t)??a[0]??null:n??a[0]??null)(h,f,T,I,C),[h,f,T,I,C]),N=a(()=>(e=>e.map(e=>({class:e.class,scopeKey:e.scopeKey})))(k),[k]),A=()=>{y(m??C[0]?.id??null),g(!0),b(null)},O=e=>{g(!1),y(null),b(e)},E=a(()=>(({defaultPolicies:e,overridePolicies:t,selectedId:i,onSelect:n,onAddOverride:a,modeBadgeColors:o})=>{const l=e.map(e=>({id:e.id,selectedId:i,onSelect:n,header:{label:e.name,badges:[Pg(e)?CE(e.scope):null,{label:zt[e.mode],invertColors:!0,backgroundColor:o.backgroundColor,textColor:o.textColor}]},subDivisions:[{label:e.summary}]})),r=t.map(e=>({id:e.id,selectedId:i,onSelect:n,header:{label:e.name},subDivisions:[{label:e.summary}]}));return[{id:"default-policies",title:Rc,titleCount:l.length,noData:{title:zc,subTitle:Dc},list:l},{id:"override-policies",title:_c,titleCount:r.length,addButton:{label:Lc,onClick:a},noData:{title:Xc,subTitle:Pc},list:r}]})({defaultPolicies:C,overridePolicies:k,selectedId:h?null:m,onSelect:O,onAddOverride:A,modeBadgeColors:{backgroundColor:e.v2.colors.blue[900],textColor:e.v2.colors.blue[300]}}),[C,k,h,m,e]);return t(cE,{icon:i?.panelIcon,title:Fc,count:T.length,description:i?.panelDescription||Ec,loading:s,sections:E,showDetail:h||!!I,emptyTitle:Mc,children:h?t(Ff,{services:S,transactions:x,existingOverrides:N,initialClass:$?.class,onSubmit:async e=>{if(!n.upsertLearningPolicy)return;const t=((e,t,i)=>t.find(t=>t.class===e.class)??i.find(t=>t.class===e.class&&Pg(t))??Xg(e.class))(e,C,T),i=((e,t)=>e.find(e=>e.class===t.class&&e.scope===t.scope&&e.scopeKey===t.scopeKey)??null)(k,e);if(i)return g(!1),void b(i.id);const a=(e=>Lg({scope:e.scope,scopeKey:e.scopeKey,source:{...e.source,class:e.class},displayName:e.name}))({...e,source:t}),o=await n.upsertLearningPolicy(Fg(a));o&&!o.error&&(await c(),g(!1),y(null),b(o.data?Mg(o.data).id:a.id))}}):I?t(Ff,{policy:I,onSave:async e=>{if(!n.upsertLearningPolicy)return;const t=await n.upsertLearningPolicy(Fg(e));t&&!t.error&&await c()},onDelete:Pg(I)?void 0:()=>(async e=>{if(!n.deleteLearningPolicy)return;const t=await n.deleteLearningPolicy(e.class,e.scope,e.scopeKey);t?.error||(await c(),b(null))})(I)},I.id):null})},TE={[xg.Low]:Gc,[xg.Medium]:Uc,[xg.High]:Vc,[xg.Critical]:Bc},IE=e=>{let t=xg.Medium,i=Number.POSITIVE_INFINITY;for(const[n,a]of Object.entries(Bg)){const o=Math.abs(a-e);o<i&&(t=n,i=o)}return t},$E=e=>`Triggers at ${TE[e]} risk or higher`,NE=e=>{const t=(e=>{switch(e){case Sg.Global:return Sg.Global;case Sg.Transaction:return Sg.Transaction;case Sg.Service:default:return Sg.Service}})(e.scope),i=IE(e.fireAtScore),n=(e=>{if(!e)return 0;try{const t=JSON.parse(e);if(t&&"object"==typeof t&&!Array.isArray(t))return Object.keys(t).length}catch{}return 0})(e.signalWeights);return{id:e.id,name:e.name,scope:t,scopeKey:e.scopeKey,enabled:e.enabled,summary:t===Sg.Global?$E(i):rn(e.fireAtScore,n),fireAtScore:e.fireAtScore,riskLevel:i,signalWeightOverrideCount:n,signalWeights:e.signalWeights??null,enricherLists:e.enricherLists??null}},AE=e=>({id:e.id,name:e.name,enabled:e.enabled,fireAtScore:e.fireAtScore,signalWeights:e.signalWeights,enricherLists:e.enricherLists,scope:e.scope,scopeKey:e.scopeKey}),OE=e=>{const t={invertColors:!0};switch(e){case Sg.Global:return{...t,label:Dt,status:ie.Warning};case Sg.Service:return{...t,label:Ot,status:ie.Info};case Sg.Transaction:return{...t,label:Et,status:ie.Info};default:return t}},EE=(e,t,i)=>{return{id:e.id,selectedId:t,onSelect:i,header:{label:e.name,badges:[OE(e.scope),(n=e.enabled,{label:n?De:ze,status:n?ie.Success:ie.Error,invertColors:!0})]},subDivisions:[{label:e.summary}]};var n},DE=()=>{const e=mE(uE.Detection),{insightsApi:i}=Jh(),{data:n,loading:r,refetch:s}=i.usePolicies(),c=i.useServices(),d=i.useTransactions(),p=Array.isArray(n)?n:[],[u,h]=l(!1),[g,m]=l(null),b=a(()=>p.map(NE),[p]),{defaultPolicies:f,overridePolicies:v,allPolicies:y}=a(()=>(e=>{const t=e.filter(vg),i=e.filter(e=>!vg(e));return{defaultPolicies:t,overridePolicies:i,allPolicies:[...t,...i]}})(b),[b]),S=a(()=>Array.isArray(c.data)?c.data:[],[c.data]),x=a(()=>Array.isArray(d.data)?d.data:[],[d.data]),w=a(()=>v.map(e=>e.scopeKey),[v]);o(()=>{m(e=>((e,t,i)=>e||!t.length?null:i&&t.some(e=>e.id===i)?i:t[0].id)(u,y,e))},[u,y]);const C=a(()=>y.find(e=>e.id===g)??null,[y,g]),k=f[0]??null,T=()=>{h(!0),m(null)},I=e=>{h(!1),m(e)},$=a(()=>(({defaultPolicies:e,overridePolicies:t,selectedId:i,onSelect:n,onAddOverride:a})=>{const o=e.map(e=>EE(e,i,n)),l=t.map(e=>EE(e,i,n));return[{id:"default-policies",title:Rc,titleCount:o.length,noData:{title:zc,subTitle:jc},list:o},{id:"override-policies",title:_c,titleCount:l.length,addButton:{label:un,onClick:a},noData:{title:Xc,subTitle:Hc},list:l}]})({defaultPolicies:f,overridePolicies:v,selectedId:u?null:g,onSelect:I,onAddOverride:T}),[f,v,u,g]);return t(cE,{icon:e?.panelIcon,title:Wc,count:y.length,description:e?.panelDescription,loading:r,sections:$,showDetail:u||!!C,emptyTitle:Mc,children:u?t(uy,{services:S,transactions:x,existingScopeKeys:w,onSubmit:async e=>{if(!i.upsertPolicy)return;const t=((e,t,i)=>e.find(e=>e.scope===t&&e.scopeKey===i)??null)(v,e.scope,e.scopeKey);if(t)return h(!1),void m(t.id);const n=((e,t)=>(({scope:e,scopeKey:t,name:i,defaults:n})=>{const a=n?.fireAtScore??Bg[xg.Medium],o=IE(a),l=n?.signalWeightOverrideCount??0;return{id:`${e}:${t}`,name:i,scope:e,scopeKey:t,enabled:!0,summary:rn(a,l),fireAtScore:a,riskLevel:o,signalWeightOverrideCount:l,signalWeights:n?.signalWeights??null,enricherLists:n?.enricherLists??null}})({scope:e.scope,scopeKey:e.scopeKey,name:e.name,defaults:t}))(e,k),a=await i.upsertPolicy({...AE(n),id:null});a?.error||(await s(),h(!1),m(a?.data?NE(a.data).id:n.id))}}):C?t(uy,{policy:C,onSave:async e=>{if(!i.upsertPolicy)return;const t=await i.upsertPolicy(AE(e));t?.error||await s()},onDelete:vg(C)?void 0:()=>(async e=>{if(!i.deletePolicy)return;const t=await i.deletePolicy(e.scope,e.scopeKey);t?.error||(await s(),m(null))})(C)},`${C.id}-${C.name}-${C.enabled}-${C.fireAtScore}-${C.summary}`):null})},zE=()=>{const e=mE(uE.Guardrails),{insightsApi:i}=Jh(),{data:n,loading:r,unsupported:s,refetch:c}=i.useGuardrails(),d=i.useServices(),p=i.useServiceNames(),u=Array.isArray(n)?n:[],[h,g]=l([]),[m,b]=l(!1),[f,v]=l(null),[y,S]=l(""),[x,w]=l(""),C=a(()=>s?h:u,[s,h,u]),k=a(()=>(e=>e.map(Vg))(C),[C]),T=a(()=>C.find(e=>e.scopeKey===f)??null,[C,f]),I=a(()=>Array.isArray(d.data)?d.data:[],[d.data]),$=a(()=>Array.isArray(p.data)?p.data:[],[p.data]),{namespace:N,service:A}=((e,t,i,n)=>{const a=n?Ug(n.scopeKey):null;return{namespace:e?t:a?.namespace||"",service:e?i:a?.service||""}})(m,y,x,T),O=i.useServiceProfile({namespace:N||null,service:A||""},{skip:!(m||T)||!A}),E=A?O.data??null:null;o(()=>{v(e=>((e,t,i)=>e||!t.length?null:i&&t.some(e=>e.id===i)?i:t[0].id)(m,k,e))},[m,k]),o(()=>{if(!m||!I.length)return;const e=((e,t,i)=>{if(!e.length)return{namespace:t,service:i};if(!t){const t=e[0]?.namespace||"";return{namespace:t,service:e.find(e=>e.namespace===t)?.service||""}}return i&&e.some(e=>e.namespace===t&&e.service===i)?{namespace:t,service:i}:{namespace:t,service:e.find(e=>e.namespace===t)?.service||""}})(I,y,x);e.namespace!==y&&S(e.namespace),e.service!==x&&w(e.service)},[m,I,y,x]);const D=()=>{b(!0),v(null)},z=e=>{b(!1),v(e)},R=async e=>{if(s)return g(t=>((e,t)=>[...e.filter(e=>e.scopeKey!==t.scopeKey),t])(t,e)),b(!1),void v(e.scopeKey);const t=await(i.upsertGuardrail?.(e));t?.error||(await c(),b(!1),v(e.scopeKey))},P=a(()=>(({guardrails:e,selectedId:t,onSelect:i,onCreate:n})=>{const a=e.map(e=>{const n=e.mode===Ue.Enforce;return{id:e.id,selectedId:t,onSelect:i,header:{label:e.scopeKey,badges:[{label:n?Kc:Yc,status:n?ie.Error:ie.Default,useSecondaryTone:n,invertColors:!0}]},subDivisions:e.rules.map(e=>({label:e.label,badges:[{label:e.allowlistCount,status:ie.Unknown},e.isAuto?{label:Jc,tooltip:"Created automatically when this service finished learning. You can edit the allowlist or turn the rule off anytime.",status:ie.Info,invertColors:!0}:null]}))}});return[{id:"guardrails",title:Qc,titleCount:e.length,addButton:{label:Ct,onClick:n},noData:{title:Zc,subTitle:qc},list:a}]})({guardrails:k,selectedId:m?null:f,onSelect:z,onCreate:D}),[k,m,f]);return t(cE,{icon:e?.panelIcon,title:td,count:k.length,description:Oc,loading:r,sections:P,showDetail:m||!!T,emptyTitle:ed,children:m?t(cf,{services:I,serviceNames:$,profile:E,profileLoading:!!x&&O.loading,namespace:y,service:x,onNamespaceChange:e=>{S(e),w(((e,t)=>e.find(e=>e.namespace===t)?.service||"")(I,e))},onServiceChange:w,onSubmit:R}):T?t(cf,{guardrail:T,profile:E,profileLoading:!!A&&O.loading,services:I,serviceNames:$,onSubmit:R,onDelete:async e=>{if(s)return g(t=>((e,t)=>e.filter(e=>e.scopeKey!==t))(t,e)),void v(null);const t=await(i.deleteGuardrail?.(e));t?.error||(await c(),v(null))}},T.scopeKey):null})},RE=f($)`
|
|
2222
2222
|
width: 100%;
|
|
2223
2223
|
min-width: 0;
|
|
2224
2224
|
gap: 12px;
|
|
@@ -2260,7 +2260,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2260
2260
|
width: 100%;
|
|
2261
2261
|
min-width: 0;
|
|
2262
2262
|
overflow-x: auto;
|
|
2263
|
-
`,GE=["B","KB","MB","GB","TB","PB"],jE=e=>{if(null==e||e<=0)return"0 B";const t=Math.min(Math.floor(Math.log(e)/Math.log(1024)),GE.length-1);return`${(e/Math.pow(1024,t)).toFixed(0===t?0:1)} ${GE[t]}`},HE=e=>null==e||!Number.isFinite(e)||e<=0?"0 ms":
|
|
2263
|
+
`,GE=["B","KB","MB","GB","TB","PB"],jE=e=>{if(null==e||e<=0)return"0 B";const t=Math.min(Math.floor(Math.log(e)/Math.log(1024)),GE.length-1);return`${(e/Math.pow(1024,t)).toFixed(0===t?0:1)} ${GE[t]}`},HE=e=>null==e||!Number.isFinite(e)||e<=0?"0 ms":Sc(1e9*e),WE=e=>null!=e&&Number.isFinite(e)?Math.round(e).toLocaleString():"0",KE=e=>`${Math.round(e??0)}%`,YE="—",JE="Storage health is not available.",qE="Memory",ZE="User",QE="Query";var eD,tD,iD;(e=>{e.When="when",e.Duration="duration",e.Memory="memory",e.User="user",e.Query="query"})(eD||(eD={})),(e=>{e.Elapsed="elapsed",e.User="user",e.Memory="memory",e.Query="query"})(tD||(tD={})),(e=>{e.Table="table",e.Rows="rows",e.OnDisk="onDisk",e.ActiveParts="activeParts"})(iD||(iD={}));const nD=[{key:eD.When,label:"When"},{key:eD.Duration,label:"Duration"},{key:eD.Memory,label:qE},{key:eD.User,label:ZE},{key:eD.Query,label:QE,noSort:!0,noFilter:!0}],aD=[{key:tD.Elapsed,label:"Elapsed"},{key:tD.User,label:ZE},{key:tD.Memory,label:qE},{key:tD.Query,label:QE,noSort:!0,noFilter:!0}],oD=[{key:iD.Table,label:"Table"},{key:iD.Rows,label:"Rows (approx)"},{key:iD.OnDisk,label:"On disk"},{key:iD.ActiveParts,label:"Active parts"}],lD=f($)`
|
|
2264
2264
|
flex: 1;
|
|
2265
2265
|
min-height: 0;
|
|
2266
2266
|
width: 100%;
|
|
@@ -2269,14 +2269,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2269
2269
|
padding: 4px 12px 24px;
|
|
2270
2270
|
`,rD=f(lD)`
|
|
2271
2271
|
padding-top: 16px;
|
|
2272
|
-
`,sD=e=>{switch(e){case
|
|
2272
|
+
`,sD=e=>{switch(e){case ad.Critical:return ie.Error;case ad.Warning:return ie.Warning;default:return ie.Success}},cD=({title:e})=>t(BE,{children:t(w,{size:C.XXS,color:k.Secondary,children:e})}),dD=()=>{const i=v(),n=mE(uE.Storage),{formatDurationAgo:o}=qn(),{insightsApi:r}=Jh(),{data:s,loading:c,unsupported:p,error:u}=r.useStorageHealth({pollInterval:15e3}),[h,g]=l("heaviest"),m=d(e=>e?o(e,{style:"short"}):YE,[o]),b=("heaviest"===h?s?.queries.recentHeaviest??[]:s?.queries.recentLatest??[]).slice(0,5),f=a(()=>((e,t)=>e.map((e,i)=>({id:`recent-${i}`,cells:[{key:eD.When,rawValue:t(e.finishedAt)},{key:eD.Duration,rawValue:HE(e.elapsedSeconds)},{key:eD.Memory,rawValue:jE(e.memoryBytes)},{key:eD.User,rawValue:e.user},{key:eD.Query,rawValue:e.query}]})))(b,m),[b,m]),y=a(()=>(s?.queries.items??[]).map((e,t)=>({id:`running-${t}`,cells:[{key:tD.Elapsed,rawValue:HE(e.elapsedSeconds)},{key:tD.User,rawValue:e.user},{key:tD.Memory,rawValue:jE(e.memoryBytes)},{key:tD.Query,rawValue:e.query}]})),[s?.queries.items]),S=a(()=>(s?.tables??[]).map(e=>({id:e.name,cells:[{key:iD.Table,rawValue:e.name},{key:iD.Rows,rawValue:WE(e.rows)},{key:iD.OnDisk,rawValue:jE(e.bytesOnDisk)},{key:iD.ActiveParts,rawValue:WE(e.activeParts)}]})),[s?.tables]),x=s?.disk.usedPercent??0,T=Math.max(0,100-x);return t(cE,{icon:n?.panelIcon,title:n?.title||pE,description:n?.panelDescription,children:(()=>{if(p)return t(oi,{$height:"100%",children:t(w,{size:C.XS,color:k.Secondary,children:JE})});if(c&&!s)return t(rD,{"data-id":"insights-storage-panel-loading",children:t(A,{size:8})});if(!s)return t(oi,{$height:"100%",children:t(Z,{hideIcon:!0,title:JE,subTitle:u?.message})});const n=s.connection.reachable,a=s.disk.totalBytes>0;return e(lD,{"data-id":"insights-storage-panel",children:[e(LE,{title:"Connection",children:[e(_E,{children:[t(FE,{label:"Reachable",value:n?"OK":"No"}),t(FE,{label:"Ping latency",value:n?(b=s.connection.pingLatencyMs,null!=b&&Number.isFinite(b)?`${Math.round(b)} ms`:"—"):YE}),t(FE,{label:"ClickHouse version",value:s.connection.version||YE}),t(FE,{label:"Database",value:s.connection.database||YE})]}),s.connection.error?t(w,{size:C.XXS,color:i.v2.colors.orange[500],children:s.connection.error}):null]}),t(J,{margin:"0",opacity:.45}),e(LE,{title:"Disk",children:[t(_E,{children:t(FE,{label:"Insights data",value:n?jE(s.disk.insightsBytes):YE})}),a?t(UE,{children:e(Mn,{bgTint:"900",richTitle:{title:"Filesystem (ClickHouse volume)",titleSize:C.XS},badges:[{key:"disk-used",label:`${KE(s.disk.usedPercent)} used`,status:sD(s.disk.status)}],children:[t(w,{size:C.XXXS,color:k.Secondary,children:"On shared volumes this includes unrelated host data — use Insights data above for stored size."}),t(id,{variant:nd.CurrentOfMax,gaugeWidth:150,min:0,max:"100%",current:`${Math.round(x)}%`,title:`Total ${jE(s.disk.totalBytes)}`,primaryLabel:`Used ${jE(s.disk.usedBytes)} (${KE(x)})`,secondaryLabel:`Available ${jE(s.disk.availableBytes)} (${KE(T)})`})]})}):t(cD,{title:"Filesystem usage is not available."})]}),t(J,{margin:"0",opacity:.45}),t(LE,{title:"Memory",children:e(_E,{children:[t(FE,{label:"Process RSS",value:n?jE(s.memory.processRssBytes):YE}),t(FE,{label:"Pod (cgroup)",value:n?(r=s.memory.cgroupUsedBytes,d=s.memory.cgroupTotalBytes,d>0?`${jE(r)} / ${jE(d)}`:jE(r)):YE}),t(FE,{label:"Uptime",value:n?HE(s.memory.uptimeSeconds):YE})]})}),t(J,{margin:"0",opacity:.45}),e(LE,{title:"Running queries",children:[e(_E,{children:[t(FE,{label:"Active now",value:n?String(s.queries.active):YE}),t(FE,{label:"Longest running",value:n?HE(s.queries.longestSeconds):YE}),t(FE,{label:"Peak memory (active)",value:n?jE(s.queries.peakMemoryBytes):YE})]}),y.length?t(VE,{children:t(Xa,{variant:La.DataSecondary,fitContent:!0,columns:aD,rows:y})}):t(cD,{title:"No active queries (idle is normal)."})]}),t(J,{margin:"0",opacity:.45}),t(LE,{title:"Recent queries",description:"Last 5 min · max 5",extra:t(F,{"data-id":"insights-storage-recent-sort",size:Zt.S,selected:h,setSelected:g,options:[{value:"heaviest",label:"Heaviest"},{value:"latest",label:"Latest"}]}),children:f.length?t(VE,{children:t(Xa,{variant:La.DataSecondary,fitContent:!0,maxHeight:320,columns:nD,rows:f})}):t(cD,{title:"No finished queries in the last 5 minutes."})}),t(J,{margin:"0",opacity:.45}),t(LE,{title:"Database Tables",children:S.length?t(VE,{children:t(Xa,{variant:La.DataSecondary,fitContent:!0,maxHeight:400,columns:oD,rows:S})}):t(cD,{title:"No table stats."})}),t(J,{margin:"0",opacity:.45}),t(LE,{title:"Write pressure",children:e(_E,{children:[t(FE,{label:"Unfinished mutations",value:n?String(s.writePressure.unfinishedMutations):YE}),t(FE,{label:"Active parts",value:n?String(s.writePressure.activeParts):YE}),t(FE,{label:"Flush interval",value:s.writeback.flushIntervalSeconds?`${s.writeback.flushIntervalSeconds} s`:YE})]})}),t(J,{margin:"0",opacity:.45}),t(LE,{title:"Insights <> DB",children:e(_E,{children:[t(FE,{label:"Last flush",value:(o=s.writeback.everFlushed,l=s.writeback.lastFlushOk,o?l?"OK":"Error":YE)}),t(FE,{label:"Last flush at",value:s.writeback.everFlushed?m(s.writeback.lastFlushAt):YE}),t(FE,{label:"Last flush error",value:s.writeback.lastFlushError||YE})]})})]});var o,l,r,d,b})()})},pD=f(T)`
|
|
2273
2273
|
flex: 1;
|
|
2274
2274
|
min-height: 0;
|
|
2275
2275
|
width: 100%;
|
|
2276
2276
|
align-items: stretch;
|
|
2277
2277
|
gap: 24px;
|
|
2278
2278
|
padding-top: 16px;
|
|
2279
|
-
`,uD=()=>{const[i,n]=l(hE),a=d(()=>{switch(i){case uE.Detection:return t(DE,{});case uE.Guardrails:return t(zE,{});case uE.Learning:return t(kE,{});case uE.System:return t(bE,{});case uE.Storage:return t(dD,{});default:return null}},[i]);return e(pD,{"data-id":"insights-settings-and-configurations",children:[t(wE,{selected:i,onSelect:n}),a()]})},hD=[{label:"Overview",value:
|
|
2279
|
+
`,uD=()=>{const[i,n]=l(hE),a=d(()=>{switch(i){case uE.Detection:return t(DE,{});case uE.Guardrails:return t(zE,{});case uE.Learning:return t(kE,{});case uE.System:return t(bE,{});case uE.Storage:return t(dD,{});default:return null}},[i]);return e(pD,{"data-id":"insights-settings-and-configurations",children:[t(wE,{selected:i,onSelect:n}),a()]})},hD=[{label:"Overview",value:Y$.Overview},{label:"Findings",value:Y$.Findings},{label:"Transactions",value:Y$.Transactions},{label:"Settings & Configurations",value:Y$.SettingsAndConfigurations}],gD=({minSupportedVersion:i})=>{const{isVersionSupported:n,version:a,minSupportedVersion:o}=Vp(i),[r,s]=l(Y$.Overview),c=d(()=>{switch(r){case Y$.Overview:return t(BN,{setSelectedTab:s});case Y$.Findings:return t(KN,{});case Y$.Transactions:return t(qN,{});case Y$.SettingsAndConfigurations:return t(uD,{});default:return null}},[r]);return t(Q$,{children:t(Z$.Consumer,{children:({findingDrawer:i,transactionDrawerId:l})=>t(oc,{children:e(od,{children:[!n&&t(xm,{minSupportedVersion:o,currentVersion:a||""}),e($,{$fullHeight:!0,$gap:12,children:[e($,{$gap:0,children:[t(F,{variant:Ra.Underline,size:Zt.L,options:hD,selected:r,setSelected:s}),t(J,{margin:"0"})]}),c(),i.type===J$.Anomaly&&!!i.id&&t(MA,{type:J$.Anomaly}),i.type===J$.Violation&&!!i.id&&t(MA,{type:J$.Violation}),!!l&&t(HO,{})]})]})})})})},mD=f.div`
|
|
2280
2280
|
display: flex;
|
|
2281
2281
|
align-items: center;
|
|
2282
2282
|
justify-content: space-between;
|
|
@@ -2292,7 +2292,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2292
2292
|
padding: 8px;
|
|
2293
2293
|
border-radius: 8px;
|
|
2294
2294
|
background-color: ${({theme:e})=>e.v2.colors.white[500]+I["004"]};
|
|
2295
|
-
`,fD=({setStep:i,onSave:n,sourcesPayload:o,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>i(2),d=()=>i(3),p=a(()=>Object.values(o||{}).flatMap((i,n)=>i.map((i,a)=>{if(!i.selected)return null;const o=i.kind||kn.Namespace,l=o===kn.Namespace?i.namespace:`${i.namespace} → ${i.name}`;return e(mD,{children:[t(w,{nowrap:!0,children:l}),t(E,{label:o,status:ie.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[o]),u=a(()=>l?.map((i,n)=>{const a=yn(i.option.type).icon;return e(mD,{children:[e(T,{$gap:8,children:[a&&t(bD,{children:t(a,{size:24})}),t(w,{nowrap:!0,children:i.formData.name||i.option.displayName})]}),void 0!==i.testResult&&t(E,{status:i.testResult.succeeded?ie.Success:ie.Error,leftIcon:i.testResult.succeeded?
|
|
2295
|
+
`,fD=({setStep:i,onSave:n,sourcesPayload:o,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>i(2),d=()=>i(3),p=a(()=>Object.values(o||{}).flatMap((i,n)=>i.map((i,a)=>{if(!i.selected)return null;const o=i.kind||kn.Namespace,l=o===kn.Namespace?i.namespace:`${i.namespace} → ${i.name}`;return e(mD,{children:[t(w,{nowrap:!0,children:l}),t(E,{label:o,status:ie.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[o]),u=a(()=>l?.map((i,n)=>{const a=yn(i.option.type).icon;return e(mD,{children:[e(T,{$gap:8,children:[a&&t(bD,{children:t(a,{size:24})}),t(w,{nowrap:!0,children:i.formData.name||i.option.displayName})]}),void 0!==i.testResult&&t(E,{status:i.testResult.succeeded?ie.Success:ie.Error,leftIcon:i.testResult.succeeded?Fu:Mu})]},`destination-${n}`)})||[],[l]);return t(dm,{isOpen:!0,disableAnimation:r,onBack:()=>i(3),onSave:n,header:{icon:Qu,title:ke.SUMMARY,subTitle:ke.REVIEW_SETUP},leftColumn:{width:"50%",header:e(T,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(T,{$gap:8,children:[t(Hu,{size:24}),t(w,{nowrap:!0,children:ke.SELECTED_SOURCES}),t(E,{label:p.length})]}),t(H,{"data-id":"summary-edit-sources",leftIcon:Au,variant:K.Secondary,size:W.S,onClick:c})]}),list:p.length?p:[t(oi,{$height:"100%",children:t(Z,{icon:Hu,title:ke.NO_SOURCES_SELECTED,subTitle:ke.ADD_SOURCE_PROMPT,button:{leftIcon:Tu,label:ke.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(T,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(T,{$gap:8,children:[t(Lu,{size:24}),t(w,{nowrap:!0,children:ke.SELECTED_DESTINATIONS}),t(E,{label:u.length})]}),t(H,{"data-id":"summary-edit-destinations",leftIcon:Au,variant:K.Secondary,size:W.S,onClick:d})]}),list:u.length?u:[t(oi,{"data-id":"summary-no-destinations",$height:"100%",children:t(Z,{icon:Lu,title:ke.NO_DESTINATIONS_SELECTED,subTitle:ke.ADD_DESTINATION_PROMPT,button:{leftIcon:Tu,label:ke.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},vD=f.div`
|
|
2296
2296
|
position: relative;
|
|
2297
2297
|
overflow: hidden;
|
|
2298
2298
|
width: 100vw;
|
|
@@ -2325,12 +2325,12 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2325
2325
|
& * {
|
|
2326
2326
|
text-align: center;
|
|
2327
2327
|
}
|
|
2328
|
-
`,TD=({onStart:i})=>t(ln,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(oi,{$height:"100%",children:e(CD,{children:[e(kD,{children:[t(w,{size:C.L,weight:500,children:ke.GET_STARTED_WITH}),t(
|
|
2328
|
+
`,TD=({onStart:i})=>t(ln,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(oi,{$height:"100%",children:e(CD,{children:[e(kD,{children:[t(w,{size:C.L,weight:500,children:ke.GET_STARTED_WITH}),t(bm,{size:260}),t(w,{size:C.S,weight:400,children:ke.GET_STARTED_DESCRIPTION})]}),t(H,{"data-id":"onboarding-get-started",label:zn.GET_STARTED,rightIcon:Iu,size:W.L,onClick:i})]})})}),ID=[{step:1,label:ke.INSTALLATION,forceDoneBadge:!0},{step:2,label:ke.SOURCES_SETUP},{step:3,label:ke.DESTINATIONS_SETUP},{step:4,label:ke.SUMMARY}],$D=f.div`
|
|
2329
2329
|
display: flex;
|
|
2330
2330
|
flex-direction: column;
|
|
2331
2331
|
gap: 32px;
|
|
2332
2332
|
padding: 64px;
|
|
2333
|
-
`,ND=({pagePaddingXAxis:i,pagePaddingYAxis:n,onDone:a})=>{const{setDrawerType:o}=da(),{sourcesApi:r,destinationsApi:s}=
|
|
2333
|
+
`,ND=({pagePaddingXAxis:i,pagePaddingYAxis:n,onDone:a})=>{const{setDrawerType:o}=da(),{sourcesApi:r,destinationsApi:s}=Jh(),[c,d]=l(1),[p,u]=l(!1),[h,g]=l(null),[m,b]=l(null),f=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(wD,{paddingXAxis:i,paddingYAxis:n,children:[e($D,{children:[t(bm,{useInline:!0}),t(ld,{currentStep:c,data:ID,gap:32})]}),t(Eg,{initialInputs:h,children:e(Gg,{children:[1===c&&t(TD,{onStart:f}),2===c&&t(Fy,{disableAnimation:!0,onBack:e=>{g(e),v()},onNext:e=>{g(e),f()}}),3===c&&t(Cy,{disableAnimation:!0,onBack:e=>{b(e),v()},onNext:e=>{b(e),f()},initialInputs:m}),4===c&&t(fD,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(r.persistV2(h)),m&&e.push(...m.map(e=>s.create(e.formData)));const t=await Promise.allSettled(e),i=[];for(const e of t)"rejected"===e.status?i.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&i.push(e.value.error);if(i.length)return{error:i.join("\n")};o(Pr.OnboardingDone),a()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:m})]})})]})},AD=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),OD=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),ED=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},DD=f.div`
|
|
2334
2334
|
position: relative;
|
|
2335
2335
|
display: inline-flex;
|
|
2336
2336
|
`,zD=f.button`
|
|
@@ -2377,7 +2377,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2377
2377
|
align-items: center;
|
|
2378
2378
|
gap: 8px;
|
|
2379
2379
|
margin-left: auto;
|
|
2380
|
-
`,_D=()=>{const i=v(),{platformType:n,isK8s:r,isConnector:s}=
|
|
2380
|
+
`,_D=()=>{const i=v(),{platformType:n,isK8s:r,isConnector:s}=Vp(),{sourcesApi:c,namespacesApi:d}=Jh(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:g}=Te(),{getItemSS:m,setItemSS:b,removeItemSS:f}=ud(),{statuses:y,namespaces:S,regions:x,kinds:k,monitors:T,languages:I,onlyErrors:$,podsAgentInjectionStatus:N,enabledStatuses:A,setAll:O,clearFilters:D,getEmptyState:z}=rd(),R=a(()=>sd(u,g),[u,g]);o(()=>{const e=m(cd.OVERVIEW_FILTERS,z());O(e)},[]);const[P,X]=l({statuses:y,namespaces:S,regions:x,kinds:k,monitors:T,languages:I,onlyErrors:$,podsAgentInjectionStatus:N,enabledStatuses:A}),[_,M]=l(ED(P)),[F,B]=l(!1),V=p(n);o(()=>{if(!F){const e={statuses:y,namespaces:S,regions:x,kinds:k,monitors:T,languages:I,onlyErrors:$,podsAgentInjectionStatus:N,enabledStatuses:A};X(e),M(ED(e))}},[F,y,S,x,k,T,I,$,N,A]),o(()=>{V.current!==n&&(V.current=n,f(cd.OVERVIEW_FILTERS),D(),X(z()),M(0),B(!1))},[n]);const U=p(null);Sa(U,()=>B(!1)),Or({key:"Escape",active:F},()=>B(!1));const G=a(()=>{const e=new Set,t=[];return h.forEach(({name:i})=>{e.has(i)||(e.add(i),t.push({id:i,label:i,withCheckbox:!0}))}),t},[h]),j=a(()=>{const e=new Set,t=[];return R.forEach(({id:i})=>{const{kind:n}=i;e.has(n)||(e.add(n),t.push({id:n,label:fa(n),withCheckbox:!0}))}),t},[R]),Y=a(()=>{const e=new Set,t=[];return R.forEach(({id:i})=>{const n=i.region?.trim();n&&!e.has(n)&&(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),J=a(()=>{const e=new Set,t=[];return R.forEach(({runtimeInfo:i})=>{i?.detectedLanguages?.forEach(i=>{e.has(i)||(e.add(i),t.push({id:i,label:dd[i]||i,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[R]),q=a(()=>pd.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),Z=a(()=>{const e=new Set,t=[];return R.forEach(({instrumentationReport:i})=>{const n=i?.state||i?.progressStage;n&&!e.has(n)&&(e.add(n),t.push({id:n,label:OD(n),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[R]),Q=a(()=>{const e=new Set,t=[];return R.forEach(({podsAgentInjectionStatus:i})=>{const{reasonEnum:n,message:a}=i||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Pn(n),withCheckbox:!0})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[R]),ee=a(()=>[{id:"enabled",label:ke.ENABLED,withCheckbox:!0},{id:"disabled",label:ke.DISABLED,withCheckbox:!0}],[]),te=(e,t,i)=>{const n=t.filter(e=>i.includes(e.id));X(t=>{return{...t,[e]:(i=n,i.map(({id:e,label:t})=>({id:e,label:t})))};var i})},ne=F?Uu:Gu,ae=a(()=>AD(P.languages),[P.languages]);return e(DD,{ref:U,children:[e(zD,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>B(e=>!e),children:[t(Fh,{size:16,fill:i.v2.colors.white[500]}),t(w,{size:C.XS,weight:500,nowrap:!0,children:"Filters"}),_>0&&t(E,{label:_,status:ie.Unknown,textSize:C.XXXS}),t(ne,{size:16,fill:i.v2.colors.silver[200]})]}),F&&e(RD,{children:[e(PD,{children:[r&&t(Me,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:AD(P.namespaces),setValues:e=>te("namespaces",G,e)}),s&&t(Me,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!Y.length,options:Y,values:AD(P.regions),setValues:e=>te("regions",Y,e)}),t(Me,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:AD(P.kinds),setValues:e=>te("kinds",j,e)}),t(Me,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!J.length,options:J,values:ae,setValues:e=>te("languages",J,e)}),t(Me,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!q.length,options:q,values:AD(P.monitors),setValues:e=>te("monitors",q,e)}),t(Me,r?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!Q.length,options:Q,values:AD(P.podsAgentInjectionStatus),setValues:e=>te("podsAgentInjectionStatus",Q,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!Z.length,options:Z,values:AD(P.statuses),setValues:e=>te("statuses",Z,e)}),t(Me,{label:"Enabled Status",placeholder:"All",withMultiSelect:!0,options:ee,values:AD(P.enabledStatuses),setValues:e=>te("enabledStatuses",ee,e)}),t(L,{label:"Show only sources with errors",size:Vi.L,value:!!P.onlyErrors,onChange:e=>X(t=>({...t,onlyErrors:e}))})]}),e(XD,{children:[t(H,{"data-id":"filters-reset",size:W.S,variant:K.Text,label:"Reset",onClick:()=>{f(cd.OVERVIEW_FILTERS),D(),X(z()),M(0),B(!1)},textColor:i.v2.colors.red[500]}),e(LD,{children:[t(H,{"data-id":"filters-cancel",size:W.S,variant:K.Secondary,label:"Cancel",onClick:()=>B(!1)}),t(H,{"data-id":"filters-apply",size:W.S,variant:K.Primary,label:"Apply",onClick:()=>{b(cd.OVERVIEW_FILTERS,P),O(P),M(ED(P)),B(!1)}})]})]})]})]})},MD=f.div`
|
|
2381
2381
|
position: relative;
|
|
2382
2382
|
display: flex;
|
|
2383
2383
|
align-items: center;
|
|
@@ -2397,7 +2397,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2397
2397
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
2398
2398
|
border-radius: 32px;
|
|
2399
2399
|
transition: width 0.3s;
|
|
2400
|
-
`,BD=({entityType:i,badge:n,badgeTooltip:a,isLoading:o,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=da();return e(MD,{children:[e(T,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(x,{size:Xe.S,partiallyChecked:r,value:!!s,onChange:c}),t(w,{size:C.S,nowrap:!0,children:`${Pn(i)}s`}),t(E,{label:n,tooltip:a,status:ie.Unknown,textSize:C.XXXS})]}),e(T,{children:[t(bn,{"data-id":`add-${i}`,icon:
|
|
2400
|
+
`,BD=({entityType:i,badge:n,badgeTooltip:a,isLoading:o,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=da();return e(MD,{children:[e(T,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(x,{size:Xe.S,partiallyChecked:r,value:!!s,onChange:c}),t(w,{size:C.S,nowrap:!0,children:`${Pn(i)}s`}),t(E,{label:n,tooltip:a,status:ie.Unknown,textSize:C.XXXS})]}),e(T,{children:[t(bn,{"data-id":`add-${i}`,icon:Tu,onClick:()=>p(hd(i))}),t(bn,{"data-id":`refresh-${i}`,icon:th,onClick:l,disabled:o})]}),"number"==typeof d&&t(FD,{$percent:d})]})},VD=f($)`
|
|
2401
2401
|
align-items: center !important;
|
|
2402
2402
|
justify-content: center !important;
|
|
2403
2403
|
align-self: stretch;
|
|
@@ -2412,7 +2412,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2412
2412
|
&:hover {
|
|
2413
2413
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
2414
2414
|
}
|
|
2415
|
-
`,UD=({entityType:i,description:n})=>{const{setDrawerType:a}=da();return e(VD,{onClick:()=>a(
|
|
2415
|
+
`,UD=({entityType:i,description:n})=>{const{setDrawerType:a}=da();return e(VD,{onClick:()=>a(hd(i)),children:[e(T,{$gap:4,children:[t(Tu,{size:16}),t(w,{size:C.S,children:`Add ${Pn(i)}`})]}),t(w,{size:C.XXS,align:"center",children:n})]})},GD=f.div`
|
|
2416
2416
|
display: flex;
|
|
2417
2417
|
align-items: center;
|
|
2418
2418
|
gap: 12px;
|
|
@@ -2430,7 +2430,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2430
2430
|
`,jD=f(T)`
|
|
2431
2431
|
flex: 1;
|
|
2432
2432
|
min-width: 0;
|
|
2433
|
-
`,HD=({entityId:i,entityType:n,title:o,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:g})=>{const m=v(),b=n===kn.Source,f="boolean"==typeof h,y=r||f&&!h,{setDrawerType:S,setDrawerEntityId:w}=da(),{selectedSources:k,setSelectedSources:I}=
|
|
2433
|
+
`,HD=({entityId:i,entityType:n,title:o,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:g})=>{const m=v(),b=n===kn.Source,f="boolean"==typeof h,y=r||f&&!h,{setDrawerType:S,setDrawerEntityId:w}=da(),{selectedSources:k,setSelectedSources:I}=gd(),$=g,N=b?$.id.namespace:"",A=a(()=>{if(!b)return-1;const e=k[N];return e?.length?e.findIndex(e=>e.id.name===$.id.name&&e.id.kind===$.id.kind&&(e.id.region??"")===($.id.region??"")):-1},[b,k,N,$.id]),O=f&&!h?$a(ie.Info,m):l?$a(l,m):void 0,D=b&&"object"==typeof i?`${i.namespace}-${i.name}-${i.kind}${i.region?`-${i.region}`:""}`:i;return e(GD,{"data-id":D,$faded:y,onClick:()=>{S(ma(n)),w(i)},children:[b&&t(x,{size:Xe.S,value:-1!==A,onChange:()=>{const e={...k};e[N]||(e[N]=[]),-1===A?e[N].push($):e[N].splice(A,1),I(e)}}),t(ga,{icons:p,icon:d,iconSrc:u}),e(jD,{$gap:4,children:[t(Q,{size:C.XS,nowrap:!0,children:o}),t(T,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:(c||f&&!h)&&t(ce,{text:s||(f&&!h?ke.DISABLED:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."),children:t(E,{label:c||ke.DISABLED,status:l&&[ie.Error,ie.Warning].includes(l)?l:ie.Unknown,leftIcon:O,textSize:C.XXXS})})})]})]})};function WD(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===ie.Loading)?e:{...e,workloadOdigosHealthStatus:{status:ta.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function KD(e){const t=Object.values(e.conditions??{}).filter(Boolean),i=t.filter(({status:e})=>e!==ie.Loading);return i?.length===t?.length?e:{...e,conditions:i?.length?i.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const YD=f.div`
|
|
2434
2434
|
position: absolute;
|
|
2435
2435
|
top: 0;
|
|
2436
2436
|
left: 0;
|
|
@@ -2477,7 +2477,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2477
2477
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
2478
2478
|
height: ${({$height:e})=>e}px;
|
|
2479
2479
|
overflow: hidden;
|
|
2480
|
-
`,az=({entityType:i,entities:n,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=i===kn.Source,g=n.length!==r,m=In(e=>h?e.progress[An.Instrumenting]?.percentage:void 0),b=In(e=>h?e.progress[An.Uninstrumenting]?.percentage:void 0),f=!h||void 0===m&&void 0===b?void 0:m||b||0,{selectedSources:v,setSelectedSources:y}=
|
|
2480
|
+
`,az=({entityType:i,entities:n,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=i===kn.Source,g=n.length!==r,m=In(e=>h?e.progress[An.Instrumenting]?.percentage:void 0),b=In(e=>h?e.progress[An.Uninstrumenting]?.percentage:void 0),f=!h||void 0===m&&void 0===b?void 0:m||b||0,{selectedSources:v,setSelectedSources:y}=gd(),S=a(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),x=a(()=>{if(!s)return;const e=new Map,t=i===kn.Source?s.sources:i===kn.Destination?s.destinations:void 0;if(t)for(const i of t)e.set(md(i),i.throughput);return e},[s,i]),w=a(()=>n.map(e=>((e,t,i)=>{const n=Fn(e);if(!n)return null;const a=t===kn.Source;let o,l,r=!1,s=e;if(a){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status,i=!1===e.markedForInstrumentation?.markedForInstrumentation;switch(t){case ta.Failure:return{status:ie.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case ta.Notice:return{status:ie.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case ta.Pending:case ta.Waiting:return{status:void 0,faded:!1,displaySource:WD(e)};case ta.Unsupported:case ta.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return i?{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e}:{status:void 0,faded:!1,displaySource:KD(e)}}})(e);o=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const i=t===kn.Action?bd(e):e.conditions,{priorotizedStatus:n,hasDisableds:a}=fd(i);o=n,r=a}const c=vd(e,t,{extended:a,prioritizeDisplayName:!a});let d,p,u,h,g;switch(t){case kn.Source:{d=ha(e),p=Sd(kn.Source);const t=i?.get(yd(n));h=va(t);const a=e.markedForInstrumentation?.markedForInstrumentation;"boolean"==typeof a&&(g=a);break}case kn.Destination:{const t=yn(e.destinationType.type);p=t.icon,u=t.iconSrc;const a=i?.get(yd(n));h=va(a),g=!e.disabled;break}case kn.Action:p=Un(e.type),g=!e.disabled;break;case kn.InstrumentationRule:p=Jn(e.type),g=!e.disabled}return{key:yd(n),entityId:n,namespace:a?e.id.namespace:void 0,raw:s,itemProps:{entityId:n,entityType:t,title:c,status:o,faded:r,tooltip:l,throughput:h,icon:p,icons:d,iconSrc:u,isActive:g,raw:s}}})(e,i,x)).filter(Boolean),[n,i,x]),[C,k]=l(""),{elements:T,indexToNamespace:I,multipleNs:$,dividerCount:N}=a(()=>{const e=[],i=[],n=new Set(w.map(e=>e.namespace).filter(Boolean)).size>1;n&&(i.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,o="";for(const n of w)h&&n.namespace&&n.namespace!==o&&(""!==o&&(i.push(n.namespace),e.push(t(QD,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),o=n.namespace),i.push(n.namespace||""),e.push(t(HD,{...n.itemProps},n.key));return{elements:e,indexToNamespace:i,multipleNs:n,dividerCount:a}},[w,h]);o(()=>{if(h&&I.length&&!C){const e=I.find(Boolean);e&&k(e)}},[h,I]);const O=d(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==C&&k(t)},[I,C]),E=58*w.length+($?28:0)+32*N,D=Math.max(0,p-52-16),z=Math.min(D,E)+8,R="number"==typeof f?`${f}%`:g?`${n.length}/${r}`:r;return e(tz,{children:[t(BD,{entityType:i,badge:R,badgeTooltip:g?ke.FILTERED_COUNT_TOOLTIP:void 0,isLoading:c,refetch:u,partiallySelected:S>0&&n?.length!==S,allSelected:S>0&&n?.length===S,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:i}=t.id;e[i]?e[i].push(t):e[i]=[t]}),y(e)}else y({})}:void 0,progressPercent:f}),t(iz,{children:n.length?e(nz,{$height:z,children:[$&&C&&t(ZD,{namespace:C}),t(ca,{gap:4,elements:T,onTopIndexChange:$?O:void 0})]}):c?t(A,{size:3}):t(UD,{entityType:i,description:ez[i]??ke.TO_COLLECT_OTEL_DATA})})]})},oz=f.div`
|
|
2481
2481
|
width: 100%;
|
|
2482
2482
|
flex: 1;
|
|
2483
2483
|
min-height: 0;
|
|
@@ -2485,7 +2485,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2485
2485
|
display: flex;
|
|
2486
2486
|
align-items: stretch;
|
|
2487
2487
|
gap: 16px;
|
|
2488
|
-
`,lz={sources:[],destinations:[]},rz=()=>{const i=
|
|
2488
|
+
`,lz={sources:[],destinations:[]},rz=()=>{const i=rd(),{selectedStreamName:n}=Te(),{containerRef:o,containerHeight:l}=xd(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p,capabilities:u}=Jh(),{items:h,loading:g}=r.useSources(),{items:m,loading:b}=s.useDestinations(),{items:f,loading:v}=c.useActions(),{items:y,loading:S}=d.useRules(),x=da(e=>e.drawerType),{data:w}=p.useMetrics({skip:!h.length||!m.length||!!x,pollInterval:1e4,fetchPolicy:"network-only"}),C=w?.getOverviewMetrics??lz,k=a(()=>sd(h,n),[h,n]),T=a(()=>Wn(m,n),[m,n]),I=a(()=>wd(k,i),[k,i]),$=a(()=>Cd(T,i),[T,i]),N=a(()=>kd(f,i),[f,i]);return e(oz,{ref:o,children:[u.canManageInstrumentationRules&&t(az,{entityType:kn.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:S,maxHeight:l,refetch:d.fetchAll}),t(az,{entityType:kn.Source,entities:I,unfilteredCount:k.length,metrics:C,loading:g,maxHeight:l,refetch:r.fetchAll}),u.canManageActions&&t(az,{entityType:kn.Action,entities:N,unfilteredCount:f.length,loading:v,maxHeight:l,refetch:c.fetchAll}),t(az,{entityType:kn.Destination,entities:$,unfilteredCount:T.length,metrics:C,loading:b,maxHeight:l,refetch:s.fetchAll})]})},sz="40vw",cz=f.div`
|
|
2489
2489
|
position: relative;
|
|
2490
2490
|
width: ${sz};
|
|
2491
2491
|
`,dz=f.div`
|
|
@@ -2525,7 +2525,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2525
2525
|
}
|
|
2526
2526
|
`,mz=f.div`
|
|
2527
2527
|
padding: 16px 8px;
|
|
2528
|
-
`,bz=({preventPopup:i=!1})=>{const n=v(),{selectedStreamName:o}=Te(),{searchText:s,setSearchText:c}=
|
|
2528
|
+
`,bz=({preventPopup:i=!1})=>{const n=v(),{selectedStreamName:o}=Te(),{searchText:s,setSearchText:c}=rd(),{setDrawerType:d,setDrawerEntityId:u}=da(),{sourcesApi:h,destinationsApi:g,actionsApi:m,instrumentationRulesApi:b,capabilities:f}=Jh(),y=h.useSources().items,S=g.useDestinations().items,x=m.useActions().items,T=b.useRules().items,I=p(null),[$,N]=l(!1),[A,O]=l("all"),E=!i&&(!!s||$),D=()=>{c(""),N(!1),O("all")};Sa(I,()=>D()),Or({key:"Escape",active:E},D);const{categories:z,searchResults:R}=a(()=>(({instrumentationRules:e,sources:t,actions:i,destinations:n,searchText:a,selectedCategory:o,includeActions:l=!0,includeInstrumentationRules:r=!0})=>{const s=r?a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e:[],c=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,d=l?a?i.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i:[],p=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,u=[{category:kn.Source,label:"Sources",count:c.length,entities:[]},...l?[{category:kn.Action,label:"Actions",count:d.length,entities:[]}]:[],{category:kn.Destination,label:"Destinations",count:p.length,entities:[]},...r?[{category:kn.InstrumentationRule,label:"Instrumentation Rules",count:s.length,entities:[]}]:[]];u.unshift({category:"all",label:"All",count:s.length+c.length+d.length+p.length,entities:[]});const h=u.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(o)).map(e=>({...e,entities:e.category===kn.InstrumentationRule?s:e.category===kn.Source?c:e.category===kn.Action?d:e.category===kn.Destination?p:[]}));return{categories:u,searchResults:h}})({instrumentationRules:T,sources:sd(y,o),actions:x,destinations:Wn(S,o),searchText:s,selectedCategory:A,includeActions:f.canManageActions,includeInstrumentationRules:f.canManageInstrumentationRules}),[T,y,x,S,o,s,A,f.canManageActions,f.canManageInstrumentationRules]),P=a(()=>z.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:i})=>({value:e,label:i?`${t} (${i})`:t})),[z]),X=R.some(({entities:e})=>e.length>0);return e(cz,{ref:I,children:[t(sa,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>N(!0),width:sz}),E&&e(dz,{children:[P.length>1&&t(pz,{children:t(F,{options:P,selected:A,setSelected:O})}),X?t(uz,{children:R.map(({category:i,label:a,entities:o},l)=>{if(!o.length)return null;const s=Sd(i);return e(r,{children:[t(hz,{children:t(w,{size:C.XXS,color:k.Secondary,children:a})}),o.map((a,o)=>e(gz,{onClick:()=>{const e=Fn(a);e&&(d(ma(i)),u(e),D())},children:[s&&t(s,{size:16,fill:n.v2.colors.white[500]}),t(w,{size:C.XS,nowrap:!0,children:vd(a,i,{extended:!0})})]},`entity-${l}-${o}`))]},`category-list-${i}`)})}):t(mz,{children:t(Z,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},fz=({onRedirectToSampling:n})=>{const{sourcesApi:o}=Jh(),{items:l}=o.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=da(),p=()=>{c(null),d(null)},u=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(i,{children:[t(jI,{}),r===Pr.AddSource&&t(Eg,{children:t(Fy,{onClose:p,withOverlay:!0})}),r===Pr.AddDestination&&t(Gg,{children:t(Cy,{onClose:p,withOverlay:!0})}),r===Pr.AddInstrumentationRule&&t(jg,{sourceOptions:u,namespaceOptions:h,children:t(ky,{onClose:p,withOverlay:!0})}),r===Pr.AddAction&&t(Hg,{sourceOptions:u,namespaceOptions:h,children:t(hy,{onClose:p,withOverlay:!0})}),r===Pr.EditSource&&t(Wg,{children:t(Nk,{onClose:p,sourceId:s,onRedirectToSampling:n})}),r===Pr.EditDestination&&t(Gg,{children:t(Vx,{onClose:p,destinationId:s})}),r===Pr.EditInstrumentationRule&&t(jg,{sourceOptions:u,namespaceOptions:h,children:t(Gx,{onClose:p,ruleId:s})}),r===Pr.EditAction&&t(Hg,{sourceOptions:u,namespaceOptions:h,children:t(Mx,{onClose:p,actionId:s})})]})},vz=f.div`
|
|
2529
2529
|
position: relative;
|
|
2530
2530
|
display: inline-flex;
|
|
2531
2531
|
`,yz=f.div`
|
|
@@ -2591,7 +2591,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2591
2591
|
display: flex;
|
|
2592
2592
|
padding-top: 4px;
|
|
2593
2593
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
2594
|
-
`,$z=()=>{const n=v(),{isK8s:r}=
|
|
2594
|
+
`,$z=()=>{const n=v(),{isK8s:r}=Vp(),{clearStore:s}=Td(),{dataStreamsApi:c}=Jh();c.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=Te(),g=p(null),[m,b]=l(!1),[f,y]=l(""),[S,x]=l(""),[T,I]=l(!1),[$,N]=l(!1),[A,O]=l(!1),[D,z]=l(""),[R,P]=l(!1);Sa(g,()=>b(!1)),o(()=>{m||y("")},[m]);const X=a(()=>{if(!f)return d;const e=f.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,f]),L=m?Uu:Gu;return r?e(i,{children:[e(vz,{ref:g,children:[e(yz,{"data-id":"data-stream-select",$isOpen:m,onClick:()=>b(e=>!e),children:[t(Bh,{size:24}),t(w,{size:C.S,weight:500,nowrap:!0,children:(_=u,`Data Stream: ${_}`)}),t(E,{label:d.length,status:ie.Unknown,textSize:C.XXXS}),t(L,{size:20,fill:n.v2.colors.silver[200]})]}),m&&e(Sz,{children:[t(xz,{children:t(sa,{value:f,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(wz,{children:0===X.length?t(Cz,{children:t(w,{size:C.XS,color:k.Secondary,children:"No streams match"})}):X.map(({name:i})=>{const n=i===Id;return e(Cz,{"data-id":`stream-row-${i}`,$selected:i===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),b(!1)})(i),children:[t(kz,{children:t(w,{size:C.XS,nowrap:!0,children:i})}),e(Tz,{children:[t(bn,{"data-id":`stream-edit-${i}`,icon:Au,size:fn.XS,onClick:e=>{e.stopPropagation(),b(!1),x(i),I(!0)}}),!n&&t(bn,{"data-id":`stream-delete-${i}`,icon:ku,size:fn.XS,onClick:e=>{e.stopPropagation(),b(!1),z(i),P(!0)}})]})]},`stream-${i}`)})}),t(Iz,{children:t(H,{"data-id":"add-stream-trigger",variant:K.Secondary,size:W.S,leftIcon:Tu,label:`${zn.NEW} ${ke.STREAM_NAME}`,fullWidth:!0,onClick:()=>{b(!1),s(),O(!0),N(!0)}})})]})]}),A&&t(Kg,{defaultExcludeName:u,children:t(BI,{isOpen:$,onClose:()=>N(!1),onCloseEnd:()=>O(!1)})}),S&&t(Kg,{children:t(VI,{isOpen:T,dataStreamName:S,onClose:()=>I(!1),onCloseEnd:()=>x("")})}),t(hm,{target:`${ke.STREAM_NAME.toLowerCase()} "${D}"`,isOpen:R,onClose:()=>P(!1),onApprove:async()=>{D&&await c.remove(D)}})]}):null;var _},Nz=f($)`
|
|
2595
2595
|
width: 100%;
|
|
2596
2596
|
max-height: 320px;
|
|
2597
2597
|
overflow-y: auto;
|
|
@@ -2603,7 +2603,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2603
2603
|
padding: 8px 12px;
|
|
2604
2604
|
border-radius: 8px;
|
|
2605
2605
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
2606
|
-
`,Oz=()=>{const n=v(),{selectedStreamName:r}=Te(),{selectedSources:s,setSelectedSources:c}=
|
|
2606
|
+
`,Oz=()=>{const n=v(),{selectedStreamName:r}=Te(),{selectedSources:s,setSelectedSources:c}=gd(),{sourcesApi:p}=Jh(),[u,h]=l(!1),[g,m]=l(!1),[b,f]=l(!1),[y,S]=l(!1),{toInstrument:x,toUninstrument:T,totalSelected:I}=a(()=>{const e=[],t=[];return Object.values(s).forEach(i=>{i.forEach(i=>{(e=>!1===e.markedForInstrumentation?.markedForInstrumentation)(i)?e.push(i):t.push(i)})}),{toInstrument:e,toUninstrument:t,totalSelected:e.length+t.length}},[s]),$=d(()=>{c({})},[c]),N=d(()=>h(!1),[]),A=d(()=>m(!1),[]),O=d(()=>f(!1),[]),D=d(()=>S(!1),[]);o(()=>{$()},[r,$]);const z=d((e,t)=>{if(!e.length)return;const i=new Map;e.forEach(e=>{const t=e.id.namespace,n=i.get(t)??[];n.push(e),i.set(t,n)}),p.persistV2(Object.fromEntries([...i.entries()].map(([e,i])=>[e,i.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,...e.region?{region:e.region}:{},selected:t,currentStreamName:r}))])))},[p,r]),R=d(()=>{p.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==ba.StaticPod).map(pa)),$()},[p,s,$]),P=d(()=>{z(x,!0),$()},[z,x,$]),X=d(()=>{z(T,!1),$()},[z,T,$]),L=d(()=>{z(x,!0),z(T,!1),$()},[z,x,T,$]),_=x.length>0,M=T.length>0,F=_&&M,B=a(()=>{const e=[{id:"multi-source-deselect",type:St.Button,buttonProps:{variant:K.Text,size:W.S,label:"Deselect",onClick:$}},{id:"multi-source-restart",type:St.Button,buttonProps:{variant:K.Secondary,size:W.S,label:"Restart",leftIcon:ch,onClick:()=>h(!0)}}];return F?e.push({id:"multi-source-apply",type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:"Apply Changes",leftIcon:Tu,onClick:()=>S(!0)}}):_?e.push({id:"multi-source-instrument",type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:"Instrument",leftIcon:Tu,onClick:()=>f(!0)}}):M&&e.push({id:"multi-source-uninstrument",type:St.Button,buttonProps:{variant:K.Primary,size:W.S,label:"Uninstrument",leftIcon:ku,onClick:()=>m(!0)}}),e},[$,F,_,M]),V=e=>vd(e,kn.Source,{extended:!0})||e.id.name;return e(i,{children:[t(vt,{isOpen:I>0,richTitle:{icon:Hu,title:"Selected sources",badge:{label:I}},actions:B}),t(Ce,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:N,denyButton:{label:"Go Back",variant:K.Secondary,onClick:N},approveButton:{label:"Confirm",variant:K.Primary,onClick:()=>{R(),N()}}}),t(hm,{isOpen:b,action:"instrument",target:`${x.length} source${1===x.length?"":"s"}`,onClose:O,onDeny:O,onApprove:P}),t(hm,{isOpen:g,action:"uninstrument",target:`${T.length} source${1===T.length?"":"s"}`,onClose:A,onDeny:A,onApprove:X}),t(Ce,{isOpen:y,title:"Modify selected sources",description:"These changes are applied immediately. Disabled sources are re-instrumented; enabled sources are uninstrumented.",onClose:D,denyButton:{variant:K.Secondary,label:"Cancel",onClick:D},approveButton:{variant:K.Primary,label:"Confirm",onClick:()=>{L(),D()}},children:e(Nz,{children:[x.map(i=>e(Az,{children:[t(E,{leftIcon:Tu,status:ie.Success,useSecondaryTone:!0,textColor:n.v2.colors.white[500],textSize:C.XXS}),t(w,{size:C.XS,color:k.Primary,children:V(i)})]},`instrument-${i.id.namespace}-${i.id.kind}-${i.id.name}-${i.id.region??""}`)),T.map(i=>e(Az,{children:[t(E,{leftIcon:ph,status:ie.Error,useSecondaryTone:!0,textColor:n.v2.colors.white[500],textSize:C.XXS}),t(w,{size:C.XS,color:k.Primary,children:V(i)})]},`uninstrument-${i.id.namespace}-${i.id.kind}-${i.id.name}-${i.id.region??""}`))]})})]})},Ez=S`
|
|
2607
2607
|
0% {
|
|
2608
2608
|
background-position: 200% 50%;
|
|
2609
2609
|
}
|
|
@@ -2622,7 +2622,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2622
2622
|
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%)`};
|
|
2623
2623
|
background-size: 200% 100%;
|
|
2624
2624
|
animation: ${Ez} 15s linear infinite;
|
|
2625
|
-
`,zz=({onRedirectToSampling:i})=>{const n=v(),{capabilities:o}=
|
|
2625
|
+
`,zz=({onRedirectToSampling:i})=>{const n=v(),{capabilities:o}=Jh(),l=a(()=>{const e=[];return o.canManageInstrumentationRules&&e.push(ju),e.push(Hu),o.canManageActions&&e.push(Cu),e.push(Lu),e},[o.canManageActions,o.canManageInstrumentationRules]);return e(oc,{children:[e(Re,{fullHeight:!0,customTitle:t($z,{}),customSearch:t(bz,{}),filters:t(_D,{}),children:[t(Dz,{children:l.map((i,a)=>e(r,{children:[t(i,{size:24}),a<l.length-1&&t(wu,{fill:n.v2.colors.white[500]+I["020"],size:24})]},i.name))}),t(rz,{})]}),t(fz,{onRedirectToSampling:i}),t(Oz,{})]})};var Rz;(e=>{e.Gateway="gateway",e.Node="node"})(Rz||(Rz={}));const Pz=({onClickDownloadDiagnose:i,onClickRefresh:n,loading:o,disabled:l})=>{const r=a(()=>{const e=[];return i&&e.push({id:zr(),type:St.Button,buttonProps:{label:"Download Diagnose",leftIcon:mh,size:W.S,variant:K.Text,onClick:i,disabled:l}}),n&&e.push({id:zr(),type:St.Button,buttonProps:{label:"Refresh",leftIcon:th,size:W.S,variant:K.Text,onClick:n,disabled:l,loading:o}}),e},[i,n,l,o]);return e(T,{$alignItems:"center",$justifyContent:"space-between",children:[t(lc,{icon:Vh,title:"Collectors Pipeline"}),t(rc,{actions:r})]})},Xz=({pod:i,onClose:n})=>{const{formatTimeAgo:o}=qn(),{collectorsApi:l}=Jh(),{data:r}=l.usePodInfo(i?{namespace:i.namespace,name:i.name}:void 0,{skip:!i}),s=a(()=>[{id:zr(),title:"Node",label:r?.node??"-",withCopy:!0},{id:zr(),title:"Status",badge:{status:$d(r?.status),label:r?.status??"-"}}],[r]),c=a(()=>r?.containers?.map(e=>({id:zr(),items:[{id:zr(),title:"Container",label:e.name??"-"},{id:zr(),title:"Status",label:e.startedAt?`${e.status} (since ${o(e.startedAt)})`:e.status},{id:zr(),title:"Ready",badge:{status:e.ready?ie.Success:ie.Error,leftIcon:e.ready?zu:Ru,label:e.ready?"True":"False",invertColors:!0}},{id:zr(),title:"Started",badge:{status:e.started?ie.Success:ie.Error,leftIcon:e.started?zu:Ru,label:e.started?"True":"False",invertColors:!0}},{id:zr(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:zr(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:zr(),title:ke.RESTARTS,label:e.restarts.toString()},{id:zr(),title:"State Reason",label:e.stateReason??"-"},{id:zr(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:zr(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(ln,{isOpen:!!i,header:{icon:nh,title:"Pod Information",onClose:n},children:r?e(Mn,{bgTint:"1000",richTitle:{icon:nh,title:r.name,withCopy:!0},children:[t(Mn,{bgTint:"900",cellsPerRow:2,items:s}),e(Mn,{bgTint:"900",richTitle:{icon:sh,title:ke.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(ra,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(ra,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(ra,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Mn,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:i})=>t(Mn,{bgTint:"800",cellsPerRow:2,items:i},e)):t(Z,{title:"No containers",subTitle:"Pod has no containers"})}),t(gm,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(oi,{$height:"50vh",children:t(Ve,{withSpinner:!0})})})};var Lz;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Lz||(Lz={}));const _z=e=>{const t=[{key:Lz.PodName,label:"Pod Name"},{key:Lz.Status,label:"Status"},{key:Lz.Restarts,label:ke.RESTARTS},{key:Lz.NodeName,label:"Node Name"},{key:Lz.Age,label:"Age"},{key:Lz.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Lz.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Mz=({isLoading:i,pods:n,withSpanDropRate:o})=>{const r=v(),{formatTimeAgo:s}=qn(),[c,d]=l(null),p=a(()=>n.map(i=>({onClick:()=>d(i),cells:[{key:Lz.PodName,rawValue:i.name},{key:Lz.Status,rawValue:i.status,component:()=>{return e=i.status,t(E,{status:$d(e),label:e});var e}},{key:Lz.Restarts,rawValue:i.restartsCount.toString()},{key:Lz.NodeName,rawValue:i.nodeName},{key:Lz.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=i;if(!n)return t(w,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),o=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=o>0?ie.Error:ie.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?ie.Error:ie.Success;return e(T,{$gap:4,children:[t(ce,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(E,{status:l,label:`Receiver ${o}%`,leftIcon:l===ie.Error?Uh:Gh,useSecondaryTone:!0,invertColors:!0})}),t(ce,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(E,{status:c,label:`Exporter ${s}%`,leftIcon:c===ie.Error?Uh:Gh,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Lz.Age,rawValue:s(i.creationTimestamp)},{key:Lz.DockerImage,rawValue:i.image}]})),[n,r]);return e(Mn,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:nh,title:"Pods"},children:[t(Xa,{variant:La.Data,isLoading:i,columns:_z(o),rows:p}),t(Xz,{pod:c,onClose:()=>d(null)})]})},Fz=({isOpen:e,onClose:i,title:n,yaml:a})=>t(ln,{isOpen:e,header:{icon:jh,title:n,onClose:i},children:t(gm,{yaml:a,defaultOpen:!0})}),Bz=e=>{switch(e){case Nd.Healthy:return"All desired replicas are updated, available, and ready";case Nd.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Nd.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Nd.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Nd.Down:return"No available replicas";case Nd.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Vz;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Vz||(Vz={}));const Uz=f.div`
|
|
2626
2626
|
flex: 1;
|
|
2627
2627
|
min-width: 0;
|
|
2628
2628
|
padding: 12px;
|
|
@@ -2684,7 +2684,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2684
2684
|
flex-basis: 100%;
|
|
2685
2685
|
min-width: 0;
|
|
2686
2686
|
}
|
|
2687
|
-
`,qz=({selectedTab:i,gatewayInfo:n,nodeCollectorInfo:o,isLoading:r,withDataThroughput:s})=>{const{formatTimeAgo:c}=qn(),[p,u]=l(null),h=a(()=>(e=>{switch(e){case Rz.Gateway:return"Deployment";case Rz.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(i),[i]),g=a(()=>((e,t,i,n)=>{const a={status:ie.Disabled,label:"No rollouts yet"};let o=!1,l=null;switch(e){case Rz.Gateway:o=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Rz.Node:o=i?.rolloutInProgress??!1,l=i?.lastRolloutAt??null;break;default:return a}return o?{status:ie.Info,label:"Rollout in progress",rightIcon:
|
|
2687
|
+
`,qz=({selectedTab:i,gatewayInfo:n,nodeCollectorInfo:o,isLoading:r,withDataThroughput:s})=>{const{formatTimeAgo:c}=qn(),[p,u]=l(null),h=a(()=>(e=>{switch(e){case Rz.Gateway:return"Deployment";case Rz.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(i),[i]),g=a(()=>((e,t,i,n)=>{const a={status:ie.Disabled,label:"No rollouts yet"};let o=!1,l=null;switch(e){case Rz.Gateway:o=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Rz.Node:o=i?.rolloutInProgress??!1,l=i?.lastRolloutAt??null;break;default:return a}return o?{status:ie.Info,label:"Rollout in progress",rightIcon:th,useSecondaryTone:!0}:l?{status:ie.Disabled,label:`Last Rollout: ${n(l)}`}:a})(i,n,o,c),[n,o,i,c]),m=a(()=>((e,t,i,n)=>{let a=n?ie.Info:ie.Unknown,o=n?"Loading":Nd.Unknown,l=n?"Fetching data...":Bz(Nd.Unknown);switch(e){case Rz.Gateway:a=t?.status?$d(t?.status):a,o=t?.status??o,l=t?.status?Bz(t.status):l;break;case Rz.Node:a=i?.status?$d(i?.status):a,o=i?.status??o,l=i?.status?Bz(i.status):l}return{status:a,title:o,description:l}})(i,n,o,r),[n,o,i,r]),b=a(()=>((e,t,i)=>{switch(e){case Rz.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 Rz.Node:return[{gaugeWidth:128,min:0,max:i?.nodes?.desired??0,current:i?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(i,n,o),[n,o,i]),f=a(()=>((e,t,i,n,a)=>{switch(e){case Rz.Gateway:{const e=[];return a&&e.push({title:"Data throughput",cells:[{label:"Traces data",value:va(t?.throughputTracesBytesPerSec??0),isLoading:n},{label:"Metrics data",value:va(t?.throughputMetricsBytesPerSec??0),isLoading:n},{label:"Logs data",value:va(t?.throughputLogsBytesPerSec??0),isLoading:n}]}),e.push({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}]}),e}case Rz.Node:{const e=[];return a&&e.push({title:"Data Throughput",cells:[{label:"Traces data",value:va(i?.throughputTracesBytesPerSec??0),isLoading:n},{label:"Metrics data",value:va(i?.throughputMetricsBytesPerSec??0),isLoading:n},{label:"Logs data",value:va(i?.throughputLogsBytesPerSec??0),isLoading:n}]}),e.push({title:"Resources (request/limit)",cells:[{label:"CPU",value:`${i?.resources?.requests.cpu}/${i?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${i?.resources?.requests.memory}/${i?.resources?.limits.memory}`,isLoading:n}]}),e}default:return[]}})(i,n,o,r,s),[n,o,i,r,s]),v=a(()=>(i===Rz.Gateway?n?.manifestYAML:o?.manifestYAML)??"",[n,o,i]),y=a(()=>(i===Rz.Gateway?n?.configMapYAML:o?.configMapYAML)??"",[n,o,i]),S=d(e=>u(e),[]),x=a(()=>[{id:"view-yaml",type:St.DropDataButton,buttonProps:{variant:K.Secondary,size:W.S,label:"View YAML",onClick:S},dropDataProps:{items:[{id:Vz.ManifestYaml,label:h,icon:Hh},{id:Vz.ConfigMapYaml,label:"ConfigMap",icon:Hh}]}}],[h,S]);return e(Mn,{bgTint:"1000",moreSpacing:!0,children:[e(Gz,{children:[t(jz,{children:t(lc,{icon:jh,title:h,badge:g})}),t(Hz,{children:t(rc,{actions:x})})]}),e(Wz,{$gap:16,children:[t(Kz,{children:t(Ad,{...m})}),b.map(e=>t(Yz,{children:t(Uz,{children:t(id,{...e})})},e.title)),f.map(e=>t(Jz,{children:t(sc,{...e})},e.title))]}),t(Fz,{isOpen:p===Vz.ManifestYaml,onClose:()=>u(null),title:h,yaml:v}),t(Fz,{isOpen:p===Vz.ConfigMapYaml,onClose:()=>u(null),title:"ConfigMap",yaml:y})]})},Zz=[{value:Rz.Gateway,label:"Gateway"},{value:Rz.Node,label:"Node Collector"}],Qz=({minSupportedVersion:i})=>{const{isVersionSupported:n,version:o,minSupportedVersion:r}=Vp(i),[s,c]=l(Rz.Gateway),p=s===Rz.Gateway,u=s===Rz.Node,{collectorsApi:h,configApi:g}=Jh(),{data:m}=g.useEffectiveConfig(),{data:b,loading:f,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:S,refetch:x}=h.useGatewayPods({skip:!p}),{data:w,loading:C,refetch:k}=h.useNodeCollectorInfo({skip:!u}),{data:T=[],loading:I,refetch:N}=h.useNodeCollectorPods({skip:!u}),A=p&&(f||S)||u&&(C||I),O=d(()=>{p?(v(),x()):u&&(k(),N())},[p,u,v,x,k,N]),E=a(()=>p?y:T,[y,T,p]),D=!m?.odigosOwnTelemetryStore?.metricsStoreDisabled;return e(oc,{children:[t(Pz,{disabled:!n,loading:A,onClickDownloadDiagnose:void 0,onClickRefresh:O}),e(od,{children:[e($,{children:[t(F,{variant:Ra.Underline,size:Zt.L,options:Zz,selected:s,setSelected:c}),t(qz,{selectedTab:s,gatewayInfo:b??null,nodeCollectorInfo:w??null,isLoading:A,withDataThroughput:D})]}),t(Mz,{isLoading:A,pods:E,withSpanDropRate:D}),!n&&t(xm,{minSupportedVersion:r,currentVersion:o||""})]})]})},eR=f.div`
|
|
2688
2688
|
display: inline-flex;
|
|
2689
2689
|
align-items: center;
|
|
2690
2690
|
min-width: 0;
|
|
@@ -2703,11 +2703,11 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2703
2703
|
gap: 6px;
|
|
2704
2704
|
align-items: center;
|
|
2705
2705
|
min-height: 22px;
|
|
2706
|
-
`,nR=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0}],aR=[{value:"all",label:
|
|
2706
|
+
`,nR=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0}],aR=[{value:"all",label:Rd},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],oR=({title:i,items:n,isLoading:o,showTypeFilter:r,onRuleClick:s,onCreateRule:c,onEditRule:p,onDeleteRule:u})=>{const h=v(),[g,m]=l(""),[b,f]=l("all"),y=a(()=>{let e=((e,t,i)=>i&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(n,b,r);return e=((e,t)=>{if(!t.trim())return e;const i=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(i),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(i)})})(e,g),e},[n,b,r,g]),S=a(()=>y.map(i=>{const n=i.typeBadge?((e,t)=>{const i=e.v2.colors;switch(t){case"Relevance":return{bg:i.blue[700],text:i.white[500]};case"Duration":return{bg:i.purple[700],text:i.white[500]};case"Error":return{bg:i.red[500],text:i.black[500]}}})(h,i.typeBadge):void 0;return{cells:[{key:"content",rawValue:i.summary.map(e=>e.text).join(""),component:()=>e(tR,{$disabled:i.disabled,children:[t(eR,{children:t(Gp,{parts:i.summary})}),i.name&&t(w,{size:C.XXS,color:k.Secondary,nowrap:!0,children:i.name})]})},{key:"badges",rawValue:i.typeBadge||"",component:()=>e(iR,{children:[i.disabled&&t(E,{label:_a,textSize:C.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),i.typeBadge&&n&&t(E,{label:i.typeBadge,textSize:C.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>s(i)}}),[y,h,s]),x=a(()=>{const e=e=>t(Nu,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),T=d(e=>{const t=S.indexOf(e);if(t<0)return[];const i=y[t];return i?[{id:"edit","data-id":"sampling-rule-action-edit",label:bo,leftIcon:Au,onClick:()=>p(i.ruleId,i.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:x,onClick:()=>u(i.ruleId,i.samplingId)}]:[]},[S,y,p,u,x]);return t(Re,{fullHeight:!0,richTitle:{icon:Sh,title:i,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:g,onChange:m,placeholder:"Search..",width:"500px"},filters:r?t(F,{"data-id":"sampling-segment-type-filter",options:aR,selected:b,setSelected:f}):void 0,children:t(Xa,{variant:La.Pretty,hideHeader:!0,isLoading:o,noDataProps:g.trim()?{hideIcon:!0,title:Od,subTitle:zd(g)}:{hideIcon:!0,title:Dd,button:{label:Ed,onClick:c}},columns:nR,rows:S,getRowActions:T})})},lR=({docsUrl:i})=>{const{samplingApi:n,sourcesApi:r}=Jh(),{items:s}=r.useSources(),c=a(()=>s.map(e=>({id:e.id})),[s]),{items:u,loading:h,k8sHealthProbesConfig:g,refetch:m}=n.useSamplingRules(),b=d((e,t)=>n.createNoisy?.({samplingId:e,rule:t}),[n]),f=d((e,t,i)=>n.updateNoisy?.(t,{samplingId:e,rule:i}),[n]),v=d((e,t)=>n.createHighlyRelevant?.({samplingId:e,rule:t}),[n]),y=d((e,t,i)=>n.updateHighlyRelevant?.(t,{samplingId:e,rule:i}),[n]),S=d((e,t)=>n.createCostReduction?.({samplingId:e,rule:t}),[n]),x=d((e,t,i)=>n.updateCostReduction?.(t,{samplingId:e,rule:i}),[n]),w=d((e,t,i)=>"noisy"===i?n.deleteNoisy?.(t,e):"highlyRelevant"===i?n.deleteHighlyRelevant?.(t,e):"costReduction"===i?n.deleteCostReduction?.(t,e):void 0,[n]),C=d((e,t)=>n.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[n]),k=a(()=>c.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[c]),I=a(()=>Array.from(new Set(c.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[c]),[N,A]=l(au.Noisy),[O,E]=l(null),[D,z]=l(!1),[R,P]=l(!1),[X,L]=l(null),[_,M]=l(!1),[B,V]=l(!1),[U,G]=l(!1),[j,Y]=l(!1);p(!1),o(()=>{},[h,u]);const{pendingViewSamplingRule:J,setPendingViewSamplingRule:q}=da();o(()=>{if(!J)return;if(h||0===u.length)return;q(null);const e=ou(u,J.ruleId,J.category);e&&(A(lu[J.category]),z(!1),E(e))},[h,u,J,q]);const Z=a(()=>eu(g),[g]),Q=a(()=>ru(u),[u]),ee=a(()=>tu(Q?.rule??null),[Q]),ne=a(()=>su(u),[u]),ae=a(()=>cu(ne?.rule??null),[ne]),oe=p(O);oe.current=O,o(()=>{const e=oe.current;if(!e)return;const t=du(u,e);t?E(t):(E(null),z(!1))},[u]);const le=a(()=>{const e=new Set;return Q&&e.add(Q.rule.ruleId),ne&&e.add(ne.rule.ruleId),e},[Q,ne]),re=a(()=>pu(u,N,le),[u,N,le]),se=d(()=>P(!0),[]),ce=d(()=>P(!1),[]);d(()=>Y(!1),[]);const de=d(async e=>{const t=u[0]?.id??"default";switch(fu[N]){case"noisy":await b(t,gu(e));break;case"highlyRelevant":await v(t,hu(e));break;case"costReduction":await S(t,uu(e))}P(!1)},[u,N,b,v,S]),pe=d(e=>{const t=mu(u,e);t&&(z(!1),E(t))},[u]),ue=d(()=>{E(null),z(!1)},[]),he=d((e,t)=>{const i=O;if(i&&i.rule.ruleId===e&&i.samplingId===t)z(!0),E({...i});else for(const i of u){if(i.id!==t)continue;const n=[...i.noisyOperations.map(e=>({category:"noisy",rule:e})),...i.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...i.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return z(!0),void E({category:n.category,rule:n.rule,samplingId:t,summary:bu(n.category,n.rule)})}},[O,u]),ge=d(async(e,t,i)=>{const n=O?.category;if(n){switch(n){case"noisy":await f(i,t,gu(e));break;case"highlyRelevant":await y(i,t,hu(e));break;case"costReduction":await x(i,t,uu(e))}z(!1)}},[O,f,y,x]),me=d((e,t)=>{L({ruleId:e,samplingId:t})},[]),be=d(async()=>{if(!X)return;const{ruleId:e,samplingId:t}=X,i=O?.category||fu[N];await w(t,e,i),E(null),z(!1),L(null)},[X,O,N,w]),fe=d(()=>L(null),[]),ve=d(async(e,t)=>{await C(e,t),M(!1)},[C]),ye=d(async e=>{const t=u[0]?.id??"default",i=Q;i?await y(i.samplingId,i.rule.ruleId,{name:i.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:i.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),V(!1)},[u,Q,v,y]),Se=d(async(e,t)=>{const i=u[0]?.id??"default",n=ne;n?await x(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await S(i,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),G(!1)},[u,ne,S,x]),xe=d(e=>{const t=fu[N];let i=null;switch(t){case"noisy":{const n=gu(e);i=vu(u,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=hu(e);i=vu(u,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=uu(e);i=vu(u,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return i?{message:Pd,ruleId:i}:null},[u,N]),we=d(e=>{const t=O?.category,i=O?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const a=gu(e);n=vu(u,t,{sourceScopes:a.sourceScopes,operation:a.operation},i);break}case"highlyRelevant":{const a=hu(e);n=vu(u,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},i);break}case"costReduction":{const a=uu(e);n=vu(u,t,{sourceScopes:a.sourceScopes,operation:a.operation},i);break}}return n?{message:Pd,ruleId:n}:null},[u,O]),ke=d(e=>{P(!1);for(const t of u){const i=[...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(i)return z(!0),void E({category:i.category,rule:i.rule,samplingId:t.id,summary:bu(i.category,i.rule)})}},[u]),Te=a(()=>{const e=[];return i&&e.push({id:zr(),type:St.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Xd,leftIcon:$u,size:W.S,variant:K.Text,onClick:()=>window.open(i,"_blank")}}),e.push({id:zr(),type:St.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ld,leftIcon:th,size:W.S,variant:K.Text,onClick:m,loading:h}}),e.push({id:zr(),type:St.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:_d,rightIcon:Tu,size:W.S,variant:K.Primary,onClick:se}}),e},[i,m,h,se]);return e(oc,{children:[e(T,{$gap:12,$justifyContent:"space-between",children:[t(lc,{icon:Sh,title:Fd,subTitle:Md}),t(rc,{actions:Te})]}),e($,{$gap:12,$fullHeight:!0,children:[t(F,{variant:Ra.Underline,size:Zt.L,options:yu,selected:N,setSelected:A}),e(T,{$justifyContent:"space-between",children:[t(te,{status:ie.Default,message:Su[N]}),i&&t(H,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:$u,size:W.S,variant:K.Text,onClick:()=>window.open(i,"_blank")})]}),N===au.Noisy?t(tm,{title:Ee,summary:Z,onEdit:()=>M(!0)}):N===au.HighlyRelevant?t(tm,{title:Ie,summary:ee,onEdit:()=>V(!0)}):N===au.CostReduction?t(tm,{title:Ae,summary:ae,onEdit:()=>G(!0)}):null,t(oR,{title:xu[N],items:re,isLoading:h,showTypeFilter:N===au.HighlyRelevant,onRuleClick:pe,onCreateRule:se,onEditRule:he,onDeleteRule:me})]}),t(gT,{formType:ig.View,data:O,defaultEditMode:D,onClose:ue,onDelete:me,onSaveEdit:ge,sourceOptions:k,namespaceOptions:I,validateForm:we,onNavigateToDuplicate:ke}),t(gT,{formType:ig.Create,isOpen:R,category:fu[N],onClose:ce,onSubmit:de,sourceOptions:k,namespaceOptions:I,validateForm:xe,onNavigateToDuplicate:ke}),t(gT,{formType:ig.EditAutoNoisy,isOpen:_,enabled:g?.enabled??!1,keepPercentage:g?.keepPercentage??0,onClose:()=>M(!1),onSave:ve}),t(gT,{formType:ig.EditAutoHighlyRelevant,isOpen:B,enabled:!!Q&&!Q.rule.disabled,onClose:()=>V(!1),onSave:ye}),t(gT,{formType:ig.EditAutoCostReduction,isOpen:U,enabled:!!ne&&!ne.rule.disabled,dropPercentage:ne?.rule.percentageAtMost??25,onClose:()=>G(!1),onSave:Se}),t(Ce,{title:Gd,description:Ud,isOpen:!!X,onClose:fe,denyButton:{label:Vd,variant:K.Secondary,onClick:fe},approveButton:{label:Bd,variant:K.Primary,onClick:()=>{be(),fe()}}}),!1]})},rR=f.div`
|
|
2707
2707
|
padding: 12px;
|
|
2708
2708
|
border-radius: 12px;
|
|
2709
2709
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
2710
|
-
`,sR=b(({id:e,data:i})=>t(rR,{"data-id":e,children:t(Z,{...i})}));var cR,dR;sR.displayName=sR.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(cR||(cR={})),(e=>{e.AnimatedTraffic="animated-traffic",e.SelfLoop="self-loop"})(dR||(dR={}));const pR=(e,t,i)=>{if(i)return{icons:[
|
|
2710
|
+
`,sR=b(({id:e,data:i})=>t(rR,{"data-id":e,children:t(Z,{...i})}));var cR,dR;sR.displayName=sR.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(cR||(cR={})),(e=>{e.AnimatedTraffic="animated-traffic",e.SelfLoop="self-loop"})(dR||(dR={}));const pR=(e,t,i)=>{if(i)return{icons:[rh],aggService:e,selected:!0};const n=e.isVirtual,a=n?[ua(e)]:t?ha(t):[Wh],{priorotizedStatus:o}=n?{priorotizedStatus:void 0}:fd(t?.conditions||[]);return{icons:a,status:o,isVirtual:n,aggService:e,selected:!0}},uR=e=>!(!e||e.serviceName!==rw||e.id.namespace||e.id.name||e.id.kind),hR=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},gR={id:{namespace:"",name:"",kind:""},serviceName:rw,markedForInstrumentation:{markedForInstrumentation:!0}},mR=h(null),bR=()=>{const e=g(mR);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},fR=({serviceMap:e,children:i})=>{const n=v(),{sourcesApi:r}=Jh(),{items:s}=r.useSources(),[c,p,u]=Am([]),[h,g,m]=Om([]),[b,f]=l(0),y=d(()=>f(e=>e+1),[]),[S,x]=l(""),[w,C]=l(null),[k,T]=l(null),I=d(e=>T(t=>t===e?null:e),[]),$=d(()=>T(null),[]),[N,A]=l(!1),O=d(()=>A(e=>!e),[]),E=a(()=>h.some(e=>e.source===e.target||Boolean(e.data?.isSelfLoop)),[h]),D=d((e,t)=>{const i=new Set(e);p(e=>e.map(e=>e.type===cR.MapItem&&i.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);o(()=>{let t=!1;const i=(e=>{const t=new Map,i=new Set,n=(e,i,n=!1)=>{let a=t.get(e);return a||(a={serviceName:i,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,a)),a},a=(e,t)=>{if(t)for(const{key:i,value:n}of t)i in e||(e[i]=n)};for(const t of e){const{graphKey:e}=hR(t.nodeId),o=n(e,t.serviceName);o.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=hR(e?.nodeId??"");e.isVirtual&&(i.add(t),a(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=o.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},o.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const o=[...t.entries()];for(const[,{connectionMap:e}]of o)for(const[a,o]of e)t.has(a)||n(a,o.targetServiceName,i.has(a));const l=[];for(const[e,{serviceName:i,isVirtual:n,attributes:a,connectionMap:o}]of t){const t=[...o.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:i,isVirtual:n,connections:t,attributes:a})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),a=(({sources:e,aggregatedServiceMap:t})=>{const i=[],n={x:0,y:0};if(t.length&&e.length)for(const a of t){const t=e.find(e=>a.serviceName===e.serviceName||a.serviceName===e.id.name),o=uR(t);i.push({id:a.graphKey,type:cR.MapItem,position:n,data:pR(a,t,o),measured:{width:80,height:80}})}else i.push({id:cR.NoData,type:cR.NoData,position:n,data:{subTitle:ke.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return i})({aggregatedServiceMap:i,sources:[gR].concat(s)});if(1===a.length&&a[0].id===cR.NoData)return p(a),g([]),x(""),void y();const o=(({theme:e,nodes:t,aggregatedServiceMap:i})=>{const n=[],a=new Map(t.map(e=>[e.id,e]));for(const t of i){const i=t.graphKey,o=a.get(i);if(!o)continue;const l=o.data?.status===ie.Error;for(const o of t.connections){const r=o.targetGraphKey;if(!a.has(r))continue;const s=i===r;n.push({id:`${i}-to-${r}`,type:s?dR.SelfLoop:"smoothstep",source:i,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:o.targetGraphKey,isSelfLoop:s},markerEnd:{type:Nm.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return n})({theme:n,nodes:a,aggregatedServiceMap:i});g(o);const l=a.map(e=>e.id).sort().join("|");if(l!==S)return(async(e,t,i={})=>Sm(e,t,{direction:"RIGHT",nodeWidth:80,nodeHeight:80,rootIds:e.some(e=>e.id===rw)?[rw]:[],rootLayerConstraint:"FIRST",spacing:{betweenLayers:150,nodeNode:120,edgeEdge:30,edgeNode:40},extraOptions:i}))(a,o).then(({nodes:e})=>{t||(p(e),x(l),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return a.map(e=>{const i=t.get(e.id);return i?e.type===cR.MapItem&&i.type===cR.MapItem?{...e,position:i.position,data:{...e.data,selected:i.data.selected}}:{...e,position:i.position}:e})})},[n,e,s,S]);const z=a(()=>{const e=N?h:h.filter(e=>e.source!==e.target&&!e.data?.isSelfLoop);return w||k?e.map(e=>{if(e.source===w||e.target===w||e.source===k||e.target===k)return{...e,type:dR.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):e},[h,N,w,k]),R=a(()=>({nodes:c,edges:z,onNodesChange:u,onEdgesChange:m,setNodesSelected:D,fitViewTrigger:b,hoveredNodeId:w,setHoveredNodeId:C,activeNodeId:k,toggleActiveNode:I,resetActiveNode:$,showSelfLoops:N,hasSelfLoops:E,toggleShowSelfLoops:O}),[c,z,u,m,D,b,w,k,I,$,N,E,O]);return t(mR.Provider,{value:R,children:i})},vR=f.div`
|
|
2711
2711
|
border: 1px ${({theme:e,$isSelected:t,$isVirtual:i})=>t?`solid ${e.v2.colors.blue[300]}`:i?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
|
|
2712
2712
|
border-radius: 8px;
|
|
2713
2713
|
cursor: pointer;
|
|
@@ -2723,7 +2723,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2723
2723
|
align-items: center;
|
|
2724
2724
|
gap: 4px;
|
|
2725
2725
|
margin-top: 4px;
|
|
2726
|
-
`,xR=b(({id:n,data:o})=>{const{icons:l,status:r,isVirtual:s}=o,c=v(),{activeNodeId:d,hoveredNodeId:p}=bR(),{isUserSource:u,isNodeSelected:h,isHovered:g}=a(()=>({isUserSource:n===
|
|
2726
|
+
`,xR=b(({id:n,data:o})=>{const{icons:l,status:r,isVirtual:s}=o,c=v(),{activeNodeId:d,hoveredNodeId:p}=bR(),{isUserSource:u,isNodeSelected:h,isHovered:g}=a(()=>({isUserSource:n===rw,isNodeSelected:d===n,isHovered:p===n}),[n,d,p,n]),{isSelected:m,isHighlighted:b}=a(()=>({isSelected:h||u,isHighlighted:h||g||u}),[h,g,u]),f=r?$a(r,c):null;return e(i,{children:[t(Im,{type:"source",position:$m.Right,style:{visibility:"hidden"}}),t(Im,{type:"target",position:$m.Left,style:{visibility:"hidden"}}),e(yR,{"data-id":n,children:[t(vR,{$isSelected:m,$isVirtual:s,children:t(ga,{padding:12,icons:l,status:b?ie.Info:r})}),e(SR,{children:[f&&t(f,{}),t(w,{size:C.XXS,nowrap:!0,children:n})]})]})]})});xR.displayName=xR.name;const wR=b(({id:e,sourceX:i,sourceY:n,targetX:a,targetY:o,markerEnd:l,style:r})=>{const[s]=wm({sourceX:i,sourceY:n,targetX:a,targetY:o,isSelfLoop:!0,selfLoopNodeHeight:80});return t(Em,{id:e,path:s,markerEnd:l,style:r})});wR.displayName=wR.name;const CR=f.div`
|
|
2727
2727
|
display: flex;
|
|
2728
2728
|
flex-direction: column;
|
|
2729
2729
|
gap: 12px;
|
|
@@ -2739,7 +2739,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2739
2739
|
`,kR=({children:e})=>t(CR,{children:e});var TR,IR;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(TR||(TR={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(IR||(IR={}));const $R=f.div`
|
|
2740
2740
|
flex: 1 1 auto;
|
|
2741
2741
|
min-height: 0;
|
|
2742
|
-
`,NR=()=>{const{nodes:i,activeNodeId:n,resetActiveNode:o}=bR(),[r,s]=l(TR.All),c=a(()=>{const e=new Map;for(const t of i)t.type===cR.MapItem&&e.set(t.id,t);return e},[i]),d=a(()=>c.get(n??""),[c,n]),{inbound:p,outbound:u}=a(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:IR.Outbound});for(const t of c.values())if(t.id!==d.id)for(const i of t.data.aggService?.connections??[])i.targetGraphKey===d.id&&e.push({peerId:t.id,direction:IR.Inbound});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[TR.All,TR.Inbound].includes(r)&&p.length>0,g=[TR.All,TR.Outbound].includes(r)&&u.length>0;return e(kR,{children:[e(T,{$width:"100%",$gap:8,children:[t(H,{variant:K.Text,size:W.S,leftIcon:
|
|
2742
|
+
`,NR=()=>{const{nodes:i,activeNodeId:n,resetActiveNode:o}=bR(),[r,s]=l(TR.All),c=a(()=>{const e=new Map;for(const t of i)t.type===cR.MapItem&&e.set(t.id,t);return e},[i]),d=a(()=>c.get(n??""),[c,n]),{inbound:p,outbound:u}=a(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:IR.Outbound});for(const t of c.values())if(t.id!==d.id)for(const i of t.data.aggService?.connections??[])i.targetGraphKey===d.id&&e.push({peerId:t.id,direction:IR.Inbound});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[TR.All,TR.Inbound].includes(r)&&p.length>0,g=[TR.All,TR.Outbound].includes(r)&&u.length>0;return e(kR,{children:[e(T,{$width:"100%",$gap:8,children:[t(H,{variant:K.Text,size:W.S,leftIcon:eh,onClick:o}),t(ga,{icons:d.data.icons}),t(w,{size:C.XS,children:d.id})]}),t(F,{fullWidth:!0,options:[{label:`${TR.All}`,value:TR.All,badge:{label:`${p.length+u.length}`}},{label:`${TR.Inbound}`,value:TR.Inbound,badge:{label:`${p.length}`}},{label:`${TR.Outbound}`,value:TR.Outbound,badge:{label:`${u.length}`}}],selected:r,setSelected:s}),h&&t(OR,{halfHeight:g,title:"Inbound",icon:Pu,connections:p,mapNodesById:c}),g&&t(OR,{halfHeight:h,title:"Outbound",icon:Xu,connections:u,mapNodesById:c})]})},AR=f.div`
|
|
2743
2743
|
display: flex;
|
|
2744
2744
|
flex-direction: column;
|
|
2745
2745
|
gap: 8px;
|
|
@@ -2754,7 +2754,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2754
2754
|
padding: 8px;
|
|
2755
2755
|
border-radius: 8px;
|
|
2756
2756
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
2757
|
-
`,DR=({connection:i,peerNode:n})=>e(ER,{children:[n&&t(ga,{icons:n.data.icons}),t(w,{size:C.XXS,children:i.peerId})]}),zR=b(e=>{const i=v(),n={mode:"fixed",selfLoopNodeHeight:80,isSelfLoop:e.source===e.target||Boolean(e.data?.isSelfLoop),trackColor:i.v2.colors.blue[700],ballColorSmall:i.v2.colors.blue[900],ballColorLarge:i.v2.colors.blue[500]};return t(
|
|
2757
|
+
`,DR=({connection:i,peerNode:n})=>e(ER,{children:[n&&t(ga,{icons:n.data.icons}),t(w,{size:C.XXS,children:i.peerId})]}),zR=b(e=>{const i=v(),n={mode:"fixed",selfLoopNodeHeight:80,isSelfLoop:e.source===e.target||Boolean(e.data?.isSelfLoop),trackColor:i.v2.colors.blue[700],ballColorSmall:i.v2.colors.blue[900],ballColorLarge:i.v2.colors.blue[500]};return t(Cm,{...e,data:n})});zR.displayName=zR.name;const RR=f.div`
|
|
2758
2758
|
flex: 1 1 auto;
|
|
2759
2759
|
min-height: 0;
|
|
2760
2760
|
`,PR=({})=>{const{nodes:i,setNodesSelected:n,resetActiveNode:o}=bR(),[r,s]=l(""),c=a(()=>i.filter(e=>e.type===cR.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[i]),p=a(()=>c.filter(e=>e.data.selected),[c]),u=a(()=>c.filter(e=>e.id.toLowerCase().includes(r.toLowerCase())),[c,r]),h=a(()=>u.every(e=>e.data.selected),[u]),g=d(()=>{const e=!h;n(u.map(e=>e.id),e),e||o()},[u,h,n,o]);return c.length?e(kR,{children:[e(T,{$width:"100%",$gap:8,children:[t(w,{size:C.XS,children:"Services"}),t(E,{label:c.length})]}),t(sa,{width:"100%",value:r,onChange:s}),e(T,{$width:"100%",$justifyContent:"space-between",children:[t(w,{size:C.XXXS,children:`Showing ${p.length} out of ${c.length}`}),t(w,{"data-id":"namespaces-select-all",onClick:g,disabled:!u.length,size:C.XS,children:h?ke.UNSELECT_ALL:ke.SELECT_ALL})]}),t(RR,{children:t(ca,{gap:4,elements:u.map(e=>t(LR,{node:e},e.id))})})]}):null},XR=f.div`
|
|
@@ -2817,14 +2817,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2817
2817
|
}
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
2820
|
-
`,FR={[cR.MapItem]:xR,[cR.NoData]:sR},BR={[dR.AnimatedTraffic]:zR,[dR.SelfLoop]:wR},VR={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},UR=({onRefresh:i})=>{const{nodes:n,edges:o,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d,showSelfLoops:p,hasSelfLoops:u,toggleShowSelfLoops:h}=bR(),g=a(()=>{const e=new Set(n.filter(e=>e.type===cR.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const i of o)e.has(i.source)&&t.add(i.target),e.has(i.target)&&t.add(i.source);return n.filter(e=>e.type!==cR.MapItem||e.data.selected||t.has(e.id))},[n,o]);return e(
|
|
2820
|
+
`,FR={[cR.MapItem]:xR,[cR.NoData]:sR},BR={[dR.AnimatedTraffic]:zR,[dR.SelfLoop]:wR},VR={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},UR=({onRefresh:i})=>{const{nodes:n,edges:o,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d,showSelfLoops:p,hasSelfLoops:u,toggleShowSelfLoops:h}=bR(),g=a(()=>{const e=new Set(n.filter(e=>e.type===cR.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const i of o)e.has(i.source)&&t.add(i.target),e.has(i.target)&&t.add(i.source);return n.filter(e=>e.type!==cR.MapItem||e.data.selected||t.has(e.id))},[n,o]);return e(zm,{zoomOnScroll:!0,nodes:g,nodeTypes:FR,edges:o,edgeTypes:BR,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Rm,{}),t(km,{trigger:l,options:VR}),t(MR,{children:e(Pm,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:VR,children:[u&&t(Xm,{title:p?"Hide self-loops":"Show self-loops","aria-label":p?"Hide self-loops":"Show self-loops","aria-pressed":p,onClick:h,children:t(Kh,{})}),t(Xm,{title:"Refresh","aria-label":"Refresh",onClick:i,children:t(th,{})})]})})]})},GR=i=>t(Dm,{children:e(_R,{children:[t(UR,{...i}),t(PR,{}),t(NR,{})]})}),jR=f.div`
|
|
2821
2821
|
width: 100%;
|
|
2822
2822
|
flex: 1;
|
|
2823
2823
|
align-self: stretch;
|
|
2824
2824
|
min-height: 0;
|
|
2825
2825
|
height: 100%;
|
|
2826
2826
|
position: relative;
|
|
2827
|
-
`,HR=()=>{const{serviceMapApi:e}=
|
|
2827
|
+
`,HR=()=>{const{serviceMapApi:e}=Jh(),{data:i,refetch:n}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(fR,{serviceMap:i?.serviceMap??[],children:t(jR,{children:t(GR,{onRefresh:n})})})},WR=f.div`
|
|
2828
2828
|
display: flex;
|
|
2829
2829
|
align-items: center;
|
|
2830
2830
|
justify-content: space-between;
|
|
@@ -2837,13 +2837,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2837
2837
|
width: 1px;
|
|
2838
2838
|
height: 20px;
|
|
2839
2839
|
background-color: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
2840
|
-
`,JR=({disabled:i,loading:n,onClickShowYaml:o,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=a(()=>o?[{id:
|
|
2840
|
+
`,JR=({disabled:i,loading:n,onClickShowYaml:o,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=a(()=>o?[{id:zr(),type:St.Button,buttonProps:{label:"Show Config YAML",leftIcon:Hh,size:W.S,variant:K.Secondary,onClick:o,disabled:i}}]:[],[o,i]),h=a(()=>{const e=[];return s&&e.push({id:zr(),type:St.Button,buttonProps:{leftIcon:th,tooltip:"Refresh",hideTooltipIcon:!0,size:W.S,variant:K.Text,onClick:s,disabled:i,loading:n}}),r&&e.push({id:zr(),type:St.Button,buttonProps:{leftIcon:ku,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:W.S,variant:K.Text,textColor:c.v2.colors.red[500],onClick:()=>p(!0),disabled:i}}),e},[i,n,r,s,c]),g=u.length>0,m=h.length>0;return e(WR,{children:[t(lc,{icon:ih,title:"Odigos Settings"}),e(KR,{children:[g&&t(rc,{actions:u}),g&&m&&t(YR,{}),m&&t(rc,{actions:h})]}),t(Ce,{isOpen:d,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:K.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:K.Primary,onClick:()=>{r?.(),p(!1)}}})]})},qR=f($)`
|
|
2841
2841
|
width: 220px;
|
|
2842
2842
|
flex-shrink: 0;
|
|
2843
2843
|
height: 100%;
|
|
2844
2844
|
gap: 4px;
|
|
2845
2845
|
overflow-y: auto;
|
|
2846
|
-
`,ZR=({options:e,selected:i,setSelected:n,disabled:a})=>t(qR,{children:e.map(e=>t(
|
|
2846
|
+
`,ZR=({options:e,selected:i,setSelected:n,disabled:a})=>t(qR,{children:e.map(e=>t(Um,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:i===e.id,disabled:a,onClick:()=>n(e.id)},e.id))}),QR=f($)`
|
|
2847
2847
|
width: 100%;
|
|
2848
2848
|
/* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
|
|
2849
2849
|
max-width: 844px;
|
|
@@ -2871,7 +2871,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2871
2871
|
`,nP=f.div`
|
|
2872
2872
|
flex: 1;
|
|
2873
2873
|
min-width: 0;
|
|
2874
|
-
`,aP=e=>"general"===e.name?0:"advanced"===e.name?2:1,oP=({minSupportedVersion:n})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=
|
|
2874
|
+
`,aP=e=>"general"===e.name?0:"advanced"===e.name?2:1,oP=({minSupportedVersion:n})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=Vp(n),{configApi:p}=Jh(),{data:u,loading:h}=p.useConfigYamls(),{data:g,loading:m,refetch:b}=p.useEffectiveConfig(),f=u?.configYamls??[],[v,y]=l(!1),S=a(()=>{if(!g)return{};const{manifestYAML:e,provenance:t,...i}=g;return i},[g]),{formData:x,handleFormChange:I,getNestedValue:N,getFormDiff:A,isFormDirty:O}=Gn(S);o(()=>{"{}"!==JSON.stringify(S)&&"{}"===JSON.stringify(x)&&I(void 0,void 0,S)},[S,x]);const D=a(()=>[...f].sort((e,t)=>aP(e)-aP(t)),[f]),z=a(()=>(e=>{if(!e)return{};const t={};for(const i of e)t[i.helmPath]=i.reconciledFrom;return t})(g?.provenance),[g?.provenance]),R=a(()=>{const e=new Set;for(const t of f)for(const i of t.fields)i.componentType===_n.Dropdown&&e.add(i.helmValuePath);return e},[f]),P=a(()=>f.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:N("formData",e.helmValuePath)}))),[f,x,N]),[X,L]=l(!1),[_,M]=l(!1),F=a(()=>[{id:zr(),type:St.Button,buttonProps:{"data-id":"settings-save",variant:K.Primary,size:W.S,label:"Save Changes",leftIcon:Fu,loading:v,onClick:()=>L(!0)}},{id:zr(),type:St.Button,buttonProps:{"data-id":"settings-cancel",variant:K.Secondary,size:W.S,label:"Cancel",leftIcon:Mu,onClick:()=>I(void 0,void 0,S)}}],[v,A,S,x,I]),B=a(()=>D.map(e=>({id:e.name,label:e.displayName})),[D]),V=a(()=>D.map(e=>e.name),[D]),{selectedSection:U,setSelectedSection:G,setSectionRef:j,setScrollContainerRef:H}=jd({sectionNames:V});return t(oc,{$gap:24,children:e(QR,{children:[t(JR,{disabled:!r,loading:h||m,onClickShowYaml:()=>M(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(b?.()),I(void 0,void 0,{})},onClickRefresh:b?()=>b():void 0}),e(od,{children:[!r&&t(xm,{minSupportedVersion:d,currentVersion:s||""}),t(vt,{isOpen:O,richTitle:{icon:ih,title:"Config Settings"},actions:F}),t(Ce,{isOpen:X,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:()=>L(!1),denyButton:{label:"Keep editing",variant:K.Secondary,onClick:()=>L(!1)},approveButton:{label:"Save changes",variant:K.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const i=(e,t,i)=>{for(let i=0;i<t.length-1;i++){const n=t[i];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=i},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&i(n,t,a.replaceAll("-","_"))}return n})(A(S,x),R);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await b())})(e),I(void 0,void 0,{})})(),L(!1)}}}),e(eP,{$gap:24,$alignItems:"stretch",children:[!!f.length&&t(ZR,{options:B,selected:U,setSelected:G,disabled:!r}),t(tP,{ref:H,$gap:24,$width:"100%",children:f.length?D.map(n=>t(Re,{id:n.name,bordered:!0,ref:e=>j(n.name,e),customTitle:t(w,{size:C.M,weight:500,color:k.Primary,children:n.displayName}),children:t($,{$gap:24,children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!c)return null;if(n.renderCondition&&!Hn(n.renderCondition,[],P))return null;const a=xn(n.componentProps||"{}",{}),o=z[n.helmValuePath],l=n.componentType===_n.Toggle,r=t(w,{size:C.XS,weight:500,color:k.Primary,children:n.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:ie.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:ie.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:ie.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(o),d=s?t(E,{...s}):null,p=n.description?t(w,{size:C.XXS,color:k.Secondary,children:n.description}):null,u=e($,{$gap:4,children:[e(T,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(Tm,{componentType:n.componentType,inputType:a.type,name:n.helmValuePath,disabled:n.isHelmOnly||v,value:N("formData",n.helmValuePath),setValue:e=>I(n.helmValuePath,e),dropdownOptions:a.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Vi.S},n.helmValuePath),g=n.isHelmOnly?t(ce,{text:"This field can only be updated via the Helm values.yaml file",children:t(Dh,{})}):null;return t($,{$gap:8,children:l?e(T,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(T,{$gap:8,$alignItems:"center",children:[g,h]})]}):e(i,{children:[u,e(iP,{children:[t(nP,{children:h}),g]})]})},n.helmValuePath)})})},n.name)):h?t(oi,{$height:"30vh",children:t(Ve,{withSpinner:!0})}):t(Re,{richTitle:{icon:ih,title:"Config Settings"},children:t(Z,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(ln,{isOpen:_,width:"40vw",minWidth:"480px",header:{icon:Hh,title:"Effective Config YAML",onClose:()=>M(!1)},children:m&&!g?.manifestYAML?t(oi,{$height:"30vh",children:t(Ve,{withSpinner:!0})}):t(gm,{yaml:g?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},lP=f.div`
|
|
2875
2875
|
position: fixed;
|
|
2876
2876
|
bottom: 12px;
|
|
2877
2877
|
left: 12px;
|
|
@@ -2901,7 +2901,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2901
2901
|
padding: 4px 8px;
|
|
2902
2902
|
border-radius: 6px;
|
|
2903
2903
|
background-color: ${({theme:e})=>e.v2.colors.grey[500]};
|
|
2904
|
-
`;function pP(e){return[e.namespace,e.name].filter(Boolean).join("/")||e.kind||"unknown"}function uP(e){const t=pP(e);return e.kind&&t!==e.kind?`${e.kind} ${t}`:t}function hP({label:e,wide:i}){return t(dP,{$wide:i,children:t(Q,{size:C.XXS,color:k.Primary,nowrap:!0,fullText:e,children:e})})}function gP({count:e,items:i}){return e<=0?null:t(ce,{text:i,maxWidth:360,children:t(Xi,{variant:_i.Default,label:`+${e}`})})}function mP({label:i,items:n}){if(!n.length)return null;const a=n.slice(0,2),o=n.slice(2),l=1===n.length;return e(cP,{children:[t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:i}),a.map(e=>t(hP,{label:e,wide:l},e)),t(gP,{count:o.length,items:o})]})}function bP({sources:i}){if(!i.length)return null;const n=i.slice(0,2),a=i.slice(2),o=1===i.length,l=new Map;for(const e of n){const t=e.kind||
|
|
2904
|
+
`;function pP(e){return[e.namespace,e.name].filter(Boolean).join("/")||e.kind||"unknown"}function uP(e){const t=pP(e);return e.kind&&t!==e.kind?`${e.kind} ${t}`:t}function hP({label:e,wide:i}){return t(dP,{$wide:i,children:t(Q,{size:C.XXS,color:k.Primary,nowrap:!0,fullText:e,children:e})})}function gP({count:e,items:i}){return e<=0?null:t(ce,{text:i,maxWidth:360,children:t(Xi,{variant:_i.Default,label:`+${e}`})})}function mP({label:i,items:n}){if(!n.length)return null;const a=n.slice(0,2),o=n.slice(2),l=1===n.length;return e(cP,{children:[t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:i}),a.map(e=>t(hP,{label:e,wide:l},e)),t(gP,{count:o.length,items:o})]})}function bP({sources:i}){if(!i.length)return null;const n=i.slice(0,2),a=i.slice(2),o=1===i.length,l=new Map;for(const e of n){const t=e.kind||Jd,i=l.get(t)??[];i.push(e),l.set(t,i)}return e(cP,{children:[[...l.entries()].map(([i,n])=>e(cP,{children:[t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:i}),n.map(e=>t(hP,{label:pP(e),wide:o},`${e.kind}-${e.namespace}-${e.name}`))]},i)),t(gP,{count:a.length,items:a.map(uP)})]})}const fP=({scopes:i})=>{if(Zp(i))return t(Xi,{variant:_i.Default,label:Hd});const a=i.languages??[],o=i.namespaces??[],l=i.sources??[],r=[a.length?t(mP,{label:Wd,items:a},"languages"):null,o.length?t(mP,{label:Kd,items:o},"namespaces"):null,l.length?t(bP,{sources:l},"sources"):null].filter(Boolean);return t(sP,{children:r.map((i,a)=>e(n.Fragment,{children:[a>0&&t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:Yd}),i]},a))})},vP=f($)`
|
|
2905
2905
|
gap: 12px;
|
|
2906
2906
|
width: 100%;
|
|
2907
2907
|
`,yP=f($)`
|
|
@@ -2945,7 +2945,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2945
2945
|
justify-content: center;
|
|
2946
2946
|
width: 100%;
|
|
2947
2947
|
padding: 4px 16px;
|
|
2948
|
-
`,TP=({rules:n,onDelete:a,onAdd:o})=>{const[r,s]=l(null),c=o?t(H,{"data-id":"url-templatization-disabled-scopes-add",label:
|
|
2948
|
+
`,TP=({rules:n,onDelete:a,onAdd:o})=>{const[r,s]=l(null),c=o?t(H,{"data-id":"url-templatization-disabled-scopes-add",label:qd,leftIcon:Tu,variant:K.Text,size:W.S,onClick:o}):null;return e(i,{children:[e(vP,{"data-id":"url-templatization-disabled-scopes-table",children:[e(yP,{children:[t(w,{size:C.S,color:k.Primary,children:Zd}),t(w,{size:C.XXS,color:k.Secondary,children:Qd(n.length)})]}),e(SP,{children:[n.map(i=>{const n=i.group.scopes??Qp(),o=`${i.actionId}-${i.groupIndex}`;return e(xP,{children:[e(wP,{children:[t(fP,{scopes:n}),t(E,{label:ir,status:ie.Warning,textSize:C.XXXS})]}),!!a&&t(CP,{className:"url-templatization-disabled-scope-delete",children:t(bn,{"data-id":`url-templatization-disabled-scope-delete-${o}`,icon:ku,size:fn.S,onClick:()=>s(i)})})]},o)}),!!c&&t(kP,{children:c})]})]}),t(hm,{isOpen:!!r,onClose:()=>s(null),onApprove:()=>{r&&a?.(r)},target:ip,description:tp,overrideApproveButtonLabel:ep})]})},IP=f($)`
|
|
2949
2949
|
gap: 12px;
|
|
2950
2950
|
width: 100%;
|
|
2951
2951
|
`,$P=f($)`
|
|
@@ -2989,7 +2989,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
2989
2989
|
justify-content: center;
|
|
2990
2990
|
width: 100%;
|
|
2991
2991
|
padding: 4px 16px;
|
|
2992
|
-
`,zP=({rules:n,onDelete:a,onAdd:o})=>{const[r,s]=l(null),c=o?t(H,{"data-id":"url-templatization-skip-policies-add",label:
|
|
2992
|
+
`,zP=({rules:n,onDelete:a,onAdd:o})=>{const[r,s]=l(null),c=o?t(H,{"data-id":"url-templatization-skip-policies-add",label:np,leftIcon:Tu,variant:K.Text,size:W.S,onClick:o}):null;return e(i,{children:[e(IP,{"data-id":"url-templatization-skip-policies-table",children:[e($P,{children:[t(w,{size:C.S,color:k.Primary,children:ap}),t(w,{size:C.XXS,color:k.Secondary,children:op(n.length)})]}),e(NP,{children:[n.map(i=>{const n=i.group.scopes??Qp(),o=`${i.actionId}-${i.groupIndex}`,l=(e=>{const t=e.skipPolicy;if(!t)return"";const i=!!t.skipForNonSuccessCodes,n=(t.skipHttpStatusCodes??[]).filter(e=>Number.isInteger(e));return i?"Skip non-2xx":1===n.length?`Skip HTTP ${n[0]}`:n.length>1?`Skip HTTP ${n.join(", ")}`:""})(i.group);return e(AP,{children:[e(OP,{children:[t(fP,{scopes:n}),!!l&&t(E,{label:l,status:ie.Info,textSize:C.XXXS})]}),!!a&&t(EP,{className:"url-templatization-skip-policy-delete",children:t(bn,{"data-id":`url-templatization-skip-policy-delete-${o}`,icon:ku,size:fn.S,onClick:()=>s(i)})})]},o)}),!!c&&t(DP,{children:c})]})]}),t(hm,{isOpen:!!r,onClose:()=>s(null),onApprove:()=>{r&&a?.(r)},target:sp,description:rp,overrideApproveButtonLabel:lp})]})},RP=f($)`
|
|
2993
2993
|
width: 100%;
|
|
2994
2994
|
gap: 24px;
|
|
2995
2995
|
`,PP=f($)`
|
|
@@ -3002,7 +3002,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
3002
3002
|
`,LP=f($)`
|
|
3003
3003
|
width: 100%;
|
|
3004
3004
|
gap: 24px;
|
|
3005
|
-
`,_P=({disabledRules:i=[],skipPolicyRules:n=[],onDisableForScope:a,onAddSkipPolicy:o,onDeleteDisabledRule:l,onDeleteSkipPolicyRule:r})=>t("div",{"data-id":"url-templatization-default-normalization-card",children:t(Re,{padding:32,children:e(RP,{children:[e(PP,{children:[e(XP,{children:[t(w,{size:C.M,color:k.Primary,children:
|
|
3005
|
+
`,_P=({disabledRules:i=[],skipPolicyRules:n=[],onDisableForScope:a,onAddSkipPolicy:o,onDeleteDisabledRule:l,onDeleteSkipPolicyRule:r})=>t("div",{"data-id":"url-templatization-default-normalization-card",children:t(Re,{padding:32,children:e(RP,{children:[e(PP,{children:[e(XP,{children:[t(w,{size:C.M,color:k.Primary,children:cp}),t(E,{label:dp,status:ie.Success,textSize:C.XXXS})]}),t(w,{size:C.XS,color:k.Secondary,children:pp})]}),t(LT,{"data-id":"url-templatization-advanced",label:up,summary:hp(i.length,n.length),children:e(LP,{children:[t(TP,{rules:i,onDelete:l,onAdd:a}),t(zP,{rules:n,onDelete:r,onAdd:o})]})})]})})}),MP=f.div`
|
|
3006
3006
|
position: relative;
|
|
3007
3007
|
display: flex;
|
|
3008
3008
|
flex-wrap: wrap;
|
|
@@ -3063,7 +3063,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
3063
3063
|
& > button {
|
|
3064
3064
|
width: 100%;
|
|
3065
3065
|
}
|
|
3066
|
-
`,JP=({onEnableDefault:i,onDismiss:n})=>{const a=v();return e(MP,{"data-id":"url-templatization-default-empty","aria-label":`${
|
|
3066
|
+
`,JP=({onEnableDefault:i,onDismiss:n})=>{const a=v();return e(MP,{"data-id":"url-templatization-default-empty","aria-label":`${gp}, ${qo}`,children:[!!n&&t(FP,{children:t(bn,{"data-id":"url-templatization-enable-default-dismiss",icon:Mu,size:fn.S,onClick:n})}),e(BP,{children:[t(VP,{"aria-hidden":!0,children:t(yh,{size:18,fill:a.v2.colors.purple[300]})}),e(UP,{children:[e(GP,{children:[e(jP,{children:[t(w,{size:C.S,color:k.Primary,children:gp}),t(E,{label:qo,leftIcon:kh,backgroundColor:a.v2.colors.purple[700],textColor:a.v2.colors.white[500],textSize:C.XXXS})]}),t(w,{size:C.XXS,color:k.Secondary,children:mp})]}),e(HP,{children:[e(WP,{children:[t(nh,{size:14,fill:a.v2.colors.grey[300]}),t(w,{size:C.XXXS,color:k.Secondary,children:bp})]}),t(KP,{"aria-hidden":!0}),e(WP,{children:[t(ch,{size:14,fill:a.v2.colors.grey[300]}),t(w,{size:C.XXXS,color:k.Secondary,children:fp})]})]})]})]}),t(YP,{children:t(H,{"data-id":"url-templatization-enable-default",label:vp,rightIcon:Iu,variant:K.Secondary,size:W.S,onClick:i})})]})},qP=f($)`
|
|
3067
3067
|
width: 100%;
|
|
3068
3068
|
flex: 1;
|
|
3069
3069
|
min-height: 0;
|
|
@@ -3186,7 +3186,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
3186
3186
|
width: 18px;
|
|
3187
3187
|
height: 18px;
|
|
3188
3188
|
flex-shrink: 0;
|
|
3189
|
-
`;function fX(e){return(e.group.templatizationRules??[]).map(e=>e.template).filter(e=>!!e?.trim())}function vX(e,t){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())}const yX=({actions:i,onCreateGroup:n,onEditGroup:o,onViewTemplate:r})=>{const[s,c]=l("groups"),[d,p]=l({}),[u,h]=l({}),g=e=>!0===d[e],m=e=>!1!==u[e],b=a(()=>i.reduce((e,t)=>e+t.groups.reduce((e,t)=>e+fX(t).length,0),0),[i]);return e(qP,{"data-id":"url-templatization-custom-templates-list",children:[e(ZP,{children:[e(QP,{children:[t(w,{size:C.S,children:
|
|
3189
|
+
`;function fX(e){return(e.group.templatizationRules??[]).map(e=>e.template).filter(e=>!!e?.trim())}function vX(e,t){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())}const yX=({actions:i,onCreateGroup:n,onEditGroup:o,onViewTemplate:r})=>{const[s,c]=l("groups"),[d,p]=l({}),[u,h]=l({}),g=e=>!0===d[e],m=e=>!1!==u[e],b=a(()=>i.reduce((e,t)=>e+t.groups.reduce((e,t)=>e+fX(t).length,0),0),[i]);return e(qP,{"data-id":"url-templatization-custom-templates-list",children:[e(ZP,{children:[e(QP,{children:[t(w,{size:C.S,children:yp}),t(E,{label:b,textSize:C.XXXS})]}),e(T,{$gap:8,$alignItems:"center",children:[t(w,{size:C.XS,color:k.Secondary,children:Sp}),t(F,{"data-id":"url-templatization-custom-view",size:Zt.L,selected:s,setSelected:c,options:[{value:"groups",label:xp},{value:"tree",label:wp,disabled:!0},{value:"list",label:Cp,disabled:!0}]})]})]}),t(eX,{children:i.map(i=>{const a=g(i.id),l=i.groups.reduce((e,t)=>e+fX(t).length,0),s=()=>p(e=>({...e,[i.id]:!g(i.id)}));return e(tX,{children:[e(iX,{role:"button",tabIndex:0,"aria-expanded":a,"aria-label":a?"Collapse action":"Expand action",onClick:s,onKeyDown:e=>vX(e,s),children:[t(bX,{children:t(a?Gu:wu,{size:18})}),t(nX,{children:e(aX,{children:[t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:sl}),e(oX,{children:[t(w,{size:C.XS,color:k.Primary,nowrap:!0,lineHeight:"1",children:i.name||Ro}),t(YT,{actionName:i.name}),t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:kp(i.groups.length,l)})]})]})}),t(H,{"data-id":`url-templatization-create-group-${i.id}`,label:Tp,rightIcon:Tu,variant:K.Text,size:W.S,onClick:e=>{e.stopPropagation(),n?.(i.id)}})]}),a&&e(sX,{children:[e(cX,{children:[t(w,{size:C.XXS,color:k.Secondary,children:Ip}),t(E,{label:i.groups.length,textSize:C.XXXS})]}),t(dX,{children:i.groups.map(i=>{const n=`${i.actionId}-${i.groupIndex}`,a=m(n),l=fX(i),s=yT(i.group),c=()=>h(e=>({...e,[n]:!m(n)}));return e(pX,{children:[e(uX,{role:"button",tabIndex:0,"aria-expanded":a,"aria-label":a?"Collapse templating scope":"Expand templating scope",onClick:c,onKeyDown:e=>vX(e,c),children:[t(bX,{children:t(a?Gu:wu,{size:18})}),t(nX,{children:e(oX,{children:[t(lX,{children:t(fP,{scopes:s})}),e(rX,{children:[t(w,{size:C.XXXS,color:k.Secondary,nowrap:!0,children:Jo(l.length)}),o&&t(hX,{className:"url-templatization-edit-group",children:t(bn,{"data-id":`url-templatization-edit-group-${n}`,icon:Au,size:fn.XS,onClick:e=>{e.stopPropagation(),o(i)}})})]})]})})]}),a&&t(gX,{children:l.map((e,a)=>t(mX,{$clickable:!!r,onClick:()=>r?.(i,e),children:t(IT,{copyable:!0,template:e,"data-id":`url-templatization-template-${n}-${a}`})},`${n}-${a}`))})]},n)})})]})]},i.id)})})]})},SX=f.div`
|
|
3190
3190
|
display: flex;
|
|
3191
3191
|
flex-wrap: wrap;
|
|
3192
3192
|
align-items: center;
|
|
@@ -3221,7 +3221,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
3221
3221
|
&:enabled:hover {
|
|
3222
3222
|
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
3223
3223
|
}
|
|
3224
|
-
`,TX=({onCreateCustomRule:i})=>{const n=v();return e(SX,{"data-id":"url-templatization-custom-empty",children:[e(xX,{children:[t(wX,{"aria-hidden":!0,children:t(
|
|
3224
|
+
`,TX=({onCreateCustomRule:i})=>{const n=v();return e(SX,{"data-id":"url-templatization-custom-empty",children:[e(xX,{children:[t(wX,{"aria-hidden":!0,children:t(ih,{size:18,fill:n.v2.colors.grey[300]})}),e(CX,{children:[t(w,{size:C.S,color:k.Primary,children:$p}),t(w,{size:C.XXS,color:k.Secondary,children:Np})]})]}),t(kX,{"data-id":"url-templatization-create-template",label:Ap,variant:K.Text,size:W.M,onClick:i})]})},IX=f.div`
|
|
3225
3225
|
display: flex;
|
|
3226
3226
|
flex-direction: column;
|
|
3227
3227
|
flex: 1;
|
|
@@ -3287,7 +3287,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
3287
3287
|
outline-offset: 2px;
|
|
3288
3288
|
border-radius: 4px;
|
|
3289
3289
|
}
|
|
3290
|
-
`,XX=e=>e.split(/(\{[^}]+\}|\d+)/g).filter(Boolean).map((e,i)=>{const n=e.startsWith("{")&&e.endsWith("}")||/^\d+$/.test(e);return t(zX,{$accent:n,children:e},`${e}-${i}`)}),LX=({docsUrl:i,onEnableDefault:n,onCreateCustomRule:a})=>{const o=v();return t(IX,{"data-id":"url-templatization-onboarding",children:t(Re,{padding:32,fullHeight:!0,children:t($X,{children:e(NX,{children:[e($,{$gap:8,children:[t(w,{variant:Tn.H2,size:C.M,color:k.Primary,children
|
|
3290
|
+
`,XX=e=>e.split(/(\{[^}]+\}|\d+)/g).filter(Boolean).map((e,i)=>{const n=e.startsWith("{")&&e.endsWith("}")||/^\d+$/.test(e);return t(zX,{$accent:n,children:e},`${e}-${i}`)}),LX=({docsUrl:i,onEnableDefault:n,onCreateCustomRule:a})=>{const o=v();return t(IX,{"data-id":"url-templatization-onboarding",children:t(Re,{padding:32,fullHeight:!0,children:t($X,{children:e(NX,{children:[e($,{$gap:8,children:[t(w,{variant:Tn.H2,size:C.M,color:k.Primary,children:Op}),t(w,{size:C.XS,color:k.Secondary,children:Ep})]}),e(AX,{"aria-label":"URL templatization example",children:[e(OX,{children:[t(EX,{children:t(w,{size:C.XXXS,color:k.Secondary,align:"center",children:Dp})}),t(DX,{children:XX(Pp)})]}),e(OX,{children:[t(EX,{children:t(w,{size:C.XXXS,color:k.Secondary,align:"center",children:zp})}),t(DX,{children:XX(Xp)})]})]}),e(RX,{children:[t(JP,{onEnableDefault:n}),t(TX,{onCreateCustomRule:a})]}),i?e(PX,{type:"button","data-id":"url-templatization-onboarding-docs",onClick:()=>window.open(i,"_blank","noopener,noreferrer"),"aria-label":`${Rp} (opens in a new tab)`,children:[t($u,{size:14,fill:o.v2.colors.purple[400]}),t(w,{size:C.XXS,color:k.Link,weight:500,children:Rp}),t(bh,{size:12,fill:o.v2.colors.purple[400]})]}):null]})})})})},_X=f(oc)`
|
|
3291
3291
|
padding-right: 24px;
|
|
3292
3292
|
`,MX=f($)`
|
|
3293
3293
|
flex: 1;
|
|
@@ -3295,4 +3295,4 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useMem
|
|
|
3295
3295
|
width: 100%;
|
|
3296
3296
|
gap: 24px;
|
|
3297
3297
|
overflow-y: auto;
|
|
3298
|
-
`,FX=({docsUrl:n=
|
|
3298
|
+
`,FX=({docsUrl:n=Lp})=>{const{actionsApi:o,sourcesApi:r}=Jh(),{items:s,loading:c,refetch:p}=o.useActions(),{items:u}=r.useSources(),[h,g]=l(!1),[m,b]=l(null),[f,v]=l(null),[y,S]=l(!1),[x,w]=l(!1),[C,k]=l(!1),[I,$]=l(!1),[N,A]=l(!1),[O,E]=l(),[z,R]=l(!1),[P,X]=l(null),L=a(()=>$T(s),[s]),_=L[0]??null,M=a(()=>L.flatMap(e=>(e.fields.urlTemplatizationRulesGroups??[]).map((t,i)=>({actionId:e.id,actionName:e.name||Ro,groupIndex:i,group:t}))),[L]),F=a(()=>{const e=[],t=new Map;for(const i of M){const n=t.get(i.actionId);void 0!==n?e[n].groups.push(i):(t.set(i.actionId,e.length),e.push({id:i.actionId,name:i.actionName,groups:[i]}))}return e},[M]),B=(e=>!!e&&(e.fields.urlTemplatizationDefaultGroups??[]).length>0)(_),V=a(()=>(e=>$T(e).filter(e=>!e.disabled).flatMap(e=>(e.fields.urlTemplatizationDefaultGroups??[]).map((t,i)=>({action:e,group:t,groupIndex:i})).filter(({group:e})=>!0===e.disabled).map(({action:e,group:t,groupIndex:i})=>({actionId:e.id,actionName:e.name||Ro,groupIndex:i,group:t}))))(L),[L]),U=a(()=>function(e){return $T(e).filter(e=>!e.disabled).flatMap(e=>(e.fields.urlTemplatizationDefaultGroups??[]).map((t,i)=>({action:e,group:t,groupIndex:i})).filter(({group:e})=>(e=>{const t=e.skipPolicy;return!!t&&(!!t.skipForNonSuccessCodes||(t.skipHttpStatusCodes??[]).some(e=>Number.isInteger(e)))})(e)).map(({action:e,group:t,groupIndex:i})=>({actionId:e.id,actionName:e.name||Ro,groupIndex:i,group:t})))}(L),[L]),G=(e=>$T(e).some(e=>(e=>!!e&&(e.fields.urlTemplatizationRulesGroups??[]).some(e=>e.templatizationRules?.some(e=>!!e.template?.trim())))(e)))(s),j=a(()=>u.map(e=>({id:`${e.id.namespace}/${e.id.kind}/${e.id.name}`,label:e.id.name,badge:e.id.kind,secondaryLabel:e.id.namespace})),[u]),H=a(()=>Array.from(new Set(u.map(e=>e.id.namespace))).sort().map(e=>({id:e,label:e})),[u]),Y=d(()=>{b(null),v(null),S(!0),w(!1),g(!0)},[]),J=d(()=>{b(null),v(null),S(!1),w(!0),g(!0)},[]),Z=d(async()=>{const e=fT(mT());_?await o.update(_.id,{type:_.type,name:_.name,notes:_.notes,disabled:_.disabled,signals:_.signals,fields:{..._.fields,[D.UrlTemplatizationDefaultGroups]:[..._.fields.urlTemplatizationDefaultGroups??[],e]}}):await o.create({type:q.URLTemplatization,name:Ro,disabled:!1,signals:[ae.Traces],fields:{[D.UrlTemplatizationDefaultGroups]:[e]}})},[_,o]),Q=d(async e=>{const t=L.find(t=>t.id===e.actionId);if(t){$(!0);try{const i=(t.fields.urlTemplatizationDefaultGroups??[]).filter((t,i)=>i!==e.groupIndex);await o.update(t.id,{type:t.type,name:t.name,notes:t.notes,disabled:t.disabled,signals:t.signals,fields:{...t.fields,[D.UrlTemplatizationDefaultGroups]:i}})}finally{$(!1)}}},[o,L]),ee=d(async e=>{const t=L.find(t=>t.id===e.actionId);if(t){$(!0);try{const i=(t.fields.urlTemplatizationDefaultGroups??[]).map((t,i)=>i===e.groupIndex?{...t,skipPolicy:null}:t);await o.update(t.id,{type:t.type,name:t.name,notes:t.notes,disabled:t.disabled,signals:t.signals,fields:{...t.fields,[D.UrlTemplatizationDefaultGroups]:i}})}finally{$(!1)}}},[o,L]),te=d(()=>{I||(g(!1),b(null),v(null),S(!1),w(!1))},[I]),ie=d(()=>{E(void 0),A(!0)},[]),ne=d(e=>{E({step:2,destination:"template-group",groupMode:"new",existingGroupIndex:null,targetActionId:e,createNewAction:!1}),A(!0)},[]),oe=d((e,t)=>{const i=M.findIndex(t=>t.actionId===e.actionId&&t.groupIndex===e.groupIndex);i<0||(E({step:2,destination:"template-group",groupMode:"existing",existingGroupIndex:i,targetActionId:e.actionId,createNewAction:!1,loadExistingGroupTemplates:!0,replaceExistingGroupTemplates:!0,focusTemplate:t}),A(!0))},[M]),le=d(()=>{z||(A(!1),E(void 0))},[z]),re=d((e,t)=>{X({template:t,actionName:e.actionName,actionId:e.actionId,groupIndex:e.groupIndex,scopes:yT(e.group),groupTemplates:(e.group.templatizationRules??[]).map(e=>e.template?.trim()||"").filter(Boolean)})},[]),se=d(()=>{X(null)},[]),ce=d(e=>{if(!P)return;const t=M.find(e=>e.actionId===P.actionId&&e.groupIndex===P.groupIndex);t&&(X(null),oe(t,e))},[M,oe,P]),de=d(()=>{if(!P)return;const e=M.find(e=>e.actionId===P.actionId&&e.groupIndex===P.groupIndex);e&&(X(null),oe(e))},[M,oe,P]),pe=a(()=>{if(y)return{...mT(),enabled:!1};if(x)return{...mT(),enabled:!0,skipForNonSuccessCodes:!0};if(!f)return;const e=L.find(e=>e.id===f.actionId),t=e?.fields.urlTemplatizationDefaultGroups?.[f.groupIndex];return t?(e=>{const t=e.skipPolicy,i=(t?.skipHttpStatusCodes??[]).filter(e=>Number.isInteger(e)),n=!!t?.skipForNonSuccessCodes,a=!n&&i.length>0;return{scopes:Up(e.scopes),enabled:!e.disabled,skipForNonSuccessCodes:n,skipSelectedHttpStatusCodes:a,skipHttpStatusCodesInput:a?i.join(", "):""}})(t):void 0},[y,x,f,L]),ue=d(async e=>{$(!0);try{const t=fT(e),i=f?L.find(e=>e.id===f.actionId)??null:_;if(i){const e=i.fields.urlTemplatizationDefaultGroups??[],n=f?.groupIndex??m,a=null==n?[...e,t]:e.map((e,i)=>i===n?t:e);await o.update(i.id,{type:i.type,name:i.name,notes:i.notes,disabled:i.disabled,signals:i.signals,fields:{...i.fields,[D.UrlTemplatizationDefaultGroups]:a}})}else{const e=await o.create({type:q.URLTemplatization,name:Ro,disabled:!1,signals:[ae.Traces],fields:{[D.UrlTemplatizationDefaultGroups]:[t]}});if(e?.error)return}g(!1),b(null),v(null),S(!1),w(!1)}finally{$(!1)}},[_,o,m,f,L]),he=d(async e=>{R(!0);try{const i={scopes:Zp((t=e).scopes)?null:t.scopes,templatizationRules:t.templates.map(e=>e.trim()).filter(Boolean).map(e=>({template:e}))};if(null!==e.existingGroupIndex){const t=M[e.existingGroupIndex],n=L.find(e=>e.id===t?.actionId);if(!t||!n)return;const a=n.fields.urlTemplatizationRulesGroups??[],l=!!e.replaceExistingGroupTemplates;return await o.update(n.id,{type:n.type,name:n.name,notes:n.notes,disabled:n.disabled,signals:n.signals,fields:{...n.fields,[D.UrlTemplatizationRulesGroups]:a.map((n,a)=>a===t.groupIndex?l?i:((e,t)=>{const i=t.map(e=>e.trim()).filter(Boolean).map(e=>({template:e}));return{...e,templatizationRules:[...e.templatizationRules??[],...i]}})(n,e.templates):n)}}),A(!1),void E(void 0)}const n=e.createNewAction?null:"entire-cluster"===e.destination?L.find(e=>e.name===Ro)??null:e.targetActionId?L.find(t=>t.id===e.targetActionId)??null:L.find(e=>e.name===Ro)??null;if(n)await o.update(n.id,{type:n.type,name:n.name,notes:n.notes,disabled:n.disabled,signals:n.signals,fields:{...n.fields,[D.UrlTemplatizationRulesGroups]:[...n.fields.urlTemplatizationRulesGroups??[],i]}});else{const t="entire-cluster"===e.destination?Ro:e.createNewAction&&e.newActionName.trim()||Ro,n=await o.create({type:q.URLTemplatization,name:t,disabled:!1,signals:[ae.Traces],fields:{[D.UrlTemplatizationRulesGroups]:[i]}});if(n?.error)return}A(!1),E(void 0)}finally{R(!1)}var t},[o,M,L]),ge=d(async e=>{if(null!==e.existingGroupIndex){R(!0);try{const t=M[e.existingGroupIndex],i=L.find(e=>e.id===t?.actionId);if(!t||!i)return;const n=i.fields.urlTemplatizationRulesGroups??[];await o.update(i.id,{type:i.type,name:i.name,notes:i.notes,disabled:i.disabled,signals:i.signals,fields:{...i.fields,[D.UrlTemplatizationRulesGroups]:n.filter((e,i)=>i!==t.groupIndex)}}),A(!1),E(void 0)}finally{R(!1)}}},[o,M,L]),me=a(()=>{const e=[];return n&&e.push({id:zr(),type:St.Button,buttonProps:{"data-id":"url-templatization-btn-docs",label:_p,leftIcon:$u,size:W.S,variant:K.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:zr(),type:St.Button,buttonProps:{"data-id":"url-templatization-btn-refresh",label:"Refresh",size:W.S,variant:K.Text,onClick:p,loading:c}}),G&&e.push({id:zr(),type:St.Button,buttonProps:{"data-id":"url-templatization-btn-create",label:Mp,rightIcon:Tu,size:W.S,variant:K.Primary,onClick:ie}}),e},[n,ie,G,c,p]);return e(_X,{"data-id":"url-templatization-page",children:[e(T,{$gap:12,$justifyContent:"space-between",children:[t(lc,{icon:wh,title:Bp,subTitle:Fp}),t(rc,{actions:me})]}),c&&!s.length?t(oi,{$height:"320px",children:t(Ve,{})}):t(MX,{children:B||G?e(i,{children:[B?t(i,{children:t(_P,{disabledRules:V,skipPolicyRules:U,onDisableForScope:Y,onAddSkipPolicy:J,onDeleteDisabledRule:Q,onDeleteSkipPolicyRule:ee})}):!C&&t(JP,{onEnableDefault:Z,onDismiss:()=>k(!0)}),G?t(yX,{actions:F,onCreateGroup:ne,onEditGroup:oe,onViewTemplate:re}):t(TX,{onCreateCustomRule:ie})]}):t(LX,{docsUrl:n,onEnableDefault:Z,onCreateCustomRule:ie})}),t(CI,{isOpen:h,mode:null===f?"create":"edit",disableForScope:y,skipPolicyForScope:x,initialFormState:pe,submitting:I,onClose:te,onSubmit:ue,sourceOptions:j,namespaceOptions:H}),t(bI,{isOpen:N,submitting:z,prefill:O,templatizationActions:L.map(e=>({id:e.id,name:e.name||Ro})),existingGroups:M,onClose:le,onSubmit:he,onDelete:ge,sourceOptions:j,namespaceOptions:H}),t(EI,{isOpen:!!P,template:P?.template??"",actionName:P?.actionName,actionId:P?.actionId,scopes:P?.scopes,groupTemplates:P?.groupTemplates,onClose:se,onEdit:ce,onEditGroup:de})]})};export{hy as AddActionDrawer,hb as AddActionForm,BI as AddDataStreamModal,Cy as AddDestinationDrawer,mb as AddDestinationForm,ky as AddRuleDrawer,Cb as AddRuleForm,Fy as AddSourceDrawer,K$ as CentralConnections,Dx as CloudConnectorStep,Px as CreateCloudConnectorDrawer,B$ as CreateNewType,Tb as DataStreamForm,kb as DataStreamMergeWarning,uy as DetectionPolicyForm,Mx as EditActionDrawer,Fx as EditConfigDrawer,VI as EditDataStreamModal,Vx as EditDestinationDrawer,Gx as EditRuleDrawer,Nk as EditSourceDrawer,Ib as EditSourceForm,cf as GuardrailForm,gD as Insights,Ff as LearningPolicyForm,ND as Onboarding,jI as OnboardingDone,zz as Overview,Qz as PipelineCollectors,iT as RecommendationsDrawer,Yg as RegexTesterDrawer,Gv as RiskModelDrawer,Mk as SECTION_ORDER,M$ as SamplingOnboardingModal,gT as SamplingRuleDrawer,Db as SamplingRuleForm,lR as SamplingRules,HR as ServiceMap,oP as Settings,FI as SystemDrawer,nv as SystemSettingsForm,Zz as TABS,rP as ToastList,FX as UrlTemplatization,bI as UrlTemplatizationCustomTemplateDrawer,CI as UrlTemplatizationDefaultRuleDrawer,EI as UrlTemplatizationTemplateViewDrawer,_k as countRecommended,Xk as getRecommendationState,Lk as groupRecommendations};
|