@odigos/ui-kit 0.0.275 → 0.0.277
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-BkaWRtR9.js → helpers-DifX1XM0.js} +1 -1
- package/lib/chunks/{index-D3cEk2g_.js → index-BxDn2YI2.js} +1 -1
- package/lib/chunks/source-instrument-form-context-HMXzB4jU.js +5 -0
- package/lib/chunks/{ui-components-BUMZXMZ4.js → ui-components-B2sd5xH7.js} +230 -230
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/create-cloud-connector-drawer/index.d.ts +1 -1
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/setup-artifacts.d.ts +7 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/setup-credentials/methods.d.ts +2 -0
- package/lib/containers.js +242 -216
- package/lib/contexts/cloud-connector-form-context.d.ts +1 -1
- package/lib/contexts/odigos-api/hooks/use-sources-api.d.ts +1 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store/useFilterStore.d.ts +4 -0
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/cloud-connectors/index.d.ts +14 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/source-instrument-form-context-B40tRNcP.js +0 -5
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMemo as i,useEffect as a,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 m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMemo as i,useEffect as a,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 m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,g as T,f as k,e as I,q as E,h as N,j as O,k as $,p as A,l as D,c as R,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as J,I as q,J as Z}from"./chunks/helpers-DifX1XM0.js";import{C as Q,e as ee,g as te,f as ne,h as oe,bx as ie,F as ae,by as le,bz as re,bA as se,bB as ce,bn as de,d as pe,k as ue,I as he,bC as me,o as ge,p as fe,w as be,Y as ve,bD as ye,bE as Ce,ar as Se,bF as xe,bG as we,B as Te,i as ke,j as Ie,x as Ee,a4 as Ne,bo as Oe,b0 as $e,bH as Ae,bI as De,u as Re,N as _e,S as Pe,bJ as Le,bt as Fe,bu as Me,bs as ze,bK as Be,af as Xe,T as Ue,ad as Ve,ae as He,ab as je,aa as Ge,ac as We,a9 as Ke,b7 as Ye,a8 as Je,bL as qe,bM as Ze,bN as Qe,bO as et,W as tt,m as nt,bb as ot,bP as it,bQ as at,bR as lt,bS as rt,bT as st,bU as ct,bV as dt,bW as pt,Q as ut,bX as ht,bY as mt,bZ as gt,a$ as ft,br as bt,s as vt,b_ as yt,b$ as Ct,b1 as St,c0 as xt,c1 as wt,aY as Tt,v as kt,bv as It,ba as Et,q as Nt,c2 as Ot,bc as $t,c3 as At,c4 as Dt,be as Rt,c5 as _t,b3 as Pt,c6 as Lt,l as Ft,y as Mt,D as zt,c7 as Bt,ag as Xt,c8 as Ut,c9 as Vt,n as Ht,bh as jt,bm as Gt,z as Wt,ca as Kt,cb as Yt,bl as Jt,cc as qt,a3 as Zt,cd as Qt,ce as en,b6 as tn,H as nn,cf as on,cg as an,ch as ln,ci as rn,cj as sn,ck as cn,cl as dn,cm as pn,O as un,cn as hn,co as mn,A as gn,b2 as fn,a_ as bn,cp as vn,cq as yn,cr as Cn,cs as Sn,ct as xn,cu as wn,bw as Tn,cv as kn,cw as In,cx as En,cy as Nn,cz as On,b as $n,cA as An,cB as Dn,M as Rn,cC as _n,cD as Pn,cE as Ln,cF as Fn,cG as Mn,cH as zn,cI as Bn,cJ as Xn,cK as Un,cL as Vn,cM as Hn,cN as jn,cO as Gn,cP as Wn,cQ as Kn,cR as Yn,cS as Jn,aO as qn,cT as Zn,cU as Qn,cV as eo,cW as to,cX as no,cY as oo,cZ as io,c_ as ao,c$ as lo,d0 as ro,d1 as so,d2 as co,d3 as po,d4 as uo,d5 as ho,ax as mo,d6 as go,d7 as fo,b4 as bo,d8 as vo,d9 as yo,da as Co,db as So,dc as xo,dd as wo,de as To,df as ko,dg as Io,dh as Eo,di as No,dj as Oo,dk as $o,dl as Ao,dm as Do,dn as Ro,dp as _o,dq as Po,dr as Lo,ds as Fo,dt as Mo,du as zo,dv as Bo,dw as Xo,dx as Uo,dy as Vo,dz as Ho,dA as jo,dB as Go,dC as Wo,dD as Ko,dE as Yo,dF as Jo,dG as qo,dH as Zo,dI as Qo,dJ as ei,dK as ti,dL as ni,dM as oi,dN as ii,dO as ai,dP as li,dQ as ri,dR as si,dS as ci,dT as di,dU as pi,dV as ui,dW as hi,dX as mi,dY as gi,dZ as fi,d_ as bi,d$ as vi,e0 as yi,e1 as Ci,e2 as Si,e3 as xi,e4 as wi,e5 as Ti,e6 as ki,e7 as Ii,e8 as Ei,e9 as Ni,ea as Oi,eb as $i,ec as Ai,ed as Di,ee as Ri,ef as _i,eg as Pi,eh as Li,ei as Fi,ej as Mi,ek as zi,el as Bi,P as Xi,em as Ui,en as Vi,eo as Hi,ep as ji,eq as Gi,er as Wi,es as Ki,aZ as Yi,et as Ji,$ as qi,eu as Zi,ev as Qi,ew as ea,ex as ta,ey as na,ez as oa,eA as ia,eB as aa,eC as la,eD as ra,eE as sa,eF as ca,bd as da,eG as pa,R as ua,a as ha,eH as ma,eI as ga,eJ as fa,eK as ba,eL as va,eM as ya,eN as Ca,eO as Sa,eP as xa,eQ as wa,eR as Ta,eS as ka,eT as Ia,eU as Ea,eV as Na,eW as Oa,eX as $a,eY as Aa,eZ as Da,e_ as Ra,e$ as _a,f0 as Pa}from"./chunks/ui-components-B2sd5xH7.js";import{ChevronRightIcon as La,ActionIcon as Fa,TrashIcon as Ma,PlusIcon as za,ArrowRightIcon as Ba,VSquareIcon as Xa,XSquareIcon as Ua,BookIcon as Va,DeleteIcon as Ha,EditIcon as ja,GoLogo as Ga,JavaLogo as Wa,PhpLogo as Ka,DestinationIcon as Ya,ChevronUpIcon as Ja,ChevronDownIcon as qa,VIcon as Za,XIcon as Qa,InstrumentationRuleIcon as el,SourceIcon as tl,NamespacesIcon as nl,AzureIcon as ol,GoogleCloudPlatformLogo as il,AwsLogo as al,CloudConnectorIcon as ll,EyeOpenIcon as rl,OdigosLogo as sl,ArrowLeftIcon as cl,ISquareIcon as dl,RefreshIcon as pl,SettingsIcon as ul,PodIcon as hl,K8sLogo as ml,ExclamationCircleIcon as gl,QuestionCircleIcon as fl,InboundIcon as bl,OutboundIcon as vl,UserIcon as yl,TerminalIcon as Cl,RefreshLeftArrowIcon as Sl,MinusIcon as xl,SearchIcon as wl,ExpandIcon as Tl,CopyIcon as kl,DotIcon as Il,ArrowDownIcon as El,DownloadIcon as Nl,SamplingIcon as Ol,ExclamationTriangleIcon as $l,KeyIcon as Al,DiagnoseIcon as Dl,StarIcon as Rl,ArrowIcon as _l,ConnectionsIcon as Pl,FilterIcon as Ll,DataStreamIcon as Fl,PipelineCollectorIcon as Ml,ArrowDownSquareIcon as zl,ArrowUpSquareIcon as Bl,GatewayIcon as Xl,YamlIcon as Ul,ImageErrorIcon as Vl,LockIcon as Hl}from"./icons.js";import{h as jl,o as Gl,n as Wl,q as Kl,m as Yl,t as Jl,s as ql,S as Zl,w as Ql,E as er,x as tr,y as nr,v as or,l as ir,d as ar,O as lr,f as rr,b as sr,A as cr,R as dr,C as pr,e as ur,D as hr}from"./chunks/source-instrument-form-context-HMXzB4jU.js";import{n as mr,f as gr,k as fr,I as br,l as vr,A as yr,i as Cr,P as Sr,S as xr,R as wr,g as Tr,j as kr,c as Ir,h as Er,m as Nr,W as Or,C as $r,b as Ar,Y as Dr,O as Rr,a as _r,U as Pr,e as Lr}from"./chunks/index-BxDn2YI2.js";import{createPortal as Fr}from"react-dom";import{MarkerType as Mr,useNodesState as zr,useEdgesState as Br,Handle as Xr,Position as Ur,getSmoothStepPath as Vr,BaseEdge as Hr,EdgeLabelRenderer as jr,ReactFlowProvider as Gr,ReactFlow as Wr,Background as Kr,Controls as Yr,ControlButton as Jr,useReactFlow as qr}from"@xyflow/react";import Zr from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const Qr=b.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -42,7 +42,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
42
42
|
`,Ss=b.div`
|
|
43
43
|
/* Pushes the arrow down to sit next to the inputs rather than the field titles. */
|
|
44
44
|
padding-top: 24px;
|
|
45
|
-
`,xs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ws=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Ts=de.UrlTemplatizationRulesGroups,ks=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Is={[Oe.K8sAttributes]:({value:o,setValue:i,formErrors:l})=>(a(()=>{o[de.CollectContainerAttributes]||o[de.CollectReplicaSetAttributes]||o[de.CollectWorkloadId]||o[de.CollectClusterId]||o[de.LabelsAttributes]?.length||o[de.AnnotationsAttributes]?.length||(i(de.CollectContainerAttributes,!0),i(de.CollectReplicaSetAttributes,!0),i(de.CollectWorkloadId,!0),i(de.CollectClusterId,!0),i(de.LabelsAttributes,[]),i(de.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ae,{$gap:6,children:ds.map(({id:n,label:a})=>e(ae,{children:[t(Q,{label:a,value:o[n]||!1,onChange:e=>i(n,e)}),t(ue,{errorMessage:l[n]})]},n))}),t(he,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:us,values:o[de.LabelsAttributes]||[],setValues:e=>i(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:hs,values:o[de.AnnotationsAttributes]||[],setValues:e=>i(de.AnnotationsAttributes,e),errorMessage:l[de.AnnotationsAttributes]})]})),[Oe.AddClusterInfo]:({value:o,setValue:i,formErrors:a})=>{const l=v();return e(n,{children:[t(ge,{label:"Overwrite existing values",labelAlign:fe.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[de.OverwriteExistingValues]||!1,onChange:e=>i(de.OverwriteExistingValues,e)}),t(he,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:o[de.ClusterAttributes]||[],setValues:e=>i(de.ClusterAttributes,e),errorMessage:a[de.ClusterAttributes]})]})},[Oe.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(be,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[de.AttributeNamesToDelete]||[],setValues:e=>n(de.AttributeNamesToDelete,e),errorMessage:o[de.AttributeNamesToDelete]}),[Oe.RenameAttributes]:({value:e,setValue:n,formErrors:o})=>{const i=e[de.Renames],[r,s]=l(()=>xs(i));return a(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(ws(r),i||{})||s(xs(i))},[i]),t(he,{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),n(de.Renames,ws(t))},errorMessage:o[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[de.PiiCategories]?.length||o(de.PiiCategories,cs.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:cs.map(({id:e,label:i})=>t(Q,{label:i,value:n[de.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=n[de.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);o(de.PiiCategories,a)}},e))}),t(ue,{errorMessage:i[de.PiiCategories]})]})),[Oe.URLTemplatization]:({value:o,setValue:i,formErrors:a})=>{const l=v(),s=o[Ts]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Ts,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(r,{children:[t(Ee,{}),e(ae,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${o+1}`}),t(Te,{leftIcon:()=>t(Ma,{fill:l.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(Ne,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(he,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ks,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(be,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ue,{errorMessage:a[Ts]})]},`url-templatization-group-${o}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:za,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ee,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:o,formErrors:i})=>{const r=v(),s=i[ms],c=n[ms]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(vs)?gs.Regex:gs.Preset)(c)),[u,h]=l(null),m=e=>o(ms,{extractions:e});a(()=>{0===c.length&&m([d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===gs.Preset,y=c.length?c:[b?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:gs.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:gs.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ae,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const i=o===y.length-1,a=n.dataFormat||Ce.JSON,l=xe[a];return e(ys,{"data-id":`extract-row-${o}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ae,{$gap:10,children:[t(pe,{label:b?ye.PRESET_ROW_TITLE(o):ye.REGEX_ROW_TITLE(o)}),b&&t(oe,{$gap:24,children:fs.map(e=>t(Se,{"data-id":`extract-row-${o}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!b&&t(Te,{"data-id":`extract-row-${o}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:Ie.Secondary,size:ke.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(Te,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(Ma,{fill:r.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(Te,{"data-id":`extract-row-${o}-add`,leftIcon:za,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Cs,{children:t(Ne,{name:`extract-row-${o}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Ss,{children:t(Ba,{size:24,fill:r.v2.colors.silver[200]})}),t(Cs,{children:t(Ne,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(ae,{$gap:12,$width:"100%",children:[t(Ne,{name:`extract-row-${o}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(Ne,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(ue,{errorMessage:s})]}),t(mr,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},Ns=({actionType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=Is[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},Es=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=jl();if(!i||!o)return t($e,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=i;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:o.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(Ne,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>s("name",e),errorMessage:c.name}),t(Ns,{actionType:o.type,dynamicFields:o.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>s(`fields.${e}`,t),formErrors:c,sourceOptions:a,namespaceOptions:l}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},Os=b(oe)`
|
|
45
|
+
`,xs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ws=e=>{const t={};return e.forEach(({oldKey:e,newKey:n})=>{t[e]=n}),t},Ts=de.UrlTemplatizationRulesGroups,ks=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Is={[Oe.K8sAttributes]:({value:o,setValue:i,formErrors:l})=>(a(()=>{o[de.CollectContainerAttributes]||o[de.CollectReplicaSetAttributes]||o[de.CollectWorkloadId]||o[de.CollectClusterId]||o[de.LabelsAttributes]?.length||o[de.AnnotationsAttributes]?.length||(i(de.CollectContainerAttributes,!0),i(de.CollectReplicaSetAttributes,!0),i(de.CollectWorkloadId,!0),i(de.CollectClusterId,!0),i(de.LabelsAttributes,[]),i(de.AnnotationsAttributes,[]))},[]),e(n,{children:[t(ae,{$gap:6,children:ds.map(({id:n,label:a})=>e(ae,{children:[t(Q,{label:a,value:o[n]||!1,onChange:e=>i(n,e)}),t(ue,{errorMessage:l[n]})]},n))}),t(he,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:us,values:o[de.LabelsAttributes]||[],setValues:e=>i(de.LabelsAttributes,e),errorMessage:l[de.LabelsAttributes]}),t(he,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:hs,values:o[de.AnnotationsAttributes]||[],setValues:e=>i(de.AnnotationsAttributes,e),errorMessage:l[de.AnnotationsAttributes]})]})),[Oe.AddClusterInfo]:({value:o,setValue:i,formErrors:a})=>{const l=v();return e(n,{children:[t(ge,{label:"Overwrite existing values",labelAlign:fe.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:o[de.OverwriteExistingValues]||!1,onChange:e=>i(de.OverwriteExistingValues,e)}),t(he,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:o[de.ClusterAttributes]||[],setValues:e=>i(de.ClusterAttributes,e),errorMessage:a[de.ClusterAttributes]})]})},[Oe.DeleteAttributes]:({value:e,setValue:n,formErrors:o})=>t(be,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[de.AttributeNamesToDelete]||[],setValues:e=>n(de.AttributeNamesToDelete,e),errorMessage:o[de.AttributeNamesToDelete]}),[Oe.RenameAttributes]:({value:e,setValue:n,formErrors:o})=>{const i=e[de.Renames],[r,s]=l(()=>xs(i));return a(()=>{((e,t)=>{const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e[n])})(ws(r),i||{})||s(xs(i))},[i]),t(he,{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),n(de.Renames,ws(t))},errorMessage:o[de.Renames]})},[Oe.PiiMasking]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[de.PiiCategories]?.length||o(de.PiiCategories,cs.map(({id:e})=>e))},[]),e(ae,{$gap:12,children:[t(pe,{label:"Attributes to mask"}),t(ae,{$gap:6,children:cs.map(({id:e,label:i})=>t(Q,{label:i,value:n[de.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=n[de.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);o(de.PiiCategories,a)}},e))}),t(ue,{errorMessage:i[de.PiiCategories]})]})),[Oe.URLTemplatization]:({value:o,setValue:i,formErrors:a})=>{const l=v(),s=o[Ts]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Ts,e),d=(e,t)=>c(s.map((n,o)=>o===e?{...n,...t}:n));return e(n,{children:[s.map((n,o)=>e(r,{children:[t(Ne,{}),e(ae,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(pe,{label:`Rule Group ${o+1}`}),t(Te,{leftIcon:()=>t(Ma,{fill:l.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>{return e=o,c(s.filter((t,n)=>n!==e));var e},disabled:1===s.length})]}),t(Ee,{name:`urlGroup-${o}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:n.filterK8sNamespace||"",onChange:e=>d(o,{filterK8sNamespace:e.target.value})}),t(he,{name:`urlGroup-${o}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ks,values:n.workloadFilters||[],setValues:e=>d(o,{workloadFilters:e})}),t(be,{name:`urlGroup-${o}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:n.templatizationRules.map(e=>e.template),setValues:e=>d(o,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ue,{errorMessage:a[Ts]})]},`url-templatization-group-${o}`)),t(Te,{variant:Ie.Secondary,label:"Add rule group",leftIcon:za,onClick:()=>c([...s,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(Ne,{})]})},[Oe.ExtractAttribute]:({value:n,setValue:o,formErrors:i})=>{const r=v(),s=i[ms],c=n[ms]?.extractions||[],[d,p]=l(()=>(e=>e.length&&e.some(vs)?gs.Regex:gs.Preset)(c)),[u,h]=l(null),m=e=>o(ms,{extractions:e});a(()=>{0===c.length&&m([d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((n,o)=>o===e?{...n,...t}:n))},f=()=>{m([...c,d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===gs.Preset,y=c.length?c:[b?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ae,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:gs.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]},{value:gs.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:r.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ae,{$gap:8,$width:"100%",children:[y.map((n,o)=>{const i=o===y.length-1,a=n.dataFormat||Ce.JSON,l=xe[a];return e(ys,{"data-id":`extract-row-${o}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ae,{$gap:10,children:[t(pe,{label:b?ye.PRESET_ROW_TITLE(o):ye.REGEX_ROW_TITLE(o)}),b&&t(oe,{$gap:24,children:fs.map(e=>t(Se,{"data-id":`extract-row-${o}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(o,{dataFormat:e})},`extract-row-${o}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!b&&t(Te,{"data-id":`extract-row-${o}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:Ie.Secondary,size:ke.S,onClick:()=>h(o),disabled:!n.regex?.trim()}),t(Te,{"data-id":`extract-row-${o}-delete`,leftIcon:()=>t(Ma,{fill:r.v2.colors.red[500]}),variant:Ie.Secondary,size:ke.S,onClick:()=>(e=>{const t=c.filter((t,n)=>n!==e);m(t.length?t:[d===gs.Preset?bs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(o)}),i&&t(Te,{"data-id":`extract-row-${o}-add`,leftIcon:za,variant:Ie.Secondary,size:ke.S,onClick:f})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Cs,{children:t(Ee,{name:`extract-row-${o}-lookupKey`,label:l.keyLabel,placeholder:l.placeholder,helpMessage:l.helpMessage,width:"100%",value:n.lookupKey||"",onChange:e=>g(o,{lookupKey:e.target.value})})}),t(Ss,{children:t(Ba,{size:24,fill:r.v2.colors.silver[200]})}),t(Cs,{children:t(Ee,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})})]}):e(ae,{$gap:12,$width:"100%",children:[t(Ee,{name:`extract-row-${o}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:n.regex||"",onChange:e=>g(o,{regex:e.target.value})}),t(Ee,{name:`extract-row-${o}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:n.targetAttributeName||"",onChange:e=>g(o,{targetAttributeName:e.target.value})})]})]},`extract-row-${o}`)}),t(ue,{errorMessage:s})]}),t(mr,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})},[Oe.DbQueryTemplatization]:null,[Oe.InferDbAttributes]:null},Es=({actionType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,signals:l,sourceOptions:r,namespaceOptions:s})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:l||[],seedInitialValues:!0,keyValuePersistAs:"map",sourceOptions:r,namespaceOptions:s},e);const c=Is[e];return c?t(c,{value:n,setValue:o,formErrors:i}):null},Ns=()=>{const n=v(),{selectedOption:o,genericForm:i,sourceOptions:a,namespaceOptions:l}=jl();if(!i||!o)return t($e,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=i;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:o.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:De.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>o.docsUrl&&window.open(o.docsUrl,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"Signals for processing",allowedSignals:o.allowedSignals,selectedSignals:r.signals||[],setSelectedSignals:e=>s("signals",e),errorMessage:c.signals}),t(Ee,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:r.name||"",onChange:({target:{value:e}})=>s("name",e),errorMessage:c.name}),t(Es,{actionType:o.type,dynamicFields:o.fields,signals:r.signals||[],value:r.fields,setValue:(e,t)=>s(`fields.${e}`,t),formErrors:c,sourceOptions:a,namespaceOptions:l}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes||"",onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},Os=b(oe)`
|
|
46
46
|
position: sticky;
|
|
47
47
|
bottom: 4px;
|
|
48
48
|
align-self: center;
|
|
@@ -53,7 +53,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{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
|
-
`,$s=s(({isEdit:n},o)=>{const i=v(),{isK8s:r}=S(),{destinationsApi:s}=Gl(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Wl(),[b,y]=l(h?.testResult),[C,x]=l(!!h);a(()=>{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(Be(p.formData));return y(e),e};return c(o,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(ae,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(_e,{status:Pe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(_e,{status:Pe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[r&&t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:Re.S,selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"This connection will monitor:",allowedSignals:ze(d.option.supportedSignals),selectedSignals:Me(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Fe.Logs),metrics:e.includes(Fe.Metrics),traces:e.includes(Fe.Traces),profiles:e.includes(Fe.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(Ne,{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:C,errorMessage:p.formErrors.name}),t(gr,{signals:Me(p.formData.exportedSignals),fields:d.option.fields,disabled:C,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const n=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",n?p.formData.fields.map(n=>n.key===e?{...n,value:t}:n):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!n&&e(Os,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Ha,variant:Ie.Secondary,textColor:i.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:Ie.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:ja,variant:Ie.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t($e,{title:"No active form"})});$s.displayName="AddDestinationForm";const As=[{id:Xe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Xe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Xe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Rs=[{id:Xe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Xe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Xe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ds=["*"],_s=[{id:He.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:He.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:He.DbQuery,label:"Collect DB query",tooltip:""},{id:He.Messaging,label:"Collect messaging",tooltip:""}],Ps={[Ke.Java]:[new Ge("","")],[Ke.Golang]:[new je("")],[Ke.Php]:[new We("","")]},Ls={[Je.CodeAttributes]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=i(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);a(()=>{if(!d.length&&!c){const e={[Xe.FilePath]:!0,[Xe.Function]:!0,[Xe.LineNumber]:!0,[Xe.Column]:null,[Xe.Namespace]:null,[Xe.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Xe).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ae,{$gap:6,children:As.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]}),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ae,{$gap:6,children:Rs.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Je.CustomInstrumentation]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=i(()=>(o?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),p=i(()=>(o?.customInstrumentations?.[Ke.Java]||[]).map(e=>new Ge(e.className,e.methodName)),[o]),u=i(()=>(o?.customInstrumentations?.[Ke.Php]||[]).map(e=>new We(e.className,e.functionName)),[o]);return a(()=>{o?.customInstrumentations||c||l("customInstrumentations",{[Ke.Golang]:Ps[Ke.Golang],[Ke.Java]:Ps[Ke.Java],[Ke.Php]:Ps[Ke.Php]})},[]),e(n,{children:[e(ae,{children:[e(oe,{$gap:8,children:[t(Ga,{}),t(pe,{label:"Golang custom probes"})]}),t(he,{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[Ke.Golang]=e.map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=p,t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Wa,{}),t(pe,{label:"Java custom probes"})]}),t(he,{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[Ke.Golang]=d,t[Ke.Java]=e.map(e=>new Ge(e.className,e.methodName)),t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Ka,{}),t(pe,{label:"PHP custom probes"})]}),t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(he,{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[Ke.Golang]=d,t[Ke.Java]=p,t[Ke.Php]=e.map(e=>new We(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Je.HeadersCollection]:({value:e,setValue:n,formErrors:o,disabled:l})=>{const r=o.headersCollection,s=i(()=>e?.headersCollection?.[Ve.HeaderKeys]||[],[e]),c=e=>{const t={[Ve.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{s.length||r||c(Ds)},[]),t(be,{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})},[Je.PayloadCollection]:({value:n,setValue:o,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=i(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return a(()=>{if(!c.length&&!s){const e={[He.HttpRequest]:{},[He.HttpResponse]:{},[He.DbQuery]:{},[He.Messaging]:{}};o("payloadCollection",e)}},[]),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ae,{$gap:6,children:_s.map(({id:e,label:n,tooltip:i})=>t(Ue,{text:i,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),i={[He.HttpRequest]:n.includes(He.HttpRequest)?{}:null,[He.HttpResponse]:n.includes(He.HttpResponse)?{}:null,[He.DbQuery]:n.includes(He.DbQuery)?{}:null,[He.Messaging]:n.includes(He.Messaging)?{}:null};o("payloadCollection",i)})(e,t),disabled:r})},e))}),t(ue,{errorMessage:s})]})},[Je.UnknownType]:null},Fs=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Ls[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},Ms=()=>{const n=v(),{isEnterprise:o,isK8s:a}=S(),{selectedOption:l,genericForm:r,sourceOptions:s,namespaceOptions:c}=Kl(),d=i(()=>qe(l?.supportedLanguages),[l?.supportedLanguages]),p=i(()=>{if(l)return l.type===Je.CustomInstrumentation?[]:Ze(l.supportedLanguages)},[l]);if(!r||!l)return t($e,{title:"No active form"});const{formData:u,handleFormChange:h,formErrors:m}=r;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:l.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:Re.S,selected:u.disabled,setSelected:e=>h("disabled",e),disabled:!o}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>l.docsUrl&&window.open(l.docsUrl,"_blank","noopener noreferrer")})]})]}),t(br,{option:l,formState:u}),!!d.length&&e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),d.map(e=>t(ce,{label:et(e),leftIcon:Qe(e),backgroundColor:n.v2.colors.purple[900]},e))]}),a&&t(vr,{scopes:u.sourceScopes,onChange:e=>h("sourceScopes",e),sourceOptions:s,namespaceOptions:c,supportedLanguages:p,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(Ne,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:u.ruleName,onChange:({target:{value:e}})=>h("ruleName",e),errorMessage:m.ruleName,disabled:!o}),t(Fs,{ruleType:l.type,dynamicFields:l.fields,value:u,setValue:(e,t)=>h(e,t),formErrors:m,disabled:!o}),t(De,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:u.notes,onChange:({target:{value:e}})=>h("notes",e),errorMessage:m.notes,disabled:!o})]})},zs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Yl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(tt,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:nt.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:Ie.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:Ie.Secondary,onClick:o}})},Bs=({autoFocus:n})=>{const{dataStreams:o}=ot(),{genericForm:a,excludeName:l,editingName:r}=Yl(),{formData:s,formErrors:c,handleFormChange:d}=a,p=s.name,u=i(()=>o.find(e=>e.name===p&&e.name!==l),[o,p,l]);return e(ae,{$width:"100%",$gap:12,children:[t(Ne,{name:"data-stream-name",label:nt.STREAM_NAME,placeholder:nt.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:nt.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(_e,{status:Pe.Warning,message:nt.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Xs=()=>{const{selectedStreamName:e}=ot(),{genericForm:n}=Jl();if(!n)return t($e,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(Ne,{name:"sourceName",label:nt.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Us=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Vs=b.div`
|
|
56
|
+
`,$s=s(({isEdit:n},o)=>{const i=v(),{isK8s:r}=S(),{destinationsApi:s}=Gl(),{activeForm:d,genericForm:p,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Wl(),[b,y]=l(h?.testResult),[C,x]=l(!!h);a(()=>{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(Be(p.formData));return y(e),e};return c(o,()=>({testConnection:w,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,p,s]),p&&d?e(ae,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(_e,{status:Pe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(_e,{status:Pe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[r&&t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:De.S,selected:p.formData.disabled,setSelected:e=>p.handleFormChange("disabled",e),disabled:C}),t(Te,{"data-id":"dest-form-docs",leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]})]}),t(fr,{title:"This connection will monitor:",allowedSignals:ze(d.option.supportedSignals),selectedSignals:Me(p.formData.exportedSignals),setSelectedSignals:e=>p.handleFormChange("exportedSignals",{logs:e.includes(Fe.Logs),metrics:e.includes(Fe.Metrics),traces:e.includes(Fe.Traces),profiles:e.includes(Fe.Profiles)}),disabled:C,errorMessage:p.formErrors.exportedSignals}),t(Ee,{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:C,errorMessage:p.formErrors.name}),t(gr,{signals:Me(p.formData.exportedSignals),fields:d.option.fields,disabled:C,value:Object.fromEntries(p.formData.fields.map(e=>[e.key,e.value])),setValue:(e,t)=>{const n=p.formData.fields.some(t=>t.key===e);p.handleFormChange("fields",n?p.formData.fields.map(n=>n.key===e?{...n,value:t}:n):[...p.formData.fields,{key:e,value:t}]),e&&p.formErrors[e]&&p.handleErrorChange(e,void 0)},formErrors:p.formErrors,keyValuePersistAs:"array"}),!n&&e(Os,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Ha,variant:Ie.Secondary,textColor:i.v2.colors.red[500],onClick:()=>f(d.unsavedIdx)})}),r&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:Ie.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:ja,variant:Ie.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},n)}}})}),!h&&t("div",{style:{width:"150px"},children:t(Te,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:Ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),n=!!e&&!e.succeeded;m({formData:t,testResult:e},n)}}})})]})]}):t($e,{title:"No active form"})});$s.displayName="AddDestinationForm";const As=[{id:Xe.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Xe.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Xe.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ds=[{id:Xe.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Xe.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Xe.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Rs=["*"],_s=[{id:He.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:He.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:He.DbQuery,label:"Collect DB query",tooltip:""},{id:He.Messaging,label:"Collect messaging",tooltip:""}],Ps={[Ke.Java]:[new Ge("","")],[Ke.Golang]:[new je("")],[Ke.Php]:[new We("","")]},Ls={[Je.CodeAttributes]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.codeAttributes,d=i(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);a(()=>{if(!d.length&&!c){const e={[Xe.FilePath]:!0,[Xe.Function]:!0,[Xe.LineNumber]:!0,[Xe.Column]:null,[Xe.Namespace]:null,[Xe.StackTrace]:null};l("codeAttributes",e)}},[]);const p=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),o=Object.values(Xe).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});l("codeAttributes",o)};return e(n,{children:[e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ae,{$gap:6,children:As.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]}),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ae,{$gap:6,children:Ds.map(({id:e,label:n,tooltip:o})=>t(Ue,{text:o,withIcon:!0,children:t(Q,{label:n,value:d.includes(e),onChange:t=>p(e,t),disabled:s})},e))}),t(ue,{errorMessage:c})]})]})},[Je.CustomInstrumentation]:({value:o,setValue:l,formErrors:r,disabled:s})=>{const c=r.customInstrumentations,d=i(()=>(o?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),p=i(()=>(o?.customInstrumentations?.[Ke.Java]||[]).map(e=>new Ge(e.className,e.methodName)),[o]),u=i(()=>(o?.customInstrumentations?.[Ke.Php]||[]).map(e=>new We(e.className,e.functionName)),[o]);return a(()=>{o?.customInstrumentations||c||l("customInstrumentations",{[Ke.Golang]:Ps[Ke.Golang],[Ke.Java]:Ps[Ke.Java],[Ke.Php]:Ps[Ke.Php]})},[]),e(n,{children:[e(ae,{children:[e(oe,{$gap:8,children:[t(Ga,{}),t(pe,{label:"Golang custom probes"})]}),t(he,{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[Ke.Golang]=e.map(e=>new je(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=p,t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Wa,{}),t(pe,{label:"Java custom probes"})]}),t(he,{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[Ke.Golang]=d,t[Ke.Java]=e.map(e=>new Ge(e.className,e.methodName)),t[Ke.Php]=u,l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2,disabled:s})]}),e(ae,{children:[e(oe,{$gap:8,children:[t(Ka,{}),t(pe,{label:"PHP custom probes"})]}),t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),t(he,{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[Ke.Golang]=d,t[Ke.Java]=p,t[Ke.Php]=e.map(e=>new We(e.className,e.functionName)),l("customInstrumentations",t)},errorMessage:c,limitFieldsPerRow:2})]})]})},[Je.HeadersCollection]:({value:e,setValue:n,formErrors:o,disabled:l})=>{const r=o.headersCollection,s=i(()=>e?.headersCollection?.[Ve.HeaderKeys]||[],[e]),c=e=>{const t={[Ve.HeaderKeys]:e};n("headersCollection",t)};return a(()=>{s.length||r||c(Rs)},[]),t(be,{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})},[Je.PayloadCollection]:({value:n,setValue:o,formErrors:l,disabled:r})=>{const s=l.payloadCollection,c=i(()=>Object.entries(n.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);return a(()=>{if(!c.length&&!s){const e={[He.HttpRequest]:{},[He.HttpResponse]:{},[He.DbQuery]:{},[He.Messaging]:{}};o("payloadCollection",e)}},[]),e(ae,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ae,{$gap:6,children:_s.map(({id:e,label:n,tooltip:i})=>t(Ue,{text:i,withIcon:!0,children:t(Q,{label:n,value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),i={[He.HttpRequest]:n.includes(He.HttpRequest)?{}:null,[He.HttpResponse]:n.includes(He.HttpResponse)?{}:null,[He.DbQuery]:n.includes(He.DbQuery)?{}:null,[He.Messaging]:n.includes(He.Messaging)?{}:null};o("payloadCollection",i)})(e,t),disabled:r})},e))}),t(ue,{errorMessage:s})]})},[Je.UnknownType]:null},Fs=({ruleType:e,value:n,setValue:o,formErrors:i,dynamicFields:a,disabled:l})=>{if(!e)return null;if(a?.length)return t(gr,{fields:a,value:n||{},setValue:o,formErrors:i||{},signals:[],seedInitialValues:!0,keyValuePersistAs:"map",disabled:l},e);const r=Ls[e];return r?t(r,{value:n,setValue:o,formErrors:i,disabled:l}):null},Ms=()=>{const n=v(),{isEnterprise:o,isK8s:a}=S(),{selectedOption:l,genericForm:r,sourceOptions:s,namespaceOptions:c}=Kl(),d=i(()=>qe(l?.supportedLanguages),[l?.supportedLanguages]),p=i(()=>{if(l)return l.type===Je.CustomInstrumentation?[]:Ze(l.supportedLanguages)},[l]);if(!r||!l)return t($e,{title:"No active form"});const{formData:u,handleFormChange:h,formErrors:m}=r;return e(ae,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ae,{size:te.XXXS,maxLines:2,children:l.description}),e(oe,{$gap:12,children:[t(ve,{options:[{icon:Xa,label:"Enabled",value:!1,selectedBgColor:n.v2.colors.green[800]},{icon:Ua,label:"Disabled",value:!0,selectedBgColor:n.v2.colors.red[800]}],size:De.S,selected:u.disabled,setSelected:e=>h("disabled",e),disabled:!o}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>l.docsUrl&&window.open(l.docsUrl,"_blank","noopener noreferrer")})]})]}),t(br,{option:l,formState:u}),!!d.length&&e(oe,{$gap:12,children:[t(ee,{size:te.XS,color:ne.Secondary,nowrap:!0,children:"Supported Languages:"}),d.map(e=>t(ce,{label:et(e),leftIcon:Qe(e),backgroundColor:n.v2.colors.purple[900]},e))]}),a&&t(vr,{scopes:u.sourceScopes,onChange:e=>h("sourceScopes",e),sourceOptions:s,namespaceOptions:c,supportedLanguages:p,dataIdPrefix:"instrumentation-rule",slim:!0,disabled:!o}),t(Ee,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:u.ruleName,onChange:({target:{value:e}})=>h("ruleName",e),errorMessage:m.ruleName,disabled:!o}),t(Fs,{ruleType:l.type,dynamicFields:l.fields,value:u,setValue:(e,t)=>h(e,t),formErrors:m,disabled:!o}),t(Re,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:u.notes,onChange:({target:{value:e}})=>h("notes",e),errorMessage:m.notes,disabled:!o})]})},zs=()=>{const{pendingMerge:e,confirmMerge:n,cancelMerge:o}=Yl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(tt,{isOpen:!0,onClose:o,title:"Merge with existing Data Stream?",description:nt.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:Ie.Primary,onClick:n},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:Ie.Secondary,onClick:o}})},Bs=({autoFocus:n})=>{const{dataStreams:o}=ot(),{genericForm:a,excludeName:l,editingName:r}=Yl(),{formData:s,formErrors:c,handleFormChange:d}=a,p=s.name,u=i(()=>o.find(e=>e.name===p&&e.name!==l),[o,p,l]);return e(ae,{$width:"100%",$gap:12,children:[t(Ee,{name:"data-stream-name",label:nt.STREAM_NAME,placeholder:nt.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:nt.STREAM_DESCRIPTION,required:!0,autoFocus:n,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(_e,{status:Pe.Warning,message:nt.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Xs=()=>{const{selectedStreamName:e}=ot(),{genericForm:n}=Jl();if(!n)return t($e,{title:"No active form"});const{formData:o,handleFormChange:i,formErrors:a}=n;return t(Ee,{name:"sourceName",label:nt.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:o.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Us=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Vs=b.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: column;
|
|
59
59
|
gap: 24px;
|
|
@@ -63,7 +63,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
63
63
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
64
64
|
transition: opacity 0.2s ease;
|
|
65
65
|
}
|
|
66
|
-
`,js=({value:e})=>{const n=v();return t(ce,e?{status:Pe.Success,label:dt,leftIcon:Xa}:{label:pt,leftIcon:Ua,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Gs=({value:e,onChange:n})=>{const o=v(),a=i(()=>[{icon:Xa,label:dt,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Ua,label:pt,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ve,{options:a,selected:e,setSelected:n??(()=>{}),disabled:!n})},Ws=()=>{const e=ql();switch(e.formType){case Zl.Create:return t(Ks,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Zl.View:return e.data?e.isEditing?t(Ks,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Ys,{data:e.data,renderAction:()=>t(js,{value:!e.data?.rule.disabled})}):null;case Zl.EditAutoNoisy:return t(Js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ct,sectionTitle:lt,sectionSubTitle:st,presetLabel:at,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Zl.EditAutoCostReduction:return t(Js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:lt,presetLabel:at,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Zl.EditAutoHighlyRelevant:return t(Vs,{children:t(yr,{title:e.localEnabled?void 0:it,summary:e.summary,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Ks=({category:n,formData:o,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Vs,{children:[t(xr,{category:n,formState:o,renderAction:r}),e(Hs,{$faded:!!o.disabled,children:[t(wr,{category:n,formState:o,onChange:i}),t(vr,{scopes:o.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Tr,{category:n,formState:o,onChange:i}),"highlyRelevant"===n&&t(kr,{formState:o,onChange:i}),"highlyRelevant"===n&&t(Ir,{ruleType:o.ruleType,formState:o,onChange:i}),t(
|
|
66
|
+
`,js=({value:e})=>{const n=v();return t(ce,e?{status:Pe.Success,label:dt,leftIcon:Xa}:{label:pt,leftIcon:Ua,backgroundColor:n.v2.colors.silver[500],textColor:n.v2.colors.white[500]})},Gs=({value:e,onChange:n})=>{const o=v(),a=i(()=>[{icon:Xa,label:dt,value:!0,selectedBgColor:o.v2.colors.green[800]},{icon:Ua,label:pt,value:!1,selectedBgColor:o.v2.colors.silver[500]}],[o]);return t(ve,{options:a,selected:e,setSelected:n??(()=>{}),disabled:!n})},Ws=()=>{const e=ql();switch(e.formType){case Zl.Create:return t(Ks,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Zl.View:return e.data?e.isEditing?t(Ks,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Ys,{data:e.data,renderAction:()=>t(js,{value:!e.data?.rule.disabled})}):null;case Zl.EditAutoNoisy:return t(Js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ct,sectionTitle:lt,sectionSubTitle:st,presetLabel:at,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Zl.EditAutoCostReduction:return t(Js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:lt,presetLabel:at,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Zl.EditAutoHighlyRelevant:return t(Vs,{children:t(yr,{title:e.localEnabled?void 0:it,summary:e.summary,renderAction:()=>t(Gs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Ks=({category:n,formData:o,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Vs,{children:[t(xr,{category:n,formState:o,renderAction:r}),e(Hs,{$faded:!!o.disabled,children:[t(wr,{category:n,formState:o,onChange:i}),t(vr,{scopes:o.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Tr,{category:n,formState:o,onChange:i}),"highlyRelevant"===n&&t(kr,{formState:o,onChange:i}),"highlyRelevant"===n&&t(Ir,{ruleType:o.ruleType,formState:o,onChange:i}),t(Er,{category:n,formState:o,onChange:i})]})]}),Ys=({data:n,renderAction:o})=>e(Vs,{children:[t(xr,{readOnly:!0,summary:n.summary,renderAction:o}),t(wr,{readOnly:!0,data:n}),t(vr,{readOnly:!0,scopes:x(n.rule.sourceScopes)}),t(Tr,{readOnly:!0,data:n}),t(Er,{readOnly:!0,data:n}),"highlyRelevant"===n.category&&t(Ir,{readOnly:!0,rule:n.rule})]}),Js=({enabled:n,summary:o,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:r,customInputName:s,showModeToggle:c=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=d(e=>u(e),[u]),y=d(e=>m(e),[m]),C=d(e=>f(e.target.value),[f]),S=!c||"sample"===p;return e(Vs,{children:[t(yr,{title:n?void 0:i,summary:o,renderAction:b}),t(Hs,{$faded:!n,children:e(ut,{richTitle:{title:a,subTitle:l},children:[c&&t(ae,{$alignItems:"flex-start",children:t(ve,{options:Us,selected:p,setSelected:v})}),S&&t(Cr,{description:r,options:Sr,selected:h,onSelect:y,customName:s,customLabel:ht,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},qs=({onClose:n,selectedConnectionIds:o,setSelectedConnectionIds:a,withOverlay:r})=>{const{actionsApi:s}=Gl(),{platformType:c,version:u}=S(),[h,m]=l(""),[g,f]=l(null),b=p(null),{selectedOption:v,onSelectOption:y,genericForm:C,validateFormData:x}=jl(),{options:w,loading:T}=s.useActionTypes(),k=i(()=>w.length?w:mt(c,u),[w,c,u]),I=i(()=>(h?k.filter(e=>e?.label?.toLowerCase().includes(h.toLowerCase())):k).filter(e=>!!e),[k,h]),E=d(e=>{b.current?.clearErrors(),y(e)},[y]),N=(({isLoading:e,options:n,selectedCategory:o,selectedType:a,onSelectOption:l})=>({width:"40%",list:i(()=>{if(e)return[t(le,{$padding:"8px 12px",children:t(re,{size:6})},"loading")];const i=n.reduce((e,t)=>{const n=t.category&&t.category in ls?t.category:as;return(e[n]||=[]).push(t),e},{});return Object.keys(ls).filter(e=>i[e]?.length&&(!o||o===e)).map(e=>t(ss,{bucket:e,options:i[e],selectedType:a,onSelectOption:l},e))},[e,n,o,a,l])}))({isLoading:T,options:I,selectedCategory:g,selectedType:v?.type,onSelectOption:E}),O=i(()=>{const e=new Set(k.map(e=>e.category));return[{value:null,label:"All Actions"},...Object.values(gt).filter(t=>e.has(t)).map(e=>({value:e,label:se[e].TITLE}))]},[k]),$=i(()=>T?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:v?[t(Ns,{},v.type)]:[t(ft,{$height:"100%",children:t($e,{icon:Fa,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[T,v]);return t(Nr,{ref:b,isOpen:!0,withOverlay:r,onClose:n,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=x();if(e)return!1;await s.create(t)},disableSave:!v||!C?.isFormDirty,isFormDirty:C?.isFormDirty,hideDirtyNote:!0,progress:{title:nt.CREATING_ACTION,subTitle:nt.CREATING_ACTION_SUBTITLE},header:{icon:Fa,title:nt.ADD_ACTION,subTitle:nt.ADD_ACTION_DESCRIPTION},connectionIds:o&&a?{value:o,setValue:a}:void 0,search:{value:h,onChange:m,placeholder:"Search by action name",width:"370px"},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:"Show"}),t(ve,{options:O,selected:g,setSelected:f})]}),leftColumn:N,rightColumn:{width:"60%",list:$}})},Zs=({destinationsByCategory:o,filters:a,setFilters:l})=>{const r=i(()=>Object.values(bt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>o[e.id]?.length),[o]),s=i(()=>{const e=Object.values(Fe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(n,{children:[t(vt,{placeholder:"Select category",options:r,values:a.categoryType?[a.categoryType]:[],setValues:e=>l({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(ve,{options:s,selected:a.signalType,setSelected:e=>l({...a,signalType:e})})]})},Qs=b.div`
|
|
67
67
|
display: flex;
|
|
68
68
|
flex-direction: column;
|
|
69
69
|
padding: 8px;
|
|
@@ -76,7 +76,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
76
76
|
justify-content: space-between;
|
|
77
77
|
gap: 12px;
|
|
78
78
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
79
|
-
`,tc=({title:n,tooltip:o,list:i,noBgColor:a,purpleColors:r})=>{const[s,c]=l(!0);return e(Qs,{"data-id":`collapse-${n}`,$noBgColor:a,$purpleColors:r,children:[e(ec,{$isOpen:s,children:[e(oe,{$gap:10,children:[t(ee,{size:te.XS,children:n}),o&&t(Ue,{text:o,withIcon:!0}),t(ce,{label:i.length,status:r?Pe.Default:void 0})]}),t(yt,{icon:s?Ja:qa,size:Ct.M,onClick:()=>c(e=>!e)})]}),s?t(ae,{children:i.length?u.toArray(i):t(ft,{$padding:"12px 0",children:t($e,{})})}):null]})},nc=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||ze(e.supportedSignals).includes(n.signalType))):e,oc=({option:e,formData:n,testResult:o,isSelected:i,onSelect:a})=>t(is,{icon:wt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:i,onClick:()=>a(),children:o&&t(ce,{status:o.succeeded?Pe.Success:Pe.Error,leftIcon:o.succeeded?Za:Qa})}),ic=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:i,onChangeActiveForm:a}=Wl();return n?.length?t(tc,{title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:n.map((n,o)=>t(oc,{option:n,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=n.id&&""!==n.id?i?.option.id===n.id:i?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(tc,{purpleColors:!0,title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(oc,{option:n,formData:o,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ac;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(ac||(ac={}));const lc=(e,t)=>{const n=[],o=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ac.SELF_HOSTED?o.push(...e.items):e.name===ac.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=Tt(o),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const o=kt(t.fields,{});Object.keys(o).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[i]))}}}),{[bt.DETECTED]:n,[bt.SELF_HOSTED]:o,[bt.MANAGED]:i}},rc=({onClose:e,onBack:n,onNext:o,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Gl(),[m,g]=l(""),[f,b]=l({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=Wl();a(()=>{c&&I(c)},[c]);const
|
|
79
|
+
`,tc=({title:n,tooltip:o,list:i,noBgColor:a,purpleColors:r})=>{const[s,c]=l(!0);return e(Qs,{"data-id":`collapse-${n}`,$noBgColor:a,$purpleColors:r,children:[e(ec,{$isOpen:s,children:[e(oe,{$gap:10,children:[t(ee,{size:te.XS,children:n}),o&&t(Ue,{text:o,withIcon:!0}),t(ce,{label:i.length,status:r?Pe.Default:void 0})]}),t(yt,{icon:s?Ja:qa,size:Ct.M,onClick:()=>c(e=>!e)})]}),s?t(ae,{children:i.length?u.toArray(i):t(ft,{$padding:"12px 0",children:t($e,{})})}):null]})},nc=(e,t,n)=>t||n.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!n.signalType||ze(e.supportedSignals).includes(n.signalType))):e,oc=({option:e,formData:n,testResult:o,isSelected:i,onSelect:a})=>t(is,{icon:wt(e.type).icon,title:n?.name||e.displayName,withCarret:!0,purpleColors:!!n,isSelected:i,onClick:()=>a(),children:o&&t(ce,{status:o.succeeded?Pe.Success:Pe.Error,leftIcon:o.succeeded?Za:Qa})}),ic=({listType:e,destinationOptions:n,unsavedDestinations:o})=>{const{activeForm:i,onChangeActiveForm:a}=Wl();return n?.length?t(tc,{title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:n.map((n,o)=>t(oc,{option:n,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=n.id&&""!==n.id?i?.option.id===n.id:i?.option.type===n.type),onSelect:()=>a({listType:e,option:n})},`${e}-${n.id??n.type}-${o}`))}):o?.length?t(tc,{purpleColors:!0,title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:o.map(({option:n,formData:o,testResult:l},r)=>t(oc,{option:n,formData:o,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:n,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ac;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(ac||(ac={}));const lc=(e,t)=>{const n=[],o=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ac.SELF_HOSTED?o.push(...e.items):e.name===ac.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const o of e?.destinationCategories?.categories||[]){const e=Tt(o),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const o=kt(t.fields,{});Object.keys(o).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:o[e.name]})),n.push(e.items[i]))}}}),{[bt.DETECTED]:n,[bt.SELF_HOSTED]:o,[bt.MANAGED]:i}},rc=({onClose:e,onBack:n,onNext:o,selectedConnectionIds:r,setSelectedConnectionIds:s,initialInputs:c,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Gl(),[m,g]=l(""),[f,b]=l({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=Wl();a(()=>{c&&I(c)},[c]);const E=C||x,N=i(()=>y?.destinationCategories?.categories??[],[y]),[O,$]=l({[bt.ALL]:[],[bt.UNSAVED]:[],[bt.EXISTS]:[],[bt.DETECTED]:[],[bt.SELF_HOSTED]:[],[bt.MANAGED]:[]});a(()=>{const e=v.map(e=>{let t;for(const n of N){const o=n.items.find(t=>t.type===e.destinationType.type);if(o){t=o;break}}const n=kt(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:n[e.name]??e.initialValue})):[]}});$(t=>({...t,[bt.EXISTS]:e}))},[v,N]),a(()=>{(y||S)&&$(e=>({...e,...lc(y,S)}))},[y,S]);const A=d(async()=>{for(const{option:e,formData:t}of k){const n=Be(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),o=Object.fromEntries(n.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==o[e])){await h.update(e.id,n);continue}}await h.create(n)}},[k,h]),D=(({isFetching:e,destinationsByCategory:n,searchText:o,filters:a})=>{const{unsavedDestinations:l}=Wl();return{width:"40%",list:i(()=>{const i=[];l.length&&i.push(t(ic,{listType:bt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(bt)){if(a.categoryType&&a.categoryType!==e)continue;const l=nc(n[e],o,a);l.length&&i.push(t(ic,{listType:e,destinationOptions:l},e))}return e&&i.push(t(ft,{$height:"100%",children:t(St,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),i},[l,n,o,a,e])}})({isFetching:E,destinationsByCategory:O,searchText:m,filters:f}),R=(()=>{const{activeForm:e}=Wl();return{width:"60%",list:e?[t($s,{},e.option.type)]:[t(ft,{$height:"100%",children:t($e,{icon:Ya,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Nr,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:n?()=>n(k):void 0,onNext:o?()=>o(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:E,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:nt.CREATING_DESTINATION,subTitle:nt.CREATING_DESTINATION_SUBTITLE},header:{icon:Ya,title:nt.ADD_DESTINATIONS,subTitle:nt.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:r&&s?{value:r,setValue:s}:void 0,search:{value:m,onChange:g},filters:t(Zs,{destinationsByCategory:O,filters:f,setFilters:b}),leftColumn:D,rightColumn:R})},sc=({onClose:e,selectedConnectionIds:n,setSelectedConnectionIds:o,withOverlay:a})=>{const{isEnterprise:r}=S(),{instrumentationRulesApi:s}=Gl(),[c,d]=l(""),u=p(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=Kl(),{options:b,loading:v}=s.useRuleTypes(),y=i(()=>b.length?b:It,[b]),C=i(()=>c?y.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):y,[y,c]),x=i(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:C.map(e=>{const n=h?.type===e.type;return t(is,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:n,onClick:()=>{u.current?.clearErrors(),m(e)}},e.type)}),[v,h?.type,C,m]),w=i(()=>v?[t(le,{$padding:"8px 12px",children:t(re,{size:4})},"loading")]:h?[t(Ms,{},h.type)]:[t(ft,{$height:"100%",children:t($e,{icon:el,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[v,h]);return t(Nr,{ref:u,isOpen:!0,withOverlay:a,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=f();if(e)return!1;await s.create(t,h?.type)},disableSave:!h||!g?.isFormDirty||!r,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,forcedNote:{fullWidth:!0,status:Pe.Warning,message:"This feature is only supported for OnPrem (Enterprise) installations"},progress:{title:nt.CREATING_INSTRUMENTATION_RULE,subTitle:nt.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:el,title:nt.ADD_INSTRUMENTATION_RULE,subTitle:nt.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:n&&o?{value:n,setValue:o}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:w}})},cc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:nt.FETCHING_NAMESPACES,subTitle:nt.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:nt.SELECT_NAMESPACE,subTitle:nt.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},dc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Et.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"},pc=e=>e?dc:cc,uc="No matches",hc=e=>(e?"Unselect":"Select")+" all",mc="Selected",gc=b.div``,fc=b.div`
|
|
80
80
|
visibility: hidden;
|
|
81
81
|
|
|
82
82
|
transition: visibility 0s;
|
|
@@ -119,7 +119,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
119
119
|
justify-content: flex-end;
|
|
120
120
|
align-items: center;
|
|
121
121
|
min-width: 0;
|
|
122
|
-
`,xc=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Gl(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(vc,{children:t(is,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(yc,{$withAuto:p,children:[p&&t(Cc,{$visible:r||a,children:t(Ue,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ge,{label:"Auto",labelAlign:fe.Left,size:
|
|
122
|
+
`,xc=({clusterId:n,namespaceName:o,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{capabilities:d}=Gl(),p=d.canInstrumentNamespaces,u=e=>{s(),c({clusterId:n,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return t(vc,{children:t(is,{dataId:`namespace-${o}`,withCarret:!0,title:o,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(yc,{$withAuto:p,children:[p&&t(Cc,{$visible:r||a,children:t(Ue,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ge,{label:"Auto",labelAlign:fe.Left,size:Nt.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(Sc,{children:[t(ee,{variant:Ot.Span,size:te.XXXS,color:ne.Secondary,align:"right",nowrap:!0,children:mc}),t(ce,{label:`${l.sourced}/${l.total}`,status:r?Pe.Default:Pe.Unknown,minWidth:"42px"})]})]})})})},wc=({withCollapse:e,clusterId:n,clusterName:o,namespaces:a,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=i(()=>a.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(xc,{clusterId:n,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===n&&l.namespaceName===e,onActive:()=>r({clusterId:n,clusterName:o,namespaceName:e}),handleSourceChange:s},`${n}#${e}`)),[n,o,a,l]);return e?t(tc,{title:o,list:c,noBgColor:!0}):c},Tc=({onClose:n,onBack:o,onNext:r,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isK8s:u}=S(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=Gl(),{data:f,loading:b,pending:v,refetch:y}=m.useSnapshots(),{items:C,loading:x}=g.useNamespaces({skip:v||!!f}),w=pc(!u),{selectedStreamName:T}=ot(),{progress:k,resetProgress:I}=$t(),{isFetching:E,setIsFetching:N,setSnapshots:O,formData:$,handleSourceChange:A,handleSelectAll:D,formDiff:R,isFormDirty:_}=or();a(()=>{y()},[]);const P=i(()=>{if(f)return f;const e=C;return e.length?{clusters:[{clusterId:Dt,clusterName:At,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(T),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(T)??!1)}))||[]}))}]}:null},[f,C,T]);a(()=>{N(b||x),P&&O(P)},[P,b,x,N,O]);const[L,F]=l(""),[M,z]=l(Et.Namespace),[B,X]=l({showOnlySelected:!1}),[U,V]=l({clusterId:"",clusterName:"",namespaceName:""}),H=(({isFetching:n,formData:o,handleSourceChange:a,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isK8s:u}=S(),h=pc(!u),m=i(()=>o.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>tr(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...nr(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[o,c,p]),g=i(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:n,selectedCount:o}of t)if(e=!0,o!==n)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:y}=i(()=>{const e=m.map(({clusterId:e,clusterName:n,visibleNamespaces:o})=>o.length?t(wc,{withCollapse:m.length>1,clusterId:e,clusterName:n,namespaces:o,selectedArea:r,setSelectedArea:s,handleSourceChange:a},e):null).filter(e=>null!==e),n=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),i=o.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:n!==i,filteredCount:n,totalCount:i}},[m,o,r]);return{width:"60%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ue,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:p}),disabled:!f.length,size:te.XS,children:hc(g)})]}),list:f.length?f:n?[t(ft,{$height:"100%",children:t(St,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ft,{$height:"100%",children:t($e,c?{icon:nl,title:uc,subTitle:h.noGroupMatchedFilter(c)}:{icon:nl,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:E,formData:$,handleSourceChange:A,handleSelectAll:D,selectedArea:U,setSelectedArea:V,searchText:M===Et.Namespace?L:"",searchBy:M,filters:B}),j=(({formData:n,handleSourceChange:o,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{isK8s:d,isEnterprise:p}=S(),u=pc(!d),h=i(()=>l.value.namespaceName?n.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[n,l.value.clusterId,l.value.namespaceName]),m=i(()=>h?[...h.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ql(e,r,c)):[],[h,r,c]),g=i(()=>!!m.length&&m.every(({selected:e})=>e),[m]),f=i(()=>{if(!h)return[];const{clusterId:e}=l.value,{name:n}=h;return m.map(({name:i,selected:a,kind:l,region:r})=>{const s=d&&!p&&er.has(l);return t(bc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>o({clusterId:e,workloadId:{namespace:n,name:i,kind:l,region:r}}),disabled:s},`${e}#${n}#${i}#${l}#${r??""}`)})},[m,h,l.value.clusterId,o,d,p]),{withFilterCount:b,filteredCount:v,totalCount:y}=i(()=>{const e=h?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,h]);return{width:"40%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${u.itemColumnHeader}`:u.itemColumnHeader}),t(Ue,{text:b?nt.FILTERED_COUNT_TOOLTIP:void 0,children:t(ce,{label:`${b?`${v} / ${y}`:y}`,status:Pe.Unknown})})]}),t(ee,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!g,searchText:r,searchBy:s,filters:c}),disabled:!f.length,size:te.XS,children:hc(g)})]}),list:f.length?f:[t(ft,{$height:"100%",children:t($e,h?r?{icon:tl,title:uc,subTitle:(C=r,`No sources matched the filter '${C}'`)}:{icon:tl,title:"No sources",subTitle:u.noItemsInGroupSubTitle}:{icon:tl,title:u.selectGroupPrompt.title,subTitle:u.selectGroupPrompt.subTitle})},"no-data")]};var C})({formData:$,handleSourceChange:A,handleSelectAll:D,selectedArea:{value:U},searchText:M===Et.Source?L:"",searchBy:M,filters:B});return t(Nr,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:n?()=>{I(Rt.BulkInstrumenting),n()}:void 0,onBack:o?()=>o(R):void 0,onNext:r?()=>r(R):void 0,nextIsSkip:!_,onSave:()=>h.persistV2(R),header:{icon:tl,title:nt.ADD_SOURCE,subTitle:nt.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{F(e),M===Et.Namespace&&V({clusterId:"",clusterName:"",namespaceName:""})},placeholder:w.searchPlaceholder(M),segment:{options:[{label:w.groupSegmentLabel,value:Et.Namespace},{label:w.itemSegmentLabel,value:Et.Source}],selected:M,setSelected:z}},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{name:"filter-selected",size:Nt.S,label:mc,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:_,isFetching:E,progress:{title:nt.CREATING_SOURCES,subTitle:nt.CREATING_SOURCES_SUBTITLE,percentage:k[Rt.BulkInstrumenting]?.percentage||0},leftColumn:H,rightColumn:j})},kc={aws:al,gcp:il,azure:ol},Ic={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Ec=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Nc=e=>e.provider.toUpperCase(),Oc=b.div`
|
|
123
123
|
display: flex;
|
|
124
124
|
flex-direction: column;
|
|
125
125
|
gap: 8px;
|
|
@@ -152,13 +152,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
152
152
|
border-radius: 8px;
|
|
153
153
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
154
154
|
flex-shrink: 0;
|
|
155
|
-
`,
|
|
155
|
+
`,Dc=b.div`
|
|
156
156
|
display: flex;
|
|
157
157
|
flex-direction: column;
|
|
158
158
|
gap: 2px;
|
|
159
159
|
flex: 1;
|
|
160
160
|
min-width: 0;
|
|
161
|
-
`,
|
|
161
|
+
`,Rc=({providers:n,selectedProvider:o,onSelect:i})=>{const a=v();return n.length?t(Oc,{children:n.map(n=>{const l=(e=>kc[e.provider]??ll)(n),r=n.provider===o,s=(e=>{const t=e.features.find(e=>e.key===_t.Discovery);if(!t)return"";const n=[],o=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=Ic[t]??Ec(t);o.has(i)||(o.add(i),n.push(i))}return n.join(", ")})(n);return e($c,{type:"button",$selected:r,onClick:()=>i(n.provider),"data-id":`cloud-connector-provider-${n.provider}`,children:[t(Ac,{children:t(l,{size:24})}),e(Dc,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:Nc(n)}),s&&t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]}),t(La,{size:18,fill:a.v2.colors.silver[300]})]},n.provider)})}):t(ee,{size:te.XS,color:ne.Secondary,children:"No providers available."})},_c=b.div`
|
|
162
162
|
display: flex;
|
|
163
163
|
flex-direction: column;
|
|
164
164
|
gap: 8px;
|
|
@@ -212,25 +212,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
212
212
|
line-height: 20px;
|
|
213
213
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
214
214
|
white-space: pre;
|
|
215
|
-
`,zc=({policy:n})=>{const o=v(),{CopyButton:i}=Pt();return e(_c,{children:[e(Pc,{children:[t(rl,{size:16,fill:o.v2.colors.silver[200]}),t(Lc,{children:t(ee,{size:te.XXS,color:ne.Primary,children:nt.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:n,size:Ct.XS})]}),t(Fc,{children:t(Mc,{children:n})})]})};var
|
|
215
|
+
`,zc=({policy:n})=>{const o=v(),{CopyButton:i}=Pt();return e(_c,{children:[e(Pc,{children:[t(rl,{size:16,fill:o.v2.colors.silver[200]}),t(Lc,{children:t(ee,{size:te.XXS,color:ne.Primary,children:nt.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:n,size:Ct.XS})]}),t(Fc,{children:t(Mc,{children:n})})]})},Bc="{{permissions}}";var Xc;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(Xc||(Xc={}));const Uc=[{id:Xc.DiscoveryOnly,title:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[_t.Discovery]},{id:Xc.DiscoveryInstrumentation,title:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[_t.Discovery,_t.Instrumentation]},{id:Xc.Custom,title:nt.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:nt.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],Vc=(e,t)=>e.features?.find(e=>e.key===t),Hc=e=>{if(!e)return[];const t=Vc(e,_t.Discovery),n=Vc(e,_t.Instrumentation);return t?t.types.map(e=>{const t=n?.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}}):[]},jc=()=>{const e=new Set,t=[];return{out:t,add:n=>n?.forEach(n=>{n&&!e.has(n)&&(e.add(n),t.push(n))})}},Gc=(e,t,n)=>{const o=t===Xc.Custom?((e,t)=>{if(!e)return[];const n=Hc(e),o=Vc(e,_t.Discovery),i=n.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=jc();return l(e.auth?.permissions),i&&l(o?.permissions),n.forEach(e=>{const n=t[e.typeName];n?.discovery&&l(e.discoveryPermissions),n?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,n??{}):((e,t)=>{if(!e)return[];const n=Uc.find(e=>e.id===t)?.featureKeys??[],{out:o,add:i}=jc();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&n.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),o})(e,t),i=(e=>(e?.setup?.artifacts??[]).find(e=>"permissions"===e.section&&"policy-preview"===e.id))(e);return i?((e,t)=>{const{template:n,itemTemplate:o,itemSeparator:i}=e,a=n.split("\n"),l=a.findIndex(e=>e.includes(Bc));if(-1===l)return n;const r=a[l],s=r.slice(0,r.indexOf(Bc));return 0===t.permissions.length?a.splice(l,1):a[l]=t.permissions.map(e=>{return s+(t=e,o.split("{{permission}}").join(t));var t}).join(i),a.join("\n")})(i,{permissions:o}):Wc(o)},Wc=e=>{const t={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:e,Resource:"*"}]};return JSON.stringify(t,null,2)},Kc=b.div`
|
|
216
216
|
width: 100%;
|
|
217
217
|
padding: 12px 16px;
|
|
218
218
|
border-radius: 12px;
|
|
219
219
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
220
220
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
221
|
-
`,
|
|
221
|
+
`,Yc=b.div`
|
|
222
222
|
display: grid;
|
|
223
223
|
grid-template-columns: minmax(0, 1fr) 120px 150px;
|
|
224
224
|
align-items: center;
|
|
225
225
|
row-gap: 16px;
|
|
226
226
|
column-gap: 8px;
|
|
227
|
-
`,
|
|
227
|
+
`,Jc=b.div`
|
|
228
228
|
display: flex;
|
|
229
229
|
align-items: center;
|
|
230
230
|
min-width: 0;
|
|
231
|
-
`,
|
|
231
|
+
`,qc=b(Jc)`
|
|
232
232
|
justify-content: center;
|
|
233
|
-
`,
|
|
233
|
+
`,Zc={discovery:!1,instrumentation:!1},Qc=({provider:n,capabilities:i,onCapabilitiesChange:a})=>{const l=Hc(n),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(Kc,{children:e(Yc,{children:[t(Jc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(qc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(qc,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(n=>{const a=i[n.typeName]??Zc,l=void 0!==n.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(o.Fragment,{children:[t(Jc,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.displayName})}),t(qc,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-discovery`,size:Nt.S,value:s,disabled:a.instrumentation,onChange:e=>r(n.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(qc,{children:t(ge,{name:`cloud-connector-custom-${n.typeName}-instrumentation`,size:Nt.S,value:a.instrumentation,disabled:!l,onChange:e=>r(n.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},n.typeName)})]})}):null},ed=b.div`
|
|
234
234
|
display: flex;
|
|
235
235
|
flex-direction: column;
|
|
236
236
|
gap: 8px;
|
|
@@ -239,12 +239,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
239
239
|
padding: 8px;
|
|
240
240
|
border-radius: 0 16px 16px 0;
|
|
241
241
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
242
|
-
`,
|
|
242
|
+
`,td=b.div`
|
|
243
243
|
display: flex;
|
|
244
244
|
flex-direction: column;
|
|
245
245
|
gap: 8px;
|
|
246
246
|
width: 100%;
|
|
247
|
-
`,
|
|
247
|
+
`,nd=b.div`
|
|
248
248
|
display: flex;
|
|
249
249
|
align-items: center;
|
|
250
250
|
gap: 10px;
|
|
@@ -252,7 +252,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
252
252
|
padding: 4px 12px 4px 4px;
|
|
253
253
|
border-radius: 8px;
|
|
254
254
|
background-color: ${({theme:e})=>e.v2.colors.purple[900]};
|
|
255
|
-
`,
|
|
255
|
+
`,od=b.div`
|
|
256
256
|
display: flex;
|
|
257
257
|
align-items: center;
|
|
258
258
|
justify-content: center;
|
|
@@ -261,30 +261,30 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
261
261
|
border-radius: 6px;
|
|
262
262
|
flex-shrink: 0;
|
|
263
263
|
background-color: ${({theme:e})=>e.v2.colors.purple[800]};
|
|
264
|
-
`,
|
|
264
|
+
`,id=({message:n})=>{const o=v();return e(nd,{children:[t(od,{children:t(sl,{fill:"#B08BFD",size:24})}),t(ee,{size:te.XXS,color:o.v2.colors.purple[300],children:n})]})},ad=({provider:n,selectedPermission:o,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(ed,{children:Uc.map(r=>{const s=r.id===o,c=r.id===Xc.Custom,d=s?e(td,{children:[c&&t(Qc,{provider:n,capabilities:a,onCapabilitiesChange:l}),t(zc,{policy:Gc(n,r.id,a)})]}):void 0,p=s?t(id,{message:c?nt.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:nt.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Lt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:p},r.id)})}),ld=b.div`
|
|
265
265
|
display: flex;
|
|
266
266
|
flex-direction: column;
|
|
267
267
|
padding: 16px;
|
|
268
|
-
`,
|
|
268
|
+
`,rd=b.div`
|
|
269
269
|
display: flex;
|
|
270
270
|
flex-direction: column;
|
|
271
271
|
gap: 16px;
|
|
272
272
|
padding: 16px;
|
|
273
273
|
border-radius: 16px;
|
|
274
274
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
275
|
-
`,
|
|
275
|
+
`,sd=b.div`
|
|
276
276
|
display: flex;
|
|
277
277
|
flex-direction: column;
|
|
278
278
|
gap: 4px;
|
|
279
|
-
`,
|
|
279
|
+
`,cd=b.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
align-items: stretch;
|
|
282
282
|
width: 100%;
|
|
283
|
-
`,
|
|
283
|
+
`,dd=b.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex: 0 0 40%;
|
|
286
286
|
min-width: 0;
|
|
287
|
-
`,
|
|
287
|
+
`,pd=()=>{const{providers:n,genericForm:o}=ir(),[r,s]=l(!0),c=i(()=>n.find(e=>e.provider===o.formData.provider),[n,o.formData.provider]),p=d(e=>{e!==o.formData.provider&&o.handleFormChange(void 0,void 0,{...o.formData,provider:e,authMethod:"",setupMethod:"",accountId:"",credentials:{},customCapabilities:{}})},[o]);return a(()=>{!o.formData.provider&&n.length>0&&p(n[0].provider)},[n,o.formData.provider,p]),a(()=>{o.formData.permission||o.handleFormChange("permission",Xc.DiscoveryInstrumentation)},[o.formData.permission,o]),t(ld,{children:e(rd,{children:[e(sd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:nt.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),r&&t(_e,{fullWidth:!0,maxWidth:"800px",smallIcon:!0,status:Pe.Info,message:nt.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Ft.CLOSE,onClick:()=>s(!1)}}),e(cd,{children:[t(dd,{children:t(Rc,{providers:n,selectedProvider:o.formData.provider,onSelect:p})}),t(ad,{provider:c,selectedPermission:o.formData.permission,onSelect:e=>o.handleFormChange("permission",e),capabilities:o.formData.customCapabilities,onCapabilitiesChange:e=>o.handleFormChange("customCapabilities",e)})]})]})})},ud=b.div`
|
|
288
288
|
display: flex;
|
|
289
289
|
flex-direction: column;
|
|
290
290
|
gap: 16px;
|
|
@@ -292,12 +292,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
292
292
|
padding: 12px;
|
|
293
293
|
border-radius: 8px;
|
|
294
294
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
295
|
-
`,
|
|
295
|
+
`,hd=b.div`
|
|
296
296
|
display: flex;
|
|
297
297
|
align-items: center;
|
|
298
298
|
gap: 12px;
|
|
299
299
|
width: 100%;
|
|
300
|
-
`,
|
|
300
|
+
`,md=b.div`
|
|
301
301
|
display: flex;
|
|
302
302
|
align-items: center;
|
|
303
303
|
justify-content: center;
|
|
@@ -306,41 +306,59 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
306
306
|
height: 24px;
|
|
307
307
|
border-radius: 16px;
|
|
308
308
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
309
|
-
`,
|
|
309
|
+
`,gd=b.div`
|
|
310
310
|
display: flex;
|
|
311
311
|
flex: 1;
|
|
312
312
|
flex-direction: column;
|
|
313
313
|
gap: 2px;
|
|
314
314
|
min-width: 0;
|
|
315
|
-
`,
|
|
315
|
+
`,fd=b.div`
|
|
316
316
|
display: flex;
|
|
317
317
|
flex-direction: column;
|
|
318
318
|
gap: 10px;
|
|
319
319
|
width: 100%;
|
|
320
320
|
padding-left: 32px;
|
|
321
|
-
`,
|
|
321
|
+
`,bd=({"data-id":n,step:o,title:i,description:a,children:l})=>e(ud,{"data-id":n,children:[e(hd,{children:[t(md,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:o})}),e(gd,{children:[t(ee,{size:te.S,weight:400,lineHeight:"24px",color:ne.Primary,children:i}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:a})]})]}),l&&t(fd,{children:l})]});var vd,yd;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(vd||(vd={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})(yd||(yd={}));const Cd=[{id:vd.AssumeRole,label:nt.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:nt.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:vd.StaticKeys,label:nt.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:nt.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],Sd=[{id:yd.CloudFormation,label:nt.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:yd.Terraform,label:nt.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:yd.AwsCli,label:nt.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:yd.Manual,label:nt.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],xd={[yd.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[yd.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[yd.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[yd.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},wd=(e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const o=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(o.get(e)?.fields)),l(n.fields),a},Td=b.div`
|
|
322
|
+
display: flex;
|
|
323
|
+
flex-direction: column;
|
|
324
|
+
gap: 16px;
|
|
325
|
+
width: 100%;
|
|
326
|
+
`,kd=b.div`
|
|
327
|
+
display: flex;
|
|
328
|
+
flex-wrap: wrap;
|
|
329
|
+
gap: 24px;
|
|
330
|
+
width: 100%;
|
|
331
|
+
`,Id=b.div`
|
|
332
|
+
display: flex;
|
|
333
|
+
flex: 1 1 calc(50% - 12px);
|
|
334
|
+
min-width: 0;
|
|
335
|
+
`,Ed=b.div`
|
|
336
|
+
display: flex;
|
|
337
|
+
width: 100%;
|
|
338
|
+
max-width: 479px;
|
|
339
|
+
`,Nd=({step:n})=>{const{genericForm:o,providers:a}=ir(),{provider:l,authMethod:r,accountId:s,credentials:c}=o.formData,d=i(()=>a.find(e=>e.provider===l),[a,l]),p=i(()=>wd(d,r),[d,r]);return t(bd,{"data-id":"cloud-connector-enter-arn",step:n,title:nt.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:nt.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(Td,{children:[t(Ed,{children:t(Ee,{name:"cloud-connector-aws-account-id",width:"100%",label:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>o.handleFormChange("accountId",e.target.value)})}),p.length>0&&t(kd,{children:p.map(e=>t(Id,{children:t(Ee,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Mt.Password:Mt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:c[e.name]??"",onChange:t=>{return n=e.name,i=t.target.value,void o.handleFormChange("credentials",{...c,[n]:i});var n,i}})},e.name))})]})})},Od=b.div`
|
|
322
340
|
display: flex;
|
|
323
341
|
align-items: stretch;
|
|
324
342
|
gap: 10px;
|
|
325
343
|
width: 100%;
|
|
326
|
-
|
|
344
|
+
`,$d=b.div`
|
|
327
345
|
display: flex;
|
|
328
346
|
flex: 2 1 0;
|
|
329
347
|
flex-direction: column;
|
|
330
348
|
gap: 12px;
|
|
331
349
|
min-width: 0;
|
|
332
350
|
padding: 12px 0;
|
|
333
|
-
`,
|
|
351
|
+
`,Ad=b.div`
|
|
334
352
|
display: flex;
|
|
335
353
|
flex-direction: column;
|
|
336
354
|
gap: 8px;
|
|
337
355
|
width: 100%;
|
|
338
|
-
`,
|
|
356
|
+
`,Dd=b.div`
|
|
339
357
|
display: flex;
|
|
340
358
|
align-items: center;
|
|
341
359
|
gap: 12px;
|
|
342
360
|
width: 100%;
|
|
343
|
-
`,
|
|
361
|
+
`,Rd=b.div`
|
|
344
362
|
display: flex;
|
|
345
363
|
align-items: center;
|
|
346
364
|
justify-content: center;
|
|
@@ -349,7 +367,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
349
367
|
height: 24px;
|
|
350
368
|
border-radius: 16px;
|
|
351
369
|
background-color: ${({theme:e})=>e.v2.colors.purple[700]};
|
|
352
|
-
`,
|
|
370
|
+
`,_d=b.div`
|
|
353
371
|
display: flex;
|
|
354
372
|
flex: 3 1 0;
|
|
355
373
|
flex-direction: column;
|
|
@@ -358,60 +376,42 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
358
376
|
border-radius: 12px;
|
|
359
377
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
360
378
|
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
361
|
-
`,
|
|
379
|
+
`,Pd=b.div`
|
|
362
380
|
display: flex;
|
|
363
381
|
align-items: center;
|
|
364
382
|
justify-content: flex-end;
|
|
365
383
|
width: 100%;
|
|
366
|
-
`,
|
|
384
|
+
`,Ld=b.div`
|
|
367
385
|
flex: 1;
|
|
368
386
|
width: 100%;
|
|
369
387
|
min-height: 200px;
|
|
370
388
|
max-height: 260px;
|
|
371
389
|
overflow: auto;
|
|
372
390
|
padding: 0 12px 12px;
|
|
373
|
-
`,
|
|
391
|
+
`,Fd=b.pre`
|
|
374
392
|
margin: 0;
|
|
375
393
|
font-family: ${({theme:e})=>e.font_family.code};
|
|
376
394
|
font-size: 12px;
|
|
377
395
|
line-height: 20px;
|
|
378
396
|
color: ${({theme:e})=>e.v2.colors.green[400]};
|
|
379
397
|
white-space: pre;
|
|
380
|
-
|
|
381
|
-
display: flex;
|
|
382
|
-
flex-direction: column;
|
|
383
|
-
gap: 16px;
|
|
384
|
-
width: 100%;
|
|
385
|
-
`,Rd=b.div`
|
|
386
|
-
display: flex;
|
|
387
|
-
flex-wrap: wrap;
|
|
388
|
-
gap: 24px;
|
|
389
|
-
width: 100%;
|
|
390
|
-
`,Dd=b.div`
|
|
391
|
-
display: flex;
|
|
392
|
-
flex: 1 1 calc(50% - 12px);
|
|
393
|
-
min-width: 0;
|
|
394
|
-
`,_d=b.div`
|
|
395
|
-
display: flex;
|
|
396
|
-
width: 100%;
|
|
397
|
-
max-width: 479px;
|
|
398
|
-
`,Pd=({step:n})=>{const{genericForm:o,providers:a}=ir(),{provider:l,authMethod:r,awsAccountId:s,credentials:c}=o.formData,d=i(()=>a.find(e=>e.provider===l),[a,l]),p=i(()=>((e,t)=>{const n=e?.auth?.methods?.find(e=>e.id===t);if(!n)return[];const o=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return n.baseMethods?.forEach(e=>l(o.get(e)?.fields)),l(n.fields),a})(d,r),[d,r]);return t(gd,{"data-id":"cloud-connector-enter-arn",step:n,title:nt.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:nt.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(Ad,{children:[t(_d,{children:t(Ne,{name:"cloud-connector-aws-account-id",width:"100%",label:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:nt.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>o.handleFormChange("awsAccountId",e.target.value)})}),p.length>0&&t(Rd,{children:p.map(e=>t(Dd,{children:t(Ne,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Mt.Password:Mt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:c[e.name]??"",onChange:t=>{return n=e.name,i=t.target.value,void o.handleFormChange("credentials",{...c,[n]:i});var n,i}})},e.name))})]})})},Ld=b.div`
|
|
398
|
+
`,Md=({step:n,setupMethod:o})=>{const i=v(),{CopyButton:a}=Pt(),{description:l,steps:r,code:s}=(e=>xd[e]??xd[yd.CloudFormation])(o);return t(bd,{"data-id":"cloud-connector-create-role",step:n,title:nt.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(Od,{children:[e($d,{children:[t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(Ad,{children:r.map((n,a)=>e(Dd,{children:[t(Rd,{children:t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(ee,{size:te.XXS,weight:400,lineHeight:"20px",color:ne.Primary,children:n})]},`${o}-step-${a}`))})]}),e(_d,{children:[t(Pd,{children:t(a,{value:s,size:Ct.XS})}),t(Ld,{children:t(Fd,{children:s})})]})]})})},zd=b.div`
|
|
399
399
|
display: flex;
|
|
400
400
|
flex-direction: column;
|
|
401
401
|
padding: 16px;
|
|
402
|
-
`,
|
|
402
|
+
`,Bd=b.div`
|
|
403
403
|
display: flex;
|
|
404
404
|
flex-direction: column;
|
|
405
405
|
gap: 12px;
|
|
406
406
|
padding: 16px 16px 12px;
|
|
407
407
|
border-radius: 16px;
|
|
408
408
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
409
|
-
`,
|
|
409
|
+
`,Xd=b.div`
|
|
410
410
|
display: flex;
|
|
411
411
|
align-items: center;
|
|
412
412
|
gap: 8px;
|
|
413
413
|
width: 100%;
|
|
414
|
-
`,
|
|
414
|
+
`,Ud=b.button`
|
|
415
415
|
display: flex;
|
|
416
416
|
align-items: center;
|
|
417
417
|
justify-content: center;
|
|
@@ -428,24 +428,38 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
428
428
|
&:hover {
|
|
429
429
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
430
430
|
}
|
|
431
|
-
`,
|
|
431
|
+
`,Vd=b.div`
|
|
432
432
|
display: flex;
|
|
433
433
|
flex: 1;
|
|
434
434
|
flex-direction: column;
|
|
435
435
|
gap: 4px;
|
|
436
436
|
min-width: 0;
|
|
437
|
-
`,
|
|
437
|
+
`,Hd=b.div`
|
|
438
438
|
display: flex;
|
|
439
439
|
align-items: center;
|
|
440
440
|
gap: 4px;
|
|
441
441
|
padding: 8px 0 8px 2px;
|
|
442
|
-
`,
|
|
442
|
+
`,jd=b.div`
|
|
443
|
+
display: flex;
|
|
444
|
+
flex-direction: column;
|
|
445
|
+
gap: 16px;
|
|
446
|
+
width: 100%;
|
|
447
|
+
`,Gd=b.div`
|
|
448
|
+
display: flex;
|
|
449
|
+
flex-wrap: wrap;
|
|
450
|
+
gap: 24px;
|
|
451
|
+
width: 100%;
|
|
452
|
+
`,Wd=b.div`
|
|
453
|
+
display: flex;
|
|
454
|
+
flex: 1 1 calc(50% - 12px);
|
|
455
|
+
min-width: 0;
|
|
456
|
+
`,Kd=e=>{switch(e?.provider){case"azure":return{subtitle:"Configure the Azure subscription and the identity Odigos uses to access it.",accountTitle:"Enter Azure subscription",accountDescription:"Paste the subscription ID that contains the resources Odigos should discover.",authDescription:"Use a service principal for local Central, or choose workload identity only when it is configured on the connector pod.",credentialsTitle:"Enter service principal credentials",credentialsDescription:"Create an app in Microsoft Entra ID, grant its service principal the required role on this subscription, then paste its Directory ID, Application ID, and client secret."};case"gcp":return{subtitle:"Configure the Google Cloud project and the identity Odigos uses to access it.",accountTitle:"Enter Google Cloud project",accountDescription:"Paste the project ID that contains the resources Odigos should discover.",authDescription:"Use a service account key for local Central, or choose workload identity only when it is configured on the connector pod.",credentialsTitle:"Enter service account credentials",credentialsDescription:"Grant the service account the required roles on this project, then paste its complete JSON key."};default:return{subtitle:`Configure the ${e?.displayName??"cloud provider"} account and authentication details.`,accountTitle:"Enter account details",accountDescription:"Enter the provider account identifier that contains the resources Odigos should discover.",authDescription:"Choose how the connector authenticates with this provider.",credentialsTitle:"Enter credentials",credentialsDescription:"Enter the credentials required by the selected authentication method."}}},Yd=({field:e,value:n,onChange:o})=>{const i=`cloud-connector-credential-${e.name}`,a=e.displayName||e.name,l={name:i,label:a,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:a,value:n};return"textarea"===e.componentType||"credentialsJson"===e.name?t(Re,{...l,minHeight:"120px",onChange:e=>o(e.target.value)}):t(Ee,{...l,width:"100%",type:e.secret?Mt.Password:Mt.Text,onChange:e=>o(e.target.value)})},Jd=()=>{const o=v(),{genericForm:i}=ir(),l=i.formData.authMethod,r=i.formData.setupMethod;a(()=>{l||i.handleFormChange("authMethod",vd.AssumeRole)},[l,i]),a(()=>{r||i.handleFormChange("setupMethod",yd.CloudFormation)},[r,i]);const s=Cd.find(e=>e.id===l)?.note;return e(n,{children:[e(bd,{"data-id":"cloud-connector-auth-method",step:1,title:nt.CLOUD_CONNECTOR_AUTH_TITLE,description:nt.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:De.S,selected:l,setSelected:e=>i.handleFormChange("authMethod",e),options:Cd.map(e=>({value:e.id,label:e.label}))}),s&&e(Hd,{children:[t(dl,{size:16,fill:o.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:s})]})]}),t(bd,{"data-id":"cloud-connector-setup-method",step:2,title:nt.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:nt.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:De.S,selected:r,setSelected:e=>i.handleFormChange("setupMethod",e),options:Sd.map(e=>({value:e.id,label:e.label}))})}),t(Md,{step:3,setupMethod:r}),t(Nd,{step:4})]})},qd=({provider:o})=>{const l=v(),{genericForm:r}=ir(),{authMethod:s,accountId:c,credentials:d}=r.formData,p=i(()=>Kd(o),[o]),u=o?.connectorFields?.[0],h=i(()=>(e=>e?.auth?.methods?.find(e=>e.fields?.some(e=>e.required))?.id??e?.auth?.methods?.[0]?.id??"")(o),[o]),m=i(()=>o?.auth?.methods?.find(e=>e.id===s),[o,s]),g=i(()=>wd(o,s),[o,s]);return a(()=>{if(!o)return;const e=o.auth?.methods?.some(e=>e.id===s);e||r.handleFormChange("authMethod",h)},[o,s,h,r]),e(n,{children:[t(bd,{"data-id":"cloud-connector-account",step:1,title:p.accountTitle,description:p.accountDescription,children:u&&t(Ee,{name:`cloud-connector-account-${u.name}`,width:"100%",label:u.displayName||u.name,required:u.required,tooltip:u.tooltip||void 0,helpMessage:u.tooltip||void 0,placeholder:u.displayName||u.name,value:c,onChange:e=>r.handleFormChange("accountId",e.target.value)})}),e(bd,{"data-id":"cloud-connector-auth-method",step:2,title:nt.CLOUD_CONNECTOR_AUTH_TITLE,description:p.authDescription,children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:De.S,selected:s,setSelected:e=>{r.handleFormChange(void 0,void 0,{...r.formData,authMethod:e,credentials:{}})},options:(o?.auth?.methods??[]).map(e=>({value:e.id,label:e.displayName}))}),m?.description&&e(Hd,{children:[t(dl,{size:16,fill:l.v2.colors.silver[200]}),t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:m.description})]})]}),t(bd,{"data-id":"cloud-connector-provider-credentials",step:3,title:p.credentialsTitle,description:p.credentialsDescription,children:g.length>0?t(jd,{children:t(Gd,{children:g.map(e=>{const n="textarea"===e.componentType||"credentialsJson"===e.name;return t(Wd,{style:n?{flex:"1 1 100%"}:void 0,children:t(Yd,{field:e,value:d[e.name]??"",onChange:t=>((e,t)=>{r.handleFormChange("credentials",{...d,[e]:t})})(e.name,t)})},e.name)})})}):t(ee,{size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:"No stored credentials are required for this authentication method."})})]})},Zd=({onBack:n})=>{const{providers:o,genericForm:a}=ir(),l=i(()=>o.find(e=>e.provider===a.formData.provider),[o,a.formData.provider]),r="aws"===l?.provider,s=i(()=>Kd(l),[l]);return t(zd,{children:e(Bd,{children:[e(Xd,{children:[t(Ud,{"data-id":"cloud-connector-setup-back",type:"button",onClick:n,"aria-label":nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(cl,{size:24})}),e(Vd,{children:[t(ee,{size:te.S,weight:500,lineHeight:"24px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:r?nt.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE:s.subtitle})]})]}),r?t(Jd,{}):t(qd,{provider:l})]})})},Qd=b.div`
|
|
443
457
|
display: flex;
|
|
444
458
|
flex-direction: column;
|
|
445
459
|
flex: 1;
|
|
446
460
|
min-height: 0;
|
|
447
461
|
padding: 16px;
|
|
448
|
-
`,
|
|
462
|
+
`,ep=b.div`
|
|
449
463
|
display: flex;
|
|
450
464
|
flex-direction: column;
|
|
451
465
|
flex: 1;
|
|
@@ -453,13 +467,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
453
467
|
padding: 16px;
|
|
454
468
|
border-radius: 16px;
|
|
455
469
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
456
|
-
`,
|
|
470
|
+
`,tp=b.div`
|
|
457
471
|
display: flex;
|
|
458
472
|
flex: 1;
|
|
459
473
|
align-items: center;
|
|
460
474
|
justify-content: center;
|
|
461
475
|
width: 100%;
|
|
462
|
-
`,
|
|
476
|
+
`,np=b.div`
|
|
463
477
|
display: flex;
|
|
464
478
|
flex-direction: column;
|
|
465
479
|
align-items: center;
|
|
@@ -469,7 +483,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
469
483
|
padding: 24px 8px;
|
|
470
484
|
border-radius: 8px;
|
|
471
485
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
472
|
-
`,
|
|
486
|
+
`,op=b.div`
|
|
473
487
|
display: flex;
|
|
474
488
|
flex-direction: column;
|
|
475
489
|
align-items: center;
|
|
@@ -478,7 +492,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
478
492
|
padding: 16px;
|
|
479
493
|
border-radius: 12px;
|
|
480
494
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
481
|
-
`,
|
|
495
|
+
`,ip=b.div`
|
|
482
496
|
display: flex;
|
|
483
497
|
align-items: center;
|
|
484
498
|
justify-content: center;
|
|
@@ -487,7 +501,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
487
501
|
height: 39px;
|
|
488
502
|
border-radius: 20px;
|
|
489
503
|
background-color: ${({theme:e})=>e.v2.colors.red[500]};
|
|
490
|
-
`,
|
|
504
|
+
`,ap=b.div`
|
|
491
505
|
display: flex;
|
|
492
506
|
align-items: flex-start;
|
|
493
507
|
gap: 8px;
|
|
@@ -497,7 +511,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
497
511
|
padding: 12px;
|
|
498
512
|
border-radius: 8px;
|
|
499
513
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
500
|
-
`,
|
|
514
|
+
`,lp=b.pre`
|
|
501
515
|
flex: 1;
|
|
502
516
|
min-width: 0;
|
|
503
517
|
margin: 0;
|
|
@@ -507,25 +521,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
507
521
|
color: ${({theme:e})=>e.v2.colors.silver[200]};
|
|
508
522
|
white-space: pre-wrap;
|
|
509
523
|
word-break: break-word;
|
|
510
|
-
`,
|
|
524
|
+
`,rp=b.div`
|
|
511
525
|
display: flex;
|
|
512
526
|
flex-direction: column;
|
|
513
527
|
gap: 12px;
|
|
514
528
|
width: 100%;
|
|
515
|
-
`,
|
|
529
|
+
`,sp=b.div`
|
|
516
530
|
display: flex;
|
|
517
531
|
flex-wrap: wrap;
|
|
518
532
|
gap: 24px;
|
|
519
533
|
padding: 0 2px;
|
|
520
|
-
`,
|
|
534
|
+
`,cp=b.div`
|
|
521
535
|
display: flex;
|
|
522
536
|
gap: 6px;
|
|
523
537
|
min-width: 0;
|
|
524
|
-
`,
|
|
538
|
+
`,dp=b.div`
|
|
525
539
|
display: flex;
|
|
526
540
|
flex-direction: column;
|
|
527
541
|
gap: 8px;
|
|
528
|
-
`,
|
|
542
|
+
`,pp=b.div`
|
|
529
543
|
display: flex;
|
|
530
544
|
flex-direction: column;
|
|
531
545
|
gap: 6px;
|
|
@@ -533,7 +547,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
533
547
|
border-radius: 12px;
|
|
534
548
|
border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
|
|
535
549
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
536
|
-
`,np=({isTesting:n,error:o,result:a})=>{const l=v(),{CopyButton:r}=Pt(),s=i(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!o&&(!a||a.success)),d=o?nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||s.map(e=>e.message).filter(Boolean).join("\n");return t(Vd,{children:t(Hd,{children:n?t(jd,{children:t(Gd,{children:t(St,{withVisual:!0,withGradient:!0,title:nt.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(jd,{children:e(Wd,{children:[t(Kd,{children:t(Qa,{size:20,fill:l.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:d}),p&&e(Yd,{children:[t(Jd,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):a?e(qd,{children:[t(ce,{status:Pe.Success,label:nt.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Za,fullWidth:!0}),(a.accountId||a.identity)&&e(Zd,{children:[a.accountId&&e(Qd,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.accountId})]}),a.identity&&e(Qd,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.identity})]})]}),a.checks.length>0&&t(ep,{children:a.checks.map(n=>e(tp,{$passed:n.passed,children:[t(ce,{status:n.passed?Pe.Success:Pe.Error,label:n.displayName,leftIcon:n.passed?Za:Qa}),n.message&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:n.message}),!n.passed&&n.remediation&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.remediation})]},n.name))})]}):t(jd,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var op;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(op||(op={}));const ip=op.SelectProvider,ap=op.Validate,lp=({onClose:n,withOverlay:o,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=ir(),[p,u]=l(ip),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(void 0),[y,C]=l(void 0),[S,x]=l(void 0),w=c.isFormDirty,T=p===ip,k=p===ap,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),N=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>ip?e-1:e)},[]),E=d(()=>{if(x(void 0),p===op.SelectProvider){if(!c.formData.provider)return void x("Please select a cloud provider");if(!c.formData.permission)return void x("Please select a permission level")}u(e=>e<ap?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),u(op.Validate),!a)return;const{provider:e,permission:t,customCapabilities:n,awsAccountId:o,credentials:i,name:l}=c.formData,d=((e,t,n)=>{const o=Vc(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Bc.DiscoveryOnly:a=!0;break;case Bc.DiscoveryInstrumentation:a=!0,l=o;break;case Bc.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(s.find(t=>t.provider===e),t,n);f(!0);try{const t=await a({provider:e,displayName:l,credentials:i,expectedAccountId:o,capabilities:d});if(t.created)return void r?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[a,r,c.formData,s]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),R=i(()=>S?{status:Pe.Error,message:S}:void 0,[S]),D=i(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:Ie.Text,leftIcon:cl,onClick:N,disabled:$},[T,I,N,$]),_=i(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:Ie.Primary,rightIcon:pl,onClick:O}:void 0}return p===op.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:Ie.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:Ie.Primary,onClick:E,disabled:$}},[k,g,A,p,O,E,$]),P=i(()=>[D,_].filter(Boolean),[D,_]);return e(zt,{width:Or,isOpen:!0,hideOverlay:!$&&!o,header:{icon:ll,title:nt.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:R,actions:P},children:[p===op.SelectProvider&&t(cd,{}),p===op.Config&&t(Ud,{onBack:N}),p===op.Validate&&t(np,{isTesting:g,error:y,result:b}),t($r,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},rp=({statuses:e})=>{const n=i(()=>Bt(e).map(({status:e,type:t,reason:n,message:o})=>({status:e,title:Xt(n||t),subTitle:o??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Ut,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},sp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:nt.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:nt.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},cp=({onClose:o,actionId:r})=>{const s=v(),{isK8s:c}=S(),{actionsApi:u}=Gl(),{items:h,refetch:m}=u.useActions(),{options:g}=u.useActionTypes(),{selectedOption:f,loadAction:b,validateFormData:y,genericForm:C}=jl(),x=p(m);x.current=m,a(()=>{x.current()},[]);const[w,T]=l(!1),[k,I]=l(!1),[N,E]=l(null),O=w&&!!C?.isFormDirty;a(()=>{if(w)return;const e=setInterval(()=>x.current(),3e3);return()=>clearInterval(e)},[w]);const $=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>g.find(({type:e})=>e===$?.type)??Gt.find(({type:e})=>e===$?.type)??null,[g,$?.type]),R=$?.statuses&&Array.isArray($.statuses)?$.statuses:null;a(()=>{$&&b($,A)},[$,A]);const D=d(()=>{$&&T(!0)},[$]),_=d(()=>{$&&(b($,A),T(!1))},[$,A,b]),P=d(()=>{O?E("close"):o()},[O,o]),L=d(()=>{O?E("cancel"):_()},[O,_]),F=d(()=>{const e=N;E(null),"close"===e?(_(),o()):_()},[N,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=y();e||(await u.update($.id,t),T(!1))}},[$,y,u]),z=d(()=>{$&&I(!0)},[$]),B=d(async()=>{$&&(await u.remove($.id,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U.fields||{},V.fields,{signals:U.signals||[],skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;const H=A.fields?.find(e=>e.componentType===Ht.SourceScopes),j=H?.name||de.Scopes,G=$.fields?.[j]??null,W=c&&(!!H||void 0!==$.fields?.scopes);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:Yt($.type),title:A.label,onClose:P,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:ja,active:w,onClick:D},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:k,onClick:z}]},footer:{actions:w?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:w&&f?t(Es,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&(R?t(rp,{statuses:R}):t(Kt,{conditions:$.conditions||[]})),t(Wt,{bgTint:"800",cellsPerRow:2,items:sp($,A)})]}),W&&t(vr,{readOnly:!0,scopes:G}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})})]})})})}),t(Ar,{target:"action",isOpen:k,onClose:()=>I(!1),onApprove:B}),t($r,{isOpen:null!==N,onClose:()=>E(null),onApprove:F})]})},dp=({onClose:n,connections:o,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Gl(),[d,u]=l(""),[h,m]=l({showOnlySelected:!1}),g=i(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&n}),[o.length,r.length,d,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=c.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=i(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Jt(C||{rollout:{automaticRolloutDisabled:!1}}),k=p(T);k.current=T,a(()=>{C&&k.current(C)},[C]);const I=i(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(Er,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(S,r))??void 0,header:{icon:ul,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:u},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Et.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:g.length,status:Pe.Unknown})]}),e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${g.length}`,status:Pe.Unknown})]})]}),list:g.map(e=>t(is,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ee,{size:te.XS,children:"Configurations"}),list:[t(ge,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},pp=e=>{const t=[{id:"type",title:nt.TYPE,label:e.destinationType.displayName},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],n=Me(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:nt.MONITORS,label:n}),e.name&&t.push({id:"name",title:nt.NAME,label:e.name}),t},up=({onClose:o,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=Gl(),{selectedStreamName:h}=ot(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Wl();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[N,E]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,R=i(()=>Qt(m,h),[m,h]),D=i(()=>R?.find(e=>jt(e)===r),[r,R]),_=f?.destinationCategories?.categories??null;a(()=>{D&&_&&C(D,_)},[D,_]);const P=i(()=>D&&_?en(_,D):[],[D,_]),L=d(()=>{D&&I(!0)},[D]),F=d(()=>{D&&_&&(C(D,_),I(!1))},[D,_,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),B=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),X=d(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Be(t)),I(!1))}},[D,x,u]),U=d(()=>{D&&E(!0)},[D]),V=d(async()=>{D&&(await u.remove(D.id),o())},[D,u,o]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const n=[],o=qt(e,t),i=o.map(e=>({name:e.key,value:e.value})),a=Me(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Zt(h,a,i))return;const{type:g}=kt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(p===Ht.MultiInput){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===Ht.KeyValuePair){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(D,P);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:ja,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:N,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:z},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:Ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t($s,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&t(Kt,{conditions:D.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:pp(D)})]}),!!G.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Wt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Wt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Ar,{target:"destination",isOpen:N,onClose:()=>E(!1),onApprove:V}),t($r,{isOpen:null!==O,onClose:()=>$(null),onApprove:B})]})},hp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}];return e.ruleName&&n.push({id:"name",title:nt.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:nt.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},mp=({onClose:o,ruleId:r})=>{const s=v(),{addNotification:c}=tn(),{isK8s:p}=S(),{instrumentationRulesApi:u}=Gl(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Kl();a(()=>{m()},[]);const[C,x]=l(!1),[w,T]=l(!1),[k,I]=l(null),N=C&&!!y?.isFormDirty,{options:E}=u.useRuleTypes(),O=i(()=>E.length?E:It,[E]),$=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>O.find(({type:e})=>e===$?.type)??null,[O,$?.type]),R=i(()=>qe(A?.supportedLanguages),[A?.supportedLanguages]);a(()=>{$&&A&&f($,A)},[$,A]);const D=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_EDIT_RULE,crdType:Nt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});x(!0)}},[$,c]),_=d(()=>{$&&A&&(f($,A),x(!1))},[$,A,f]),P=d(()=>{N?I("close"):o()},[N,o]),L=d(()=>{N?I("cancel"):_()},[N,_]),F=d(()=>{const e=k;I(null),"close"===e?(_(),o()):_()},[k,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),x(!1))}},[$,b,u]),z=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_DELETE_RULE,crdType:Nt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});T(!0)}},[$,c]),B=d(async()=>{$&&(await u.remove($.ruleId,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U,V.fields,{skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;return e(n,{children:[t(zt,{isOpen:!0,header:{icon:on($.type),title:A.label,onClose:P,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:ja,active:C,onClick:D},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:w,onClick:z}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:C&&g?t(Ms,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[p&&t(Kt,{conditions:$.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:hp($,A)})]}),p&&t(vr,{readOnly:!0,scopes:$.sourceScopes??null}),A.type===Je.CustomInstrumentation&&!!$.customInstrumentations?.[Ke.Php]?.length&&t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})}),!!R.length&&t(Wt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:R.map(e=>t(nn,{label:et(e),leftIcon:Qe(e),flex:R.length>1?"0.5":"1"},e))})})})]})})})}),t(Ar,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:B}),t($r,{isOpen:null!==k,onClose:()=>I(null),onApprove:F})]})};var gp;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(gp||(gp={}));const fp=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=an(),m=ln(!!n),g=i(()=>({title:l,icon:hl,withCopy:!0}),[l]),f=i(()=>{const e=[],t=rn(c);t&&e.push(t);const n=rn(d,sl,"health");n&&e.push(n);const o=rn(p,ml,"health");return o&&e.push(o),e},[c,d,p]),b=i(()=>o?[{id:`restart-pod-${l}`,icon:pl,label:Ft.RESTART_POD,onClick:()=>o(a,l)}]:void 0,[o,a,l]),v=i(()=>[{id:"nodeName",title:nt.NODE,label:r,withCopy:!0},{id:"age",title:nt.AGE,label:s?h(s,{style:"short"}):nt.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Wt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},bp=b.div`
|
|
550
|
+
`,up=({isTesting:n,error:o,result:a})=>{const l=v(),{CopyButton:r}=Pt(),s=i(()=>a?.checks.filter(e=>!e.passed)??[],[a]),c=!(n||!o&&(!a||a.success)),d=o?nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||nt.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=o||s.map(e=>e.message).filter(Boolean).join("\n");return t(Qd,{children:t(ep,{children:n?t(tp,{children:t(np,{children:t(St,{withVisual:!0,withGradient:!0,title:nt.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:te.XS})})}):c?t(tp,{children:e(op,{children:[t(ip,{children:t(Qa,{size:20,fill:l.v2.colors.black[500]})}),t(ee,{size:te.XS,weight:400,lineHeight:"20px",color:ne.Primary,children:nt.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ee,{align:"center",size:te.XXXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:d}),p&&e(ap,{children:[t(lp,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):a?e(rp,{children:[t(ce,{status:Pe.Success,label:nt.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Za,fullWidth:!0}),(a.accountId||a.identity)&&e(sp,{children:[a.accountId&&e(cp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.accountId})]}),a.identity&&e(cp,{children:[e(ee,{size:te.XXS,weight:500,color:ne.Secondary,children:[nt.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ee,{size:te.XXS,weight:400,color:ne.Primary,children:a.identity})]})]}),a.checks.length>0&&t(dp,{children:a.checks.map(n=>e(pp,{$passed:n.passed,children:[t(ce,{status:n.passed?Pe.Success:Pe.Error,label:n.displayName,leftIcon:n.passed?Za:Qa}),n.message&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Secondary,children:n.message}),!n.passed&&n.remediation&&t(ee,{size:te.XXS,weight:400,lineHeight:"normal",color:ne.Primary,children:n.remediation})]},n.name))})]}):t(tp,{children:t(ee,{size:te.XXS,weight:400,color:ne.Secondary,children:nt.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var hp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(hp||(hp={}));const mp=hp.SelectProvider,gp=hp.Validate,fp=({onClose:n,withOverlay:o,onCreateCloudConnector:a,onCreated:r})=>{const{providers:s,genericForm:c}=ir(),[p,u]=l(mp),[h,m]=l(!1),[g,f]=l(!1),[b,v]=l(void 0),[y,C]=l(void 0),[S,x]=l(void 0),w=c.isFormDirty,T=p===mp,k=p===gp,I=d(()=>{w&&!h?m(!0):(m(!1),n?.())},[w,h,n]),E=d(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>mp?e-1:e)},[]),N=d(()=>{if(x(void 0),p===hp.SelectProvider){if(!c.formData.provider)return void x("Please select a cloud provider");if(!c.formData.permission)return void x("Please select a permission level")}u(e=>e<gp?e+1:e)},[p,c.formData.provider,c.formData.permission]),O=d(async()=>{if(x(void 0),C(void 0),v(void 0),!a)return;const{provider:e,permission:t,customCapabilities:n,accountId:o,authMethod:i,credentials:l,name:d}=c.formData,p=s.find(t=>t.provider===e),h=p?.connectorFields?.[0];if(h?.required&&!o.trim())return void x(`Please enter ${h.displayName||h.name}`);if(!i)return void x("Please select an authentication method");const m=((e,t,n)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return;const i=e=>!!n[e]?.trim(),a=e=>e?.find(e=>e.required&&!i(e.name)),l=a(o.fields);if(l)return l;if(!o.baseMethods?.length)return;const r=new Map(e?.auth?.methods?.map(e=>[e.id,e])),s=o.baseMethods.some(e=>{const t=r.get(e);return!(!t||t.fields&&0!==t.fields.length)});for(const e of o.baseMethods){const t=r.get(e);if(t?.fields?.length&&(t.fields.some(e=>i(e.name))||!s)){const e=a(t.fields);if(e)return e}}})(p,i,l);if(m)return void x(`Please enter ${m.displayName||m.name}`);const g=((e,t,n)=>{const o=Hc(e),i=[];return o.forEach(e=>{const o=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Xc.DiscoveryOnly:a=!0;break;case Xc.DiscoveryInstrumentation:a=!0,l=o;break;case Xc.Custom:{const t=n[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(p,t,n);u(hp.Validate),f(!0);try{const t=await a({provider:e,displayName:d,credentials:l,expectedAccountId:o.trim(),capabilities:g});if(t.created)return void r?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[a,r,c.formData,s]),$=g,A=k&&!g&&(!!y||!!b&&!b.success),D=i(()=>S?{status:Pe.Error,message:S}:void 0,[S]),R=i(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:I,disabled:$}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:Ie.Text,leftIcon:cl,onClick:E,disabled:$},[T,I,E,$]),_=i(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:Ie.Primary,rightIcon:pl,onClick:O}:void 0}return p===hp.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:Ie.Primary,onClick:O,disabled:$}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:Ie.Primary,onClick:N,disabled:$}},[k,g,A,p,O,N,$]),P=i(()=>[R,_].filter(Boolean),[R,_]);return e(zt,{width:Or,isOpen:!0,hideOverlay:!$&&!o,header:{icon:ll,title:nt.CREATE_CLOUD_CONNECTOR,onClose:n?I:void 0,onCloseDisabled:$},footer:{note:D,actions:P},children:[p===hp.SelectProvider&&t(pd,{}),p===hp.Config&&t(Zd,{onBack:E}),p===hp.Validate&&t(up,{isTesting:g,error:y,result:b}),t($r,{isOpen:h,onClose:()=>m(!1),onApprove:()=>n?.()})]})},bp=({statuses:e})=>{const n=i(()=>Bt(e).map(({status:e,type:t,reason:n,message:o})=>({status:e,title:Xt(n||t),subTitle:o??void 0})),[e]);return n.length?t(ae,{$gap:12,children:n.map(e=>t(Ut,{invertColors:!0,slim:!0,width:"100%",...e},e.title))}):null},vp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],o=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&n.push({id:"signals",title:nt.SIGNALS_FOR_PROCESSING,label:o}),e.name&&n.push({id:"name",title:nt.NAME,label:e.name}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},yp=({onClose:o,actionId:r})=>{const s=v(),{isK8s:c}=S(),{actionsApi:u}=Gl(),{items:h,refetch:m}=u.useActions(),{options:g}=u.useActionTypes(),{selectedOption:f,loadAction:b,validateFormData:y,genericForm:C}=jl(),x=p(m);x.current=m,a(()=>{x.current()},[]);const[w,T]=l(!1),[k,I]=l(!1),[E,N]=l(null),O=w&&!!C?.isFormDirty;a(()=>{if(w)return;const e=setInterval(()=>x.current(),3e3);return()=>clearInterval(e)},[w]);const $=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>g.find(({type:e})=>e===$?.type)??Gt.find(({type:e})=>e===$?.type)??null,[g,$?.type]),D=$?.statuses&&Array.isArray($.statuses)?$.statuses:null;a(()=>{$&&b($,A)},[$,A]);const R=d(()=>{$&&T(!0)},[$]),_=d(()=>{$&&(b($,A),T(!1))},[$,A,b]),P=d(()=>{O?N("close"):o()},[O,o]),L=d(()=>{O?N("cancel"):_()},[O,_]),F=d(()=>{const e=E;N(null),"close"===e?(_(),o()):_()},[E,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=y();e||(await u.update($.id,t),T(!1))}},[$,y,u]),z=d(()=>{$&&I(!0)},[$]),B=d(async()=>{$&&(await u.remove($.id,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U.fields||{},V.fields,{signals:U.signals||[],skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;const H=A.fields?.find(e=>e.componentType===Ht.SourceScopes),j=H?.name||de.Scopes,G=$.fields?.[j]??null,W=c&&(!!H||void 0!==$.fields?.scopes);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:Yt($.type),title:A.label,onClose:P,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:ja,active:w,onClick:R},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:k,onClick:z}]},footer:{actions:w?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:w&&f?t(Ns,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&(D?t(bp,{statuses:D}):t(Kt,{conditions:$.conditions||[]})),t(Wt,{bgTint:"800",cellsPerRow:2,items:vp($,A)})]}),W&&t(vr,{readOnly:!0,scopes:G}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})})]})})})}),t(Ar,{target:"action",isOpen:k,onClose:()=>I(!1),onApprove:B}),t($r,{isOpen:null!==E,onClose:()=>N(null),onApprove:F})]})},Cp=({onClose:n,connections:o,selectedConnectionIds:r,setSelectedConnectionIds:s})=>{const{configApi:c}=Gl(),[d,u]=l(""),[h,m]=l({showOnlySelected:!1}),g=i(()=>o.filter(e=>{const t=!d||e.name.toLowerCase().includes(d.toLowerCase()),n=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&n}),[o.length,r.length,d,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=c.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=i(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Jt(C||{rollout:{automaticRolloutDisabled:!1}}),k=p(T);k.current=T,a(()=>{C&&k.current(C)},[C]);const I=i(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(Nr,{isOpen:!0,onClose:n,onSave:async()=>await(c.applyConfigurations?.(S,r))??void 0,header:{icon:ul,title:"Cluster Configuration"},connectionIds:{value:r,setValue:s},search:{placeholder:"Search by cluster name",value:d,onChange:u},filters:e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:"Show only:"}),t(ge,{size:Nt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:y,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(ee,{size:te.XS,children:"Clusters"}),t(ce,{label:g.length,status:Pe.Unknown})]}),e(oe,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,align:"right",children:"Selected clusters"}),t(ce,{label:`${r.length}/${g.length}`,status:Pe.Unknown})]})]}),list:g.map(e=>t(is,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ee,{size:te.XS,children:"Configurations"}),list:[t(ge,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Sp=e=>{const t=[{id:"type",title:nt.TYPE,label:e.destinationType.displayName},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}],n=Me(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&t.push({id:"monitors",title:nt.MONITORS,label:n}),e.name&&t.push({id:"name",title:nt.NAME,label:e.name}),t},xp=({onClose:o,destinationId:r})=>{const s=v(),{isK8s:c}=S(),{destinationsApi:u}=Gl(),{selectedStreamName:h}=ot(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Wl();a(()=>{g()},[]);const T=p(null),[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(null),A=k&&!!w?.isFormDirty,D=i(()=>Qt(m,h),[m,h]),R=i(()=>D?.find(e=>jt(e)===r),[r,D]),_=f?.destinationCategories?.categories??null;a(()=>{R&&_&&C(R,_)},[R,_]);const P=i(()=>R&&_?en(_,R):[],[R,_]),L=d(()=>{R&&I(!0)},[R]),F=d(()=>{R&&_&&(C(R,_),I(!1))},[R,_,C]),M=d(()=>{A?$("close"):o()},[A,o]),z=d(()=>{A?$("cancel"):F()},[A,F]),B=d(()=>{const e=O;$(null),"close"===e?(F(),o()):F()},[O,F,o]),X=d(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(R.id,Be(t)),I(!1))}},[R,x,u]),U=d(()=>{R&&N(!0)},[R]),V=d(async()=>{R&&(await u.remove(R.id),o())},[R,u,o]);if(!R)return null;const{icon:H,iconSrc:j}=wt(R.destinationType.type),G=((e,t)=>{const n=[],o=qt(e,t),i=o.map(e=>({name:e.key,value:e.value})),a=Me(e.exportedSignals);let l=[];const r=()=>{l.length&&(n.push({kind:"cells",id:`cells-${n.length}`,items:l}),l=[])};return o.forEach(({key:e,name:o,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Zt(h,a,i))return;const{type:g}=kt(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...n},o)=>{t==s&&l.push({id:`${e}-custom-${o}`,title:n.title,label:n.value})});else if(s)if(f)l.push({id:e,title:o,label:new Array(10).fill("•").join("")});else{if(p===Ht.MultiInput){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"list",id:e,title:o,items:t.map((t,n)=>({id:`${e}-${n}`,label:String(t)}))})}if(p===Ht.KeyValuePair){const t=kt(s,null);if(Array.isArray(t)&&t.length)return r(),void n.push({kind:"pairs",id:e,title:o,items:t.map((t,n)=>{const o=t&&"object"==typeof t?t:{};return{id:`${e}-${n}`,title:null!=o.key?String(o.key):"",label:null!=o.value?String(o.value):""}})})}l.push({id:e,title:o,label:s})}else l.push({id:e,title:o,label:"-"})}),r(),n})(R,P);return e(n,{children:[t(zt,{isOpen:!0,header:{icon:H,iconSrc:j,title:R.name||R.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:ja,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:E,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:z},...y?.option.testConnectionSupported&&c?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:Ie.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:X}]:[]},children:t(le,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t($s,{ref:T,isEdit:!0}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[c&&t(Kt,{conditions:R.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:Sp(R)})]}),!!G.length&&t(Wt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Wt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Wt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Ar,{target:"destination",isOpen:E,onClose:()=>N(!1),onApprove:V}),t($r,{isOpen:null!==O,onClose:()=>$(null),onApprove:B})]})},wp=(e,t)=>{const n=[{id:"type",title:nt.TYPE,label:t.label},{id:"status",title:nt.STATUS,badge:{status:e.disabled?Pe.Unknown:Pe.Success,label:e.disabled?nt.DISABLED:nt.ENABLED}}];return e.ruleName&&n.push({id:"name",title:nt.NAME,label:e.ruleName}),e.profileName&&n.push({id:"profile",title:nt.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&n.push({id:"notes",title:nt.NOTES,label:e.notes}),n},Tp=({onClose:o,ruleId:r})=>{const s=v(),{addNotification:c}=tn(),{isK8s:p}=S(),{instrumentationRulesApi:u}=Gl(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Kl();a(()=>{m()},[]);const[C,x]=l(!1),[w,T]=l(!1),[k,I]=l(null),E=C&&!!y?.isFormDirty,{options:N}=u.useRuleTypes(),O=i(()=>N.length?N:It,[N]),$=i(()=>h?.find(e=>jt(e)===r),[r,h]),A=i(()=>O.find(({type:e})=>e===$?.type)??null,[O,$?.type]),D=i(()=>qe(A?.supportedLanguages),[A?.supportedLanguages]);a(()=>{$&&A&&f($,A)},[$,A]);const R=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_EDIT_RULE,crdType:Et.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});x(!0)}},[$,c]),_=d(()=>{$&&A&&(f($,A),x(!1))},[$,A,f]),P=d(()=>{E?I("close"):o()},[E,o]),L=d(()=>{E?I("cancel"):_()},[E,_]),F=d(()=>{const e=k;I(null),"close"===e?(_(),o()):_()},[k,_,o]),M=d(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update($.ruleId,t,$.type),x(!1))}},[$,b,u]),z=d(()=>{if($){if(!$.mutable)return void c({type:Pe.Warning,title:Ye.FORBIDDEN,message:Ye.CANNOT_DELETE_RULE,crdType:Et.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});T(!0)}},[$,c]),B=d(async()=>{$&&(await u.remove($.ruleId,$.type),o())},[$,u,o]);if(!$||!A)return null;const X=(U=$,V=A,V?.fields?.length?Vt(U,V.fields,{skipComponentTypes:[Ht.SourceScopes]}):[]);var U,V;return e(n,{children:[t(zt,{isOpen:!0,header:{icon:on($.type),title:A.label,onClose:P,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:ja,active:C,onClick:R},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ma,color:s.v2.colors.red[500],active:w,onClick:z}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:L},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:M}]:[]},children:t(le,{$padding:"4px 12px 12px",children:C&&g?t(Ms,{}):t(ae,{$gap:16,children:e(Wt,{bgTint:"1000",children:[e(Wt,{bgTint:"900",children:[p&&t(Kt,{conditions:$.conditions||[]}),t(Wt,{bgTint:"800",cellsPerRow:2,items:wp($,A)})]}),p&&t(vr,{readOnly:!0,scopes:$.sourceScopes??null}),A.type===Je.CustomInstrumentation&&!!$.customInstrumentations?.[Ke.Php]?.length&&t(_e,{status:Pe.Warning,message:Ye.PHP_CUSTOM_INSTRUMENTATION_RESTART,fullWidth:!0}),!!X?.length&&t(Wt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",cellsPerRow:2,items:X})}),!!D.length&&t(Wt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Wt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:D.map(e=>t(nn,{label:et(e),leftIcon:Qe(e),flex:D.length>1?"0.5":"1"},e))})})})]})})})}),t(Ar,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:B}),t($r,{isOpen:null!==k,onClose:()=>I(null),onApprove:F})]})};var kp;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(kp||(kp={}));const Ip=({collapseIsDefaultOpen:e,isJumpToTarget:n,onClickRestartPod:o,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=an(),m=ln(!!n),g=i(()=>({title:l,icon:hl,withCopy:!0}),[l]),f=i(()=>{const e=[],t=rn(c);t&&e.push(t);const n=rn(d,sl,"health");n&&e.push(n);const o=rn(p,ml,"health");return o&&e.push(o),e},[c,d,p]),b=i(()=>o?[{id:`restart-pod-${l}`,icon:pl,label:Ft.RESTART_POD,onClick:()=>o(a,l)}]:void 0,[o,a,l]),v=i(()=>[{id:"nodeName",title:nt.NODE,label:r,withCopy:!0},{id:"age",title:nt.AGE,label:s?h(s,{style:"short"}):nt.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Wt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Ep=b.div`
|
|
537
551
|
display: flex;
|
|
538
552
|
align-items: center;
|
|
539
553
|
justify-content: space-between;
|
|
@@ -541,7 +555,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
541
555
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
542
556
|
border-radius: 12px;
|
|
543
557
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
544
|
-
`,
|
|
558
|
+
`,Np=({podsOdigosHealthStatus:n,pods:o,noPadding:a})=>{const l=cn(n?.status),r=Xt(n?.name),s=n?.message,{totalPodsCount:c,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=i(()=>({totalPodsCount:o?.length||0,odigosHealthyPodsCount:o?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===sn.Success?1:0),0)||0,k8sHealthyPodsCount:o?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===sn.Success?1:0),0)||0}),[o]);return o?.length&&n&&l?e(Ep,{$noPadding:a,children:[t(Ut,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(oe,{$gap:8,children:[t($p,{label:nt.PODS,count:c}),t($p,{label:nt.ODIGOS_HEALTHY,icon:sl,count:d,total:c}),t($p,{label:nt.KUBERNETES_HEALTHY,icon:ml,count:p,total:c})]})]}):null},Op=b.div`
|
|
545
559
|
display: flex;
|
|
546
560
|
flex-direction: column;
|
|
547
561
|
justify-content: center;
|
|
@@ -552,7 +566,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
552
566
|
width: fit-content;
|
|
553
567
|
border-radius: 8px;
|
|
554
568
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
555
|
-
|
|
569
|
+
`,$p=({count:n,total:o,label:i,icon:a})=>{const l=v(),r=void 0===o?void 0:n===o?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Op,{children:[e(oe,{$gap:0,$alignItems:"flex-end",children:[t(ee,{size:te.L,color:r,weight:500,nowrap:!0,children:n}),void 0!==o&&t(ee,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${o}`})]}),e(oe,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(ee,{size:te.XXXS,nowrap:!0,children:i})]})]})},Ap=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===dn.PID)??e.identifyingAttributes?.find(({name:e})=>e===dn.VPID);return t?.value??null};var Dp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Dp||(Dp={}));const Rp=({overrideProcessNum:n,healthy:o,healthStatus:r,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=l(Dp.IdentifyingAttributes),m=ln(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=i(()=>{const e=c?.some(e=>!1===e.healthy),n=[{value:Dp.IdentifyingAttributes,label:nt.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:p.v2.colors.purple[500]},{value:Dp.InstrumentationLibraries,label:nt.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(gl,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.v2.colors.purple[500]}];return{tabOptions:n,firstTabValue:n.find(e=>!e.disabled)?.value||n[0].value,bothTabsDisabled:n.every(e=>e.disabled)}},[s,c]);a(()=>{f&&h(f)},[f]);const y=i(()=>{switch(u){case Dp.IdentifyingAttributes:return t(ae,{children:s?.map((e,n)=>t(Mp,{label:e.name,value:e.value},`attr-${n}-${e.name}`))});case Dp.InstrumentationLibraries:return t(ae,{children:c?.map((e,n)=>t(Mp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))});default:return null}},[u,s,c]),C=i(()=>Ap({overrideProcessNum:n,identifyingAttributes:s}),[n,s]);return t("div",{ref:m,children:e(Wt,{bgTint:"800",richTitle:{title:C?`${nt.PROCESS} ${nt.PID(C)}`:nt.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ee,{color:o?ne.Success:ne.Error,size:te.XXXS,children:r?.message}),badges:[{key:"odigos-healthy",status:o?Pe.Success:Pe.Error,leftIcon:sl,label:o?nt.HEALTHY:nt.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ve,{options:g,selected:u,setSelected:h}),!b&&y]})})},_p=b.div`
|
|
556
570
|
display: flex;
|
|
557
571
|
align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
|
|
558
572
|
gap: 8px;
|
|
@@ -561,23 +575,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
561
575
|
&:hover {
|
|
562
576
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
563
577
|
}
|
|
564
|
-
`,
|
|
578
|
+
`,Pp=b(ee)`
|
|
565
579
|
flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
|
|
566
|
-
`,
|
|
580
|
+
`,Lp=b(ee)`
|
|
567
581
|
flex: 1 1 auto;
|
|
568
582
|
min-width: 0;
|
|
569
|
-
`,
|
|
583
|
+
`,Fp=b(oe)`
|
|
570
584
|
flex: 1 1 auto;
|
|
571
585
|
justify-content: flex-end;
|
|
572
586
|
min-width: 0;
|
|
573
|
-
`,
|
|
587
|
+
`,Mp=({label:n,value:o,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(_p,{$withHealthBadge:r,children:[t(Pp,{size:te.XXS,color:ne.Secondary,$withHealthBadge:r,children:n}),o&&t(Lp,{size:te.XXS,color:ne.Primary,align:"right",children:o}),(i||r)&&e(Fp,{children:[i&&t(ce,{status:Pe.Info,label:nt.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&e(oe,{$gap:4,children:[l&&t(Lp,{size:te.XXXS,color:ne.Error,align:"right",children:l}),t(ce,{status:a?Pe.Success:Pe.Error,label:a?nt.HEALTHY:nt.NOT_HEALTHY,leftIcon:sl,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},zp=h(null),Bp=({value:e,children:n})=>t(zp.Provider,{value:e,children:n}),Xp=({podContainers:e,sourceContainers:n,jumpToTarget:o})=>{const a=e??[],l=i(()=>({title:nt.CONTAINERS,titleSize:te.XS,badge:{label:a.length}}),[a.length]),r=i(()=>{const e=new Map;return n?.forEach(t=>e.set(t.containerName,t)),e},[n]);return t(Wt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:a.map(e=>{const n=o?.containerName===e.containerName;return t(Vp,{...e,language:pn(r.get(e.containerName)),jumpToTarget:n?o:null},`pod-container-${e.containerName}`)})})})},Up=b.div`
|
|
574
588
|
display: flex;
|
|
575
589
|
flex-direction: column;
|
|
576
590
|
gap: 12px;
|
|
577
591
|
padding: 8px 12px;
|
|
578
592
|
border-radius: 8px;
|
|
579
593
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
580
|
-
`,
|
|
594
|
+
`,Vp=({language:n,containerName:o,otelDistroName:a,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=an(),C=ln(v),S=i(()=>({title:o,icon:n?un(n):fl,iconWithWrapper:!0}),[o,n]),x=i(()=>{const e=[],t=rn({status:a?sn.Success:sn.Disabled,reasonEnum:a?nt.INSTRUMENTED_WITH_DISTRO(a):nt.UNINSTRUMENTED,message:""});t&&e.push(t);const n=rn(h,sl,"health");n&&e.push(n);const o=rn(m,ml,"health");return o&&e.push(o),e},[m,h,a]),w=i(()=>{const e=[{id:"runningTime",title:nt.RUNNING_TIME,label:l?y(l,{style:"short"}):nt.NOT_RUNNING,labelTooltip:`${nt.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Pe.Success:Pe.Disabled,leftIcon:r?Xa:Ua,label:r?nt.STARTED:nt.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Pe.Success:Pe.Disabled,leftIcon:s?Xa:Ua,label:s?nt.READY:nt.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}];return d&&e.push({id:"isCrashLoop",badge:{status:Pe.Error,leftIcon:Ua,label:nt.CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}}),e.push({id:"restartCount",title:nt.RESTARTS,badge:{status:c?Pe.Error:void 0,label:c||0,textSize:te.XXXS}}),e},[l,y,r,s,d,c]),T=i(()=>u?Xt(p):"",[u,p]);return t("div",{ref:C,children:e(Wt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Up,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(nn,{variant:hn.Pink,leftIcon:ml,label:T}),t(ee,{size:te.XXXS,color:ne.Error,children:u})]})}),(g??[]).map((e,n)=>{const i=n+1,a=b&&(l=f,r=e,!!l?.processPid&&Ap({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Rp,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${o}-process-${i}`)})]})})},Hp=({podName:e,namespace:n,hasRestarted:o})=>{const a=i(()=>({title:nt.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=i(()=>[{label:nt.GET_POD_YAML,value:`kubectl get pod ${e} -n ${n} -o yaml`},{label:nt.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${n}`},{label:nt.GET_POD_LOGS,value:`kubectl logs ${e} -n ${n}${o?" -p":""}`}],[e,n,o]);return t(Wt,{bgTint:"800",richTitle:a,withCollapse:!0,children:l.map(({label:e,value:n})=>t(mn,{bgTint:"700",label:e,value:n},e))})},jp=({source:o,onClickRestartPod:a})=>{const{jumpToTarget:l}=(()=>{const e=m(zp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===kp.Pods?l:null,s=o?.pods??[],c=s.length>0,d=i(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),p=i(()=>({title:nt.PODS,badge:{label:s.length}}),[s.length]);return t(ae,{$gap:12,children:c?e(n,{children:[t(Np,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:s}),t(Wt,{bgTint:"1000",richTitle:p,children:s.map(n=>{const i=r?.podName===n.podName,l=i&&!r?.containerName;return e(Ip,{...n,namespace:o.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:i,isJumpToTarget:l,children:[t(Hp,{podName:n.podName,namespace:o.id.namespace,hasRestarted:d}),t(Xp,{podContainers:n.containers,sourceContainers:o.containers,jumpToTarget:i?r:null})]},`pod-${n.podName}`)})})]}):t(ft,{$height:"70vh",children:t($e,{title:nt.NO_RUNNING_PODS,subTitle:nt.NO_RUNNING_PODS_SUBTITLE})})})},Gp="user",Wp=({source:n})=>{const o=i(()=>n.serviceName||n.id.name,[n]),{sourcesApi:a}=Gl(),{data:l,loading:r,refetch:s}=a.usePeerSources({serviceName:o},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(ft,r?{$height:"70vh",children:t(St,{withSpinner:!0})}:{$height:"70vh",children:t($e,{subTitle:nt.COULD_NOT_FETCH_PEER_SOURCES})}):e(oe,{$gap:16,$alignItems:"flex-start",children:[t(Kp,{icon:bl,title:nt.INBOUND,subTitle:nt.INBOUND_DESCRIPTION(o),onRefresh:s,items:c?.inbound??[]}),t(Kp,{icon:vl,title:nt.OUTBOUND,subTitle:nt.OUTBOUND_DESCRIPTION(o),onRefresh:s,items:c?.outbound??[]})]})},Kp=({icon:n,title:o,subTitle:a,onRefresh:r,items:s})=>{const[c,d]=l(""),p=i(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Wt,{bgTint:"1000",richTitle:{icon:n,title:o,titleSize:te.XS,subTitle:a,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:pl,onClick:r}}],children:[t(fn,{value:c,onChange:d,width:"100%"}),t(bn,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(ft,{$height:"50vh",children:t($e,{icon:n,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(Jp,{...e},`${o}-${e.serviceName}`)):[t(ft,{$height:"50vh",children:t($e,{icon:n,title:`No ${o} connections yet`,subTitle:o===nt.INBOUND?nt.NO_INBOUND_CONNECTIONS_DESCRIPTION:nt.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Yp=b.div`
|
|
581
595
|
display: flex;
|
|
582
596
|
align-items: center;
|
|
583
597
|
justify-content: space-between;
|
|
@@ -591,9 +605,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
591
605
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
592
606
|
}
|
|
593
607
|
`}
|
|
594
|
-
`,
|
|
608
|
+
`,Jp=({serviceName:n,isVirtual:o,nodeAttributes:a})=>{const l=vn(e=>e.drawerEntityId),{items:r}=Gl().sourcesApi.useSources(),s=i(()=>r.find(e=>e.id.name===n||e.serviceName===n),[r,n]),c=i(()=>s&&JSON.stringify(yn(s))!==JSON.stringify(yn(l)),[s,l]),d=i(()=>{if(o){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[Cn({serviceName:n,attributes:e})]}if(n?.toLowerCase()===Gp)return[yl];const e=s?Sn(s):void 0;return e?.length?e:[fl]},[o,a,n,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=vn.getState();e(wn(Et.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(Yp,{onClick:p,$withClick:!!p,children:[e(oe,{$gap:8,children:[t(xn,{icons:d}),t(ee,{size:te.XXS,children:n})]}),o&&t(ce,{status:Pe.Info,label:nt.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:nt.VIRTUAL_TOOLTIP})]})},qp=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}},Zp=({source:n})=>{const o=v(),{k8sManifestApi:r}=Gl(),[s,c]=l(!0),[d,p]=l(void 0),[u,h]=l(!0),[m,g]=l(void 0),[f,b]=l(!0),[y,C]=l({}),S=n.pods??[],x=S.map(e=>e.podName).join(",");a(()=>{r.fetch({namespace:n.id.namespace,kind:n.id.kind,name:n.id.name}).then(({data:e})=>p(qp(e))).finally(()=>c(!1)),r.fetch({namespace:n.id.namespace,kind:Tn.InstrumentationConfig,name:`${n.id.kind}-${n.id.name}`.toLowerCase()}).then(({data:e})=>g(qp(e))).finally(()=>h(!1))},[r,n.id.namespace,n.id.kind,n.id.name]),a(()=>{const e=x?x.split(","):[];if(0===e.length)return C({}),void b(!1);let t=!1;return b(!0),Promise.all(e.map(async e=>{const{data:t}=await r.fetch({namespace:n.id.namespace,kind:Tn.Pod,name:e});return[e,qp(t)]})).then(e=>{t||C(Object.fromEntries(e))}).finally(()=>{t||b(!1)}),()=>{t=!0}},[r,n.id.namespace,x]);const w=i(()=>[{label:nt.DESCRIBE_POD,value:`kubectl describe ${n.id.kind} ${n.id.name} -n ${n.id.namespace}`},{label:nt.GET_POD_YAML,value:`kubectl get ${n.id.kind} ${n.id.name} -n ${n.id.namespace} -o yaml`},{label:nt.GET_POD_YAML,value:`kubectl get ${Tn.InstrumentationConfig} ${n.id.kind}-${n.id.name} -n ${n.id.namespace} -o yaml`}],[n.id.kind,n.id.name,n.id.namespace]);return e(Wt,{bgTint:"1000",children:[t(Wt,{bgTint:"900",richTitle:{icon:Cl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:w.map(({label:e,value:n},o)=>t(mn,{label:e,value:n},`debug-cmd-${o}-${e}`))}),s?t(re,{size:1}):t(Dr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`${n.id.kind} YAML`,yaml:d}),u?t(re,{size:1}):t(Dr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m}),S.map(e=>f?t(re,{size:1},e.podName):t(Dr,{bgTint:"800",codeBgColor:o.v2.colors.silver[900],title:`Pod ${e.podName} YAML`,yaml:y[e.podName]},e.podName))]})},Qp=({title:n,children:o})=>e(ae,{$gap:8,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),o]}),eu=({source:n})=>{const o=i(()=>{const[e,t]=In(n.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[n]);return t(Qp,{title:nt.THROUGHPUT_LAST_10_SECONDS,children:e(oe,{$alignItems:"flex-end",$gap:4,children:[t(ee,{size:te.L,children:o.value}),t(ee,{size:te.XS,variant:Ot.Span,children:o.units})]})})},tu=({source:n})=>{const{CopyButton:o}=Pt();return t(Qp,{title:nt.NAMESPACE,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:n.id.namespace}),t(o,{value:n.id.namespace,size:Ct.XS})]})})},nu=({source:n})=>{const{CopyButton:o}=Pt(),i=n.id.region;return i?t(Qp,{title:nt.REGION,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:i}),t(o,{value:i,size:Ct.XS})]})}):null},ou=({source:e})=>{const n=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(Qp,{title:nt.ENABLED,children:t(oe,{children:t(nn,{variant:n?hn.Green:hn.Default,label:n?nt.ENABLED:nt.DISABLED})})})},iu=({source:e,label:n})=>t(Qp,{title:nt.KIND,children:t(oe,{children:t(nn,{variant:hn.Blue,label:n||e.id.kind})})}),au=({source:n})=>{const{CopyButton:o}=Pt();return t(Qp,{title:nt.NAME,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:n.id.name}),t(o,{value:n.id.name,size:Ct.XS})]})})},lu=({source:n})=>{const{CopyButton:o}=Pt(),i=n.serviceName||n.id.name;return t(Qp,{title:nt.SERVICE_NAME,children:e(oe,{children:[t(nn,{variant:hn.Blue,label:i}),t(o,{value:i,size:Ct.XS})]})})},ru=({source:n})=>{const{isK8s:o,isConnector:a}=S(),l=i(()=>kn(n.id.kind),[n.id.kind]);return t(Wt,{children:e(oe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[o&&t(eu,{source:n}),t(ou,{source:n}),a&&t(nu,{source:n}),o&&t(tu,{source:n}),t(iu,{source:n,label:l}),t(au,{source:n}),!o&&t(lu,{source:n})]})})},su=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Wt,{bgTint:"900",children:t(Np,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,cu=({source:e})=>{const n=i(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?En(e.workloadOdigosHealthStatus.status):Pe.Unknown,title:Xt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return n?t(Ut,{...n,width:"100%"}):null},du=h(null),pu=b.div`
|
|
595
609
|
position: relative;
|
|
596
|
-
`,
|
|
610
|
+
`,uu=({children:e})=>{const n=p(null);return t(pu,{ref:n,children:t(du.Provider,{value:n,children:e})})},hu=b.div`
|
|
597
611
|
position: fixed;
|
|
598
612
|
top: ${({$coords:e})=>e.top}px;
|
|
599
613
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -607,25 +621,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
607
621
|
padding: 12px 16px;
|
|
608
622
|
border-radius: 12px;
|
|
609
623
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
610
|
-
`,
|
|
624
|
+
`,mu=b.div`
|
|
611
625
|
display: flex;
|
|
612
626
|
align-items: flex-end;
|
|
613
627
|
justify-content: space-between;
|
|
614
628
|
gap: 8px;
|
|
615
|
-
`,
|
|
629
|
+
`,gu=b.div`
|
|
616
630
|
flex: 1;
|
|
617
|
-
`,
|
|
631
|
+
`,fu=({width:n,onClose:o,onSave:i,saveTooltip:a,onDelete:r,deleteTooltip:s,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(du),[y,C]=l(null);return Nn(b??{current:null},o),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?Fr(e(hu,{$coords:y,$width:n,"data-ignore-outside-click":"true",children:[e(ae,{$gap:4,children:[t(ee,{size:te.XXS,children:c}),t(ee,{size:te.XXXS,color:ne.Secondary,children:d})]}),e(mu,{children:[t(gu,{children:u}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(Te,{variant:Ie.Secondary,onClick:r,leftIcon:Ma,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ke.S,textColor:f.v2.colors.red[500]}),t(Te,{variant:Ie.Primary,onClick:i,leftIcon:Za,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ke.S})]})]}),t("div",{children:t(_e,{status:Pe.Warning,message:p})})]}),document.body):null},bu=({language:n,overridden:o,onOverride:a,defaultValues:r})=>{const{tier:s}=S(),{formData:c,handleFormChange:d,resetFormData:p}=Jt(r),u=i(()=>{if(!n)return[];const e=On[n].community,t=s===$n.Onprem?On[n].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))},[n,s]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(oe,{$gap:4,$alignItems:"center",children:[o?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(uu,{children:[t(Ue,{text:nt.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:ja,onClick:b})}),g&&t(fu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:nt.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:nt.OVERRIDE_OTEL_DISTRO_NAME,subTitle:nt.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:nt.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(vt,{label:nt.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},vu=({overridden:n,onOverride:o,defaultValues:a,originalValues:r})=>{const{addNotification:s}=tn(),{formData:c,handleFormChange:d,resetFormData:p}=Jt(a),u=i(()=>An.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(oe,{children:[n?t(ce,{status:Pe.Info,invertColors:!0,label:nt.OVERIDDEN}):null,e(uu,{children:[t(Ue,{text:nt.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:ja,onClick:b})}),g&&t(fu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Dn(c.version)?(m(!0),await o(c),m(!1),b()):s({type:Pe.Warning,message:Ye.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:nt.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await o({language:null,version:""}),m(!1),b()},deleteTooltip:nt.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:nt.OVERRIDE_RUNTIME_DETAILS,subTitle:nt.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:nt.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(oe,{$gap:8,children:[t(vt,{label:nt.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${r.language||"none"}`}),t(Ee,{label:nt.RUNTIME_VERSION,placeholder:nt.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${r.version||"none"}`})]})})]})]})},yu=b.div`
|
|
618
632
|
display: flex;
|
|
619
633
|
flex-direction: column;
|
|
620
634
|
gap: 10px;
|
|
621
635
|
padding: 10px 12px 10px 20px;
|
|
622
636
|
border-radius: 8px;
|
|
623
637
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
624
|
-
`,
|
|
638
|
+
`,Cu=b.div`
|
|
625
639
|
display: flex;
|
|
626
640
|
flex-wrap: wrap;
|
|
627
641
|
gap: 12px 24px;
|
|
628
|
-
`,
|
|
642
|
+
`,Su=({title:n,children:o})=>e(ae,{$gap:4,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:n}),o]}),xu=({processes:n})=>{const o=i(()=>[...n].sort((e,t)=>e.pid-t.pid),[n]);return o.length?e(ae,{$gap:6,children:[t(ee,{size:te.XXXS,color:ne.Secondary,children:`${nt.PROCESSES} (${o.length})`}),o.map(n=>{const o=n.exe?.trim()||null,i=n.cmdline?.trim()||null;return e(yu,{children:[t(Cu,{children:t(Su,{title:nt.PROCESS_PID,children:t(ee,{size:te.XS,children:String(n.pid)})})}),o?t(mn,{label:nt.EXECUTABLE,value:o,bgTint:"900"}):null,i&&i!==o?t(mn,{label:nt.COMMAND,value:i,bgTint:"900"}):null]},n.pid)})]}):null},wu=b.div`
|
|
629
643
|
display: flex;
|
|
630
644
|
flex-direction: column;
|
|
631
645
|
align-self: stretch;
|
|
@@ -633,14 +647,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
633
647
|
padding: 8px 12px;
|
|
634
648
|
border-radius: 8px;
|
|
635
649
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
636
|
-
`,
|
|
650
|
+
`,Tu=b.div`
|
|
637
651
|
display: flex;
|
|
638
652
|
align-items: center;
|
|
639
653
|
justify-content: center;
|
|
640
654
|
padding: 8px;
|
|
641
655
|
border-radius: 10px;
|
|
642
656
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
643
|
-
`,
|
|
657
|
+
`,ku=e=>{if(!e)return Rn.Unknown;const t=e.trim().toLowerCase();return{go:Rn.Go,golang:Rn.Go,javascript:Rn.JavaScript,js:Rn.JavaScript,node:Rn.JavaScript,nodejs:Rn.JavaScript,typescript:Rn.JavaScript,python:Rn.Python,java:Rn.Java,dotnet:Rn.DotNet,csharp:Rn.CSharp,php:Rn.Php,ruby:Rn.Ruby,rust:Rn.Rust,swift:Rn.Swift,elixir:Rn.Elixir}[t]??Rn.Unknown},Iu=({source:n})=>{const o=v(),{isK8s:a,isVm:l}=S(),{sourcesApi:r}=Gl(),s=n.instrumentationReport,c=n.sourceConfig,d=l?s?.processes:null,p=i(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=i(()=>{const e=ku(s?.runtimeLanguage);return e!==Rn.Unknown?e:n.runtimeInfo?.detectedLanguages?.[0]??Rn.Unknown},[s?.runtimeLanguage,n.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",m=i(()=>{const e=ku(c?.runtimeOverride?.language);return{language:e!==Rn.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||h||void 0}},[c,u,h]),g=i(()=>!!c?.distroOverride?.otelDistroName,[c]),f=i(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),b=i(()=>{const{language:e,version:t}=m;return e!==Rn.Unknown||t?e!==Rn.Unknown&&t?`${e} • ${t}`:e!==Rn.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===s?.state,C=i(()=>y||m.language===Rn.Unknown?fl:un(m.language),[y,m.language]),x=i(()=>{const e=s?.state??"",t=s?.instrumented||"Instrumented"===e,n=c?.distroOverride?.otelDistroName?.trim()||s?.sdkType?.trim();return"Instrumenting"===e?{status:Pe.Loading,label:Xt(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Pe.Disabled,leftIcon:Ua,label:Xt(e)||e}:"Error"===e?{status:Pe.Error,leftIcon:Ua,label:"Error"}:t?{status:Pe.Success,leftIcon:Xa,label:n?`Instrumented | ${n}`:"Instrumented"}:{status:Pe.Disabled,leftIcon:Ua,label:nt.UNINSTRUMENTED}},[s,c]),w=e=>r.update(n.id,{...g?f:{},...p?{language:m.language!==Rn.Unknown?m.language:void 0,version:m.version}:{},...e});return a?null:s?t(Wt,{bgTint:"1000",richTitle:{title:nt.INSTRUMENTATION,tooltip:nt.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:e(wu,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Tu,{children:t(C,{size:24,fill:y||m.language===Rn.Unknown?o.v2.colors.grey[400]:void 0})}),t(ee,{children:n.id.name}),y?t(nn,{variant:hn.Loader,label:nt.DETECTING_RUNTIME_INFO}):b?t(nn,{variant:hn.Blue,label:b}):null,t(vu,{overridden:p,onOverride:w,defaultValues:{language:m.language!==Rn.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==Rn.Unknown?u:void 0,version:h}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(ce,{...x,textSize:te.XXXS}),t(bu,{language:m.language!==Rn.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(xu,{processes:d}):null]})})}):null},Eu="100%",Nu=b(oe)`
|
|
644
658
|
@media (max-width: 1099px) {
|
|
645
659
|
flex-direction: column;
|
|
646
660
|
|
|
@@ -648,12 +662,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
648
662
|
width: 100%;
|
|
649
663
|
}
|
|
650
664
|
}
|
|
651
|
-
`,
|
|
665
|
+
`,Ou=(e,t)=>e?e.toLowerCase().includes(t.toLowerCase())?Xt(e):`${t} ${Xt(e)}`:t,$u=b(oe)`
|
|
652
666
|
width: fit-content;
|
|
653
667
|
padding: 2px 6px;
|
|
654
668
|
border-radius: 8px;
|
|
655
669
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
656
|
-
`,
|
|
670
|
+
`,Au=({overview:n,status:o})=>{const i=v(),a=n?[{id:"applied",count:n.totalAgentAppliedPods,ok:n.agentAppliedOk,label:"Agent applied"},{id:"out-of-date",count:n.totalAgentOutOfDatePods,ok:n.agentOutOfDateOk,label:"Agent out of date"},{id:"not-applied",count:n.totalAgentNotAppliedPods,ok:n.agentNotAppliedOk,label:"No agent applied"}].filter(({count:e})=>e>0):[];return a.length?t($u,{$gap:12,$wrap:"wrap",children:a.map(({id:a,count:l,ok:r,label:s})=>{const c=r?Pe.Success:o,d=Pn(c,i);return e(oe,{$gap:2,children:[t(d,{size:16,fill:_n(i,c,"300")}),t(ee,{size:te.XXXS,color:ne.Secondary,children:`${l}/${n?.totalPods??0} ${s}`})]},a)})}):null},Du=({changedTime:e})=>{const{formatTimeAgo:n}=an();return t(ee,{size:te.XXXS,color:ne.Disable,nowrap:!0,children:`Agent Assignment Updated · ${n(e)}`})},Ru=({source:n,onClickRollout:o,onClickRollback:a})=>{const l=n.rollout?.podsManifestInjectionStatus??n.conditions?.rollout,r=i(()=>{const{status:e,reasonEnum:i,message:a,actionItems:r}=l||{},s=cn(e);if(!s)return null;const c=Ou(i,nt.ROLLOUT),d=a,p=(r??[]).flatMap(e=>[{"data-id":`rollout-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:Sl,onClick:o}]);return{status:s,title:c,subTitle:d,details:t(Au,{overview:n.rollout?.podsManifestInjectionOverview,status:s}),actionDetails:n.rollout?.agentsMetaHashChangedTime?t(Du,{changedTime:n.rollout.agentsMetaHashChangedTime}):void 0,actionButtons:p}},[n.rollout,l,o]),s=i(()=>{const{status:e,reasonEnum:t,message:o,actionItems:i}=n.autoRollback?.autoRollbackStatus||{},l=cn(e);if(!l)return null;const r=Ou(t,nt.ROLLBACK),s=o,c=(i??[]).flatMap(e=>[{"data-id":`rollback-action-${e.type}`,label:e.buttonText,hideTooltipIcon:!0,leftIcon:pl,onClick:a}]);return c.length||l===Pe.Success||c.push({"data-id":"rollback-action",label:nt.ROLLBACK,tooltip:"Recover the workload from the last rollback",hideTooltipIcon:!0,leftIcon:pl,onClick:a}),{status:l,title:r,subTitle:s,actionButtons:c}},[n,a]);return r||s?e(Nu,{$gap:12,$alignItems:"stretch",children:[r&&t(Ut,{invertColors:!0,slim:!0,width:s?"calc(60% - 6px)":Eu,...r}),s&&t(Ut,{invertColors:!0,slim:!0,width:r?"calc(40% - 6px)":Eu,...s})]}):null},_u=({source:e})=>{const{isK8s:n}=S(),{containers:o,containersRichTitle:a}=i(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?`${e.id.kind} ${nt.CONTAINERS}`:nt.DETECTED_PROCESSES,tooltip:t?.message||(n?nt.DETECTED_CONTAINERS_DESCRIPTION:nt.DETECTED_PROCESSES_DESCRIPTION),badge:cn(t?.status)===Pe.Loading?{status:Pe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return o.length?t(Wt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ae,{$gap:8,children:o.map(n=>n&&t(Mu,{...n,sourceId:e.id},`source-container-${n.containerName}`))})}):null},Pu=b.div`
|
|
657
671
|
display: flex;
|
|
658
672
|
flex-direction: column;
|
|
659
673
|
align-self: stretch;
|
|
@@ -661,26 +675,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
661
675
|
padding: 8px 12px;
|
|
662
676
|
border-radius: 8px;
|
|
663
677
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
664
|
-
`,
|
|
678
|
+
`,Lu=b.div`
|
|
665
679
|
display: flex;
|
|
666
680
|
align-items: center;
|
|
667
681
|
justify-content: center;
|
|
668
682
|
padding: 8px;
|
|
669
683
|
border-radius: 10px;
|
|
670
684
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
671
|
-
`,
|
|
685
|
+
`,Fu=b.div`
|
|
672
686
|
display: flex;
|
|
673
687
|
flex-direction: column;
|
|
674
688
|
gap: 12px;
|
|
675
689
|
padding: 8px 12px;
|
|
676
690
|
border-radius: 8px;
|
|
677
691
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
678
|
-
`,
|
|
692
|
+
`,Mu=({sourceId:n,...o})=>{const{containerName:a,runtimeInfo:l,agentEnabled:r,overrides:s}=o,c=v(),{sourcesApi:d}=Gl(),p=i(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=i(()=>({language:pn(o),version:Ln(o)||void 0}),[o]),h=i(()=>!!s?.otelDistroName,[s]),m=i(()=>({otelDistroName:s?.otelDistroName||o.agentEnabled?.otelDistroName}),[s,o]),g=i(()=>!l&&!p,[l,p]),f=i(()=>g?fl:un(u.language),[g,u]),b=i(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),y=i(()=>g?{status:Pe.Loading,label:nt.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Pe.Success:Pe.Disabled,leftIcon:r?.otelDistroName?Xa:Ua,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(n,{containerName:a,...h?m:{},...p?u:{},...e}),S=i(()=>{const e=[];return o.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(nt.HEAD_SAMPLING),(o.collectorConfig?.tailSampling?.noisyOperations?.length||o.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||o.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(nt.TAIL_SAMPLING),e},[o]);return e(Pu,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Lu,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ee,{children:a}),t(nn,b?{variant:hn.Blue,label:b}:{variant:hn.Loader,label:nt.DETECTING_RUNTIME_INFO}),t(vu,{overridden:p,onOverride:C,defaultValues:u,originalValues:{language:o.runtimeInfo?.language,version:o.runtimeInfo?.runtimeVersion||""}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(ce,{...y,textSize:te.XXXS}),t(bu,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(Fu,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(nn,{variant:hn.Pink,label:Xt(r.agentEnabledStatus?.reasonEnum)||nt.NO_AVAILABLE_AGENT}),t(ee,{size:te.XXXS,color:ne.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(Fu,{children:t(oe,{$gap:16,$wrap:"wrap",children:S.map((e,n)=>t(ce,{label:e,leftIcon:Xa,status:Pe.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${n}`))})})]})},zu=({source:n,onClickRollout:o,onClickRollback:i})=>{const{isK8s:a}=S();return e(ae,{$gap:12,children:[t(ru,{source:n}),t(cu,{source:n}),a&&t(Ru,{source:n,onClickRollout:o,onClickRollback:i}),a&&t(_u,{source:n}),!a&&t(Iu,{source:n}),a&&t(su,{source:n})]})},Bu=({source:e})=>{const n=e.containers||[];return t(Wt,{bgTint:"1000",richTitle:{title:nt.INSTRUMENTED_LIBRARIES},children:n.length?n.map(e=>{const n=e.instrumentations||[];return t(Wt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:n.length}},withCollapse:!0,collapseIsDefaultOpen:!!n?.length,children:n?.length?t(ae,{children:n.map((e,n)=>t(Mp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${n}-${e.name}`))}):t($e,{title:"No libraries found"})},e.containerName)}):t($e,{title:"No containers found"})})},Xu=b(ae)`
|
|
679
693
|
width: 100%;
|
|
680
694
|
max-height: 320px;
|
|
681
695
|
overflow-y: auto;
|
|
682
696
|
gap: 8px;
|
|
683
|
-
`,
|
|
697
|
+
`,Uu=b(oe)`
|
|
684
698
|
width: 100%;
|
|
685
699
|
align-items: center;
|
|
686
700
|
gap: 8px;
|
|
@@ -690,14 +704,14 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
690
704
|
& > * {
|
|
691
705
|
font-family: monospace !important;
|
|
692
706
|
}
|
|
693
|
-
`,Du=({pendingModify:n,onClose:o,onConfirm:i})=>{const a=v();return t(tt,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:o,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:o},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:i},children:n&&e(Au,{children:[n.add.map(n=>e(Ru,{children:[t(ce,{leftIcon:za,status:Pe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(Ru,{children:[t(ce,{leftIcon:xl,status:Pe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`remove-${n}`))]})})};function _u(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Pu(e){const t=Math.abs(e);return t>=1e9?`${Lu(e/1e9)}s`:t>=1e6?`${Lu(e/1e6)}ms`:t>=1e3?`${Lu(e/1e3)}μs`:String(Math.round(e))}function Lu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Fu(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let i=0;for(let e=0;e+3<o.length;e+=4){const a=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=i+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Mu(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function zu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Bu(e,t,n){return((e,t)=>{const n=[];for(let o=0;o<=t.level;o++){let i;for(const n of e)if(n.level===o&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){i=n;break}if(!i)return n;n.push(i)}return n})(t,n).map(t=>_u(e,t.nameIndex))}function Xu(e,t,n){if(0===n.length)return null;let o=null,i=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&_u(e,n.nameIndex)===l&&(o&&(n.offset<o.offset||n.offset+n.size>o.offset+o.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;o=r,i=r}return i}function Uu(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=n;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){i.push(e);break}}return i}function Vu(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Hu(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return i[n%i.length]}var ju,Gu;function Wu(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ku(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function Yu(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"})(ju||(ju={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Gu||(Gu={}));const Ju=({flamebearer:n,maxRowPx:o,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=p(null),S=p(null),x=p({x:0,y:0}),[w,T]=l({w:0,h:0}),[k,I]=l(""),[N,E]=l(null),[O,$]=l([]),[A,R]=l(!1),[D,_]=l(ju.Fit),[P,L]=l(Gu.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=O.length>0?O[O.length-1]:null,U=X?.size??n.numTicks,V=i(()=>Fu(n),[n]),H=p({fb:n,rects:V});a(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},$(t=>{if(0===t.length)return t;const o=((e,t,n,o,i)=>{const a=[];for(const l of i){const i=Bu(e,t,l);if(0===i.length)break;const r=Xu(n,o,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return o.length===t.length&&o.every((e,n)=>zu(e,t[n]))?t:o}))},[n,V]),a(()=>{if(!f)return;if(!X)return void f(null);const e=Uu(V,X),t=new Set;for(const o of e){const e=_u(n,o.nameIndex);e&&t.add(e)}f([...t])},[X,n,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),a(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=i(()=>function(e,t,n,o,i,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Fu(e);let p=l?Uu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(_u(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const i=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const a=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&_u(e,l.nameIndex)===_u(e,t.nameIndex)&&i.add(Mu(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Mu(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=o.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Mu(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=i.trim(),y=b>8?1:0;return p.map(n=>{const o=n.level-u,i=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=_u(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:Vu(s,v)}})}(n,z,B,o,r,{zoomRoot:X,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,o,r,B,z,X,s,F,V]),G=i(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?r.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,r]),W=d(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=Ku((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(o){const e=Mu(o);E(e);const t=U>0?(100*o.size/U).toFixed(1):"0",i=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${Pu(o.size)} (${t}% of view, ${i}% of profile) · self ${Pu(o.self)}`)}else E(null),I("")},[G,n.numTicks,B,z,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{E(null),I("")},[]),J=d(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=d(e=>{const{x:t,y:n}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(z<2||B<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=Ku((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&zu(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,B),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,n,o,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Hu(s,a);e.fillStyle=u,e.fillRect(n,o,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+i-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(i-1,0),Math.max(l-1,0));const m=Wu(d,r),g=`${s} (${Pu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(Mu(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,r,y,N,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,n.numTicks,N,r,B,z,y]);const Z=d(()=>R(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ie=i(()=>((e,t,n)=>{const o=n??Fu(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(n,X,V),[n,X,V]),ae=null!==ie,le=O.length>0,re=X?_u(n,X.nameIndex):"",se=d(()=>{$([]),b?.()},[b]),ce=d(()=>$(e=>e.slice(0,-1)),[]),de=d(()=>{ie&&$(e=>[...e,ie])},[ie]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(oe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ge,{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:fe.Left,size:Et.S,value:F,onChange:M}),e(oe,{$gap:8,children:[e(oe,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:wl,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:xl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!le,onClick:ce}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:za,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(oe,{children:[t(Ue,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Fn.Filled,options:[{value:ju.Fit,label:"W: Fit"},{value:ju.X10,label:"10x"}],selected:D,setSelected:_})}),t(Ue,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Fn.Filled,options:[{value:Gu.Fit,label:"H: Fit"},{value:Gu.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?Qa:Tl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Ue,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:N?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(oe,{$justifyContent:"space-between",children:[t(ee,X?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${Pu(U)} samples in view`}:{size:te.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ee,{size:te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Yu(h.totalBytesUsed)} / ${Yu(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},qu=[Dn.Go,Dn.Java],Zu="Profiling Symbols";function Qu(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Dn.Go:e.includes(" ")||e.includes("(")?Dn.Java:Dn.Go)(e);if(n===Dn.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const i=t.slice(0,o),a=t.slice(o+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new je(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new je(i,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===Dn.Java){const t=(e=>{let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const o=t.split(/\s+/);t=o[o.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new Ge(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function eh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function th(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>eh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function nh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function oh(e,t){return e.className===t.className&&e.methodName===t.methodName}function ih(e,t,n,o){const i=Qu(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!th(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ke.Golang]?.some(e=>nh(e,i.golang)),l=!!i.java&&!!n[Ke.Java]?.some(e=>oh(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var ah,lh,rh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(ah||(ah={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(lh||(lh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(rh||(rh={}));const sh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function ch(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(rh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(rh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&sh.test(n))}const dh=({rows:e,languages:n,instrumentation:o,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(Dn.Java),h=i(()=>{const t=s?new Set(s):null,n=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,a,s]),m=i(()=>{const e=[];if(o.selectionEnabled&&e.push({id:lh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:rh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:rh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===ah.Symbol)?.rawValue?.toString()??"";return!(t.includes(lh.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&ch(n,t)}}},[o,u]),g=i(()=>[{key:ah.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:ah.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:ah.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=i(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:ah.Symbol,rawValue:e.name},{key:ah.Self,rawValue:Pu(e.self)},{key:ah.Total,rawValue:Pu(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=d(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),i=[];return n.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ma,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:za,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:kl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Mn,{variant:zn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var ph;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(ph||(ph={}));const uh=b(ae)`
|
|
707
|
+
`,Vu=({pendingModify:n,onClose:o,onConfirm:i})=>{const a=v();return t(tt,{isOpen:!!n,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:o,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:o},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:i},children:n&&e(Xu,{children:[n.add.map(n=>e(Uu,{children:[t(ce,{leftIcon:za,status:Pe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`add-${n}`)),n.remove.map(n=>e(Uu,{children:[t(ce,{leftIcon:xl,status:Pe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:n})]},`remove-${n}`))]})})};function Hu(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function ju(e){const t=Math.abs(e);return t>=1e9?`${Gu(e/1e9)}s`:t>=1e6?`${Gu(e/1e6)}ms`:t>=1e3?`${Gu(e/1e3)}μs`:String(Math.round(e))}function Gu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Wu(e){const t=[];for(let n=0;n<e.levels.length;n++){const o=e.levels[n];let i=0;for(let e=0;e+3<o.length;e+=4){const a=o[e],l=o[e+1],r=o[e+2],s=o[e+3],c=i+a;t.push({level:n,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Ku(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Yu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Ju(e,t,n){return((e,t)=>{const n=[];for(let o=0;o<=t.level;o++){let i;for(const n of e)if(n.level===o&&t.offset>=n.offset&&t.offset+t.size<=n.offset+n.size){i=n;break}if(!i)return n;n.push(i)}return n})(t,n).map(t=>Hu(e,t.nameIndex))}function qu(e,t,n){if(0===n.length)return null;let o=null,i=null;for(let a=0;a<n.length;a++){const l=n[a];let r=null;for(const n of t)n.level===a&&Hu(e,n.nameIndex)===l&&(o&&(n.offset<o.offset||n.offset+n.size>o.offset+o.size)||(!r||n.size>r.size)&&(r=n));if(!r)return null;o=r,i=r}return i}function Zu(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),o=new Map;for(const t of e){const e=o.get(t.level);e?e.push(t):o.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=n;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const n=o.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){i.push(e);break}}return i}function Qu(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function eh(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const o=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:o},{fill:t.v2.colors.green[300],text:o},{fill:t.v2.colors.red[300],text:o},{fill:t.v2.colors.blue[300],text:o},{fill:t.v2.colors.yellow[300],text:o}];return i[n%i.length]}var th,nh;function oh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ih(e,t,n){for(const o of n)if(e>=o.x&&e<o.x+o.w&&t>=o.y&&t<o.y+o.h)return o;return null}function ah(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"})(th||(th={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(nh||(nh={}));const lh=({flamebearer:n,maxRowPx:o,searchQuery:r="",shouldKeepName:s,minHostHeight:c=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=p(null),S=p(null),x=p({x:0,y:0}),[w,T]=l({w:0,h:0}),[k,I]=l(""),[E,N]=l(null),[O,$]=l([]),[A,D]=l(!1),[R,_]=l(th.Fit),[P,L]=l(nh.Fit),[F,M]=l(!1),z=Math.max(1,Math.min(Math.floor(w.w*R),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=O.length>0?O[O.length-1]:null,U=X?.size??n.numTicks,V=i(()=>Wu(n),[n]),H=p({fb:n,rects:V});a(()=>{const e=H.current;e.fb!==n&&(H.current={fb:n,rects:V},$(t=>{if(0===t.length)return t;const o=((e,t,n,o,i)=>{const a=[];for(const l of i){const i=Ju(e,t,l);if(0===i.length)break;const r=qu(n,o,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,n,V,t);return o.length===t.length&&o.every((e,n)=>Yu(e,t[n]))?t:o}))},[n,V]),a(()=>{if(!f)return;if(!X)return void f(null);const e=Zu(V,X),t=new Set;for(const o of e){const e=Hu(n,o.nameIndex);e&&t.add(e)}f([...t])},[X,n,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),a(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=i(()=>function(e,t,n,o,i,a={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Wu(e);let p=l?Zu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Hu(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),o=new Map;for(const e of n){const t=o.get(e.level);t?t.push(e):o.set(e.level,[e])}const i=new Set;for(const t of n){const n=o.get(t.level+1);if(!n)continue;const a=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&Hu(e,l.nameIndex)===Hu(e,t.nameIndex)&&i.add(Ku(l))}if(0===i.size)return n;const a=[];for(const e of n){if(i.has(Ku(e)))continue;let t=0;for(let n=0;n<e.level;n++){const a=o.get(n);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Ku(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=o??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(n/g,f)),v=i.trim(),y=b>8?1:0;return p.map(n=>{const o=n.level-u,i=(n.offset-h)/m*t,a=Math.max(n.size/m*t,1),l=o*b,r=Math.max(b-y,1),s=Hu(e,n.nameIndex);return{...n,x:i,y:l,w:a,h:r,name:s,matchesSearch:Qu(s,v)}})}(n,z,B,o,r,{zoomRoot:X,shouldKeepName:s,collapseRecursive:F,allRects:V}),[n,o,r,B,z,X,s,F,V]),G=i(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?r.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,r]),W=d(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const o=ih((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(o){const e=Ku(o);N(e);const t=U>0?(100*o.size/U).toFixed(1):"0",i=n.numTicks>0?(100*o.size/n.numTicks).toFixed(1):"0";I(`${o.name}\ntotal ${ju(o.size)} (${t}% of view, ${i}% of profile) · self ${ju(o.self)}`)}else N(null),I("")},[G,n.numTicks,B,z,U]),K=d(e=>{W(e)},[W]),Y=d(()=>{N(null),I("")},[]),J=d(e=>{x.current={x:e.clientX,y:e.clientY}},[]),q=d(e=>{const{x:t,y:n}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(z<2||B<2)return;const o=e.currentTarget.getBoundingClientRect();if(o.width<1||o.height<1)return;const i=ih((e.clientX-o.left)/o.width*z,(e.clientY-o.top)/o.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);$(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Yu(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,o=Math.max(z,B),i=Math.min(t,16384/o);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,n,o,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of o){const{x:n,y:o,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=eh(s,a);e.fillStyle=u,e.fillRect(n,o,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,o+.5),e.lineTo(n+i-.5,o+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,o+.5,Math.max(i-1,0),Math.max(l-1,0));const m=oh(d,r),g=`${s} (${ju(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+v,o+l/2),e.fillStyle=h,e.fillText(t,n+v,o+l/2))}}if(l)for(const t of o){if(Ku(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:o,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,o+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,r,y,E,n.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,n.numTicks,E,r,B,z,y]);const Z=d(()=>D(e=>!e),[]),Q=n.numTicks>0?Math.max(0,Math.min(100,Math.round(U/n.numTicks*100))):100,ie=i(()=>((e,t,n)=>{const o=n??Wu(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of o)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(n,X,V),[n,X,V]),ae=null!==ie,le=O.length>0,re=X?Hu(n,X.nameIndex):"",se=d(()=>{$([]),b?.()},[b]),ce=d(()=>$(e=>e.slice(0,-1)),[]),de=d(()=>{ie&&$(e=>[...e,ie])},[ie]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(oe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ge,{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:fe.Left,size:Nt.S,value:F,onChange:M}),e(oe,{$gap:8,children:[e(oe,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,label:"Reset zoom",leftIcon:wl,onClick:se,disabled:!O.length}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:xl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!le,onClick:ce}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:20,leftIcon:za,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ae,onClick:de})]}),e(oe,{children:[t(Ue,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Fn.Filled,options:[{value:th.Fit,label:"W: Fit"},{value:th.X10,label:"10x"}],selected:R,setSelected:_})}),t(Ue,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Fn.Filled,options:[{value:nh.Fit,label:"H: Fit"},{value:nh.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(Te,{variant:Ie.Secondary,size:ke.S,iconSize:24,leftIcon:A?Qa:Tl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Ue,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:R>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:J,onPointerMove:K,onPointerLeave:Y,onClick:q})})})})}),e(oe,{$justifyContent:"space-between",children:[t(ee,X?{size:te.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${re} • ${ju(U)} samples in view`}:{size:te.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ee,{size:te.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ah(h.totalBytesUsed)} / ${ah(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},rh=[Rn.Go,Rn.Java],sh="Profiling Symbols";function ch(e,t){if(0===t.length)return null;const n=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?Rn.Go:e.includes(" ")||e.includes("(")?Rn.Java:Rn.Go)(e);if(n===Rn.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const n=t.lastIndexOf("/"),o=t.indexOf(".",n+1);if(-1===o)return null;const i=t.slice(0,o),a=t.slice(o+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new je(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new je(i,a);return r.Verify()?r:null})(e);return t?{language:n,golang:t}:null}if(n===Rn.Java){const t=(e=>{let t=e.trim();if(!t)return null;const n=t.indexOf("(");-1!==n&&(t=t.slice(0,n).trim());const o=t.split(/\s+/);t=o[o.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new Ge(a,l);return r.Verify()?r:null})(e);return t?{language:n,java:t}:null}return null}function dh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function ph(e,t,n){if(!e)return!0;const{sources:o=[],namespaces:i=[],languages:a=[]}=e,l=!o.length||o.some(e=>dh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==n||a.includes(n);return l&&r&&s}function uh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function hh(e,t){return e.className===t.className&&e.methodName===t.methodName}function mh(e,t,n,o){const i=ch(e,n);if(!i)return[];const a=[];for(const e of o){const n=e.customInstrumentations;if(!n)continue;if(!ph(e.sourceScopes,t,i.language))continue;const o=!!i.golang&&!!n[Ke.Golang]?.some(e=>uh(e,i.golang)),l=!!i.java&&!!n[Ke.Java]?.some(e=>hh(e,i.java));(o||l)&&a.push({rule:e,resolved:i})}return a}var gh,fh,bh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(gh||(gh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(fh||(fh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(bh||(bh={}));const vh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function yh(e,t){const n=(e=>e.split(" ")[0]??"")(e);return(!t.includes(bh.FilterOutVoid)||"void"!==n)&&!!(!t.includes(bh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==n&&vh.test(n))}const Ch=({rows:e,languages:n,instrumentation:o,searchQuery:a,filters:l,onFiltersChange:r,zoomedSymbols:s,highlightSymbol:c,scrollSignal:p})=>{const u=!!n?.includes(Rn.Java),h=i(()=>{const t=s?new Set(s):null,n=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!n||e.name.toLowerCase().includes(n)))},[e,a,s]),m=i(()=>{const e=[];if(o.selectionEnabled&&e.push({id:fh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:bh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:bh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const n=e.cells.find(e=>e.key===gh.Symbol)?.rawValue?.toString()??"";return!(t.includes(fh.OnlyInstrumentable)&&!o.getSymbolState(n).showCheckbox)&&yh(n,t)}}},[o,u]),g=i(()=>[{key:gh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:gh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:gh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=i(()=>h.map(e=>{const t=o.getSymbolState(e.name),n=t.showCheckbox;return{id:e.name,cells:[{key:gh.Symbol,rawValue:e.name},{key:gh.Self,rawValue:ju(e.self)},{key:gh.Total,rawValue:ju(e.total)}],isSelected:n?o.isSelected(e.name):void 0,onSelect:n?()=>o.onToggleSymbol(e.name,!0):void 0,onDeselect:n?()=>o.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!n,checkboxDisabled:n?t.checkboxDisabled:void 0,checkboxTooltip:n?t.checkboxTooltip:void 0}}),[h,o]),b=d(e=>{const t=e.cells[0].rawValue,n=o.getSymbolState(t),i=[];return n.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ma,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>o.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:za,tooltip:n.addTooltip,disabled:!n.addEnabled,onClick:()=>o.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:kl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[o]);return t(Mn,{variant:zn.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:o.selectionEnabled,filters:l,onFiltersChange:r,activeRowId:c,scrollSignal:p,getRowActions:b})};var Sh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(Sh||(Sh={}));const xh=b(ae)`
|
|
694
708
|
width: 100%;
|
|
695
709
|
flex: 1;
|
|
696
710
|
border-radius: 16px;
|
|
697
711
|
overflow: hidden;
|
|
698
712
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
699
713
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
700
|
-
`,
|
|
714
|
+
`,wh=b.div`
|
|
701
715
|
display: flex;
|
|
702
716
|
align-items: center;
|
|
703
717
|
gap: 10px;
|
|
@@ -705,11 +719,11 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
705
719
|
padding: 12px 12px 8px;
|
|
706
720
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
707
721
|
border-radius: 16px 16px 0 0;
|
|
708
|
-
`,
|
|
722
|
+
`,Th=b(oe)`
|
|
709
723
|
flex-shrink: 0;
|
|
710
724
|
align-items: center;
|
|
711
725
|
gap: 4px;
|
|
712
|
-
`,
|
|
726
|
+
`,kh=b.div`
|
|
713
727
|
flex: 1;
|
|
714
728
|
display: flex;
|
|
715
729
|
align-items: stretch;
|
|
@@ -717,20 +731,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
717
731
|
padding: 16px;
|
|
718
732
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
719
733
|
border-radius: 0 0 16px 16px;
|
|
720
|
-
`,
|
|
734
|
+
`,Ih=b(ae)`
|
|
721
735
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
722
736
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
723
737
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
724
738
|
gap: 10px;
|
|
725
|
-
`,
|
|
739
|
+
`,Eh=b(ae)`
|
|
726
740
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
727
741
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
728
742
|
gap: 10px;
|
|
729
|
-
`,
|
|
743
|
+
`,Nh=b(oe)`
|
|
730
744
|
width: 100%;
|
|
731
745
|
min-height: 32px;
|
|
732
746
|
flex-shrink: 0;
|
|
733
|
-
`,
|
|
747
|
+
`,Oh=({source:n,onFlameFullscreenChange:o})=>{const s=v(),c=n.id,{profilingApi:u}=Gl(),[h,m]=l(!0),[g,f]=l(Sh.Both),[b,y]=l(""),[C,S]=l({}),[x,w]=l(!1),T=p(!1);a(()=>{T.current||(T.current=!0,u.enableProfiling?.(c),w(!0))},[u,c]);const{data:k}=u.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:I,loading:E,refetch:N}=u.useSourceProfiling(c,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),O=I?.profileJson??null,$=i(()=>(e=>{if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}})(O),[O]),A=i(()=>$?(e=>{const t=new Map;for(let n=0;n<e.levels.length;n++){const o=e.levels[n];for(let n=0;n+3<o.length;n+=4){const i=o[n+1],a=o[n+2],l=Hu(e,o[n+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})($.flamebearer):[],[$]),D=g===Sh.Table||g===Sh.Both,R=g===Sh.Flame||g===Sh.Both,_=D&&R,P=n.runtimeInfo?.detectedLanguages?.join("\0")??"",L=n.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=i(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=i(()=>((e,t)=>{if(!t?.includes(Rn.Java))return;const n=(e?.[gh.Symbol]?.filter(Boolean)??[]).filter(e=>e===bh.FilterOutVoid||e===bh.OnlyWithReturnValues);return 0!==n.length?e=>yh(e,n):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:n}){const{instrumentationRulesApi:o,capabilities:a}=Gl(),{items:r}=o.useRules(),[s,c]=l(new Set),[p,u]=l(new Set),[h,m]=l(null),g=i(()=>(e=>{const t=new Set(e??[]);return rh.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=i(()=>((e,t)=>{const n=e.filter(e=>e.type===Je.CustomInstrumentation&&e.ruleName===sh&&ph(e.sourceScopes,t));return n.find(e=>e.sourceScopes?.sources?.some(e=>dh(e,t.id)))??n[0]??null})(r,e),[r,b]),y=f&&g.length>0,C=i(()=>{const t=new Map;for(const o of n){const n=!!ch(o.name,g),i=mh(o.name,e,g,r),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),l=i.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&l.length>0,c=y&&n,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===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?n?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(o.name,{parsable:n,inManagedRule:a,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[n,r,b,g,f,y,v]),S=i(()=>{const e=new Set;return C.forEach((t,n)=>{t.inManagedRule&&e.add(n)}),e},[C]),x=i(()=>[...s].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[s,C,S]),w=i(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=d(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||s.has(e)},[C,p,s]),I=d((e,t)=>{const n=C.get(e);n&&!n.checkboxDisabled&&(n.inManagedRule?u(n=>{const o=new Set(n);return t?o.delete(e):o.add(e),o}):c(n=>{const o=new Set(n);return t?o.add(e):o.delete(e),o}))},[C]),E=d(()=>{c(new Set),u(new Set)},[]),N=d(t=>{(async()=>{const n=t.add.map(e=>ch(e,g)).filter(e=>!!e),i=t.remove.map(e=>ch(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,n)=>{const o=e.customInstrumentations??{};let i=[...o[Ke.Golang]??[]],a=[...o[Ke.Java]??[]];for(const e of n)e.golang&&(i=i.filter(t=>!uh(t,e.golang))),e.java&&(a=a.filter(t=>!hh(t,e.java)));for(const e of t)e.golang&&!i.some(t=>uh(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>hh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ke.Golang]:i,[Ke.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,n,i);t?await o.remove(v.ruleId,Je.CustomInstrumentation):await o.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),Je.CustomInstrumentation)}else n.length>0&&await o.create(((e,t)=>{const n=e.map(e=>e.golang).filter(e=>!!e),o=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:sh,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ke.Golang]:n,[Ke.Java]:o}}})(n,e),Je.CustomInstrumentation)})()},[v,g,e,o]),O=d(()=>{T&&m({add:x,remove:w})},[T,x,w]),$=d(e=>m({add:[e],remove:[]}),[]),A=d(e=>m({add:[],remove:[e]}),[]),D=d(()=>m(null),[]),R=d(()=>{h&&(N(h),m(null),E())},[h,N,E]),_=d(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:i(()=>({getSymbolState:_,onAdd:$,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:I}),[_,$,A,y,k,I]),pendingCount:T,pendingModify:h,closeModify:D,openBulkModify:O,resetSelection:E,confirmModify:R}}({source:n,languages:F,rows:A}),[G,W]=l(null),[K,Y]=l(0),[J,q]=l(null),Z=d(e=>{W(e),Y(e=>e+1),f(e=>e===Sh.Flame?Sh.Both:e)},[]),Q=d(e=>{q(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const n=new Set(t);if(e.every(e=>n.has(e)))return t}return e})},[]),ie=d(()=>W(null),[]);return!O&&E?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(xh,{$gap:0,$width:"100%",children:[e(wh,{children:[t(Ue,{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(Th,{children:t(ee,{size:te.S,weight:500,color:ne.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(oe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(fn,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:s.v2.colors.silver[900],emphasizeBackgroundColor:s.v2.colors.silver[800]})}),t(ve,{variant:Fn.Filled,options:[{value:Sh.Table,label:"Top table"},{value:Sh.Flame,label:"Flame graph"},{value:Sh.Both,label:"Both"}],selected:g,setSelected:f}),t(Te,h?{variant:Ie.Secondary,size:ke.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(Il,{...e,size:8,fill:s.v2.colors.green[500]})}:{variant:Ie.Secondary,size:ke.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Il,{...e,size:8,fill:s.v2.colors.red[500]})})]})]}),t(kh,{$gap:D&&R?16:0,children:$?e(r,{children:[D&&e(Ih,{$splitWithFlame:_,children:[e(Nh,{$justifyContent:"space-between",children:[e(ae,{$margin:"0 0 0 20px",children:[t(ee,{size:te.XXXS,nowrap:!0,children:"Please select symbols to"}),e(oe,{$gap:8,children:[e(oe,{children:[t(El,{size:24}),t(ee,{size:te.S,color:ne.Success,nowrap:!0,children:"Custom Instrument"})]}),t(Te,{leftIcon:Va,variant:Ie.Secondary,size:ke.S,onClick:()=>window.open(`${Le}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(oe,{$gap:8,children:[J&&t(Ue,{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(ce,{label:`Zoomed: ${J.length} symbols`,backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS})}),t(Te,{variant:Ie.Secondary,size:ke.S,label:"Download snapshot",rightIcon:Nl,onClick:()=>{if(!O)return;const e=new Blob([O],{type:"application/json"}),t=URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=`cpu-profile-${n.id.namespace}-${n.id.kind}-${n.id.name}.json`,o.click(),URL.revokeObjectURL(t)},disabled:!O})]})]}),t(Ch,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:J,highlightSymbol:G,scrollSignal:K})]}),R&&e(Eh,{$splitWithTable:_,children:[e(Nh,{$justifyContent:"space-between",children:[t(ce,{label:$?`Total in view ${ju($.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:s.v2.colors.silver[750],textColor:s.v2.colors.silver[200],textSize:te.XXS}),e(oe,{$gap:12,children:[!h&&t(Te,{variant:Ie.Secondary,size:ke.S,label:"Refresh",leftIcon:pl,onClick:N}),t(ge,{label:"Auto refresh",labelAlign:fe.Left,size:Nt.S,value:h,onChange:m})]})]}),t(lh,{flamebearer:$.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:o,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:ie})]})]}):t(ft,{children:t($e,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Vu,{pendingModify:X,onClose:U,onConfirm:j}),t(Bn,{isOpen:B>0,richTitle:{icon:el,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Modify Rule",leftIcon:ja,onClick:V}}]})]})},$h=b.div`
|
|
734
748
|
position: relative;
|
|
735
749
|
display: flex;
|
|
736
750
|
align-items: center;
|
|
@@ -738,23 +752,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
738
752
|
padding: 8px 16px;
|
|
739
753
|
border-radius: 12px;
|
|
740
754
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
741
|
-
`,
|
|
755
|
+
`,Ah=b.div`
|
|
742
756
|
display: flex;
|
|
743
757
|
flex-direction: column;
|
|
744
758
|
gap: 4px;
|
|
745
759
|
flex: 1;
|
|
746
760
|
min-width: 0;
|
|
747
761
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
748
|
-
`,
|
|
762
|
+
`,Dh=b.div`
|
|
749
763
|
flex-shrink: 0;
|
|
750
764
|
display: flex;
|
|
751
765
|
align-items: center;
|
|
752
766
|
margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
|
|
753
|
-
`,
|
|
767
|
+
`,Rh=b.div`
|
|
754
768
|
min-width: 0;
|
|
755
769
|
white-space: pre;
|
|
756
770
|
overflow-x: auto;
|
|
757
|
-
`,
|
|
771
|
+
`,_h=b.div`
|
|
758
772
|
position: absolute;
|
|
759
773
|
top: 50%;
|
|
760
774
|
right: 8px;
|
|
@@ -763,24 +777,24 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
763
777
|
pointer-events: none;
|
|
764
778
|
transition: opacity 0.15s ease;
|
|
765
779
|
|
|
766
|
-
${
|
|
780
|
+
${$h}:hover & {
|
|
767
781
|
opacity: 1;
|
|
768
782
|
pointer-events: auto;
|
|
769
783
|
}
|
|
770
|
-
`,
|
|
784
|
+
`,Ph=({name:n,summary:o,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e($h,{children:[e(Ah,{$disabled:i,children:[n&&t(ee,{size:te.XXXS,color:ne.Secondary,nowrap:!0,children:n}),t(Rh,{children:t(w,{parts:o})})]}),i&&t(Dh,{$reserveJumpSpace:!!a,children:t(ce,{label:Xn,textSize:te.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(_h,{children:t(Ue,{text:nt.OPEN_IN_SAMPLING_PAGE,children:t(Te,{"data-id":"sampling-rule-jump",variant:Ie.Primary,size:ke.S,leftIcon:Tl,onClick:a})})})]})},Lh=b.div`
|
|
771
785
|
opacity: 0;
|
|
772
786
|
pointer-events: none;
|
|
773
787
|
transition: opacity 0.15s ease;
|
|
774
|
-
`,
|
|
775
|
-
&:hover ${
|
|
788
|
+
`,Fh=b.div`
|
|
789
|
+
&:hover ${Lh} {
|
|
776
790
|
opacity: 1;
|
|
777
791
|
pointer-events: auto;
|
|
778
792
|
}
|
|
779
|
-
`,
|
|
793
|
+
`,Mh=b.div`
|
|
780
794
|
display: flex;
|
|
781
795
|
align-items: center;
|
|
782
796
|
padding: 4px 12px;
|
|
783
|
-
`,
|
|
797
|
+
`,zh=({source:e,onRedirectToSampling:n})=>t(Wt,{bgTint:"1000",richTitle:{title:nt.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Uh,{container:e,onRedirectToSampling:n},e.containerName))});var Bh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Bh||(Bh={}));const Xh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?I(e.rule,"source"):[],Uh=({container:n,onRedirectToSampling:o})=>{const[a,r]=l(Bh.All),s=vn(e=>e.setPendingViewSamplingRule),c=n.agentConfig?.traces?.headSampling?.noisyOperations??[],d=i(()=>(n.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[n.agentConfig?.traces?.headSampling?.noisyOperations]),p=i(()=>(n.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[n.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=i(()=>(n.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[n.collectorConfig?.tailSampling?.costReductionRules]),h=i(()=>a===Bh.Noisy?d:a===Bh.HighlyRelevant?p:a===Bh.CostReduction?u:[...d,...p,...u],[a,p,u]),m=d.length+p.length+u.length,g=i(()=>(e,t)=>{s({ruleId:e,category:t}),o()},[o,s]),f=t(Lh,{children:t(Te,{"data-id":"sampling-container-create-rule",variant:Ie.Secondary,size:ke.S,label:Un,rightIcon:za,onClick:e=>{e.stopPropagation(),o()}})});return t(Fh,{children:e(Wt,{bgTint:"900",richTitle:{title:n.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Wt,{bgTint:"800",richTitle:{title:nt.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ee,{size:te.XXS,children:nt.NOISY_OPERATIONS}),t(ae,{$gap:4,children:c.map(e=>t(Ph,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Mh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.HEAD_SAMPLING})}),m?e(Wt,{bgTint:"800",richTitle:{title:nt.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:Bh.All,label:"All",badge:{label:b+v+y,textSize:te.XXXS}},{value:Bh.Noisy,label:nt.NOISY_OPERATIONS,badge:{label:b,textSize:te.XXXS}},{value:Bh.HighlyRelevant,label:nt.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:te.XXXS}},{value:Bh.CostReduction,label:nt.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:te.XXXS}}]),selected:a,setSelected:r}),t(ae,{$gap:4,children:h.length?h.map(e=>t(Ph,{name:e.rule.name,summary:Xh(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t($e,{title:`No ${a===Bh.All?`${Bh.Noisy}, ${Bh.HighlyRelevant} and ${Bh.CostReduction}`:a} operations`})})]}):t(Mh,{children:t(ee,{size:te.XS,color:ne.Secondary,children:nt.TAIL_SAMPLING})})]})});var b,v,y},Vh=[Tn.Deployment,Tn.StatefulSet,Tn.DaemonSet,Tn.DeploymentConfig,Tn.Rollout,Tn.Pod];var Hh;(e=>{e.Workload="Workload",e.Pod="Pod"})(Hh||(Hh={}));const jh=e=>!!e&&cn(e.status)===Pe.Error,Gh=e=>jh(e.healthStatus),Wh=e=>jh(e.odigosHealthStatus)||(e.processes??[]).some(Gh),Kh=e=>jh(e.agentInjectedStatus)||jh(e.odigosHealthStatus)||(e.containers??[]).some(Wh),Yh=({onClose:n,sourceId:o,onRedirectToSampling:r})=>{const s=v(),{isK8s:c,platformType:u}=S(),{sourcesApi:h,configApi:m}=Gl(),{selectedStreamName:g}=ot(),{genericForm:f,loadSource:b,validateFormData:y}=Jl(),{data:C}=m.useEffectiveConfig(),[x,w]=l(!1),[T,k]=l(!1),[I,E]=l(!1),[N,O]=l(kp.Overview),[$,A]=l(null),[D,R]=l({openFor:null}),_=(()=>{const[e,t]=l(null),n=d(e=>{t({tab:kp.Pods,podName:e.podName})},[]),o=d((e,n)=>{t({tab:kp.Pods,podName:e.podName,containerName:n.containerName})},[]),a=d((e,n,o)=>{const i=Ap({identifyingAttributes:o.identifyingAttributes});t({tab:kp.Pods,podName:e.podName,containerName:n.containerName,processPid:i})},[]),r=d(()=>t(null),[]);return i(()=>({jumpToTarget:e,jumpToPod:n,jumpToContainer:o,jumpToProcess:a,clearJumpToTarget:r}),[e,n,o,a,r])})();a(()=>{_.jumpToTarget&&O(_.jumpToTarget.tab)},[_.jumpToTarget]),a(()=>{$&&JSON.stringify(yn(o))!==JSON.stringify(yn($))&&A(null)},[o,$]);const P=p(!1),L=d(async()=>A(await h.fetchById(o)||null),[o,h]);a(()=>{if(P.current||(L(),P.current=!0),!x){const e=setInterval(()=>L(),3e3);return()=>clearInterval(e)}},[L,x]),a(()=>{$&&b($)},[$]);const F=$&&Vh.includes($.id.kind),M=i(()=>{const e=[],n=($?.pods??[]).some(Kh),o=(i=$,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(gl,{...e,fill:s.v2.colors.red[500]});return e.push({value:kp.Overview,label:nt.OVERVIEW}),c?(e.push({value:kp.Pods,label:nt.PODS,icon:n?a:void 0}),e.push({value:kp.Libraries,label:nt.LIBRARIES,icon:o?a:void 0}),e.push({value:kp.PeerSources,label:nt.PEER_SOURCES}),C?.profiling?.enabled&&e.push({value:kp.Profiling,label:nt.PROFILING}),e.push({value:kp.Sampling,label:nt.SAMPLING}),e.push({value:kp.Debug,label:nt.DEBUG}),e):e},[c,C,$?.pods,s]),z=d(()=>w(!0),[]),B=i(()=>()=>{n(),r()},[n,r]),X=d(()=>{$&&b($),w(!1)},[$]),U=d(async()=>{if(!$||!f)return;const{errorMessage:e,preparedFormData:t}=y();if(e)return;const n=t.otelServiceName!==$.id.name?t.otelServiceName:"";await h.update(o,{...t,otelServiceName:n}),w(!1)},[$,f,y,o,h]),V=!1===$?.markedForInstrumentation?.markedForInstrumentation,H=d(()=>k(!0),[]),j=d(async()=>{if(!$)return;const e=!1===$.markedForInstrumentation?.markedForInstrumentation;await h.persistV2({[Dt]:[{namespace:$.id.namespace,name:$.id.name,kind:$.id.kind,...$.id.region?{region:$.id.region}:{},selected:e,currentStreamName:g}]}),k(!1),e||n()},[$,h,g,n]),G=d(()=>{R({openFor:Hh.Workload})},[]),W=d(e=>{O(e),_.clearJumpToTarget()},[_]),K=d(async()=>{await h.recoverFromRollback(o)},[h,o]),Y=d(()=>R({openFor:null}),[]),J=d(async()=>{D.openFor===Hh.Workload?await h.restartWorkloads([o]):D.openFor===Hh.Pod&&D.podNamespace&&D.podName&&await h.restartPod(D.podNamespace,D.podName),Y()},[D,h,o,Y]),q=i(()=>{const{kind:e,name:t}=o;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[o]),Z=i(()=>{const e=[];return x||N===kp.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:ja,active:x,onClick:z}),c&&F&&e.push({id:"edit-source-btn-restart",label:nt.ROLLOUT_RESTART,icon:Sl,onClick:G}),e.push(V?{id:"edit-source-btn-instrument",label:Ft.INSTRUMENT,icon:za,color:s.v2.colors.green[500],active:T,onClick:H}:{id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:Ma,color:s.v2.colors.red[500],active:T,onClick:H})),e},[N,x,T,V,c,F,z,G,H,s]),Q=i(()=>{if(!$)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:$.id.name,leftIcon:c?ml:void 0}),$.serviceName&&$.serviceName!==$.id.name&&e.push({...t,label:$.serviceName,leftIcon:sl,textColor:s.v2.colors.silver[200]}),e},[$,s,c]);if(!$)return t(zt,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const ee=N===kp.Profiling?I?"95vw":"fit-content":x?void 0:"60vw",ne=c?Hn($.containers)[0]:Vn(u);return e(Bp,{value:_,children:[t(zt,{isOpen:!0,width:ee,minWidth:"min(1100px, 100vw)",header:{icon:ne,titleBadges:Q,onClose:()=>{W(kp.Overview),A(null),E(!1),n()},actions:Z},footer:{actions:x?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:X},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:U}]:[]},children:t(le,{$padding:"4px 12px 12px",children:e(ae,{$gap:16,children:[!x&&M.length>1&&t(ve,{options:M,selected:N,setSelected:W}),(()=>{switch(N){case kp.Overview:return x?t(Xs,{}):t(zu,{source:$,onClickRollout:G,onClickRollback:K});case kp.Pods:return t(jp,{source:$,onClickRestartPod:F?(e,t)=>R({openFor:Hh.Pod,podNamespace:e,podName:t}):void 0});case kp.Libraries:return t(Bu,{source:$});case kp.PeerSources:return t(Wp,{source:$});case kp.Profiling:return t(Oh,{source:$,onFlameFullscreenChange:E});case kp.Sampling:return t(zh,{source:$,onRedirectToSampling:B});case kp.Debug:return t(Zp,{source:$});default:return null}})()]})})}),t(Ar,{target:"source",action:V?"instrument":"uninstrument",isOpen:T,onClose:()=>k(!1),onApprove:j}),t(tt,{isOpen:D.openFor===Hh.Workload,title:q.title,description:q.description,onClose:Y,denyButton:{label:"Go back",variant:Ie.Secondary,onClick:Y},approveButton:{label:Ft.CONFIRM,variant:Ie.Primary,onClick:J}}),t(Ar,{target:"pod",action:"restart",description:nt.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:D.openFor===Hh.Pod,onClose:Y,onApprove:J,overrideApproveButtonLabel:nt.DELETE_POD_TO_RESTART})]})},Jh=b.div`
|
|
784
798
|
display: flex;
|
|
785
799
|
align-items: center;
|
|
786
800
|
gap: 8px;
|
|
@@ -790,9 +804,9 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
790
804
|
&:hover {
|
|
791
805
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
792
806
|
}
|
|
793
|
-
`,
|
|
807
|
+
`,qh=b.div`
|
|
794
808
|
flex: 1;
|
|
795
|
-
`,
|
|
809
|
+
`,Zh=({onClick:n})=>{const o=v().v2.colors.red[500];return e(Jh,{"data-id":"sampling-view-btn-delete",onClick:n,children:[t(ee,{size:te.XS,weight:500,color:o,children:Kn}),t(Ma,{size:16,fill:o})]})};const Qh={[Zl.EditAutoNoisy]:{title:so,subTitle:ro,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Zl.EditAutoCostReduction]:{title:lo,subTitle:ao,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Zl.EditAutoHighlyRelevant]:{title:io,subTitle:oo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},em=({isOpen:e,title:n,subTitle:o,onClose:i,footer:a,renderBody:l})=>t(zt,{isOpen:e,width:po,header:{icon:Ol,title:n,subTitle:o,onClose:i},footer:a,children:l?l():t(le,{$padding:"12px",children:t(Ws,{})})}),tm=({isOpen:o,onClose:r,onSubmit:s,validateForm:c,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=ql(Zl.Create),[b,v]=l(!1);a(()=>{o&&(m(),v(!1))},[o]);const y=d(()=>{v(!1),s(h)},[h,s]),C=d(()=>{if(c){const e=c(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(E(t)))(h,u)?v(!0):y()},[h,u,c,f,y]),S=i(()=>b?((e,t)=>{switch(e){case"noisy":return T($(t));case"highlyRelevant":return k(O(t));case"costReduction":return I(N(t))}})(u,h):[],[b,u,h]),x={note:g?{status:Pe.Warning,message:g.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:jn,variant:Ie.Secondary,size:ke.S,onClick:r},{"data-id":"sampling-create-btn-submit",label:Un,variant:Ie.Primary,size:ke.S,onClick:C,disabled:!!g}]};return e(n,{children:[t(em,{isOpen:o,title:Zn[u],subTitle:Yn[u],onClose:r,footer:x}),t(tt,{isOpen:b,title:to,description:eo,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Qn,variant:Ie.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Un,variant:Ie.Primary,onClick:y},children:e(ae,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(ee,{size:te.XS,weight:500,color:ne.Secondary,children:no}),t("div",{style:{width:"100%"},children:t(yr,{summary:S})})]})})]})},nm=({onClose:o,onDelete:a,onSaveEdit:l,validateForm:r,onNavigateToDuplicate:s})=>{const{data:c,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=ql(Zl.View),b=c?.rule.name||qn,v=p&&c?Jn[c.category]:`${b} preview`,y=d(()=>{if(c&&p){if(r){const e=r(u);if(e)return void f(e)}l(u,c.rule.ruleId,c.samplingId),m()}},[c,p,u,l,r,f,m]),C=d(()=>{c&&a(c.rule.ruleId,c.samplingId)},[c,a]),S=i(()=>{if(!c)return;const i=g?{message:g.message,onViewRule:s?()=>s(g.ruleId):void 0}:null;return function(o){if(o.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=o;return{children:e(n,{children:[t(Zh,{onClick:l}),r&&t(_e,{status:Pe.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(qh,{}),t(Te,{"data-id":"sampling-view-edit-btn-cancel",label:jn,variant:Ie.Secondary,size:ke.S,onClick:i}),t(Te,{"data-id":"sampling-view-edit-btn-save",label:Gn,variant:Ie.Primary,size:ke.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=o;return{children:e(n,{children:[t(Zh,{onClick:i}),t(qh,{}),t(Te,{"data-id":"sampling-view-btn-cancel",label:jn,variant:Ie.Secondary,size:ke.S,onClick:a}),t(Te,{"data-id":"sampling-view-btn-edit",label:Wn,variant:Ie.Primary,size:ke.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:o,onEdit:h})},[c,p,g,m,y,C,h,o,s]);return t(em,{isOpen:!!c,title:v,subTitle:c?Yn[c.category]:"",onClose:o,footer:S})},om=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=ql(Zl.EditAutoNoisy),l=d(()=>o(i,a),[o,i,a]);return t(lm,{formType:Zl.EditAutoNoisy,isOpen:e,onClose:n,onSave:l})},im=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i,resolvedPercentage:a}=ql(Zl.EditAutoCostReduction),l=d(()=>o(i,a),[o,i,a]);return t(lm,{formType:Zl.EditAutoCostReduction,isOpen:e,onClose:n,onSave:l})},am=({isOpen:e,onClose:n,onSave:o})=>{const{localEnabled:i}=ql(Zl.EditAutoHighlyRelevant),a=d(()=>o(i),[o,i]);return t(lm,{formType:Zl.EditAutoHighlyRelevant,isOpen:e,onClose:n,onSave:a})},lm=({formType:e,isOpen:n,onClose:o,onSave:i})=>{const a=Qh[e];return t(em,{isOpen:n,title:a.title,subTitle:a.subTitle,onClose:o,footer:{actions:[{"data-id":a.cancelId,label:jn,variant:Ie.Secondary,size:ke.S,onClick:o},{"data-id":a.saveId,label:co,variant:Ie.Primary,size:ke.S,onClick:i}]}})},rm=e=>{switch(e.formType){case Zl.Create:return t(ar,{formType:Zl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(tm,{...e})});case Zl.View:return t(ar,{formType:Zl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(nm,{...e})});case Zl.EditAutoNoisy:return t(ar,{formType:Zl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(om,{...e})});case Zl.EditAutoCostReduction:return t(ar,{formType:Zl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(im,{...e})});case Zl.EditAutoHighlyRelevant:return t(ar,{formType:Zl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(am,{...e})})}},sm=({token:o,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=Pt(),m=!a||i||!c.newToken;return uo({key:"Enter",active:!m},s),e(oe,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Ee,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(oe,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(St,{title:"Saving...",withGradient:!0}):e(n,{children:[t(Te,{variant:Ie.Secondary,size:ke.S,leftIcon:Qa,onClick:r,disabled:i}),t(Te,{variant:Ie.Primary,size:ke.S,leftIcon:Za,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ee,{size:te.XS,children:new Array(55).fill("•").join("")}),e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:o}),t(yt,{icon:ja,onClick:l})]})]})},cm=({expiresAt:e,callbackValid:n,callbackExpired:o})=>{const{formatTimeAgo:l}=an(),r=i(()=>l(e),[e,l]),s=i(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=i(()=>ho(e,0)?Pe.Error:ho(e,2592e6)?Pe.Warning:Pe.Success,[e]),d=i(()=>c===Pe.Success?Za:c===Pe.Warning?$l:gl,[c]);return a(()=>{c===Pe.Success?n():c===Pe.Error&&o()},[c]),t(Ue,{text:s,children:t(ce,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},dm=b.div`
|
|
796
810
|
display: flex;
|
|
797
811
|
flex-direction: column;
|
|
798
812
|
gap: 12px;
|
|
@@ -800,7 +814,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
800
814
|
border-radius: 12px;
|
|
801
815
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
802
816
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
803
|
-
`,
|
|
817
|
+
`,pm=({children:e})=>{const n=v();return t(ee,{size:te.XXXS,color:n.v2.colors.grey[150],children:e})},um=({token:n})=>{const{tokensApi:o}=Gl(),[i,a]=l(!1),[r,s]=l(!1),[c,d]=l(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=Jt({newToken:""});return t(ut,{richTitle:{icon:Al,title:"Odigos Pro Token"},children:e(dm,{$isExpired:c,children:[e(oe,{$justifyContent:"space-between",children:[e(ae,{$gap:4,children:[t(pm,{children:"Issued for"}),t(ee,{size:te.XS,children:n.name||"N/A"})]}),e(ae,{$gap:4,children:[t(pm,{children:"Expiration"}),t(cm,{expiresAt:n.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ae,{})]}),t(oe,{children:e(ae,{children:[t(pm,{children:"Token"}),t(sm,{token:n.token,newToken:p.newToken,isLoading:i,isEditing:r,onEdit:()=>s(!0),onCancel:()=>(s(!1),void u("newToken","")),onSave:()=>(async()=>{if(!o.updateToken)return;a(!0);const e=await o.updateToken(p.newToken.trim());a(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},hm=b.div`
|
|
804
818
|
display: flex;
|
|
805
819
|
flex-direction: column;
|
|
806
820
|
align-items: center;
|
|
@@ -809,23 +823,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
809
823
|
padding: 12px 24px;
|
|
810
824
|
border-radius: 8px;
|
|
811
825
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
812
|
-
`,im=()=>{const{progress:n}=$t(),{describeApi:o,namespacesApi:i}=Gl(),{items:a}=i.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=Jt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:Rl,title:"Diagnose"},children:r?e(om,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Dt.DownloadingDiagnose]?.percentage,percentage:n[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Dt.DownloadingDiagnose]?.percentage,visualIcon:El,startedAt:r}),n[Dt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Dt.DownloadingDiagnose].list.map((n,o)=>e(oe,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(Za,{size:16}):n.status===Pe.Error?t(Qa,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(ae,{$gap:24,children:[t(ee,{size:te.XXS,color:ne.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(ae,{$gap:16,children:[e(oe,{$gap:8,children:[t(Q,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include pprof profiles"})]}),e(oe,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include Prometheus metrics"})]}),e(oe,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(mo,{alignX:fo.Left,alignY:go.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:Ie.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(ce,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:El,variant:Ie.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},am=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:i}=Gl(),[r,s]=l(null);return a(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:Cl,title:"General Information"},children:t(Wt,{cellsPerRow:2,items:[{id:bo(),title:"Odigos Version",label:n},{id:bo(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:bo(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:bo(),title:"Tier",label:o}]})})},lm=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=Gl(),l=a.useTokens().items[0];return e(zt,{isOpen:n,header:{icon:Cl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(am,{}),a.updateToken&&l&&t(nm,{token:l}),i.downloadDiagnose&&t(im,{})]})},rm=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=ot(),{dataStreamsApi:s}=Gl(),{requestSubmit:c}=Yl(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),i()},[s,l,r,i]),u=d(()=>c(p),[c,p]);return uo({key:"Enter",active:o},u),e(n,{children:[t(tt,{isOpen:o,onClose:i,onCloseEnd:a,title:nt.NAME_YOUR_STREAM,description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},sm=({isOpen:o,onClose:i,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Gl(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Yl();a(()=>{o&&r&&p(r)},[o,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),i()},[s,r,i]),g=d(()=>u(m),[u,m]);return uo({key:"Enter",active:o},g),e(n,{children:[t(tt,{isOpen:o,onClose:i,onCloseEnd:l,title:nt.RENAME_STREAM(r),description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},cm=({scale:n=1})=>e("svg",{width:742*n,height:533*n,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),dm=b.div`
|
|
826
|
+
`,mm=()=>{const{progress:n}=$t(),{describeApi:o,namespacesApi:i}=Gl(),{items:a}=i.useNamespaces(),[r,s]=l(null),{formData:c,handleFormChange:d,resetFormData:p}=Jt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ut,{richTitle:{icon:Dl,title:"Diagnose"},children:r?e(hm,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[Rt.DownloadingDiagnose]?.percentage,percentage:n[Rt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[Rt.DownloadingDiagnose]?.percentage,visualIcon:Nl,startedAt:r}),n[Rt.DownloadingDiagnose]?.list?.length&&t(ae,{$width:"100%",children:n[Rt.DownloadingDiagnose].list.map((n,o)=>e(oe,{$gap:4,$alignItems:"center",children:[n.status===Pe.Success?t(Za,{size:16}):n.status===Pe.Error?t(Qa,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ee,{size:te.XXXS,color:ne.Secondary,children:n.label})]},`diagnose-item-${o}-${n.label}`))})]}):e(ae,{$gap:24,children:[t(ee,{size:te.XXS,color:ne.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(ae,{$gap:16,children:[e(oe,{$gap:8,children:[t(Q,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include pprof profiles"})]}),e(oe,{$gap:8,children:[t(Q,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include Prometheus metrics"})]}),e(oe,{$gap:8,children:[t(Q,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>d("includeSourceWorkloads",e)}),t(ee,{size:te.XXXS,color:ne.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(mo,{alignX:fo.Left,alignY:go.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:Ie.Secondary,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(ce,{label:c.sourceWorkloadNamespaces.length,status:Pe.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(Te,{label:"Download Diagnose",rightIcon:Nl,variant:Ie.Primary,onClick:async()=>{o.downloadDiagnose&&(s(Date.now()),await o.downloadDiagnose(c),s(null),p())},disabled:null!==r})})]})})},gm=()=>{const{platformType:e,version:n,tier:o}=S(),{describeApi:i}=Gl(),[r,s]=l(null);return a(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ut,{richTitle:{icon:Cl,title:"General Information"},children:t(Wt,{cellsPerRow:2,items:[{id:bo(),title:"Odigos Version",label:n},{id:bo(),title:`${e.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:bo(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:bo(),title:"Tier",label:o}]})})},fm=({isOpen:n,onClose:o})=>{const{describeApi:i,tokensApi:a}=Gl(),l=a.useTokens().items[0];return e(zt,{isOpen:n,header:{icon:Cl,title:"System Overview",onClose:o},children:[i.fetchDescribeOdigos&&t(gm,{}),a.updateToken&&l&&t(um,{token:l}),i.downloadDiagnose&&t(mm,{})]})},bm=({isOpen:o,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:r}=ot(),{dataStreamsApi:s}=Gl(),{requestSubmit:c}=Yl(),p=d(async e=>{s.create?await s.create(e):(l([e]),r(e.name)),i()},[s,l,r,i]),u=d(()=>c(p),[c,p]);return uo({key:"Enter",active:o},u),e(n,{children:[t(tt,{isOpen:o,onClose:i,onCloseEnd:a,title:nt.NAME_YOUR_STREAM,description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:Ie.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},vm=({isOpen:o,onClose:i,onCloseEnd:l,dataStreamName:r})=>{const{dataStreamsApi:s}=Gl(),{genericForm:c,loadDataStream:p,requestSubmit:u}=Yl();a(()=>{o&&r&&p(r)},[o,r]);const h=!!c?.isFormDirty,m=d(async e=>{await s.update(r,e),i()},[s,r,i]),g=d(()=>u(m),[u,m]);return uo({key:"Enter",active:o},g),e(n,{children:[t(tt,{isOpen:o,onClose:i,onCloseEnd:l,title:nt.RENAME_STREAM(r),description:nt.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:Ie.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:Ie.Secondary,onClick:i},children:t(Bs,{autoFocus:!0})}),t(zs,{})]})},ym=({scale:n=1})=>e("svg",{width:742*n,height:533*n,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),Cm=b.div`
|
|
813
827
|
position: absolute;
|
|
814
828
|
top: 50%;
|
|
815
829
|
left: 50%;
|
|
816
830
|
transform: translate(-50%, -50%);
|
|
817
831
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
818
|
-
`,
|
|
832
|
+
`,Sm=()=>{const{drawerType:n,setDrawerType:o}=vn(),i=n===yo.OnboardingDone,a=()=>o(null);return e(vo,{isOpen:i,onClose:a,children:[t(ym,{}),t(Cm,{children:e(ae,{$gap:32,$alignItems:"center",children:[e(ae,{$gap:24,$alignItems:"center",children:[t(ee,{size:te.L,weight:500,children:"Welcome to"}),t(Rr,{size:260}),t(ee,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(Te,{label:"Get Started",rightIcon:Ba,onClick:a})]})})]})},xm=b.div`
|
|
819
833
|
display: flex;
|
|
820
834
|
flex-direction: column;
|
|
821
835
|
gap: 8px;
|
|
822
836
|
padding: 4px 8px;
|
|
823
837
|
border-radius: 8px;
|
|
824
838
|
width: 100%;
|
|
825
|
-
`,
|
|
839
|
+
`,wm=b.div`
|
|
826
840
|
white-space: pre;
|
|
827
841
|
overflow-x: auto;
|
|
828
|
-
`,
|
|
842
|
+
`,Tm=({name:n,recommended:o,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(xm,{children:[e(oe,{$gap:8,$justifyContent:"space-between",children:[e(oe,{$gap:4,children:[t(ee,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:n}),o&&t(ce,{label:Co,leftIcon:Rl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(ge,{name:s??`sampling-onboarding-toggle-${n}`,label:i,labelAlign:fe.Left,value:a,onChange:l,size:Nt.S})]}),t(wm,{children:t(w,{parts:r})})]})},km=b.div`
|
|
829
843
|
position: relative;
|
|
830
844
|
display: flex;
|
|
831
845
|
align-items: center;
|
|
@@ -835,18 +849,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
835
849
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
836
850
|
border-top-left-radius: 18px;
|
|
837
851
|
border-top-right-radius: 18px;
|
|
838
|
-
`,
|
|
852
|
+
`,Im=b.div`
|
|
839
853
|
position: absolute;
|
|
840
854
|
left: 16px;
|
|
841
855
|
top: 50%;
|
|
842
856
|
transform: translateY(-50%);
|
|
843
|
-
`,
|
|
857
|
+
`,Em=b.div`
|
|
844
858
|
height: 16px;
|
|
845
859
|
width: 100%;
|
|
846
860
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
847
861
|
border-top-left-radius: 18px;
|
|
848
862
|
border-top-right-radius: 18px;
|
|
849
|
-
`,
|
|
863
|
+
`,Nm=b.div`
|
|
850
864
|
width: ${({$width:e})=>e}px;
|
|
851
865
|
display: flex;
|
|
852
866
|
flex-direction: column;
|
|
@@ -854,7 +868,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
854
868
|
gap: 22px;
|
|
855
869
|
padding: 8px 32px 32px 32px;
|
|
856
870
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
857
|
-
`,
|
|
871
|
+
`,Om=e=>t(_l,{rotate:90,...e}),$m=({children:n,center:o,onNext:i,nextLabel:a=So,nextLoading:l})=>e(oe,{$gap:8,$justifyContent:o?"center":"flex-end",$padding:"0 16px 16px 16px",children:[n,i&&t(Te,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:Om,variant:Ie.Primary,size:ke.M,onClick:i,loading:l})]}),Am=e=>t(_l,{rotate:-90,...e}),Dm=({title:n,onBack:o})=>{const i=v();return e(km,{$hasBack:!!o,children:[o&&t(Im,{children:t(yt,{"data-id":"sampling-onboarding-back",icon:Am,size:Ct.M,onClick:o})}),t(ee,{size:te.M,weight:500,color:i.v2.colors.white[500],align:"center",children:n})]})},Rm=b.div`
|
|
858
872
|
box-sizing: border-box;
|
|
859
873
|
width: ${({$width:e})=>e??"100%"};
|
|
860
874
|
${({$fillHeight:e})=>e&&y`
|
|
@@ -867,16 +881,16 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
867
881
|
padding: 16px;
|
|
868
882
|
border-radius: 16px;
|
|
869
883
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
870
|
-
`,
|
|
884
|
+
`,_m=({children:e,fillHeight:n,width:o})=>t(Rm,{$fillHeight:n,$width:o,children:e}),Pm=b.ul`
|
|
871
885
|
margin: 0;
|
|
872
886
|
padding: 0;
|
|
873
887
|
list-style: disc;
|
|
874
|
-
`,
|
|
888
|
+
`,Lm=b.li`
|
|
875
889
|
margin-left: 18px;
|
|
876
890
|
& + & {
|
|
877
891
|
margin-top: 6px;
|
|
878
892
|
}
|
|
879
|
-
`,
|
|
893
|
+
`,Fm=({items:e,color:n})=>{const o=v(),i=n||o.v2.colors.silver[200];return t(Pm,{children:e.map((e,n)=>t(Lm,{style:{color:i},children:t(ee,{size:te.XXS,color:i,children:e})},n))})},Mm=({items:n})=>{const o=v();return t(ae,{$gap:16,children:n.map((n,i)=>e(oe,{$gap:8,$alignItems:"flex-start",children:[e(ee,{size:te.XS,color:o.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ae,{$gap:2,children:[t(ee,{size:te.XS,color:o.v2.colors.white[500],weight:500,children:n.title}),t(ee,{size:te.XS,color:o.v2.colors.silver[200],children:n.description})]})]},i))})},zm=({message:e})=>t(_e,{status:Pe.Default,message:e,fullWidth:!0,smallIcon:!0}),Bm=b.div`
|
|
880
894
|
width: 100%;
|
|
881
895
|
padding: 8px;
|
|
882
896
|
display: flex;
|
|
@@ -884,12 +898,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
884
898
|
gap: 4px;
|
|
885
899
|
border-radius: 16px;
|
|
886
900
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
887
|
-
`,
|
|
901
|
+
`,Xm=b.div`
|
|
888
902
|
display: flex;
|
|
889
903
|
align-items: center;
|
|
890
904
|
gap: 8px;
|
|
891
905
|
padding: 4px 8px 12px 8px;
|
|
892
|
-
`,
|
|
906
|
+
`,Um=b.div`
|
|
893
907
|
width: 100%;
|
|
894
908
|
display: flex;
|
|
895
909
|
flex-direction: column;
|
|
@@ -897,20 +911,20 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
897
911
|
padding: 8px;
|
|
898
912
|
border-radius: 12px;
|
|
899
913
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
900
|
-
`,
|
|
914
|
+
`,Vm=({children:e})=>{const n=v();return t(ee,{size:te.S,weight:500,color:n.v2.colors.white[500],align:"center",children:e})},Hm=b.div`
|
|
901
915
|
white-space: pre-line;
|
|
902
|
-
`,
|
|
916
|
+
`,jm=({enabled:o,onEnabledChange:a,onBack:l,onNext:r})=>{const s=v(),c=i(()=>A({enabled:o,keepPercentage:0}),[o]);return e(n,{children:[t(Dm,{title:xo,onBack:l}),e(Nm,{$width:854,children:[t(Vm,{children:wo}),e(ae,{$gap:8,$width:"100%",children:[t(_m,{children:t(Hm,{children:t(ee,{size:te.XXS,color:s.v2.colors.silver[200],children:To})})}),e(ae,{$gap:8,$width:"100%",children:[e(Bm,{children:[t(Xm,{children:t(ee,{size:te.S,weight:500,color:s.v2.colors.white[500],children:ko})}),t(Um,{children:t(Tm,{name:Eo,recommended:!0,toggleLabel:Io,enabled:o,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(zm,{message:No})]})]})]}),t($m,{onNext:r})]})},Gm=e=>t(_l,{rotate:90,...e}),Wm=({onClose:o})=>{const i=v();return e(n,{children:[t(Em,{}),e(Nm,{$width:732,children:[t(Oo,{icon:Ol}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ee,{size:te.M,weight:500,color:i.v2.colors.white[500],children:$o}),Ao.split("\n").map((e,n)=>t(Vm,{children:e},`subtitle-${n}-${e}`)),e(_m,{children:[t(ee,{size:te.XS,color:i.v2.colors.silver[200],children:Do}),t(Fm,{color:i.v2.colors.white[500],items:[Ro,_o,Po]})]})]})]}),t($m,{center:!0,children:t(Te,{"data-id":"sampling-onboarding-btn-go-to",label:Lo,rightIcon:Gm,variant:Ie.Primary,size:ke.M,onClick:o})})]})},Km=e=>t(_l,{rotate:90,...e}),Ym=b.div`
|
|
903
917
|
display: flex;
|
|
904
918
|
flex-direction: column;
|
|
905
919
|
align-items: center;
|
|
906
920
|
gap: 8px;
|
|
907
921
|
width: 100%;
|
|
908
|
-
`,
|
|
922
|
+
`,Jm=({onSkip:o,onNext:i})=>{const a=v();return e(n,{children:[t(Em,{}),e(Nm,{$width:732,children:[t(Oo,{icon:Ol}),e(ae,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Ym,{children:[t(ee,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Fo}),t(Vm,{children:Mo})]}),e(_m,{children:[t(ee,{size:te.XS,color:a.v2.colors.silver[200],children:zo}),t(Mm,{items:[{title:Xo,description:Bo},{title:Vo,description:Uo},{title:jo,description:Ho}]}),t(zm,{message:Go})]})]})]}),e($m,{center:!0,children:[t(Te,{"data-id":"sampling-onboarding-btn-skip",label:Wo,variant:Ie.Secondary,onClick:o}),t(Te,{"data-id":"sampling-onboarding-btn-start",label:Ko,rightIcon:Km,variant:Ie.Primary,onClick:i})]})]})},qm=b.div`
|
|
909
923
|
display: flex;
|
|
910
924
|
align-items: stretch;
|
|
911
925
|
gap: 16px;
|
|
912
926
|
width: 100%;
|
|
913
|
-
`,
|
|
927
|
+
`,Zm=b.div`
|
|
914
928
|
flex: 1;
|
|
915
929
|
display: flex;
|
|
916
930
|
flex-direction: column;
|
|
@@ -930,18 +944,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
930
944
|
background-color: ${t.v2.colors.silver[700]};
|
|
931
945
|
}
|
|
932
946
|
`}
|
|
933
|
-
`,
|
|
947
|
+
`,Qm=b.div`
|
|
934
948
|
display: flex;
|
|
935
949
|
align-items: center;
|
|
936
950
|
gap: 8px;
|
|
937
951
|
padding: 12px 16px;
|
|
938
|
-
`,
|
|
952
|
+
`,eg=b.div`
|
|
939
953
|
flex: 1;
|
|
940
954
|
padding: 8px;
|
|
941
955
|
display: flex;
|
|
942
956
|
flex-direction: column;
|
|
943
957
|
gap: 8px;
|
|
944
|
-
`,
|
|
958
|
+
`,tg=b.div`
|
|
945
959
|
flex: 1;
|
|
946
960
|
display: flex;
|
|
947
961
|
flex-direction: column;
|
|
@@ -949,17 +963,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
949
963
|
padding: 12px;
|
|
950
964
|
border-radius: 12px;
|
|
951
965
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
952
|
-
`,
|
|
966
|
+
`,ng=b.div`
|
|
953
967
|
display: flex;
|
|
954
968
|
justify-content: flex-end;
|
|
955
|
-
`,
|
|
969
|
+
`,og=b.div`
|
|
956
970
|
display: flex;
|
|
957
971
|
align-items: center;
|
|
958
972
|
gap: 8px;
|
|
959
973
|
padding: 4px 12px 4px 4px;
|
|
960
974
|
border-radius: 8px;
|
|
961
975
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
962
|
-
`,
|
|
976
|
+
`,ig=b.div`
|
|
963
977
|
display: flex;
|
|
964
978
|
align-items: center;
|
|
965
979
|
justify-content: center;
|
|
@@ -967,13 +981,13 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
967
981
|
height: 24px;
|
|
968
982
|
border-radius: 6px;
|
|
969
983
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
970
|
-
`,
|
|
984
|
+
`,ag=({selected:n,onSelect:o,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),p=n?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Zm,{$selected:n,onClick:o,children:[e(Qm,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${i}`,value:n,onChange:o,size:we.L}),t(Ol,{size:24,fill:d.v2.colors.white[500]}),t(ee,{size:te.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(eg,{children:[e(tg,{$selected:n,children:[e(ae,{$gap:8,children:[t(ce,{...l,textSize:te.XXXS}),t(ee,{size:te.XXS,color:p,children:a})]}),r&&r.length>0&&t(Fm,{color:p,items:r}),s&&e(og,{children:[t(ig,{children:t($l,{size:18,fill:d.v2.colors.yellow[500]})}),t(ee,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(ng,{children:t(Te,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:pi,rightIcon:Va,variant:Ie.Text,size:ke.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},lg=({strategy:o,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(n,{children:[t(Dm,{title:Yo,onBack:a}),e(Nm,{$width:854,children:[t(Vm,{children:Jo}),e(qm,{children:[t(ag,{selected:"keep-list"===o,onSelect:()=>i("keep-list"),name:ni,description:ti,badgeProps:{label:ei,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Zo,Qo],warning:qo,onReadMore:c}),t(ag,{selected:"drop-list"===o,onSelect:()=>i("drop-list"),name:ri,description:li,badgeProps:{label:ai,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[oi,ii],onReadMore:c}),t(ag,{selected:"advanced"===o,onSelect:()=>i("advanced"),name:di,description:ci,badgeProps:{label:si,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t($m,{onNext:l})]})},rg=({onBack:o,onNext:a,submitting:l})=>{const r=v(),s=i(()=>[{title:gi,bullets:[ui,hi,mi]},{title:Si,bullets:[fi,bi,vi,yi,Ci]}],[]);return e(n,{children:[t(Dm,{title:xi,onBack:o}),e(Nm,{$width:854,children:[t(Vm,{children:wi}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((n,o)=>e(_m,{fillHeight:!0,width:"50%",children:[t(ee,{size:te.XS,color:r.v2.colors.white[500],children:n.title}),t(Fm,{items:n.bullets})]},o))}),t(zm,{message:Ti})]}),t($m,{onNext:a,nextLoading:l})]})},sg=b.div`
|
|
971
985
|
white-space: pre-line;
|
|
972
|
-
`,
|
|
986
|
+
`,cg=({errorPresetEnabled:o,onErrorPresetChange:a,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=i(()=>D(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Dm,{title:ki,onBack:l}),e(Nm,{$width:854,children:[t(Vm,{children:Ii}),e(ae,{$gap:8,$width:"100%",children:[e(_m,{children:[t(sg,{children:t(ee,{size:te.XXS,color:c.v2.colors.silver[200],children:Ei})}),t(zm,{message:Ti})]}),e(Bm,{children:[e(Xm,{children:[t(ee,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Ni}),t(fl,{size:16,fill:c.v2.colors.silver[200]})]}),t(Um,{children:t(Tm,{name:$i,recommended:!0,toggleLabel:Oi,enabled:o,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t($m,{onNext:r,nextLoading:s})]})},dg=b.div`
|
|
973
987
|
white-space: pre-line;
|
|
974
|
-
`,
|
|
988
|
+
`,pg=b.div`
|
|
975
989
|
width: fit-content;
|
|
976
|
-
`,ng=["50","25","10","1","0.1"],og=({value:n,onChange:o,label:a})=>{const l=v(),r=i(()=>ng.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ae,{$gap:8,children:[t(ee,{size:te.XS,color:l.v2.colors.white[500],children:a}),t(tg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},ig=({errorPresetEnabled:o,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=i(()=>R(o?{disabled:!1}:null),[o]);return e(n,{children:[t(xm,{title:Ai,onBack:s}),e(vm,{$width:854,children:[t(Dm,{children:Ri}),e(ae,{$gap:8,$width:"100%",children:[e(Tm,{children:[t(eg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Di})}),t(Nm,{items:[_i,Pi,Li,Fi,Mi]}),t(Om,{message:Ti})]}),e($m,{children:[e(Am,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:zi}),t(fl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Rm,{children:t(mm,{name:$i,recommended:!0,toggleLabel:Oi,enabled:o,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Rm,{children:t(og,{value:l,onChange:r,label:Bi})})]})]})]}),t(Cm,{onNext:c,nextLoading:d})]})},ag=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:i,docsUrl:r})=>{const{samplingApi:s}=Gl(),[c,p]=l("welcome"),[u,h]=l(!0),[m,g]=l("keep-list"),[f,b]=l(!0),[v,y]=l("25"),[C,S]=l(!1);a(()=>{e&&(p("welcome"),h(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=i??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.keepPercentage??0}))}if("advanced"!==m&&f){const n=s.createHighlyRelevant;n&&t.push(n({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const n=s.createCostReduction;n&&t.push(n({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),p("success")}catch{}finally{S(!1)}},[i,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(Bm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(Pm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(Jm,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(ig,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Qm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(qm,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Fm,{onClose:n})}return t(vo,{isOpen:e,onClose:n,children:w})};var lg,rg;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"})(lg||(lg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(rg||(rg={}));const sg=[{id:rg.CloudConnector,label:"Cloud Connector"}];var cg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(cg||(cg={}));const dg=[{key:cg.Name,label:"Name"},{key:cg.Type,label:"Type"},{key:cg.Status,label:"Status"},{key:cg.OdigosVersion,label:"Odigos Version"},{key:cg.ConnectedSince,label:"Connected Since"},{key:cg.LastActivity,label:"Last Activity"}],pg=(e,t)=>{const n=e.find(e=>e.key===cg.Id)?.rawValue;return t(n?.toString()||"")},ug={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},hg={[Xi.K8s]:hn.Purple,[Xi.Vm]:hn.Blue,[Xi.Connector]:hn.Green,[Xi.AwsEcs]:hn.Yellow},mg=({connections:n,getConnections:o,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=an(),{capabilities:b}=Gl(),[y,C]=l(!n?.length),[S,x]=l(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);a(()=>{S.length||w()},[]);const[T,k]=l(""),[I,N]=l(null),[E,O]=l([]),[$,A]=l(!1),[R,P]=l(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===rg.CloudConnector?A(!0):c?.(e)},[c]),M=i(()=>I===lg.BulkConfig?h:I===lg.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=i(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=D(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);a(()=>{if(!I||I===lg.Delete)return;const e=E.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,E.length,B.length]);const X=i(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:cg.Id,rawValue:e.id},{key:cg.Name,rawValue:e.name},{key:cg.Type,rawValue:e.type,component:()=>t(nn,{variant:hg[e.type]??hn.Default,label:Ui(e.type),leftIcon:Vn(e.type)})},{key:cg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Xi.Connector){const n=ug[e.status]??"Pending",o=e.status===Pe.Success?Za:e.status===Pe.Error?Qa:void 0;return t(ce,{status:e.status,label:n,leftIcon:o})}const n=e.status===Pe.Success?"Connection live":"Connection lost",o=e.status===Pe.Success?Za:Qa;return t(ce,{status:e.status,label:n,leftIcon:o})})(e)},{key:cg.OdigosVersion,rawValue:e.odigosVersion},{key:cg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:cg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||I?void 0:()=>r(e),isSelected:E.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||I===lg.BulkConfig&&!D(e.odigosVersion,h,e.type)||I===lg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,E,T,I,h,m,f,r]),U=i(()=>S.length>0&&S.every(e=>e.type===Xi.K8s),[S]),V=i(()=>{const e=(e,t)=>{O([e]),N(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===cg.Status)?.rawValue===Pe.Success)(e))return[{id:bo(),label:"Delete Connection",rightIcon:Ha,onClick:()=>pg(e,i)}];const d=pg(e,e=>t.find(t=>t.id===e));if(d?.type!==Xi.K8s)return[];const p=!!d&&D(d.odigosVersion,n,d.type),u=!!d&&D(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:bo(),tooltip:u?nt.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:tl,disabled:!u,onClick:()=>pg(e,a)}),l&&g.push({id:bo(),tooltip:nt.ADD_DESTINATION,rightIcon:Ya,onClick:()=>pg(e,l)}),r&&g.push({id:bo(),tooltip:nt.ADD_ACTION,rightIcon:Fa,onClick:()=>pg(e,r)}),s&&g.push({id:bo(),tooltip:nt.ADD_INSTRUMENTATION_RULE,rightIcon:el,onClick:()=>pg(e,s)}),c&&g.push({id:bo(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:ul,disabled:!p,onClick:()=>pg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,lg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,lg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,lg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,lg.BulkConfig):void 0})},[S,h,m,b]),H=i(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Add Sources",rightIcon:tl,onClick:n}});const s=[o?{id:lg.BulkDestination,label:nt.ADD_DESTINATION,icon:Ya}:null,i?{id:lg.BulkAction,label:nt.ADD_ACTION,icon:Fa}:null,a?{id:lg.BulkInstrumentationRule,label:nt.ADD_INSTRUMENTATION_RULE,icon:el}:null,l?{id:lg.BulkConfig,label:"Manage Configurations",icon:ul}:null];return s.some(Boolean)&&r.push({id:bo(),type:gn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Bulk Operations",onClick:e=>{e===lg.BulkSource?n?.():e===lg.BulkDestination?o?.():e===lg.BulkAction?i?.():e===lg.BulkInstrumentationRule?a?.():e===lg.BulkConfig&&l?.()}},dropDataProps:{alignX:fo.Left,items:s}}),r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>N(lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>N(lg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>N(lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>N(lg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>N(lg.BulkConfig):void 0}),[b]),j=i(()=>t(mo,{items:sg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[F]),G=i(()=>T.trim()&&S.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(T)}:{icon:Pl,title:nt.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(Vi,{children:e(ut,{fullHeight:!0,richTitle:{icon:Pl,title:nt.CONNECTIONS,badge:{label:S.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:pl,onClick:w,disabled:y}},{id:"connections-create-new",type:gn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:fo.Right,items:sg}}],children:[t(Mn,{variant:zn.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:dg,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${Or} - 24px)`:void 0,getRowActions:V}),I===lg.BulkConfig&&b.canApplyEffectiveConfig&&t(lr,{connectionIds:E,children:t(dp,{onClose:()=>N(null),connections:z,selectedConnectionIds:E,setSelectedConnectionIds:O})}),I===lg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(lr,{connectionIds:E,children:t(rr,{selectedConnectionIds:E,children:t(Tc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(lr,{connectionIds:E,children:t(sr,{children:t(rc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkAction&&b.canCreateAction&&t(lr,{connectionIds:E,children:t(cr,{children:t(qs,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),I===lg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(lr,{connectionIds:E,children:t(dr,{children:t(sc,{onClose:()=>N(null),selectedConnectionIds:E,setSelectedConnectionIds:O})})}),$&&t(pr,{providers:p,children:t(lp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(_r,{isOpen:R,onClose:()=>P(!1)}),t(Ar,{target:"connection",isOpen:I===lg.Delete,onClose:()=>{O([]),N(null)},onApprove:async()=>{const e=E[0];e&&(await s(e),await w())}}),t(Bn,{isOpen:!!E.length&&!I,richTitle:{icon:Xa,title:"Selected Clusters",badge:{label:E.length}},actions:H})]})})},gg=b.div`
|
|
990
|
+
`,ug=["50","25","10","1","0.1"],hg=({value:n,onChange:o,label:a})=>{const l=v(),r=i(()=>ug.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ae,{$gap:8,children:[t(ee,{size:te.XS,color:l.v2.colors.white[500],children:a}),t(pg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:n,setSelected:o})})]})},mg=({errorPresetEnabled:o,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=i(()=>D(o?{disabled:!1}:null),[o]);return e(n,{children:[t(Dm,{title:Ai,onBack:s}),e(Nm,{$width:854,children:[t(Vm,{children:Di}),e(ae,{$gap:8,$width:"100%",children:[e(_m,{children:[t(dg,{children:t(ee,{size:te.XXS,color:p.v2.colors.silver[200],children:Ri})}),t(Fm,{items:[_i,Pi,Li,Fi,Mi]}),t(zm,{message:Ti})]}),e(Bm,{children:[e(Xm,{children:[t(ee,{size:te.S,weight:500,color:p.v2.colors.white[500],children:zi}),t(fl,{size:16,fill:p.v2.colors.silver[200]})]}),t(Um,{children:t(Tm,{name:$i,recommended:!0,toggleLabel:Oi,enabled:o,onEnabledChange:a,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Um,{children:t(hg,{value:l,onChange:r,label:Bi})})]})]})]}),t($m,{onNext:c,nextLoading:d})]})},gg=({isOpen:e,onClose:n,k8sHealthProbesConfig:o,samplingId:i,docsUrl:r})=>{const{samplingApi:s}=Gl(),[c,p]=l("welcome"),[u,h]=l(!0),[m,g]=l("keep-list"),[f,b]=l(!0),[v,y]=l("25"),[C,S]=l(!1);a(()=>{e&&(p("welcome"),h(o?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,o?.enabled]);const x=d(async()=>{const e=i??"default",t=[];if(u!==(o?.enabled??!1)){const e=s.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:o?.keepPercentage??0}))}if("advanced"!==m&&f){const n=s.createHighlyRelevant;n&&t.push(n({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const n=s.createCostReduction;n&&t.push(n({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),p("success")}catch{}finally{S(!1)}},[i,s,u,o?.enabled,o?.keepPercentage,m,f,v]);let w=null;switch(c){case"welcome":w=t(Jm,{onSkip:n,onNext:()=>p("noisy")});break;case"noisy":w=t(jm,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(lg,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:r});break;case"keep-list":w=t(mg,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(cg,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(rg,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Wm,{onClose:n})}return t(vo,{isOpen:e,onClose:n,children:w})};var fg,bg;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"})(fg||(fg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector",e.AwsEcsAgent="aws-ecs-agent"})(bg||(bg={}));const vg=[{id:bg.CloudConnector,label:"Cloud Connector"}];var yg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(yg||(yg={}));const Cg=[{key:yg.Name,label:"Name"},{key:yg.Type,label:"Type"},{key:yg.Status,label:"Status"},{key:yg.OdigosVersion,label:"Odigos Version"},{key:yg.ConnectedSince,label:"Connected Since"},{key:yg.LastActivity,label:"Last Activity"}],Sg=(e,t)=>{const n=e.find(e=>e.key===yg.Id)?.rawValue;return t(n?.toString()||"")},xg={[Pe.Success]:"Connected",[Pe.Warning]:"Degraded",[Pe.Error]:"Error",[Pe.Disabled]:"Disabled",[Pe.Info]:"Pending"},wg={[Xi.K8s]:hn.Purple,[Xi.Vm]:hn.Blue,[Xi.Connector]:hn.Green,[Xi.AwsEcs]:hn.Yellow},Tg=({connections:n,getConnections:o,onClickConnection:r,deleteConnection:s,onCreateNew:c,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=an(),{capabilities:b}=Gl(),[y,C]=l(!n?.length),[S,x]=l(n||[]),w=d(async()=>{try{C(!0),x(await o()??[])}catch(e){}finally{C(!1)}},[]);a(()=>{S.length||w()},[]);const[T,k]=l(""),[I,E]=l(null),[N,O]=l([]),[$,A]=l(!1),[D,P]=l(!1),L=d(()=>{A(!1),P(!0),w()},[w]),F=d(e=>{e===bg.CloudConnector?A(!0):c?.(e)},[c]),M=i(()=>I===fg.BulkConfig?h:I===fg.BulkSource?m:0,[I,h,m]),{supportedConnections:z,supportedConnectionIds:B}=i(()=>{const e=((e,t)=>e.filter(e=>{const n=e.status===Pe.Success,o=R(e.odigosVersion,t,e.type);return n&&o}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);a(()=>{if(!I||I===fg.Delete)return;const e=N.filter(e=>!B.includes(e));e.length&&O(t=>t.filter(t=>!e.includes(t)))},[I,N.length,B.length]);const X=i(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:yg.Id,rawValue:e.id},{key:yg.Name,rawValue:e.name},{key:yg.Type,rawValue:e.type,component:()=>t(nn,{variant:wg[e.type]??hn.Default,label:Ui(e.type),leftIcon:Vn(e.type)})},{key:yg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Xi.Connector){const n=xg[e.status]??"Pending",o=e.status===Pe.Success?Za:e.status===Pe.Error?Qa:void 0;return t(ce,{status:e.status,label:n,leftIcon:o})}const n=e.status===Pe.Success?"Connection live":"Connection lost",o=e.status===Pe.Success?Za:Qa;return t(ce,{status:e.status,label:n,leftIcon:o})})(e)},{key:yg.OdigosVersion,rawValue:e.odigosVersion},{key:yg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:yg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Pe.Success||I?void 0:()=>r(e),isSelected:N.includes(e.id),onSelect:()=>O(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>O(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Pe.Success||I===fg.BulkConfig&&!R(e.odigosVersion,h,e.type)||I===fg.BulkSource&&!R(e.odigosVersion,m,e.type)})),[S,N,T,I,h,m,f,r]),U=i(()=>S.length>0&&S.every(e=>e.type===Xi.K8s),[S]),V=i(()=>{const e=(e,t)=>{O([e]),E(t)};return(e=>{const{connections:t,configMinSupportedVersion:n,snapshotMinSupportedVersion:o,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===yg.Status)?.rawValue===Pe.Success)(e))return[{id:bo(),label:"Delete Connection",rightIcon:Ha,onClick:()=>Sg(e,i)}];const d=Sg(e,e=>t.find(t=>t.id===e));if(d?.type!==Xi.K8s)return[];const p=!!d&&R(d.odigosVersion,n,d.type),u=!!d&&R(d.odigosVersion,o,d.type),h=_(n,d?.type),m=_(o,d?.type),g=[];return a&&g.push({id:bo(),tooltip:u?nt.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:tl,disabled:!u,onClick:()=>Sg(e,a)}),l&&g.push({id:bo(),tooltip:nt.ADD_DESTINATION,rightIcon:Ya,onClick:()=>Sg(e,l)}),r&&g.push({id:bo(),tooltip:nt.ADD_ACTION,rightIcon:Fa,onClick:()=>Sg(e,r)}),s&&g.push({id:bo(),tooltip:nt.ADD_INSTRUMENTATION_RULE,rightIcon:el,onClick:()=>Sg(e,s)}),c&&g.push({id:bo(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:ul,disabled:!p,onClick:()=>Sg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,fg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,fg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,fg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,fg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,fg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,fg.BulkConfig):void 0})},[S,h,m,b]),H=i(()=>(e=>{const{onCancel:t,onAddSource:n,onAddDestination:o,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];n&&r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Add Sources",rightIcon:tl,onClick:n}});const s=[o?{id:fg.BulkDestination,label:nt.ADD_DESTINATION,icon:Ya}:null,i?{id:fg.BulkAction,label:nt.ADD_ACTION,icon:Fa}:null,a?{id:fg.BulkInstrumentationRule,label:nt.ADD_INSTRUMENTATION_RULE,icon:el}:null,l?{id:fg.BulkConfig,label:"Manage Configurations",icon:ul}:null];return s.some(Boolean)&&r.push({id:bo(),type:gn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Bulk Operations",onClick:e=>{e===fg.BulkSource?n?.():e===fg.BulkDestination?o?.():e===fg.BulkAction?i?.():e===fg.BulkInstrumentationRule?a?.():e===fg.BulkConfig&&l?.()}},dropDataProps:{alignX:fo.Left,items:s}}),r.push({id:bo(),type:gn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>O([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>E(fg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>E(fg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>E(fg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>E(fg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>E(fg.BulkConfig):void 0}),[b]),j=i(()=>t(mo,{items:vg,withMultiSelect:!1,selectedIds:[],setSelectedIds:e=>F(e[0]),buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW}}),[F]),G=i(()=>T.trim()&&S.length>0?{hideIcon:!0,title:nt.NO_RESULTS,subTitle:nt.NO_RESULTS_FOR_FILTER(T)}:{icon:Pl,title:nt.NO_CONNECTIONS,action:j},[T,S.length,j]);return t(Vi,{children:e(ut,{fullHeight:!0,richTitle:{icon:Pl,title:nt.CONNECTIONS,badge:{label:S.length.toString(),status:Pe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,leftIcon:pl,onClick:w,disabled:y}},{id:"connections-create-new",type:gn.ButtonDropData,buttonProps:{variant:Ie.Primary,size:ke.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:fo.Right,items:vg}}],children:[t(Mn,{variant:zn.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:Cg,rows:X,noDataProps:G,rowActionsPushRightPosition:I?`calc(${Or} - 24px)`:void 0,getRowActions:V}),I===fg.BulkConfig&&b.canApplyEffectiveConfig&&t(lr,{connectionIds:N,children:t(Cp,{onClose:()=>E(null),connections:z,selectedConnectionIds:N,setSelectedConnectionIds:O})}),I===fg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(lr,{connectionIds:N,children:t(rr,{selectedConnectionIds:N,children:t(Tc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===fg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(lr,{connectionIds:N,children:t(sr,{children:t(rc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===fg.BulkAction&&b.canCreateAction&&t(lr,{connectionIds:N,children:t(cr,{children:t(qs,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),I===fg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(lr,{connectionIds:N,children:t(dr,{children:t(sc,{onClose:()=>E(null),selectedConnectionIds:N,setSelectedConnectionIds:O})})}),$&&t(pr,{providers:p,children:t(fp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(_r,{isOpen:D,onClose:()=>P(!1)}),t(Ar,{target:"connection",isOpen:I===fg.Delete,onClose:()=>{O([]),E(null)},onApprove:async()=>{const e=N[0];e&&(await s(e),await w())}}),t(Bn,{isOpen:!!N.length&&!I,richTitle:{icon:Xa,title:"Selected Clusters",badge:{label:N.length}},actions:H})]})})},kg=b.div`
|
|
977
991
|
display: flex;
|
|
978
992
|
align-items: center;
|
|
979
993
|
justify-content: space-between;
|
|
@@ -982,26 +996,26 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
982
996
|
width: 100%;
|
|
983
997
|
border-radius: 16px;
|
|
984
998
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
985
|
-
`,
|
|
999
|
+
`,Ig=b.div`
|
|
986
1000
|
display: flex;
|
|
987
1001
|
align-items: center;
|
|
988
1002
|
justify-content: center;
|
|
989
1003
|
padding: 8px;
|
|
990
1004
|
border-radius: 8px;
|
|
991
1005
|
background-color: ${({theme:e})=>e.v2.colors.white[500]+ie["004"]};
|
|
992
|
-
`,
|
|
1006
|
+
`,Eg=({setStep:n,onSave:o,sourcesPayload:a,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>n(2),d=()=>n(3),p=i(()=>Object.values(a||{}).flatMap((n,o)=>n.map((n,i)=>{if(!n.selected)return null;const a=n.kind||Et.Namespace,l=a===Et.Namespace?n.namespace:`${n.namespace} → ${n.name}`;return e(kg,{children:[t(ee,{nowrap:!0,children:l}),t(ce,{label:a,status:Pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${o}-${i}`)})).filter(Boolean),[a]),u=i(()=>l?.map((n,o)=>{const i=wt(n.option.type).icon;return e(kg,{children:[e(oe,{$gap:8,children:[i&&t(Ig,{children:t(i,{size:24})}),t(ee,{nowrap:!0,children:n.formData.name||n.option.displayName})]}),void 0!==n.testResult&&t(ce,{status:n.testResult.succeeded?Pe.Success:Pe.Error,leftIcon:n.testResult.succeeded?Za:Qa})]},`destination-${o}`)})||[],[l]);return t(Nr,{isOpen:!0,disableAnimation:r,onBack:()=>n(3),onSave:o,header:{icon:sl,title:nt.SUMMARY,subTitle:nt.REVIEW_SETUP},leftColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(tl,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_SOURCES}),t(ce,{label:p.length})]}),t(Te,{"data-id":"summary-edit-sources",leftIcon:ja,variant:Ie.Secondary,size:ke.S,onClick:c})]}),list:p.length?p:[t(ft,{$height:"100%",children:t($e,{icon:tl,title:nt.NO_SOURCES_SELECTED,subTitle:nt.ADD_SOURCE_PROMPT,button:{leftIcon:za,label:nt.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Ya,{size:24}),t(ee,{nowrap:!0,children:nt.SELECTED_DESTINATIONS}),t(ce,{label:u.length})]}),t(Te,{"data-id":"summary-edit-destinations",leftIcon:ja,variant:Ie.Secondary,size:ke.S,onClick:d})]}),list:u.length?u:[t(ft,{"data-id":"summary-no-destinations",$height:"100%",children:t($e,{icon:Ya,title:nt.NO_DESTINATIONS_SELECTED,subTitle:nt.ADD_DESTINATION_PROMPT,button:{leftIcon:za,label:nt.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Ng=b.div`
|
|
993
1007
|
position: relative;
|
|
994
1008
|
overflow: hidden;
|
|
995
1009
|
width: 100vw;
|
|
996
1010
|
height: 100vh;
|
|
997
1011
|
box-sizing: border-box;
|
|
998
|
-
`,
|
|
1012
|
+
`,Og=b.svg`
|
|
999
1013
|
position: absolute;
|
|
1000
1014
|
top: 50%;
|
|
1001
1015
|
left: 50%;
|
|
1002
1016
|
transform: translate(-50%, -50%);
|
|
1003
1017
|
z-index: -1;
|
|
1004
|
-
|
|
1018
|
+
`,$g=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],Ag=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:$g},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:$g},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:$g}],Dg=({paddingXAxis:n="0px",paddingYAxis:o="0px",children:r})=>{const[s,c]=l(window.innerWidth),d=i(()=>s/Ag[0].width,[s]);return a(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Ng,{$paddingXAxis:n,$paddingYAxis:o,children:[Ag.map(({width:n,height:o,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(Og,{width:n*d,height:"100%",viewBox:`0 0 ${n} ${o}`,fill:"none",children:[t("path",{opacity:i,d:a,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:n},o)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:n},o))})})]},c)}),r]})},Rg=b.div`
|
|
1005
1019
|
display: flex;
|
|
1006
1020
|
flex-direction: column;
|
|
1007
1021
|
align-items: center;
|
|
@@ -1012,7 +1026,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1012
1026
|
width: 50vw;
|
|
1013
1027
|
border-radius: 16px;
|
|
1014
1028
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1015
|
-
`,
|
|
1029
|
+
`,_g=b.div`
|
|
1016
1030
|
display: flex;
|
|
1017
1031
|
flex-direction: column;
|
|
1018
1032
|
align-items: center;
|
|
@@ -1022,15 +1036,15 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1022
1036
|
& * {
|
|
1023
1037
|
text-align: center;
|
|
1024
1038
|
}
|
|
1025
|
-
`,
|
|
1039
|
+
`,Pg=({onStart:n})=>t(zt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ft,{$height:"100%",children:e(Rg,{children:[e(_g,{children:[t(ee,{size:te.L,weight:500,children:nt.GET_STARTED_WITH}),t(Rr,{size:260}),t(ee,{size:te.S,weight:400,children:nt.GET_STARTED_DESCRIPTION})]}),t(Te,{"data-id":"onboarding-get-started",label:Ft.GET_STARTED,rightIcon:Ba,size:ke.L,onClick:n})]})})}),Lg=[{step:1,label:nt.INSTALLATION,forceDoneBadge:!0},{step:2,label:nt.SOURCES_SETUP},{step:3,label:nt.DESTINATIONS_SETUP},{step:4,label:nt.SUMMARY}],Fg=b.div`
|
|
1026
1040
|
display: flex;
|
|
1027
1041
|
flex-direction: column;
|
|
1028
1042
|
gap: 32px;
|
|
1029
1043
|
padding: 64px;
|
|
1030
|
-
`,
|
|
1044
|
+
`,Mg=({pagePaddingXAxis:n,pagePaddingYAxis:o,onDone:i})=>{const{setDrawerType:a}=vn(),{sourcesApi:r,destinationsApi:s}=Gl(),[c,d]=l(1),[p,u]=l(!1),[h,m]=l(null),[g,f]=l(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(Dg,{paddingXAxis:n,paddingYAxis:o,children:[e(Fg,{children:[t(Rr,{useInline:!0}),t(Hi,{currentStep:c,data:Lg,gap:32})]}),t(rr,{initialInputs:h,children:e(sr,{children:[1===c&&t(Pg,{onStart:b}),2===c&&t(Tc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(rc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Eg,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(r.persistV2(h)),g&&e.push(...g.map(e=>s.create(e.formData)));const t=await Promise.allSettled(e),n=[];for(const e of t)"rejected"===e.status?n.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&n.push(e.value.error);if(n.length)return{error:n.join("\n")};a(yo.OnboardingDone),i()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},zg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Bg=e=>e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),Xg=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Ug=b.div`
|
|
1031
1045
|
position: relative;
|
|
1032
1046
|
display: inline-flex;
|
|
1033
|
-
`,
|
|
1047
|
+
`,Vg=b.button`
|
|
1034
1048
|
display: inline-flex;
|
|
1035
1049
|
align-items: center;
|
|
1036
1050
|
gap: 8px;
|
|
@@ -1043,7 +1057,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1043
1057
|
&:hover {
|
|
1044
1058
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1045
1059
|
}
|
|
1046
|
-
`,
|
|
1060
|
+
`,Hg=b.div`
|
|
1047
1061
|
position: absolute;
|
|
1048
1062
|
top: calc(100% + 8px);
|
|
1049
1063
|
right: 0;
|
|
@@ -1056,25 +1070,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1056
1070
|
border-radius: 12px;
|
|
1057
1071
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1058
1072
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1059
|
-
`,
|
|
1073
|
+
`,jg=b.div`
|
|
1060
1074
|
display: flex;
|
|
1061
1075
|
flex-direction: column;
|
|
1062
1076
|
gap: 12px;
|
|
1063
1077
|
padding: 16px;
|
|
1064
1078
|
max-height: 60vh;
|
|
1065
1079
|
overflow-y: auto;
|
|
1066
|
-
`,
|
|
1080
|
+
`,Gg=b.div`
|
|
1067
1081
|
display: flex;
|
|
1068
1082
|
align-items: center;
|
|
1069
1083
|
gap: 8px;
|
|
1070
1084
|
padding: 12px 16px;
|
|
1071
1085
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1072
|
-
`,
|
|
1086
|
+
`,Wg=b.div`
|
|
1073
1087
|
display: flex;
|
|
1074
1088
|
align-items: center;
|
|
1075
1089
|
gap: 8px;
|
|
1076
1090
|
margin-left: auto;
|
|
1077
|
-
`,
|
|
1091
|
+
`,Kg=()=>{const n=v(),{platformType:o,isK8s:r,isConnector:s}=S(),{sourcesApi:c,namespacesApi:d}=Gl(),u=c.useSources().items,h=d.useNamespaces().items,{selectedStreamName:m}=ot(),{getItemSS:g,setItemSS:f,removeItemSS:b}=Ji(),{statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N,setAll:O,clearFilters:$,getEmptyState:A}=ji(),D=i(()=>Gi(u,m),[u,m]);a(()=>{const e=g(Wi.OVERVIEW_FILTERS,A());O(e)},[]);const[R,_]=l({statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N}),[P,L]=l(Xg(R)),[F,M]=l(!1),z=p(o);a(()=>{if(!F){const e={statuses:y,namespaces:C,regions:x,kinds:w,monitors:T,languages:k,onlyErrors:I,podsAgentInjectionStatus:E,enabledStatuses:N};_(e),L(Xg(e))}},[F,y,C,x,w,T,k,I,E,N]),a(()=>{z.current!==o&&(z.current=o,b(Wi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1))},[o]);const B=p(null);Nn(B,()=>M(!1)),uo({key:"Escape",active:F},()=>M(!1));const X=i(()=>{const e=new Set,t=[];return h.forEach(({name:n})=>{e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[h]),U=i(()=>{const e=new Set,t=[];return D.forEach(({id:n})=>{const{kind:o}=n;e.has(o)||(e.add(o),t.push({id:o,label:kn(o),withCheckbox:!0}))}),t},[D]),V=i(()=>{const e=new Set,t=[];return D.forEach(({id:n})=>{const o=n.region?.trim();o&&!e.has(o)&&(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t.sort((e,t)=>e.id.localeCompare(t.id))},[D]),H=i(()=>{const e=new Set,t=[];return D.forEach(({runtimeInfo:n})=>{n?.detectedLanguages?.forEach(n=>{e.has(n)||(e.add(n),t.push({id:n,label:Ki[n]||n,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[D]),j=i(()=>Yi.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),G=i(()=>{const e=new Set,t=[];return D.forEach(({instrumentationReport:n})=>{const o=n?.state||n?.progressStage;o&&!e.has(o)&&(e.add(o),t.push({id:o,label:Bg(o),withCheckbox:!0}))}),t.sort((e,t)=>e.label.localeCompare(t.label))},[D]),W=i(()=>{const e=new Set,t=[];return D.forEach(({podsAgentInjectionStatus:n})=>{const{reasonEnum:o,message:i}=n||{};if(o){if(e.has(o))return;e.add(o),t.push({id:o,label:Xt(o),withCheckbox:!0})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[D]),K=i(()=>[{id:"enabled",label:nt.ENABLED,withCheckbox:!0},{id:"disabled",label:nt.DISABLED,withCheckbox:!0}],[]),Y=(e,t,n)=>{const o=t.filter(e=>n.includes(e.id));_(t=>{return{...t,[e]:(n=o,n.map(({id:e,label:t})=>({id:e,label:t})))};var n})},J=F?Ja:qa,q=i(()=>zg(R.languages),[R.languages]);return e(Ug,{ref:B,children:[e(Vg,{"data-id":"filters-trigger",$isOpen:F,type:"button",onClick:()=>M(e=>!e),children:[t(Ll,{size:16,fill:n.v2.colors.white[500]}),t(ee,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),P>0&&t(ce,{label:P,status:Pe.Unknown,textSize:te.XXXS}),t(J,{size:16,fill:n.v2.colors.silver[200]})]}),F&&e(Hg,{children:[e(jg,{children:[r&&t(vt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!X.length,options:X,values:zg(R.namespaces),setValues:e=>Y("namespaces",X,e)}),s&&t(vt,{label:"Region",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!V.length,options:V,values:zg(R.regions),setValues:e=>Y("regions",V,e)}),t(vt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!U.length,options:U,values:zg(R.kinds),setValues:e=>Y("kinds",U,e)}),t(vt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!H.length,options:H,values:q,setValues:e=>Y("languages",H,e)}),t(vt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!j.length,options:j,values:zg(R.monitors),setValues:e=>Y("monitors",j,e)}),t(vt,r?{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!W.length,options:W,values:zg(R.podsAgentInjectionStatus),setValues:e=>Y("podsAgentInjectionStatus",W,e)}:{label:"Instrumentation Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!G.length,options:G,values:zg(R.statuses),setValues:e=>Y("statuses",G,e)}),t(vt,{label:"Enabled Status",placeholder:"All",withMultiSelect:!0,options:K,values:zg(R.enabledStatuses),setValues:e=>Y("enabledStatuses",K,e)}),t(ge,{label:"Show only sources with errors",size:Nt.L,value:!!R.onlyErrors,onChange:e=>_(t=>({...t,onlyErrors:e}))})]}),e(Gg,{children:[t(Te,{"data-id":"filters-reset",size:ke.S,variant:Ie.Text,label:"Reset",onClick:()=>{b(Wi.OVERVIEW_FILTERS),$(),_(A()),L(0),M(!1)},textColor:n.v2.colors.red[500]}),e(Wg,{children:[t(Te,{"data-id":"filters-cancel",size:ke.S,variant:Ie.Secondary,label:"Cancel",onClick:()=>M(!1)}),t(Te,{"data-id":"filters-apply",size:ke.S,variant:Ie.Primary,label:"Apply",onClick:()=>{f(Wi.OVERVIEW_FILTERS,R),O(R),L(Xg(R)),M(!1)}})]})]})]})]})},Yg=b.div`
|
|
1078
1092
|
position: relative;
|
|
1079
1093
|
display: flex;
|
|
1080
1094
|
align-items: center;
|
|
@@ -1085,7 +1099,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1085
1099
|
box-sizing: border-box;
|
|
1086
1100
|
border-radius: 16px 16px 0 0;
|
|
1087
1101
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1088
|
-
`,
|
|
1102
|
+
`,Jg=b.div`
|
|
1089
1103
|
position: absolute;
|
|
1090
1104
|
bottom: 0;
|
|
1091
1105
|
left: 0;
|
|
@@ -1094,7 +1108,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1094
1108
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
1095
1109
|
border-radius: 32px;
|
|
1096
1110
|
transition: width 0.3s;
|
|
1097
|
-
`,
|
|
1111
|
+
`,qg=({entityType:n,badge:o,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=vn();return e(Yg,{children:[e(oe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Q,{size:qi.S,partiallyChecked:r,value:!!s,onChange:c}),t(ee,{size:te.S,nowrap:!0,children:`${Xt(n)}s`}),t(ce,{label:o,tooltip:i,status:Pe.Unknown,textSize:te.XXXS})]}),e(oe,{children:[t(yt,{"data-id":`add-${n}`,icon:za,onClick:()=>p(Zi(n))}),t(yt,{"data-id":`refresh-${n}`,icon:pl,onClick:l,disabled:a})]}),"number"==typeof d&&t(Jg,{$percent:d})]})},Zg=b(ae)`
|
|
1098
1112
|
align-items: center !important;
|
|
1099
1113
|
justify-content: center !important;
|
|
1100
1114
|
align-self: stretch;
|
|
@@ -1109,7 +1123,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1109
1123
|
&:hover {
|
|
1110
1124
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
1111
1125
|
}
|
|
1112
|
-
`,
|
|
1126
|
+
`,Qg=({entityType:n,description:o})=>{const{setDrawerType:i}=vn();return e(Zg,{onClick:()=>i(Zi(n)),children:[e(oe,{$gap:4,children:[t(za,{size:16}),t(ee,{size:te.S,children:`Add ${Xt(n)}`})]}),t(ee,{size:te.XXS,align:"center",children:o})]})},ef=b.div`
|
|
1113
1127
|
display: flex;
|
|
1114
1128
|
align-items: center;
|
|
1115
1129
|
gap: 12px;
|
|
@@ -1124,10 +1138,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1124
1138
|
&:hover {
|
|
1125
1139
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1126
1140
|
}
|
|
1127
|
-
`,
|
|
1141
|
+
`,tf=b(oe)`
|
|
1128
1142
|
flex: 1;
|
|
1129
1143
|
min-width: 0;
|
|
1130
|
-
`,
|
|
1144
|
+
`,nf=({entityId:n,entityType:o,title:a,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=o===Et.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=vn(),{selectedSources:x,setSelectedSources:w}=Qi(),T=m,k=f?T.id.namespace:"",I=i(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),E=b&&!h?Pn(Pe.Info,g):l?Pn(l,g):void 0,N=f&&"object"==typeof n?`${n.namespace}-${n.name}-${n.kind}${n.region?`-${n.region}`:""}`:n;return e(ef,{"data-id":N,$faded:y,onClick:()=>{C(wn(o)),S(n)},children:[f&&t(Q,{size:qi.S,value:-1!==I,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===I?e[k].push(T):e[k].splice(I,1),w(e)}}),t(xn,{icons:p,icon:d,iconSrc:u}),e(tf,{$gap:4,children:[t(Ae,{size:te.XS,nowrap:!0,children:a}),t(oe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:(c||b&&!h)&&t(Ue,{text:s||(b&&!h?nt.DISABLED:"Heads up! The data-flow metrics you see are calculated over 10-second intervals."),children:t(ce,{label:c||nt.DISABLED,status:l&&[Pe.Error,Pe.Warning].includes(l)?l:Pe.Unknown,leftIcon:E,textSize:te.XXXS})})})]})]})};function of(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Pe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:sn.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function af(e){const t=Object.values(e.conditions??{}).filter(Boolean),n=t.filter(({status:e})=>e!==Pe.Loading);return n?.length===t?.length?e:{...e,conditions:n?.length?n.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const lf=b.div`
|
|
1131
1145
|
position: absolute;
|
|
1132
1146
|
top: 0;
|
|
1133
1147
|
left: 0;
|
|
@@ -1138,21 +1152,21 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1138
1152
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1139
1153
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1140
1154
|
pointer-events: none;
|
|
1141
|
-
`,
|
|
1155
|
+
`,rf=b.div`
|
|
1142
1156
|
display: flex;
|
|
1143
1157
|
align-items: center;
|
|
1144
1158
|
gap: 8px;
|
|
1145
1159
|
padding: 4px 8px 0;
|
|
1146
|
-
`,
|
|
1160
|
+
`,sf=b.div`
|
|
1147
1161
|
flex: 1;
|
|
1148
1162
|
height: 1px;
|
|
1149
1163
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1150
|
-
`,
|
|
1164
|
+
`,cf=({namespace:e})=>{const n=v();return t(lf,{children:t(ee,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:e})})},df=({namespace:n})=>{const o=v();return e(rf,{children:[t(sf,{}),t(ee,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:n}),t(sf,{})]})},pf={[Et.InstrumentationRule]:nt.NO_DATA_INSTRUMENTATION_RULES,[Et.Source]:nt.NO_DATA_SOURCES,[Et.Action]:nt.NO_DATA_ACTIONS,[Et.Destination]:nt.NO_DATA_DESTINATIONS},uf=b.div`
|
|
1151
1165
|
display: flex;
|
|
1152
1166
|
flex-direction: column;
|
|
1153
1167
|
flex: 1 0 0;
|
|
1154
1168
|
min-width: 0;
|
|
1155
|
-
`,
|
|
1169
|
+
`,hf=b.div`
|
|
1156
1170
|
display: flex;
|
|
1157
1171
|
flex-direction: column;
|
|
1158
1172
|
align-items: stretch;
|
|
@@ -1162,7 +1176,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1162
1176
|
border-radius: 0 0 16px 16px;
|
|
1163
1177
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1164
1178
|
overflow: hidden;
|
|
1165
|
-
`,
|
|
1179
|
+
`,mf=b.div`
|
|
1166
1180
|
position: relative;
|
|
1167
1181
|
display: flex;
|
|
1168
1182
|
flex-direction: column;
|
|
@@ -1174,7 +1188,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1174
1188
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1175
1189
|
height: ${({$height:e})=>e}px;
|
|
1176
1190
|
overflow: hidden;
|
|
1177
|
-
`,
|
|
1191
|
+
`,gf=({entityType:n,entities:o,unfilteredCount:r,metrics:s,loading:c,maxHeight:p,refetch:u})=>{const h=n===Et.Source,m=o.length!==r,g=$t(e=>h?e.progress[Rt.Instrumenting]?.percentage:void 0),f=$t(e=>h?e.progress[Rt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Qi(),C=i(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=i(()=>{if(!s)return;const e=new Map,t=n===Et.Source?s.sources:n===Et.Destination?s.destinations:void 0;if(t)for(const n of t)e.set(ea(n),n.throughput);return e},[s,n]),x=i(()=>o.map(e=>((e,t,n)=>{const o=jt(e);if(!o)return null;const i=t===Et.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status,n=!1===e.markedForInstrumentation?.markedForInstrumentation;switch(t){case sn.Failure:return{status:Pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case sn.Notice:return{status:Pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case sn.Pending:case sn.Waiting:return{status:void 0,faded:!1,displaySource:of(e)};case sn.Unsupported:case sn.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return n?{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e}:{status:void 0,faded:!1,displaySource:af(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const n=t===Et.Action?ta(e):e.conditions,{priorotizedStatus:o,hasDisableds:i}=na(n);a=o,r=i}const c=oa(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case Et.Source:{d=Sn(e),p=aa(Et.Source);const t=n?.get(ia(o));h=In(t);const i=e.markedForInstrumentation?.markedForInstrumentation;"boolean"==typeof i&&(m=i);break}case Et.Destination:{const t=wt(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=n?.get(ia(o));h=In(i),m=!e.disabled;break}case Et.Action:p=Yt(e.type),m=!e.disabled;break;case Et.InstrumentationRule:p=on(e.type),m=!e.disabled}return{key:ia(o),entityId:o,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:o,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:p,icons:d,iconSrc:u,isActive:m,raw:s}}})(e,n,S)).filter(Boolean),[o,n,S]),[w,T]=l(""),{elements:k,indexToNamespace:I,multipleNs:E,dividerCount:N}=i(()=>{const e=[],n=[],o=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;o&&(n.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const o of x)h&&o.namespace&&o.namespace!==a&&(""!==a&&(n.push(o.namespace),e.push(t(df,{namespace:o.namespace},`ns-divider-${o.namespace}`)),i+=1),a=o.namespace),n.push(o.namespace||""),e.push(t(nf,{...o.itemProps},o.key));return{elements:e,indexToNamespace:n,multipleNs:o,dividerCount:i}},[x,h]);a(()=>{if(h&&I.length&&!w){const e=I.find(Boolean);e&&T(e)}},[h,I]);const O=d(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==w&&T(t)},[I,w]),$=58*x.length+(E?28:0)+32*N,A=Math.max(0,p-52-16),D=Math.min(A,$)+8,R="number"==typeof b?`${b}%`:m?`${o.length}/${r}`:r;return e(uf,{children:[t(qg,{entityType:n,badge:R,badgeTooltip:m?nt.FILTERED_COUNT_TOOLTIP:void 0,isLoading:c,refetch:u,partiallySelected:C>0&&o?.length!==C,allSelected:C>0&&o?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};o?.forEach(t=>{const{namespace:n}=t.id;e[n]?e[n].push(t):e[n]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(hf,{children:o.length?e(mf,{$height:D,children:[E&&w&&t(cf,{namespace:w}),t(bn,{gap:4,elements:k,onTopIndexChange:E?O:void 0})]}):c?t(re,{size:3}):t(Qg,{entityType:n,description:pf[n]??nt.TO_COLLECT_OTEL_DATA})})]})},ff=b.div`
|
|
1178
1192
|
width: 100%;
|
|
1179
1193
|
flex: 1;
|
|
1180
1194
|
min-height: 0;
|
|
@@ -1182,10 +1196,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1182
1196
|
display: flex;
|
|
1183
1197
|
align-items: stretch;
|
|
1184
1198
|
gap: 16px;
|
|
1185
|
-
`,
|
|
1199
|
+
`,bf={sources:[],destinations:[]},vf=()=>{const n=ji(),{selectedStreamName:o}=ot(),{containerRef:a,containerHeight:l}=la(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=Gl(),{items:u,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=vn(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??bf,w=i(()=>Gi(u,o),[u,o]),T=i(()=>Qt(m,o),[m,o]),k=i(()=>ra(w,n),[w,n]),I=i(()=>sa(T,n),[T,n]),E=i(()=>ca(f,n),[f,n]);return e(ff,{ref:a,children:[t(gf,{entityType:Et.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(gf,{entityType:Et.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(gf,{entityType:Et.Action,entities:E,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(gf,{entityType:Et.Destination,entities:I,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},yf="40vw",Cf=b.div`
|
|
1186
1200
|
position: relative;
|
|
1187
|
-
width: ${
|
|
1188
|
-
`,
|
|
1201
|
+
width: ${yf};
|
|
1202
|
+
`,Sf=b.div`
|
|
1189
1203
|
position: absolute;
|
|
1190
1204
|
top: calc(100% + 8px);
|
|
1191
1205
|
left: 0;
|
|
@@ -1194,23 +1208,23 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1194
1208
|
flex-direction: column;
|
|
1195
1209
|
gap: 8px;
|
|
1196
1210
|
padding: 8px;
|
|
1197
|
-
width: calc(${
|
|
1211
|
+
width: calc(${yf} - 16px);
|
|
1198
1212
|
border-radius: 12px;
|
|
1199
1213
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1200
1214
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
1201
|
-
`,
|
|
1215
|
+
`,xf=b.div`
|
|
1202
1216
|
display: flex;
|
|
1203
1217
|
align-items: center;
|
|
1204
1218
|
overflow-x: auto;
|
|
1205
|
-
`,
|
|
1219
|
+
`,wf=b.div`
|
|
1206
1220
|
display: flex;
|
|
1207
1221
|
flex-direction: column;
|
|
1208
1222
|
gap: 0;
|
|
1209
1223
|
max-height: 60vh;
|
|
1210
1224
|
overflow-y: auto;
|
|
1211
|
-
`,
|
|
1225
|
+
`,Tf=b.div`
|
|
1212
1226
|
padding: 8px 12px 4px 12px;
|
|
1213
|
-
`,
|
|
1227
|
+
`,kf=b.div`
|
|
1214
1228
|
display: flex;
|
|
1215
1229
|
align-items: center;
|
|
1216
1230
|
gap: 8px;
|
|
@@ -1220,12 +1234,12 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1220
1234
|
&:hover {
|
|
1221
1235
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1222
1236
|
}
|
|
1223
|
-
`,
|
|
1237
|
+
`,If=b.div`
|
|
1224
1238
|
padding: 16px 8px;
|
|
1225
|
-
`,
|
|
1239
|
+
`,Ef=({preventPopup:n=!1})=>{const o=v(),{selectedStreamName:a}=ot(),{searchText:s,setSearchText:c}=ji(),{setDrawerType:d,setDrawerEntityId:u}=vn(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Gl(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=p(null),[w,T]=l(!1),[k,I]=l("all"),E=!n&&(!!s||w),N=()=>{c(""),T(!1),I("all")};Nn(x,()=>N()),uo({key:"Escape",active:E},N);const{categories:O,searchResults:$}=i(()=>(({instrumentationRules:e,sources:t,actions:n,destinations:o,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?n.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,c=i?o.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,d=[{category:Et.Source,label:"Sources",count:r.length,entities:[]},{category:Et.Action,label:"Actions",count:s.length,entities:[]},{category:Et.Destination,label:"Destinations",count:c.length,entities:[]},{category:Et.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const p=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Et.InstrumentationRule?l:e.category===Et.Source?r:e.category===Et.Action?s:e.category===Et.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:Gi(b,a),actions:C,destinations:Qt(y,a),searchText:s,selectedCategory:k}),[S,b,C,y,a,s,k]),A=i(()=>O.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:n})=>({value:e,label:n?`${t} (${n})`:t})),[O]),D=$.some(({entities:e})=>e.length>0);return e(Cf,{ref:x,children:[t(fn,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>T(!0),width:yf}),E&&e(Sf,{children:[A.length>1&&t(xf,{children:t(ve,{options:A,selected:k,setSelected:I})}),D?t(wf,{children:$.map(({category:n,label:i,entities:a},l)=>{if(!a.length)return null;const s=aa(n);return e(r,{children:[t(Tf,{children:t(ee,{size:te.XXS,color:ne.Secondary,children:i})}),a.map((i,a)=>e(kf,{onClick:()=>{const e=jt(i);e&&(d(wn(n)),u(e),N())},children:[s&&t(s,{size:16,fill:o.v2.colors.white[500]}),t(ee,{size:te.XS,nowrap:!0,children:oa(i,n,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${n}`)})}):t(If,{children:t($e,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},Nf=({onRedirectToSampling:o})=>{const{sourcesApi:a}=Gl(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=vn(),p=()=>{c(null),d(null)},u=i(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=i(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(n,{children:[t(Sm,{}),r===yo.AddSource&&t(rr,{children:t(Tc,{onClose:p,withOverlay:!0})}),r===yo.AddDestination&&t(sr,{children:t(rc,{onClose:p,withOverlay:!0})}),r===yo.AddInstrumentationRule&&t(dr,{sourceOptions:u,namespaceOptions:h,children:t(sc,{onClose:p,withOverlay:!0})}),r===yo.AddAction&&t(cr,{sourceOptions:u,namespaceOptions:h,children:t(qs,{onClose:p,withOverlay:!0})}),r===yo.EditSource&&t(ur,{children:t(Yh,{onClose:p,sourceId:s,onRedirectToSampling:o})}),r===yo.EditDestination&&t(sr,{children:t(xp,{onClose:p,destinationId:s})}),r===yo.EditInstrumentationRule&&t(dr,{sourceOptions:u,namespaceOptions:h,children:t(Tp,{onClose:p,ruleId:s})}),r===yo.EditAction&&t(cr,{sourceOptions:u,namespaceOptions:h,children:t(yp,{onClose:p,actionId:s})})]})},Of=b.div`
|
|
1226
1240
|
position: relative;
|
|
1227
1241
|
display: inline-flex;
|
|
1228
|
-
|
|
1242
|
+
`,$f=b.div`
|
|
1229
1243
|
display: inline-flex;
|
|
1230
1244
|
align-items: center;
|
|
1231
1245
|
gap: 6px;
|
|
@@ -1236,7 +1250,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1236
1250
|
&:hover {
|
|
1237
1251
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1238
1252
|
}
|
|
1239
|
-
`,
|
|
1253
|
+
`,Af=b.div`
|
|
1240
1254
|
position: absolute;
|
|
1241
1255
|
top: calc(100% + 8px);
|
|
1242
1256
|
left: 0;
|
|
@@ -1250,18 +1264,18 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1250
1264
|
border-radius: 12px;
|
|
1251
1265
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1252
1266
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
1253
|
-
`,
|
|
1267
|
+
`,Df=b.div`
|
|
1254
1268
|
display: flex;
|
|
1255
1269
|
align-items: center;
|
|
1256
1270
|
gap: 8px;
|
|
1257
1271
|
width: 100%;
|
|
1258
|
-
`,
|
|
1272
|
+
`,Rf=b.div`
|
|
1259
1273
|
display: flex;
|
|
1260
1274
|
flex-direction: column;
|
|
1261
1275
|
gap: 0;
|
|
1262
1276
|
max-height: 240px;
|
|
1263
1277
|
overflow-y: auto;
|
|
1264
|
-
`,
|
|
1278
|
+
`,_f=b.div`
|
|
1265
1279
|
display: flex;
|
|
1266
1280
|
align-items: center;
|
|
1267
1281
|
gap: 8px;
|
|
@@ -1272,29 +1286,41 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1272
1286
|
&:hover {
|
|
1273
1287
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
1274
1288
|
}
|
|
1275
|
-
`,
|
|
1289
|
+
`,Pf=b.div`
|
|
1276
1290
|
flex: 1;
|
|
1277
1291
|
min-width: 0;
|
|
1278
1292
|
overflow: hidden;
|
|
1279
1293
|
text-overflow: ellipsis;
|
|
1280
1294
|
white-space: nowrap;
|
|
1281
|
-
`,
|
|
1295
|
+
`,Lf=b.div`
|
|
1282
1296
|
display: flex;
|
|
1283
1297
|
align-items: center;
|
|
1284
1298
|
gap: 2px;
|
|
1285
1299
|
flex-shrink: 0;
|
|
1286
|
-
`,
|
|
1300
|
+
`,Ff=b.div`
|
|
1287
1301
|
display: flex;
|
|
1288
1302
|
padding-top: 4px;
|
|
1289
1303
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
1290
|
-
`,
|
|
1304
|
+
`,Mf=()=>{const o=v(),{isK8s:r}=S(),{clearStore:s}=da(),{dataStreamsApi:c}=Gl();c.useDataStreams();const{dataStreams:d,selectedStreamName:u,setSelectedStreamName:h}=ot(),m=p(null),[g,f]=l(!1),[b,y]=l(""),[C,x]=l(""),[w,T]=l(!1),[k,I]=l(!1),[E,N]=l(!1),[O,$]=l(""),[A,D]=l(!1);Nn(m,()=>f(!1)),a(()=>{g||y("")},[g]);const R=i(()=>{if(!b)return d;const e=b.toLowerCase();return d.filter(({name:t})=>t.toLowerCase().includes(e))},[d,b]),_=g?Ja:qa;return r?e(n,{children:[e(Of,{ref:m,children:[e($f,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Fl,{size:24}),t(ee,{size:te.S,weight:500,nowrap:!0,children:(P=u,`Data Stream: ${P}`)}),t(ce,{label:d.length,status:Pe.Unknown,textSize:te.XXXS}),t(_,{size:20,fill:o.v2.colors.silver[200]})]}),g&&e(Af,{children:[t(Df,{children:t(fn,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(Rf,{children:0===R.length?t(_f,{children:t(ee,{size:te.XS,color:ne.Secondary,children:"No streams match"})}):R.map(({name:n})=>{const o=n===pa;return e(_f,{"data-id":`stream-row-${n}`,$selected:n===u,onClick:()=>(e=>{e!==u&&(s(),h(e)),f(!1)})(n),children:[t(Pf,{children:t(ee,{size:te.XS,nowrap:!0,children:n})}),e(Lf,{children:[t(yt,{"data-id":`stream-edit-${n}`,icon:ja,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),x(n),T(!0)}}),!o&&t(yt,{"data-id":`stream-delete-${n}`,icon:Ma,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),$(n),D(!0)}})]})]},`stream-${n}`)})}),t(Ff,{children:t(Te,{"data-id":"add-stream-trigger",variant:Ie.Secondary,size:ke.S,leftIcon:za,label:`${Ft.NEW} ${nt.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),s(),N(!0),I(!0)}})})]})]}),E&&t(hr,{defaultExcludeName:u,children:t(bm,{isOpen:k,onClose:()=>I(!1),onCloseEnd:()=>N(!1)})}),C&&t(hr,{children:t(vm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Ar,{target:`${nt.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:A,onClose:()=>D(!1),onApprove:async()=>{O&&await c.remove(O)}})]}):null;var P},zf=b(ae)`
|
|
1305
|
+
width: 100%;
|
|
1306
|
+
max-height: 320px;
|
|
1307
|
+
overflow-y: auto;
|
|
1308
|
+
gap: 8px;
|
|
1309
|
+
`,Bf=b(oe)`
|
|
1310
|
+
width: 100%;
|
|
1311
|
+
align-items: center;
|
|
1312
|
+
gap: 8px;
|
|
1313
|
+
padding: 8px 12px;
|
|
1314
|
+
border-radius: 8px;
|
|
1315
|
+
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1316
|
+
`,Xf=()=>{const o=v(),{selectedStreamName:r}=ot(),{selectedSources:s,setSelectedSources:c}=Qi(),{sourcesApi:p}=Gl(),[u,h]=l(!1),[m,g]=l(!1),[f,b]=l(!1),[y,C]=l(!1),{toInstrument:S,toUninstrument:x,totalSelected:w}=i(()=>{const e=[],t=[];return Object.values(s).forEach(n=>{n.forEach(n=>{(e=>!1===e.markedForInstrumentation?.markedForInstrumentation)(n)?e.push(n):t.push(n)})}),{toInstrument:e,toUninstrument:t,totalSelected:e.length+t.length}},[s]),T=d(()=>{c({})},[c]),k=d(()=>h(!1),[]),I=d(()=>g(!1),[]),E=d(()=>b(!1),[]),N=d(()=>C(!1),[]);a(()=>{T()},[r,T]);const O=d((e,t)=>{if(!e.length)return;const n=new Map;e.forEach(e=>{const t=e.id.namespace,o=n.get(t)??[];o.push(e),n.set(t,o)}),p.persistV2(Object.fromEntries([...n.entries()].map(([e,n])=>[e,n.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]),$=d(()=>{p.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==Tn.StaticPod).map(yn)),T()},[p,s,T]),A=d(()=>{O(S,!0),T()},[O,S,T]),D=d(()=>{O(x,!1),T()},[O,x,T]),R=d(()=>{O(S,!0),O(x,!1),T()},[O,S,x,T]),_=S.length>0,P=x.length>0,L=_&&P,F=i(()=>{const e=[{id:"multi-source-deselect",type:gn.Button,buttonProps:{variant:Ie.Text,size:ke.S,label:"Deselect",onClick:T}},{id:"multi-source-restart",type:gn.Button,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"Restart",leftIcon:Sl,onClick:()=>h(!0)}}];return L?e.push({id:"multi-source-apply",type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Apply Changes",leftIcon:za,onClick:()=>C(!0)}}):_?e.push({id:"multi-source-instrument",type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Instrument",leftIcon:za,onClick:()=>b(!0)}}):P&&e.push({id:"multi-source-uninstrument",type:gn.Button,buttonProps:{variant:Ie.Primary,size:ke.S,label:"Uninstrument",leftIcon:Ma,onClick:()=>g(!0)}}),e},[T,L,_,P]),M=e=>oa(e,Et.Source,{extended:!0})||e.id.name;return e(n,{children:[t(Bn,{isOpen:w>0,richTitle:{icon:tl,title:"Selected sources",badge:{label:w}},actions:F}),t(tt,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:k,denyButton:{label:"Go Back",variant:Ie.Secondary,onClick:k},approveButton:{label:"Confirm",variant:Ie.Primary,onClick:()=>{$(),k()}}}),t(Ar,{isOpen:f,action:"instrument",target:`${S.length} source${1===S.length?"":"s"}`,onClose:E,onDeny:E,onApprove:A}),t(Ar,{isOpen:m,action:"uninstrument",target:`${x.length} source${1===x.length?"":"s"}`,onClose:I,onDeny:I,onApprove:D}),t(tt,{isOpen:y,title:"Modify selected sources",description:"These changes are applied immediately. Disabled sources are re-instrumented; enabled sources are uninstrumented.",onClose:N,denyButton:{variant:Ie.Secondary,label:"Cancel",onClick:N},approveButton:{variant:Ie.Primary,label:"Confirm",onClick:()=>{R(),N()}},children:e(zf,{children:[S.map(n=>e(Bf,{children:[t(ce,{leftIcon:za,status:Pe.Success,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`instrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`)),x.map(n=>e(Bf,{children:[t(ce,{leftIcon:xl,status:Pe.Error,useSecondaryTone:!0,textColor:o.v2.colors.white[500],textSize:te.XXS}),t(ee,{size:te.XS,color:ne.Primary,children:M(n)})]},`uninstrument-${n.id.namespace}-${n.id.kind}-${n.id.name}-${n.id.region??""}`))]})})]})},Uf=C`
|
|
1291
1317
|
0% {
|
|
1292
1318
|
background-position: 200% 50%;
|
|
1293
1319
|
}
|
|
1294
1320
|
100% {
|
|
1295
1321
|
background-position: 0% 50%;
|
|
1296
1322
|
}
|
|
1297
|
-
`,
|
|
1323
|
+
`,Vf=b.div`
|
|
1298
1324
|
display: flex;
|
|
1299
1325
|
align-items: center;
|
|
1300
1326
|
justify-content: space-evenly;
|
|
@@ -1305,43 +1331,43 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1305
1331
|
|
|
1306
1332
|
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%)`};
|
|
1307
1333
|
background-size: 200% 100%;
|
|
1308
|
-
animation: ${
|
|
1309
|
-
`,
|
|
1334
|
+
animation: ${Uf} 15s linear infinite;
|
|
1335
|
+
`,Hf=[el,tl,Fa,Ya],jf=({onRedirectToSampling:n})=>{const o=v();return e(Vi,{children:[e(ut,{fullHeight:!0,customTitle:t(Mf,{}),customSearch:t(Ef,{}),filters:t(Kg,{}),children:[t(Vf,{children:Hf.map((n,i)=>e(r,{children:[t(n,{size:24}),i<Hf.length-1&&t(La,{fill:o.v2.colors.white[500]+ie["020"],size:24})]},n.name))}),t(vf,{})]}),t(Nf,{onRedirectToSampling:n}),t(Xf,{})]})};var Gf;(e=>{e.Gateway="gateway",e.Node="node"})(Gf||(Gf={}));const Wf=({onClickDownloadDiagnose:n,onClickRefresh:o,loading:a,disabled:l})=>{const r=i(()=>{const e=[];return n&&e.push({id:bo(),type:gn.Button,buttonProps:{label:"Download Diagnose",leftIcon:Nl,size:ke.S,variant:Ie.Text,onClick:n,disabled:l}}),o&&e.push({id:bo(),type:gn.Button,buttonProps:{label:"Refresh",leftIcon:pl,size:ke.S,variant:Ie.Text,onClick:o,disabled:l,loading:a}}),e},[n,o,l,a]);return e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(ua,{icon:Ml,title:"Collectors Pipeline"}),t(ha,{actions:r})]})},Kf=({pod:n,onClose:o})=>{const{formatTimeAgo:a}=an(),{collectorsApi:l}=Gl(),{data:r}=l.usePodInfo(n?{namespace:n.namespace,name:n.name}:void 0,{skip:!n}),s=i(()=>[{id:bo(),title:"Node",label:r?.node??"-",withCopy:!0},{id:bo(),title:"Status",badge:{status:ma(r?.status),label:r?.status??"-"}}],[r]),c=i(()=>r?.containers?.map(e=>({id:bo(),items:[{id:bo(),title:"Container",label:e.name??"-"},{id:bo(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:bo(),title:"Ready",badge:{status:e.ready?Pe.Success:Pe.Error,leftIcon:e.ready?Xa:Ua,label:e.ready?"True":"False",invertColors:!0}},{id:bo(),title:"Started",badge:{status:e.started?Pe.Success:Pe.Error,leftIcon:e.started?Xa:Ua,label:e.started?"True":"False",invertColors:!0}},{id:bo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:bo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:bo(),title:nt.RESTARTS,label:e.restarts.toString()},{id:bo(),title:"State Reason",label:e.stateReason??"-"},{id:bo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:bo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(zt,{isOpen:!!n,header:{icon:hl,title:"Pod Information",onClose:o},children:r?e(Wt,{bgTint:"1000",richTitle:{icon:hl,title:r.name,withCopy:!0},children:[t(Wt,{bgTint:"900",cellsPerRow:2,items:s}),e(Wt,{bgTint:"900",richTitle:{icon:Cl,title:nt.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(mn,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(mn,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(mn,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Wt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:n})=>t(Wt,{bgTint:"800",cellsPerRow:2,items:n},e)):t($e,{title:"No containers",subTitle:"Pod has no containers"})}),t(Dr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})})})};var Yf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Yf||(Yf={}));const Jf=e=>{const t=[{key:Yf.PodName,label:"Pod Name"},{key:Yf.Status,label:"Status"},{key:Yf.Restarts,label:nt.RESTARTS},{key:Yf.NodeName,label:"Node Name"},{key:Yf.Age,label:"Age"},{key:Yf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Yf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},qf=({isLoading:n,pods:o,withSpanDropRate:a})=>{const r=v(),{formatTimeAgo:s}=an(),[c,d]=l(null),p=i(()=>o.map(n=>({onClick:()=>d(n),cells:[{key:Yf.PodName,rawValue:n.name},{key:Yf.Status,rawValue:n.status,component:()=>{return e=n.status,t(ce,{status:ma(e),label:e});var e}},{key:Yf.Restarts,rawValue:n.restartsCount.toString()},{key:Yf.NodeName,rawValue:n.nodeName},{key:Yf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:o}=n;if(!o)return t(ee,{children:"-"});const i=(o?.metricsAcceptedRps??0)+(o?.metricsDroppedRps??0),a=i>0?Math.round((o?.metricsDroppedRps??0)/i*100):0,l=a>0?Pe.Error:Pe.Success,r=(o?.exporterSuccessRps??0)+(o?.exporterFailedRps??0),s=r>0?Math.round((o?.exporterFailedRps??0)/r*100):0,c=s>0?Pe.Error:Pe.Success;return e(oe,{$gap:4,children:[t(Ue,{text:`Accepted: ${o.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${o.metricsDroppedRps.toLocaleString()} spans/s`,children:t(ce,{status:l,label:`Receiver ${a}%`,leftIcon:l===Pe.Error?zl:Bl,useSecondaryTone:!0,invertColors:!0})}),t(Ue,{text:`Success: ${o.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${o.exporterFailedRps.toLocaleString()} spans/s`,children:t(ce,{status:c,label:`Exporter ${s}%`,leftIcon:c===Pe.Error?zl:Bl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Yf.Age,rawValue:s(n.creationTimestamp)},{key:Yf.DockerImage,rawValue:n.image}]})),[o,r]);return e(Wt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:hl,title:"Pods"},children:[t(Mn,{variant:zn.Data,isLoading:n,columns:Jf(a),rows:p}),t(Kf,{pod:c,onClose:()=>d(null)})]})},Zf=({isOpen:e,onClose:n,title:o,yaml:i})=>t(zt,{isOpen:e,header:{icon:Xl,title:o,onClose:n},children:t(Dr,{yaml:i,defaultOpen:!0})}),Qf=e=>{switch(e){case ga.Healthy:return"All desired replicas are updated, available, and ready";case ga.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ga.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ga.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ga.Down:return"No available replicas";case ga.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var eb;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(eb||(eb={}));const tb=b.div`
|
|
1310
1336
|
flex: 0.5;
|
|
1311
1337
|
padding: 12px;
|
|
1312
1338
|
border-radius: 12px;
|
|
1313
1339
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
1314
|
-
`,
|
|
1340
|
+
`,nb=({selectedTab:n,gatewayInfo:o,nodeCollectorInfo:a,isLoading:r})=>{const{formatTimeAgo:s}=an(),[c,d]=l(null),p=i(()=>(e=>{switch(e){case Gf.Gateway:return"Deployment";case Gf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(n),[n]),u=i(()=>((e,t,n,o)=>{const i={status:Pe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Gf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Gf.Node:a=n?.rolloutInProgress??!1,l=n?.lastRolloutAt??null;break;default:return i}return a?{status:Pe.Info,label:"Rollout in progress",rightIcon:pl,useSecondaryTone:!0}:l?{status:Pe.Disabled,label:`Last Rollout: ${o(l)}`}:i})(n,o,a,s),[o,a,n,s]),h=i(()=>((e,t,n,o)=>{let i=o?Pe.Info:Pe.Unknown,a=o?"Loading":ga.Unknown,l=o?"Fetching data...":Qf(ga.Unknown);switch(e){case Gf.Gateway:i=t?.status?ma(t?.status):i,a=t?.status??a,l=t?.status?Qf(t.status):l;break;case Gf.Node:i=n?.status?ma(n?.status):i,a=n?.status??a,l=n?.status?Qf(n.status):l}return{status:i,title:a,description:l}})(n,o,a,r),[o,a,n,r]),m=i(()=>((e,t,n)=>{switch(e){case Gf.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 Gf.Node:return[{gaugeWidth:128,min:0,max:n?.nodes?.desired??0,current:n?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(n,o,a),[o,a,n]),g=i(()=>((e,t,n,o)=>{switch(e){case Gf.Gateway:return[{title:"Data throughput",cells:[{label:"Traces data",value:In(t?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:In(t?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:In(t?.throughputLogsBytesPerSec??0),isLoading:o}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:o}]}];case Gf.Node:return[{title:"Data Throughput",cells:[{label:"Traces data",value:In(n?.throughputTracesBytesPerSec??0),isLoading:o},{label:"Metrics data",value:In(n?.throughputMetricsBytesPerSec??0),isLoading:o},{label:"Logs data",value:In(n?.throughputLogsBytesPerSec??0),isLoading:o}]},{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${n?.resources?.requests.cpu}/${n?.resources?.limits.cpu}`,isLoading:o},{label:"Memory",value:`${n?.resources?.requests.memory}/${n?.resources?.limits.memory}`,isLoading:o}]}];default:return[]}})(n,o,a,r),[o,a,n,r]),f=i(()=>(n===Gf.Gateway?o?.manifestYAML:a?.manifestYAML)??"",[o,a,n]),b=i(()=>(n===Gf.Gateway?o?.configMapYAML:a?.configMapYAML)??"",[o,a,n]);return e(Wt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Xl,title:p,badge:u},actions:[{id:bo(),type:gn.ButtonDropData,buttonProps:{variant:Ie.Secondary,size:ke.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:eb.ManifestYaml,label:p,icon:Ul},{id:eb.ConfigMapYaml,label:"ConfigMap",icon:Ul}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(fa,{...h})}),m.map(e=>t(tb,{children:t("div",{children:t(ba,{...e})})},e.title)),g.map(e=>t(va,{...e},e.title))]}),t(Zf,{isOpen:c===eb.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Zf,{isOpen:c===eb.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},ob=[{value:Gf.Gateway,label:"Gateway"},{value:Gf.Node,label:"Node Collector"}],ib=({minSupportedVersion:n})=>{const{isVersionSupported:o,version:a,minSupportedVersion:r}=S(n),[s,c]=l(Gf.Gateway),p=s===Gf.Gateway,u=s===Gf.Node,{collectorsApi:h,configApi:m}=Gl(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!p}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!u}),{data:I=[],loading:E,refetch:N}=h.useNodeCollectorPods({skip:!u}),O=p&&(b||C)||u&&(T||E),$=d(()=>{p?(v(),x()):u&&(k(),N())},[p,u,v,x,k,N]),A=i(()=>p?y:I,[y,I,p]);return e(Vi,{children:[t(Wf,{disabled:!o,loading:O,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e(ya,{children:[e(ae,{children:[t(ve,{variant:Fn.Underline,size:De.L,options:ob,selected:s,setSelected:c}),t(nb,{selectedTab:s,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:O})]}),t(qf,{isLoading:O,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!o&&t(Pr,{minSupportedVersion:r,currentVersion:a||""})]})]})},ab=b.div`
|
|
1315
1341
|
display: inline-flex;
|
|
1316
1342
|
align-items: center;
|
|
1317
1343
|
min-width: 0;
|
|
1318
1344
|
overflow: hidden;
|
|
1319
1345
|
white-space: pre;
|
|
1320
1346
|
text-overflow: ellipsis;
|
|
1321
|
-
`,
|
|
1347
|
+
`,lb=b.div`
|
|
1322
1348
|
display: flex;
|
|
1323
1349
|
flex-direction: column;
|
|
1324
1350
|
gap: 4px;
|
|
1325
1351
|
min-width: 0;
|
|
1326
1352
|
flex: 1;
|
|
1327
1353
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
1328
|
-
`,
|
|
1354
|
+
`,rb=b(oe)`
|
|
1329
1355
|
flex-shrink: 0;
|
|
1330
1356
|
gap: 6px;
|
|
1331
1357
|
align-items: center;
|
|
1332
1358
|
min-height: 22px;
|
|
1333
|
-
`,
|
|
1359
|
+
`,sb=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],cb=[{value:"all",label:Ca},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],db=({title:n,items:o,isLoading:a,showTypeFilter:r,onRuleClick:s,onCreateRule:c,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=l(""),[f,b]=l("all"),y=i(()=>{let e=((e,t,n)=>n&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(o,f,r);return e=((e,t)=>{if(!t.trim())return e;const n=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(n),o=e.summary.map(e=>e.text).join("").toLowerCase();return t||o.includes(n)})})(e,m),e},[o,f,r,m]),C=i(()=>y.map(n=>{const o=n.typeBadge?((e,t)=>{const n=e.v2.colors;switch(t){case"Relevance":return{bg:n.blue[700],text:n.white[500]};case"Duration":return{bg:n.purple[700],text:n.white[500]};case"Error":return{bg:n.red[500],text:n.black[500]}}})(h,n.typeBadge):void 0;return{cells:[{key:"content",rawValue:n.summary.map(e=>e.text).join(""),component:()=>e(lb,{$disabled:n.disabled,children:[t(ab,{children:t(w,{parts:n.summary})}),n.name&&t(ee,{size:te.XXS,color:ne.Secondary,nowrap:!0,children:n.name})]})},{key:"badges",rawValue:n.typeBadge||"",component:()=>e(rb,{children:[n.disabled&&t(ce,{label:Xn,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),n.typeBadge&&o&&t(ce,{label:n.typeBadge,textSize:te.XXXS,backgroundColor:o.bg,textColor:o.text})]})}],onClick:()=>s(n)}}),[y,h,s]),S=i(()=>{const e=e=>t(Ha,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=d(e=>{const t=C.indexOf(e);if(t<0)return[];const n=y[t];return n?[{id:"edit","data-id":"sampling-rule-action-edit",label:Wn,leftIcon:ja,onClick:()=>p(n.ruleId,n.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>u(n.ruleId,n.samplingId)}]:[]},[C,y,p,u,S]);return t(ut,{fullHeight:!0,richTitle:{icon:Ol,title:n,badge:{label:o.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...r?{segment:{"data-id":"sampling-segment-type-filter",options:cb,selected:f,setSelected:b}}:{}},children:t(Mn,{variant:zn.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:Sa,subTitle:Ta(m)}:{hideIcon:!0,title:wa,button:{label:xa,onClick:c}},columns:sb,rows:C,getRowActions:x})})},pb=({docsUrl:n})=>{const{samplingApi:o,sourcesApi:r}=Gl(),{items:s}=r.useSources(),c=i(()=>s.map(e=>({id:e.id})),[s]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=o.useSamplingRules(),f=d((e,t)=>o.createNoisy?.({samplingId:e,rule:t}),[o]),b=d((e,t,n)=>o.updateNoisy?.(t,{samplingId:e,rule:n}),[o]),v=d((e,t)=>o.createHighlyRelevant?.({samplingId:e,rule:t}),[o]),y=d((e,t,n)=>o.updateHighlyRelevant?.(t,{samplingId:e,rule:n}),[o]),C=d((e,t)=>o.createCostReduction?.({samplingId:e,rule:t}),[o]),S=d((e,t,n)=>o.updateCostReduction?.(t,{samplingId:e,rule:n}),[o]),x=d((e,t,n)=>"noisy"===n?o.deleteNoisy?.(t,e):"highlyRelevant"===n?o.deleteHighlyRelevant?.(t,e):"costReduction"===n?o.deleteCostReduction?.(t,e):void 0,[o]),w=d((e,t)=>o.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[o]),T=i(()=>c.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[c]),k=i(()=>Array.from(new Set(c.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[c]),[I,E]=l(P.Noisy),[N,O]=l(null),[$,R]=l(!1),[_,Q]=l(!1),[ee,te]=l(null),[ne,ie]=l(!1),[le,re]=l(!1),[se,ce]=l(!1),[de,pe]=l(!1);p(!1),a(()=>{},[h,u]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:he}=vn();a(()=>{if(!ue)return;if(h||0===u.length)return;he(null);const e=L(u,ue.ruleId,ue.category);e&&(E(F[ue.category]),R(!1),O(e))},[h,u,ue,he]);const me=i(()=>A(m),[m]),ge=i(()=>M(u),[u]),fe=i(()=>D(ge?.rule??null),[ge]),be=i(()=>z(u),[u]),ye=i(()=>B(be?.rule??null),[be]),Ce=p(N);Ce.current=N,a(()=>{const e=Ce.current;if(!e)return;const t=X(u,e);t?O(t):(O(null),R(!1))},[u]);const Se=i(()=>{const e=new Set;return ge&&e.add(ge.rule.ruleId),be&&e.add(be.rule.ruleId),e},[ge,be]),xe=i(()=>U(u,I,Se),[u,I,Se]),we=d(()=>Q(!0),[]),Ee=d(()=>Q(!1),[]);d(()=>pe(!1),[]);const Ne=d(async e=>{const t=u[0]?.id??"default";switch(K[I]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[u,I,f,v,C]),Oe=d(e=>{const t=G(u,e);t&&(R(!1),O(t))},[u]),$e=d(()=>{O(null),R(!1)},[]),Ae=d((e,t)=>{const n=N;if(n&&n.rule.ruleId===e&&n.samplingId===t)R(!0),O({...n});else for(const n of u){if(n.id!==t)continue;const o=[...n.noisyOperations.map(e=>({category:"noisy",rule:e})),...n.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...n.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return R(!0),void O({category:o.category,rule:o.rule,samplingId:t,summary:W(o.category,o.rule)})}},[N,u]),Re=d(async(e,t,n)=>{const o=N?.category;if(o){switch(o){case"noisy":await b(n,t,j(e));break;case"highlyRelevant":await y(n,t,H(e));break;case"costReduction":await S(n,t,V(e))}R(!1)}},[N,b,y,S]),Le=d((e,t)=>{te({ruleId:e,samplingId:t})},[]),Fe=d(async()=>{if(!ee)return;const{ruleId:e,samplingId:t}=ee,n=N?.category||K[I];await x(t,e,n),O(null),R(!1),te(null)},[ee,N,I,x]),Me=d(()=>te(null),[]),ze=d(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=d(async e=>{const t=u[0]?.id??"default",n=ge;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:n.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),re(!1)},[u,ge,v,y]),Xe=d(async(e,t)=>{const n=u[0]?.id??"default",o=be;o?await S(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:o.rule.notes}):e&&await C(n,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),ce(!1)},[u,be,C,S]),Ue=d(e=>{const t=K[I];let n=null;switch(t){case"noisy":{const o=j(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}case"highlyRelevant":{const o=H(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation,error:o.error??!1,durationAtLeastMs:o.durationAtLeastMs});break}case"costReduction":{const o=V(e);n=Y(u,t,{sourceScopes:o.sourceScopes,operation:o.operation});break}}return n?{message:ka,ruleId:n}:null},[u,I]),Ve=d(e=>{const t=N?.category,n=N?.rule.ruleId;if(!t)return null;let o=null;switch(t){case"noisy":{const i=j(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}case"highlyRelevant":{const i=H(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},n);break}case"costReduction":{const i=V(e);o=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},n);break}}return o?{message:ka,ruleId:o}:null},[u,N]),He=d(e=>{Q(!1);for(const t of u){const n=[...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(n)return R(!0),void O({category:n.category,rule:n.rule,samplingId:t.id,summary:W(n.category,n.rule)})}},[u]),je=i(()=>{const e=[];return n&&e.push({id:bo(),type:gn.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ia,leftIcon:Va,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")}}),e.push({id:bo(),type:gn.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ea,leftIcon:pl,size:ke.S,variant:Ie.Text,onClick:g,loading:h}}),e.push({id:bo(),type:gn.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Na,rightIcon:za,size:ke.S,variant:Ie.Primary,onClick:we}}),e},[n,g,h,we]);return e(Vi,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(ua,{icon:Ol,title:$a,subTitle:Oa}),t(ha,{actions:je})]}),e(ae,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Fn.Underline,size:De.L,options:J,selected:I,setSelected:E}),e(oe,{$justifyContent:"space-between",children:[t(_e,{status:Pe.Default,message:q[I]}),n&&t(Te,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Va,size:ke.S,variant:Ie.Text,onClick:()=>window.open(n,"_blank")})]}),I===P.Noisy?t(yr,{title:ct,summary:me,onEdit:()=>ie(!0)}):I===P.HighlyRelevant?t(yr,{title:it,summary:fe,onEdit:()=>re(!0)}):I===P.CostReduction?t(yr,{title:rt,summary:ye,onEdit:()=>ce(!0)}):null,t(db,{title:Z[I],items:xe,isLoading:h,showTypeFilter:I===P.HighlyRelevant,onRuleClick:Oe,onCreateRule:we,onEditRule:Ae,onDeleteRule:Le})]}),t(rm,{formType:Zl.View,data:N,defaultEditMode:$,onClose:$e,onDelete:Le,onSaveEdit:Re,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(rm,{formType:Zl.Create,isOpen:_,category:K[I],onClose:Ee,onSubmit:Ne,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(rm,{formType:Zl.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(rm,{formType:Zl.EditAutoHighlyRelevant,isOpen:le,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:Be}),t(rm,{formType:Zl.EditAutoCostReduction,isOpen:se,enabled:!!be&&!be.rule.disabled,dropPercentage:be?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Xe}),t(tt,{title:_a,description:Ra,isOpen:!!ee,onClose:Me,denyButton:{label:Da,variant:Ie.Secondary,onClick:Me},approveButton:{label:Aa,variant:Ie.Primary,onClick:()=>{Fe(),Me()}}}),!1]})},ub=b.div`
|
|
1334
1360
|
padding: 12px;
|
|
1335
1361
|
border-radius: 12px;
|
|
1336
1362
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
1337
|
-
`,
|
|
1363
|
+
`,hb=f(({id:e,data:n})=>t(ub,{"data-id":e,children:t($e,{...n})}));var mb,gb;hb.displayName=hb.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(mb||(mb={})),(e=>{e.AnimatedTraffic="animated-traffic"})(gb||(gb={}));const fb=(e,t,n)=>{if(n)return{icons:[yl],aggService:e,selected:!0};const o=e.isVirtual,i=o?[Cn(e)]:t?Sn(t):[Vl],{priorotizedStatus:a}=o?{priorotizedStatus:void 0}:na(t?.conditions||[]);return{icons:i,status:a,isVirtual:o,aggService:e,selected:!0}},bb=e=>!(!e||e.serviceName!==Gp||e.id.namespace||e.id.name||e.id.kind),vb=new Zr,yb={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},Cb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},Sb={id:{namespace:"",name:"",kind:""},serviceName:Gp,markedForInstrumentation:{markedForInstrumentation:!0}},xb=h(null),wb=()=>{const e=m(xb);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},Tb=({serviceMap:e,children:n})=>{const o=v(),{sourcesApi:r}=Gl(),{items:s}=r.useSources(),[c,p,u]=zr([]),[h,m,g]=Br([]),[f,b]=l(0),y=d(()=>b(e=>e+1),[]),[C,S]=l(""),[x,w]=l(null),[T,k]=l(null),I=d(e=>k(t=>t===e?null:e),[]),E=d(()=>k(null),[]),N=d((e,t)=>{const n=new Set(e);p(e=>e.map(e=>e.type===mb.MapItem&&n.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);a(()=>{let t=!1;const n=(e=>{const t=new Map,n=new Set,o=(e,n,o=!1)=>{let i=t.get(e);return i||(i={serviceName:n,isVirtual:o,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:n,value:o}of t)n in e||(e[n]=o)};for(const t of e){const{graphKey:e}=Cb(t.nodeId),a=o(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=Cb(e?.nodeId??"");e.isVirtual&&(n.add(t),i(o(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||o(i,a.targetServiceName,n.has(i));const l=[];for(const[e,{serviceName:n,isVirtual:o,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:n,isVirtual:o,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const n=[],o={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=bb(t);n.push({id:i.graphKey,type:mb.MapItem,position:o,data:fb(i,t,a),measured:{width:80,height:80}})}else n.push({id:mb.NoData,type:mb.NoData,position:o,data:{subTitle:nt.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({aggregatedServiceMap:n,sources:[Sb].concat(s)});if(1===i.length&&i[0].id===mb.NoData)return p(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:n})=>{const o=[],i=new Map(t.map(e=>[e.id,e]));for(const t of n){const n=t.graphKey,a=i.get(n);if(!a)continue;const l=a.data?.status===Pe.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&o.push({id:`${n}-to-${r}`,type:"smoothstep",source:n,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Mr.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return o})({theme:o,nodes:i,aggregatedServiceMap:n});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,n={})=>{const o={id:"root",layoutOptions:{...yb,...n},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Gp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await vb.layout(o),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(i,a).then(({nodes:e})=>{t||(p(e),S(l),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return i.map(e=>{const n=t.get(e.id);return n?e.type===mb.MapItem&&n.type===mb.MapItem?{...e,position:n.position,data:{...e.data,selected:n.data.selected}}:{...e,position:n.position}:e})})},[o,e,s,C]);const O=i(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:gb.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),$=i(()=>({nodes:c,edges:O,onNodesChange:u,onEdgesChange:g,setNodesSelected:N,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:I,resetActiveNode:E}),[c,O,u,g,N,f,x,T,I,E]);return t(xb.Provider,{value:$,children:n})},kb=b.div`
|
|
1338
1364
|
border: 1px ${({theme:e,$isSelected:t,$isVirtual:n})=>t?`solid ${e.v2.colors.blue[300]}`:n?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
|
|
1339
1365
|
border-radius: 8px;
|
|
1340
1366
|
cursor: pointer;
|
|
1341
1367
|
opacity: ${({$isVirtual:e})=>e?.8:1};
|
|
1342
|
-
`,
|
|
1368
|
+
`,Ib=b.div`
|
|
1343
1369
|
position: relative;
|
|
1344
|
-
`,
|
|
1370
|
+
`,Eb=b.div`
|
|
1345
1371
|
position: absolute;
|
|
1346
1372
|
top: 100%;
|
|
1347
1373
|
left: 50%;
|
|
@@ -1350,7 +1376,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1350
1376
|
align-items: center;
|
|
1351
1377
|
gap: 4px;
|
|
1352
1378
|
margin-top: 4px;
|
|
1353
|
-
`,
|
|
1379
|
+
`,Nb=f(({id:o,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=v(),{activeNodeId:d,hoveredNodeId:p}=wb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=i(()=>({isUserSource:o===Gp,isNodeSelected:d===o,isHovered:p===o}),[o,d,p,o]),{isSelected:g,isHighlighted:f}=i(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=r?Pn(r,c):null;return e(n,{children:[t(Xr,{type:"source",position:Ur.Right,style:{visibility:"hidden"}}),t(Xr,{type:"target",position:Ur.Left,style:{visibility:"hidden"}}),e(Ib,{"data-id":o,children:[t(kb,{$isSelected:g,$isVirtual:s,children:t(xn,{padding:12,icons:l,status:f?Pe.Info:r})}),e(Eb,{children:[b&&t(b,{}),t(ee,{size:te.XXS,nowrap:!0,children:o})]})]})]})});Nb.displayName=Nb.name;const Ob=b.div`
|
|
1354
1380
|
display: flex;
|
|
1355
1381
|
flex-direction: column;
|
|
1356
1382
|
gap: 12px;
|
|
@@ -1363,10 +1389,10 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1363
1389
|
top: 16px;
|
|
1364
1390
|
left: 8px;
|
|
1365
1391
|
z-index: ${({theme:e})=>e.v2.zIndex.drawer};
|
|
1366
|
-
|
|
1392
|
+
`,$b=({children:e})=>t(Ob,{children:e});var Ab,Db;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(Ab||(Ab={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(Db||(Db={}));const Rb=b.div`
|
|
1367
1393
|
flex: 1 1 auto;
|
|
1368
1394
|
min-height: 0;
|
|
1369
|
-
`,
|
|
1395
|
+
`,_b=()=>{const{nodes:n,activeNodeId:o,resetActiveNode:a}=wb(),[r,s]=l(Ab.All),c=i(()=>{const e=new Map;for(const t of n)t.type===mb.MapItem&&e.set(t.id,t);return e},[n]),d=i(()=>c.get(o??""),[c,o]),{inbound:p,outbound:u}=i(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:Db.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const n of t.data.aggService?.connections??[])n.targetGraphKey===d.id&&e.push({peerId:t.id,direction:Db.Inbound,totalRequests:n.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[Ab.All,Ab.Inbound].includes(r)&&p.length>0,m=[Ab.All,Ab.Outbound].includes(r)&&u.length>0;return e($b,{children:[e(oe,{$width:"100%",$gap:8,children:[t(Te,{variant:Ie.Text,size:ke.S,leftIcon:cl,onClick:a}),t(xn,{icons:d.data.icons}),t(ee,{size:te.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${Ab.All}`,value:Ab.All,badge:{label:`${p.length+u.length}`}},{label:`${Ab.Inbound}`,value:Ab.Inbound,badge:{label:`${p.length}`}},{label:`${Ab.Outbound}`,value:Ab.Outbound,badge:{label:`${u.length}`}}],selected:r,setSelected:s}),h&&t(Lb,{halfHeight:m,title:"Inbound",icon:bl,connections:p,mapNodesById:c}),m&&t(Lb,{halfHeight:h,title:"Outbound",icon:vl,connections:u,mapNodesById:c})]})},Pb=b.div`
|
|
1370
1396
|
display: flex;
|
|
1371
1397
|
flex-direction: column;
|
|
1372
1398
|
gap: 8px;
|
|
@@ -1374,17 +1400,17 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1374
1400
|
border-radius: 12px;
|
|
1375
1401
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1376
1402
|
height: ${({$halfHeight:e})=>e?"48%":"100%"};
|
|
1377
|
-
`,
|
|
1403
|
+
`,Lb=({halfHeight:n,title:o,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(Pb,{$halfHeight:n,children:[e(oe,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(ee,{size:te.XXS,color:ne.Secondary,children:o})]}),t(Rb,{children:t(bn,{gap:4,elements:a.map(e=>t(Mb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Fb=b.div`
|
|
1378
1404
|
display: flex;
|
|
1379
1405
|
align-items: center;
|
|
1380
1406
|
gap: 8px;
|
|
1381
1407
|
padding: 8px;
|
|
1382
1408
|
border-radius: 8px;
|
|
1383
1409
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1384
|
-
`,
|
|
1410
|
+
`,Mb=({connection:n,peerNode:o})=>e(Fb,{children:[o&&t(xn,{icons:o.data.icons}),e(oe,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXS,children:n.peerId}),t(ce,{label:n.totalRequests,tooltip:"Total requests"})]})]}),zb="0;0.5;1",Bb=f(({id:o,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Vr({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${o}__animated-traffic-motion`,m=p.v2.colors.blue[700],g=p.v2.colors.blue[900],f=p.v2.colors.blue[500],b="4s";return e(n,{children:[t(Hr,{id:o,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(jr,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:u,fill:"none",stroke:"none"}),Array.from({length:5}).map((n,o)=>{const i=`-${(.8*o).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:zb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:zb,values:`${g};${f};${f}`})]},o)})]})})]})});Bb.displayName=Bb.name;const Xb=b.div`
|
|
1385
1411
|
flex: 1 1 auto;
|
|
1386
1412
|
min-height: 0;
|
|
1387
|
-
|
|
1413
|
+
`,Ub=({})=>{const{nodes:n,setNodesSelected:o,resetActiveNode:a}=wb(),[r,s]=l(""),c=i(()=>n.filter(e=>e.type===mb.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[n]),p=i(()=>c.filter(e=>e.data.selected),[c]),u=i(()=>c.filter(e=>e.id.toLowerCase().includes(r.toLowerCase())),[c,r]),h=i(()=>u.every(e=>e.data.selected),[u]),m=d(()=>{const e=!h;o(u.map(e=>e.id),e),e||a()},[u,h,o,a]);return c.length?e($b,{children:[e(oe,{$width:"100%",$gap:8,children:[t(ee,{size:te.XS,children:"Services"}),t(ce,{label:c.length})]}),t(fn,{width:"100%",value:r,onChange:s}),e(oe,{$width:"100%",$justifyContent:"space-between",children:[t(ee,{size:te.XXXS,children:`Showing ${p.length} out of ${c.length}`}),t(ee,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:te.XS,children:h?nt.UNSELECT_ALL:nt.SELECT_ALL})]}),t(Xb,{children:t(bn,{gap:4,elements:u.map(e=>t(Hb,{node:e},e.id))})})]}):null},Vb=b.div`
|
|
1388
1414
|
display: flex;
|
|
1389
1415
|
align-items: center;
|
|
1390
1416
|
gap: 8px;
|
|
@@ -1392,7 +1418,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1392
1418
|
border-radius: 8px;
|
|
1393
1419
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
1394
1420
|
cursor: pointer;
|
|
1395
|
-
`,
|
|
1421
|
+
`,Hb=({node:n})=>{const{setNodesSelected:o,activeNodeId:i,resetActiveNode:a}=wb(),l=d(()=>{const e=!n.data.selected,t=i===n.id;o([n.id],e),!e&&t&&a()},[n,i,o,a]);return e(Vb,{onClick:l,children:[t(Q,{value:n.data.selected||!1,onChange:l}),t(xn,{icons:n.data.icons}),t(ee,{size:te.XXS,children:n.id})]},n.id)},jb=b.div`
|
|
1396
1422
|
position: relative;
|
|
1397
1423
|
height: 100%;
|
|
1398
1424
|
.react-flow__attribution {
|
|
@@ -1401,7 +1427,7 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1401
1427
|
* {
|
|
1402
1428
|
transition: none;
|
|
1403
1429
|
}
|
|
1404
|
-
`,
|
|
1430
|
+
`,Gb=b.div`
|
|
1405
1431
|
.react-flow__controls {
|
|
1406
1432
|
display: flex;
|
|
1407
1433
|
align-items: center;
|
|
@@ -1427,33 +1453,33 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1427
1453
|
}
|
|
1428
1454
|
}
|
|
1429
1455
|
}
|
|
1430
|
-
`,
|
|
1456
|
+
`,Wb={[mb.MapItem]:Nb,[mb.NoData]:hb},Kb={[gb.AnimatedTraffic]:Bb},Yb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Jb=({trigger:e})=>{const{fitView:t}=qr(),n=p(!0);return a(()=>{n.current?n.current=!1:e>0&&requestAnimationFrame(()=>t(Yb))},[e,t]),null},qb=({onRefresh:n})=>{const{nodes:o,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=wb(),p=i(()=>{const e=new Set(o.filter(e=>e.type===mb.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const n of a)e.has(n.source)&&t.add(n.target),e.has(n.target)&&t.add(n.source);return o.filter(e=>e.type!==mb.MapItem||e.data.selected||t.has(e.id))},[o,a]);return e(Wr,{zoomOnScroll:!0,nodes:p,nodeTypes:Wb,edges:a,edgeTypes:Kb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Kr,{}),t(Jb,{trigger:l}),t(Gb,{children:t(Yr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Yb,children:t(Jr,{onClick:n,children:t(pl,{})})})})]})},Zb=n=>t(Gr,{children:e(jb,{children:[t(qb,{...n}),t(Ub,{}),t(_b,{})]})}),Qb=b.div`
|
|
1431
1457
|
width: 100%;
|
|
1432
1458
|
flex: 1;
|
|
1433
1459
|
align-self: stretch;
|
|
1434
1460
|
min-height: 0;
|
|
1435
1461
|
height: 100%;
|
|
1436
1462
|
position: relative;
|
|
1437
|
-
`,
|
|
1463
|
+
`,ev=()=>{const{serviceMapApi:e}=Gl(),{data:n,refetch:o}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(Tb,{serviceMap:n?.serviceMap??[],children:t(Qb,{children:t(Zb,{onRefresh:o})})})},tv=b.div`
|
|
1438
1464
|
display: flex;
|
|
1439
1465
|
align-items: center;
|
|
1440
1466
|
justify-content: space-between;
|
|
1441
1467
|
padding: 0 12px;
|
|
1442
|
-
`,
|
|
1468
|
+
`,nv=b.div`
|
|
1443
1469
|
display: flex;
|
|
1444
1470
|
align-items: center;
|
|
1445
1471
|
gap: 8px;
|
|
1446
|
-
`,
|
|
1472
|
+
`,ov=b.div`
|
|
1447
1473
|
width: 1px;
|
|
1448
1474
|
height: 20px;
|
|
1449
1475
|
background-color: ${({theme:e})=>e.v2.colors.silver[500]};
|
|
1450
|
-
`,
|
|
1476
|
+
`,iv=({disabled:n,loading:o,onClickShowYaml:a,onClickReset:r,onClickRefresh:s})=>{const c=v(),[d,p]=l(!1),u=i(()=>a?[{id:bo(),type:gn.Button,buttonProps:{label:"Show Config YAML",leftIcon:Ul,size:ke.S,variant:Ie.Secondary,onClick:a,disabled:n}}]:[],[a,n]),h=i(()=>{const e=[];return s&&e.push({id:bo(),type:gn.Button,buttonProps:{leftIcon:pl,tooltip:"Refresh",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,onClick:s,disabled:n,loading:o}}),r&&e.push({id:bo(),type:gn.Button,buttonProps:{leftIcon:Ma,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:ke.S,variant:Ie.Text,textColor:c.v2.colors.red[500],onClick:()=>p(!0),disabled:n}}),e},[n,o,r,s,c]),m=u.length>0,g=h.length>0;return e(tv,{children:[t(ua,{icon:ul,title:"Odigos Settings"}),e(nv,{children:[m&&t(ha,{actions:u}),m&&g&&t(ov,{}),g&&t(ha,{actions:h})]}),t(tt,{isOpen:d,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:Ie.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:Ie.Primary,onClick:()=>{r?.(),p(!1)}}})]})},av=b(ae)`
|
|
1451
1477
|
width: 220px;
|
|
1452
1478
|
flex-shrink: 0;
|
|
1453
1479
|
height: 100%;
|
|
1454
1480
|
gap: 4px;
|
|
1455
1481
|
overflow-y: auto;
|
|
1456
|
-
`,
|
|
1482
|
+
`,lv=({options:e,selected:n,setSelected:o,disabled:i})=>t(av,{children:e.map(e=>t(is,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:n===e.id,disabled:i,onClick:()=>o(e.id)},e.id))}),rv=b(ae)`
|
|
1457
1483
|
width: 100%;
|
|
1458
1484
|
/* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
|
|
1459
1485
|
max-width: 844px;
|
|
@@ -1463,25 +1489,25 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1463
1489
|
gap: 24px;
|
|
1464
1490
|
flex: 1;
|
|
1465
1491
|
min-height: 0;
|
|
1466
|
-
`,
|
|
1492
|
+
`,sv=b(oe)`
|
|
1467
1493
|
flex: 1;
|
|
1468
1494
|
min-height: 0;
|
|
1469
1495
|
width: 100%;
|
|
1470
1496
|
align-self: stretch;
|
|
1471
|
-
`,
|
|
1497
|
+
`,cv=b(ae)`
|
|
1472
1498
|
flex: 1;
|
|
1473
1499
|
min-height: 0;
|
|
1474
1500
|
height: 100%;
|
|
1475
1501
|
max-width: 600px;
|
|
1476
1502
|
overflow-y: auto;
|
|
1477
|
-
`,
|
|
1503
|
+
`,dv=b(oe)`
|
|
1478
1504
|
gap: 8px;
|
|
1479
1505
|
width: 100%;
|
|
1480
1506
|
align-items: center;
|
|
1481
|
-
`,
|
|
1507
|
+
`,pv=b.div`
|
|
1482
1508
|
flex: 1;
|
|
1483
1509
|
min-width: 0;
|
|
1484
|
-
`,
|
|
1510
|
+
`,uv=e=>"general"===e.name?0:"advanced"===e.name?2:1,hv=({minSupportedVersion:o})=>{const{isVersionSupported:r,version:s,isEnterprise:c,minSupportedVersion:d}=S(o),{configApi:p}=Gl(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=l(!1),C=i(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...n}=m;return n},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:I}=Jt(C);a(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const E=i(()=>[...b].sort((e,t)=>uv(e)-uv(t)),[b]),N=i(()=>(e=>{if(!e)return{};const t={};for(const n of e)t[n.helmPath]=n.reconciledFrom;return t})(m?.provenance),[m?.provenance]),O=i(()=>{const e=new Set;for(const t of b)for(const n of t.fields)n.componentType===Ht.Dropdown&&e.add(n.helmValuePath);return e},[b]),$=i(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,D]=l(!1),[R,_]=l(!1),P=i(()=>[{id:bo(),type:gn.Button,buttonProps:{"data-id":"settings-save",variant:Ie.Primary,size:ke.S,label:"Save Changes",leftIcon:Za,loading:v,onClick:()=>D(!0)}},{id:bo(),type:gn.Button,buttonProps:{"data-id":"settings-cancel",variant:Ie.Secondary,size:ke.S,label:"Cancel",leftIcon:Qa,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=i(()=>E.map(e=>({id:e.name,label:e.displayName})),[E]),F=i(()=>E.map(e=>e.name),[E]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=Pa({sectionNames:F});return t(Vi,{$gap:24,children:e(rv,{children:[t(iv,{disabled:!r,loading:h||g,onClickShowYaml:()=>_(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(ya,{children:[!r&&t(Pr,{minSupportedVersion:d,currentVersion:s||""}),t(Bn,{isOpen:I,richTitle:{icon:ul,title:"Config Settings"},actions:P}),t(tt,{isOpen:A,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>D(!1),denyButton:{label:"Keep editing",variant:Ie.Secondary,onClick:()=>D(!1)},approveButton:{label:"Save changes",variant:Ie.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const n=(e,t,n)=>{for(let n=0;n<t.length-1;n++){const o=t[n];o in e&&"object"==typeof e[o]&&null!==e[o]||(e[o]={}),e=e[o]}e[t[t.length-1]]=n},o=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let i=o;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&n(o,t,i.replaceAll("-","_"))}return o})(k(C,x),O);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),D(!1)}}}),e(sv,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(lv,{options:L,selected:M,setSelected:z,disabled:!r}),t(cv,{ref:X,$gap:24,$width:"100%",children:b.length?E.map(o=>t(ut,{id:o.name,bordered:!0,ref:e=>B(o.name,e),customTitle:t(ee,{size:te.M,weight:500,color:ne.Primary,children:o.displayName}),children:t(ae,{$gap:24,children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!c)return null;if(o.renderCondition&&!Zt(o.renderCondition,[],$))return null;const i=kt(o.componentProps||"{}",{}),a=N[o.helmValuePath],l=o.componentType===Ht.Toggle,r=t(ee,{size:te.XS,weight:500,color:ne.Primary,children:o.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Pe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Pe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Pe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(ce,{...s}):null,p=o.description?t(ee,{size:te.XXS,color:ne.Secondary,children:o.description}):null,u=e(ae,{$gap:4,children:[e(oe,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(Lr,{componentType:o.componentType,inputType:i.type,name:o.helmValuePath,disabled:o.isHelmOnly||v,value:T("formData",o.helmValuePath),setValue:e=>w(o.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Nt.S},o.helmValuePath),m=o.isHelmOnly?t(Ue,{text:"This field can only be updated via the Helm values.yaml file",children:t(Hl,{})}):null;return t(ae,{$gap:8,children:l?e(oe,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(oe,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(n,{children:[u,e(dv,{children:[t(pv,{children:h}),m]})]})},o.helmValuePath)})})},o.name)):h?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(ut,{richTitle:{icon:ul,title:"Config Settings"},children:t($e,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(zt,{isOpen:R,width:"40vw",minWidth:"480px",header:{icon:Ul,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(Dr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},mv=b.div`
|
|
1485
1511
|
position: fixed;
|
|
1486
1512
|
bottom: 12px;
|
|
1487
1513
|
left: 12px;
|
|
@@ -1490,4 +1516,4 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o,{useMem
|
|
|
1490
1516
|
flex-direction: column-reverse;
|
|
1491
1517
|
gap: 6px;
|
|
1492
1518
|
max-width: 600px;
|
|
1493
|
-
`,
|
|
1519
|
+
`,gv=()=>{const{notifications:e,markAsDismissed:n,markAsSeen:o}=tn(),i=e.filter(({dismissed:e})=>!e);return t(mv,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(_e,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{n(e),t&&o(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{qs as AddActionDrawer,Ns as AddActionForm,bm as AddDataStreamModal,rc as AddDestinationDrawer,$s as AddDestinationForm,sc as AddRuleDrawer,Ms as AddRuleForm,Tc as AddSourceDrawer,Tg as CentralConnections,hp as CloudConnectorStep,fp as CreateCloudConnectorDrawer,bg as CreateNewType,Bs as DataStreamForm,zs as DataStreamMergeWarning,yp as EditActionDrawer,Cp as EditConfigDrawer,vm as EditDataStreamModal,xp as EditDestinationDrawer,Tp as EditRuleDrawer,Yh as EditSourceDrawer,Xs as EditSourceForm,Mg as Onboarding,Sm as OnboardingDone,jf as Overview,ib as PipelineCollectors,mr as RegexTesterDrawer,gg as SamplingOnboardingModal,rm as SamplingRuleDrawer,Ws as SamplingRuleForm,pb as SamplingRules,ev as ServiceMap,hv as Settings,fm as SystemDrawer,ob as TABS,gv as ToastList};
|