@odigos/ui-kit 0.0.243 → 0.0.244
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 +13 -0
- package/lib/chunks/{helpers-DlRedD4d.js → helpers-aJJ1GhqS.js} +1 -1
- package/lib/chunks/{index-Cl1o9W_f.js → index-BnOPIhIp.js} +12 -12
- package/lib/chunks/source-instrument-form-context-5GXsAhJd.js +1 -0
- package/lib/chunks/ui-components-Dnqp-MQm.js +1592 -0
- package/lib/components/_v2/note/index.d.ts +6 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/actions/index.d.ts +0 -2
- package/lib/constants.js +1 -1
- package/lib/containers/index.d.ts +0 -1
- package/lib/containers/v2.js +121 -126
- package/lib/containers.js +7 -62
- package/lib/contexts.js +1 -1
- package/lib/functions/get-action-icon/index.d.ts +2 -2
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +6 -6
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +0 -19
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/source-instrument-form-context-0FWO95UV.js +0 -1
- package/lib/chunks/ui-components-D8ipj0yK.js +0 -1570
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/error-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/latency-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/probabilistic-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/service-name-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/span-attribute-sampler/index.d.ts +0 -5
- package/lib/containers/notification-manager/index.d.ts +0 -4
package/lib/containers/v2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,Fragment as a,forwardRef as i,useState as l,useImperativeHandle as s,useMemo as r,useCallback as c,useRef as d,Children as u,createContext as p,useContext as h,useLayoutEffect as m}from"react";import g,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as k,S as T,f as $,e as N,a as I,r as E,h as O,i as A,j as D,k as R,l as F,m as P,o as L,p as _,q as M,s as B,t as z}from"../chunks/helpers-DlRedD4d.js";import{y as X,F as V,$ as U,a0 as H,a1 as j,a2 as W,a3 as G,G as K,a4 as Y,a5 as J,a6 as q,a7 as Z,a8 as Q,p as ee,h as te,a9 as oe,aa as ne,ab as ae,R as ie,z as le,N as se,b as re,c as ce,ac as de,ad as ue,ae as pe,af as he,ag as me,S as ge,M as fe,Q as be,L as ve,ah as ye,ai as Ce,aj as Se,ak as we,V as xe,al as ke,X as Te,Y as $e,W as Ne,Z as Ie,am as Ee,an as Oe,ao as Ae,ap as De,D as Re,H as Fe,aq as Pe,ar as Le,as as _e,at as Me,au as Be,av as ze,aw as Xe,ax as Ve,ay as Ue,az as He,i as je,A as We,x as Ge,aA as Ke,K as Ye,aB as Je,aC as qe,aD as Ze,aE as Qe,aF as et,aG as tt,w as ot,O as nt,q as at,U as it,E as lt,aH as st,T as rt,aI as ct,aJ as dt,aK as ut,aL as pt,aM as ht,aN as mt,aO as gt,o as ft,aP as bt,aQ as vt,aR as yt,aS as Ct,aT as St,v as wt,aU as xt,aV as kt,aW as Tt,aX as $t,d as Nt,B as It,aY as Et,aZ as Ot,f as At,a_ as Dt,a$ as Rt,b0 as Ft,b1 as Pt,b2 as Lt,b3 as _t,b4 as Mt,b5 as Bt,b6 as zt,b7 as Xt,b8 as Vt,b9 as Ut,ba as Ht,bb as jt,bc as Wt,l as Gt,m as Kt,bd as Yt,be as Jt,bf as qt,bg as Zt,bh as Qt,bi as eo,bj as to,bk as oo,bl as no,bm as ao,_ as io,bn as lo,bo as so,bp as ro,bq as co,br as uo,bs as po,bt as ho,bu as mo,bv as go,bw as fo,bx as bo,by as vo,bz as yo,bA as Co,bB as So,bC as wo,bD as xo,bE as ko,bF as To,bG as $o,bH as No,bI as Io,bJ as Eo,bK as Oo,bL as Ao,bM as Do,bN as Ro,bO as Fo,bP as Po,bQ as Lo,bR as _o,bS as Mo,bT as Bo,bU as zo,bV as Xo,bW as Vo,bX as Uo,bY as Ho,bZ as jo,b_ as Wo,b$ as Go,c0 as Ko,c1 as Yo,c2 as Jo,c3 as qo,c4 as Zo,c5 as Qo,c6 as en,c7 as tn,c8 as on,c9 as nn,ca as an,cb as ln,cc as sn,cd as rn,ce as cn,cf as dn,cg as un,ch as pn,ci as hn,cj as mn,ck as gn,cl as fn,cm as bn,cn as vn,co as yn,cp as Cn,cq as Sn,cr as wn,cs as xn,ct as kn,cu as Tn,cv as $n,cw as Nn,cx as In,cy as En,cz as On,cA as An,cB as Dn,cC as Rn,cD as Fn,cE as Pn,cF as Ln,cG as _n,cH as Mn,cI as Bn,cJ as zn,cK as Xn,cL as Vn,cM as Un,cN as Hn,cO as jn,cP as Wn,cQ as Gn,cR as Kn,cS as Yn,cT as Jn,cU as qn,cV as Zn,cW as Qn,cX as ea,cY as ta,cZ as oa,c_ as na,c$ as aa,d0 as ia,d1 as la,d2 as sa,d3 as ra,d4 as ca,d5 as da,d6 as ua,d7 as pa,d8 as ha,d9 as ma,da as ga,db as fa,dc as ba,dd as va,de as ya,df as Ca,dg as Sa,j as wa,dh as xa,n as ka,di as Ta,dj as $a,dk as Na,dl as Ia,dm as Ea,dn as Oa,dp as Aa,dq as Da,dr as Ra,ds as Fa,dt as Pa,du as La,dv as _a,dw as Ma,dx as Ba,dy as za,dz as Xa,dA as Va,dB as Ua,dC as Ha,dD as ja,dE as Wa,dF as Ga,dG as Ka,dH as Ya,dI as Ja,dJ as qa,dK as Za,dL as Qa,dM as ei,dN as ti,dO as oi,dP as ni}from"../chunks/ui-components-D8ipj0yK.js";import{TrashIcon as ai,PlusIcon as ii,BookIcon as li,VSquareIcon as si,XSquareIcon as ri,DeleteIcon as ci,EditIcon as di,GoLogo as ui,JavaLogo as pi,ChevronRightIcon as hi,ActionIcon as mi,DestinationIcon as gi,ChevronUpIcon as fi,ChevronDownIcon as bi,VIcon as vi,XIcon as yi,InstrumentationRuleIcon as Ci,SourceIcon as Si,NamespacesIcon as wi,SettingsIcon as xi,PodIcon as ki,OdigosLogo as Ti,K8sLogo as $i,RefreshIcon as Ni,ExclamationCircleIcon as Ii,QuestionCircleIcon as Ei,InboundIcon as Oi,OutboundIcon as Ai,UserIcon as Di,ExpandIcon as Ri,SearchIcon as Fi,MinusIcon as Pi,CopyIcon as Li,DotIcon as _i,DownloadIcon as Mi,RefreshLeftArrowIcon as Bi,SamplingIcon as zi,ExclamationTriangleIcon as Xi,KeyIcon as Vi,DiagnoseIcon as Ui,TerminalIcon as Hi,ArrowRightIcon as ji,StarIcon as Wi,ArrowIcon as Gi,ConnectionsIcon as Ki,FilterIcon as Yi,DataStreamIcon as Ji,PipelineCollectorIcon as qi,ArrowDownSquareIcon as Zi,ArrowUpSquareIcon as Qi,GatewayIcon as el,YamlIcon as tl}from"../icons.js";import{S as ol,D as nl,A as al,P as il,a as ll,b as sl,R as rl,c as cl,O as dl,d as ul,e as pl,f as hl,W as ml,g as gl,C as fl,Y as bl,h as vl,i as yl,U as Cl}from"../chunks/index-Cl1o9W_f.js";import{u as Sl,f as wl,g as xl,e as kl,i as Tl,h as $l,S as Nl,k as Il,E as El,l as Ol,m as Al,j as Dl,b as Rl,d as Fl,a as Pl,A as Ll,R as _l,c as Ml,D as Bl}from"../chunks/source-instrument-form-context-0FWO95UV.js";import{createPortal as zl}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Xl=[{id:"CREDIT_CARD",label:"Credit card"}],Vl=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],Ul=[{id:J.Pod,label:J.Pod},{id:J.Namespace,label:J.Namespace},{id:J.Node,label:J.Node}],Hl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Ul}],jl=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Ul}],Wl=[{label:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered."},{label:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product."},{label:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",inputType:G.Number,min:0},{label:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",inputType:G.Number,min:0,max:100}],Gl=X.UrlTemplatizationRulesGroups,Kl=[{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"}],Yl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:G.Number,min:0,max:100},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:G.Number,min:0,max:100}],Jl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:G.Number,min:0,max:100},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:ie.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:ie.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],ql={[le.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:Vl.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(j,{errorMessage:l[o]})]},o))}),t(Y,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Hl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(Y,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:jl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[le.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(q,{label:"Overwrite existing values",labelAlign:Z.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(Y,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[le.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(Q,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[le.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>t(Y,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[X.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),o(X.Renames,t)},errorMessage:n[X.Renames]}),[le.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Xl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Xl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(j,{errorMessage:i[X.PiiCategories]})]})),[le.ErrorSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.FallbackSamplingRatio],i=K(e[X.FallbackSamplingRatio])?"":String(e[X.FallbackSamplingRatio]);return t(W,{name:"fallbackSamplingRatio",label:"Fallback sampling ratio",type:G.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,o(X.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[le.ProbabilisticSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.SamplingPercentage],i=K(e[X.SamplingPercentage])?"":String(e[X.SamplingPercentage]);return t(W,{name:"samplingPercentage",label:"Sampling percentage",type:G.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,o(X.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[le.LatencySampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.EndpointsFilters],i=e[X.EndpointsFilters]||[];return t(Y,{name:"endpointsFilters",limitFieldsPerRow:2,columns:Wl,values:i,setValues:e=>{o(X.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(o),fallbackSamplingRatio:Number(n)})))},errorMessage:a})},[le.ServiceNameSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.ServicesNameFilters],i=e[X.ServicesNameFilters]||[];return t(Y,{name:"servicesNameFilters",limitFieldsPerRow:2,columns:Yl,values:i,setValues:e=>{o(X.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)})))},errorMessage:a})},[le.SpanAttributeSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.AttributeFilters],i=(e[X.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(Y,{name:"attributeFilters",limitFieldsPerRow:2,columns:Jl,values:i,setValues:e=>{o(X.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n,operation:a,expectedValue:i,jsonPath:l})=>{const s={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(o),condition:{[n]:{operation:a,expectedValue:i}}};return l&&(s.condition[n].jsonPath=l),s}))},errorMessage:a})},[le.URLTemplatization]:({value:n,setValue:i,formErrors:l})=>{const s=f(),r=n[Gl]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Gl,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(a,{children:[t(ee,{}),e(V,{$gap:12,children:[e(te,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(oe,{leftIcon:()=>t(ai,{fill:s.v2.colors.red[500]}),variant:ae.Secondary,size:ne.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(W,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(Y,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Kl,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(Q,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(j,{errorMessage:l[Gl]})]},`url-templatization-group-${n}`)),t(oe,{variant:ae.Secondary,label:"Add rule group",leftIcon:ii,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ee,{})]})}},Zl=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=ql[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Ql=()=>{const o=f(),{selectedOption:n,genericForm:a}=Sl();if(!a||!n)return t(se,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(re,{size:ce.XXS,children:n.docsDescription}),t(oe,{label:"Docs",leftIcon:li,variant:ae.Text,size:ne.S,onClick:()=>window.open(`${de}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),t(ue,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ri,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ol,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(W,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Zl,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},es=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!o||he(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(nl,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>i(f,e)},f)}),ts=g(te)`
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,Fragment as a,forwardRef as i,useState as l,useImperativeHandle as s,useMemo as r,useCallback as c,useRef as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as T,S as k,f as I,e as $,a as E,r as N,h as O,i as A,j as D,k as R,l as P,m as F,o as L,p as _,q as B,s as z,t as M}from"../chunks/helpers-aJJ1GhqS.js";import{q as X,R as V,U,V as H,W as j,X as W,Y as G,Z as K,_ as Y,$ as J,i as q,F as Z,a0 as Q,a1 as ee,a2 as te,a3 as oe,r as ne,a4 as ae,b as ie,c as le,a5 as se,a6 as re,a7 as ce,a8 as de,n as ue,S as pe,B as he,G as ge,z as me,a9 as fe,aa as be,ab as ve,ac as ye,J as Ce,ad as Se,L as we,M as xe,K as Te,O as ke,ae as Ie,af as $e,ag as Ee,ah as Ne,D as Oe,w as Ae,ai as De,aj as Re,ak as Pe,al as Fe,am as Le,an as _e,ao as Be,ap as ze,aq as Me,ar as Xe,as as Ve,A as Ue,at as He,y as je,au as We,av as Ge,aw as Ke,ax as Ye,ay as Je,az as qe,p as Ze,C as Qe,j as et,I as tt,E as ot,aA as nt,T as at,aB as it,aC as lt,aD as st,aE as rt,aF as ct,aG as dt,aH as ut,f as pt,aI as ht,aJ as gt,aK as mt,aL as ft,aM as bt,o as vt,aN as yt,H as Ct,aO as St,aP as wt,aQ as xt,l as Tt,v as kt,aR as It,aS as $t,aT as Et,aU as Nt,aV as Ot,aW as At,aX as Dt,aY as Rt,aZ as Pt,a_ as Ft,a$ as Lt,b0 as _t,b1 as Bt,b2 as zt,b3 as Mt,b4 as Xt,b5 as Vt,b6 as Ut,g as Ht,d as jt,b7 as Wt,b8 as Gt,b9 as Kt,ba as Yt,bb as Jt,bc as qt,bd as Zt,be as Qt,bf as eo,bg as to,Q as oo,bh as no,bi as ao,bj as io,bk as lo,bl as so,bm as ro,bn as co,bo as uo,bp as po,bq as ho,br as go,bs as mo,bt as fo,bu as bo,bv as vo,bw as yo,bx as Co,by as So,bz as wo,bA as xo,bB as To,bC as ko,bD as Io,bE as $o,bF as Eo,bG as No,bH as Oo,bI as Ao,bJ as Do,bK as Ro,bL as Po,bM as Fo,bN as Lo,bO as _o,bP as Bo,bQ as zo,bR as Mo,bS as Xo,bT as Vo,bU as Uo,bV as Ho,bW as jo,bX as Wo,bY as Go,bZ as Ko,b_ as Yo,b$ as Jo,c0 as qo,c1 as Zo,c2 as Qo,c3 as en,c4 as tn,c5 as on,c6 as nn,c7 as an,c8 as ln,c9 as sn,ca as rn,cb as cn,cc as dn,cd as un,ce as pn,cf as hn,cg as gn,ch as mn,ci as fn,cj as bn,ck as vn,cl as yn,cm as Cn,cn as Sn,co as wn,cp as xn,cq as Tn,cr as kn,cs as In,ct as $n,cu as En,cv as Nn,cw as On,cx as An,cy as Dn,cz as Rn,cA as Pn,cB as Fn,cC as Ln,cD as _n,cE as Bn,cF as zn,cG as Mn,cH as Xn,cI as Vn,cJ as Un,cK as Hn,cL as jn,cM as Wn,cN as Gn,cO as Kn,cP as Yn,cQ as Jn,cR as qn,cS as Zn,cT as Qn,cU as ea,cV as ta,cW as oa,cX as na,cY as aa,cZ as ia,c_ as la,c$ as sa,d0 as ra,d1 as ca,d2 as da,d3 as ua,d4 as pa,d5 as ha,d6 as ga,d7 as ma,d8 as fa,d9 as ba,da as va,db as ya,dc as Ca,e as Sa,dd as wa,de as xa,df as Ta,dg as ka,dh as Ia,di as $a,dj as Ea,dk as Na,dl as Oa,dm as Aa,dn as Da,dp as Ra,dq as Pa,dr as Fa,ds as La,dt as _a,du as Ba,dv as za,dw as Ma,dx as Xa,dy as Va,dz as Ua,dA as Ha,dB as ja,dC as Wa,dD as Ga,dE as Ka,dF as Ya,dG as Ja,dH as qa,dI as Za,dJ as Qa,dK as ei}from"../chunks/ui-components-Dnqp-MQm.js";import{TrashIcon as ti,PlusIcon as oi,BookIcon as ni,VSquareIcon as ai,XSquareIcon as ii,DeleteIcon as li,EditIcon as si,GoLogo as ri,JavaLogo as ci,ChevronRightIcon as di,ActionIcon as ui,DestinationIcon as pi,ChevronUpIcon as hi,ChevronDownIcon as gi,VIcon as mi,XIcon as fi,InstrumentationRuleIcon as bi,SourceIcon as vi,NamespacesIcon as yi,SettingsIcon as Ci,PodIcon as Si,OdigosLogo as wi,K8sLogo as xi,RefreshIcon as Ti,ExclamationCircleIcon as ki,QuestionCircleIcon as Ii,InboundIcon as $i,OutboundIcon as Ei,UserIcon as Ni,ExpandIcon as Oi,SearchIcon as Ai,MinusIcon as Di,CopyIcon as Ri,DotIcon as Pi,DownloadIcon as Fi,RefreshLeftArrowIcon as Li,SamplingIcon as _i,ExclamationTriangleIcon as Bi,KeyIcon as zi,DiagnoseIcon as Mi,TerminalIcon as Xi,ArrowRightIcon as Vi,StarIcon as Ui,ArrowIcon as Hi,ConnectionsIcon as ji,FilterIcon as Wi,DataStreamIcon as Gi,PipelineCollectorIcon as Ki,ArrowDownSquareIcon as Yi,ArrowUpSquareIcon as Ji,GatewayIcon as qi,YamlIcon as Zi}from"../icons.js";import{S as Qi,D as el,A as tl,P as ol,a as nl,b as al,R as il,c as ll,O as sl,d as rl,e as cl,f as dl,W as ul,g as pl,C as hl,Y as gl,h as ml,i as fl,U as bl}from"../chunks/index-BnOPIhIp.js";import{u as vl,f as yl,g as Cl,e as Sl,i as wl,h as xl,S as Tl,k as kl,E as Il,l as $l,m as El,j as Nl,b as Ol,d as Al,a as Dl,A as Rl,R as Pl,c as Fl,D as Ll}from"../chunks/source-instrument-form-context-5GXsAhJd.js";import{createPortal as _l}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Bl=[{id:"CREDIT_CARD",label:"Credit card"}],zl=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],Ml=[{id:G.Pod,label:G.Pod},{id:G.Namespace,label:G.Namespace},{id:G.Node,label:G.Node}],Xl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Ml}],Vl=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Ml}],Ul=X.UrlTemplatizationRulesGroups,Hl=[{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"}],jl={[ne.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:zl.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(j,{errorMessage:l[o]})]},o))}),t(W,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Xl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(W,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Vl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[ne.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(K,{label:"Overwrite existing values",labelAlign:Y.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(W,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[ne.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(J,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[ne.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>t(W,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[X.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),o(X.Renames,t)},errorMessage:n[X.Renames]}),[ne.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Bl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Bl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(j,{errorMessage:i[X.PiiCategories]})]})),[ne.URLTemplatization]:({value:n,setValue:i,formErrors:l})=>{const s=f(),r=n[Ul]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Ul,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(a,{children:[t(q,{}),e(V,{$gap:12,children:[e(Z,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(Q,{leftIcon:()=>t(ti,{fill:s.v2.colors.red[500]}),variant:te.Secondary,size:ee.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(oe,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(W,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Hl,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(J,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(j,{errorMessage:l[Ul]})]},`url-templatization-group-${n}`)),t(Q,{variant:te.Secondary,label:"Add rule group",leftIcon:oi,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(q,{})]})}},Wl=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=jl[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Gl=()=>{const o=f(),{selectedOption:n,genericForm:a}=vl();if(!a||!n)return t(ae,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(Z,{$gap:12,$justifyContent:"space-between",children:[t(ie,{size:le.XXS,children:n.docsDescription}),t(Q,{label:"Docs",leftIcon:ni,variant:te.Text,size:ee.S,onClick:()=>window.open(`${se}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),t(re,{options:[{icon:ai,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ii,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(Qi,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(oe,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Wl,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(ce,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},Kl=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:g,options:m})=>{if(!(!o||de(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(el,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:n,required:g,placeholder:p,errorMessage:l[f],dropdownOptions:m,value:v||"",setValue:e=>i(f,e)},f)}),Yl=m(Z)`
|
|
2
2
|
position: sticky;
|
|
3
3
|
bottom: 4px;
|
|
4
4
|
align-self: center;
|
|
@@ -9,17 +9,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
9
9
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
10
10
|
box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
|
|
11
11
|
z-index: 1;
|
|
12
|
-
`,os=i(({testConnection:o,isEdit:a},i)=>{const r=f(),{isVm:c}=y(),{activeForm:d,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:b}=wl(),[v,C]=l(h?.testResult),[S,w]=l(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!d?.option.testConnectionSupported||!u||c)return;const e=await o(ye(u.formData));return C(e),e};return s(i,()=>({testConnection:x,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,u,o]),u&&d?e(V,{$gap:24,style:{minHeight:"100%"},children:[e(te,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(me,{status:ge.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(me,{status:ge.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),t(oe,{"data-id":"dest-form-docs",label:"Docs",leftIcon:li,variant:ae.Text,size:ne.S,onClick:()=>window.open(`${de}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]}),!c&&t(ue,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:r.v2.colors.green[800]},{icon:ri,label:"Disabled",value:!0,selectedBgColor:r.v2.colors.red[800]}],selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(ol,{title:"This connection will monitor:",allowedSignals:ve(d.option.supportedSignals),selectedSignals:be(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(fe.Logs),metrics:e.includes(fe.Metrics),traces:e.includes(fe.Traces),profiles:e.includes(fe.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(W,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(es,{signals:be(u.formData.exportedSignals),fields:d.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!a&&e(ts,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:ci,variant:ae.Secondary,textColor:r.v2.colors.red[500],onClick:()=>b(d.unsavedIdx)})}),!c&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ae.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:di,variant:ae.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ae.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ae.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t(se,{title:"No active form"})});os.displayName="AddDestinationForm";const ns=[{id:Se.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Se.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Se.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],as=[{id:Se.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Se.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Se.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],is=["*"],ls=[{id:ke.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:ke.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:ke.DbQuery,label:"Collect DB query",tooltip:""},{id:ke.Messaging,label:"Collect messaging",tooltip:""}],ss={[Ne.Java]:[new $e("","")],[Ne.Golang]:[new Te("")]},rs={[Ie.CodeAttributes]:({value:a,setValue:i,formErrors:l})=>{const s=l.codeAttributes,c=r(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]);n(()=>{if(!c.length&&!s){const e={[Se.FilePath]:!0,[Se.Function]:!0,[Se.LineNumber]:!0,[Se.Column]:null,[Se.Namespace]:null,[Se.StackTrace]:null};i("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Se).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});i("codeAttributes",n)};return e(o,{children:[e(V,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(V,{$gap:6,children:ns.map(({id:e,label:o,tooltip:n})=>t(we,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]}),e(V,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(V,{$gap:6,children:as.map(({id:e,label:o,tooltip:n})=>t(we,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]})]})},[Ie.CustomInstrumentation]:({value:a,setValue:i,formErrors:l})=>{const s=l.customInstrumentations,c=r(()=>(a?.customInstrumentations?.[Ne.Golang]||[]).map(e=>new Te(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[a]),d=r(()=>(a?.customInstrumentations?.[Ne.Java]||[]).map(e=>new $e(e.className,e.methodName)),[a]);return n(()=>{a?.customInstrumentations||s||i("customInstrumentations",{[Ne.Golang]:ss[Ne.Golang],[Ne.Java]:ss[Ne.Java]})},[]),e(o,{children:[e(V,{children:[e(te,{$gap:8,children:[t(ui,{}),t(U,{label:"Golang custom probes"})]}),t(Y,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Ne.Golang]=e.map(e=>new Te(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ne.Java]=d,i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(V,{children:[e(te,{$gap:8,children:[t(pi,{}),t(U,{label:"Java custom probes"})]}),t(Y,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ne.Golang]=c,t[Ne.Java]=e.map(e=>new $e(e.className,e.methodName)),i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Ie.HeadersCollection]:({value:e,setValue:o,formErrors:a})=>{const i=a.headersCollection,l=r(()=>e?.headersCollection?.[xe.HeaderKeys]||[],[e]),s=e=>{const t={[xe.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{l.length||i||s(is)},[]),t(Q,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:l,setValues:s,errorMessage:i})},[Ie.PayloadCollection]:({value:o,setValue:a,formErrors:i})=>{const l=i.payloadCollection,s=r(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!l){const e={[ke.HttpRequest]:{},[ke.HttpResponse]:{},[ke.DbQuery]:{},[ke.Messaging]:{}};a("payloadCollection",e)}},[]);return e(V,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Type of data to collect"}),t(V,{$gap:6,children:ls.map(({id:e,label:o,tooltip:n})=>t(we,{text:n,withIcon:!0,children:t(H,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[ke.HttpRequest]:o.includes(ke.HttpRequest)?{}:null,[ke.HttpResponse]:o.includes(ke.HttpResponse)?{}:null,[ke.DbQuery]:o.includes(ke.DbQuery)?{}:null,[ke.Messaging]:o.includes(ke.Messaging)?{}:null};a("payloadCollection",n)})(e,t)})},e))}),t(j,{errorMessage:l})]})},[Ie.UnknownType]:null},cs=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=rs[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},ds=()=>{const o=f(),{selectedOption:n,genericForm:a}=xl();if(!a||!n)return t(se,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(re,{size:ce.XXS,children:n.docsDescription}),t(oe,{label:"Docs",leftIcon:li,variant:ae.Text,size:ne.S,onClick:()=>window.open(`${de}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),e(te,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Ee,{label:Oe[e],leftIcon:Ae(e),status:ge.Default,useSecondaryTone:!0},e))]}),t(ue,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ri,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(W,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:i.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:s.ruleName}),t(cs,{ruleType:n.type,value:i,setValue:(e,t)=>l(e,t),formErrors:s}),t(pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},us=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=kl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(De,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Re.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ae.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ae.Secondary,onClick:n}})},ps=({autoFocus:o})=>{const{dataStreams:n}=Fe(),{genericForm:a,excludeName:i,editingName:l}=kl(),{formData:s,formErrors:c,handleFormChange:d}=a,u=s.name,p=r(()=>n.find(e=>e.name===u&&e.name!==i),[n,u,i]);return e(V,{$width:"100%",$gap:12,children:[t(W,{name:"data-stream-name",label:Re.STREAM_NAME,placeholder:Re.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Re.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(me,{status:ge.Warning,message:Re.DATA_STREAM_MERGE_WARNING(l,p.name),fullWidth:!0})]})},hs=()=>{const{selectedStreamName:e}=Fe(),{genericForm:o}=Tl();if(!o)return t(se,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(W,{name:"sourceName",label:Re.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},ms=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],gs=g.div`
|
|
12
|
+
`,Jl=i(({testConnection:o,isEdit:a},i)=>{const r=f(),{isVm:c}=y(),{activeForm:d,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=yl(),[v,C]=l(h?.testResult),[S,w]=l(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!d?.option.testConnectionSupported||!u||c)return;const e=await o(fe(u.formData));return C(e),e};return s(i,()=>({testConnection:x,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,u,o]),u&&d?e(V,{$gap:24,style:{minHeight:"100%"},children:[e(Z,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(ue,{status:pe.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(ue,{status:pe.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),t(Q,{"data-id":"dest-form-docs",label:"Docs",leftIcon:ni,variant:te.Text,size:ee.S,onClick:()=>window.open(`${se}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]}),!c&&t(re,{options:[{icon:ai,label:"Enabled",value:!1,selectedBgColor:r.v2.colors.green[800]},{icon:ii,label:"Disabled",value:!0,selectedBgColor:r.v2.colors.red[800]}],selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(Qi,{title:"This connection will monitor:",allowedSignals:me(d.option.supportedSignals),selectedSignals:ge(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(he.Logs),metrics:e.includes(he.Metrics),traces:e.includes(he.Traces),profiles:e.includes(he.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(oe,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Kl,{signals:ge(u.formData.exportedSignals),fields:d.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!a&&e(Yl,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(Q,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:li,variant:te.Secondary,textColor:r.v2.colors.red[500],onClick:()=>b(d.unsavedIdx)})}),!c&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(Q,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:te.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(Q,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:si,variant:te.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(Q,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:te.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m(d.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(Q,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:te.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(ae,{title:"No active form"})});Jl.displayName="AddDestinationForm";const ql=[{id:ve.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:ve.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:ve.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Zl=[{id:ve.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:ve.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:ve.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ql=["*"],es=[{id:Se.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Se.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Se.DbQuery,label:"Collect DB query",tooltip:""},{id:Se.Messaging,label:"Collect messaging",tooltip:""}],ts={[Te.Java]:[new xe("","")],[Te.Golang]:[new we("")]},os={[ke.CodeAttributes]:({value:a,setValue:i,formErrors:l})=>{const s=l.codeAttributes,c=r(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]);n(()=>{if(!c.length&&!s){const e={[ve.FilePath]:!0,[ve.Function]:!0,[ve.LineNumber]:!0,[ve.Column]:null,[ve.Namespace]:null,[ve.StackTrace]:null};i("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(ve).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});i("codeAttributes",n)};return e(o,{children:[e(V,{$gap:12,children:[t(ie,{size:le.XS,color:be.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(V,{$gap:6,children:ql.map(({id:e,label:o,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]}),e(V,{$gap:12,children:[t(ie,{size:le.XS,color:be.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(V,{$gap:6,children:Zl.map(({id:e,label:o,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]})]})},[ke.CustomInstrumentation]:({value:a,setValue:i,formErrors:l})=>{const s=l.customInstrumentations,c=r(()=>(a?.customInstrumentations?.[Te.Golang]||[]).map(e=>new we(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[a]),d=r(()=>(a?.customInstrumentations?.[Te.Java]||[]).map(e=>new xe(e.className,e.methodName)),[a]);return n(()=>{a?.customInstrumentations||s||i("customInstrumentations",{[Te.Golang]:ts[Te.Golang],[Te.Java]:ts[Te.Java]})},[]),e(o,{children:[e(V,{children:[e(Z,{$gap:8,children:[t(ri,{}),t(U,{label:"Golang custom probes"})]}),t(W,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Te.Golang]=e.map(e=>new we(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Te.Java]=d,i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(V,{children:[e(Z,{$gap:8,children:[t(ci,{}),t(U,{label:"Java custom probes"})]}),t(W,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Te.Golang]=c,t[Te.Java]=e.map(e=>new xe(e.className,e.methodName)),i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[ke.HeadersCollection]:({value:e,setValue:o,formErrors:a})=>{const i=a.headersCollection,l=r(()=>e?.headersCollection?.[Ce.HeaderKeys]||[],[e]),s=e=>{const t={[Ce.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{l.length||i||s(Ql)},[]),t(J,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:l,setValues:s,errorMessage:i})},[ke.PayloadCollection]:({value:o,setValue:a,formErrors:i})=>{const l=i.payloadCollection,s=r(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!l){const e={[Se.HttpRequest]:{},[Se.HttpResponse]:{},[Se.DbQuery]:{},[Se.Messaging]:{}};a("payloadCollection",e)}},[]);return e(V,{$gap:12,children:[t(ie,{size:le.XS,color:be.Secondary,nowrap:!0,children:"Type of data to collect"}),t(V,{$gap:6,children:es.map(({id:e,label:o,tooltip:n})=>t(ye,{text:n,withIcon:!0,children:t(H,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Se.HttpRequest]:o.includes(Se.HttpRequest)?{}:null,[Se.HttpResponse]:o.includes(Se.HttpResponse)?{}:null,[Se.DbQuery]:o.includes(Se.DbQuery)?{}:null,[Se.Messaging]:o.includes(Se.Messaging)?{}:null};a("payloadCollection",n)})(e,t)})},e))}),t(j,{errorMessage:l})]})},[ke.UnknownType]:null},ns=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=os[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},as=()=>{const o=f(),{selectedOption:n,genericForm:a}=Cl();if(!a||!n)return t(ae,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(Z,{$gap:12,$justifyContent:"space-between",children:[t(ie,{size:le.XXS,children:n.docsDescription}),t(Q,{label:"Docs",leftIcon:ni,variant:te.Text,size:ee.S,onClick:()=>window.open(`${se}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),e(Z,{$gap:12,children:[t(ie,{size:le.XS,color:be.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Ie,{label:$e[e],leftIcon:Ee(e),status:pe.Default,useSecondaryTone:!0},e))]}),t(re,{options:[{icon:ai,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ii,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(oe,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:i.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:s.ruleName}),t(ns,{ruleType:n.type,value:i,setValue:(e,t)=>l(e,t),formErrors:s}),t(ce,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},is=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Sl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Ne,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Oe.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:te.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:te.Secondary,onClick:n}})},ls=({autoFocus:o})=>{const{dataStreams:n}=Ae(),{genericForm:a,excludeName:i,editingName:l}=Sl(),{formData:s,formErrors:c,handleFormChange:d}=a,u=s.name,p=r(()=>n.find(e=>e.name===u&&e.name!==i),[n,u,i]);return e(V,{$width:"100%",$gap:12,children:[t(oe,{name:"data-stream-name",label:Oe.STREAM_NAME,placeholder:Oe.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Oe.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(ue,{status:pe.Warning,message:Oe.DATA_STREAM_MERGE_WARNING(l,p.name),fullWidth:!0})]})},ss=()=>{const{selectedStreamName:e}=Ae(),{genericForm:o}=wl();if(!o)return t(ae,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(oe,{name:"sourceName",label:Oe.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},rs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],cs=m.div`
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
gap: 24px;
|
|
16
|
-
`,
|
|
16
|
+
`,ds=m.div`
|
|
17
17
|
display: contents;
|
|
18
18
|
& > * {
|
|
19
19
|
opacity: ${({$faded:e})=>e?.4:1};
|
|
20
20
|
transition: opacity 0.2s ease;
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,us=({value:e})=>{const o=f();return t(Ie,e?{status:pe.Success,label:Be,leftIcon:ai}:{label:ze,leftIcon:ii,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},ps=({value:e,onChange:o})=>{const n=f(),a=r(()=>[{icon:ai,label:Be,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:ii,label:ze,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(re,{options:a,selected:e,setSelected:o??(()=>{}),disabled:!o})},hs=()=>{const e=xl();switch(e.formType){case Tl.Create:return t(gs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(ps,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Tl.View:return e.data?e.isEditing?t(gs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(ps,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(ms,{data:e.data,renderAction:()=>t(us,{value:!e.data?.rule.disabled})}):null;case Tl.EditAutoNoisy:return t(fs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:_e,sectionTitle:Pe,sectionSubTitle:Le,presetLabel:Re,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(ps,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Tl.EditAutoCostReduction:return t(fs,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Fe,sectionTitle:Pe,presetLabel:Re,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(ps,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Tl.EditAutoHighlyRelevant:return t(cs,{children:t(tl,{title:e.localEnabled?void 0:De,summary:e.summary,renderAction:()=>t(ps,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},gs=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:s})=>e(cs,{children:[t(al,{category:o,formState:n,renderAction:s}),e(ds,{$faded:!!n.disabled,children:[t(il,{category:o,formState:n,onChange:a}),t(ll,{formState:n,onChange:a,sourceOptions:i,namespaceOptions:l}),t(sl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(rl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(cl,{ruleType:n.ruleType,formState:n,onChange:a}),t(dl,{category:o,formState:n,onChange:a})]})]}),ms=({data:o,renderAction:n})=>e(cs,{children:[t(al,{readOnly:!0,summary:o.summary,renderAction:n}),t(il,{readOnly:!0,data:o}),t(ll,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(sl,{readOnly:!0,data:o}),t(dl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(cl,{readOnly:!0,rule:o.rule})]}),fs=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:l,presetLabel:s,customInputName:r,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:g,customPercentage:m,setCustomPercentage:f,renderAction:b})=>{const v=c(e=>p(e),[p]),y=c(e=>g(e),[g]),C=c(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(cs,{children:[t(tl,{title:o?void 0:a,summary:n,renderAction:b}),t(ds,{$faded:!o,children:e(Me,{richTitle:{title:i,subTitle:l},children:[d&&t(V,{$alignItems:"flex-start",children:t(re,{options:rs,selected:u,setSelected:v})}),S&&t(ol,{description:s,options:nl,selected:h,onSelect:y,customName:r,customLabel:Xe,customPlaceholder:"5%",customValue:m,onCustomChange:C})]})})]})},bs=m.div`
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
25
25
|
justify-content: space-between;
|
|
@@ -32,32 +32,27 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
32
32
|
&:hover {
|
|
33
33
|
background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>e?t?o.v2.colors.purple[700]:o.v2.colors.silver[600]:t?o.v2.colors.purple[800]:o.v2.colors.silver[700]};
|
|
34
34
|
}
|
|
35
|
-
`,
|
|
35
|
+
`,vs=m.div`
|
|
36
36
|
display: flex;
|
|
37
37
|
align-items: center;
|
|
38
38
|
justify-content: center;
|
|
39
39
|
padding: 8px;
|
|
40
40
|
border-radius: 8px;
|
|
41
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
42
|
-
`,
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
gap: 8px;
|
|
46
|
-
padding: 8px;
|
|
47
|
-
`,Ns=({onClose:o,selectedConnectionIds:n,setSelectedConnectionIds:a,createAction:i,withOverlay:s})=>{const[c,u]=l(""),p=d(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=Sl(),b=r(()=>(c?We.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):We).filter(e=>!!e),[c]),v=r(()=>(c?Ge.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):Ge).filter(e=>!!e),[c]),y=r(()=>{const o=(o,n)=>e($s,{children:[t(re,{size:ce.XS,color:Ce.Secondary,children:o}),t(Ee,{label:n.toString()})]},o),n=e=>{const o=h?.type===e.type;return t(Ts,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{p.current?.clearErrors(),m(e)}},e.type)};return[o("Attributes",b.length),...b.map(n),o("Samplers",v.length),...v.map(n)]},[h?.type,b.length,v.length,m]),C=r(()=>h?[t(Ql,{},h.type)]:[t(Ke,{$height:"100%",children:t(se,{icon:mi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[h]);return t(ml,{ref:p,isOpen:!0,withOverlay:s,onClose:o,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=f();return!e&&await i(t)},disableSave:!h||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Re.CREATING_ACTION,subTitle:Re.CREATING_ACTION_SUBTITLE},header:{icon:mi,title:Re.ADD_ACTION,subTitle:Re.ADD_ACTION_DESCRIPTION},connectionIds:n&&a?{value:n,setValue:a}:void 0,search:{value:c,onChange:u},leftColumn:{width:"40%",list:y},rightColumn:{width:"60%",list:C}})},Is=({destinationsByCategory:n,filters:a,setFilters:i})=>{const l=r(()=>Object.values(Ye).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=r(()=>{const e=Object.values(fe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(Je,{placeholder:"Select category",options:l,values:a.categoryType?[a.categoryType]:[],setValues:e=>i({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(ue,{options:s,selected:a.signalType,setSelected:e=>i({...a,signalType:e})})]})},Es=g.div`
|
|
41
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+Ve["004"]};
|
|
42
|
+
`,ys=({dataId:o,icon:n,title:a,description:i,withCarret:l,purpleColors:s,disabled:r,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:g})=>e(bs,{"data-id":o||`list-item-${a}`,$isSelected:d,$purpleColors:s,$disabled:r,onClick:()=>!d&&!r&&u(),children:[e(V,{$gap:4,children:[e(Z,{$gap:12,children:[g&&t(H,{partiallyChecked:h||!1,value:p||!1,onChange:e=>g(e)}),n&&t(vs,{children:t(n,{size:20})}),t(ie,{size:le.XS,children:a})]}),i&&t(ie,{size:le.XXXS,color:be.Secondary,children:i})]}),(l||c)&&e(Z,{$gap:8,children:[c,l&&t(di,{size:18})]})]}),Cs=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createAction:a,withOverlay:i})=>{const[s,c]=l(""),u=d(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=vl(),f=r(()=>(s?Ue.filter(e=>e?.label?.toLowerCase().includes(s.toLowerCase())):Ue).filter(e=>!!e),[s]),b=r(()=>f.map(e=>{const o=p?.type===e.type;return t(ys,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p?.type,f.length,h]),v=r(()=>p?[t(Gl,{},p.type)]:[t(He,{$height:"100%",children:t(ae,{icon:ui,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(ul,{ref:u,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await a(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Oe.CREATING_ACTION,subTitle:Oe.CREATING_ACTION_SUBTITLE},header:{icon:ui,title:Oe.ADD_ACTION,subTitle:Oe.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:s,onChange:c},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Ss=({destinationsByCategory:n,filters:a,setFilters:i})=>{const l=r(()=>Object.values(je).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=r(()=>{const e=Object.values(he).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(We,{placeholder:"Select category",options:l,values:a.categoryType?[a.categoryType]:[],setValues:e=>i({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(re,{options:s,selected:a.signalType,setSelected:e=>i({...a,signalType:e})})]})},ws=m.div`
|
|
48
43
|
display: flex;
|
|
49
44
|
flex-direction: column;
|
|
50
45
|
padding: 8px;
|
|
51
46
|
border-radius: 16px;
|
|
52
47
|
border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
|
|
53
48
|
background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
|
|
54
|
-
`,
|
|
49
|
+
`,xs=m.div`
|
|
55
50
|
display: flex;
|
|
56
51
|
align-items: center;
|
|
57
52
|
justify-content: space-between;
|
|
58
53
|
gap: 12px;
|
|
59
54
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
60
|
-
`,
|
|
55
|
+
`,Ts=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:s})=>{const[r,c]=l(!0);return e(ws,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:s,children:[e(xs,{$isOpen:r,children:[e(Z,{$gap:10,children:[t(ie,{size:le.XS,children:o}),n&&t(ye,{text:n,withIcon:!0}),t(Ie,{label:a.length,status:s?pe.Default:void 0})]}),t(Ge,{icon:r?hi:gi,size:Ke.M,onClick:()=>c(e=>!e)})]}),r?t(V,{children:a.length?u.toArray(a):t(He,{$padding:"12px 0",children:t(ae,{})})}):null]})},ks=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||me(e.supportedSignals).includes(o.signalType))):e,Is=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(ys,{icon:qe(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Ie,{status:n.succeeded?pe.Success:pe.Error,leftIcon:n.succeeded?mi:fi})}),$s=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=yl();return o?.length?t(Ts,{title:Je[e].TITLE,tooltip:Je[e].DESCRIPTION,list:o.map((o,n)=>t(Is,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(Ts,{purpleColors:!0,title:Je[e].TITLE,tooltip:Je[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},s)=>t(Is,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===s&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:s})},`${e}-${s}`))},e):void 0};var Es;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(Es||(Es={}));const Ns=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Es.SELF_HOSTED?n.push(...e.items):e.name===Es.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=Ze(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=Qe(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[je.DETECTED]:o,[je.SELF_HOSTED]:n,[je.MANAGED]:a}},Os=({onClose:e,onBack:o,onNext:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getDestinationCategories:d,getPotentialDestinations:u,initialInputs:p,testConnection:h,createDestination:g,updateDestination:m,withOverlay:f,disableAnimation:b})=>{const[v,y]=l(""),[C,S]=l({categoryType:null,signalType:null}),{destinations:w}=et(),{activeForm:x,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:I}=yl();n(()=>{p&&I(p)},[p]);const[$,E]=l(!0),[N,O]=l([]),[A,D]=l({[je.ALL]:[],[je.UNSAVED]:[],[je.EXISTS]:[],[je.DETECTED]:[],[je.SELF_HOSTED]:[],[je.MANAGED]:[]});n(()=>{const e=w.map(e=>{let t;for(const o of N){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=Qe(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});D(t=>({...t,[je.EXISTS]:e}))},[w,N]);const R=c(async()=>{try{E(!0);const[e,t]=await Promise.all([d(),u()]);e&&O(e.destinationCategories.categories),D(o=>({...o,...Ns(e,t)}))}catch(e){}finally{E(!1)}},[]);n(()=>{R()},[]);const P=c(async()=>{const e=(await Promise.all(k.map(({option:e,formData:t})=>{const o=fe(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e]))return m(e.id,o,i)}return g(o,i)}))).filter(e=>e?.error);if(e.length)return{error:e.map(e=>e?.error).join("\n")}},[k,i,g,m]),F=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:a})=>{const{unsavedDestinations:i}=yl();return{width:"40%",list:r(()=>{const l=[];i.length&&l.push(t($s,{listType:je.UNSAVED,unsavedDestinations:i},"unsaved"));for(const e of Object.values(je)){if(a.categoryType&&a.categoryType!==e)continue;const i=ks(o[e],n,a);i.length&&l.push(t($s,{listType:e,destinationOptions:i},e))}return e&&l.push(t(He,{$height:"100%",children:t(Ye,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),l},[i,o,n,a,e])}})({isFetching:$,destinationsByCategory:A,searchText:v,filters:C}),L=(({testConnection:e})=>{const{activeForm:o}=yl();return{width:"60%",list:o?[t(Jl,{testConnection:e},o.option.type)]:[t(He,{$height:"100%",children:t(ae,{icon:pi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(ul,{isOpen:!0,withOverlay:f,disableAnimation:b,onClose:e,onBack:o?()=>o(k):void 0,onNext:a?()=>a(k):void 0,nextIsSkip:!k.length,onSave:P,disableSave:!x&&!k.length,isFetching:$,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:Oe.CREATING_DESTINATION,subTitle:Oe.CREATING_DESTINATION_SUBTITLE},header:{icon:pi,title:Oe.ADD_DESTINATIONS,subTitle:Oe.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:i&&s?{value:i,setValue:s}:void 0,search:{value:v,onChange:y},filters:t(Ss,{destinationsByCategory:A,filters:C,setFilters:S}),leftColumn:F,rightColumn:L})},As=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createInstrumentationRule:a,withOverlay:i})=>{const[s,c]=l(""),u=d(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=Cl(),f=r(()=>s?tt.filter(e=>e.label.toLowerCase().includes(s.toLowerCase())):tt,[s]),b=r(()=>f.map(e=>{const o=p?.type===e.type;return t(ys,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=r(()=>p?[t(as,{},p.type)]:[t(He,{$height:"100%",children:t(ae,{icon:bi,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(ul,{ref:u,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await a(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Oe.CREATING_INSTRUMENTATION_RULE,subTitle:Oe.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:bi,title:Oe.ADD_INSTRUMENTATION_RULE,subTitle:Oe.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:s,onChange:c},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Ds={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Oe.FETCHING_NAMESPACES,subTitle:Oe.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:Oe.SELECT_NAMESPACE,subTitle:Oe.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Rs={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===ot.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"},Ps=e=>e?Rs:Ds,Fs="No matches",Ls="No sources",_s=e=>`No sources matched the filter '${e}'`,Bs=e=>(e?"Unselect":"Select")+" all",zs="Show only:",Ms="Selected",Xs="Auto",Vs="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Us="Enterprise only",Hs=m.div``,js=m.div`
|
|
61
56
|
visibility: hidden;
|
|
62
57
|
|
|
63
58
|
transition: visibility 0s;
|
|
@@ -65,19 +60,19 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
65
60
|
transition-duration: 0s;
|
|
66
61
|
}
|
|
67
62
|
|
|
68
|
-
${
|
|
63
|
+
${Hs}:hover & {
|
|
69
64
|
visibility: visible;
|
|
70
65
|
}
|
|
71
|
-
`,
|
|
66
|
+
`,Ws=({workloadName:e,workloadKind:o,isChecked:n,onToggle:a,disabled:i,disabledReason:l})=>{const s=f(),r=()=>{};return t(Hs,{children:t(ys,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?r:a,isChecked:n,onCheckboxChange:i?r:a,children:i&&l?t(Ie,{label:l,status:pe.Default,textSize:le.XXXS}):t(js,{children:t(Ie,{label:o,status:pe.Info,textSize:le.XXXS,backgroundColor:s.v2.colors.blue[900]})})})})},Gs=m.div``,Ks=m.div`
|
|
72
67
|
visibility: ${({$visible:e})=>e?"visible":"hidden"};
|
|
73
68
|
|
|
74
69
|
transition: visibility 0s;
|
|
75
70
|
${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
|
|
76
71
|
|
|
77
|
-
${
|
|
72
|
+
${Gs}:hover & {
|
|
78
73
|
visibility: visible;
|
|
79
74
|
}
|
|
80
|
-
`,or=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(er,{children:t(Ts,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(te,{$gap:12,children:[!d&&t(tr,{$visible:s||i,children:t(we,{text:Ys,children:t(q,{label:Ks,labelAlign:Z.Left,size:ct.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(te,{$gap:8,children:[t(re,{variant:dt.Span,size:ce.XXXS,color:Ce.Secondary,align:"right",children:Gs}),t(Ee,{label:`${l.sourced}/${l.total}`,status:s?ge.Default:st.Unknown,minWidth:"42px"})]})]})})})},nr=({withCollapse:e,clusterId:o,clusterName:n,namespaces:a,selectedArea:i,setSelectedArea:l,handleSourceChange:s})=>{const c=r(()=>a.map(({name:e,totalWorkloads:a,selectedCount:r,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(or,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:r,total:a},isActive:i.clusterId===o&&i.namespaceName===e,onActive:()=>l({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,a,i]);return e?t(As,{title:n,list:c,noBgColor:!0}):c},ar=({onClose:o,onBack:a,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:m})=>{const{isVm:g}=y(),f=Xs(g),{selectedStreamName:b}=Fe(),{progress:v,resetProgress:C}=ut(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:k,handleSourceChange:T,handleSelectAll:$,formDiff:N,isFormDirty:I}=Dl();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:mt,clusterName:ht,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:e.markedForInstrumentation?.markedForInstrumentation??!1}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[E,O]=l(""),[A,D]=l(lt.Namespace),[R,F]=l({showOnlySelected:!1}),[P,L]=l({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:a,handleSelectAll:i,selectedArea:l,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=Xs(p),m=r(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ol(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Al(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),g=r(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=r(()=>{const e=m.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(nr,{withCollapse:m.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:l,setSelectedArea:s,handleSourceChange:a},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[m,l]);return{width:"60%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,nowrap:!0,children:h.groupColumnHeader}),t(we,{text:b?Re.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ee,{label:`${b?`${v} / ${C}`:C}`,status:st.Unknown})})]}),t(re,{"data-id":"namespaces-select-all",onClick:()=>i({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:ce.XS,children:js(g)})]}),list:f.length?f:o?[t(Ke,{$height:"100%",children:t(Qe,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(Ke,{$height:"100%",children:t(se,c?{icon:wi,title:Vs,subTitle:h.noGroupMatchedFilter(c)}:{icon:wi,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:P,setSelectedArea:L,searchText:A===lt.Namespace?E:"",searchBy:A,filters:R}),M=(({formData:o,handleSourceChange:n,handleSelectAll:a,selectedArea:i,searchText:l,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=Xs(u),h=d===rt.Onprem,m=r(()=>i.value.namespaceName?o.find(({clusterId:e})=>e===i.value.clusterId)?.namespaces.find(({name:e})=>e===i.value.namespaceName):void 0,[o,i.value.clusterId,i.value.namespaceName]),g=r(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Il(e,l,c)):[],[m,l,c]),f=r(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=r(()=>{if(!m)return[];const{clusterId:e}=i.value,{name:o}=m;return g.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&El.has(l);return t(Qs,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:s,disabledReason:Js},`${e}#${o}#${a}#${l}`)})},[g,m,i.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=r(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,nowrap:!0,children:i.value.namespaceName?`${i.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(we,{text:v?Re.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ee,{label:`${v?`${C} / ${S}`:S}`,status:st.Unknown})})]}),t(re,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:i.value.clusterId,namespaceName:i.value.namespaceName,boolean:!f,searchText:l,searchBy:s,filters:c}),disabled:!b.length,size:ce.XS,children:js(f)})]}),list:b.length?b:[t(Ke,{$height:"100%",children:t(se,m?l?{icon:Si,title:Vs,subTitle:Hs(l)}:{icon:Si,title:Us,subTitle:p.noItemsInGroupSubTitle}:{icon:Si,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:{value:P},searchText:A===lt.Source?E:"",searchBy:A,filters:R});return t(ml,{isOpen:!0,withOverlay:h,disableAnimation:m,onClose:o?()=>{C(pt.BulkInstrumenting),o()}:void 0,onBack:a?()=>a(N):void 0,onNext:i?()=>i(N):void 0,nextIsSkip:!I,onSave:()=>d(N),header:{icon:Si,title:Re.ADD_SOURCE,subTitle:Re.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:E,onChange:e=>{O(e),A===lt.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(A),segment:{options:[{label:f.groupSegmentLabel,value:lt.Namespace},{label:f.itemSegmentLabel,value:lt.Source}],selected:A,setSelected:D}},filters:e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:Ws}),t(q,{name:"filter-selected",size:ct.S,label:Gs,value:R.showOnlySelected,onChange:e=>F(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:S,progress:{title:Re.CREATING_SOURCES,subTitle:Re.CREATING_SOURCES_SUBTITLE,percentage:v[pt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:M})},ir=({onClose:a,actionId:i,updateAction:s,deleteAction:d})=>{const u=f(),{actions:p}=at(),{selectedOption:h,loadAction:m,validateFormData:g,genericForm:b}=Sl(),[v,y]=l(!1),[C,S]=l(!1),[w,x]=l(null),k=v&&!!b?.isFormDirty,T=r(()=>p?.find(e=>gt(e)===i),[i,p]),$=r(()=>We.find(({type:e})=>e===T?.type)??Ge.find(({type:e})=>e===T?.type)??null,[T?.type]);n(()=>{T&&m(T)},[T]);const N=c(()=>{T&&y(!0)},[T]),I=c(()=>{T&&(m(T),y(!1))},[T,m]),E=c(()=>{k?x("close"):a()},[k,a]),O=c(()=>{k?x("cancel"):I()},[k,I]),A=c(()=>{const e=w;x(null),"close"===e?(I(),a()):I()},[w,I,a]),D=c(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=g();e||(await s(T.id,t),y(!1))}},[T,g,s]),R=c(()=>{T&&S(!0)},[T]),F=c(async()=>{T&&(await d(T.id,T.type),a())},[T,d,a]);if(!T||!$)return null;const P=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?ge.Success:st.Unknown,label:e?"True":"False",invertColors:!0});return o===le.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||J.Pod,r=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||J.Pod,r=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),o===le.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===le.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===le.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===le.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===le.ErrorSampler&&t.push({id:"fallbackSamplingRatio",title:"Sampling Ratio",label:String(n.fallbackSamplingRatio??"-")}),o===le.ProbabilisticSampler&&t.push({id:"samplingPercentage",title:"Sampling Percentage",label:String(n.samplingPercentage??"-")}),o===le.LatencySampler&&n.endpointsFilters?.forEach(({serviceName:e,httpRoute:o,minimumLatencyThreshold:a,fallbackSamplingRatio:i},l)=>{const s=(n.endpointsFilters?.length??0)>1?`Endpoint #${l+1} `:"Endpoint ";t.push({id:`endpoint-${l}-service`,title:`${s}Service Name`,label:e}),t.push({id:`endpoint-${l}-route`,title:`${s}HTTP Route`,label:o}),t.push({id:`endpoint-${l}-latency`,title:`${s}Min. Latency`,label:String(a)}),t.push({id:`endpoint-${l}-fallback`,title:`${s}Fallback Sampling Ratio`,label:String(i)})}),o===le.ServiceNameSampler&&n.servicesNameFilters?.forEach(({serviceName:e,samplingRatio:o,fallbackSamplingRatio:a},i)=>{const l=(n.servicesNameFilters?.length??0)>1?`Filter #${i+1} `:"Filter ";t.push({id:`service-${i}-name`,title:`${l}Service Name`,label:e}),t.push({id:`service-${i}-ratio`,title:`${l}Sampling Ratio`,label:String(o)}),t.push({id:`service-${i}-fallback`,title:`${l}Fallback Sampling Ratio`,label:String(a)})}),o===le.SpanAttributeSampler&&n.attributeFilters?.forEach(({serviceName:e,attributeKey:o,fallbackSamplingRatio:a,condition:i},l)=>{const s=Object.keys(i)[0],r=i[s],c=(n.attributeFilters?.length??0)>1?`Filter #${l+1} `:"Filter ";t.push({id:`attr-${l}-service`,title:`${c}Service Name`,label:e}),t.push({id:`attr-${l}-key`,title:`${c}Attribute Key`,label:o}),t.push({id:`attr-${l}-fallback`,title:`${c}Fallback Sampling Ratio`,label:String(a)}),t.push({id:`attr-${l}-condition`,title:`${c}Condition`,label:s}),t.push({id:`attr-${l}-operation`,title:`${c}Operation`,label:r?.operation??"-"}),t.push({id:`attr-${l}-expected`,title:`${c}Expected Value`,label:String(r?.expectedValue??"-")}),"jsonCondition"===s&&t.push({id:`attr-${l}-jsonpath`,title:`${c}JSON Path`,label:r?.jsonPath??"-"})}),o===le.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:St(T.type),title:$.label,onClose:E,actions:[{id:"edit-action-btn-edit",label:bt.EDIT,icon:di,active:v,onClick:N},{id:"edit-action-btn-delete",label:bt.DELETE,icon:ai,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:O},{"data-id":"edit-action-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:D}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:v&&h?t(Ql,{}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[t(Ct,{conditions:T.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(L=T,_=$,[{id:"type",title:Re.TYPE,label:_.label},{id:"status",title:Re.STATUS,badge:{status:L.disabled?st.Unknown:ge.Success,label:L.disabled?Re.DISABLED:Re.ENABLED}},{id:"signals",title:Re.SIGNALS_FOR_PROCESSING,label:L.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:Re.NAME,label:L.name||"-"},{id:"notes",title:Re.NOTES,label:L.notes||"-"}])})]}),!!P?.length&&t(yt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",cellsPerRow:2,items:P})})]})})})}),t(gl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:F}),t(fl,{isOpen:null!==w,onClose:()=>x(null),onApprove:A})]});var L,_},lr=({onClose:o,connections:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=l(""),[h,m]=l({showOnlySelected:!1}),g=r(()=>a.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&i.includes(e.id);return t&&o}),[a.length,i.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=l(!1),[y,C]=l(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=wt(y||{rollout:{automaticRolloutDisabled:!1}}),T=r(()=>i.length>1||void 0!==y&&!x(y,S),[i.length,y,S]);return n(()=>{1===i.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),k(e)}v(!1)})(i[0]):C(void 0)},[i.length]),t(ml,{isOpen:!0,onClose:o,onSave:()=>d(S,i),header:{icon:xi,title:"Cluster Configuration"},connectionIds:{value:i,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:"Show only:"}),t(q,{size:ct.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:b,leftColumn:{width:"35%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,children:"Clusters"}),t(Ee,{label:g.length,status:st.Unknown})]}),e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,align:"right",children:"Selected clusters"}),t(Ee,{label:`${i.length}/${g.length}`,status:st.Unknown})]})]}),list:g.map(e=>t(Ts,{title:e.name,isChecked:i.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(re,{size:ce.XS,children:"Configurations"}),list:[t(q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},sr=({onClose:a,destinationId:i,getDestinationCategories:s,testConnection:u,updateDestination:p,deleteDestination:h})=>{const m=f(),{isVm:g}=y(),{destinations:b}=at(),{selectedStreamName:v}=Fe(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=wl(),k=d(null),[T,$]=l(!1),[N,I]=l(!1),[E,O]=l(null),[A,D]=l(!0),[R,F]=l(null),P=T&&!!x?.isFormDirty,L=r(()=>kt(b,v),[b,v]),_=r(()=>L?.find(e=>gt(e)===i),[i,L]);n(()=>{let e=!1;return D(!0),s().then(t=>{e||O(t?.destinationCategories.categories??[])}).catch(t=>{e||O([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&E&&S(_,E)},[_,E]);const M=r(()=>_&&E?Tt(E,_):[],[_,E]),B=c(()=>{_&&$(!0)},[_]),z=c(()=>{_&&E&&(S(_,E),$(!1))},[_,E,S]),X=c(()=>{P?F("close"):a()},[P,a]),U=c(()=>{P?F("cancel"):z()},[P,z]),H=c(()=>{const e=R;F(null),"close"===e?(z(),a()):z()},[R,z,a]),j=c(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,ye(t)),$(!1))}},[_,w,p]),W=c(()=>{_&&I(!0)},[_]),G=c(async()=>{_&&(await h(_.id),a())},[_,h,a]);if(!_)return null;const{icon:K,iconSrc:Y}=tt(_.destinationType.type),J=((e,t)=>{const o=[],n=xt(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=be(e.exportedSignals);let l=[];const s=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&he(h,i,a))return;const{type:g}=nt(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...o},n)=>{t==r&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(r)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===ie.MultiInput){const t=nt(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===ie.KeyValuePair){const t=nt(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:r})}else l.push({id:e,title:n,label:"-"})}),s(),o})(_,M);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:bt.EDIT,icon:di,active:T,onClick:B},{id:"edit-destination-btn-delete",label:bt.DELETE,icon:ai,color:m.v2.colors.red[500],active:N,onClick:W}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:U},...C?.option.testConnectionSupported&&!g?[{"data-id":"edit-destination-btn-test-connection",label:bt.TEST_CONNECTION,variant:ae.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:j}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:A?t(Ke,{$height:"50vh",children:t(Qe,{withSpinner:!0})}):T&&C?t(os,{ref:k,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[!g&&t(Ct,{conditions:_.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(q=_,[{id:"type",title:Re.TYPE,label:q.destinationType.displayName},{id:"status",title:Re.STATUS,badge:{status:q.disabled?st.Unknown:ge.Success,label:q.disabled?Re.DISABLED:Re.ENABLED}},{id:"monitors",title:Re.MONITORS,label:be(q.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:Re.NAME,label:q.name||"-"}])})]}),!!J.length&&t(yt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(yt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(yt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(gl,{target:"destination",isOpen:N,onClose:()=>I(!1),onApprove:G}),t(fl,{isOpen:null!==R,onClose:()=>F(null),onApprove:H})]});var q},rr=({onClose:a,ruleId:i,updateInstrumentationRule:s,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=at(),{addNotification:h}=Nt(),{selectedOption:m,loadRule:g,validateFormData:b,genericForm:v}=xl(),[y,C]=l(!1),[S,w]=l(!1),[x,k]=l(null),T=y&&!!v?.isFormDirty,$=r(()=>p?.find(e=>gt(e)===i),[i,p]),N=r(()=>it.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&g($)},[$]);const I=c(()=>{if($){if(!$.mutable)return void h({type:ge.Warning,title:It.FORBIDDEN,message:It.CANNOT_EDIT_RULE,crdType:lt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,h]),E=c(()=>{$&&(g($),C(!1))},[$,g]),O=c(()=>{T?k("close"):a()},[T,a]),A=c(()=>{T?k("cancel"):E()},[T,E]),D=c(()=>{const e=x;k(null),"close"===e?(E(),a()):E()},[x,E,a]),R=c(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await s($.ruleId,t),C(!1))}},[$,b,s]),F=c(()=>{if($){if(!$.mutable)return void h({type:ge.Warning,title:It.FORBIDDEN,message:It.CANNOT_DELETE_RULE,crdType:lt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,h]),P=c(async()=>{$&&(await d($.ruleId),a())},[$,d,a]);if(!$||!N)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(re,{size:ce.XS,children:`• ${$t(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(re,{size:ce.XS,children:`• ${$t(e).toLowerCase()}`},e))}),e.headersCollection?.[xe.HeaderKeys]?.length&&e.headersCollection[xe.HeaderKeys].forEach(e=>{e&&n.push(t(re,{size:ce.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Ne.Java]?.forEach((e,a)=>{const i=new $e(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(re,{size:ce.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(re,{size:ce.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Ne.Golang]?.forEach((e,a)=>{const i=new Te(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(re,{size:ce.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(re,{size:ce.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})($,u);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:Ot($.type),title:N.label,onClose:O,actions:[{id:"edit-rule-btn-edit",label:bt.EDIT,icon:di,active:y,onClick:I},{id:"edit-rule-btn-delete",label:bt.DELETE,icon:ai,color:u.v2.colors.red[500],active:S,onClick:F}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:A},{"data-id":"edit-rule-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:R}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:y&&m?t(ds,{}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[t(Ct,{conditions:$.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(_=$,M=N,[{id:"type",title:Re.TYPE,label:M.label},{id:"status",title:Re.STATUS,badge:{status:_.disabled?st.Unknown:ge.Success,label:_.disabled?Re.DISABLED:Re.ENABLED}},{id:"name",title:Re.NAME,label:_.ruleName||"-"},{id:"profile",title:Re.MANAGED_BY_PROFILE,label:_.profileName||"-"},{id:"notes",title:Re.NOTES,label:_.notes||"-"}])})]}),!!L.length&&t(yt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",children:L})}),!!N.supportedLanguages.length&&t(yt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",children:t(te,{$gap:12,$wrap:"wrap",children:N.supportedLanguages.map(e=>t(Et,{label:Oe[e],leftIcon:Ae(e),flex:"0.5"},e))})})})]})})})}),t(gl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:P}),t(fl,{isOpen:null!==x,onClose:()=>k(null),onApprove:D})]});var _,M};var cr;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(cr||(cr={}));const dr=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:a,podName:i,nodeName:l,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=At(),m=Dt(!!o),g=r(()=>({title:i,icon:ki,withCopy:!0}),[i]),f=r(()=>{const e=[],t=Rt(c);t&&e.push(t);const o=Rt(d,Ti,"health");o&&e.push(o);const n=Rt(u,$i,"health");return n&&e.push(n),e},[c,d,u]),b=r(()=>n?[{id:`restart-pod-${i}`,icon:Ni,label:bt.RESTART_POD,onClick:()=>n(a,i)}]:void 0,[n,a,i]),v=r(()=>[{id:"nodeName",title:Re.NODE,label:l,withCopy:!0},{id:"age",title:Re.AGE,label:s?h(s,{style:"short"}):Re.NOT_RUNNING,labelTooltip:s}],[l,s,h]);return t("div",{ref:m,children:t(yt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},ur=g.div`
|
|
75
|
+
`,Ys=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Gs,{children:t(ys,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(Z,{$gap:12,children:[!d&&t(Ks,{$visible:s||i,children:t(ye,{text:Vs,children:t(K,{label:Xs,labelAlign:Y.Left,size:it.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(Z,{$gap:8,children:[t(ie,{variant:lt.Span,size:le.XXXS,color:be.Secondary,align:"right",children:Ms}),t(Ie,{label:`${l.sourced}/${l.total}`,status:s?pe.Default:nt.Unknown,minWidth:"42px"})]})]})})})},Js=({withCollapse:e,clusterId:o,clusterName:n,namespaces:a,selectedArea:i,setSelectedArea:l,handleSourceChange:s})=>{const c=r(()=>a.map(({name:e,totalWorkloads:a,selectedCount:r,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Ys,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:r,total:a},isActive:i.clusterId===o&&i.namespaceName===e,onActive:()=>l({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,a,i]);return e?t(Ts,{title:n,list:c,noBgColor:!0}):c},qs=({onClose:o,onBack:a,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:g})=>{const{isVm:m}=y(),f=Ps(m),{selectedStreamName:b}=Ae(),{progress:v,resetProgress:C}=st(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:T,handleSourceChange:k,handleSelectAll:I,formDiff:$,isFormDirty:E}=Nl();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:dt,clusterName:ct,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:e.markedForInstrumentation?.markedForInstrumentation??!1}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[N,O]=l(""),[A,D]=l(ot.Namespace),[R,P]=l({showOnlySelected:!1}),[F,L]=l({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:a,handleSelectAll:i,selectedArea:l,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=Ps(p),g=r(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>$l(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...El(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=r(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=r(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(Js,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:l,setSelectedArea:s,handleSourceChange:a},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,l]);return{width:"60%",header:e(Z,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(Z,{$gap:8,children:[t(ie,{size:le.XS,nowrap:!0,children:h.groupColumnHeader}),t(ye,{text:b?Oe.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ie,{label:`${b?`${v} / ${C}`:C}`,status:nt.Unknown})})]}),t(ie,{"data-id":"namespaces-select-all",onClick:()=>i({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:le.XS,children:Bs(m)})]}),list:f.length?f:o?[t(He,{$height:"100%",children:t(Ye,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(He,{$height:"100%",children:t(ae,c?{icon:yi,title:Fs,subTitle:h.noGroupMatchedFilter(c)}:{icon:yi,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:T,handleSourceChange:k,handleSelectAll:I,selectedArea:F,setSelectedArea:L,searchText:A===ot.Namespace?N:"",searchBy:A,filters:R}),B=(({formData:o,handleSourceChange:n,handleSelectAll:a,selectedArea:i,searchText:l,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=Ps(u),h=d===at.Onprem,g=r(()=>i.value.namespaceName?o.find(({clusterId:e})=>e===i.value.clusterId)?.namespaces.find(({name:e})=>e===i.value.namespaceName):void 0,[o,i.value.clusterId,i.value.namespaceName]),m=r(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>kl(e,l,c)):[],[g,l,c]),f=r(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=r(()=>{if(!g)return[];const{clusterId:e}=i.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&Il.has(l);return t(Ws,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:s,disabledReason:Us},`${e}#${o}#${a}#${l}`)})},[m,g,i.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=r(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(Z,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(Z,{$gap:8,children:[t(ie,{size:le.XS,nowrap:!0,children:i.value.namespaceName?`${i.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(ye,{text:v?Oe.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ie,{label:`${v?`${C} / ${S}`:S}`,status:nt.Unknown})})]}),t(ie,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:i.value.clusterId,namespaceName:i.value.namespaceName,boolean:!f,searchText:l,searchBy:s,filters:c}),disabled:!b.length,size:le.XS,children:Bs(f)})]}),list:b.length?b:[t(He,{$height:"100%",children:t(ae,g?l?{icon:vi,title:Fs,subTitle:_s(l)}:{icon:vi,title:Ls,subTitle:p.noItemsInGroupSubTitle}:{icon:vi,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:T,handleSourceChange:k,handleSelectAll:I,selectedArea:{value:F},searchText:A===ot.Source?N:"",searchBy:A,filters:R});return t(ul,{isOpen:!0,withOverlay:h,disableAnimation:g,onClose:o?()=>{C(rt.BulkInstrumenting),o()}:void 0,onBack:a?()=>a($):void 0,onNext:i?()=>i($):void 0,nextIsSkip:!E,onSave:()=>d($),header:{icon:vi,title:Oe.ADD_SOURCE,subTitle:Oe.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:N,onChange:e=>{O(e),A===ot.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(A),segment:{options:[{label:f.groupSegmentLabel,value:ot.Namespace},{label:f.itemSegmentLabel,value:ot.Source}],selected:A,setSelected:D}},filters:e(Z,{$gap:8,children:[t(ie,{size:le.XXXS,color:be.Secondary,nowrap:!0,children:zs}),t(K,{name:"filter-selected",size:it.S,label:Ms,value:R.showOnlySelected,onChange:e=>P(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:S,progress:{title:Oe.CREATING_SOURCES,subTitle:Oe.CREATING_SOURCES_SUBTITLE,percentage:v[rt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:B})},Zs=(e,t)=>{const o=[{id:"type",title:Oe.TYPE,label:t.label},{id:"status",title:Oe.STATUS,badge:{status:e.disabled?nt.Unknown:pe.Success,label:e.disabled?Oe.DISABLED:Oe.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Oe.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Oe.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Oe.NOTES,label:e.notes}),o},Qs=({onClose:a,actionId:i,updateAction:s,deleteAction:d})=>{const u=f(),{actions:p}=et(),{selectedOption:h,loadAction:g,validateFormData:m,genericForm:b}=vl(),[v,y]=l(!1),[C,S]=l(!1),[w,x]=l(null),T=v&&!!b?.isFormDirty,k=r(()=>p?.find(e=>ut(e)===i),[i,p]),I=r(()=>Ue.find(({type:e})=>e===k?.type)??null,[k?.type]);n(()=>{k&&g(k)},[k]);const $=c(()=>{k&&y(!0)},[k]),E=c(()=>{k&&(g(k),y(!1))},[k,g]),N=c(()=>{T?x("close"):a()},[T,a]),O=c(()=>{T?x("cancel"):E()},[T,E]),A=c(()=>{const e=w;x(null),"close"===e?(E(),a()):E()},[w,E,a]),D=c(async()=>{if(k){const{errorMessage:e,preparedFormData:t}=m();e||(await s(k.id,t),y(!1))}},[k,m,s]),R=c(()=>{k&&S(!0)},[k]),P=c(async()=>{k&&(await d(k.id,k.type),a())},[k,d,a]);if(!k||!I)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?pe.Success:nt.Unknown,label:e?"True":"False",invertColors:!0});return o===ne.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||G.Pod,r=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||G.Pod,r=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),o===ne.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ne.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ne.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ne.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ne.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(k);return e(o,{children:[t(pt,{isOpen:!0,header:{icon:bt(k.type),title:I.label,onClose:N,actions:[{id:"edit-action-btn-edit",label:ht.EDIT,icon:si,active:v,onClick:$},{id:"edit-action-btn-delete",label:ht.DELETE,icon:ti,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:ht.CANCEL,variant:te.Secondary,onClick:O},{"data-id":"edit-action-btn-save",label:ht.SAVE,variant:te.Primary,onClick:D}]:[]},children:t(gt,{$padding:"4px 12px 12px",children:v&&h?t(Gl,{}):t(V,{$gap:16,children:e(mt,{bgTint:"1000",children:[e(mt,{bgTint:"900",children:[t(ft,{conditions:k.conditions||[]}),t(mt,{bgTint:"800",cellsPerRow:2,items:Zs(k,I)})]}),!!F?.length&&t(mt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(mt,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(pl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(hl,{isOpen:null!==w,onClose:()=>x(null),onApprove:A})]})},er=({onClose:o,connections:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=l(""),[h,g]=l({showOnlySelected:!1}),m=r(()=>a.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&i.includes(e.id);return t&&o}),[a.length,i.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=l(!1),[y,C]=l(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:T}=vt(y||{rollout:{automaticRolloutDisabled:!1}}),k=r(()=>i.length>1||void 0!==y&&!x(y,S),[i.length,y,S]);return n(()=>{1===i.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),T(e)}v(!1)})(i[0]):C(void 0)},[i.length]),t(ul,{isOpen:!0,onClose:o,onSave:()=>d(S,i),header:{icon:Ci,title:"Cluster Configuration"},connectionIds:{value:i,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(Z,{$gap:8,children:[t(ie,{size:le.XXXS,color:be.Secondary,nowrap:!0,children:"Show only:"}),t(K,{size:it.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:k,isFetching:b,leftColumn:{width:"35%",header:e(Z,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(Z,{$gap:8,children:[t(ie,{size:le.XS,children:"Clusters"}),t(Ie,{label:m.length,status:nt.Unknown})]}),e(Z,{$gap:8,children:[t(ie,{size:le.XXXS,color:be.Secondary,align:"right",children:"Selected clusters"}),t(Ie,{label:`${i.length}/${m.length}`,status:nt.Unknown})]})]}),list:m.map(e=>t(ys,{title:e.name,isChecked:i.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ie,{size:le.XS,children:"Configurations"}),list:[t(K,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},tr=e=>{const t=[{id:"type",title:Oe.TYPE,label:e.destinationType.displayName},{id:"status",title:Oe.STATUS,badge:{status:e.disabled?nt.Unknown:pe.Success,label:e.disabled?Oe.DISABLED:Oe.ENABLED}}],o=ge(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Oe.MONITORS,label:o}),e.name&&t.push({id:"name",title:Oe.NAME,label:e.name}),t},or=({onClose:a,destinationId:i,getDestinationCategories:s,testConnection:u,updateDestination:p,deleteDestination:h})=>{const g=f(),{isVm:m}=y(),{destinations:b}=et(),{selectedStreamName:v}=Ae(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=yl(),T=d(null),[k,I]=l(!1),[$,E]=l(!1),[N,O]=l(null),[A,D]=l(!0),[R,P]=l(null),F=k&&!!x?.isFormDirty,L=r(()=>St(b,v),[b,v]),_=r(()=>L?.find(e=>ut(e)===i),[i,L]);n(()=>{let e=!1;return D(!0),s().then(t=>{e||O(t?.destinationCategories.categories??[])}).catch(t=>{e||O([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&N&&S(_,N)},[_,N]);const B=r(()=>_&&N?wt(N,_):[],[_,N]),z=c(()=>{_&&I(!0)},[_]),M=c(()=>{_&&N&&(S(_,N),I(!1))},[_,N,S]),X=c(()=>{F?P("close"):a()},[F,a]),U=c(()=>{F?P("cancel"):M()},[F,M]),H=c(()=>{const e=R;P(null),"close"===e?(M(),a()):M()},[R,M,a]),j=c(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,fe(t)),I(!1))}},[_,w,p]),W=c(()=>{_&&E(!0)},[_]),G=c(async()=>{_&&(await h(_.id),a())},[_,h,a]);if(!_)return null;const{icon:K,iconSrc:Y}=qe(_.destinationType.type),J=((e,t)=>{const o=[],n=yt(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=ge(e.exportedSignals);let l=[];const s=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&de(h,i,a))return;const{type:m}=Qe(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==r&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(r)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===Ct.MultiInput){const t=Qe(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===Ct.KeyValuePair){const t=Qe(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:r})}else l.push({id:e,title:n,label:"-"})}),s(),o})(_,B);return e(o,{children:[t(pt,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:ht.EDIT,icon:si,active:k,onClick:z},{id:"edit-destination-btn-delete",label:ht.DELETE,icon:ti,color:g.v2.colors.red[500],active:$,onClick:W}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:ht.CANCEL,variant:te.Secondary,onClick:U},...C?.option.testConnectionSupported&&!m?[{"data-id":"edit-destination-btn-test-connection",label:ht.TEST_CONNECTION,variant:te.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:ht.SAVE,variant:te.Primary,onClick:j}]:[]},children:t(gt,{$padding:"4px 12px 12px",children:A?t(He,{$height:"50vh",children:t(Ye,{withSpinner:!0})}):k&&C?t(Jl,{ref:T,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(mt,{bgTint:"1000",children:[e(mt,{bgTint:"900",children:[!m&&t(ft,{conditions:_.conditions||[]}),t(mt,{bgTint:"800",cellsPerRow:2,items:tr(_)})]}),!!J.length&&t(mt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(mt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(mt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(pl,{target:"destination",isOpen:$,onClose:()=>E(!1),onApprove:G}),t(hl,{isOpen:null!==R,onClose:()=>P(null),onApprove:H})]})},nr=(e,t)=>{const o=[{id:"type",title:Oe.TYPE,label:t.label},{id:"status",title:Oe.STATUS,badge:{status:e.disabled?nt.Unknown:pe.Success,label:e.disabled?Oe.DISABLED:Oe.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Oe.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Oe.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Oe.NOTES,label:e.notes}),o},ar=({onClose:a,ruleId:i,updateInstrumentationRule:s,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=et(),{addNotification:h}=Tt(),{selectedOption:g,loadRule:m,validateFormData:b,genericForm:v}=Cl(),[y,C]=l(!1),[S,w]=l(!1),[x,T]=l(null),k=y&&!!v?.isFormDirty,I=r(()=>p?.find(e=>ut(e)===i),[i,p]),$=r(()=>tt.find(({type:e})=>e===I?.type)??null,[I?.type]);n(()=>{I&&m(I)},[I]);const E=c(()=>{if(I){if(!I.mutable)return void h({type:pe.Warning,title:kt.FORBIDDEN,message:kt.CANNOT_EDIT_RULE,crdType:ot.InstrumentationRule,target:I.ruleId,hideFromHistory:!0});C(!0)}},[I,h]),N=c(()=>{I&&(m(I),C(!1))},[I,m]),O=c(()=>{k?T("close"):a()},[k,a]),A=c(()=>{k?T("cancel"):N()},[k,N]),D=c(()=>{const e=x;T(null),"close"===e?(N(),a()):N()},[x,N,a]),R=c(async()=>{if(I){const{errorMessage:e,preparedFormData:t}=b();e||(await s(I.ruleId,t),C(!1))}},[I,b,s]),P=c(()=>{if(I){if(!I.mutable)return void h({type:pe.Warning,title:kt.FORBIDDEN,message:kt.CANNOT_DELETE_RULE,crdType:ot.InstrumentationRule,target:I.ruleId,hideFromHistory:!0});w(!0)}},[I,h]),F=c(async()=>{I&&(await d(I.ruleId),a())},[I,d,a]);if(!I||!$)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(ie,{size:le.XS,children:`• ${xt(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(ie,{size:le.XS,children:`• ${xt(e).toLowerCase()}`},e))}),e.headersCollection?.[Ce.HeaderKeys]?.length&&e.headersCollection[Ce.HeaderKeys].forEach(e=>{e&&n.push(t(ie,{size:le.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Te.Java]?.forEach((e,a)=>{const i=new xe(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(ie,{size:le.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(ie,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Te.Golang]?.forEach((e,a)=>{const i=new we(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(ie,{size:le.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(ie,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})(I,u);return e(o,{children:[t(pt,{isOpen:!0,header:{icon:$t(I.type),title:$.label,onClose:O,actions:[{id:"edit-rule-btn-edit",label:ht.EDIT,icon:si,active:y,onClick:E},{id:"edit-rule-btn-delete",label:ht.DELETE,icon:ti,color:u.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:ht.CANCEL,variant:te.Secondary,onClick:A},{"data-id":"edit-rule-btn-save",label:ht.SAVE,variant:te.Primary,onClick:R}]:[]},children:t(gt,{$padding:"4px 12px 12px",children:y&&g?t(as,{}):t(V,{$gap:16,children:e(mt,{bgTint:"1000",children:[e(mt,{bgTint:"900",children:[t(ft,{conditions:I.conditions||[]}),t(mt,{bgTint:"800",cellsPerRow:2,items:nr(I,$)})]}),!!L.length&&t(mt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(mt,{bgTint:"800",children:L})}),!!$.supportedLanguages.length&&t(mt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(mt,{bgTint:"800",children:t(Z,{$gap:12,$wrap:"wrap",children:$.supportedLanguages.map(e=>t(It,{label:$e[e],leftIcon:Ee(e),flex:"0.5"},e))})})})]})})})}),t(pl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(hl,{isOpen:null!==x,onClose:()=>T(null),onApprove:D})]})};var ir;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(ir||(ir={}));const lr=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:a,podName:i,nodeName:l,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Et(),g=Nt(!!o),m=r(()=>({title:i,icon:Si,withCopy:!0}),[i]),f=r(()=>{const e=[],t=Ot(c);t&&e.push(t);const o=Ot(d,wi,"health");o&&e.push(o);const n=Ot(u,xi,"health");return n&&e.push(n),e},[c,d,u]),b=r(()=>n?[{id:`restart-pod-${i}`,icon:Ti,label:ht.RESTART_POD,onClick:()=>n(a,i)}]:void 0,[n,a,i]),v=r(()=>[{id:"nodeName",title:Oe.NODE,label:l,withCopy:!0},{id:"age",title:Oe.AGE,label:s?h(s,{style:"short"}):Oe.NOT_RUNNING,labelTooltip:s}],[l,s,h]);return t("div",{ref:g,children:t(mt,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},sr=m.div`
|
|
81
76
|
display: flex;
|
|
82
77
|
align-items: center;
|
|
83
78
|
justify-content: space-between;
|
|
@@ -85,7 +80,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
85
80
|
padding: ${({$noPadding:e})=>e?"0":"12px"};
|
|
86
81
|
border-radius: 12px;
|
|
87
82
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
88
|
-
`,
|
|
83
|
+
`,rr=({podsOdigosHealthStatus:o,pods:n,noPadding:a})=>{const i=Rt(o?.status),l=xt(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=r(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===At.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===At.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===At.Success?1:0),0)||0}),[n]);return n?.length&&o&&i?e(sr,{$noPadding:a,children:[t(Dt,{invertColors:!0,hideBackground:!0,status:i,title:l,subTitle:s}),e(Z,{$gap:8,children:[t(dr,{label:Oe.PODS,count:c}),t(dr,{label:Oe.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(dr,{label:Oe.ODIGOS_HEALTHY,icon:wi,count:u,total:c}),t(dr,{label:Oe.KUBERNETES_HEALTHY,icon:xi,count:p,total:c})]})]}):null},cr=m.div`
|
|
89
84
|
display: flex;
|
|
90
85
|
flex-direction: column;
|
|
91
86
|
justify-content: center;
|
|
@@ -96,7 +91,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
96
91
|
width: fit-content;
|
|
97
92
|
border-radius: 8px;
|
|
98
93
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
99
|
-
`,
|
|
94
|
+
`,dr=({count:o,total:n,label:a,icon:i})=>{const l=f(),s=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(cr,{children:[e(Z,{$gap:0,$alignItems:"flex-end",children:[t(ie,{size:le.L,color:s,weight:500,nowrap:!0,children:o}),void 0!==n&&t(ie,{size:le.S,color:s,weight:500,nowrap:!0,children:`/${n}`})]}),e(Z,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(ie,{size:le.XXXS,nowrap:!0,children:a})]})]})},ur=12,pr=24,hr=12,gr=24,mr=40,fr=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===Pt.PID)??e.identifyingAttributes?.find(({name:e})=>e===Pt.VPID);return t?.value??null};var br;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(br||(br={}));const vr=({overrideProcessNum:o,healthy:a,healthStatus:i,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=l(br.IdentifyingAttributes),g=Nt(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:v}=r(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:br.IdentifyingAttributes,label:Oe.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:br.InstrumentationLibraries,label:Oe.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(ki,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[s,c]);n(()=>{b&&h(b)},[b]);const y=r(()=>{switch(p){case br.IdentifyingAttributes:return t(V,{children:s?.map(e=>t(Cr,{label:e.name,value:e.value},e.name))});case br.InstrumentationLibraries:return t(V,{children:c?.map(e=>t(Cr,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[p,s,c]),C=r(()=>fr({overrideProcessNum:o,identifyingAttributes:s}),[o,s]);return t("div",{ref:g,children:e(mt,{bgTint:"800",richTitle:{title:C?`${Oe.PROCESS} ${Oe.PID(C)}`:Oe.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ie,{color:a?be.Success:be.Error,size:le.XXXS,children:i?.message}),badges:[{key:"odigos-healthy",status:a?pe.Success:pe.Error,leftIcon:wi,label:a?Oe.HEALTHY:Oe.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(re,{options:m,selected:p,setSelected:h}),!v&&y]})})},yr=m.div`
|
|
100
95
|
display: flex;
|
|
101
96
|
align-items: center;
|
|
102
97
|
justify-content: space-between;
|
|
@@ -105,14 +100,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
105
100
|
&:hover {
|
|
106
101
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
107
102
|
}
|
|
108
|
-
`,
|
|
103
|
+
`,Cr=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const s="boolean"==typeof i;return e(yr,{children:[t(ie,{size:le.XXS,color:be.Secondary,children:o}),n&&t(ie,{size:le.XXS,color:be.Primary,children:n}),(s||a)&&e(Z,{children:[a&&t(Ie,{status:pe.Info,label:Oe.STANDARD,textSize:le.XXXS,invertColors:!0}),s&&t(Ie,{status:i?pe.Success:pe.Error,label:i?Oe.HEALTHY:Oe.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Sr=p(null),wr=({value:e,children:o})=>t(Sr.Provider,{value:e,children:o}),xr=()=>{const e=h(Sr);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e},Tr=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const a=e??[],i=r(()=>({title:Oe.CONTAINERS,titleSize:le.XS,badge:{label:a.length}}),[a.length]),l=r(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(mt,{bgTint:"800",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:a.map(e=>{const o=n?.containerName===e.containerName;return t(Ir,{...e,language:Ft(l.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},kr=m.div`
|
|
109
104
|
display: flex;
|
|
110
105
|
flex-direction: column;
|
|
111
106
|
gap: 12px;
|
|
112
107
|
padding: 8px 12px;
|
|
113
108
|
border-radius: 8px;
|
|
114
109
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
115
|
-
`,
|
|
110
|
+
`,Ir=({language:o,containerName:n,otelDistroName:a,runningStartedTime:i,started:l,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:g,processes:m,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Et(),C=Nt(v),S=r(()=>({title:n,icon:o?Ee(o):Ii,iconWithWrapper:!0}),[n,o]),w=r(()=>{const e=[],t=Ot({status:a?At.Success:At.Disabled,reasonEnum:a?Oe.INSTRUMENTED_WITH_DISTRO(a):Oe.UNINSTRUMENTED,message:""});t&&e.push(t);const o=Ot(h,wi,"health");o&&e.push(o);const n=Ot(g,xi,"health");return n&&e.push(n),e},[g,h,a]),x=r(()=>[{id:"runningTime",title:Oe.RUNNING_TIME,label:i?y(i,{style:"short"}):Oe.NOT_RUNNING,labelTooltip:`${Oe.RUNNING_TIME_TOOLTIP}. (${i})`},{id:"blank",spacer:!0},{id:"started",badge:{status:l?pe.Success:Lt.Disabled,leftIcon:l?ai:ii,label:l?Oe.STARTED:Oe.NOT_STARTED,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?pe.Success:Lt.Disabled,leftIcon:s?ai:ii,label:s?Oe.READY:Oe.NOT_READY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?pe.Error:pe.Success,leftIcon:d?ii:ai,label:d?Oe.CRASHLOOP:Oe.NO_CRASHLOOP,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Oe.RESTARTS,badge:{status:c?pe.Error:void 0,label:c||0,textSize:le.XXXS}}],[i,y,l,s,d,c]),T=r(()=>p?xt(u):"",[p,u]);return t("div",{ref:C,children:e(mt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(kr,{children:e(Z,{$gap:10,$alignItems:"center",children:[t(It,{variant:_t.Pink,leftIcon:xi,label:T}),t(ie,{size:le.XXXS,color:be.Error,children:p})]})}),(m??[]).map((e,o)=>{const a=o+1,i=b&&(l=f,s=e,!!l?.processPid&&fr({identifyingAttributes:s.identifyingAttributes})===l.processPid);var l,s;return t(vr,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${n}-process-${a}`)})]})})},$r=({podName:e,namespace:o,hasRestarted:n})=>{const a=r(()=>({title:Oe.DEBUG_COMMANDS,titleSize:le.XS}),[]),i=r(()=>[{label:Oe.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Oe.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Oe.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(mt,{bgTint:"800",richTitle:a,withCollapse:!0,children:i.map(({label:e,value:o})=>t(Bt,{bgTint:"700",label:e,value:o},e))})},Er=({source:n,onClickRestartPod:a})=>{const{jumpToTarget:i}=xr(),l=i?.tab===ir.Pods?i:null,s=n?.pods??[],c=s.length>0,d=r(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=r(()=>({title:Oe.PODS,badge:{label:s.length}}),[s.length]);return t(V,{$gap:12,children:c?e(o,{children:[t(rr,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(mt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const i=l?.podName===o.podName,s=i&&!l?.containerName;return e(lr,{...o,namespace:n.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:i,isJumpToTarget:s,children:[t($r,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(Tr,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:i?l:null})]},`pod-${o.podName}`)})})]}):t(He,{$height:"70vh",children:t(ae,{title:Oe.NO_RUNNING_PODS,subTitle:Oe.NO_RUNNING_PODS_SUBTITLE})})})},Nr=({source:o,fetchPeerSources:a})=>{const i=r(()=>o.serviceName||o.id.name,[o]),[s,d]=l(!1),[u,p]=l(null),h=c(()=>{d(!0),a(i).then(({data:e})=>p(e?.peerSources??null)).finally(()=>d(!1))},[i]);return n(()=>{h()},[h]),!u||s?t(He,s?{$height:"70vh",children:t(Ye,{withSpinner:!0})}:{$height:"70vh",children:t(ae,{subTitle:Oe.COULD_NOT_FETCH_PEER_SOURCES})}):e(Z,{$gap:16,$alignItems:"flex-start",children:[t(Or,{icon:$i,title:Oe.INBOUND,subTitle:Oe.INBOUND_DESCRIPTION(i),onRefresh:h,items:u?.inbound??[]}),t(Or,{icon:Ei,title:Oe.OUTBOUND,subTitle:Oe.OUTBOUND_DESCRIPTION(i),onRefresh:h,items:u?.outbound??[]})]})},Or=({icon:o,title:n,subTitle:a,onRefresh:i,items:s})=>{const[c,d]=l(""),u=r(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(mt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:le.XS,subTitle:a,subTitleSize:le.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:zt.Button,buttonProps:{variant:te.Secondary,size:ee.S,leftIcon:Ti,onClick:i}}],children:[t(Mt,{value:c,onChange:d,width:"100%"}),t(Xt,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(He,{$height:"50vh",children:t(ae,{icon:o,title:Oe.NO_RESULTS,subTitle:Oe.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(Dr,{...e},`${n}-${e.serviceName}`)):[t(He,{$height:"50vh",children:t(ae,{icon:o,title:`No ${n} connections yet`,subTitle:n===Oe.INBOUND?Oe.NO_INBOUND_CONNECTIONS_DESCRIPTION:Oe.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Ar=m.div`
|
|
116
111
|
display: flex;
|
|
117
112
|
align-items: center;
|
|
118
113
|
justify-content: space-between;
|
|
@@ -126,7 +121,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
126
121
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
127
122
|
}
|
|
128
123
|
`}
|
|
129
|
-
`,
|
|
124
|
+
`,Dr=({serviceName:o,isVirtual:n,nodeAttributes:a})=>{const i=Vt(e=>e.drawerEntityId),l=et(e=>e.sources),s=r(()=>l.find(e=>e.id.name===o||e.serviceName===o),[l,o]),c=r(()=>s&&JSON.stringify(Ut(s))!==JSON.stringify(Ut(i)),[s,i]),d=r(()=>{if(n){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[Ht({serviceName:o,attributes:e})]}if("user"===o?.toLowerCase())return[Ni];const e=s?jt(s):void 0;return e?.length?e:[Ii]},[n,a,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Vt.getState();e(ot.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(Ar,{onClick:u,$withClick:!!u,children:[e(Z,{$gap:8,children:[t(Wt,{icons:d}),t(ie,{size:le.XXS,children:o})]}),n&&t(Ie,{status:pe.Info,label:Oe.VIRTUAL,textSize:le.XXXS,invertColors:!0,tooltip:Oe.VIRTUAL_TOOLTIP})]})},Rr=({title:o,children:n})=>e(V,{$gap:8,children:[t(ie,{size:le.XXXS,color:be.Secondary,children:o}),n]}),Pr=({source:o})=>{const n=r(()=>{const[e,t]=Gt(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(Rr,{title:Oe.THROUGHPUT_LAST_10_SECONDS,children:e(Z,{$alignItems:"flex-end",$gap:4,children:[t(ie,{size:le.L,children:n.value}),t(ie,{size:le.XS,variant:lt.Span,children:n.units})]})})},Fr=({source:o})=>{const{CopyButton:n}=Kt();return t(Rr,{title:Oe.NAMESPACE,children:e(Z,{children:[t(It,{variant:_t.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:Ke.XS})]})})},Lr=({source:e})=>t(Rr,{title:Oe.KIND,children:t(Z,{children:t(It,{variant:_t.Blue,label:e.id.kind})})}),_r=({source:o})=>{const{CopyButton:n}=Kt();return t(Rr,{title:Oe.NAME,children:e(Z,{children:[t(It,{variant:_t.Blue,label:o.id.name}),t(n,{value:o.id.name,size:Ke.XS})]})})},Br=({source:o})=>t(mt,{children:e(Z,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[t(Pr,{source:o}),t(Fr,{source:o}),t(Lr,{source:o}),t(_r,{source:o})]})}),zr=m.div`
|
|
130
125
|
display: flex;
|
|
131
126
|
align-items: center;
|
|
132
127
|
gap: 6px;
|
|
@@ -135,33 +130,33 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
135
130
|
cursor: ${({$clickable:e})=>e?"pointer":"default"};
|
|
136
131
|
transition: background-color 0.15s ease;
|
|
137
132
|
${({$clickable:e,theme:t})=>e&&`\n &:hover {\n background-color: ${t.v2.colors.silver[700]};\n }\n `}
|
|
138
|
-
`,
|
|
133
|
+
`,Mr=m.div`
|
|
139
134
|
display: flex;
|
|
140
135
|
align-items: center;
|
|
141
136
|
justify-content: center;
|
|
142
137
|
flex-shrink: 0;
|
|
143
138
|
width: 18px;
|
|
144
139
|
height: 18px;
|
|
145
|
-
`,
|
|
140
|
+
`,Xr=m.div`
|
|
146
141
|
flex: 1;
|
|
147
142
|
min-width: 0;
|
|
148
143
|
display: flex;
|
|
149
|
-
`,
|
|
144
|
+
`,Vr=({chevron:o,onClick:n,label:a,name:i,badges:l,action:s,paddingLeft:r})=>{const c=f();return e(zr,{$clickable:!!n,$paddingLeft:r,onClick:n,children:[o&&t(Mr,{children:t(o,{size:18,fill:c.v2.colors.silver[200]})}),t(ie,{size:le.XXXS,color:be.Secondary,nowrap:!0,children:a}),t(Xr,{children:t(ie,{size:le.XS,nowrap:!0,children:i})}),s&&t(ye,{text:s.tooltip,children:t(Ge,{icon:s.icon,size:Ke.XS,onClick:s.onClick})}),l.map(({key:e,...o})=>t(Ur,{...o},e))]})},Ur=({status:e,leftIcon:o,label:n,tooltip:a})=>{const i=o||(e===pe.Success?ai:ii);return t(Ie,{status:e,leftIcon:i,label:n,tooltip:a,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0})},Hr=({overrideProcessNum:e,pod:o,container:n,process:a})=>{const{jumpToProcess:i}=xr(),l=r(()=>fr({overrideProcessNum:e,identifyingAttributes:a.identifyingAttributes}),[e,a.identifyingAttributes]),s=r(()=>{const e=[],t=Ot(a.healthStatus,wi,"health");return t&&e.push(t),e},[]);return t(Vr,{label:Oe.PROCESS,name:l?Oe.PID(l):Oe.PROCESS_FALLBACK_NAME,paddingLeft:mr,action:{icon:Oi,onClick:()=>i(o,n,a),tooltip:Oe.OPEN_IN_POD_TAB},badges:s})},jr=m.div`
|
|
150
145
|
display: flex;
|
|
151
146
|
flex-direction: column;
|
|
152
147
|
align-self: stretch;
|
|
153
148
|
border-radius: 8px;
|
|
154
149
|
background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[750]:"transparent"};
|
|
155
|
-
`,
|
|
150
|
+
`,Wr=({pod:o,container:n})=>{const[a,i]=l(!1),{jumpToContainer:s}=xr(),c=r(()=>{const e=[],t=Rt(n.odigosHealthStatus?.status);t&&e.push({key:"odigos-health",status:t,leftIcon:wi,label:Yt(t,n.odigosHealthStatus?.reasonEnum),tooltip:n.odigosHealthStatus?.message});const o=Rt(n.k8sHealthStatus?.status);return o&&e.push({key:"k8s-health",status:o,leftIcon:xi,label:Yt(o,n.k8sHealthStatus?.reasonEnum),tooltip:n.k8sHealthStatus?.message}),e},[]),d=n.processes??[],u=d.length>0;return e(jr,{$isExpanded:a,children:[t(Vr,{chevron:u?a?gi:di:void 0,onClick:u?()=>i(e=>!e):void 0,label:Oe.CONTAINER,name:n.containerName,paddingLeft:gr+(u?0:24),action:{icon:Oi,onClick:()=>s(o,n),tooltip:Oe.OPEN_IN_POD_TAB},badges:c}),u&&a&&t(V,{$gap:0,$padding:`0 ${pr}px`,children:d.map((e,a)=>{const i=a+1;return t(Hr,{overrideProcessNum:i,pod:o,container:n,process:e},`pod-${o.podName}-container-${n.containerName}-process-${i}`)})})]})},Gr=m.div`
|
|
156
151
|
display: flex;
|
|
157
152
|
flex-direction: column;
|
|
158
153
|
align-self: stretch;
|
|
159
154
|
border-radius: 8px;
|
|
160
155
|
background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[800]:"transparent"};
|
|
161
156
|
padding-bottom: ${({$isExpanded:e})=>e?"12px":"0"};
|
|
162
|
-
`,
|
|
157
|
+
`,Kr=({pod:o})=>{const[n,a]=l(!1),{jumpToPod:i}=xr(),s=o.containers??[],c=s.length>0,d=r(()=>{const e=[],t=Ot(o.agentInjectedStatus);t&&e.push(t);const n=Ot(o.odigosHealthStatus,wi,"health");n&&e.push(n);const a=Ot(o.k8sHealthStatus,xi,"health");return a&&e.push(a),e},[o.k8sHealthStatus,o.odigosHealthStatus,o.agentInjectedStatus]);return e(Gr,{$isExpanded:n,children:[t(Vr,{chevron:c?n?gi:di:void 0,onClick:c?()=>a(e=>!e):void 0,label:Oe.POD,name:o.podName,paddingLeft:hr+(c?0:24),action:{icon:Oi,onClick:()=>i(o),tooltip:Oe.OPEN_IN_POD_TAB},badges:d}),n&&c&&t(V,{$gap:0,$padding:`0 ${ur}px`,children:s.map(e=>t(Wr,{pod:o,container:e},`pod-${o.podName}-container-${e.containerName}`))})]})},Yr=({pods:e})=>e?.length?t(V,{$gap:4,children:e.map(e=>t(Kr,{pod:e},`pod-${e.podName}`))}):t(He,{children:t(ae,{title:Oe.NO_RUNNING_PODS,subTitle:Oe.NO_RUNNING_PODS_SUBTITLE})}),Jr=({source:o})=>t(mt,{bgTint:"1000",richTitle:{title:Oe.PODS,badge:{label:o.pods?.length||0}},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(mt,{bgTint:"900",children:[t(rr,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:o.pods,noPadding:!0}),t(Yr,{pods:o.pods})]})}),qr=({source:e})=>{const o=r(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?Jt(e.workloadOdigosHealthStatus.status):nt.Unknown,title:xt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Dt,{...o,width:"calc(100% - 32px)"}):null},Zr="calc(50% - 6px)",Qr=({source:o,onClickRollout:n,onClickRollback:a})=>{const i=r(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Rt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?xt(t):`${Oe.ROLLOUT} ${xt(t)}`,subTitle:a,action:i!==pe.Success?{icon:Ti,tooltip:Oe.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),l=r(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},i=Rt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollback")?xt(t):`${Oe.ROLLBACK} ${xt(t)}`,subTitle:n,action:i!==pe.Success?{icon:Ti,tooltip:Oe.ROLLBACK_RECOVER,onClick:a}:void 0}},[o]);return i||l?t(mt,{bgTint:"1000",children:e(Z,{$gap:12,$alignItems:"stretch",children:[i&&t(Dt,{invertColors:!0,slim:!0,width:l?Zr:"100%",...i}),l&&t(Dt,{invertColors:!0,slim:!0,width:Zr,...l})]})}):null},ec=p(null),tc=m.div`
|
|
163
158
|
position: relative;
|
|
164
|
-
`,
|
|
159
|
+
`,oc=({children:e})=>{const o=d(null);return t(tc,{ref:o,children:t(ec.Provider,{value:o,children:e})})},nc=m.div`
|
|
165
160
|
position: fixed;
|
|
166
161
|
top: ${({$coords:e})=>e.top}px;
|
|
167
162
|
right: ${({$coords:e})=>e.right}px;
|
|
@@ -175,14 +170,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
175
170
|
padding: 12px 16px;
|
|
176
171
|
border-radius: 12px;
|
|
177
172
|
background-color: ${({theme:e})=>e.v2.colors.silver[750]};
|
|
178
|
-
`,
|
|
173
|
+
`,ac=m.div`
|
|
179
174
|
display: flex;
|
|
180
175
|
align-items: flex-end;
|
|
181
176
|
justify-content: space-between;
|
|
182
177
|
gap: 8px;
|
|
183
|
-
`,
|
|
178
|
+
`,ic=m.div`
|
|
184
179
|
flex: 1;
|
|
185
|
-
`,
|
|
180
|
+
`,lc=({width:o,onClose:n,onSave:a,saveTooltip:i,onDelete:s,deleteTooltip:r,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:m})=>{const b=f(),v=h(ec),[y,C]=l(null);return qt(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?_l(e(nc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(V,{$gap:4,children:[t(ie,{size:le.XXS,children:c}),t(ie,{size:le.XXXS,color:be.Secondary,children:d})]}),e(ac,{children:[t(ic,{children:p}),e(Z,{$gap:8,$width:"fit-content",$margin:`0 0 ${m||0} 0`,children:[t(Q,{variant:te.Secondary,onClick:s,leftIcon:ti,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:ee.S,textColor:b.v2.colors.red[500]}),t(Q,{variant:te.Primary,onClick:a,leftIcon:mi,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ee.S})]})]}),t("div",{children:t(ue,{status:pe.Warning,message:u})})]}),document.body):null},sc=({language:o,overridden:n,onOverride:a,defaultValues:i})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=vt(i),p=r(()=>{if(!o)return[];const e=Zt[o].community,t=s===at.Onprem?Zt[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,s]),[h,g]=l(!1),[m,f]=l(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(Z,{$gap:4,$alignItems:"center",children:[n?t(Ie,{status:pe.Info,invertColors:!0,label:Oe.OVERIDDEN}):null,e(oc,{children:[t(ye,{text:Oe.OVERRIDE_OTEL_DISTRO_NAME,children:t(Ge,{icon:si,onClick:b})}),m&&t(lc,{width:"500px",onClose:b,onSave:async()=>{g(!0),await a(c),g(!1),b()},saveTooltip:Oe.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await a({otelDistroName:null}),g(!1),b()},deleteTooltip:Oe.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Oe.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Oe.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Oe.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(We,{label:Oe.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},rc=({overridden:o,onOverride:n,defaultValues:a,originalValues:i})=>{const{addNotification:s}=Tt(),{formData:c,handleFormChange:d,resetFormData:u}=vt(a),p=r(()=>Qt.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,g]=l(!1),[m,f]=l(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(Z,{children:[o?t(Ie,{status:pe.Info,invertColors:!0,label:Oe.OVERIDDEN}):null,e(oc,{children:[t(ye,{text:Oe.OVERRIDE_RUNTIME_DETAILS,children:t(Ge,{icon:si,onClick:b})}),m&&t(lc,{width:"500px",onClose:b,onSave:async()=>{!c.version||eo(c.version)?(g(!0),await n(c),g(!1),b()):s({type:pe.Warning,message:kt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Oe.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await n({language:null,version:""}),g(!1),b()},deleteTooltip:Oe.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Oe.OVERRIDE_RUNTIME_DETAILS,subTitle:Oe.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Oe.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(Z,{$gap:8,children:[t(We,{label:Oe.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${i.language||"none"}`}),t(oe,{label:Oe.RUNTIME_VERSION,placeholder:Oe.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${i.version||"none"}`})]})})]})]})},cc=({source:e,onOverride:o})=>{const{isVm:n}=y(),{containers:a,containersRichTitle:i}=r(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Oe.DETECTED_PROCESSES:`${e.id.kind} ${Oe.CONTAINERS}`,tooltip:t?.message||(n?Oe.DETECTED_PROCESSES_DESCRIPTION:Oe.DETECTED_CONTAINERS_DESCRIPTION),badge:Rt(t?.status)===Lt.Loading?{status:Lt.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(mt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:a.map(e=>e&&t(hc,{...e,onOverride:o},`source-container-${e.containerName}`))})})},dc=m.div`
|
|
186
181
|
display: flex;
|
|
187
182
|
flex-direction: column;
|
|
188
183
|
align-self: stretch;
|
|
@@ -190,28 +185,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
190
185
|
padding: 8px 12px;
|
|
191
186
|
border-radius: 8px;
|
|
192
187
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
193
|
-
`,
|
|
188
|
+
`,uc=m.div`
|
|
194
189
|
display: flex;
|
|
195
190
|
align-items: center;
|
|
196
191
|
justify-content: center;
|
|
197
192
|
padding: 8px;
|
|
198
193
|
border-radius: 10px;
|
|
199
194
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
200
|
-
`,
|
|
195
|
+
`,pc=m.div`
|
|
201
196
|
display: flex;
|
|
202
197
|
flex-direction: column;
|
|
203
198
|
gap: 12px;
|
|
204
199
|
padding: 8px 12px;
|
|
205
200
|
border-radius: 8px;
|
|
206
201
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
207
|
-
`,bc=({onOverride:o,...n})=>{const{containerName:a,runtimeInfo:i,agentEnabled:l,overrides:s}=n,c=f(),d=r(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=r(()=>({language:Mt(n),version:ao(n)||void 0}),[n]),p=r(()=>!!s?.otelDistroName,[s]),h=r(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),m=r(()=>!i&&!d,[i,d]),g=r(()=>m?Ei:Ae(u.language),[m,u]),b=r(()=>{if(m)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[m,u]),v=r(()=>m?{status:Bt.Loading,label:Re.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?ge.Success:Bt.Disabled,leftIcon:l?.otelDistroName?si:ri,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[m,l]),y=e=>o({containerName:a,...p?h:{},...d?u:{},...e});return e(mc,{children:[e(te,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(te,{$gap:8,$alignItems:"center",children:[t(gc,{children:t(g,{size:24,fill:i?void 0:c.v2.colors.grey[400]})}),t(re,{children:a}),t(Et,b?{variant:zt.Blue,label:b}:{variant:zt.Loader,label:Re.DETECTING_RUNTIME_INFO}),t(pc,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(te,{$gap:8,$alignItems:"center",children:[t(Ee,{...v,textSize:ce.XXXS}),t(uc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!l||l.agentEnabled||m?null:t(fc,{children:e(te,{$gap:10,$alignItems:"center",children:[t(Et,{variant:zt.Pink,label:$t(l.agentEnabledStatus?.reasonEnum)||Re.NO_AVAILABLE_AGENT}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:l?.agentEnabledStatus?.message})]})})]})},vc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>e(V,{$gap:12,children:[t(Vr,{source:o}),t(tc,{source:o}),t(nc,{source:o,onClickRollout:n,onClickRollback:a}),t(hc,{source:o,onOverride:i}),t(ec,{source:o})]}),yc=({source:o,fetchK8sManifest:a})=>{const i=f(),[s,r]=l(!0),[c,d]=l(void 0),[u,p]=l(!0),[h,m]=l(void 0);return n(()=>{a(o.id.namespace,o.id.kind,o.id.name).then(d).finally(()=>r(!1)),a(o.id.namespace,io.InstrumentationConfig,`${o.id.kind}-${o.id.name}`.toLowerCase()).then(m).finally(()=>p(!1))},[a,o.id.namespace,o.id.kind,o.id.name]),e(yt,{bgTint:"1000",children:[s?t(lo,{size:1}):t(bl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:c}),u?t(lo,{size:1}):t(bl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:h})]})};function Cc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function Sc(e){const t=Math.abs(e);return t>=1e9?`${wc(e/1e9)}s`:t>=1e6?`${wc(e/1e6)}ms`:t>=1e3?`${wc(e/1e3)}μs`:String(Math.round(e))}function wc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function xc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],s=n[e+2],r=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function kc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Tc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function $c(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1}=i,c=xc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(s&&(d=d.filter(t=>s(Cc(e,t.nameIndex))),0===d.length))return null;if(r&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Cc(e,l.nameIndex)===Cc(e,t.nameIndex)&&a.add(kc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(kc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(kc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const m=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,g=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/m,g)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,s=Math.max(f-v,1),r=Cc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:s,name:r,matchesSearch:Tc(r,b)}})}function Nc(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var Ic,Ec;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Ic||(Ic={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Ec||(Ec={}));function Oc(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ac(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function Dc(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Rc=({flamebearer:o,maxRowPx:a,searchQuery:i="",shouldKeepName:s,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const g=f(),b=d(null),v=d(null),y=d({x:0,y:0}),C=d(o.numTicks),[S,w]=l({w:0,h:0}),[x,k]=l(""),[T,$]=l(null),[N,I]=l([]),[E,O]=l(!1),[A,D]=l(Ic.Fit),[R,F]=l(Ec.Fit),[P,L]=l(!1),_=Math.max(1,Math.min(Math.floor(S.w*A),8192)),M=Math.max(1,Math.min(Math.floor(S.h*R),8192)),B=N.length>0?N[N.length-1]:null,z=B?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,I([]))},[o.numTicks]),m(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!E)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[E]),n(()=>(p?.(E),()=>{E&&p?.(!1)}),[E,p]);const X=r(()=>$c(o,_,M,a,i,{zoomRoot:B,shouldKeepName:s,collapseRecursive:P}),[o,a,i,M,_,B,s,P]),V=r(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?i.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,i]),U=c(e=>{if(_<2||M<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Ac((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*M,V);if(n){const e=kc(n);$(e);const t=z>0?(100*n.size/z).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";k(`${n.name}\ntotal ${Sc(n.size)} (${t}% of view, ${a}% of profile) · self ${Sc(n.self)}`)}else $(null),k("")},[V,o.numTicks,M,_,z]),H=c(e=>{U(e)},[U]),j=c(()=>{$(null),k("")},[]),W=c(e=>{y.current={x:e.clientX,y:e.clientY}},[]),G=c(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||M<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=Ac((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*M,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);I(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,M,_]);m(()=>{const e=v.current;if(!e||_<2||M<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,M),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(M*a),e.style.width=`${_}px`,e.style.height=`${M}px`;const l=e.getContext("2d");l&&(l.setTransform(a,0,0,a,0,0),l.clearRect(0,0,_,M),X?.length?function(e,t,o,n,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Nc(r,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const m=Oc(d,s),g=`${r} (${Sc(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(kc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(l,_,M,X,i,g,T,o.numTicks):(l.fillStyle=g.v2.colors.silver[900],l.fillRect(0,0,_,M)))},[X,o.numTicks,T,i,M,_,g]);const K=c(()=>O(e=>!e),[]),Y=o.numTicks>0?Math.max(0,Math.min(100,Math.round(z/o.numTicks*100))):100,J=r(()=>function(e,t){const o=xc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let s=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(o,B),[o,B]),Q=null!==J,ee=N.length>0,ie=B?Cc(o,B.nameIndex):"",le=c(()=>I([]),[]),se=c(()=>I(e=>e.slice(0,-1)),[]),de=c(()=>{J&&I(e=>[...e,J])},[J]);return e("div",{style:E?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:g.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(te,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(q,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Z.Left,size:ct.S,value:P,onChange:L}),e(te,{$gap:8,children:[e(te,{children:[t(oe,{variant:ae.Secondary,size:ne.S,label:"Reset zoom",leftIcon:Fi,onClick:le,disabled:!N.length}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:20,leftIcon:Pi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ee,onClick:se}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(re,{size:ce.XXS,color:Ce.Secondary,nowrap:!0,align:"center",children:`${Y}%`})}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:20,leftIcon:ii,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!Q,onClick:de})]}),e(te,{children:[t(we,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:so.Filled,options:[{value:Ic.Fit,label:"W: Fit"},{value:Ic.X10,label:"10x"}],selected:A,setSelected:D})}),t(we,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:so.Filled,options:[{value:Ec.Fit,label:"H: Fit"},{value:Ec.X10,label:"10x"}],selected:R,setSelected:F})})]}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:24,leftIcon:E?yi:Ri,tooltip:E?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:K})]})]}),t(we,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:E?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:A>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:M||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:T?"pointer":"default"},onPointerDown:W,onPointerMove:H,onPointerLeave:j,onClick:G})})})}),e(te,{$justifyContent:"space-between",children:[t(re,B?{size:ce.XXXS,color:g.v2.colors.silver[300],children:`Zoomed: ${ie} • ${Sc(z)} samples in view`}:{size:ce.XXXS,color:g.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(re,{size:ce.XXXS,color:g.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Dc(h.totalBytesUsed)} / ${Dc(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var Fc,Pc;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Fc||(Fc={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Pc||(Pc={}));const Lc=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function _c(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Pc.FilterOutVoid)&&"void"===o)return!1;if(t.includes(Pc.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&Lc.test(o)))return!1}return!0}const Mc={options:[{id:Pc.FilterOutVoid,label:"Filter out void symbols"},{id:Pc.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>_c(e.cells.find(e=>e.key===Fc.Symbol)?.rawValue?.toString()??"",t)},Bc=({rows:e,languages:o,filters:n,onFiltersChange:a})=>{const i=r(()=>[{key:Fc.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(ro.Java)?Mc:void 0,noFilter:!o?.includes(ro.Java)},{key:Fc.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Fc.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),l=r(()=>e.map(e=>({cells:[{key:Fc.Symbol,rawValue:e.name},{key:Fc.Self,rawValue:Sc(e.self)},{key:Fc.Total,rawValue:Sc(e.total)}]})),[e]);return t(co,{variant:uo.Data,maxHeight:"calc(100vh - 306px)",columns:i,rows:l,filters:n,onFiltersChange:a,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Li,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var zc;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(zc||(zc={}));const Xc=g(V)`
|
|
202
|
+
`,hc=({onOverride:o,...n})=>{const{containerName:a,runtimeInfo:i,agentEnabled:l,overrides:s}=n,c=f(),d=r(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=r(()=>({language:Ft(n),version:to(n)||void 0}),[n]),p=r(()=>!!s?.otelDistroName,[s]),h=r(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=r(()=>!i&&!d,[i,d]),m=r(()=>g?Ii:Ee(u.language),[g,u]),b=r(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),v=r(()=>g?{status:Lt.Loading,label:Oe.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?pe.Success:Lt.Disabled,leftIcon:l?.otelDistroName?ai:ii,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[g,l]),y=e=>o({containerName:a,...p?h:{},...d?u:{},...e});return e(dc,{children:[e(Z,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(Z,{$gap:8,$alignItems:"center",children:[t(uc,{children:t(m,{size:24,fill:i?void 0:c.v2.colors.grey[400]})}),t(ie,{children:a}),t(It,b?{variant:_t.Blue,label:b}:{variant:_t.Loader,label:Oe.DETECTING_RUNTIME_INFO}),t(rc,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(Z,{$gap:8,$alignItems:"center",children:[t(Ie,{...v,textSize:le.XXXS}),t(sc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!l||l.agentEnabled||g?null:t(pc,{children:e(Z,{$gap:10,$alignItems:"center",children:[t(It,{variant:_t.Pink,label:xt(l.agentEnabledStatus?.reasonEnum)||Oe.NO_AVAILABLE_AGENT}),t(ie,{size:le.XXXS,color:be.Secondary,children:l?.agentEnabledStatus?.message})]})})]})},gc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>e(V,{$gap:12,children:[t(Br,{source:o}),t(qr,{source:o}),t(Qr,{source:o,onClickRollout:n,onClickRollback:a}),t(cc,{source:o,onOverride:i}),t(Jr,{source:o})]}),mc=({source:o,fetchK8sManifest:a})=>{const i=f(),[s,r]=l(!0),[c,d]=l(void 0),[u,p]=l(!0),[h,g]=l(void 0);return n(()=>{a(o.id.namespace,o.id.kind,o.id.name).then(d).finally(()=>r(!1)),a(o.id.namespace,oo.InstrumentationConfig,`${o.id.kind}-${o.id.name}`.toLowerCase()).then(g).finally(()=>p(!1))},[a,o.id.namespace,o.id.kind,o.id.name]),e(mt,{bgTint:"1000",children:[s?t(no,{size:1}):t(gl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:c}),u?t(no,{size:1}):t(gl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:h})]})};function fc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function bc(e){const t=Math.abs(e);return t>=1e9?`${vc(e/1e9)}s`:t>=1e6?`${vc(e/1e6)}ms`:t>=1e3?`${vc(e/1e3)}μs`:String(Math.round(e))}function vc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function yc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],s=n[e+2],r=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function Cc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Sc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function wc(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1}=i,c=yc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(s&&(d=d.filter(t=>s(fc(e,t.nameIndex))),0===d.length))return null;if(r&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&fc(e,l.nameIndex)===fc(e,t.nameIndex)&&a.add(Cc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(Cc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Cc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const g=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,m=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/g,m)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,s=Math.max(f-v,1),r=fc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:s,name:r,matchesSearch:Sc(r,b)}})}function xc(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var Tc,kc;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Tc||(Tc={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(kc||(kc={}));function Ic(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function $c(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function Ec(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Nc=({flamebearer:o,maxRowPx:a,searchQuery:i="",shouldKeepName:s,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const m=f(),b=d(null),v=d(null),y=d({x:0,y:0}),C=d(o.numTicks),[S,w]=l({w:0,h:0}),[x,T]=l(""),[k,I]=l(null),[$,E]=l([]),[N,O]=l(!1),[A,D]=l(Tc.Fit),[R,P]=l(kc.Fit),[F,L]=l(!1),_=Math.max(1,Math.min(Math.floor(S.w*A),8192)),B=Math.max(1,Math.min(Math.floor(S.h*R),8192)),z=$.length>0?$[$.length-1]:null,M=z?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,E([]))},[o.numTicks]),g(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!N)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[N]),n(()=>(p?.(N),()=>{N&&p?.(!1)}),[N,p]);const X=r(()=>wc(o,_,B,a,i,{zoomRoot:z,shouldKeepName:s,collapseRecursive:F}),[o,a,i,B,_,z,s,F]),V=r(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?i.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,i]),U=c(e=>{if(_<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=$c((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*B,V);if(n){const e=Cc(n);I(e);const t=M>0?(100*n.size/M).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";T(`${n.name}\ntotal ${bc(n.size)} (${t}% of view, ${a}% of profile) · self ${bc(n.self)}`)}else I(null),T("")},[V,o.numTicks,B,_,M]),H=c(e=>{U(e)},[U]),j=c(()=>{I(null),T("")},[]),W=c(e=>{y.current={x:e.clientX,y:e.clientY}},[]),G=c(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||B<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=$c((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*B,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);E(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,B,_]);g(()=>{const e=v.current;if(!e||_<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,B),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(B*a),e.style.width=`${_}px`,e.style.height=`${B}px`;const l=e.getContext("2d");l&&(l.setTransform(a,0,0,a,0,0),l.clearRect(0,0,_,B),X?.length?function(e,t,o,n,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=xc(r,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=Ic(d,s),m=`${r} (${bc(d)}, ${g}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(Cc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(l,_,B,X,i,m,k,o.numTicks):(l.fillStyle=m.v2.colors.silver[900],l.fillRect(0,0,_,B)))},[X,o.numTicks,k,i,B,_,m]);const J=c(()=>O(e=>!e),[]),q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(M/o.numTicks*100))):100,oe=r(()=>function(e,t){const o=yc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let s=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(o,z),[o,z]),ne=null!==oe,ae=$.length>0,se=z?fc(o,z.nameIndex):"",ce=c(()=>E([]),[]),de=c(()=>E(e=>e.slice(0,-1)),[]),ue=c(()=>{oe&&E(e=>[...e,oe])},[oe]);return e("div",{style:N?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:m.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(Z,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(K,{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:Y.Left,size:it.S,value:F,onChange:L}),e(Z,{$gap:8,children:[e(Z,{children:[t(Q,{variant:te.Secondary,size:ee.S,label:"Reset zoom",leftIcon:Ai,onClick:ce,disabled:!$.length}),t(Q,{variant:te.Secondary,size:ee.S,iconSize:20,leftIcon:Di,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ae,onClick:de}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ie,{size:le.XXS,color:be.Secondary,nowrap:!0,align:"center",children:`${q}%`})}),t(Q,{variant:te.Secondary,size:ee.S,iconSize:20,leftIcon:oi,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ne,onClick:ue})]}),e(Z,{children:[t(ye,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(re,{variant:ao.Filled,options:[{value:Tc.Fit,label:"W: Fit"},{value:Tc.X10,label:"10x"}],selected:A,setSelected:D})}),t(ye,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(re,{variant:ao.Filled,options:[{value:kc.Fit,label:"H: Fit"},{value:kc.X10,label:"10x"}],selected:R,setSelected:P})})]}),t(Q,{variant:te.Secondary,size:ee.S,iconSize:24,leftIcon:N?fi:Oi,tooltip:N?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:J})]})]}),t(ye,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:N?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:A>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:k?"pointer":"default"},onPointerDown:W,onPointerMove:H,onPointerLeave:j,onClick:G})})})}),e(Z,{$justifyContent:"space-between",children:[t(ie,z?{size:le.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${se} • ${bc(M)} samples in view`}:{size:le.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ie,{size:le.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Ec(h.totalBytesUsed)} / ${Ec(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var Oc,Ac;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Oc||(Oc={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Ac||(Ac={}));const Dc=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Rc(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Ac.FilterOutVoid)&&"void"===o)return!1;if(t.includes(Ac.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&Dc.test(o)))return!1}return!0}const Pc={options:[{id:Ac.FilterOutVoid,label:"Filter out void symbols"},{id:Ac.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>Rc(e.cells.find(e=>e.key===Oc.Symbol)?.rawValue?.toString()??"",t)},Fc=({rows:e,languages:o,filters:n,onFiltersChange:a})=>{const i=r(()=>[{key:Oc.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(io.Java)?Pc:void 0,noFilter:!o?.includes(io.Java)},{key:Oc.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Oc.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),l=r(()=>e.map(e=>({cells:[{key:Oc.Symbol,rawValue:e.name},{key:Oc.Self,rawValue:bc(e.self)},{key:Oc.Total,rawValue:bc(e.total)}]})),[e]);return t(lo,{variant:so.Data,maxHeight:"calc(100vh - 306px)",columns:i,rows:l,filters:n,onFiltersChange:a,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Ri,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var Lc;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(Lc||(Lc={}));const _c=m(V)`
|
|
208
203
|
width: 100%;
|
|
209
204
|
flex: 1;
|
|
210
205
|
border-radius: 16px;
|
|
211
206
|
overflow: hidden;
|
|
212
207
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
213
208
|
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
214
|
-
`,
|
|
209
|
+
`,Bc=m.div`
|
|
215
210
|
display: flex;
|
|
216
211
|
align-items: center;
|
|
217
212
|
gap: 10px;
|
|
@@ -219,11 +214,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
219
214
|
padding: 12px 12px 8px;
|
|
220
215
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
221
216
|
border-radius: 16px 16px 0 0;
|
|
222
|
-
`,
|
|
217
|
+
`,zc=m(Z)`
|
|
223
218
|
flex-shrink: 0;
|
|
224
219
|
align-items: center;
|
|
225
220
|
gap: 4px;
|
|
226
|
-
`,
|
|
221
|
+
`,Mc=m.div`
|
|
227
222
|
flex: 1;
|
|
228
223
|
display: flex;
|
|
229
224
|
align-items: stretch;
|
|
@@ -231,20 +226,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
231
226
|
padding: 16px;
|
|
232
227
|
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
233
228
|
border-radius: 0 0 16px 16px;
|
|
234
|
-
`,
|
|
229
|
+
`,Xc=m(V)`
|
|
235
230
|
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
236
231
|
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
237
232
|
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
238
233
|
gap: 10px;
|
|
239
|
-
`,
|
|
234
|
+
`,Vc=m(V)`
|
|
240
235
|
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
241
236
|
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
242
237
|
gap: 10px;
|
|
243
|
-
`,
|
|
238
|
+
`,Uc=m(Z)`
|
|
244
239
|
width: 100%;
|
|
245
240
|
min-height: 32px;
|
|
246
241
|
flex-shrink: 0;
|
|
247
|
-
`,
|
|
242
|
+
`,Hc=({source:o,fetchProfilingSlots:i,enableProfiling:s,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=f(),g=o.id,[m,b]=l(!0),[v,y]=l(null),[C,S]=l(null),[w,x]=l(0),[T,k]=l(Lc.Both),[I,$]=l(""),[E,N]=l({}),O=d(null),A=c(async()=>{try{const e=[i()];m&&e.push(u(g));const[t,o]=await Promise.all(e);t&&y(t),o?.profileJson&&S(o.profileJson)}finally{x(e=>e+1)}},[i,u,g]);n(()=>{let e=!1;return(async()=>{await s(g),e||(await A(),e||(O.current=setInterval(A,3e3)))})(),()=>{e=!0,O.current&&clearInterval(O.current)}},[s,A,g]);const D=r(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(C),[C]),R=r(()=>D?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=fc(e,n[o+3]);if(!l)continue;const s=t.get(l);(!s||a>s.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(D.flamebearer):[],[D]),P=r(()=>{const e=I.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,I]),F=T===Lc.Table||T===Lc.Both,L=T===Lc.Flame||T===Lc.Both,_=F&&L,B=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),z=r(()=>function(e,t){if(!t?.includes(io.Java))return;const o=e?.[Oc.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>Rc(e,o):void 0}(E,B),[E,B]);return!C&&w<2?t(He,{$height:"70vh",children:t(Ye,{withSpinner:!0})}):e(_c,{$gap:0,$width:"100%",children:[e(Bc,{children:[t(ye,{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(zc,{children:t(ie,{size:le.S,weight:500,color:be.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(Z,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Mt,{value:I,onChange:$,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(re,{variant:ao.Filled,options:[{value:Lc.Table,label:"Top table"},{value:Lc.Flame,label:"Flame graph"},{value:Lc.Both,label:"Both"}],selected:T,setSelected:k}),t(Q,m?{variant:te.Secondary,size:ee.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(Pi,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:te.Secondary,size:ee.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Pi,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(Mc,{$gap:F&&L?16:0,children:D?e(a,{children:[F&&e(Xc,{$splitWithFlame:_,children:[t(Uc,{$justifyContent:"flex-end",children:t(Q,{variant:te.Secondary,size:ee.S,label:"Download snapshot",rightIcon:Fi,onClick:()=>{if(!C)return;const e=new Blob([C],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!C})}),t(Fc,{rows:P,languages:B,filters:E,onFiltersChange:N})]}),L&&e(Vc,{$splitWithTable:_,children:[e(Uc,{$justifyContent:"space-between",children:[t(Ie,{label:D?`Total in view ${bc(D.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:le.XXS}),e(Z,{$gap:12,children:[!m&&t(Q,{variant:te.Secondary,size:ee.S,label:"Refresh",leftIcon:Ti,onClick:A}),t(K,{label:"Auto refresh",labelAlign:Y.Left,size:it.S,value:m,onChange:b})]})]}),t(Nc,{flamebearer:D.flamebearer,maxRowPx:24,searchQuery:I,shouldKeepName:z,minHostHeight:280,onFullscreenChange:p,profilingSlots:v},T)]})]}):t(He,{children:t(ae,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},jc=[oo.Deployment,oo.StatefulSet,oo.DaemonSet,oo.DeploymentConfig,oo.Rollout,oo.Pod];var Wc;!function(e){e.Workload="Workload",e.Pod="Pod"}(Wc||(Wc={}));const Gc=e=>!!e&&Rt(e.status)===pe.Error,Kc=e=>Gc(e.healthStatus),Yc=e=>Gc(e.odigosHealthStatus)||(e.processes??[]).some(Kc),Jc=e=>Gc(e.agentInjectedStatus)||Gc(e.odigosHealthStatus)||(e.containers??[]).some(Yc),qc=({onClose:o,effectiveConfig:a,sourceId:i,fetchSourceById:s,persistSources:u,updateSource:p,restartWorkloads:h,restartPod:g,recoverFromRollback:m,fetchPeerSources:b,enableProfiling:v,fetchProfilingSlots:C,fetchSourceProfiling:S,fetchK8sManifest:w})=>{const x=f(),{isVm:T}=y(),{selectedStreamName:k}=Ae(),{genericForm:I,loadSource:$,validateFormData:E}=wl(),[N,O]=l(!1),[A,D]=l(!1),[R,P]=l(!1),[F,L]=l(ir.Overview),[_,B]=l(null),[z,M]=l({openFor:null}),X=(()=>{const[e,t]=l(null),o=c(e=>{t({tab:ir.Pods,podName:e.podName})},[]),n=c((e,o)=>{t({tab:ir.Pods,podName:e.podName,containerName:o.containerName})},[]),a=c((e,o,n)=>{const a=fr({identifyingAttributes:n.identifyingAttributes});t({tab:ir.Pods,podName:e.podName,containerName:o.containerName,processPid:a})},[]),i=c(()=>t(null),[]);return r(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:a,clearJumpToTarget:i}),[e,o,n,a,i])})();n(()=>{X.jumpToTarget&&L(X.jumpToTarget.tab)},[X.jumpToTarget]),n(()=>{_&&JSON.stringify(Ut(i))!==JSON.stringify(Ut(_))&&B(null)},[i,_]);const U=d(!1),H=c(async()=>B(await s(i)||null),[i]);n(()=>{if(U.current||(H(),U.current=!0),!N){const e=setInterval(()=>H(),3e3);return()=>clearInterval(e)}},[H,N]),n(()=>{_&&$(_)},[_]);const j=_&&jc.includes(_.id.kind),W=r(()=>{const e=[],o=(_?.pods??[]).some(Jc);return e.push({value:ir.Overview,label:Oe.OVERVIEW}),e.push({value:ir.Pods,label:Oe.PODS,icon:o?e=>t(ki,{...e,fill:x.v2.colors.red[500]}):void 0}),T||e.push({value:ir.PeerSources,label:Oe.PEER_SOURCES}),a?.profiling?.enabled&&e.push({value:ir.Profiling,label:Oe.PROFILING}),T||e.push({value:ir.Debug,label:Oe.DEBUG}),e},[T,a,_?.pods]),G=c(()=>O(!0),[]),K=c(()=>{_&&$(_),O(!1)},[_]),Y=c(async()=>{if(!_||!I)return;const{errorMessage:e,preparedFormData:t}=E();if(e)return;const o=t.otelServiceName!==_.id.name?t.otelServiceName:"";await p(i,{...t,otelServiceName:o}),O(!1)},[_,I,E,i,p]),J=c(()=>D(!0),[]),q=c(async()=>{_&&(await u({[dt]:[{namespace:_.id.namespace,name:_.id.name,kind:_.id.kind,selected:!1,currentStreamName:k}]}),D(!1),o())},[_,u,k,o]),Z=c(()=>{M({openFor:Wc.Workload})},[]),Q=c(e=>{L(e),X.clearJumpToTarget()},[X]),ee=c(async()=>{await m(i)},[m,i]),oe=c(async()=>{z.openFor===Wc.Workload?await h([i]):z.openFor===Wc.Pod&&z.podNamespace&&z.podName&&await g(z.podNamespace,z.podName),M({openFor:null})},[z,h,g,i]),ne=r(()=>{const e=[];return N||F===ir.Overview&&(e.push({id:"edit-source-btn-edit",label:ht.EDIT,icon:si,active:N,onClick:G}),!T&&j&&e.push({id:"edit-source-btn-restart",label:ht.RESTART,icon:Li,onClick:Z}),e.push({id:"edit-source-btn-delete",label:ht.DELETE,icon:ti,color:x.v2.colors.red[500],active:A,onClick:J})),e},[F,N,A,T,j,G,Z,J,x]),ae=r(()=>{if(!_)return[];const e=[],t={backgroundColor:"transparent",textSize:le.S};return e.push({...t,label:_.id.name,leftIcon:xi}),_.serviceName&&_.serviceName!==_.id.name&&e.push({...t,label:_.serviceName,leftIcon:wi,textColor:x.v2.colors.silver[200]}),e},[_,x]);if(!_)return t(pt,{isOpen:!0,children:t(He,{$height:"80vh",children:t(Ye,{withSpinner:!0})})});const ie=F===ir.Profiling?R?"95vw":"80vw":N?void 0:"60vw";return e(wr,{value:X,children:[t(pt,{isOpen:!0,width:ie,header:{icon:ro(_.containers)[0],titleBadges:ae,onClose:()=>{Q(ir.Overview),B(null),P(!1),o()},actions:ne},footer:{actions:N?[{"data-id":"edit-source-btn-cancel",label:ht.CANCEL,variant:te.Secondary,onClick:K},{"data-id":"edit-source-btn-save",label:ht.SAVE,variant:te.Primary,onClick:Y}]:[]},children:t(gt,{$padding:"4px 12px 12px",children:e(V,{$gap:16,children:[!N&&W.length>1&&t(re,{options:W,selected:F,setSelected:Q}),(()=>{switch(F){case ir.Overview:return N?t(ss,{}):t(gc,{source:_,onClickRollout:Z,onClickRollback:ee,onOverride:e=>p(i,e)});case ir.Pods:return t(Er,{source:_,onClickRestartPod:j?(e,t)=>M({openFor:Wc.Pod,podNamespace:e,podName:t}):void 0});case ir.PeerSources:return t(Nr,{source:_,fetchPeerSources:b});case ir.Profiling:return t(Hc,{source:_,fetchProfilingSlots:C,enableProfiling:v,fetchSourceProfiling:S,onFlameFullscreenChange:P});case ir.Debug:return t(mc,{source:_,fetchK8sManifest:w});default:return null}})()]})})}),t(pl,{target:"source",action:"uninstrument",isOpen:A,onClose:()=>D(!1),onApprove:q}),t(pl,{target:`${z.openFor?.toLowerCase()??""}`,action:"restart",description:Oe.RESTART_POD_DESCRIPTION,isOpen:!!z.openFor,onClose:()=>M({openFor:null}),onApprove:oe,overrideApproveButtonLabel:Oe.DELETE_POD_TO_RESTART})]})},Zc=m.div`
|
|
248
243
|
display: flex;
|
|
249
244
|
align-items: center;
|
|
250
245
|
gap: 8px;
|
|
@@ -254,9 +249,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
254
249
|
&:hover {
|
|
255
250
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
256
251
|
}
|
|
257
|
-
`,
|
|
252
|
+
`,Qc=m.div`
|
|
258
253
|
flex: 1;
|
|
259
|
-
`,
|
|
254
|
+
`,ed=({onClick:o})=>{const n=f().v2.colors.red[500];return e(Zc,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(ie,{size:le.XS,weight:500,color:n,children:ho}),t(ti,{size:16,fill:n})]})};function td(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:s}=n;return{children:e(o,{children:[t(ed,{onClick:l}),s&&t(ue,{status:pe.Warning,message:s.message,action:s.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:s.onViewRule}:void 0}),t(Qc,{}),t(Q,{"data-id":"sampling-view-edit-btn-cancel",label:co,variant:te.Secondary,size:ee.S,onClick:a}),t(Q,{"data-id":"sampling-view-edit-btn-save",label:uo,variant:te.Primary,size:ee.S,onClick:i,disabled:!!s})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(ed,{onClick:a}),t(Qc,{}),t(Q,{"data-id":"sampling-view-btn-cancel",label:co,variant:te.Secondary,size:ee.S,onClick:i}),t(Q,{"data-id":"sampling-view-btn-edit",label:po,variant:te.Primary,size:ee.S,onClick:l})]})}}const od={[Tl.EditAutoNoisy]:{title:To,subTitle:xo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Tl.EditAutoCostReduction]:{title:wo,subTitle:So,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Tl.EditAutoHighlyRelevant]:{title:Co,subTitle:yo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},nd=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(pt,{isOpen:e,width:Io,header:{icon:_i,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(gt,{$padding:"12px",children:t(hs,{})})}),ad=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:l})=>{const{category:s,formData:r,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=xl(Tl.Create);n(()=>{e&&d()},[e]);const h=c(()=>{if(i){const e=i(r);if(e)return void p(e)}a(r)},[r,a,i,p]),g={note:u?{status:pe.Warning,message:u.message,action:l?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>l(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:co,variant:te.Secondary,size:ee.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:bo,variant:te.Primary,size:ee.S,onClick:h,disabled:!!u}]};return t(nd,{isOpen:e,title:vo[s],subTitle:go[s],onClose:o,footer:g})},id=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:a,onNavigateToDuplicate:i})=>{const{data:l,isEditing:s,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:g}=xl(Tl.View),m=l?.rule.name||fo,f=s&&l?mo[l.category]:`${m} preview`,b=c(()=>{if(l&&s){if(a){const e=a(d);if(e)return void g(e)}n(d,l.rule.ruleId,l.samplingId)}},[l,s,d,n,a,g]),v=c(()=>{l&&o(l.rule.ruleId,l.samplingId)},[l,o]),y=r(()=>{if(!l)return;const t=h?{message:h.message,onViewRule:i?()=>i(h.ruleId):void 0}:null;return td(s?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[l,s,h,p,b,v,u,e,i]);return t(nd,{isOpen:!!l,title:f,subTitle:l?go[l.category]:"",onClose:e,footer:y})},ld=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=xl(Tl.EditAutoNoisy),l=c(()=>n(a,i),[n,a,i]);return t(cd,{formType:Tl.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},sd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=xl(Tl.EditAutoCostReduction),l=c(()=>n(a,i),[n,a,i]);return t(cd,{formType:Tl.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},rd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=xl(Tl.EditAutoHighlyRelevant),i=c(()=>n(a),[n,a]);return t(cd,{formType:Tl.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},cd=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=od[e];return t(nd,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:co,variant:te.Secondary,size:ee.S,onClick:n},{"data-id":i.saveId,label:ko,variant:te.Primary,size:ee.S,onClick:a}]}})},dd=e=>{switch(e.formType){case Tl.Create:return t(Ol,{formType:Tl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(ad,{...e})});case Tl.View:return t(Ol,{formType:Tl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(id,{...e})});case Tl.EditAutoNoisy:return t(Ol,{formType:Tl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(ld,{...e})});case Tl.EditAutoCostReduction:return t(Ol,{formType:Tl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(sd,{...e})});case Tl.EditAutoHighlyRelevant:return t(Ol,{formType:Tl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(rd,{...e})})}},ud=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:s,onSave:r,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=Kt(),g=!i||a||!c.newToken;return $o({key:"Enter",active:!g},r),e(Z,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(oe,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(Z,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(Ye,{title:"Saving...",withGradient:!0}):e(o,{children:[t(Q,{variant:te.Secondary,size:ee.S,leftIcon:fi,onClick:s,disabled:a}),t(Q,{variant:te.Primary,size:ee.S,leftIcon:mi,onClick:r,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ie,{size:le.XS,children:new Array(55).fill("•").join("")}),e(Z,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(Ge,{icon:si,onClick:l})]})]})},pd=({expiresAt:e,callbackValid:o,callbackExpired:a})=>{const{formatTimeAgo:i}=Et(),l=r(()=>i(e),[e,i]),s=r(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=r(()=>Eo(e,0)?pe.Error:Eo(e,2592e6)?pe.Warning:pe.Success,[e]),d=r(()=>c===pe.Success?mi:c===pe.Warning?Bi:ki,[c]);return n(()=>{c===pe.Success?o():c===pe.Error&&a()},[c]),t(ye,{text:s,children:t(Ie,{leftIcon:d,label:l,status:c,invertColors:!0,useSecondaryTone:!0})})},hd=m.div`
|
|
260
255
|
display: flex;
|
|
261
256
|
flex-direction: column;
|
|
262
257
|
gap: 12px;
|
|
@@ -264,7 +259,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
264
259
|
border-radius: 12px;
|
|
265
260
|
border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
|
|
266
261
|
background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
|
|
267
|
-
`,
|
|
262
|
+
`,gd=({children:e})=>{const o=f();return t(ie,{size:le.XXXS,color:o.v2.colors.grey[150],children:e})},md=({token:o,updateToken:n})=>{const[a,i]=l(!1),[s,r]=l(!1),[c,d]=l(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:g,resetFormData:m}=vt({newToken:""});return t(Me,{richTitle:{icon:zi,title:"Odigos Pro Token"},children:e(hd,{$isExpired:c,children:[e(Z,{$justifyContent:"space-between",children:[e(V,{$gap:4,children:[t(gd,{children:"Issued for"}),t(ie,{size:le.XS,children:o.name||"N/A"})]}),e(V,{$gap:4,children:[t(gd,{children:"Expiration"}),t(pd,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(V,{})]}),t(Z,{children:e(V,{children:[t(gd,{children:"Token"}),t(ud,{token:o.token,newToken:u.newToken,isLoading:s,isEditing:a,onEdit:()=>i(!0),onCancel:()=>(i(!1),r(!1),void p("newToken","")),onSave:()=>(async()=>{r(!0);const e=await n(u.newToken.trim());r(!1),e?.error?g("newToken",e.error):(i(!1),m())})(),formData:u,handleFormChange:p,handleErrorChange:g,formErrors:h})]})})]})})},fd=m.div`
|
|
268
263
|
display: flex;
|
|
269
264
|
flex-direction: column;
|
|
270
265
|
align-items: center;
|
|
@@ -273,23 +268,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
273
268
|
padding: 12px 24px;
|
|
274
269
|
border-radius: 8px;
|
|
275
270
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
276
|
-
`,Sd=({downloadDiagnose:o})=>{const{progress:n}=ut(),{namespaces:a}=at(),[i,s]=l(null),{formData:r,handleFormChange:c,resetFormData:d}=wt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ue,{richTitle:{icon:Ui,title:"Diagnose"},children:i?e(Cd,{children:[t(Qe,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[pt.DownloadingDiagnose]?.percentage,percentage:n[pt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[pt.DownloadingDiagnose]?.percentage,visualIcon:Mi,startedAt:i}),n[pt.DownloadingDiagnose]?.list?.length&&t(V,{$width:"100%",children:n[pt.DownloadingDiagnose].list.map(o=>e(te,{$gap:4,$alignItems:"center",children:[o.status===ge.Success?t(vi,{size:16}):o.status===ge.Error?t(yi,{size:16}):t(Qe,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:o.label})]},o.label))})]}):e(V,{$gap:24,children:[t(re,{size:ce.XXS,color:Ce.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(V,{$gap:16,children:[e(te,{$gap:8,children:[t(H,{label:"Profiles",value:r.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:"Include pprof profiles"})]}),e(te,{$gap:8,children:[t(H,{label:"Metrics",value:r.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:"Include Prometheus metrics"})]}),e(te,{$gap:8,children:[t(H,{label:"Source Workloads",value:r.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Do,{alignX:Fo.Left,alignY:Ro.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:r.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(r.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:ae.Secondary,disabled:r.includeSourceWorkloads,leftIcon:r.sourceWorkloadNamespaces.length?()=>t(Ee,{label:r.sourceWorkloadNamespaces.length,status:ge.Default}):void 0}}),t(te,{$justifyContent:"flex-end",children:t(oe,{label:"Download Diagnose",rightIcon:Mi,variant:ae.Primary,onClick:async()=>{s(Date.now()),await o(r),s(null),d()},disabled:null!==i})})]})})},wd=({fetchDescribeOdigos:e})=>{const{platformType:o,version:a,tier:i}=y(),[s,r]=l(null);return n(()=>{e().then(({data:e})=>r(e?.describeOdigos||null))},[]),t(Ue,{richTitle:{icon:Hi,title:"General Information"},children:t(yt,{cellsPerRow:2,items:[{id:Po(),title:"Odigos Version",label:a},{id:Po(),title:`${o.toUpperCase()} Version`,label:s?.kubernetesVersion?.value||"-"},{id:Po(),title:"Installation Method",label:s?.installationMethod?.value||"-"},{id:Po(),title:"Tier",label:i}]})})},xd=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:s})=>e(ft,{isOpen:o,header:{icon:Hi,title:"System Overview",onClose:n},children:[l&&t(wd,{fetchDescribeOdigos:l}),i&&a&&t(yd,{token:a,updateToken:i}),s&&t(Sd,{downloadDiagnose:s})]}),kd=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:l})=>{const{addDataStreams:s,setSelectedStreamName:r}=Fe(),{requestSubmit:d}=kl(),u=c(async e=>{l?await l(e):(s([e]),r(e.name)),a()},[l,s,r,a]),p=c(()=>d(u),[d,u]);return Oo({key:"Enter",active:n},p),e(o,{children:[t(De,{isOpen:n,onClose:a,onCloseEnd:i,title:Re.NAME_YOUR_STREAM,description:Re.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:bt.DONE,variant:ae.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:a},children:t(ps,{autoFocus:!0})}),t(us,{})]})},Td=({isOpen:a,onClose:i,onCloseEnd:l,dataStreamName:s,updateDataStream:r})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=kl();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,m=c(async e=>{await r(s,e),i()},[r,s,i]),g=c(()=>p(m),[p,m]);return Oo({key:"Enter",active:a},g),e(o,{children:[t(De,{isOpen:a,onClose:i,onCloseEnd:l,title:Re.RENAME_STREAM(s),description:Re.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:i},children:t(ps,{autoFocus:!0})}),t(us,{})]})},$d=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),Nd=g.div`
|
|
271
|
+
`,bd=({downloadDiagnose:o})=>{const{progress:n}=st(),{namespaces:a}=et(),[i,s]=l(null),{formData:r,handleFormChange:c,resetFormData:d}=vt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Me,{richTitle:{icon:Mi,title:"Diagnose"},children:i?e(fd,{children:[t(Ye,{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:Fi,startedAt:i}),n[rt.DownloadingDiagnose]?.list?.length&&t(V,{$width:"100%",children:n[rt.DownloadingDiagnose].list.map(o=>e(Z,{$gap:4,$alignItems:"center",children:[o.status===pe.Success?t(mi,{size:16}):o.status===pe.Error?t(fi,{size:16}):t(Ye,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ie,{size:le.XXXS,color:be.Secondary,children:o.label})]},o.label))})]}):e(V,{$gap:24,children:[t(ie,{size:le.XXS,color:be.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(V,{$gap:16,children:[e(Z,{$gap:8,children:[t(H,{label:"Profiles",value:r.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ie,{size:le.XXXS,color:be.Secondary,children:"Include pprof profiles"})]}),e(Z,{$gap:8,children:[t(H,{label:"Metrics",value:r.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(ie,{size:le.XXXS,color:be.Secondary,children:"Include Prometheus metrics"})]}),e(Z,{$gap:8,children:[t(H,{label:"Source Workloads",value:r.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(ie,{size:le.XXXS,color:be.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(No,{alignX:Ao.Left,alignY:Oo.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:r.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(r.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:te.Secondary,disabled:r.includeSourceWorkloads,leftIcon:r.sourceWorkloadNamespaces.length?()=>t(Ie,{label:r.sourceWorkloadNamespaces.length,status:pe.Default}):void 0}}),t(Z,{$justifyContent:"flex-end",children:t(Q,{label:"Download Diagnose",rightIcon:Fi,variant:te.Primary,onClick:async()=>{s(Date.now()),await o(r),s(null),d()},disabled:null!==i})})]})})},vd=({fetchDescribeOdigos:e})=>{const{platformType:o,version:a,tier:i}=y(),[s,r]=l(null);return n(()=>{e().then(({data:e})=>r(e?.describeOdigos||null))},[]),t(Me,{richTitle:{icon:Xi,title:"General Information"},children:t(mt,{cellsPerRow:2,items:[{id:Do(),title:"Odigos Version",label:a},{id:Do(),title:`${o.toUpperCase()} Version`,label:s?.kubernetesVersion?.value||"-"},{id:Do(),title:"Installation Method",label:s?.installationMethod?.value||"-"},{id:Do(),title:"Tier",label:i}]})})},yd=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:s})=>e(pt,{isOpen:o,header:{icon:Xi,title:"System Overview",onClose:n},children:[l&&t(vd,{fetchDescribeOdigos:l}),i&&a&&t(md,{token:a,updateToken:i}),s&&t(bd,{downloadDiagnose:s})]}),Cd=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:l})=>{const{addDataStreams:s,setSelectedStreamName:r}=Ae(),{requestSubmit:d}=Sl(),u=c(async e=>{l?await l(e):(s([e]),r(e.name)),a()},[l,s,r,a]),p=c(()=>d(u),[d,u]);return $o({key:"Enter",active:n},p),e(o,{children:[t(Ne,{isOpen:n,onClose:a,onCloseEnd:i,title:Oe.NAME_YOUR_STREAM,description:Oe.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:ht.DONE,variant:te.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:ht.CANCEL,variant:te.Secondary,onClick:a},children:t(ls,{autoFocus:!0})}),t(is,{})]})},Sd=({isOpen:a,onClose:i,onCloseEnd:l,dataStreamName:s,updateDataStream:r})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=Sl();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,g=c(async e=>{await r(s,e),i()},[r,s,i]),m=c(()=>p(g),[p,g]);return $o({key:"Enter",active:a},m),e(o,{children:[t(Ne,{isOpen:a,onClose:i,onCloseEnd:l,title:Oe.RENAME_STREAM(s),description:Oe.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:ht.SAVE,variant:te.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:ht.CANCEL,variant:te.Secondary,onClick:i},children:t(ls,{autoFocus:!0})}),t(is,{})]})},wd=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),xd=m.div`
|
|
277
272
|
position: absolute;
|
|
278
273
|
top: 50%;
|
|
279
274
|
left: 50%;
|
|
280
275
|
transform: translate(-50%, -50%);
|
|
281
276
|
z-index: ${({theme:e})=>e.v2.zIndex.modal};
|
|
282
|
-
`,
|
|
277
|
+
`,Td="onboarding-done",kd=()=>{const{currentModal:o,setCurrentModal:n}=Ro(),a=()=>n("");return e(Po,{isOpen:o===Td,onClose:a,children:[t(wd,{}),t(xd,{children:e(V,{$gap:32,$alignItems:"center",children:[e(V,{$gap:24,$alignItems:"center",children:[t(ie,{size:le.L,weight:500,children:"Welcome to"}),t(ml,{size:260}),t(ie,{size:le.S,weight:400,children:"Your observability control plane is ready."})]}),t(Q,{label:"Get Started",rightIcon:Vi,onClick:a})]})})]})},Id=m.div`
|
|
283
278
|
display: flex;
|
|
284
279
|
flex-direction: column;
|
|
285
280
|
gap: 8px;
|
|
286
281
|
padding: 4px 8px;
|
|
287
282
|
border-radius: 8px;
|
|
288
283
|
width: calc(100% - 16px);
|
|
289
|
-
|
|
284
|
+
`,$d=m.div`
|
|
290
285
|
white-space: pre;
|
|
291
286
|
overflow-x: auto;
|
|
292
|
-
`,
|
|
287
|
+
`,Ed=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:s,toggleName:r})=>{const c=f();return e(Id,{children:[e(Z,{$gap:8,$justifyContent:"space-between",children:[e(Z,{$gap:4,children:[t(ie,{size:le.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Ie,{label:Fo,leftIcon:Ui,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:le.XXXS})]}),t(K,{name:r??`sampling-onboarding-toggle-${o}`,label:a,labelAlign:Y.Left,value:i,onChange:l,size:it.S})]}),t($d,{children:t(S,{parts:s})})]})},Nd=m.div`
|
|
293
288
|
position: relative;
|
|
294
289
|
display: flex;
|
|
295
290
|
align-items: center;
|
|
@@ -299,18 +294,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
299
294
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
300
295
|
border-top-left-radius: 18px;
|
|
301
296
|
border-top-right-radius: 18px;
|
|
302
|
-
`,
|
|
297
|
+
`,Od=m.div`
|
|
303
298
|
position: absolute;
|
|
304
299
|
left: 16px;
|
|
305
300
|
top: 50%;
|
|
306
301
|
transform: translateY(-50%);
|
|
307
|
-
`,
|
|
302
|
+
`,Ad=m.div`
|
|
308
303
|
height: 16px;
|
|
309
304
|
width: 100%;
|
|
310
305
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
311
306
|
border-top-left-radius: 18px;
|
|
312
307
|
border-top-right-radius: 18px;
|
|
313
|
-
`,
|
|
308
|
+
`,Dd=m.div`
|
|
314
309
|
width: ${({$width:e})=>e}px;
|
|
315
310
|
display: flex;
|
|
316
311
|
flex-direction: column;
|
|
@@ -318,7 +313,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
318
313
|
gap: 22px;
|
|
319
314
|
padding: 8px 32px 32px 32px;
|
|
320
315
|
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
321
|
-
`,
|
|
316
|
+
`,Rd=e=>t(Hi,{rotate:90,...e}),Pd=({children:o,center:n,onNext:a,nextLabel:i=Lo,nextLoading:l})=>e(Z,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,a&&t(Q,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:Rd,variant:te.Primary,size:ee.M,onClick:a,loading:l})]}),Fd=e=>t(Hi,{rotate:-90,...e}),Ld=({title:o,onBack:n})=>{const a=f();return e(Nd,{$hasBack:!!n,children:[n&&t(Od,{children:t(Ge,{"data-id":"sampling-onboarding-back",icon:Fd,size:Ke.M,onClick:n})}),t(ie,{size:le.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},_d=m.div`
|
|
322
317
|
box-sizing: border-box;
|
|
323
318
|
width: ${({$width:e})=>e??"100%"};
|
|
324
319
|
${({$fillHeight:e})=>e&&b`
|
|
@@ -331,16 +326,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
331
326
|
padding: 16px;
|
|
332
327
|
border-radius: 16px;
|
|
333
328
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
334
|
-
`,
|
|
329
|
+
`,Bd=({children:e,fillHeight:o,width:n})=>t(_d,{$fillHeight:o,$width:n,children:e}),zd=m.ul`
|
|
335
330
|
margin: 0;
|
|
336
331
|
padding: 0;
|
|
337
332
|
list-style: disc;
|
|
338
|
-
`,
|
|
333
|
+
`,Md=m.li`
|
|
339
334
|
margin-left: 18px;
|
|
340
335
|
& + & {
|
|
341
336
|
margin-top: 6px;
|
|
342
337
|
}
|
|
343
|
-
`,
|
|
338
|
+
`,Xd=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(zd,{children:e.map((e,o)=>t(Md,{style:{color:a},children:t(ie,{size:le.XXS,color:a,children:e})},o))})},Vd=({items:o})=>{const n=f();return t(V,{$gap:16,children:o.map((o,a)=>e(Z,{$gap:8,$alignItems:"flex-start",children:[e(ie,{size:le.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(V,{$gap:2,children:[t(ie,{size:le.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(ie,{size:le.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},Ud=({message:e})=>t(ue,{status:pe.Default,message:e,fullWidth:!0,smallIcon:!0}),Hd=m.div`
|
|
344
339
|
width: calc(100% - 16px);
|
|
345
340
|
padding: 8px;
|
|
346
341
|
display: flex;
|
|
@@ -348,12 +343,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
348
343
|
gap: 4px;
|
|
349
344
|
border-radius: 16px;
|
|
350
345
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
351
|
-
`,
|
|
346
|
+
`,jd=m.div`
|
|
352
347
|
display: flex;
|
|
353
348
|
align-items: center;
|
|
354
349
|
gap: 8px;
|
|
355
350
|
padding: 4px 8px 12px 8px;
|
|
356
|
-
`,
|
|
351
|
+
`,Wd=m.div`
|
|
357
352
|
width: calc(100% - 16px);
|
|
358
353
|
display: flex;
|
|
359
354
|
flex-direction: column;
|
|
@@ -361,20 +356,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
361
356
|
padding: 8px;
|
|
362
357
|
border-radius: 12px;
|
|
363
358
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
364
|
-
`,
|
|
359
|
+
`,Gd=({children:e})=>{const o=f();return t(ie,{size:le.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Kd=m.div`
|
|
365
360
|
white-space: pre-line;
|
|
366
|
-
`,
|
|
361
|
+
`,Yd=({enabled:n,onEnabledChange:a,onBack:i,onNext:l})=>{const s=f(),c=r(()=>w({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(Ld,{title:_o,onBack:i}),e(Dd,{$width:854,children:[t(Gd,{children:Bo}),e(V,{$gap:8,$width:"100%",children:[t(Bd,{children:t(Kd,{children:t(ie,{size:le.XXS,color:s.v2.colors.silver[200],children:zo})})}),e(V,{$gap:8,$width:"100%",children:[e(Hd,{children:[t(jd,{children:t(ie,{size:le.S,weight:500,color:s.v2.colors.white[500],children:Mo})}),t(Wd,{children:t(Ed,{name:Vo,recommended:!0,toggleLabel:Xo,enabled:n,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Ud,{message:Uo})]})]})]}),t(Pd,{onNext:l})]})},Jd=e=>t(Hi,{rotate:90,...e}),qd=({onClose:n})=>{const a=f();return e(o,{children:[t(Ad,{}),e(Dd,{$width:732,children:[t(Ho,{icon:_i}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ie,{size:le.M,weight:500,color:a.v2.colors.white[500],children:jo}),Wo.split("\n").map(e=>t(Gd,{children:e},e)),e(Bd,{children:[t(ie,{size:le.XS,color:a.v2.colors.silver[200],children:Go}),t(Xd,{color:a.v2.colors.white[500],items:[Ko,Yo,Jo]})]})]})]}),t(Pd,{center:!0,children:t(Q,{"data-id":"sampling-onboarding-btn-go-to",label:qo,rightIcon:Jd,variant:te.Primary,size:ee.M,onClick:n})})]})},Zd=e=>t(Hi,{rotate:90,...e}),Qd=m.div`
|
|
367
362
|
display: flex;
|
|
368
363
|
flex-direction: column;
|
|
369
364
|
align-items: center;
|
|
370
365
|
gap: 8px;
|
|
371
366
|
width: 100%;
|
|
372
|
-
`,
|
|
367
|
+
`,eu=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(Ad,{}),e(Dd,{$width:732,children:[t(Ho,{icon:_i}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Qd,{children:[t(ie,{size:le.M,weight:500,color:i.v2.colors.white[500],children:Zo}),t(Gd,{children:Qo})]}),e(Bd,{children:[t(ie,{size:le.XS,color:i.v2.colors.silver[200],children:en}),t(Vd,{items:[{title:on,description:tn},{title:an,description:nn},{title:sn,description:ln}]}),t(Ud,{message:rn})]})]})]}),e(Pd,{center:!0,children:[t(Q,{"data-id":"sampling-onboarding-btn-skip",label:cn,variant:te.Secondary,onClick:n}),t(Q,{"data-id":"sampling-onboarding-btn-start",label:dn,rightIcon:Zd,variant:te.Primary,onClick:a})]})]})},tu=m.div`
|
|
373
368
|
display: flex;
|
|
374
369
|
align-items: stretch;
|
|
375
370
|
gap: 16px;
|
|
376
371
|
width: 100%;
|
|
377
|
-
`,
|
|
372
|
+
`,ou=m.div`
|
|
378
373
|
flex: 1;
|
|
379
374
|
display: flex;
|
|
380
375
|
flex-direction: column;
|
|
@@ -394,18 +389,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
394
389
|
background-color: ${t.v2.colors.silver[700]};
|
|
395
390
|
}
|
|
396
391
|
`}
|
|
397
|
-
`,
|
|
392
|
+
`,nu=m.div`
|
|
398
393
|
display: flex;
|
|
399
394
|
align-items: center;
|
|
400
395
|
gap: 8px;
|
|
401
396
|
padding: 12px 16px;
|
|
402
|
-
`,
|
|
397
|
+
`,au=m.div`
|
|
403
398
|
flex: 1;
|
|
404
399
|
padding: 8px;
|
|
405
400
|
display: flex;
|
|
406
401
|
flex-direction: column;
|
|
407
402
|
gap: 8px;
|
|
408
|
-
`,
|
|
403
|
+
`,iu=m.div`
|
|
409
404
|
flex: 1;
|
|
410
405
|
display: flex;
|
|
411
406
|
flex-direction: column;
|
|
@@ -413,17 +408,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
413
408
|
padding: 12px;
|
|
414
409
|
border-radius: 12px;
|
|
415
410
|
background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
|
|
416
|
-
`,
|
|
411
|
+
`,lu=m.div`
|
|
417
412
|
display: flex;
|
|
418
413
|
justify-content: flex-end;
|
|
419
|
-
`,
|
|
414
|
+
`,su=m.div`
|
|
420
415
|
display: flex;
|
|
421
416
|
align-items: center;
|
|
422
417
|
gap: 8px;
|
|
423
418
|
padding: 4px 12px 4px 4px;
|
|
424
419
|
border-radius: 8px;
|
|
425
420
|
background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
|
|
426
|
-
`,
|
|
421
|
+
`,ru=m.div`
|
|
427
422
|
display: flex;
|
|
428
423
|
align-items: center;
|
|
429
424
|
justify-content: center;
|
|
@@ -431,13 +426,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
431
426
|
height: 24px;
|
|
432
427
|
border-radius: 6px;
|
|
433
428
|
background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
|
|
434
|
-
`,
|
|
429
|
+
`,cu=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:s,warning:r,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(ou,{$selected:o,onClick:n,children:[e(nu,{children:[t($n,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:En.L}),t(_i,{size:24,fill:d.v2.colors.white[500]}),t(ie,{size:le.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(au,{children:[e(iu,{$selected:o,children:[e(V,{$gap:8,children:[t(Ie,{...l,textSize:le.XXXS}),t(ie,{size:le.XXS,color:u,children:i})]}),s&&s.length>0&&t(Xd,{color:u,items:s}),r&&e(su,{children:[t(ru,{children:t(Bi,{size:18,fill:d.v2.colors.yellow[500]})}),t(ie,{size:le.XXXS,color:d.v2.colors.yellow[500],children:r})]})]}),c&&t(lu,{children:t(Q,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:Nn,rightIcon:ni,variant:te.Text,size:ee.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},du=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:s})=>{const r=f(),c=s?()=>window.open(s,"_blank"):void 0;return e(o,{children:[t(Ld,{title:un,onBack:i}),e(Dd,{$width:854,children:[t(Gd,{children:pn}),e(tu,{children:[t(cu,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:vn,description:bn,badgeProps:{label:fn,backgroundColor:r.v2.colors.purple[500],textColor:r.v2.colors.white[500]},bullets:[gn,mn],warning:hn,onReadMore:c}),t(cu,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:xn,description:wn,badgeProps:{label:Sn,backgroundColor:r.v2.colors.green[500],textColor:r.v2.colors.black[500]},bullets:[yn,Cn],onReadMore:c}),t(cu,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:In,description:kn,badgeProps:{label:Tn,backgroundColor:r.v2.colors.blue[700],textColor:r.v2.colors.white[500]},onReadMore:c})]})]}),t(Pd,{onNext:l})]})},uu=({onBack:n,onNext:a,submitting:i})=>{const l=f(),s=r(()=>[{title:Rn,bullets:[On,An,Dn]},{title:zn,bullets:[Pn,Fn,Ln,_n,Bn]}],[]);return e(o,{children:[t(Ld,{title:Mn,onBack:n}),e(Dd,{$width:854,children:[t(Gd,{children:Xn}),t(Z,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(Bd,{fillHeight:!0,width:"50%",children:[t(ie,{size:le.XS,color:l.v2.colors.white[500],children:o.title}),t(Xd,{items:o.bullets})]},n))}),t(Ud,{message:Vn})]}),t(Pd,{onNext:a,nextLoading:i})]})},pu=m.div`
|
|
435
430
|
white-space: pre-line;
|
|
436
|
-
`,
|
|
431
|
+
`,hu=({errorPresetEnabled:n,onErrorPresetChange:a,onBack:i,onNext:l,submitting:s})=>{const c=f(),d=r(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(Ld,{title:Un,onBack:i}),e(Dd,{$width:854,children:[t(Gd,{children:Hn}),e(V,{$gap:8,$width:"100%",children:[e(Bd,{children:[t(pu,{children:t(ie,{size:le.XXS,color:c.v2.colors.silver[200],children:jn})}),t(Ud,{message:Vn})]}),e(Hd,{children:[e(jd,{children:[t(ie,{size:le.S,weight:500,color:c.v2.colors.white[500],children:Wn}),t(Ii,{size:16,fill:c.v2.colors.silver[200]})]}),t(Wd,{children:t(Ed,{name:Kn,recommended:!0,toggleLabel:Gn,enabled:n,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Pd,{onNext:l,nextLoading:s})]})},gu=m.div`
|
|
437
432
|
white-space: pre-line;
|
|
438
|
-
`,
|
|
433
|
+
`,mu=m.div`
|
|
439
434
|
width: fit-content;
|
|
440
|
-
`,Cu=["50","25","10","1","0.1"],Su=({value:o,onChange:n,label:a})=>{const i=f(),l=r(()=>Cu.map(e=>({value:e,label:`${e}%`,selectedBgColor:i.v2.colors.purple[900],selectedBorderColor:i.v2.colors.purple[400]})),[i]);return e(V,{$gap:8,children:[t(re,{size:ce.XS,color:i.v2.colors.white[500],children:a}),t(yu,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:l,selected:o,setSelected:n})})]})},wu=({errorPresetEnabled:n,onErrorPresetChange:a,ambientPercentage:i,onAmbientPercentageChange:l,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=r(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(zd,{title:Zn,onBack:s}),e(Ld,{$width:854,children:[t(qd,{children:Qn}),e(V,{$gap:8,$width:"100%",children:[e(Vd,{children:[t(vu,{children:t(re,{size:ce.XXS,color:u.v2.colors.silver[200],children:ea})}),t(jd,{items:[ta,oa,na,aa,ia]}),t(Gd,{message:jn})]}),e(Kd,{children:[e(Yd,{children:[t(re,{size:ce.S,weight:500,color:u.v2.colors.white[500],children:la}),t(Ei,{size:16,fill:u.v2.colors.silver[200]})]}),t(Jd,{children:t(Dd,{name:qn,recommended:!0,toggleLabel:Jn,enabled:n,onEnabledChange:a,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Jd,{children:t(Su,{value:i,onChange:l,label:sa})})]})]})]}),t(Md,{onNext:c,nextLoading:d})]})},xu=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:r,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=l("welcome"),[m,g]=l(!0),[f,b]=l("keep-list"),[v,y]=l(!0),[C,S]=l("25"),[w,x]=l(!1);n(()=>{e&&(h("welcome"),g(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const k=c(async()=>{const e=i??"default",t=[];m!==(a?.enabled??!1)&&t.push(r(m,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,r,m,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let T=null;switch(p){case"welcome":T=t(au,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":T=t(Qd,{enabled:m,onEnabledChange:g,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":T=t(mu,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(wu,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"drop-list":T=t(bu,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"advanced":T=t(gu,{onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"success":T=t(tu,{onClose:o})}return t(_o,{isOpen:e,onClose:o,children:T})};var ku,Tu;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(ku||(ku={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Tu||(Tu={}));const $u=[{key:Tu.Name,label:"Name"},{key:Tu.Type,label:"Type",textAlign:"right"},{key:Tu.Status,label:"Status"},{key:Tu.OdigosVersion,label:"Odigos Version"},{key:Tu.ConnectedSince,label:"Connected Since"},{key:Tu.LastActivity,label:"Last Activity"}],Nu=(e,t)=>{const o=e.find(e=>e.key===Tu.Id)?.rawValue;return t(o?.toString()||"")},Iu=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Tu.Status)?.rawValue===ge.Success)(e))return[{id:Po(),label:"Delete Connection",rightIcon:ci,onClick:()=>Nu(e,a)}];const d=Nu(e,e=>{const n=t.find(t=>t.id===e);return!!n&&k(n.odigosVersion,o)}),u=Nu(e,e=>{const o=t.find(t=>t.id===e);return!!o&&k(o.odigosVersion,n)}),p=[];return i&&p.push({id:Po(),tooltip:u?Re.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Si,disabled:!u,onClick:()=>Nu(e,i)}),l&&p.push({id:Po(),tooltip:Re.ADD_DESTINATION,rightIcon:gi,onClick:()=>Nu(e,l)}),s&&p.push({id:Po(),tooltip:Re.ADD_ACTION,rightIcon:mi,onClick:()=>Nu(e,s)}),r&&p.push({id:Po(),tooltip:Re.ADD_INSTRUMENTATION_RULE,rightIcon:Ci,onClick:()=>Nu(e,r)}),c&&p.push({id:Po(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:xi,disabled:!d,onClick:()=>Nu(e,c)}),p}},Eu=({tableRowsMaxHeight:o,connections:a,getConnections:i,onClickConnection:s,deleteConnection:d,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:h,snapshotMinSupportedVersion:m=0,getAllClusterSnapshots:g,persistSources:b,getDestinationCategories:v,getPotentialDestinations:C,testConnection:S,createDestination:w,updateDestination:x,createAction:T,createInstrumentationRule:$})=>{const N=f(),{isVm:I}=y(),{formatTimeAgo:E}=At(),[O,A]=l(!1),[D,R]=l(a||[]),F=c(async()=>{try{A(!0),R(await i()??[])}catch(e){}finally{A(!1)}},[]);n(()=>{D.length||F()},[]);const[P,L]=l(""),[_,M]=l(null),[B,z]=l([]),X=r(()=>_===ku.BulkConfig?u:_===ku.BulkSource?m:0,[_,u,m]),{supportedConnections:V,supportedConnectionIds:U}=r(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===ge.Success,n=k(e.odigosVersion,t);return o&&n}))(D,X);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[D.length,X]);n(()=>{if(!_||_===ku.Delete)return;const e=B.filter(e=>!U.includes(e));e.length&&z(t=>t.filter(t=>!e.includes(t)))},[_,B.length,U.length]);const H=r(()=>D.filter(e=>!P||e.name.toLowerCase().includes(P.toLowerCase())).map(e=>({cells:[{key:Tu.Id,rawValue:e.id},{key:Tu.Name,rawValue:e.name},{key:Tu.Type,rawValue:e.type},{key:Tu.Status,rawValue:e.status,component:()=>(e=>{const o=e===ge.Success?"Connection live":"Connection lost",n=e===ge.Success?vi:yi;return t(Ee,{status:e,label:o,leftIcon:n})})(e.status)},{key:Tu.OdigosVersion,rawValue:e.odigosVersion},{key:Tu.ConnectedSince,rawValue:e.connectedAt?E(e.connectedAt):"-"},{key:Tu.LastActivity,rawValue:e.lastSeenAt?E(e.lastSeenAt):"-"}],onClick:e.status!==ge.Success||_?void 0:()=>s(e),isSelected:B.includes(e.id),onSelect:()=>z(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>z(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==ge.Success||_===ku.BulkConfig&&!k(e.odigosVersion,u)||_===ku.BulkSource&&!k(e.odigosVersion,m)})),[D,B,P,_,u,m]),j=r(()=>{const e=(e,t)=>{z([e]),M(t)};return Iu({connections:D,configMinSupportedVersion:u,snapshotMinSupportedVersion:m,onDelete:t=>e(t,ku.Delete),onAddSource:!I&&g&&b?t=>e(t,ku.BulkSource):void 0,onAddDestination:!I&&v&&C&&w?t=>e(t,ku.BulkDestination):void 0,onAddAction:!I&&T?t=>e(t,ku.BulkAction):void 0,onAddInstrumentationRule:!I&&$?t=>e(t,ku.BulkInstrumentationRule):void 0,onEditConfiguration:!I&&p&&h?t=>e(t,ku.BulkConfig):void 0})},[I,D,u,p,h,m,g,b,v,C,w,T,$]),W=r(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];o&&s.push({id:Po(),type:Vt.Button,buttonProps:{variant:ae.Primary,size:ne.S,label:"Add Sources",rightIcon:Si,onClick:o}});const r=[n?{id:ku.BulkDestination,label:Re.ADD_DESTINATION,icon:gi}:null,a?{id:ku.BulkAction,label:Re.ADD_ACTION,icon:mi}:null,i?{id:ku.BulkInstrumentationRule,label:Re.ADD_INSTRUMENTATION_RULE,icon:Ci}:null,l?{id:ku.BulkConfig,label:"Manage Configurations",icon:xi}:null];return r.some(Boolean)&&s.push({id:Po(),type:Vt.ButtonDropData,buttonProps:{variant:ae.Secondary,size:ne.S,label:"Bulk Operations",onClick:e=>{e===ku.BulkSource?o?.():e===ku.BulkDestination?n?.():e===ku.BulkAction?a?.():e===ku.BulkInstrumentationRule?i?.():e===ku.BulkConfig&&l?.()}},dropDataProps:{alignX:Fo.Left,items:r}}),s.push({id:Po(),type:Vt.Button,buttonProps:{variant:ae.Text,size:ne.S,label:bt.CANCEL,onClick:t}}),s})({onCancel:()=>z([]),onAddSource:!I&&g&&b?()=>M(ku.BulkSource):void 0,onAddDestination:!I&&v&&C&&w?()=>M(ku.BulkDestination):void 0,onAddAction:!I&&T?()=>M(ku.BulkAction):void 0,onAddInstrumentationRule:!I&&$?()=>M(ku.BulkInstrumentationRule):void 0,onManageConfigurations:!I&&p&&h?()=>M(ku.BulkConfig):void 0}),[I,p,h,g,b,v,C,w,T,$]);return t(ra,{children:e(Ue,{richTitle:{icon:Ki,title:Re.CONNECTIONS,badge:{label:D.length.toString(),status:st.Unknown}},search:{placeholder:"Search by cluster name",value:P,onChange:e=>L(e),width:"300px"},actions:[{id:Po(),type:Vt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,leftIcon:Ni,onClick:F,disabled:O}}],children:[t(co,{variant:uo.Pretty,maxHeight:o,headerBackgroundColor:N.v2.colors.silver[1e3],isLoading:O,withCheckboxes:!0,columns:$u,rows:H,rowActionsPushRightPosition:_?`calc(${yl} - 24px)`:void 0,getRowActions:j}),_===ku.BulkConfig&&p&&h&&t(lr,{onClose:()=>M(null),connections:V,selectedConnectionIds:B,setSelectedConnectionIds:z,getEffectiveConfig:p,onApply:h}),_===ku.BulkSource&&g&&b&&t(Fl,{selectedConnectionIds:B,children:t(ar,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,getAllClusterSnapshots:g,persistSources:async e=>await(b?.(e))})}),_===ku.BulkDestination&&v&&C&&S&&w&&x&&t(Pl,{children:t(_s,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,getDestinationCategories:v,getPotentialDestinations:C,testConnection:e=>S(e,B),createDestination:e=>w(e,B),updateDestination:(e,t)=>x(e,t,B)})}),_===ku.BulkAction&&T&&t(Ll,{children:t(Ns,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,createAction:e=>T(e,B)})}),_===ku.BulkInstrumentationRule&&$&&t(_l,{children:t(Ms,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,createInstrumentationRule:e=>$(e,B)})}),t(gl,{target:"connection",isOpen:_===ku.Delete,onClose:()=>{z([]),M(null)},onApprove:async()=>{const e=B[0];e&&(await d(e),await F())}}),t(ca,{isOpen:!!B.length&&!_,richTitle:{icon:si,title:"Selected Clusters",badge:{label:B.length}},actions:W})]})})},Ou=g.div`
|
|
435
|
+
`,fu=["50","25","10","1","0.1"],bu=({value:o,onChange:n,label:a})=>{const i=f(),l=r(()=>fu.map(e=>({value:e,label:`${e}%`,selectedBgColor:i.v2.colors.purple[900],selectedBorderColor:i.v2.colors.purple[400]})),[i]);return e(V,{$gap:8,children:[t(ie,{size:le.XS,color:i.v2.colors.white[500],children:a}),t(mu,{children:t(re,{"data-id":"sampling-onboarding-ambient",options:l,selected:o,setSelected:n})})]})},vu=({errorPresetEnabled:n,onErrorPresetChange:a,ambientPercentage:i,onAmbientPercentageChange:l,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=r(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(Ld,{title:Yn,onBack:s}),e(Dd,{$width:854,children:[t(Gd,{children:Jn}),e(V,{$gap:8,$width:"100%",children:[e(Bd,{children:[t(gu,{children:t(ie,{size:le.XXS,color:u.v2.colors.silver[200],children:qn})}),t(Xd,{items:[Zn,Qn,ea,ta,oa]}),t(Ud,{message:Vn})]}),e(Hd,{children:[e(jd,{children:[t(ie,{size:le.S,weight:500,color:u.v2.colors.white[500],children:na}),t(Ii,{size:16,fill:u.v2.colors.silver[200]})]}),t(Wd,{children:t(Ed,{name:Kn,recommended:!0,toggleLabel:Gn,enabled:n,onEnabledChange:a,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Wd,{children:t(bu,{value:i,onChange:l,label:aa})})]})]})]}),t(Pd,{onNext:c,nextLoading:d})]})},yu=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:r,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=l("welcome"),[g,m]=l(!0),[f,b]=l("keep-list"),[v,y]=l(!0),[C,S]=l("25"),[w,x]=l(!1);n(()=>{e&&(h("welcome"),m(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const T=c(async()=>{const e=i??"default",t=[];g!==(a?.enabled??!1)&&t.push(r(g,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,r,g,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let k=null;switch(p){case"welcome":k=t(eu,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":k=t(Yd,{enabled:g,onEnabledChange:m,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":k=t(du,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":k=t(vu,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"drop-list":k=t(hu,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"advanced":k=t(uu,{onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"success":k=t(qd,{onClose:o})}return t(Po,{isOpen:e,onClose:o,children:k})};var Cu,Su;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Cu||(Cu={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Su||(Su={}));const wu=[{key:Su.Name,label:"Name"},{key:Su.Type,label:"Type",textAlign:"right"},{key:Su.Status,label:"Status"},{key:Su.OdigosVersion,label:"Odigos Version"},{key:Su.ConnectedSince,label:"Connected Since"},{key:Su.LastActivity,label:"Last Activity"}],xu=(e,t)=>{const o=e.find(e=>e.key===Su.Id)?.rawValue;return t(o?.toString()||"")},Tu=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Su.Status)?.rawValue===pe.Success)(e))return[{id:Do(),label:"Delete Connection",rightIcon:li,onClick:()=>xu(e,a)}];const d=xu(e,e=>{const n=t.find(t=>t.id===e);return!!n&&T(n.odigosVersion,o)}),u=xu(e,e=>{const o=t.find(t=>t.id===e);return!!o&&T(o.odigosVersion,n)}),p=[];return i&&p.push({id:Do(),tooltip:u?Oe.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:vi,disabled:!u,onClick:()=>xu(e,i)}),l&&p.push({id:Do(),tooltip:Oe.ADD_DESTINATION,rightIcon:pi,onClick:()=>xu(e,l)}),s&&p.push({id:Do(),tooltip:Oe.ADD_ACTION,rightIcon:ui,onClick:()=>xu(e,s)}),r&&p.push({id:Do(),tooltip:Oe.ADD_INSTRUMENTATION_RULE,rightIcon:bi,onClick:()=>xu(e,r)}),c&&p.push({id:Do(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ci,disabled:!d,onClick:()=>xu(e,c)}),p}},ku=({tableRowsMaxHeight:o,connections:a,getConnections:i,onClickConnection:s,deleteConnection:d,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:h,snapshotMinSupportedVersion:g=0,getAllClusterSnapshots:m,persistSources:b,getDestinationCategories:v,getPotentialDestinations:C,testConnection:S,createDestination:w,updateDestination:x,createAction:k,createInstrumentationRule:I})=>{const $=f(),{isVm:E}=y(),{formatTimeAgo:N}=Et(),[O,A]=l(!1),[D,R]=l(a||[]),P=c(async()=>{try{A(!0),R(await i()??[])}catch(e){}finally{A(!1)}},[]);n(()=>{D.length||P()},[]);const[F,L]=l(""),[_,B]=l(null),[z,M]=l([]),X=r(()=>_===Cu.BulkConfig?u:_===Cu.BulkSource?g:0,[_,u,g]),{supportedConnections:V,supportedConnectionIds:U}=r(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===pe.Success,n=T(e.odigosVersion,t);return o&&n}))(D,X);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[D.length,X]);n(()=>{if(!_||_===Cu.Delete)return;const e=z.filter(e=>!U.includes(e));e.length&&M(t=>t.filter(t=>!e.includes(t)))},[_,z.length,U.length]);const H=r(()=>D.filter(e=>!F||e.name.toLowerCase().includes(F.toLowerCase())).map(e=>({cells:[{key:Su.Id,rawValue:e.id},{key:Su.Name,rawValue:e.name},{key:Su.Type,rawValue:e.type},{key:Su.Status,rawValue:e.status,component:()=>(e=>{const o=e===pe.Success?"Connection live":"Connection lost",n=e===pe.Success?mi:fi;return t(Ie,{status:e,label:o,leftIcon:n})})(e.status)},{key:Su.OdigosVersion,rawValue:e.odigosVersion},{key:Su.ConnectedSince,rawValue:e.connectedAt?N(e.connectedAt):"-"},{key:Su.LastActivity,rawValue:e.lastSeenAt?N(e.lastSeenAt):"-"}],onClick:e.status!==pe.Success||_?void 0:()=>s(e),isSelected:z.includes(e.id),onSelect:()=>M(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>M(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==pe.Success||_===Cu.BulkConfig&&!T(e.odigosVersion,u)||_===Cu.BulkSource&&!T(e.odigosVersion,g)})),[D,z,F,_,u,g]),j=r(()=>{const e=(e,t)=>{M([e]),B(t)};return Tu({connections:D,configMinSupportedVersion:u,snapshotMinSupportedVersion:g,onDelete:t=>e(t,Cu.Delete),onAddSource:!E&&m&&b?t=>e(t,Cu.BulkSource):void 0,onAddDestination:!E&&v&&C&&w?t=>e(t,Cu.BulkDestination):void 0,onAddAction:!E&&k?t=>e(t,Cu.BulkAction):void 0,onAddInstrumentationRule:!E&&I?t=>e(t,Cu.BulkInstrumentationRule):void 0,onEditConfiguration:!E&&p&&h?t=>e(t,Cu.BulkConfig):void 0})},[E,D,u,p,h,g,m,b,v,C,w,k,I]),W=r(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];o&&s.push({id:Do(),type:zt.Button,buttonProps:{variant:te.Primary,size:ee.S,label:"Add Sources",rightIcon:vi,onClick:o}});const r=[n?{id:Cu.BulkDestination,label:Oe.ADD_DESTINATION,icon:pi}:null,a?{id:Cu.BulkAction,label:Oe.ADD_ACTION,icon:ui}:null,i?{id:Cu.BulkInstrumentationRule,label:Oe.ADD_INSTRUMENTATION_RULE,icon:bi}:null,l?{id:Cu.BulkConfig,label:"Manage Configurations",icon:Ci}:null];return r.some(Boolean)&&s.push({id:Do(),type:zt.ButtonDropData,buttonProps:{variant:te.Secondary,size:ee.S,label:"Bulk Operations",onClick:e=>{e===Cu.BulkSource?o?.():e===Cu.BulkDestination?n?.():e===Cu.BulkAction?a?.():e===Cu.BulkInstrumentationRule?i?.():e===Cu.BulkConfig&&l?.()}},dropDataProps:{alignX:Ao.Left,items:r}}),s.push({id:Do(),type:zt.Button,buttonProps:{variant:te.Text,size:ee.S,label:ht.CANCEL,onClick:t}}),s})({onCancel:()=>M([]),onAddSource:!E&&m&&b?()=>B(Cu.BulkSource):void 0,onAddDestination:!E&&v&&C&&w?()=>B(Cu.BulkDestination):void 0,onAddAction:!E&&k?()=>B(Cu.BulkAction):void 0,onAddInstrumentationRule:!E&&I?()=>B(Cu.BulkInstrumentationRule):void 0,onManageConfigurations:!E&&p&&h?()=>B(Cu.BulkConfig):void 0}),[E,p,h,m,b,v,C,w,k,I]);return t(ia,{children:e(Me,{richTitle:{icon:ji,title:Oe.CONNECTIONS,badge:{label:D.length.toString(),status:nt.Unknown}},search:{placeholder:"Search by cluster name",value:F,onChange:e=>L(e),width:"300px"},actions:[{id:Do(),type:zt.Button,buttonProps:{variant:te.Secondary,size:ee.S,leftIcon:Ti,onClick:P,disabled:O}}],children:[t(lo,{variant:so.Pretty,maxHeight:o,headerBackgroundColor:$.v2.colors.silver[1e3],isLoading:O,withCheckboxes:!0,columns:wu,rows:H,rowActionsPushRightPosition:_?`calc(${fl} - 24px)`:void 0,getRowActions:j}),_===Cu.BulkConfig&&p&&h&&t(er,{onClose:()=>B(null),connections:V,selectedConnectionIds:z,setSelectedConnectionIds:M,getEffectiveConfig:p,onApply:h}),_===Cu.BulkSource&&m&&b&&t(Al,{selectedConnectionIds:z,children:t(qs,{onClose:()=>B(null),selectedConnectionIds:z,setSelectedConnectionIds:M,getAllClusterSnapshots:m,persistSources:async e=>await(b?.(e))})}),_===Cu.BulkDestination&&v&&C&&S&&w&&x&&t(Dl,{children:t(Os,{onClose:()=>B(null),selectedConnectionIds:z,setSelectedConnectionIds:M,getDestinationCategories:v,getPotentialDestinations:C,testConnection:e=>S(e,z),createDestination:e=>w(e,z),updateDestination:(e,t)=>x(e,t,z)})}),_===Cu.BulkAction&&k&&t(Rl,{children:t(Cs,{onClose:()=>B(null),selectedConnectionIds:z,setSelectedConnectionIds:M,createAction:e=>k(e,z)})}),_===Cu.BulkInstrumentationRule&&I&&t(Pl,{children:t(As,{onClose:()=>B(null),selectedConnectionIds:z,setSelectedConnectionIds:M,createInstrumentationRule:e=>I(e,z)})}),t(pl,{target:"connection",isOpen:_===Cu.Delete,onClose:()=>{M([]),B(null)},onApprove:async()=>{const e=z[0];e&&(await d(e),await P())}}),t(la,{isOpen:!!z.length&&!_,richTitle:{icon:ai,title:"Selected Clusters",badge:{label:z.length}},actions:W})]})})},Iu=m.div`
|
|
441
436
|
display: flex;
|
|
442
437
|
align-items: center;
|
|
443
438
|
justify-content: space-between;
|
|
@@ -446,26 +441,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
446
441
|
width: calc(100% - 32px);
|
|
447
442
|
border-radius: 16px;
|
|
448
443
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
449
|
-
|
|
444
|
+
`,$u=m.div`
|
|
450
445
|
display: flex;
|
|
451
446
|
align-items: center;
|
|
452
447
|
justify-content: center;
|
|
453
448
|
padding: 8px;
|
|
454
449
|
border-radius: 8px;
|
|
455
|
-
background-color: ${({theme:e})=>e.v2.colors.white[500]+
|
|
456
|
-
`,
|
|
450
|
+
background-color: ${({theme:e})=>e.v2.colors.white[500]+Ve["004"]};
|
|
451
|
+
`,Eu=({setStep:o,onSave:n,sourcesPayload:a,destinationsPayload:i,disableAnimation:l})=>{const s=f(),c=()=>o(2),d=()=>o(3),u=r(()=>Object.values(a||{}).flatMap((o,n)=>o.map((o,a)=>{if(!o.selected)return null;const i=o.kind||ot.Namespace,l=i===ot.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(Iu,{children:[t(ie,{nowrap:!0,children:l}),t(Ie,{label:i,status:pe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[a]),p=r(()=>i?.map((o,n)=>{const a=qe(o.option.type).icon;return e(Iu,{children:[e(Z,{$gap:8,children:[a&&t($u,{children:t(a,{size:24})}),t(ie,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Ie,{status:o.testResult.succeeded?pe.Success:pe.Error,leftIcon:o.testResult.succeeded?mi:fi})]},`destination-${n}`)})||[],[i]);return t(ul,{isOpen:!0,disableAnimation:l,onBack:()=>o(3),onSave:n,header:{icon:wi,title:Oe.SUMMARY,subTitle:Oe.REVIEW_SETUP},leftColumn:{width:"50%",header:e(Z,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(Z,{$gap:8,children:[t(vi,{size:24}),t(ie,{nowrap:!0,children:Oe.SELECTED_SOURCES}),t(Ie,{label:u.length})]}),t(Q,{"data-id":"summary-edit-sources",leftIcon:si,variant:te.Secondary,size:ee.S,onClick:c})]}),list:u.length?u:[t(He,{$height:"100%",children:t(ae,{icon:vi,title:Oe.NO_SOURCES_SELECTED,subTitle:Oe.ADD_SOURCE_PROMPT,button:{leftIcon:oi,label:Oe.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(Z,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(Z,{$gap:8,children:[t(pi,{size:24}),t(ie,{nowrap:!0,children:Oe.SELECTED_DESTINATIONS}),t(Ie,{label:p.length})]}),t(Q,{"data-id":"summary-edit-destinations",leftIcon:si,variant:te.Secondary,size:ee.S,onClick:d})]}),list:p.length?p:[t(He,{"data-id":"summary-no-destinations",$height:"100%",children:t(ae,{icon:pi,title:Oe.NO_DESTINATIONS_SELECTED,subTitle:Oe.ADD_DESTINATION_PROMPT,button:{leftIcon:oi,label:Oe.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Nu=m.div`
|
|
457
452
|
position: relative;
|
|
458
453
|
overflow: hidden;
|
|
459
454
|
width: calc(100vw - ${({$paddingXAxis:e})=>e});
|
|
460
455
|
height: calc(100vh - ${({$paddingYAxis:e})=>e});
|
|
461
456
|
box-sizing: border-box;
|
|
462
|
-
`,
|
|
457
|
+
`,Ou=m.svg`
|
|
463
458
|
position: absolute;
|
|
464
459
|
top: 50%;
|
|
465
460
|
left: 50%;
|
|
466
461
|
transform: translate(-50%, -50%);
|
|
467
462
|
z-index: -1;
|
|
468
|
-
`,
|
|
463
|
+
`,Au=[{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"}],Du=[{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:Au},{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:Au},{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:Au}],Ru=({paddingXAxis:o="0px",paddingYAxis:a="0px",children:i})=>{const[s,c]=l(window.innerWidth),d=r(()=>s/Du[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Nu,{$paddingXAxis:o,$paddingYAxis:a,children:[Du.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:s},r)=>{const c=`purple-ring-${r}`;return e(Ou,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:s.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),i]})},Pu=m.div`
|
|
469
464
|
display: flex;
|
|
470
465
|
flex-direction: column;
|
|
471
466
|
align-items: center;
|
|
@@ -476,7 +471,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
476
471
|
width: 50vw;
|
|
477
472
|
border-radius: 16px;
|
|
478
473
|
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
479
|
-
`,
|
|
474
|
+
`,Fu=m.div`
|
|
480
475
|
display: flex;
|
|
481
476
|
flex-direction: column;
|
|
482
477
|
align-items: center;
|
|
@@ -486,15 +481,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
486
481
|
& * {
|
|
487
482
|
text-align: center;
|
|
488
483
|
}
|
|
489
|
-
`,
|
|
484
|
+
`,Lu=({onStart:o})=>t(pt,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(He,{$height:"100%",children:e(Pu,{children:[e(Fu,{children:[t(ie,{size:le.L,weight:500,children:Oe.GET_STARTED_WITH}),t(ml,{size:260}),t(ie,{size:le.S,weight:400,children:Oe.GET_STARTED_DESCRIPTION})]}),t(Q,{"data-id":"onboarding-get-started",label:ht.GET_STARTED,rightIcon:Vi,size:ee.L,onClick:o})]})})}),_u=[{step:1,label:Oe.INSTALLATION,forceDoneBadge:!0},{step:2,label:Oe.SOURCES_SETUP},{step:3,label:Oe.DESTINATIONS_SETUP},{step:4,label:Oe.SUMMARY}],Bu=m.div`
|
|
490
485
|
display: flex;
|
|
491
486
|
flex-direction: column;
|
|
492
487
|
gap: 32px;
|
|
493
488
|
padding: 64px;
|
|
494
|
-
`,
|
|
489
|
+
`,zu=({pagePaddingXAxis:o,pagePaddingYAxis:n,fetchNamespacesWithWorkloads:a,persistSources:i,getDestinationCategories:s,getPotentialDestinations:r,testConnection:c,createDestination:d,updateDestination:u,onDone:p})=>{const{setCurrentModal:h}=Ro(),[g,m]=l(1),[f,b]=l(!1),[v,y]=l(null),[C,S]=l(null),w=()=>m(e=>e+1),x=()=>m(e=>e-1);return e(Ru,{paddingXAxis:o,paddingYAxis:n,children:[e(Bu,{children:[t(ml,{useInline:!0}),t(sa,{currentStep:g,data:_u,gap:32})]}),t(Al,{initialInputs:v,children:e(Dl,{children:[1===g&&t(Lu,{onStart:w}),2===g&&t(qs,{disableAnimation:!0,onBack:e=>{y(e),x()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:a,persistSources:i}),3===g&&t(Os,{disableAnimation:!0,onBack:e=>{S(e),x()},onNext:e=>{S(e),w()},getDestinationCategories:s,getPotentialDestinations:r,initialInputs:C,testConnection:c,createDestination:d,updateDestination:u}),4===g&&t(Eu,{disableAnimation:!0,setStep:m,onSave:async()=>{if(!f){b(!0);try{const e=[];v&&e.push(i(v)),C&&e.push(...C.map(e=>d(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value?.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};h(Td),p()}catch(e){return b(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},Mu=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Xu=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Vu=m.div`
|
|
495
490
|
position: relative;
|
|
496
491
|
display: inline-flex;
|
|
497
|
-
`,
|
|
492
|
+
`,Uu=m.button`
|
|
498
493
|
display: inline-flex;
|
|
499
494
|
align-items: center;
|
|
500
495
|
gap: 8px;
|
|
@@ -507,7 +502,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
507
502
|
&:hover {
|
|
508
503
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
509
504
|
}
|
|
510
|
-
`,
|
|
505
|
+
`,Hu=m.div`
|
|
511
506
|
position: absolute;
|
|
512
507
|
top: calc(100% + 8px);
|
|
513
508
|
right: 0;
|
|
@@ -520,28 +515,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
520
515
|
border-radius: 12px;
|
|
521
516
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
522
517
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
523
|
-
`,
|
|
518
|
+
`,ju=m.div`
|
|
524
519
|
display: flex;
|
|
525
520
|
flex-direction: column;
|
|
526
521
|
gap: 12px;
|
|
527
522
|
padding: 16px;
|
|
528
523
|
max-height: 60vh;
|
|
529
524
|
overflow-y: auto;
|
|
530
|
-
`,
|
|
525
|
+
`,Wu=m.div`
|
|
531
526
|
display: flex;
|
|
532
527
|
align-items: center;
|
|
533
528
|
gap: 8px;
|
|
534
529
|
padding: 12px 16px;
|
|
535
530
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
536
|
-
`,
|
|
531
|
+
`,Gu=m.div`
|
|
537
532
|
display: flex;
|
|
538
533
|
align-items: center;
|
|
539
534
|
gap: 8px;
|
|
540
535
|
margin-left: auto;
|
|
541
|
-
`,
|
|
536
|
+
`,Ku=()=>{const o=f(),a=et(e=>e.sources),i=et(e=>e.namespaces),{selectedStreamName:s}=Ae(),{getItemSS:c,setItemSS:u,removeItemSS:p}=pa(),{namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=ra(),x=r(()=>ca(a,s),[a,s]);n(()=>{const e=c(da.OVERVIEW_FILTERS,w());C(e)},[]);const[T,k]=l({namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y}),[I,$]=l(Xu(T)),[E,N]=l(!1);n(()=>{if(!E){const e={namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y};k(e),$(Xu(e))}},[E,h,g,m,b,v,y]);const O=d(null);qt(O,()=>N(!1)),$o({key:"Escape",active:E},()=>N(!1));const A=r(()=>{const e=new Set,t=[];return i.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[i]),D=r(()=>{const e=new Set,t=[];return x.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[x]),R=r(()=>{const e=new Set,t=[];return x.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:$e[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[x]),P=r(()=>ua.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=r(()=>{const e=new Set,t=[];return x.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:xt(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[x]),L=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));k(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},_=E?hi:gi,B=r(()=>Mu(T.languages),[T.languages]);return e(Vu,{ref:O,children:[e(Uu,{"data-id":"filters-trigger",$isOpen:E,type:"button",onClick:()=>N(e=>!e),children:[t(Wi,{size:16,fill:o.v2.colors.white[500]}),t(ie,{size:le.XS,weight:500,nowrap:!0,children:"Filters"}),I>0&&t(Ie,{label:I,status:nt.Unknown,textSize:le.XXXS}),t(_,{size:16,fill:o.v2.colors.silver[200]})]}),E&&e(Hu,{children:[e(ju,{children:[t(We,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!A.length,options:A,values:Mu(T.namespaces),setValues:e=>L("namespaces",A,e)}),t(We,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Mu(T.kinds),setValues:e=>L("kinds",D,e)}),t(We,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!R.length,options:R,values:B,setValues:e=>L("languages",R,e)}),t(We,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:Mu(T.monitors),setValues:e=>L("monitors",P,e)}),t(We,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:Mu(T.podsAgentInjectionStatus),setValues:e=>L("podsAgentInjectionStatus",F,e)}),t(K,{label:"Show only sources with errors",size:it.L,value:!!T.onlyErrors,onChange:e=>k(t=>({...t,onlyErrors:e}))})]}),e(Wu,{children:[t(Q,{"data-id":"filters-reset",size:ee.S,variant:te.Text,label:"Reset",onClick:()=>{p(da.OVERVIEW_FILTERS),S(),k(w()),$(0),N(!1)},textColor:o.v2.colors.red[500]}),e(Gu,{children:[t(Q,{"data-id":"filters-cancel",size:ee.S,variant:te.Secondary,label:"Cancel",onClick:()=>N(!1)}),t(Q,{"data-id":"filters-apply",size:ee.S,variant:te.Primary,label:"Apply",onClick:()=>{u(da.OVERVIEW_FILTERS,T),C(T),$(Xu(T)),N(!1)}})]})]})]})]})},Yu="40vw",Ju=m.div`
|
|
542
537
|
position: relative;
|
|
543
|
-
width: ${
|
|
544
|
-
`,
|
|
538
|
+
width: ${Yu};
|
|
539
|
+
`,qu=m.div`
|
|
545
540
|
position: absolute;
|
|
546
541
|
top: calc(100% + 8px);
|
|
547
542
|
left: 0;
|
|
@@ -550,23 +545,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
550
545
|
flex-direction: column;
|
|
551
546
|
gap: 8px;
|
|
552
547
|
padding: 8px;
|
|
553
|
-
width: calc(${
|
|
548
|
+
width: calc(${Yu} - 16px);
|
|
554
549
|
border-radius: 12px;
|
|
555
550
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
556
551
|
box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
|
|
557
|
-
`,
|
|
552
|
+
`,Zu=m.div`
|
|
558
553
|
display: flex;
|
|
559
554
|
align-items: center;
|
|
560
555
|
overflow-x: auto;
|
|
561
|
-
`,
|
|
556
|
+
`,Qu=m.div`
|
|
562
557
|
display: flex;
|
|
563
558
|
flex-direction: column;
|
|
564
559
|
gap: 0;
|
|
565
560
|
max-height: 60vh;
|
|
566
561
|
overflow-y: auto;
|
|
567
|
-
`,
|
|
562
|
+
`,ep=m.div`
|
|
568
563
|
padding: 8px 12px 4px 12px;
|
|
569
|
-
`,
|
|
564
|
+
`,tp=m.div`
|
|
570
565
|
display: flex;
|
|
571
566
|
align-items: center;
|
|
572
567
|
gap: 8px;
|
|
@@ -576,9 +571,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
576
571
|
&:hover {
|
|
577
572
|
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
578
573
|
}
|
|
579
|
-
`,
|
|
574
|
+
`,op=m.div`
|
|
580
575
|
padding: 16px 8px;
|
|
581
|
-
`,
|
|
576
|
+
`,np=({preventPopup:o=!1})=>{const n=f(),{onClickNode:i}=ha(),{searchText:s,setSearchText:c}=ra(),{selectedStreamName:u}=Ae(),p=et(e=>e.sources),h=et(e=>e.destinations),g=et(e=>e.actions),m=et(e=>e.instrumentationRules),b=d(null),[v,y]=l(!1),[C,S]=l("all"),w=!o&&(!!s||v),x=()=>{c(""),y(!1),S("all")};qt(b,()=>x()),$o({key:"Escape",active:w},x);const{categories:T,searchResults:k}=r(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,s=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,r=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:ot.Source,label:"Sources",count:s.length,entities:[]},{category:ot.Action,label:"Actions",count:r.length,entities:[]},{category:ot.Destination,label:"Destinations",count:c.length,entities:[]},{category:ot.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+s.length+r.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===ot.InstrumentationRule?l:e.category===ot.Source?s:e.category===ot.Action?r:e.category===ot.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:m,sources:ca(p,u),actions:g,destinations:St(h,u),searchText:s,selectedCategory:C}),[m,p,g,h,u,s,C]),I=r(()=>T.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[T]),$=k.some(({entities:e})=>e.length>0);return e(Ju,{ref:b,children:[t(Mt,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>y(!0),width:Yu}),w&&e(qu,{children:[I.length>1&&t(Zu,{children:t(re,{options:I,selected:C,setSelected:S})}),$?t(Qu,{children:k.map(({category:o,label:l,entities:s},r)=>{if(!s.length)return null;const c=ma(o);return e(a,{children:[t(ep,{children:t(ie,{size:le.XXS,color:be.Secondary,children:l})}),s.map((a,l)=>e(tp,{onClick:()=>{const e=ut(a);i(null,{data:{type:o,id:e}}),x()},children:[c&&t(c,{size:16,fill:n.v2.colors.white[500]}),t(ie,{size:le.XS,nowrap:!0,children:ga(a,o,{extended:!0})})]},`entity-${r}-${l}`))]},`category-list-${o}`)})}):t(op,{children:t(ae,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},ap=m.div`
|
|
582
577
|
position: relative;
|
|
583
578
|
display: flex;
|
|
584
579
|
align-items: center;
|
|
@@ -589,7 +584,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
589
584
|
box-sizing: border-box;
|
|
590
585
|
border-radius: 16px 16px 0 0;
|
|
591
586
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
592
|
-
`,
|
|
587
|
+
`,ip=m.div`
|
|
593
588
|
position: absolute;
|
|
594
589
|
bottom: 0;
|
|
595
590
|
left: 0;
|
|
@@ -598,7 +593,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
598
593
|
background-color: ${({theme:e})=>e.v2.colors.purple[500]};
|
|
599
594
|
border-radius: 32px;
|
|
600
595
|
transition: width 0.3s;
|
|
601
|
-
`,
|
|
596
|
+
`,lp=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:s,allSelected:r,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Ro();return e(ap,{children:[e(Z,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(H,{size:fa.S,partiallyChecked:s,value:!!r,onChange:c}),t(ie,{size:le.S,nowrap:!0,children:`${xt(o)}s`}),t(Ie,{label:n,tooltip:a,status:nt.Unknown,textSize:le.XXXS})]}),e(Z,{children:[t(Ge,{"data-id":`add-${o}`,icon:oi,onClick:()=>u(o)}),t(Ge,{"data-id":`refresh-${o}`,icon:Ti,onClick:l,disabled:i})]}),"number"==typeof d&&t(ip,{$percent:d})]})},sp=m(V)`
|
|
602
597
|
align-items: center !important;
|
|
603
598
|
justify-content: center !important;
|
|
604
599
|
align-self: stretch;
|
|
@@ -613,7 +608,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
613
608
|
&:hover {
|
|
614
609
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
615
610
|
}
|
|
616
|
-
`,
|
|
611
|
+
`,rp=({entityType:o,description:n})=>{const{setCurrentModal:a}=Ro();return e(sp,{onClick:()=>a(o),children:[e(Z,{$gap:4,children:[t(oi,{size:16}),t(ie,{size:le.S,children:`Add ${xt(o)}`})]}),t(ie,{size:le.XXS,align:"center",children:n})]})},cp=m.div`
|
|
617
612
|
display: flex;
|
|
618
613
|
align-items: center;
|
|
619
614
|
gap: 12px;
|
|
@@ -628,10 +623,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
628
623
|
&:hover {
|
|
629
624
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
630
625
|
}
|
|
631
|
-
`,
|
|
626
|
+
`,dp=m(Z)`
|
|
632
627
|
flex: 1;
|
|
633
628
|
min-width: 0;
|
|
634
|
-
`,
|
|
629
|
+
`,up=({entityId:o,entityType:n,title:a,status:i,faded:l,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:g})=>{const m=f(),b=n===ot.Source,v="boolean"==typeof h,y=l||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=Vt(),{selectedSources:w,setSelectedSources:x}=ba(),T=g,k=b?T.id.namespace:"",I=r(()=>{if(!b)return-1;const e=w[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind):-1},[b,w,k,T.id]),$=v&&!h?ya(pe.Info,m):i?ya(i,m):void 0,E=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(cp,{"data-id":E,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(H,{size:fa.S,value:-1!==I,onChange:()=>{const e={...w};e[k]||(e[k]=[]),-1===I?e[k].push(T):e[k].splice(I,1),x(e)}}),t(Wt,{icons:u,icon:d,iconSrc:p}),e(dp,{$gap:4,children:[t(va,{size:le.XS,nowrap:!0,children:a}),t(Z,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(ye,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ie,{label:c,status:i&&[pe.Error,pe.Warning].includes(i)?i:nt.Unknown,leftIcon:$,textSize:le.XXXS})})})]})]})};function pp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Lt.Loading)?e:{...e,workloadOdigosHealthStatus:{status:At.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function hp(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Lt.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const gp=m.div`
|
|
635
630
|
position: absolute;
|
|
636
631
|
top: 0;
|
|
637
632
|
left: 0;
|
|
@@ -642,22 +637,22 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
642
637
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
643
638
|
border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
644
639
|
pointer-events: none;
|
|
645
|
-
`,
|
|
640
|
+
`,mp=m.div`
|
|
646
641
|
display: flex;
|
|
647
642
|
align-items: center;
|
|
648
643
|
gap: 8px;
|
|
649
644
|
padding: 4px 8px 0;
|
|
650
|
-
`,
|
|
645
|
+
`,fp=m.div`
|
|
651
646
|
flex: 1;
|
|
652
647
|
height: 1px;
|
|
653
648
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
654
|
-
`,
|
|
649
|
+
`,bp=({namespace:e})=>{const o=f();return t(gp,{children:t(ie,{size:le.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},vp=({namespace:o})=>{const n=f();return e(mp,{children:[t(fp,{}),t(ie,{size:le.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(fp,{})]})},yp={[ot.InstrumentationRule]:Oe.NO_DATA_INSTRUMENTATION_RULES,[ot.Source]:Oe.NO_DATA_SOURCES,[ot.Action]:Oe.NO_DATA_ACTIONS,[ot.Destination]:Oe.NO_DATA_DESTINATIONS},Cp=m.div`
|
|
655
650
|
display: flex;
|
|
656
651
|
flex-direction: column;
|
|
657
652
|
flex: 1 0 0;
|
|
658
653
|
min-width: 0;
|
|
659
654
|
${({$isVm:e})=>e?"width: 45vw;":""}
|
|
660
|
-
`,
|
|
655
|
+
`,Sp=m.div`
|
|
661
656
|
display: flex;
|
|
662
657
|
flex-direction: column;
|
|
663
658
|
align-items: stretch;
|
|
@@ -667,7 +662,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
667
662
|
border-radius: 0 0 16px 16px;
|
|
668
663
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
669
664
|
overflow: hidden;
|
|
670
|
-
|
|
665
|
+
`,wp=m.div`
|
|
671
666
|
position: relative;
|
|
672
667
|
display: flex;
|
|
673
668
|
flex-direction: column;
|
|
@@ -679,16 +674,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
679
674
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
680
675
|
height: ${({$height:e})=>e}px;
|
|
681
676
|
overflow: hidden;
|
|
682
|
-
`,
|
|
677
|
+
`,xp=(e,t,o,n)=>{const a=ut(e);if(!a)return null;const i=t===ot.Source;let l,s,r=!1,c=e;if(i){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case At.Failure:return{status:pe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case At.Notice:return{status:pe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case At.Pending:case At.Waiting:return{status:void 0,faded:!1,displaySource:pp(e)};case At.Unsupported:case At.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:hp(e)}}}(e);l=t.status,r=t.faded,s=t.tooltip,c=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=Sa(e.conditions);l=t,r=o}const d=ga(e,t,{extended:i,prioritizeDisplayName:!i});let u,p,h,g,m;switch(t){case ot.Source:{u=jt(e),p=ma(ot.Source);const t=n?.get(wa(a));g=Gt(t);break}case ot.Destination:{const t=qe(e.destinationType.type);p=t.icon,h=t.iconSrc;const o=n?.get(wa(a));g=Gt(o),m=!e.disabled;break}case ot.Action:p=bt(e.type),m=!e.disabled;break;case ot.InstrumentationRule:p=$t(e.type),m=!e.disabled}return{key:wa(a),entityId:a,namespace:i?e.id.namespace:void 0,raw:c,itemProps:{entityId:a,entityType:t,title:d,status:l,faded:r,tooltip:s,throughput:g,icon:p,icons:u,iconSrc:h,isActive:m,raw:c}}},Tp=({entityType:o,entities:a,unfilteredCount:i,metrics:s,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),g=o===ot.Source,m=a.length!==i,f=st(e=>g?e.progress[rt.Instrumenting]?.percentage:void 0),b=st(e=>g?e.progress[rt.Uninstrumenting]?.percentage:void 0),v=!g||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=ba(),w=r(()=>g?Object.values(C).reduce((e,t)=>e+t.length,0):0,[g,C]),x=r(()=>{if(!s)return;const e=new Map,t=o===ot.Source?s.sources:o===ot.Destination?s.destinations:void 0;if(t)for(const o of t)e.set(Ca(o),o.throughput);return e},[s,o]),T=r(()=>a.map(e=>xp(e,o,0,x)).filter(Boolean),[a,o,x,h]),[k,I]=l(""),{elements:$,indexToNamespace:E,multipleNs:N,dividerCount:O}=r(()=>{const e=[],o=[],n=new Set(T.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const n of T)g&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(vp,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(up,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[T,g]);n(()=>{if(g&&E.length&&!k){const e=E.find(Boolean);e&&I(e)}},[g,E]);const A=c(e=>{if(!E.length)return;const t=E[Math.min(e,E.length-1)];t&&t!==k&&I(t)},[E,k]);if(h&&[ot.InstrumentationRule,ot.Action].includes(o))return null;const D=58*T.length+(N?28:0)+32*O,R=Math.max(0,u-52-16),P=Math.min(R,D)+8,F="number"==typeof v?`${v}%`:m?`${a.length}/${i}`:i;return e(Cp,{$isVm:h,children:[t(lp,{entityType:o,badge:F,badgeTooltip:m?Oe.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&a?.length!==w,allSelected:w>0&&a?.length===w,onSelectAll:g?e=>{if(g)if(e){const e={};a?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(Sp,{children:a.length?e(wp,{$height:P,children:[N&&k&&t(bp,{namespace:k}),t(Xt,{gap:4,elements:$,onTopIndexChange:N?A:void 0})]}):d?t(no,{size:3}):t(rp,{entityType:o,description:yp[o]??Oe.TO_COLLECT_OTEL_DATA})})]})},kp=m.div`
|
|
683
678
|
width: 100%;
|
|
684
679
|
height: ${({$height:e})=>e||"auto"};
|
|
685
680
|
display: flex;
|
|
686
681
|
align-items: stretch;
|
|
687
682
|
gap: 16px;
|
|
688
|
-
`,
|
|
683
|
+
`,Ip=({height:o,metrics:n,refetchSources:a,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:s})=>{const c=ra(),{selectedStreamName:d}=Ae(),{containerRef:u,containerHeight:p}=xa(),h=et(e=>e.sources),g=et(e=>e.sourcesLoading),m=et(e=>e.destinations),f=et(e=>e.destinationsLoading),b=et(e=>e.actions),v=et(e=>e.actionsLoading),y=et(e=>e.instrumentationRules),C=et(e=>e.instrumentationRulesLoading),S=r(()=>ca(h,d),[h,d]),w=r(()=>St(m,d),[m,d]),x=r(()=>Ta(S,c),[S,c]),T=r(()=>ka(w,c),[w,c]),k=r(()=>Ia(b,c),[b,c]);return e(kp,{ref:u,$height:o,children:[t(Tp,{entityType:ot.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:C,maxHeight:p,refetch:s}),t(Tp,{entityType:ot.Source,entities:x,unfilteredCount:S.length,metrics:n,loading:g,maxHeight:p,refetch:a}),t(Tp,{entityType:ot.Action,entities:k,unfilteredCount:b.length,loading:v,maxHeight:p,refetch:l}),t(Tp,{entityType:ot.Destination,entities:T,unfilteredCount:w.length,metrics:n,loading:f,maxHeight:p,refetch:i})]})},$p=({effectiveConfig:n,fetchNamespacesWithWorkloads:a,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchProfilingSlots:h,fetchSourceProfiling:g,fetchK8sManifest:m,getDestinationCategories:f,getPotentialDestinations:b,testConnection:v,createDestination:y,updateDestination:C,deleteDestination:S,createInstrumentationRule:w,updateInstrumentationRule:x,deleteInstrumentationRule:T,createAction:k,updateAction:I,deleteAction:$})=>{const{currentModal:E,setCurrentModal:N}=Ro(),{drawerType:O,drawerEntityId:A,setDrawerType:D,setDrawerEntityId:R}=Vt(),P=()=>{N(""),D(null),R(null)};return e(o,{children:[t(kd,{}),E===ot.Source&&t(Al,{children:t(qs,{onClose:P,fetchNamespacesWithWorkloads:a,persistSources:i,withOverlay:!0})}),E===ot.Destination&&t(Dl,{children:t(Os,{onClose:P,getDestinationCategories:f,getPotentialDestinations:b,testConnection:v,createDestination:y,updateDestination:C,withOverlay:!0})}),E===ot.InstrumentationRule&&t(Pl,{children:t(As,{onClose:P,createInstrumentationRule:w,withOverlay:!0})}),E===ot.Action&&t(Rl,{children:t(Cs,{onClose:P,createAction:k,withOverlay:!0})}),O===ot.Source&&A&&t(Fl,{children:t(qc,{onClose:P,effectiveConfig:n,sourceId:A,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchSourceProfiling:g,fetchProfilingSlots:h,fetchK8sManifest:m})}),O===ot.Destination&&A&&t(Dl,{children:t(or,{onClose:P,destinationId:A,getDestinationCategories:f,testConnection:v,updateDestination:C,deleteDestination:S})}),O===ot.InstrumentationRule&&A&&t(Pl,{children:t(ar,{onClose:P,ruleId:A,updateInstrumentationRule:x,deleteInstrumentationRule:T})}),O===ot.Action&&A&&t(Rl,{children:t(Qs,{onClose:P,actionId:A,updateAction:I,deleteAction:$})})]})},Ep="multi-source-deselect",Np="multi-source-restart",Op="multi-source-uninstrument",Ap="Selected sources",Dp="Deselect",Rp="Restart",Pp="Uninstrument",Fp="Rollout Restart Workloads",Lp="Are you sure you want to rollout restart these workloads?",_p="Go Back",Bp="Confirm",zp=({restartWorkloads:a,persistSources:i})=>{const{selectedStreamName:s}=Ae(),{selectedSources:d,setSelectedSources:u}=ba(),[p,h]=l(!1),[g,m]=l(!1),f=r(()=>Object.values(d).reduce((e,t)=>e+t.length,0),[d]),b=c(()=>{u({})},[u]),v=c(()=>h(!1),[]),y=c(()=>m(!1),[]);n(()=>{b()},[s,b]);const C=c(()=>{a(Object.values(d).flat().filter(e=>e.id.kind!==oo.StaticPod).map(Ut)),b()},[a,d,b]),S=c(()=>{i(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:s}))]))),b()},[i,d,s,b]),w=r(()=>[{id:Ep,type:zt.Button,buttonProps:{variant:te.Text,size:ee.S,label:Dp,onClick:b}},{id:Np,type:zt.Button,buttonProps:{variant:te.Secondary,size:ee.S,label:Rp,leftIcon:Li,onClick:()=>h(!0)}},{id:Op,type:zt.Button,buttonProps:{variant:te.Primary,size:ee.S,label:Pp,leftIcon:ti,onClick:()=>m(!0)}}],[b]);return e(o,{children:[t(la,{isOpen:f>0,richTitle:{icon:vi,title:Ap,badge:{label:f}},actions:w}),t(Ne,{isOpen:p,title:Fp,description:Lp,onClose:v,denyButton:{label:_p,variant:te.Secondary,onClick:v},approveButton:{label:Bp,variant:te.Primary,onClick:()=>{C(),v()}}}),t(pl,{isOpen:g,action:"uninstrument",target:`${f} source${1===f?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},Mp=e=>`Data Stream: ${e}`,Xp="Search streams...",Vp="No streams match",Up=m.div`
|
|
689
684
|
position: relative;
|
|
690
685
|
display: inline-flex;
|
|
691
|
-
`,
|
|
686
|
+
`,Hp=m.div`
|
|
692
687
|
display: inline-flex;
|
|
693
688
|
align-items: center;
|
|
694
689
|
gap: 6px;
|
|
@@ -699,7 +694,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
699
694
|
&:hover {
|
|
700
695
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
701
696
|
}
|
|
702
|
-
`,
|
|
697
|
+
`,jp=m.div`
|
|
703
698
|
position: absolute;
|
|
704
699
|
top: calc(100% + 8px);
|
|
705
700
|
left: 0;
|
|
@@ -713,18 +708,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
713
708
|
border-radius: 12px;
|
|
714
709
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
715
710
|
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
|
|
716
|
-
`,
|
|
711
|
+
`,Wp=m.div`
|
|
717
712
|
display: flex;
|
|
718
713
|
align-items: center;
|
|
719
714
|
gap: 8px;
|
|
720
715
|
width: 100%;
|
|
721
|
-
`,
|
|
716
|
+
`,Gp=m.div`
|
|
722
717
|
display: flex;
|
|
723
718
|
flex-direction: column;
|
|
724
719
|
gap: 0;
|
|
725
720
|
max-height: 240px;
|
|
726
721
|
overflow-y: auto;
|
|
727
|
-
`,
|
|
722
|
+
`,Kp=m.div`
|
|
728
723
|
display: flex;
|
|
729
724
|
align-items: center;
|
|
730
725
|
gap: 8px;
|
|
@@ -735,29 +730,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
735
730
|
&:hover {
|
|
736
731
|
background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
|
|
737
732
|
}
|
|
738
|
-
`,
|
|
733
|
+
`,Yp=m.div`
|
|
739
734
|
flex: 1;
|
|
740
735
|
min-width: 0;
|
|
741
736
|
overflow: hidden;
|
|
742
737
|
text-overflow: ellipsis;
|
|
743
738
|
white-space: nowrap;
|
|
744
|
-
`,
|
|
739
|
+
`,Jp=m.div`
|
|
745
740
|
display: flex;
|
|
746
741
|
align-items: center;
|
|
747
742
|
gap: 2px;
|
|
748
743
|
flex-shrink: 0;
|
|
749
|
-
`,
|
|
744
|
+
`,qp=m.div`
|
|
750
745
|
display: flex;
|
|
751
746
|
padding-top: 4px;
|
|
752
747
|
border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
753
|
-
`,
|
|
748
|
+
`,Zp=({updateDataStream:a,deleteDataStream:i,createDataStream:s})=>{const c=f(),{isVm:u}=y(),{clearStore:p}=$a(),{dataStreams:h,selectedStreamName:g,setSelectedStreamName:m}=Ae(),b=d(null),[v,C]=l(!1),[S,w]=l(""),[x,T]=l(""),[k,I]=l(!1),[$,E]=l(!1),[N,O]=l(!1),[A,D]=l(""),[R,P]=l(!1);qt(b,()=>C(!1)),n(()=>{v||w("")},[v]);const F=r(()=>{if(!S)return h;const e=S.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(e))},[h,S]),L=v?hi:gi;return u?null:e(o,{children:[e(Up,{ref:b,children:[e(Hp,{"data-id":"data-stream-select",$isOpen:v,onClick:()=>C(e=>!e),children:[t(Gi,{size:24}),t(ie,{size:le.S,weight:500,nowrap:!0,children:Mp(g)}),t(Ie,{label:h.length,status:nt.Unknown,textSize:le.XXXS}),t(L,{size:20,fill:c.v2.colors.silver[200]})]}),v&&e(jp,{children:[t(Wp,{children:t(Mt,{value:S,onChange:w,placeholder:Xp,width:"100%"})}),t(Gp,{children:0===F.length?t(Kp,{children:t(ie,{size:le.XS,color:be.Secondary,children:Vp})}):F.map(({name:o})=>{const n=o===Ea;return e(Kp,{"data-id":`stream-row-${o}`,$selected:o===g,onClick:()=>(e=>{e!==g&&(p(),m(e)),C(!1)})(o),children:[t(Yp,{children:t(ie,{size:le.XS,nowrap:!0,children:o})}),e(Jp,{children:[t(Ge,{"data-id":`stream-edit-${o}`,icon:si,size:Ke.XS,onClick:e=>{e.stopPropagation(),C(!1),T(o),I(!0)}}),!n&&t(Ge,{"data-id":`stream-delete-${o}`,icon:ti,size:Ke.XS,onClick:e=>{e.stopPropagation(),C(!1),D(o),P(!0)}})]})]},`stream-${o}`)})}),t(qp,{children:t(Q,{"data-id":"add-stream-trigger",variant:te.Secondary,size:ee.S,leftIcon:oi,label:`${ht.NEW} ${Oe.STREAM_NAME}`,fullWidth:!0,onClick:()=>{C(!1),p(),O(!0),E(!0)}})})]})]}),N&&t(Ll,{defaultExcludeName:g,children:t(Cd,{isOpen:$,onClose:()=>E(!1),onCloseEnd:()=>O(!1),createDataStream:s})}),x&&t(Ll,{children:t(Sd,{isOpen:k,dataStreamName:x,onClose:()=>I(!1),onCloseEnd:()=>T(""),updateDataStream:a})}),t(pl,{target:`${Oe.STREAM_NAME.toLowerCase()} "${A}"`,isOpen:R,onClose:()=>P(!1),onApprove:async()=>{A&&await i(A)}})]})},Qp=v`
|
|
754
749
|
0% {
|
|
755
750
|
background-position: 200% 50%;
|
|
756
751
|
}
|
|
757
752
|
100% {
|
|
758
753
|
background-position: 0% 50%;
|
|
759
754
|
}
|
|
760
|
-
`,
|
|
755
|
+
`,eh=m.div`
|
|
761
756
|
display: flex;
|
|
762
757
|
align-items: center;
|
|
763
758
|
justify-content: space-evenly;
|
|
@@ -768,44 +763,44 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
|
|
|
768
763
|
|
|
769
764
|
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%)`};
|
|
770
765
|
background-size: 200% 100%;
|
|
771
|
-
animation: ${
|
|
772
|
-
`,
|
|
766
|
+
animation: ${Qp} 15s linear infinite;
|
|
767
|
+
`,th=[bi,vi,ui,pi],oh=({columnsMaxHeight:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r,updateDataStream:c,deleteDataStream:d,createDataStream:u,...p})=>{const h=f();return e(ia,{children:[e(Me,{customTitle:t(Zp,{updateDataStream:c,deleteDataStream:d,createDataStream:u}),customSearch:t(np,{}),filters:t(Ku,{}),children:[t(eh,{children:th.map((o,n)=>e(a,{children:[t(o,{size:24}),n<th.length-1&&t(di,{fill:h.v2.colors.white[500]+Ve["020"],size:24})]},o.name))}),t(Ip,{height:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r})]}),t($p,{...p}),t(zp,{restartWorkloads:p.restartWorkloads,persistSources:p.persistSources})]})};var nh;!function(e){e.Gateway="gateway",e.Node="node"}(nh||(nh={}));const ah=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:a,disabled:i})=>{const l=r(()=>{const e=[];return o&&e.push({id:Do(),type:zt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Fi,size:ee.S,variant:te.Text,onClick:o,disabled:i}}),n&&e.push({id:Do(),type:zt.Button,buttonProps:{label:"Refresh",leftIcon:Ti,size:ee.S,variant:te.Text,onClick:n,disabled:i,loading:a}}),e},[o,n,i,a]);return e(Z,{$alignItems:"center",$justifyContent:"space-between",children:[t(Na,{icon:Ki,title:"Collectors Pipeline"}),t(Oa,{actions:l})]})},ih=({pod:o,getExtendedPodInfo:a,onClose:i})=>{const{formatTimeAgo:s}=Et(),[c,d]=l(null);n(()=>{o?a(o.namespace,o.name).then(e=>d(e??null)):d(null)},[o]);const u=r(()=>[{id:Do(),title:"Node",label:c?.node??"-",withCopy:!0},{id:Do(),title:"Status",badge:{status:Aa(c?.status),label:c?.status??"-"}}],[c]),p=r(()=>c?.containers?.map(e=>({id:Do(),items:[{id:Do(),title:"Container",label:e.name??"-"},{id:Do(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:Do(),title:"Ready",badge:{status:e.ready?pe.Success:pe.Error,leftIcon:e.ready?ai:ii,label:e.ready?"True":"False",invertColors:!0}},{id:Do(),title:"Started",badge:{status:e.started?pe.Success:pe.Error,leftIcon:e.started?ai:ii,label:e.started?"True":"False",invertColors:!0}},{id:Do(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Do(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Do(),title:Oe.RESTARTS,label:e.restarts.toString()},{id:Do(),title:"State Reason",label:e.stateReason??"-"},{id:Do(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Do(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return t(pt,{isOpen:!!o,header:{icon:Si,title:"Pod Information",onClose:i},children:c?e(mt,{bgTint:"1000",richTitle:{icon:Si,title:c.name,withCopy:!0},children:[t(mt,{bgTint:"900",cellsPerRow:2,items:u}),e(mt,{bgTint:"900",richTitle:{icon:Xi,title:"Kubectl Commands"},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(Bt,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),t(Bt,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),t(Bt,{value:`kubectl logs ${c.name} -n ${c.namespace}`})]}),t(mt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:p.length?p.map(({id:e,items:o})=>t(mt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(ae,{title:"No containers",subTitle:"Pod has no containers"})}),t(gl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(He,{$height:"50vh",children:t(Ye,{withSpinner:!0})})})};var lh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropDrate="spanDropDrate",e.Age="age",e.DockerImage="dockerImage"}(lh||(lh={}));const sh=[{key:lh.PodName,label:"Pod Name"},{key:lh.Status,label:"Status"},{key:lh.Restarts,label:Oe.RESTARTS},{key:lh.NodeName,label:"Node Name"},{key:lh.Age,label:"Age"},{key:lh.DockerImage,label:"Collector Version"}],rh=({isLoading:o,tableRowsMaxHeight:n,pods:a,getExtendedPodInfo:i})=>{const s=f(),{formatTimeAgo:c}=Et(),[d,u]=l(null),p=r(()=>a.map(o=>({onClick:()=>u(o),cells:[{key:lh.PodName,rawValue:o.name},{key:lh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Ie,{status:Aa(e),label:e});var e}},{key:lh.Restarts,rawValue:o.restartsCount.toString()},{key:lh.NodeName,rawValue:o.nodeName},{key:lh.SpanDropDrate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(ie,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?pe.Error:pe.Success,s=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),r=s>0?Math.round((n?.exporterFailedRps??0)/s*100):0,c=r>0?pe.Error:pe.Success;return e(Z,{$gap:4,children:[t(ye,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()}, Dropped: ${n.metricsDroppedRps.toLocaleString()}`,children:t(Ie,{status:l,label:`Receiver ${i}%`,leftIcon:l===pe.Error?Yi:Ji,useSecondaryTone:!0,invertColors:!0})}),t(ye,{text:`Success: ${n.exporterSuccessRps.toLocaleString()}, Failed: ${n.exporterFailedRps.toLocaleString()}`,children:t(Ie,{status:c,label:`Exporter ${r}%`,leftIcon:c===pe.Error?Yi:Ji,useSecondaryTone:!0,invertColors:!0})})]})}},{key:lh.Age,rawValue:c(o.creationTimestamp)},{key:lh.DockerImage,rawValue:o.image}]})),[a,s]);return e(mt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Si,title:"Pods"},children:[t(lo,{variant:so.Data,maxHeight:n,isLoading:o,columns:sh,rows:p}),t(ih,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)})]})},ch=({isOpen:e,onClose:o,title:n,yaml:a})=>t(pt,{isOpen:e,header:{icon:qi,title:n,onClose:o},children:t(gl,{yaml:a,defaultOpen:!0})}),dh=e=>{switch(e){case Da.Healthy:return"All desired replicas are updated, available, and ready";case Da.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Da.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Da.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Da.Down:return"No available replicas";case Da.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var uh;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(uh||(uh={}));const ph=m.div`
|
|
773
768
|
flex: 0.5;
|
|
774
769
|
padding: 12px;
|
|
775
770
|
border-radius: 12px;
|
|
776
771
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
777
|
-
`,
|
|
772
|
+
`,hh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:a,isLoading:i})=>{const{formatTimeAgo:s}=Et(),[c,d]=l(null),u=r(()=>(e=>{switch(e){case nh.Gateway:return"Deployment";case nh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=r(()=>((e,t,o,n)=>{const a={status:nt.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case nh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case nh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:pe.Info,label:"Rollout in progress",rightIcon:Ti,useSecondaryTone:!0}:l?{status:nt.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,a,s),[n,a,o,s]),h=r(()=>((e,t,o,n)=>{let a=n?pe.Info:nt.Unknown,i=n?"Loading":Da.Unknown,l=n?"Fetching data...":dh(Da.Unknown);switch(e){case nh.Gateway:a=t?.status?Aa(t?.status):a,i=t?.status??i,l=t?.status?dh(t.status):l;break;case nh.Node:a=o?.status?Aa(o?.status):a,i=o?.status??i,l=o?.status?dh(o.status):l}return{status:a,title:i,description:l}})(o,n,a,i),[n,a,o,i]),g=r(()=>((e,t,o)=>{switch(e){case nh.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 nh.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,a),[n,a,o]),m=r(()=>((e,t,o,n)=>{switch(e){case nh.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case nh.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,a,i),[n,a,o,i]),f=r(()=>(o===nh.Gateway?n?.manifestYAML:a?.manifestYAML)??"",[n,a,o]),b=r(()=>(o===nh.Gateway?n?.configMapYAML:a?.configMapYAML)??"",[n,a,o]);return e(mt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:qi,title:u,badge:p},actions:[{id:Do(),type:zt.ButtonDropData,buttonProps:{variant:te.Secondary,size:ee.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:uh.ManifestYaml,label:u,icon:Zi},{id:uh.ConfigMapYaml,label:"ConfigMap",icon:Zi}]}}],children:[e(Z,{$gap:16,children:[t("div",{children:t(Ra,{...h})}),g.map(e=>t(ph,{children:t("div",{children:t(Pa,{...e})})},e.title)),m.map(e=>t(Fa,{...e},e.title))]}),t(ch,{isOpen:c===uh.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(ch,{isOpen:c===uh.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},gh=[{value:nh.Gateway,label:"Gateway"},{value:nh.Node,label:"Node Collector"}],mh=({minSupportedVersion:o=0,tableRowsMaxHeight:a,getGatewayInfo:i,getGatewayPods:s,getNodeCollectorInfo:d,getNodeCollectorPods:u,getExtendedPodInfo:p})=>{const{isVersionSupported:h,version:g}=y(o),[m,f]=l(!1),[b,v]=l(nh.Gateway),[C,S]=l(null),[w,x]=l([]),[T,k]=l(null),[I,$]=l([]),E=c(async()=>{f(!0);try{switch(b){case nh.Gateway:S(await i()??null),x(await s()??[]);break;case nh.Node:k(await d()??null),$(await u()??[])}}catch(e){}f(!1)},[b]);n(()=>{E()},[E]);const N=r(()=>b===nh.Gateway?w:I,[w,I,b]);return e(ia,{children:[t(ah,{disabled:!h,loading:m,onClickDownloadDiagnose:void 0,onClickRefresh:E}),e(La,{children:[e(V,{children:[t(re,{variant:ao.Underline,size:_a.L,options:gh,selected:b,setSelected:v}),t(hh,{selectedTab:b,gatewayInfo:C,nodeCollectorInfo:T,isLoading:m})]}),t(rh,{isLoading:m,tableRowsMaxHeight:a,pods:N,getExtendedPodInfo:p}),!h&&t(bl,{minSupportedVersion:o,currentVersion:g||""})]})]})},fh=m.div`
|
|
778
773
|
display: inline-flex;
|
|
779
774
|
align-items: center;
|
|
780
775
|
min-width: 0;
|
|
781
776
|
overflow: hidden;
|
|
782
777
|
white-space: pre;
|
|
783
778
|
text-overflow: ellipsis;
|
|
784
|
-
`,
|
|
779
|
+
`,bh=m.div`
|
|
785
780
|
display: flex;
|
|
786
781
|
flex-direction: column;
|
|
787
782
|
gap: 4px;
|
|
788
783
|
min-width: 0;
|
|
789
784
|
flex: 1;
|
|
790
785
|
opacity: ${({$disabled:e})=>e?.4:1};
|
|
791
|
-
`,
|
|
786
|
+
`,vh=m(Z)`
|
|
792
787
|
flex-shrink: 0;
|
|
793
788
|
gap: 6px;
|
|
794
789
|
align-items: center;
|
|
795
790
|
min-height: 22px;
|
|
796
|
-
`;const
|
|
791
|
+
`;const yh=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Ch=[{value:"all",label:za},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Sh=({title:o,items:n,isLoading:a,showTypeFilter:i,tableRowsMaxHeight:s,onRuleClick:d,onCreateRule:u,onEditRule:p,onDeleteRule:h})=>{const g=f(),[m,b]=l(""),[v,y]=l("all"),C=r(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,v,i);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,m),e},[n,v,i,m]),w=r(()=>C.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(g,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(bh,{$disabled:o.disabled,children:[t(fh,{children:t(S,{parts:o.summary})}),o.name&&t(ie,{size:le.XXS,color:be.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(vh,{children:[o.disabled&&t(Ie,{label:Ba,textSize:le.XXXS,backgroundColor:g.v2.colors.grey[700],textColor:g.v2.colors.grey[300]}),o.typeBadge&&n&&t(Ie,{label:o.typeBadge,textSize:le.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>d(o)}}),[C,g,d]),x=r(()=>{const e=e=>t(li,{...e,fill:g.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[g]),T=c(e=>{const t=w.indexOf(e);if(t<0)return[];const o=C[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:po,leftIcon:si,onClick:()=>p(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:x,onClick:()=>h(o.ruleId,o.samplingId)}]:[]},[w,C,p,h,x]);return t(Me,{fullHeight:!0,richTitle:{icon:_i,title:o,badge:{label:n.length,backgroundColor:g.v2.colors.silver[600],textColor:g.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:b,placeholder:"Search..",width:"500px",...i?{segment:{"data-id":"sampling-segment-type-filter",options:Ch,selected:v,setSelected:y}}:{}},children:t(lo,{variant:so.Pretty,hideHeader:!0,maxHeight:s,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:Ma,subTitle:Ua(m)}:{hideIcon:!0,title:Va,button:{label:Xa,onClick:u}},columns:yh,rows:w,getRowActions:T})})},wh=({workloads:o,samplingRules:a,k8sHealthProbesConfig:i,loading:s,docsUrl:u,tableRowsMaxHeight:p,fetchSamplingRules:h,createNoisyOperationRule:g,updateNoisyOperationRule:m,createHighlyRelevantOperationRule:f,updateHighlyRelevantOperationRule:b,createCostReductionRule:v,updateCostReductionRule:y,deleteSamplingRule:C,updateK8sHealthProbesConfig:S})=>{const T=r(()=>o.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[o]),X=r(()=>Array.from(new Set(o.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[o]),[U,H]=l(k.Noisy),[j,W]=l(null),[G,K]=l(!1),[Y,J]=l(!1),[q,oe]=l(null),[ne,ae]=l(!1),[ie,le]=l(!1),[se,ce]=l(!1),[de,he]=l(!1),ge=d(!1);n(()=>{ge.current||s||(ge.current=!0,0===a.length&&he(!0))},[s,a]);const me=r(()=>w(i),[i]),fe=r(()=>I(a),[a]),be=r(()=>x(fe?.rule??null),[fe]),ve=r(()=>$(a),[a]),ye=r(()=>E(ve?.rule??null),[ve]),Ce=d(j);Ce.current=j,n(()=>{const e=Ce.current;if(!e)return;const t=N(a,e);t?W(t):(W(null),K(!1))},[a]);const Se=r(()=>{const e=new Set;return fe&&e.add(fe.rule.ruleId),ve&&e.add(ve.rule.ruleId),e},[fe,ve]),we=r(()=>O(a,U,Se),[a,U,Se]),xe=c(()=>J(!0),[]),Te=c(()=>J(!1),[]),ke=c(()=>he(!1),[]),Ie=c(async e=>{const t=a[0]?.id??"default";switch(L[U]){case"noisy":await g(t,R(e));break;case"highlyRelevant":await f(t,D(e));break;case"costReduction":await v(t,A(e))}J(!1)},[a,U,g,f,v]),$e=c(e=>{const t=P(a,e);t&&(K(!1),W(t))},[a]),Ee=c(()=>{W(null),K(!1)},[]),Oe=c((e,t)=>{const o=j;if(o&&o.rule.ruleId===e&&o.samplingId===t)K(!0),W({...o});else for(const o of a){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return K(!0),void W({category:n.category,rule:n.rule,samplingId:t,summary:F(n.category,n.rule)})}},[j,a]),Ae=c(async(e,t,o)=>{const n=j?.category;if(n){switch(n){case"noisy":await m(o,t,R(e));break;case"highlyRelevant":await b(o,t,D(e));break;case"costReduction":await y(o,t,A(e))}K(!1)}},[j,m,b,y]),Re=c((e,t)=>{oe({ruleId:e,samplingId:t})},[]),Pe=c(async()=>{if(!q)return;const{ruleId:e,samplingId:t}=q,o=j?.category||L[U];await C(t,e,o),W(null),K(!1),oe(null)},[q,j,U,C]),Le=c(()=>oe(null),[]),Be=c(async(e,t)=>{await S(e,t),ae(!1)},[S]),ze=c(async e=>{const t=a[0]?.id??"default",o=fe;o?await b(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await f(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[a,fe,f,b]),Me=c(async(e,t)=>{const o=a[0]?.id??"default",n=ve;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await v(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),ce(!1)},[a,ve,v,y]),Xe=c(e=>{const t=L[U];let o=null;switch(t){case"noisy":{const n=R(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=D(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=A(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:Ha,ruleId:o}:null},[a,U]),Ve=c(e=>{const t=j?.category,o=j?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=R(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=D(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=A(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:Ha,ruleId:n}:null},[a,j]),Ue=c(e=>{J(!1);for(const t of a){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return K(!0),void W({category:o.category,rule:o.rule,samplingId:t.id,summary:F(o.category,o.rule)})}},[a]),He=r(()=>{const e=[];return u&&e.push({id:Do(),type:zt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:ja,leftIcon:ni,size:ee.S,variant:te.Text,onClick:()=>window.open(u,"_blank")}}),e.push({id:Do(),type:zt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Wa,leftIcon:Ti,size:ee.S,variant:te.Text,onClick:h,loading:s}}),e.push({id:Do(),type:zt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Ga,rightIcon:oi,size:ee.S,variant:te.Primary,onClick:xe}}),e},[u,h,s,xe]);return e(ia,{children:[e(Z,{$gap:12,$justifyContent:"space-between",children:[t(Na,{icon:_i,title:Ya,subTitle:Ka}),t(Oa,{actions:He})]}),e(V,{$gap:12,children:[t(re,{variant:ao.Underline,size:_a.L,options:B,selected:U,setSelected:H}),e(Z,{$justifyContent:"space-between",children:[t(ue,{status:pe.Default,message:z[U]}),u&&t(Q,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:ni,size:ee.S,variant:te.Text,onClick:()=>window.open(u,"_blank")})]}),U===k.Noisy?t(tl,{title:_e,summary:me,onEdit:()=>ae(!0)}):U===k.HighlyRelevant?t(tl,{title:De,summary:be,onEdit:()=>le(!0)}):U===k.CostReduction?t(tl,{title:Fe,summary:ye,onEdit:()=>ce(!0)}):null,t(Sh,{title:M[U],items:we,isLoading:s,showTypeFilter:U===k.HighlyRelevant,tableRowsMaxHeight:p,onRuleClick:$e,onCreateRule:xe,onEditRule:Oe,onDeleteRule:Re})]}),t(dd,{formType:Tl.View,data:j,defaultEditMode:G,onClose:Ee,onDelete:Re,onSaveEdit:Ae,sourceOptions:T,namespaceOptions:X,validateForm:Ve,onNavigateToDuplicate:Ue}),t(dd,{formType:Tl.Create,isOpen:Y,category:L[U],onClose:Te,onSubmit:Ie,sourceOptions:T,namespaceOptions:X,validateForm:Xe,onNavigateToDuplicate:Ue}),t(dd,{formType:Tl.EditAutoNoisy,isOpen:ne,enabled:i?.enabled??!1,keepPercentage:i?.keepPercentage??0,onClose:()=>ae(!1),onSave:Be}),t(dd,{formType:Tl.EditAutoHighlyRelevant,isOpen:ie,enabled:!!fe&&!fe.rule.disabled,onClose:()=>le(!1),onSave:ze}),t(dd,{formType:Tl.EditAutoCostReduction,isOpen:se,enabled:!!ve&&!ve.rule.disabled,dropPercentage:ve?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:Me}),t(Ne,{title:Qa,description:Za,isOpen:!!q,onClose:Le,denyButton:{label:qa,variant:te.Secondary,onClick:Le},approveButton:{label:Ja,variant:te.Primary,onClick:()=>{Pe(),Le()}}}),t(yu,{isOpen:de,onClose:ke,k8sHealthProbesConfig:i,samplingId:a[0]?.id,docsUrl:u,updateK8sHealthProbesConfig:S,createHighlyRelevantOperationRule:f,createCostReductionRule:v})]})},xh=m.div`
|
|
797
792
|
display: flex;
|
|
798
793
|
align-items: center;
|
|
799
794
|
justify-content: space-between;
|
|
800
795
|
padding: 0 12px;
|
|
801
|
-
`,
|
|
796
|
+
`,Th=({disabled:o,loading:n,tabs:a,selectedTab:i,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[u,p]=l(!1),h=r(()=>{const e=[];return c&&e.push({id:Do(),type:zt.Button,buttonProps:{label:"Reset",leftIcon:ti,size:ee.S,variant:te.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Do(),type:zt.Button,buttonProps:{label:"Refresh",leftIcon:Ti,size:ee.S,variant:te.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(xh,{children:[e(Z,{$gap:12,$alignItems:"center",children:[t(Na,{icon:Ci,title:"Odigos Settings"}),t(We,{width:"350px",options:a,values:[i],setValues:e=>s(e[0]),disabled:o})]}),t(Oa,{actions:h}),t(Ne,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:te.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:te.Primary,onClick:()=>{c?.(),p(!1)}}})]})},kh=m(Z)`
|
|
802
797
|
flex: 1;
|
|
803
798
|
min-height: 0;
|
|
804
799
|
width: 100%;
|
|
805
800
|
align-self: stretch;
|
|
806
|
-
`,
|
|
801
|
+
`,Ih=m(V)`
|
|
807
802
|
flex: 1;
|
|
808
803
|
min-height: 0;
|
|
809
804
|
height: 100%;
|
|
810
805
|
overflow-y: auto;
|
|
811
|
-
|
|
806
|
+
`,$h=e=>"general"===e.name?0:"advanced"===e.name?2:1,Eh=({minSupportedVersion:o=0,pageHeightOffset:a=0,configYamls:i,configYamlsLoading:s,effectiveConfig:c,effectiveConfigLoading:d,refetch:u,factoryReset:p,onSave:h,saveLoading:g})=>{const{isVersionSupported:m,version:f,isEnterprise:b}=y(o),v=r(()=>{if(!c)return{};const{manifestYAML:e,provenance:t,...o}=c;return o},[c]),{formData:C,handleFormChange:S,getNestedValue:w,getFormDiff:x,isFormDirty:T}=vt(v);n(()=>{"{}"!==JSON.stringify(v)&&"{}"===JSON.stringify(C)&&S(void 0,void 0,v)},[v,C]);const k=r(()=>[...i].sort((e,t)=>$h(e)-$h(t)),[i]),I=r(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(c?.provenance),[c?.provenance]),$=r(()=>{const e=new Set;for(const t of i)for(const o of t.fields)o.componentType===Ct.Dropdown&&e.add(o.helmValuePath);return e},[i]),E=r(()=>i.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:w("formData",e.helmValuePath)}))),[i,C,w]),[N,O]=l(!1),A=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(x(v,C),$);await(h?.(e)),S(void 0,void 0,{})},D=r(()=>[{id:Do(),type:zt.Button,buttonProps:{"data-id":"settings-save",variant:te.Primary,size:ee.S,label:"Save Changes",leftIcon:mi,loading:g,onClick:()=>O(!0)}},{id:Do(),type:zt.Button,buttonProps:{"data-id":"settings-cancel",variant:te.Secondary,size:ee.S,label:"Cancel",leftIcon:fi,onClick:()=>S(void 0,void 0,v)}}],[g,x,v,C,S]),R=r(()=>k.map(e=>({id:e.name,label:e.displayName})),[k]),P=r(()=>k.map(e=>e.name),[k]),{selectedSection:F,setSelectedSection:L,setSectionRef:_,setScrollContainerRef:B}=ei({sectionNames:P});return e(ia,{$heightOffset:a,$gap:12,children:[t(Th,{disabled:!m,loading:s||d,tabs:R,selectedTab:F,setSelectedTab:L,onClickReset:p?()=>p().then(()=>u?.()):void 0,onClickRefresh:u?()=>u():void 0}),e(La,{children:[!m&&t(bl,{minSupportedVersion:o,currentVersion:f||""}),t(la,{isOpen:T,richTitle:{icon:Ci,title:"Config Settings"},actions:D}),t(Ne,{isOpen:N,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>O(!1),denyButton:{label:"Keep editing",variant:te.Secondary,onClick:()=>O(!1)},approveButton:{label:"Save changes",variant:te.Primary,onClick:()=>{A(),O(!1)}}}),e(kh,{$gap:24,$alignItems:"stretch",children:[t(Ih,{ref:B,$gap:24,$width:"100%",children:i.length?k.map(o=>t(Me,{id:o.name,ref:e=>_(o.name,e),richTitle:{icon:Ci,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!b)return null;if(o.renderCondition&&!de(o.renderCondition,[],E))return null;const n=Qe(o.componentProps||"{}",{}),a=I[o.helmValuePath];return e(V,{$gap:4,children:[t(el,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?pe.Warning:nt.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||g,value:w("formData",o.helmValuePath),setValue:e=>S(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t(ue,{status:pe.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):s?t(He,{$height:"30vh",children:t(Ye,{withSpinner:!0})}):t(Me,{richTitle:{icon:Ci,title:"Config Settings"},children:t(ae,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(Ih,{children:d&&!c?.manifestYAML?t(He,{$height:"30vh",children:t(Ye,{withSpinner:!0})}):t(gl,{title:"Effective Config YAML",yaml:c?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})]})};export{Cs as AddActionDrawer,Gl as AddActionForm,Cd as AddDataStreamModal,Os as AddDestinationDrawer,Jl as AddDestinationForm,As as AddRuleDrawer,as as AddRuleForm,qs as AddSourceDrawer,ku as CentralConnections,ls as DataStreamForm,is as DataStreamMergeWarning,Qs as EditActionDrawer,er as EditConfigDrawer,Sd as EditDataStreamModal,or as EditDestinationDrawer,ar as EditRuleDrawer,qc as EditSourceDrawer,ss as EditSourceForm,Td as ONBOARDING_DONE_MODAL_ID,zu as Onboarding,kd as OnboardingDone,oh as Overview,mh as PipelineCollectors,yu as SamplingOnboardingModal,dd as SamplingRuleDrawer,hs as SamplingRuleForm,wh as SamplingRules,Eh as Settings,yd as SystemDrawer,gh as TABS};
|