@odigos/ui-kit 0.0.190 → 0.0.192
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 +15 -0
- package/lib/chunks/index-BgT3kLZa.js +3 -0
- package/lib/chunks/{ui-components-C1WJWY4E.js → ui-components-CCA7B7ry.js} +334 -334
- package/lib/components/_v2/drop-data/index.d.ts +5 -1
- package/lib/components/_v2/drop-down/index.d.ts +9 -0
- package/lib/components/_v2/index.d.ts +1 -0
- package/lib/components/_v2/input/index.d.ts +1 -1
- package/lib/components/_v2/input-table/index.d.ts +1 -1
- package/lib/components/_v2/input-table/types.d.ts +4 -2
- package/lib/components/_v2/toggle/index.d.ts +2 -1
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/multi-source-control/index.d.ts +1 -1
- package/lib/containers/source-drawer/describe/index.d.ts +1 -1
- package/lib/containers/v2.js +1 -1
- package/lib/containers.js +112 -112
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/index.d.ts +1 -0
- package/lib/snippets/_v2/signals-checkbox-list/index.d.ts +11 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +6 -6
- package/lib/chunks/index-Aa36Kwto.js +0 -3
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as n,useEffect as a,forwardRef as o,useRef as r,useImperativeHandle as l,useMemo as s,Fragment as c,useCallback as d,Children as u}from"react";import p,{css as h,useTheme as m}from"styled-components";import{y as g,ap as y,aq as v,ar as b,as as f,at as x,au as S,av as $,aw as C,ax as w,ay as k,az as D,aA as T,aB as N,aC as E,aD as A,aE as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as n,useEffect as a,forwardRef as o,useRef as r,useImperativeHandle as l,useMemo as s,Fragment as c,useCallback as d,Children as u}from"react";import p,{css as h,useTheme as m}from"styled-components";import{y as g,ap as y,aq as v,ar as b,as as f,at as x,au as S,av as $,aw as C,ax as w,ay as k,az as D,aA as T,aB as N,aC as E,aD as A,aE as F,aF as O,aG as I,aH as R,aI as M,aJ as L,aK as P,aL as K,Z as j,aa as q,aM as H,aN as z,aO as V,U as B,a2 as W,aP as _,aQ as J,aR as U,aS as G,aT as Y,aU as X,aV as Z,aW as Q,aX as ee,aY as te,aZ as ie,S as ne,a_ as ae,a$ as oe,b0 as re,b1 as le,F as se,b2 as ce,b3 as de,b4 as ue,f as pe,b5 as he,b as me,b6 as ge,b7 as ye,b8 as ve,b9 as be,ba as fe,bb as xe,bc as Se,bd as $e,be as Ce,bf as we,bg as ke,bh as De,s as Te,N as Ne,bi as Ee,bj as Ae,bk as Fe,ah as Oe,bl as Ie,bm as Re,bn as Me,a6 as Le,bo as Pe,bp as Ke,bq as je,br as qe,bs as He,bt as ze,bu as Ve,M as Be,X as We,bv as _e,K as Je,bw as Ue,bx as Ge,by as Ye,bz as Xe,bA as Ze,bB as Qe,bC as et,bD as tt,bE as it,bF as nt,bG as at,bH as ot,bI as rt,m as lt,bJ as st,bK as ct,bL as dt,bM as ut,bN as pt,Q as ht,bO as mt,bP as gt,bQ as yt,bR as vt,bS as bt,bT as ft,bU as xt,bV as St,bW as $t,bX as Ct,bY as wt,bZ as kt,b_ as Dt,b$ as Tt,v as Nt,c0 as Et,c1 as At,c2 as Ft,c3 as Ot,H as It,J as Rt,e as Mt,G as Lt,C as Pt,P as Kt,i as jt,c4 as qt,n as Ht,c5 as zt,c6 as Vt,w as Bt,c7 as Wt,c8 as _t,c9 as Jt,ca as Ut,$ as Gt,cb as Yt,cc as Xt,cd as Zt,ce as Qt,cf as ei,cg as ti,ch as ii,ci as ni,cj as ai,ck as oi,cl as ri,cm as li,a8 as si,cn as ci,co as di,cp as ui,cq as pi,cr as hi,cs as mi,ct as gi,cu as yi,cv as vi,a0 as bi,Y as fi,x as xi,cw as Si,cx as $i,cy as Ci,cz as wi,cA as ki,cB as Di,cC as Ti}from"./chunks/ui-components-CCA7B7ry.js";import{VSquareIcon as Ni,XSquareIcon as Ei,EditIcon as Ai,TrashIcon as Fi,OdigosLogoText as Oi,PlusIcon as Ii,RefreshIcon as Ri,SearchIcon as Mi,FilterIcon as Li,DataStreamIcon as Pi,VIcon as Ki,OdigosLogo as ji,ArrowIcon as qi,RefreshLeftArrowIcon as Hi,NotificationIcon as zi,UserIcon as Vi,ImageErrorIcon as Bi,OverviewIcon as Wi,SourceIcon as _i,DestinationIcon as Ji,InstrumentationRuleIcon as Ui,ActionIcon as Gi,SlackLogo as Yi,KeyIcon as Xi,TerminalIcon as Zi,ExclamationTriangleIcon as Qi,TraceViewIcon as en}from"./icons.js";import{MarkerType as tn,useNodesState as nn,useEdgesState as an,applyNodeChanges as on}from"@xyflow/react";import{Y as rn}from"./chunks/index-BgT3kLZa.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-C-kwkNJP.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const ln=e=>{const{type:t,name:i,notes:n,signals:a,disabled:o,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:l,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:h,attributeNamesToDelete:m,renames:f,piiCategories:x,fallbackSamplingRatio:S,samplingPercentage:$,endpointsFilters:C,servicesNameFilters:w,attributeFilters:k}}=e,D=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!o)},{type:y.Monitors,title:g.SIGNALS_FOR_PROCESSING,value:a?.join(", ")||""},{title:g.NAME,value:i||""},{title:g.NOTES,value:n||""},{type:y.Divider}];if(t===v.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(r)}),D.push({title:"Collect ReplicaSet Attributes",value:String(l)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:y.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},a)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${n?.length?n.join(", "):i||b.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${a+1}`:""),value:o})}),u?.length&&D.push({type:y.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},a)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${n?.length?n.join(", "):i||b.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${a+1}`:""),value:o})})),t===v.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(h||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},n)=>{e+=`${t}: ${i}`,n<p.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.DeleteAttributes){let e="";m?.forEach((t,i)=>{e+=t,i<m.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([i,n],a)=>{e+=`${i}: ${n}`,a<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===v.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(S)}),t===v.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===v.LatencySampler&&C?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${i}\n`,o+=`Fallback Sampling Ratio: ${n}`,D.push({title:"Endpoint"+(C.length>1?` #${a+1}`:""),value:o})}),t===v.ServiceNameSampler&&w?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:a})}),t===v.SpanAttributeSampler&&k?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}\n`;const r=Object.keys(n)[0];o+=`Condition: ${r}\n`,o+=`Operation: ${n[r]?.operation}\n`,o+=`Expected Value: ${n[r]?.expectedValue}`,"jsonCondition"===r&&(o+=`\nJSON Path: ${n[r].jsonPath}`),D.push({title:"Filter"+(k.length>1?` #${a+1}`:""),value:o})}),D},sn=f.PiiCategories,cn=p.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -7,14 +7,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
7
7
|
border-radius: 32px;
|
|
8
8
|
padding: 8px;
|
|
9
9
|
`}
|
|
10
|
-
`,cn=[{id:"CREDIT_CARD",label:"Credit Card"}],dn=f.FallbackSamplingRatio,un=[{value:b.Pod,id:b.Pod},{value:b.Namespace,id:b.Namespace},{value:b.Node,id:b.Node}],pn=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:un,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],hn=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:un,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],mn=f.EndpointsFilters,gn=[{title:"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.",required:!0},{title:"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.",required:!0},{title:"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.",required:!0,type:w.Number},{title:"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.",required:!0,type:w.Number}],yn=f.AttributeNamesToDelete,vn=f.Renames,bn=f.ServicesNameFilters,fn=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:w.Number},{title:"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.",required:!0,type:w.Number}],xn=f.SamplingPercentage,Sn=f.AttributeFilters,$n=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"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.",required:!0,type:w.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:A.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:A.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],Cn={[v.K8sAttributes]:({value:n,setValue:o,formErrors:r})=>(a(()=>{n[f.CollectContainerAttributes]||n[f.CollectReplicaSetAttributes]||n[f.CollectWorkloadId]||n[f.CollectClusterId]||n[f.LabelsAttributes]?.length||n[f.AnnotationsAttributes]?.length||(o(f.CollectContainerAttributes,!0),o(f.CollectReplicaSetAttributes,!0),o(f.CollectWorkloadId,!0),o(f.CollectClusterId,!0),o(f.LabelsAttributes,[]),o(f.AnnotationsAttributes,[]))},[]),e(i,{children:[t(S,{title:"Collect Container Attributes",value:n[f.CollectContainerAttributes]||!1,onChange:e=>o(f.CollectContainerAttributes,e),errorMessage:r[f.CollectContainerAttributes]}),t(S,{title:"Collect ReplicaSet Attributes",value:n[f.CollectReplicaSetAttributes]||!1,onChange:e=>o(f.CollectReplicaSetAttributes,e),errorMessage:r[f.CollectReplicaSetAttributes]}),t(S,{title:"Collect Workload ID",value:n[f.CollectWorkloadId]||!1,onChange:e=>o(f.CollectWorkloadId,e),errorMessage:r[f.CollectWorkloadId]}),t(S,{title:"Collect Cluster ID",value:n[f.CollectClusterId]||!1,onChange:e=>o(f.CollectClusterId,e),errorMessage:r[f.CollectClusterId]}),t(D,{columns:pn,value:n[f.LabelsAttributes]||[],onChange:e=>o(f.LabelsAttributes,e),errorMessage:r[f.LabelsAttributes]}),t(D,{columns:hn,value:n[f.AnnotationsAttributes]||[],onChange:e=>o(f.AnnotationsAttributes,e),errorMessage:r[f.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:n,setValue:a,formErrors:o})=>e(i,{children:[t(T,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:n[f.OverwriteExistingValues]||!1,onChange:e=>a(f.OverwriteExistingValues,e)}),t(N,{title:"Resource Attributes",value:n[f.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(f.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:o[f.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[yn],o=e[yn]||[];return t(E,{title:"Attributes to delete",value:o,onChange:e=>i(yn,e),required:!0,errorMessage:a})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[vn],o=Object.entries(e[vn]||{}).map(([e,t])=>({key:e,value:t}));return t(N,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(vn,t)},required:!0,errorMessage:a})},[v.PiiMasking]:({value:i,setValue:o,formErrors:r})=>{const l=r[ln],s=i[ln]||[],[c,d]=n(1===s.length);return a(()=>{if(!s.length){const e=cn.map(({id:e})=>e);o(ln,e),d(1===cn.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(sn,{$hasError:!!l,children:cn.map(({id:e,label:i})=>t(S,{title:i,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e);o(ln,i),d(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[dn],o=e[dn];return t(C,{title:"Fallback sampling ratio",required:!0,type:w.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(dn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[xn],o=e[xn];return t(C,{title:"Sampling percentage",required:!0,type:w.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(xn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[mn],o=e[mn]||[];return t(D,{columns:gn,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(n)}));i(mn,t)},errorMessage:a})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[bn],o=e[bn]||[];return t(D,{columns:fn,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(bn,t)},errorMessage:a})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[Sn],o=(e[Sn]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(D,{columns:$n,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n,operation:a,expectedValue:o,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(i),condition:{[n]:{operation:a,expectedValue:o}}};return r&&(l.condition[n].jsonPath=r),l});i(Sn,t)},errorMessage:a,limitFieldsPerRow:3})}},wn=({actionType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=Cn[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},kn=p.div`
|
|
10
|
+
`,dn=[{id:"CREDIT_CARD",label:"Credit Card"}],un=f.FallbackSamplingRatio,pn=[{value:b.Pod,id:b.Pod},{value:b.Namespace,id:b.Namespace},{value:b.Node,id:b.Node}],hn=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:pn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],mn=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:pn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],gn=f.EndpointsFilters,yn=[{title:"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.",required:!0},{title:"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.",required:!0},{title:"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.",required:!0,type:w.Number},{title:"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.",required:!0,type:w.Number}],vn=f.AttributeNamesToDelete,bn=f.Renames,fn=f.ServicesNameFilters,xn=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:w.Number},{title:"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.",required:!0,type:w.Number}],Sn=f.SamplingPercentage,$n=f.AttributeFilters,Cn=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"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.",required:!0,type:w.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:A.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:A.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],wn={[v.K8sAttributes]:({value:n,setValue:o,formErrors:r})=>(a(()=>{n[f.CollectContainerAttributes]||n[f.CollectReplicaSetAttributes]||n[f.CollectWorkloadId]||n[f.CollectClusterId]||n[f.LabelsAttributes]?.length||n[f.AnnotationsAttributes]?.length||(o(f.CollectContainerAttributes,!0),o(f.CollectReplicaSetAttributes,!0),o(f.CollectWorkloadId,!0),o(f.CollectClusterId,!0),o(f.LabelsAttributes,[]),o(f.AnnotationsAttributes,[]))},[]),e(i,{children:[t(S,{title:"Collect Container Attributes",value:n[f.CollectContainerAttributes]||!1,onChange:e=>o(f.CollectContainerAttributes,e),errorMessage:r[f.CollectContainerAttributes]}),t(S,{title:"Collect ReplicaSet Attributes",value:n[f.CollectReplicaSetAttributes]||!1,onChange:e=>o(f.CollectReplicaSetAttributes,e),errorMessage:r[f.CollectReplicaSetAttributes]}),t(S,{title:"Collect Workload ID",value:n[f.CollectWorkloadId]||!1,onChange:e=>o(f.CollectWorkloadId,e),errorMessage:r[f.CollectWorkloadId]}),t(S,{title:"Collect Cluster ID",value:n[f.CollectClusterId]||!1,onChange:e=>o(f.CollectClusterId,e),errorMessage:r[f.CollectClusterId]}),t(D,{columns:hn,value:n[f.LabelsAttributes]||[],onChange:e=>o(f.LabelsAttributes,e),errorMessage:r[f.LabelsAttributes]}),t(D,{columns:mn,value:n[f.AnnotationsAttributes]||[],onChange:e=>o(f.AnnotationsAttributes,e),errorMessage:r[f.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:n,setValue:a,formErrors:o})=>e(i,{children:[t(T,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:n[f.OverwriteExistingValues]||!1,onChange:e=>a(f.OverwriteExistingValues,e)}),t(N,{title:"Resource Attributes",value:n[f.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(f.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:o[f.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[vn],o=e[vn]||[];return t(E,{title:"Attributes to delete",value:o,onChange:e=>i(vn,e),required:!0,errorMessage:a})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[bn],o=Object.entries(e[bn]||{}).map(([e,t])=>({key:e,value:t}));return t(N,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(bn,t)},required:!0,errorMessage:a})},[v.PiiMasking]:({value:i,setValue:o,formErrors:r})=>{const l=r[sn],s=i[sn]||[],[c,d]=n(1===s.length);return a(()=>{if(!s.length){const e=dn.map(({id:e})=>e);o(sn,e),d(1===dn.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(cn,{$hasError:!!l,children:dn.map(({id:e,label:i})=>t(S,{title:i,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e);o(sn,i),d(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[un],o=e[un];return t(C,{title:"Fallback sampling ratio",required:!0,type:w.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(un,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[Sn],o=e[Sn];return t(C,{title:"Sampling percentage",required:!0,type:w.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(Sn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[gn],o=e[gn]||[];return t(D,{columns:yn,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(n)}));i(gn,t)},errorMessage:a})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[fn],o=e[fn]||[];return t(D,{columns:xn,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(fn,t)},errorMessage:a})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[$n],o=(e[$n]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(D,{columns:Cn,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n,operation:a,expectedValue:o,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(i),condition:{[n]:{operation:a,expectedValue:o}}};return r&&(l.condition[n].jsonPath=r),l});i($n,t)},errorMessage:a,limitFieldsPerRow:3})}},kn=({actionType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=wn[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Dn=p.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
gap: 24px;
|
|
14
14
|
padding: 4px;
|
|
15
|
-
`,
|
|
15
|
+
`,Tn=p(P)`
|
|
16
16
|
margin-bottom: 12px;
|
|
17
|
-
`,
|
|
17
|
+
`,Nn=({isUpdate:i,action:n,formData:a,formErrors:o,handleFormChange:r})=>{const l=m();return e(Dn,{children:[i&&e("div",{children:[t(Tn,{children:"Status"}),t(F,{options:[{icon:Ni,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+O["050"]},{icon:Ei,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+O["050"]}],selected:a.disabled,setSelected:e=>r("disabled",e)})]}),!i&&t(I,{title:"",description:n.docsDescription,actionButton:t(R,{endpoint:n.docsEndpoint})}),t(M,{title:"Signals for Processing",required:!0,allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:o.signals}),!i&&t(C,{title:"Action name",placeholder:"Use a name that describes the action",value:a.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:o.name}),t(kn,{actionType:n.type,value:a.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:o}),t(L,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:o.notes})]})},En=o(({children:a,width:o=640,title:s,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:h=!1,isFormDirty:g=!1,isLastItem:y=!1,onClose:v,onEdit:b,onSave:f,onDelete:x,onCancel:S,tabs:$,headerActionButtons:C},w)=>{const k=m(),{drawerType:D,setDrawerType:T,setDrawerEntityId:N}=K();j({key:"Enter",active:h},()=>U());const[E,A]=n(!1),[F,O]=n(!1),I=r(null),R=D===B.Source,M=()=>{A(!1),O(!1)},L=()=>{M(),b&&b(!1),T(null),N(null),v?.()};l(w,()=>({closeDrawer:L}));const W=()=>{I.current?.clearTitle(),S&&S(),M()},_=()=>{const e=I.current?.isTitleDirty();g||e?O(!0):W()},J=()=>{A(!0)},U=()=>{f&&f(I.current?.getTitle()||"")},G=C||[];return b&&!h&&G.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>b(!0),children:e(i,{children:[t(Ai,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),x&&!h&&G.push({"data-id":"drawer-delete",variant:"tertiary",onClick:J,children:e(i,{children:[t(Fi,{}),t(P,{color:k.text.error,size:14,family:"secondary",decoration:"underline",children:R?q.UNINSTRUMENT:q.DELETE})]})}),e(i,{children:[t(H,{isOpen:!0,onClose:h?_:L,closeOnEscape:!E&&!F,width:`${o+64}px`,header:{icons:u,iconSrcs:p,title:s,titleTooltip:c,replaceTitleWith:!d&&h?t(An,{ref:I,title:s}):void 0,actionButtons:G,tabs:$},footer:{isOpen:h,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:U,children:q.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:_,children:q.CANCEL}],rightButtons:x?[{"data-id":"drawer-delete",variant:"tertiary",onClick:J,children:e(i,{children:[t(Fi,{}),t(P,{size:14,color:k.text.error,family:"secondary",decoration:"underline",children:q.DELETE})]})}]:[]},children:a}),t(z,{isOpen:E,noOverlay:!0,name:`${D}${s?` (${s})`:""}`,type:D,isLastItem:y,onApprove:()=>{x&&x(),M()},onDeny:M}),t(V,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:W,onDeny:M})]})}),An=o(({title:e},i)=>{const[o,r]=n(e);return a(()=>{r(e)},[e]),l(i,()=>({getTitle:()=>o||e,isTitleDirty:()=>o!==e,clearTitle:()=>r(e)})),t(C,{"data-id":"title",value:o,onChange:e=>r(e.target.value)})});An.displayName=An.name,En.displayName=En.name;const Fn=p.div`
|
|
18
18
|
width: 100%;
|
|
19
19
|
height: 100%;
|
|
20
20
|
max-height: calc(100vh - 220px);
|
|
@@ -24,28 +24,28 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
gap: 12px;
|
|
27
|
-
`,
|
|
27
|
+
`,In=({updateAction:i,deleteAction:o})=>{const{actions:l}=W(),{drawerType:c,drawerEntityId:d}=K(),u=r(null),p=c===B.Action,[h,m]=n(!1),[y,v]=n(!1),{formData:b,formErrors:f,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=_(),w=s(()=>{if(d)return l?.find(e=>J(e)===d)},[d,l]);if(a(()=>{p&&w?C(w):S()},[p,w]),!w)return null;const k=U.find(({type:e})=>e===w.type)||U.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===w.type)||U.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===w.type);return t(En,{ref:u,title:w.name||w.type,icons:[X(w.type)],isEdit:h,isFormDirty:y,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if($({withAlert:!0,alertTitle:Z.Update})){const t=e!==w.type?e:"";x("name",t),i(d,{...b,name:t}),m(!1),v(!1)}},onDelete:()=>{o(d,w.type),m(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{m(!1),v(!1),C(w)},children:h&&k?t(Fn,{children:t(Nn,{isUpdate:!0,action:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(On,{children:[t(G,{conditions:w.conditions||[]}),t(Y,{title:g.ACTION_DETAILS,data:w?ln(w):[]})]})})},Rn=p(se)`
|
|
28
28
|
margin-top: 24px;
|
|
29
29
|
gap: 12px;
|
|
30
|
-
`,Mn=({createAction:i})=>{const{currentModal:a,setCurrentModal:o}=Q(),r=a===B.Action,{formData:l,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=_(),[p,h]=n(void 0),m=()=>{d(),h(void 0),o("")},y=()=>{if(!u({withAlert:!0,alertTitle:Z.Create}))return null;i(l),m()};return j({key:"Enter",active:r},()=>y()),t(ee,{isOpen:r,onClose:m,header:{title:"Add Action"},actionComponent:t(le,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!p}]}),children:e(te,{children:[t(I,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e(
|
|
30
|
+
`,Mn=({createAction:i})=>{const{currentModal:a,setCurrentModal:o}=Q(),r=a===B.Action,{formData:l,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=_(),[p,h]=n(void 0),m=()=>{d(),h(void 0),o("")},y=()=>{if(!u({withAlert:!0,alertTitle:Z.Create}))return null;i(l),m()};return j({key:"Enter",active:r},()=>y()),t(ee,{isOpen:r,onClose:m,header:{title:"Add Action"},actionComponent:t(le,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!p}]}),children:e(te,{children:[t(I,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e(Rn,{children:[t(ie,{type:ne.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(g.ACTIONS)}),t(oe,{options:U,selectedOption:p,onOptionSelect:e=>{return t=e,d(),c("type",t?.type||""),void h(t);var t},autoFocus:!p?.type})]}),p?.type?e("div",{children:[t(re,{margin:"16px 0"}),t(Nn,{action:p,formData:l,formErrors:s,handleFormChange:c})]}):null]})})},Ln=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:n,collectWorkloadId:a,collectClusterId:o,labelsAttributes:r,annotationsAttributes:l,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:h,samplingPercentage:m,endpointsFilters:g,attributeFilters:y,servicesNameFilters:f}}=e;let x="";if(t===v.K8sAttributes&&(i&&(x+="Container Attributes, "),n&&(x+="ReplicaSet Attributes, "),a&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},a)=>{const o=n?.length?n.join(","):i||b.Pod;x+=`Label: ${e} ${t} ${o} `,a===r.length-1&&(x+=", ")}),l?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},a)=>{const o=n?.length?n.join(","):i||b.Pod;x+=`Annotation: ${e} ${t} ${o} `,a===l.length-1&&(x+=", ")})),t===v.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{x+=`${e}: ${t}`,i<s.length-1&&(x+=", ")})),t===v.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===v.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],n)=>{x+=`${t}: ${i}`,n<e.length-1&&(x+=", ")})}return t===v.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===v.ErrorSampler&&(x+=String(h)),t===v.ProbabilisticSampler&&(x+=String(m),x+="%"),t===v.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},a)=>{x+=`Endpoint${g.length>1?` #${a+1}`:""}=${e}${t}\n`,x+=` Latency=${i}`,x+=` Sampling=${n}`,a<g.length-1&&(x+=", ")}),t===v.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),t===v.SpanAttributeSampler&&y?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),x},Pn=({conditions:e,id:i})=>{const{errors:n,warnings:a,disableds:o,hasLoadings:r}=s(()=>ce(e),[e]),l=n.length>0?n:a.length>0?a:o.length>0?o:[];if(l.length>0)return t("div",{style:{lineHeight:1},children:t(Kn,{conditions:l,id:i})});const c=r?ue.Loading:ne.Success;return t("div",{style:{lineHeight:1},children:t(de,{status:c,title:c,withBorder:!0,withIcon:!0})})},Kn=({conditions:e,id:i})=>{const n=m();return t(pe,{children:he(e).map(({status:e,type:a,reason:o,message:r,lastTransitionTime:l},s)=>{"loading"!==e&&"disabled"!==e||(e=ne.Info);const c=ge(e,n);return t(me,{titleIcon:c,title:a,text:r||o||"",timestamp:l,children:t(de,{status:e,title:o||a,withBorder:!0,withIcon:!0})},`condition-${i}-${e}-${a}-${s}`)})})},jn=({instrumentationRules:e,sources:t,actions:i,destinations:n,searchText:a,selectedCategory:o})=>{const r=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,l=a?t.filter(e=>e.name?.toLowerCase().includes(a)||e.otelServiceName?.toLowerCase().includes(a)||e.namespace?.toLowerCase().includes(a)):t,s=a?i.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:B.Source,label:"Sources",count:l.length,entities:[]},{category:B.Action,label:"Actions",count:s.length,entities:[]},{category:B.Destination,label:"Destinations",count:c.length,entities:[]},{category:B.InstrumentationRule,label:"Instrumentation Rules",count:r.length,entities:[]}];d.unshift({category:"all",label:"All",count:r.length+l.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(o)).map(e=>({...e,entities:e.category===B.InstrumentationRule?r:e.category===B.Source?l:e.category===B.Action?s:e.category===B.Destination?c:[]}));return{categories:d,searchResults:u}},qn=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],Hn=({maxHeight:i,maxWidth:n})=>{const a=m(),o=ye(),{actions:r,actionsLoading:l}=W(),{setDrawerType:c,setDrawerEntityId:d}=K(),u=s(()=>jn({instrumentationRules:[],sources:[],actions:ve(r,o),destinations:[],searchText:o.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[r,o]),p=s(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=ce(e.conditions||[]);return{status:i?ne.Error:n?ne.Warning:void 0,faded:o,onClick:()=>{c(B.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(be,{icon:X(e.type)})},{columnKey:"name",value:fe(e,B.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:a.text.info},{columnKey:"notes",value:e.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Ln(e),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(xe,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(Pn,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:e.disabled?ne.Error:ne.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=s(()=>u.length!==r.length?{badge:`${u.length}/${r.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:r.length,badgeTooltip:void 0},[u,r]);return e(Se,{$maxWidth:n,children:[t($e,{children:t(Ce,{icon:we(B.Action),title:g.ACTIONS,badge:h,badgeTooltip:y,loading:l})}),t(ke,{$maxHeight:i,children:t(De,{columns:qn,rows:p})}),!u.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},zn=p(se)`
|
|
31
31
|
// width: 100vw;
|
|
32
32
|
// height: 100vh;
|
|
33
33
|
gap: 64px;
|
|
34
34
|
align-items: center;
|
|
35
35
|
justify-content: center;
|
|
36
|
-
`,
|
|
36
|
+
`,Vn=p(se)`
|
|
37
37
|
max-width: 400px;
|
|
38
38
|
gap: 12px;
|
|
39
39
|
align-items: center;
|
|
40
40
|
justify-content: center;
|
|
41
|
-
`,
|
|
41
|
+
`,Bn=p(P)`
|
|
42
42
|
text-align: center;
|
|
43
43
|
font-size: 24px;
|
|
44
|
-
`,
|
|
44
|
+
`,Wn=p(P)`
|
|
45
45
|
text-align: center;
|
|
46
46
|
line-height: 26px;
|
|
47
47
|
color: ${({theme:e})=>e.text.info};
|
|
48
|
-
`,
|
|
48
|
+
`,_n=()=>{const[i,o]=n(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Fe(500),o(e)})()},[]),e(zn,{children:[t(Oi,{size:100}),t(Ee,{width:400}),e(Vn,{children:[e(pe,{$gap:16,children:[t(Bn,{children:"Preparing your workspace..."}),t(Ae,{label:`${i}%`})]}),t(Wn,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Jn=p(se)`
|
|
49
49
|
align-items: center !important;
|
|
50
50
|
justify-content: center !important;
|
|
51
51
|
align-self: stretch;
|
|
@@ -61,9 +61,9 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
61
61
|
cursor: pointer;
|
|
62
62
|
|
|
63
63
|
&:hover {
|
|
64
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+
|
|
64
|
+
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+O["030"]};
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,Un=({entityType:i,description:n})=>{const{setCurrentModal:a}=Q();return e(Jn,{onClick:()=>a(i),children:[e(pe,{$gap:4,children:[t(Ii,{}),e(P,{size:14,weight:600,family:"secondary",decoration:"underline",children:["Add ",i]})]}),t(P,{size:12,align:"center",children:n})]})},Gn=p.div`
|
|
67
67
|
position: relative;
|
|
68
68
|
width: 100%;
|
|
69
69
|
padding: 12px 0;
|
|
@@ -73,11 +73,11 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
73
73
|
border-bottom: 1px solid ${({theme:e})=>e.colors.border};
|
|
74
74
|
`,Yn=p(pe)`
|
|
75
75
|
margin-left: ${({$marginLeft:e})=>e};
|
|
76
|
-
`,
|
|
76
|
+
`,Xn=p(Ie)`
|
|
77
77
|
width: 24px;
|
|
78
78
|
height: 24px;
|
|
79
79
|
padding: 0;
|
|
80
|
-
`,
|
|
80
|
+
`,Zn=p.div`
|
|
81
81
|
position: absolute;
|
|
82
82
|
bottom: -2px;
|
|
83
83
|
left: 0;
|
|
@@ -86,7 +86,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
86
86
|
height: 4px;
|
|
87
87
|
width: ${({percent:e})=>`${e}%`};
|
|
88
88
|
transition: width 0.3s;
|
|
89
|
-
`,
|
|
89
|
+
`,Qn=({entityType:i,badge:n,badgeTooltip:a,isLoading:o,refetch:r,partiallySelected:l,allSelected:s,onSelectAll:c,progressPercent:d})=>{const u=m(),{setCurrentModal:p}=Q(),h=we(i);return e(Gn,{children:[c&&t(Yn,{$marginLeft:"28px",children:t(S,{partiallyChecked:l,value:s,onChange:c})}),t(Yn,{$marginLeft:i===B.Source?"0":"28px",children:t(Ce,{icon:h,title:`${i}s`,badge:n,badgeTooltip:a,loading:!1})}),e(Yn,{$marginLeft:"auto",children:[t(Xn,{"data-id":`refresh-${i}`,variant:"secondary",onClick:r,disabled:o,children:o?t(Oe,{scale:.8}):t(Ri,{fill:u.colors.secondary,size:18})}),t(Xn,{"data-id":`add-${i}`,variant:"primary",onClick:()=>p(i),children:t(Ii,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(Zn,{percent:d})]})},ea=p.div`
|
|
90
90
|
padding: 2px 6px;
|
|
91
91
|
background-color: ${({theme:e})=>e.colors.primary};
|
|
92
92
|
border-radius: 360px;
|
|
@@ -101,7 +101,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
101
101
|
align-items: center;
|
|
102
102
|
justify-content: center;
|
|
103
103
|
white-space: nowrap;
|
|
104
|
-
`,
|
|
104
|
+
`,ta=({entityId:i,entityType:n,status:a,faded:o,title:r,subTitle:l,tooltip:s,label:c,icon:d,icons:u,iconSrc:p,iconSrcs:h,monitors:g,isActive:y,raw:v})=>{const b=m(),f=n===B.Source,x="boolean"==typeof y,{setDrawerType:S,setDrawerEntityId:$}=K(),{selectedSources:C,setSelectedSources:w}=Re(),k={...C},{namespace:D,name:T,kind:N}=v;f&&!k[D]&&(k[D]=[]);const E=f?k[D].findIndex(e=>e.name===T&&e.kind===N):-1;return t(Me,{"data-id":n===B.Source?`${i.namespace}-${i.name}-${i.kind}`:i,title:r,subTitle:l,onClick:()=>{S(n),$(i)},renderActions:()=>{const i=f&&(!v.conditions?.length||v.conditions?.some(({status:e})=>"loading"===e)),n=x&&!y?ge(ne.Info,b):a?ge(a,b):void 0,o=i?t(Oe,{scale:.8}):n?t(n,{size:14}):null;return c?e(ea,{$isError:a===ne.Error,children:[t(me,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:c}),o]}):o||null},iconProps:{icon:d,icons:u,iconSrc:p,iconSrcs:h},visualProps:{status:a,faded:o||x&&!y,monitors:g||void 0},checkboxProps:{withCheckbox:f,isChecked:-1!==E,onCheckboxChange:()=>{-1===E?k[D].push(v):k[D].splice(E,1),w(k)}}})},ia=p.div`
|
|
105
105
|
height: calc(${({$height:e})=>e}px - 24px);
|
|
106
106
|
width: calc(100% - 24px);
|
|
107
107
|
padding: 12px;
|
|
@@ -109,7 +109,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
109
109
|
border: 1px dashed ${({theme:e})=>e.colors.border};
|
|
110
110
|
border-radius: 24px;
|
|
111
111
|
position: relative;
|
|
112
|
-
`,
|
|
112
|
+
`,na=p.div`
|
|
113
113
|
position: absolute;
|
|
114
114
|
bottom: 0;
|
|
115
115
|
left: 0;
|
|
@@ -124,18 +124,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
124
124
|
justify-content: center;
|
|
125
125
|
|
|
126
126
|
pointer-events: none;
|
|
127
|
-
`,
|
|
127
|
+
`,aa=({height:i,entityType:n,entities:a,metrics:o})=>{const{isVm:r}=Le(),l=s(()=>a.map(e=>{const i=J(e);if(!i)return null;const a=[B.Source,B.Destination].includes(n),l=[B.Destination,B.Action].includes(n),s=[B.Destination,B.Action,B.InstrumentationRule].includes(n),c=l?n==B.Destination?Pe(e.exportedSignals):e.signals:void 0,d=a?o?.[`${n.toLowerCase()}s`]?.find(e=>JSON.stringify(J(e))===JSON.stringify(i)):void 0,u=s?!e.disabled:void 0,p=fe(e,n,{extended:n===B.Source,prioritizeDisplayName:n!==B.Source}),h=((e,t,i)=>{switch(e){case B.Source:return i?`${t.kind}`:`${t.namespace} • ${t.kind}`;case B.Destination:return t.destinationType.displayName;case B.Action:case B.InstrumentationRule:return t.type;default:return""}})(n,e,r),m=a?Ke(d?.throughput):void 0,{priorotizedStatus:g,hasDisableds:y}=ce(e.conditions||[]),{icons:v,icon:b,iconSrc:f}=((e,t)=>{switch(e){case B.Source:return{icons:ze(t.containers),icon:we(e)};case B.Destination:return He(t.destinationType.type);case B.Action:return{icon:X(t.type)};case B.InstrumentationRule:return{icon:qe(t.type)};default:return{icon:we(e)}}})(n,e),x=n===B.Source?e.podsAgentInjectionStatus:void 0,S=x?(e=>{switch(e){case Ve.Error:return ne.Error;case Ve.Notice:return ne.Warning;case Ve.Waiting:return ne.Info}})(x.status):void 0,$=x&&S?x.message:void 0;return t(ta,{entityType:n,entityId:i,raw:e,title:p,subTitle:h,faded:y,status:S||g,tooltip:$,label:m,icons:v,icon:b,iconSrc:f,monitors:c,isActive:u},JSON.stringify(i))}),[a,n,o,r]);return e(ia,{$height:i,children:[t(je,{containerHeight:i-24,elementHeight:80,elements:l}),t(na,{$hide:!0})]})},oa=p.div`
|
|
128
128
|
width: ${({$isVm:e})=>e?"45vw":"22vw"};
|
|
129
129
|
display: flex;
|
|
130
130
|
flex-direction: column;
|
|
131
131
|
gap: 12px;
|
|
132
|
-
`,
|
|
132
|
+
`,ra=({entityType:i,entities:n,unfilteredCount:a,metrics:o,loading:r,maxHeight:l,refetch:c})=>{const{isVm:d}=Le(),{frameHeight:u,hasFiltersApplied:p,isSources:h}=s(()=>({frameHeight:Math.min(l,80*n.length+12),hasFiltersApplied:n.length!==a,isSources:i===B.Source}),[i,n.length,l,a]),{progress:m}=Be(),y=s(()=>h&&(m[We.Instrumenting]||m[We.Uninstrumenting])?m[We.Instrumenting]?.percentage||m[We.Uninstrumenting]?.percentage||0:void 0,[h,m[We.Instrumenting],m[We.Uninstrumenting]]),{selectedSources:v,setSelectedSources:b}=Re(),f=s(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[B.InstrumentationRule,B.Action].includes(i)?null:e(oa,{$isVm:d,children:[t(Qn,{entityType:i,badge:"number"==typeof y?`${y}%`:p?`${n.length}/${a}`:a,badgeTooltip:p?g.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:c,partiallySelected:f>0&&n?.length!==f,allSelected:f>0&&n?.length===f,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),b(e)}else b({})}:void 0,progressPercent:y}),n.length?t(aa,{height:u,entityType:i,entities:n,metrics:o}):r?t(_e,{size:3}):t(Un,{entityType:i,description:g.TO_COLLECT_OTEL_DATA})]})},la=p.div`
|
|
133
133
|
width: 100%;
|
|
134
134
|
height: ${({$height:e})=>e};
|
|
135
135
|
display: flex;
|
|
136
136
|
justify-content: space-evenly;
|
|
137
137
|
gap: 24px;
|
|
138
|
-
`,
|
|
138
|
+
`,sa=({height:i,metrics:o,refetchSources:r,refetchDestinations:l,refetchActions:c,refetchInstrumentationRules:d})=>{const u=ye(),{selectedStreamName:p}=Je(),{containerRef:h,containerHeight:m}=Ue(),{sources:g,sourcesLoading:y,destinations:v,destinationsLoading:b,actions:f,actionsLoading:x,instrumentationRules:S,instrumentationRulesLoading:$}=W(),C=s(()=>Ge(g,p),[g,p]),w=s(()=>Ye(v,p),[v,p]),[k,D]=n([]),[T,N]=n([]),[E,A]=n([]),[F,O]=n([]);return a(()=>{D(Xe(C,u))},[C,u]),a(()=>{N(Ze(w,u))},[w,u]),a(()=>{A(ve(f,u))},[f,u]),a(()=>{O(S)},[S]),e(la,{ref:h,$height:i,children:[t(ra,{entityType:B.InstrumentationRule,entities:F,unfilteredCount:S.length,loading:$,maxHeight:m,refetch:d}),t(ra,{entityType:B.Source,entities:k,unfilteredCount:C.length,metrics:o,loading:y,maxHeight:m,refetch:r}),t(ra,{entityType:B.Action,entities:E,unfilteredCount:f.length,loading:x,maxHeight:m,refetch:c}),t(ra,{entityType:B.Destination,entities:T,unfilteredCount:w.length,metrics:o,loading:b,maxHeight:m,refetch:l})]})},ca=p.div`
|
|
139
139
|
position: relative;
|
|
140
140
|
max-width: 200px;
|
|
141
141
|
`;p.div`
|
|
@@ -149,36 +149,36 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
149
149
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
150
150
|
border: ${({theme:e})=>`1px solid ${e.colors.border}`};
|
|
151
151
|
border-radius: 24px;
|
|
152
|
-
`;const
|
|
152
|
+
`;const da=p.div`
|
|
153
153
|
display: flex;
|
|
154
154
|
align-items: center;
|
|
155
155
|
overflow-x: scroll;
|
|
156
|
-
`,
|
|
156
|
+
`,ua=({onClose:i})=>{const o=m(),{onClickNode:r}=Qe(),{searchText:l}=ye(),{selectedStreamName:d}=Je(),{sources:u,destinations:p,actions:h,instrumentationRules:g}=W(),{popupRef:y,popupOpen:v,setPopupOpen:b,popupPosition:f,handlePosition:x}=et();a(()=>{v||(x(0,50),b(!0))},[v]);const[S,$]=n("all"),{categories:C,searchResults:w}=s(()=>jn({instrumentationRules:g,sources:Ge(u,d),actions:h,destinations:Ye(p,d),searchText:l,selectedCategory:S}),[g,u,h,p,d,l,S]);return w.length?t(tt,{ref:y,isOpen:v,top:f.top,left:f.left,maxWidth:"420px",header:t(da,{children:C.map(({category:e,label:i,count:n})=>!!n&&t(nt,{label:i,badgeLabel:n,isSelected:S===e,onClick:()=>$(e)},`category-select-${e}`))}),children:w.map(({category:n,label:a,entities:l},s)=>!!l.length&&e(c,{children:[e(it,{style:{maxHeight:"all"!==S?"240px":"140px",padding:"12px 0"},children:[t(P,{size:12,family:"secondary",color:o.text.darker_grey,style:{marginLeft:"16px"},children:a}),l.map((e,a)=>t(nt,{icon:we(n),label:fe(e,n,{extended:!0}),onClick:()=>{const t=J(e);r(null,{data:{type:n,id:t}}),i()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"},`entity-${s}-${a}`))]}),t(re,{thickness:s===w.length-1?0:1,length:"90%",margin:"8px auto"})]},`category-list-${n}`))}):t(tt,{ref:y,isOpen:v,top:f.top,left:f.left,children:t(Ne,{})})},pa=({preventPopup:i=!1})=>{const{searchText:a,setSearchText:o}=ye(),[l,s]=n(!1),c=!!a||l,d=()=>{o(""),s(!1)},u=r(null);return at(u,d),j({key:"Escape",active:c},d),e(ca,{ref:u,children:[t(C,{placeholder:"Search",icon:Mi,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>s(!0)}),c&&!i?t(ua,{onClose:d}):null]})},ha=({sources:e,title:i="Condition",value:n,onSelect:a,onDeselect:o,...r})=>{const l=s(()=>{const t=[];return e.forEach(({conditions:e})=>{e?.forEach(({type:e,reason:i})=>{t.find(t=>t.id===`${e}#${i}`)||t.push({id:`${e}#${i}`,value:`${ot(e)} - ${ot(i)}`})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(rt,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:a,onDeselect:o,...r})},ma=({sources:e,title:i="Error Message",value:n,onSelect:a,onDeselect:o,disabled:r,...l})=>{const c=s(()=>{const t=[];return e.forEach(({conditions:e})=>{he(e||[]).forEach(({status:e,message:i,reason:n})=>{e!==ne.Error||t.find(e=>e.id===i)||(i?t.find(e=>e.id===i)||t.push({id:i,value:i}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n})))})}),t},[e]);return t(rt,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:n,onSelect:a,onDeselect:o,...l})},ga=({sources:e,title:i="Programming Language",value:n,onSelect:a,onDeselect:o,...r})=>{const l=s(()=>{const t=[];return e.forEach(({containers:e})=>{e?.forEach(({language:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:lt[e]||e})})}),t.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[e]);return t(rt,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:a,onDeselect:o,...r})},ya=({title:e="Monitors",value:i,onSelect:n,onDeselect:a,...o})=>{const r=s(()=>{const e=[];return st.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return t(rt,{disabled:!r?.length,title:e,placeholder:"All",options:r,value:i,onSelect:n,onDeselect:a,...o})},va=({namespaces:e,title:i="Namespace",value:n,onSelect:a,onDeselect:o,...r})=>{const l=s(()=>{const t=[];return e?.forEach(({name:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(rt,{disabled:!l?.length,title:i,placeholder:"Select namespace",options:l,value:n,onSelect:a,onDeselect:o,...r})},ba=({sources:e,title:i="Kind",value:n,onSelect:a,onDeselect:o,...r})=>{const l=s(()=>{const t=[];return e.forEach(({kind:e})=>{t.find(t=>t.id===e)||t.push({id:e,value:e})}),t},[e]);return t(rt,{disabled:!l?.length,title:i,placeholder:"All",options:l,value:n,onSelect:a,onDeselect:o,...r})},fa=({sources:e,title:i="Agent Injection Status",value:n,onSelect:a,onDeselect:o,disabled:r,...l})=>{const c=s(()=>{const t=[];return e.forEach(({podsAgentInjectionStatus:e})=>{const{reasonEnum:i,message:n}=e||{};i?t.find(e=>e.id===i)||t.push({id:i,value:ot(i)}):n&&(t.find(e=>e.id===n)||t.push({id:n,value:n}))}),t},[e]);return t(rt,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:n,onSelect:a,onDeselect:o,...l})},xa=p.div`
|
|
157
157
|
display: flex;
|
|
158
158
|
flex-direction: column;
|
|
159
159
|
gap: 12px;
|
|
160
160
|
padding: 12px;
|
|
161
|
-
`,
|
|
161
|
+
`,Sa=p.div`
|
|
162
162
|
padding: 12px 6px 6px 6px;
|
|
163
|
-
|
|
163
|
+
`,$a=p(Ie)`
|
|
164
164
|
font-size: 14px;
|
|
165
165
|
${({$color:e})=>`color: ${e};`}
|
|
166
|
-
|
|
166
|
+
`,Ca=p.div`
|
|
167
167
|
margin-left: auto;
|
|
168
|
-
`,
|
|
168
|
+
`,wa=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},ka=()=>{const i=m(),{namespaces:o,sources:l}=W(),{selectedStreamName:c}=Je(),{getItemSS:d,setItemSS:u,removeItemSS:p}=dt(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=et(),{namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k,podsAgentInjectionStatus:D,setAll:N,clearAll:E,getEmptyState:A}=ye(),F=s(()=>Ge(l,c),[l,c]),[O,I]=n({namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k,podsAgentInjectionStatus:D}),[R,M]=n(wa(O));a(()=>{const e=d(ct.OVERVIEW_FILTERS,A());N(e)},[]),a(()=>{if(!g){const e={namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k};I(e),M(wa(e))}},[g,f,x,S,$,C,w,k]);const L=()=>{y(!1)},P=r(null);return at(P,L),j({key:"Escape",active:g},L),e(ca,{ref:P,children:[t(nt,{label:"Filters",icon:Li,badgeLabel:R,badgeFilled:!!R,withBorder:!0,color:"transparent",onClick:()=>{b(0,50),y(!0)}}),t(tt,{ref:h,isOpen:g,top:v.top,left:v.left,width:"420px",footer:e(pe,{children:[t($a,{variant:"primary",onClick:()=>{u(ct.OVERVIEW_FILTERS,O),N(O),M(wa(O)),y(!1)},children:"Apply"}),t($a,{variant:"secondary",onClick:L,children:"Cancel"}),t(Ca,{children:t($a,{variant:"tertiary",onClick:()=>{p(ct.OVERVIEW_FILTERS),E(),I(A()),M(0),y(!1)},$color:i.text.error,children:"Reset"})})]}),children:e(xa,{children:[t(va,{namespaces:o,value:O.namespaces,onSelect:e=>I(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>I(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ba,{sources:F,value:O.kinds,onSelect:e=>I(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>I(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ga,{sources:F,value:O.languages,onSelect:e=>I(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>I(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ya,{value:O.monitors,onSelect:e=>I(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>I(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ha,{sources:F,value:O.conditions,onSelect:e=>I(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>I(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(fa,{sources:F,value:O.podsAgentInjectionStatus,onSelect:e=>I(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>I(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(Sa,{children:t(T,{title:"Show only sources with errors",initialValue:O.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})}),t(ma,{sources:F,value:O.errors,onSelect:e=>I(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>I(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!O.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},Da=p.div`
|
|
169
169
|
display: flex;
|
|
170
170
|
flex-direction: column;
|
|
171
171
|
gap: 24px;
|
|
172
172
|
padding: 4px;
|
|
173
|
-
`,
|
|
173
|
+
`,Ta=({formData:i,handleFormChange:n,formErrors:a,editingStreamName:o})=>{const{dataStreams:r,selectedStreamName:l}=Je(),c=o||l,d=s(()=>r.find(e=>e.name===i.name&&e.name!==c),[r,i.name,c]);return e(Da,{children:[t(C,{name:"name",title:g.STREAM_NAME,placeholder:g.NAME_YOUR_STREAM_PLACEHOLDER,required:!0,value:i.name,onChange:({target:{value:e}})=>n("name",e),errorMessage:a.name}),d&&t(ie,{type:ne.Warning,message:g.DATA_STREAM_EXISTS_WARNING(c,d.name)})]})},Na=p.div`
|
|
174
174
|
width: 100%;
|
|
175
175
|
height: 100%;
|
|
176
176
|
max-height: calc(100vh - 220px);
|
|
177
177
|
overflow: overlay;
|
|
178
178
|
overflow-y: auto;
|
|
179
|
-
`,
|
|
179
|
+
`,Ea=({isOpen:e,onClose:i,dataStreamName:a,updateDataStream:o})=>{const{dataStreams:l}=Je(),c=r(null),[u,p]=n(!1),{formData:h,handleFormChange:m,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ut({name:a}),f=s(()=>{if(!e)return v();const t=l?.find(e=>e.name===a);return t?b(t):v(),t},[e,l,a]),x=d((e,t)=>{m(e,t),p(!0)},[m]);return f?t(En,{ref:c,title:f.name,icons:[Pi],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Z.Update})&&(o(a,h),p(!1),i())},onCancel:()=>{v(),p(!1),i()},children:t(Na,{children:t(Ta,{formData:h,handleFormChange:x,formErrors:g,editingStreamName:a})})}):null},Aa=p.div`
|
|
180
180
|
position: relative;
|
|
181
|
-
`,
|
|
181
|
+
`,Fa=p(pe)`
|
|
182
182
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
183
183
|
border-radius: 32px;
|
|
184
184
|
|
|
@@ -187,22 +187,22 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
187
187
|
}
|
|
188
188
|
`,Oa=p(P)`
|
|
189
189
|
text-wrap: nowrap;
|
|
190
|
-
`,
|
|
190
|
+
`,Ia=p(it)`
|
|
191
191
|
max-height: 240px;
|
|
192
192
|
padding: 0px !important;
|
|
193
|
-
`,
|
|
193
|
+
`,Ra=p(pe)`
|
|
194
194
|
width: 100%;
|
|
195
195
|
`,Ma=p.div`
|
|
196
196
|
width: 100%;
|
|
197
|
-
`,
|
|
197
|
+
`,La=({onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const l=m(),{clearStore:c}=pt(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:h,handlePosition:g}=et(),{dataStreams:y,selectedStreamName:v,setSelectedStreamName:b}=Je(),[f,x]=n(""),[S,$]=n(""),[w,k]=n(""),D=s(()=>y.filter(({name:e})=>!w||e.toLowerCase().includes(w.toLowerCase())).map(({name:i})=>e(Ra,{children:[t(Ma,{children:t(nt,{label:i,isSelected:v===i,onClick:()=>{c(),b(i),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),i!==ht&&t(mt,{onClick:()=>$(i),tooltip:q.DELETE,children:t(Fi,{})}),t(mt,{onClick:()=>x(i),tooltip:q.EDIT,children:t(Ai,{})})]},`stream-${i}`)),[y,v,w]);return e(i,{children:[e(Aa,{children:[e(Fa,{$gap:0,children:[e(Ie,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(Pi,{fill:l.text.info}),e(Oa,{children:["Data Stream: ",v]}),t(gt,{extend:u}),t(Ae,{label:y.length})]}),t(re,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(yt,{onClick:()=>{c(),a()},label:q.NEW})]}),t(tt,{ref:d,isOpen:u,top:h.top,left:h.left,header:t(C,{placeholder:"Search...",icon:Mi,value:w,onChange:e=>k(e.target.value)}),children:t(Ia,{children:D})})]}),t(z,{isOpen:""!==S,name:S,onApprove:()=>{r(S),$("")},onDeny:()=>{$("")}}),t(Ea,{isOpen:""!==f,onClose:()=>{x("")},dataStreamName:f,updateDataStream:o})]})},Pa=p.div`
|
|
198
198
|
display: flex;
|
|
199
199
|
align-items: center;
|
|
200
200
|
margin: 20px 0;
|
|
201
201
|
padding: 0 16px;
|
|
202
202
|
gap: 8px;
|
|
203
|
-
`,
|
|
203
|
+
`,Ka=p.div`
|
|
204
204
|
margin-left: auto;
|
|
205
|
-
`,
|
|
205
|
+
`,ja=({addEntity:i,preventSearchPopup:n,onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const{isVm:l}=Le(),{setCurrentModal:s}=Q();return e(Pa,{children:[!l&&t(La,{onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r}),t(pa,{preventPopup:n}),t(ka,{}),i&&t(Ka,{children:t(yt,{"data-id":`add-${i}`,onClick:()=>s(i),label:`${q.ADD} ${ot(i)}`,variant:"primary",textProps:{weight:900}})})]})},qa=o(({isModal:i,onClickSummary:n},a)=>{const{selectedStreamName:o}=Je(),{formData:r,handleFormChange:s,formErrors:c,validateForm:d}=ut({name:o});return l(a,()=>({validateForm:d,getFormValues:()=>r})),t(te,{$isNotModal:!i,children:e(se,{$gap:24,children:[n&&t(vt,{onClick:n}),t(I,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(Ta,{formData:r,handleFormChange:s,formErrors:c})]})})});qa.displayName=qa.name;const Ha=({createDataStream:e})=>{const{currentModal:i,setCurrentModal:n}=Q(),{addDataStreams:a,setSelectedStreamName:o}=Je(),l=i===bt.DataStream,s=()=>n(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(a([t]),o(t.name)),s()}},d=r(null);return j({key:"Enter",active:l},c),t(ee,{isOpen:l,onClose:s,header:{title:"Add Data Stream"},actionComponent:t(le,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(qa,{ref:d,isModal:!0})})},za=(e,t)=>{const{destinationType:i,disabled:n,exportedSignals:a}=e,o=[{title:g.TYPE,value:i.type},{type:y.ActiveStatus,title:g.STATUS,value:String(!n)},{type:y.Monitors,title:g.MONITORS,value:Pe(a).join(", ")},{title:g.NAME,value:i.displayName}],r=ft(e,t),l=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:i,value:n})=>{const{secret:r,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!xt(c,Pe(a),l)){const{type:e}=St(s,{type:""}),t=(r||"password"===e)&&n.length?new Array(10).fill("•").join(""):"";o.push({type:y.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==n&&o.push({title:t.title,value:t.value})}):o.push({title:i,value:t||n})}}),o},Va=({signals:e,fields:i,onChange:n,formErrors:a})=>i?.map(o=>{const{componentType:r,renderCondition:l,...s}=o;if(l&&!xt(l,e,i))return null;switch(r){case A.Input:return t(C,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case A.Dropdown:return t(rt,{...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>n(o.name,e.id),errorMessage:a[o.name]},o.name);case A.MultiInput:return t(E,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case A.KeyValuePair:return t(N,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case A.TextArea:return t(L,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case A.Checkbox:return t(S,{...s,value:"true"==s.value,onChange:e=>n(o.name,String(e)),errorMessage:a[o.name]},o.name);default:return null}}),Ba=p(Ie)`
|
|
206
206
|
display: flex;
|
|
207
207
|
align-items: center;
|
|
208
208
|
gap: 8px;
|
|
@@ -216,43 +216,43 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
216
216
|
`:h`
|
|
217
217
|
background-color: transparent;
|
|
218
218
|
`}
|
|
219
|
-
`,
|
|
219
|
+
`,Wa=({destination:i,validateForm:a,status:o,testConnection:r,onSuccess:l,onError:s})=>{const c=m(),{selectedStreamName:d}=Je(),[u,p]=n(!1),h=o?ge(o,c):void 0;return e(Ba,{$status:o,variant:"secondary",onClick:async()=>{if(a()){p(!0);const e=await r({...i,currentStreamName:d});e&&(e.succeeded?l(e):s(e)),p(!1)}},children:[u?t(Oe,{}):h?t(h,{}):null,t(P,{family:"secondary",decoration:"underline",size:14,color:o?c.text[o]:void 0,children:u?"Checking":o===ne.Success?"Connection OK":"error"===o?"Connection Failed":"Test Connection"})]})},_a=p(se)`
|
|
220
220
|
align-items: unset;
|
|
221
221
|
padding: 0 4px;
|
|
222
|
-
`,
|
|
222
|
+
`,Ja=p.div`
|
|
223
223
|
display: flex;
|
|
224
224
|
flex-direction: column;
|
|
225
225
|
gap: 12px;
|
|
226
|
-
`,
|
|
226
|
+
`,Ua=p(pe)`
|
|
227
227
|
justify-content: space-between;
|
|
228
|
-
`,
|
|
228
|
+
`,Ga=p(P)`
|
|
229
229
|
margin-bottom: 12px;
|
|
230
|
-
`,Ya=({isUpdate:i,categoryItem:o,formData:l,formErrors:c,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:h,testConnection:y})=>{const{type:v,displayName:b,supportedSignals:f,testConnectionSupported:x}=o||{},S=m(),[$,w]=n(!1),[k,D]=n(!1),[T,N]=n(void 0),E=r(!1);a(()=>{if(p.length&&!E.current){E.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:i,value:n}=p[t];if(i){if([void 0,null,""].includes(n)){e=!1;break}e=!0}}w(e)}},[p,k]);const A=s(()=>{const{logs:e,metrics:t,traces:i}=f||{},n=[];return e?.supported&&n.push($t.Logs),t?.supported&&n.push($t.Metrics),i?.supported&&n.push($t.Traces),n},[f]),L=s(()=>{const{logs:e,metrics:t,traces:i}=l.exportedSignals||{},n=[];return e&&n.push($t.Logs),t&&n.push($t.Metrics),i&&n.push($t.Traces),n},[l.exportedSignals]),P=()=>{w(!1),D(!0),N(void 0)};return e(
|
|
230
|
+
`,Ya=({isUpdate:i,categoryItem:o,formData:l,formErrors:c,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:h,testConnection:y})=>{const{type:v,displayName:b,supportedSignals:f,testConnectionSupported:x}=o||{},S=m(),[$,w]=n(!1),[k,D]=n(!1),[T,N]=n(void 0),E=r(!1);a(()=>{if(p.length&&!E.current){E.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:i,value:n}=p[t];if(i){if([void 0,null,""].includes(n)){e=!1;break}e=!0}}w(e)}},[p,k]);const A=s(()=>{const{logs:e,metrics:t,traces:i}=f||{},n=[];return e?.supported&&n.push($t.Logs),t?.supported&&n.push($t.Metrics),i?.supported&&n.push($t.Traces),n},[f]),L=s(()=>{const{logs:e,metrics:t,traces:i}=l.exportedSignals||{},n=[];return e&&n.push($t.Logs),t&&n.push($t.Metrics),i&&n.push($t.Traces),n},[l.exportedSignals]),P=()=>{w(!1),D(!0),N(void 0)};return e(_a,{$gap:24,children:[e(_a,{$gap:12,children:[t(I,{title:i?"Update destination":"Create destination",description:`Connect ${b} with Odigos.`,actionButton:x&&t(Wa,{destination:l,validateForm:d,status:T?.type,testConnection:y,onError:e=>{D(!1),N({type:ne.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{D(!1),N({type:ne.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(Ja,{children:[x&&T&&t(ie,{type:T.type,title:T.title,message:T.message}),$&&!T&&!i&&t(ie,{type:ne.Default,message:`Odigos autocompleted ${b} destination details.`})]}),t(re,{})]}),e(Ua,{children:[t(M,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:A,selectedSignals:L,setSelectedSignals:e=>{P(),u("exportedSignals",{logs:e.includes($t.Logs),metrics:e.includes($t.Metrics),traces:e.includes($t.Traces)})},errorMessage:c.exportedSignals}),!i&&t(R,{endpoint:`/backends/${v}`})]}),i&&e("div",{children:[t(Ga,{children:"Status"}),t(F,{options:[{icon:Ni,label:g.ENABLED,value:!1,selectedBgColor:S.text.success+O["050"]},{icon:Ei,label:g.DISABLED,value:!0,selectedBgColor:S.text.error+O["050"]}],selected:l.disabled,setSelected:e=>u("disabled",e)})]}),!i&&t(C,{title:"Destination name",placeholder:"Enter destination name",value:l.name,onChange:e=>{P(),u("name",e.target.value)},errorMessage:c.name}),t(Va,{signals:L,fields:p,onChange:(e,t)=>{P(),h(i=>{const n=[...i],a=n.findIndex(t=>t.name===e);return-1!==a&&(n[a]={...n[a],value:t}),n})},formErrors:c})]})},Xa=p.div`
|
|
231
231
|
width: 100%;
|
|
232
232
|
height: 100%;
|
|
233
233
|
max-height: calc(100vh - 220px);
|
|
234
234
|
overflow: overlay;
|
|
235
235
|
overflow-y: auto;
|
|
236
|
-
`,
|
|
236
|
+
`,Za=p.div`
|
|
237
237
|
display: flex;
|
|
238
238
|
flex-direction: column;
|
|
239
239
|
gap: 12px;
|
|
240
|
-
`,
|
|
240
|
+
`,Qa=({categories:i,updateDestination:o,deleteDestination:l,testConnection:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{drawerType:p,drawerEntityId:h}=K(),m=s(()=>Ye(d,u),[d,u]),y=r(null),v=p===B.Destination,[b,f]=n(!1),[x,S]=n(!1),{formData:$,formErrors:C,handleFormChange:w,resetFormData:k,validateForm:D,loadFormWithDrawerItem:T,yamlFields:N,setYamlFields:E,dynamicFields:A,setDynamicFields:F}=Ct({}),O=s(()=>{if(h)return m?.find(e=>J(e)===h)},[h,m]);if(a(()=>{v&&O?(E(wt(i,O)),T(O)):k()},[v,O,i]),!O)return null;const I=i.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:R,iconSrc:M}=I?He(I?.type):{icon:void 0,iconSrc:void 0};return t(En,{ref:y,title:O.name||O.destinationType.displayName,icons:R?[R]:void 0,iconSrcs:M?[M]:void 0,isEdit:b,isFormDirty:x,onEdit:e=>{f("boolean"!=typeof e||e)},onSave:async e=>{if(D({withAlert:!0,alertTitle:Z.Update})){const t=e!==O.destinationType.displayName?e:"";w("name",t),o(h,{...$,name:t}),f(!1),S(!1)}},onDelete:async()=>{l(h),f(!1),S(!1),y.current?.closeDrawer()},onCancel:()=>{f(!1),S(!1),T(O)},isLastItem:1===m.length,children:b?t(Xa,{children:t(Ya,{isUpdate:!0,categoryItem:I,formData:$,formErrors:C,handleFormChange:(...e)=>{S(!0),w(...e)},dynamicFields:A,setDynamicFields:(...e)=>{S(!0),F(...e)},validateForm:D,testConnection:c})}):e(Za,{children:[O.conditions?.length?t(G,{conditions:O.conditions}):null,t(Y,{title:g.DESTINATION_DETAILS,data:O?za(O,N):[]})]})})},eo=p.div`
|
|
241
241
|
display: flex;
|
|
242
242
|
flex-direction: column;
|
|
243
243
|
gap: 12px;
|
|
244
|
-
`,
|
|
244
|
+
`,to=({items:i,onSelectNew:n,onSelectConfigured:a,isLoadingForDestinationIds:o})=>{const{configuredDestinationsUpdateOnly:r}=pt();return i.map(i=>{const l=i.name===Tt.EXISTS.TITLE;return e(eo,{children:[t(I,{size:"small",icon:i.icon,title:kt(i.name),description:i.description}),i.items.map(e=>{const s=`select-${i.name.replaceAll(" ","")}-destination-${e.type}`,c=Dt(e.supportedSignals),{icon:d,iconSrc:u}=He(e.type),p=e.selected||r.some(t=>t.id===e.id),h=!!o.find(t=>t===e.id),m=l?()=>a(e.id):()=>n(e);return t(Me,{"data-id":s,title:e.displayName,hoverText:q.SELECT,onClick:m,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:h,onCheckboxChange:()=>a(e.id)}},s)})]},`category-${i.name}`)})},io=p.div`
|
|
245
245
|
display: flex;
|
|
246
246
|
flex-direction: column;
|
|
247
247
|
gap: 24px;
|
|
248
|
-
`,
|
|
248
|
+
`,no=p.div`
|
|
249
249
|
display: flex;
|
|
250
250
|
align-items: center;
|
|
251
251
|
gap: 12px;
|
|
252
|
-
`,
|
|
252
|
+
`,ao=p.div`
|
|
253
253
|
width: 170px;
|
|
254
254
|
margin-right: 8px;
|
|
255
|
-
`,
|
|
255
|
+
`,oo=p.div`
|
|
256
256
|
display: flex;
|
|
257
257
|
flex-direction: column;
|
|
258
258
|
align-self: stretch;
|
|
@@ -263,18 +263,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
263
263
|
@media (height < 800px) {
|
|
264
264
|
max-height: calc(100vh - 400px);
|
|
265
265
|
}
|
|
266
|
-
`,
|
|
266
|
+
`,ro=p(io)`
|
|
267
267
|
margin-top: 80px;
|
|
268
|
-
`,{MANAGED:
|
|
268
|
+
`,{MANAGED:lo,SELF_HOSTED:so,DETECTED:co,EXISTS:uo}=Tt,po=[{value:"All types",id:"all"},{value:lo.TITLE,id:lo.TITLE},{value:so.TITLE,id:so.TITLE},{value:co.TITLE,id:co.TITLE},{value:uo.TITLE,id:uo.TITLE}],ho=po[0],mo=[$t.Logs,$t.Metrics,$t.Traces],go=(e,t,i)=>e.map(e=>{const{type:n,displayName:a}=e.destinationType,o=e.dataStreamNames?.includes(t),r=i.has(e.id);return{id:e.id,type:n,displayName:a,selected:o||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),yo=({hidden:i,categories:a,potentialDestinations:o,onSelectNew:r,onSelectConfigured:l,isLoadingForDestinationIds:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{configuredDestinations:p,configuredDestinationsUpdateOnly:h}=pt(),[m,g]=n(""),[y,v]=n(ho),[b,f]=n(mo),x=s(()=>{const e=Nt(a);return e.unshift({name:uo.TITLE,description:uo.DESCRIPTION,icon:Ki,items:go(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:co.TITLE,description:co.DESCRIPTION,icon:ji,items:o}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),n="all"===y.id||y.id===e.name,a=b.some(e=>t.supportedSignals[Et[e]]?.supported);return i&&n&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,o,d,m,y,b,u,p,h]);return i?null:e(io,{children:[t(I,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(no,{children:[t(ao,{children:t(C,{placeholder:"Search...",icon:Mi,value:m,onChange:({target:{value:e}})=>g(e)})}),t(ao,{children:t(rt,{options:po,value:y,onSelect:v,onDeselect:()=>{}})}),t(M,{title:"",selectedSignals:b,setSelectedSignals:f})]}),t(re,{}),x.length?t(oo,{children:t(to,{items:x,onSelectNew:e=>r(e,b),onSelectConfigured:l,isLoadingForDestinationIds:c})}):t(ro,{children:t(Ne,{title:"No destinations found"})})]})},vo=p.div`
|
|
269
269
|
display: flex;
|
|
270
|
-
`,
|
|
270
|
+
`,bo=p.div`
|
|
271
271
|
border-right: 1px solid ${({theme:e})=>e.colors.border};
|
|
272
272
|
padding: 32px;
|
|
273
273
|
width: 200px;
|
|
274
274
|
@media (max-width: 1050px) {
|
|
275
275
|
display: none;
|
|
276
276
|
}
|
|
277
|
-
`,
|
|
277
|
+
`,fo=({isOnboarding:i,categories:a,potentialDestinations:o,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{currentModal:p,setCurrentModal:h}=Q(),{addConfiguredDestination:m,addConfiguredDestinationUpdateOnly:y,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:b}=pt(),f=p===B.Destination,[x,S]=n(void 0),{formData:$,formErrors:C,handleFormChange:w,resetFormData:k,validateForm:D,setYamlFields:T,dynamicFields:N,setDynamicFields:E,loadFormWithDrawerItem:A}=Ct({supportedSignals:x?.supportedSignals,preLoadedFields:x?.fields}),[F,O]=n([]),I=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||$.name,disabled:e?.disabled||$.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||$.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:x.type,displayName:x.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},R=async e=>{if(i&&!e){const e=I();m(e)}else if(i&&e){const t=I(e);b.some(t=>t.id===e.id)?v(e):y(t)}else if(i||e){if(!i&&e){const t=I(e),i=t.dataStreamNames.some(e=>e===u);O(t=>[...t,e.id]),i?await s(e.id):await l(e.id,A(t)),O(t=>t.filter(t=>t!==e.id))}}else r($)},M=()=>{k(),S(void 0),h("")},L=()=>{k(),S(void 0)},P=async()=>{if(x){if(!D({withAlert:!i,alertTitle:Z.Create}))return null;R()}M()};return j({key:"Enter",active:f},()=>P()),t(ee,{isOpen:f,onClose:M,header:{title:g.ADD_DESTINATION},actionComponent:t(le,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:P}];return x&&e.unshift({label:"BACK",icon:()=>t(qi,{rotate:-90}),variant:"secondary",onClick:L}),e})()}),children:e(vo,{children:[t(bo,{children:t(At,{currentStep:x?2:1,data:[{stepNumber:1,title:g.DESTINATIONS},{stepNumber:2,title:g.CONNECTION}]})}),e(te,{style:{margin:"32px 24px 12px 24px"},children:[t(yo,{hidden:void 0!==x,categories:a,potentialDestinations:o,onSelectNew:(e,t)=>{k(),w("type",e?.type||""),w("currentStreamName",u);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[Et[t]].supported).forEach(e=>i[Et[e]]=!0),w("exportedSignals",i),T(e?.fields||[]),S(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&R(t)},isLoadingForDestinationIds:F}),x&&t(Ya,{categoryItem:x,formData:$,formErrors:C,handleFormChange:w,dynamicFields:N,setDynamicFields:E,validateForm:D,testConnection:c})]})]})})},xo=p.div`
|
|
278
278
|
display: flex;
|
|
279
279
|
flex-direction: column;
|
|
280
280
|
align-items: center;
|
|
@@ -283,7 +283,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
283
283
|
max-height: calc(100vh - 310px);
|
|
284
284
|
height: fit-content;
|
|
285
285
|
overflow-y: scroll;
|
|
286
|
-
`,
|
|
286
|
+
`,So=({categories:e,withDelete:i})=>{const{configuredDestinations:n,configuredDestinationsUpdateOnly:a}=pt();return n.length||a.length?t(xo,{children:n.concat(a).map((o,r)=>t($o,{"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:wt(e,o),isLastItem:n.length+a.length===1,withDelete:i},`configured-destination-${o.destinationType.type}-${r}`))}):t(Te,{children:t(Ne,{title:"No destinations",subTitle:"Please add a destination"})})},$o=({item:a,yamlFields:o,isLastItem:r,withDelete:l})=>{const[c,d]=n(!1),{icon:u,iconSrc:p}=He(a.destinationType.type),{removeConfiguredDestination:h,removeConfiguredDestinationUpdateOnly:m}=pt(),g=s(()=>ft(a,o).map(e=>({title:e.name,value:e.value})),[a,o]);return e(i,{children:[t(Me,{title:a.name||a.destinationType.displayName,subTitle:a.destinationType.type,iconProps:{icon:u,iconSrc:p},visualProps:{monitors:Pe(a.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>t(Ft,{data:g})},renderActions:l?()=>t(mt,{onClick:()=>d(!0),children:t(Fi,{})}):void 0}),l&&t(z,{isOpen:c,name:a.destinationType.displayName||a.name,type:B.Destination,isLastItem:r,onApprove:()=>{a.id?m(a):h(a)},onDeny:()=>d(!1)})]})},Co=p(Ie)`
|
|
287
287
|
display: flex;
|
|
288
288
|
align-items: center;
|
|
289
289
|
justify-content: center;
|
|
@@ -292,7 +292,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
292
292
|
padding: 32px;
|
|
293
293
|
border-radius: 16px;
|
|
294
294
|
border-style: dashed !important;
|
|
295
|
-
`,
|
|
295
|
+
`,wo=({isSourcesListEmpty:n,goToSources:a,categories:o,potentialDestinations:r,testConnection:l,onClickSummary:s})=>{const c=m(),{setCurrentModal:d}=Q(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=pt();return e(i,{children:[t(te,{$isNotModal:!0,children:e(se,{$gap:12,children:[e(se,{$gap:24,children:[s&&t(vt,{onClick:s}),t(I,{title:g.ADD_DESTINATIONS,badgeLabel:u.length+p.length,description:g.ADD_DESTINATION_DESCRIPTION}),n&&t(ie,{type:ne.Warning,message:g.NO_SOURCES_GO_BACK,action:{label:g.SELECT_SOURCES,onClick:a}}),e(Co,{variant:"secondary",onClick:()=>d(B.Destination),children:[t(Ii,{}),t(P,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t(So,{categories:o,withDelete:!0})]})}),t(fo,{isOnboarding:!0,categories:o,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:l})]})},ko=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"type",title:g.TYPE,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],Do=({metrics:i,maxHeight:n,maxWidth:a})=>{const o=m(),r=ye(),{selectedStreamName:l}=Je(),{setDrawerType:c,setDrawerEntityId:d}=K(),{destinations:u,destinationsLoading:p}=W(),h=s(()=>Ye(u,l),[u,l]),y=s(()=>jn({instrumentationRules:[],sources:[],actions:[],destinations:Ze(h,r),searchText:r.searchText,selectedCategory:B.Destination}).searchResults.find(({category:e})=>e===B.Destination)?.entities||[],[h,r]),v=s(()=>y.map(e=>{const{hasErrors:n,hasWarnings:a,hasDisableds:r}=ce(e.conditions||[]),{icon:l,iconSrc:s}=He(e.destinationType.type);return{status:n?ne.Error:a?ne.Warning:void 0,faded:r,onClick:()=>{c(B.Destination),d(e.id)},cells:[{columnKey:"icon",component:()=>t(be,{icon:l,src:s})},{columnKey:"name",value:fe(e,B.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.destinationType.type,textColor:o.text.info},{columnKey:"throughput",value:Ke(Ot(i,B.Destination,e.id).throughput),textColor:o.text.info},{columnKey:"signals",component:()=>t(xe,{withLabels:!0,monitors:Pe(e.exportedSignals)})},{columnKey:"conditions",component:()=>e.conditions?.length?t(Pn,{conditions:e.conditions,id:e.id}):null},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:e.disabled?ne.Error:ne.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[y,i]),{badge:b,badgeTooltip:f}=s(()=>y.length!==h.length?{badge:`${y.length}/${h.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:h.length,badgeTooltip:void 0},[y,h]);return e(Se,{$maxWidth:a,children:[t($e,{children:t(Ce,{icon:we(B.Destination),title:g.DESTINATIONS,badge:b,badgeTooltip:f,loading:p})}),t(ke,{$maxHeight:n,children:t(De,{columns:ko,rows:v})}),!y.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},To=e=>{const{type:t,ruleName:i,notes:n,disabled:a,profileName:o,payloadCollection:r,codeAttributes:l,headersCollection:s,customInstrumentations:c}=e,d=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!a)},{title:g.NAME,value:i},{title:g.NOTES,value:n},{title:g.MANAGED_BY_PROFILE,value:o},{type:y.Divider}];if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[It.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Mt.Java]||[]).map(e=>new Rt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[Mt.Golang]||[]).map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:g.GOLANG_CUSTOM_PROBES,value:t})}return d},No=p.div`
|
|
296
296
|
display: flex;
|
|
297
297
|
flex-direction: column;
|
|
298
298
|
gap: 12px;
|
|
@@ -302,7 +302,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
302
302
|
border-radius: 16px;
|
|
303
303
|
padding: 8px;
|
|
304
304
|
`}
|
|
305
|
-
`,
|
|
305
|
+
`,Eo=[{id:Pt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Pt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Pt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ao=[{id:Pt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Pt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Pt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Fo={[Mt.Java]:[new Rt("","")],[Mt.Golang]:[new Lt("")]},Oo=["*"],Io=p.div`
|
|
306
306
|
display: flex;
|
|
307
307
|
flex-direction: column;
|
|
308
308
|
gap: 12px;
|
|
@@ -312,27 +312,27 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
312
312
|
border-radius: 16px;
|
|
313
313
|
padding: 8px;
|
|
314
314
|
`}
|
|
315
|
-
`,
|
|
315
|
+
`,Ro=[{id:Kt.HttpRequest,label:"Collect HTTP Request"},{id:Kt.HttpResponse,label:"Collect HTTP Response"},{id:Kt.DbQuery,label:"Collect DB Query"},{id:Kt.Messaging,label:"Collect Messaging"}],Mo={[jt.CodeAttributes]:({value:o,setValue:r,formErrors:l})=>{const c=l.codeAttributes,d=s(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]),[u,p]=n(1===d.length);a(()=>{if(!d.length){const e={[Pt.Column]:null,[Pt.FilePath]:!0,[Pt.Function]:!0,[Pt.LineNumber]:!0,[Pt.Namespace]:null,[Pt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(Pt).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});r("codeAttributes",n),p(1===i.length)};return e(i,{children:[e("div",{children:[t(x,{title:"Recommended data to collect",required:!0}),t(No,{$hasError:!!c,children:Eo.map(({id:e,label:i,tooltip:n})=>t(me,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!c&&t($,{children:c})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(No,{$hasError:!!c,children:Ao.map(({id:e,label:i,tooltip:n})=>t(me,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!c&&t($,{children:c})]})]})},[jt.CustomInstrumentation]:({value:i,setValue:n,formErrors:o})=>{const r=o.customInstrumentations,l=s(()=>(i?.customInstrumentations?.[Mt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[i]),c=s(()=>(i?.customInstrumentations?.[Mt.Golang]||[]).map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=(e,t)=>{const i={};switch(t){case"java":i[Mt.Java]=e.map(e=>new Rt(e.className,e.methodName)),i[Mt.Golang]=c.map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[Mt.Golang]=e.map(e=>new Lt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[Mt.Java]=l.map(({key:e,value:t})=>new Rt(e,t))}n("customInstrumentations",i)};return a(()=>{i?.customInstrumentations||n("customInstrumentations",{[Mt.Golang]:Fo[Mt.Golang],[Mt.Java]:Fo[Mt.Java]})},[n,i]),e("div",{children:[t(D,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:c,onChange:e=>d(e,"golang"),errorMessage:r,limitFieldsPerRow:2}),t(N,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:l,onChange:(e=[])=>d(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:r,keyPlaceholder:"Class name",valuePlaceholder:"Method name"})]})},[jt.HeadersCollection]:({value:e,setValue:i,formErrors:n})=>{const o=n.headersCollection,r=s(()=>e?.headersCollection?.[It.HeaderKeys]||[],[e]),l=e=>{const t={[It.HeaderKeys]:e};i("headersCollection",t)};return a(()=>{r.length||l(Oo)},[r]),t("div",{children:r.length>0&&t(E,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>l(e),errorMessage:o})})},[jt.PayloadCollection]:({value:i,setValue:o,formErrors:r})=>{const l=r.payloadCollection,c=s(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[d,u]=n(1===c.length);return a(()=>{if(!c.length){const e={[Kt.HttpRequest]:{},[Kt.HttpResponse]:{},[Kt.DbQuery]:{},[Kt.Messaging]:{}};o("payloadCollection",e),u(!1)}},[]),e("div",{children:[t(x,{title:"Type of data to collect",required:!0}),t(Io,{$hasError:!!l,children:Ro.map(({id:e,label:i})=>t(S,{title:i,disabled:d&&c.includes(e),value:c.includes(e),onChange:t=>((e,t)=>{const i=t?[...c,e]:c.filter(t=>t!==e),n={[Kt.HttpRequest]:i.includes(Kt.HttpRequest)?{}:null,[Kt.HttpResponse]:i.includes(Kt.HttpResponse)?{}:null,[Kt.DbQuery]:i.includes(Kt.DbQuery)?{}:null,[Kt.Messaging]:i.includes(Kt.Messaging)?{}:null};o("payloadCollection",n),u(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[jt.UnknownType]:null},Lo=({ruleType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=Mo[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Po=p.div`
|
|
316
316
|
display: flex;
|
|
317
317
|
flex-direction: column;
|
|
318
318
|
gap: 24px;
|
|
319
319
|
padding: 4px;
|
|
320
|
-
`,
|
|
320
|
+
`,Ko=p(P)`
|
|
321
321
|
margin-bottom: 12px;
|
|
322
|
-
`,
|
|
322
|
+
`,jo=({isUpdate:n,rule:a,formData:o,formErrors:r,handleFormChange:l})=>{const s=m();return e(Po,{children:[t(pe,{children:a.supportedLanguages.map(e=>t(qt,{icon:Ht(e),type:ne.Info,children:lt[e]},e))}),n?e("div",{children:[t(Ko,{children:"Status"}),t(F,{options:[{icon:Ni,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+O["050"]},{icon:Ei,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+O["050"]}],selected:o.disabled,setSelected:e=>l("disabled",e)})]}):e(i,{children:[t(I,{title:"",description:a.docsDescription,actionButton:t(R,{endpoint:a.docsEndpoint})}),t(C,{title:"Rule name",placeholder:"Use a name that describes the rule",value:o.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName})]}),t(Lo,{ruleType:a.type,value:o,setValue:(e,t)=>l(e,t),formErrors:r}),t(L,{title:"Notes",value:o.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},qo=p.div`
|
|
323
323
|
width: 100%;
|
|
324
324
|
height: 100%;
|
|
325
325
|
max-height: calc(100vh - 220px);
|
|
326
326
|
overflow: overlay;
|
|
327
327
|
overflow-y: auto;
|
|
328
|
-
`,
|
|
328
|
+
`,Ho=p.div`
|
|
329
329
|
display: flex;
|
|
330
330
|
flex-direction: column;
|
|
331
331
|
gap: 12px;
|
|
332
|
-
`,
|
|
332
|
+
`,zo=({updateInstrumentationRule:i,deleteInstrumentationRule:o})=>{const{instrumentationRules:l}=W(),{addNotification:c}=zt(),{drawerType:d,drawerEntityId:u}=K(),p=r(null),h=d===B.InstrumentationRule,[m,g]=n(!1),[y,v]=n(!1),{formData:b,formErrors:f,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=Vt(),w=s(()=>{if(u)return l?.find(e=>J(e)===u)},[u,l]);if(a(()=>{h&&w?C(w):S()},[h,w]),!w)return null;const k=Bt.find(({type:e})=>e===w.type);return t(En,{ref:p,title:w.ruleName||w.type,icons:[qe(w.type)],isEdit:m,isFormDirty:y,onEdit:e=>{w.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):c({type:ne.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if($()){const t=e!==w.type?e:"";x("ruleName",t),i(u,{...b,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{w.mutable?(o(u),g(!1),v(!1),p.current?.closeDrawer()):c({type:ne.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),C(w)},children:m&&k?t(qo,{children:t(jo,{isUpdate:!0,rule:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(Ho,{children:[t(G,{conditions:w.conditions||[]}),t(Y,{title:"Instrumentation Rule Details",data:w?To(w):[]})]})})},Vo=p(se)`
|
|
333
333
|
margin-top: 24px;
|
|
334
334
|
gap: 12px;
|
|
335
|
-
`,
|
|
335
|
+
`,Bo=Bt,Wo=({createInstrumentationRule:i})=>{const{tier:a}=Le(),o=a===Wt.Onprem,{currentModal:r,setCurrentModal:l}=Q(),s=r===B.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Vt(),[m,y]=n(void 0),v=()=>{p(),y(void 0),l("")},b=()=>{if(!h())return null;i(c),v()};return j({key:"Enter",active:s},()=>b()),t(ee,{isOpen:s,onClose:v,header:{title:"Add Instrumentation Rule"},actionComponent:t(le,{buttons:[{variant:"primary",label:"DONE",onClick:b,disabled:!o||!m,tooltip:o?"":ae.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(te,{children:[t(I,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(Vo,{children:[t(ie,o?{type:ne.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(g.INSTRUMENTATION_RULES)}:{type:ne.Default,message:ae.ENTERPRISE_ONLY(g.INSTRUMENTATION_RULES)}),t(oe,{options:Bo,selectedOption:m,onOptionSelect:e=>{return t=e,p(),void y(t);var t},autoFocus:!m?.type})]}),m?.type?e("div",{children:[t(re,{margin:"16px 0"}),t(jo,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},_o=e=>{const{payloadCollection:t,codeAttributes:i,customInstrumentations:n}=e;let a="";return t&&(a+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&(a+=Object.entries(i).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&Object.values(Mt).forEach(e=>{const t=(n[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},Jo=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"profile",title:g.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],Uo=({maxHeight:i,maxWidth:n})=>{const a=m(),o=ye(),{setDrawerType:r,setDrawerEntityId:l}=K(),{instrumentationRules:c,instrumentationRulesLoading:d}=W(),u=s(()=>jn({instrumentationRules:c,sources:[],actions:[],destinations:[],searchText:o.searchText,selectedCategory:B.InstrumentationRule}).searchResults.find(({category:e})=>e===B.InstrumentationRule)?.entities||[],[c,o]),p=s(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=ce(e.conditions||[]);return{status:i?ne.Error:n?ne.Warning:void 0,faded:o,onClick:()=>{r(B.InstrumentationRule),l(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(be,{icon:qe(e.type)})},{columnKey:"name",value:fe(e,B.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:a.text.info},{columnKey:"profile",value:e.profileName,textColor:a.text.info},{columnKey:"notes",value:e.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:_o(e),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(Pn,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:e.disabled?ne.Error:ne.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:ne.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=s(()=>u.length!==c.length?{badge:`${u.length}/${c.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:c.length,badgeTooltip:void 0},[u,c]);return e(Se,{$maxWidth:n,children:[t($e,{children:t(Ce,{icon:we(B.Action),title:g.INSTRUMENTATION_RULES,badge:h,badgeTooltip:y,loading:d})}),t(ke,{$maxHeight:i,children:t(De,{columns:Jo,rows:p})}),!u.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},Go=p.div`
|
|
336
336
|
position: fixed;
|
|
337
337
|
bottom: 0;
|
|
338
338
|
left: 50%;
|
|
@@ -345,18 +345,18 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
345
345
|
border-radius: 32px;
|
|
346
346
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
347
347
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
348
|
-
animation-name: ${
|
|
349
|
-
`,Yo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:o})=>{const r=m(),{selectedSources:l,setSelectedSources:d}=
|
|
348
|
+
animation-name: ${Jt.in.center};
|
|
349
|
+
`,Yo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:o})=>{const r=m(),{selectedSources:l,setSelectedSources:d}=Re(),[u,p]=n(!1),[h,g]=n(!1),y=s(()=>{let e=0;return Object.values(l).forEach(t=>{e+=t.length}),e},[l]),v=()=>{d({})};return y?e(c,{children:[e(Go,{"data-id":"multi-source-control",children:[t(P,{children:"Selected sources"}),t(Ae,{label:y,filled:!0}),t(re,{orientation:"vertical",length:"16px"}),t(Ie,{variant:"tertiary",onClick:v,children:t(P,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(Ie,{variant:"tertiary",onClick:()=>g(!0),children:[t(Hi,{}),t(P,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(Ie,{variant:"tertiary",onClick:()=>p(!0),children:[t(Fi,{}),t(P,{family:"secondary",decoration:"underline",color:r.text.error,children:"Uninstrument"})]})]}),t(z,{isOpen:u,name:`${y} sources`,type:B.Source,isLastItem:y===i,onApprove:()=>{const e={};Object.entries(l).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),a(e),p(!1),v()},onDeny:()=>p(!1)}),t(_t,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:ne.Warning,onClick:()=>{const e=[];Object.values(l).forEach(t=>{e.push(...t.map(e=>Ut(e)))}),o(e),v()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},Xo=p.div`
|
|
350
350
|
position: relative;
|
|
351
351
|
width: fit-content;
|
|
352
|
-
`,
|
|
352
|
+
`,Zo=p(pe)`
|
|
353
353
|
gap: 12px;
|
|
354
354
|
padding: 0 12px;
|
|
355
|
-
`,
|
|
355
|
+
`,Qo=p(se)`
|
|
356
356
|
gap: 12px;
|
|
357
357
|
max-height: 400px;
|
|
358
358
|
overflow-y: auto;
|
|
359
|
-
`,
|
|
359
|
+
`,er=p.div`
|
|
360
360
|
position: absolute;
|
|
361
361
|
bottom: 0;
|
|
362
362
|
left: 0;
|
|
@@ -365,19 +365,19 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
365
365
|
border-radius: 0 0 24px 24px;
|
|
366
366
|
background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
|
|
367
367
|
pointer-events: none;
|
|
368
|
-
`,
|
|
368
|
+
`,tr=p(P)`
|
|
369
369
|
background-color: ${({theme:e})=>e.colors.orange_soft};
|
|
370
370
|
color: ${({theme:e})=>e.text.primary};
|
|
371
371
|
border-radius: 32px;
|
|
372
372
|
width: fit-content;
|
|
373
373
|
padding: 2px 8px;
|
|
374
|
-
`,
|
|
374
|
+
`,ir=()=>{const i=m(),{notifications:n,markAsSeen:a}=zt(),o=n.filter(({hideFromHistory:e})=>!e),r=o.filter(({seen:e})=>!e),l=r.length,{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=et({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&r.forEach(({id:e})=>a(e))}});return e(Xo,{children:[t(mt,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:i.colors.orange_og,children:t(zi,{size:18})}),e(tt,{ref:s,isOpen:c,right:u.left,maxWidth:"400px",header:e(Zo,{children:[t(P,{size:20,children:"Notifications"}),!!l&&e(tr,{size:12,family:"secondary",children:[l," new"]})]}),children:[t(Qo,{children:o.length?o.map(e=>t(sr,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Ne,{title:"No notifications",subTitle:""})}),t(er,{})]})]})},nr=p.div`
|
|
375
375
|
display: flex;
|
|
376
376
|
align-items: flex-start;
|
|
377
377
|
gap: 12px;
|
|
378
378
|
padding: 16px;
|
|
379
379
|
border-radius: 16px;
|
|
380
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+
|
|
380
|
+
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+O["080"]};
|
|
381
381
|
cursor: not-allowed;
|
|
382
382
|
&.click-enabled {
|
|
383
383
|
cursor: pointer;
|
|
@@ -385,27 +385,27 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
385
385
|
background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
`,
|
|
389
|
-
background-color: ${({$type:e,theme:t})=>t.text[e]+
|
|
388
|
+
`,ar=p.div`
|
|
389
|
+
background-color: ${({$type:e,theme:t})=>t.text[e]+O["015"]};
|
|
390
390
|
border-radius: 8px;
|
|
391
391
|
width: 36px;
|
|
392
392
|
height: 36px;
|
|
393
393
|
display: flex;
|
|
394
394
|
align-items: center;
|
|
395
395
|
justify-content: center;
|
|
396
|
-
`,ar=p.div`
|
|
397
|
-
width: 290px;
|
|
398
396
|
`,or=p.div`
|
|
399
|
-
|
|
397
|
+
width: 290px;
|
|
400
398
|
`,rr=p.div`
|
|
399
|
+
margin-bottom: 6px;
|
|
400
|
+
`,lr=p.div`
|
|
401
401
|
display: flex;
|
|
402
402
|
align-items: center;
|
|
403
403
|
gap: 6px;
|
|
404
|
-
`,
|
|
404
|
+
`,sr=({id:n,seen:a,type:o,title:r,message:l,time:s,crdType:c,target:d,onClick:u})=>{const p=m(),{formatTimeAgo:h}=Gt(),{onClickNotification:g}=Yt(),y=!!c&&!!d,v=r?.toLowerCase().includes(Z.Delete.toLowerCase())||!1,b=ge(o,p);return e(nr,{className:y?"click-enabled":"",onClick:()=>{y&&(u(),g({id:n,crdType:c,target:d}))},children:[t(ar,{$type:v?ne.Error:o,children:t(v?Fi:b,{})}),e(or,{children:[t(rr,{children:t(P,{size:14,children:l})}),e(lr,{children:[t(P,{size:10,color:p.text.grey,children:h(s)}),!a&&e(i,{children:[t(P,{size:10,children:"·"}),t(P,{size:10,color:p.colors.orange_soft,children:"new"})]})]})]})]},`notification-${n}`)},cr=(e,t,i)=>{const n=e?.serviceName||t?.otelServiceName||t?.name,a=i?[Vi]:ze(t?.containers||[]),{priorotizedStatus:o}=ce(t?.conditions||[]);return{id:n,title:n,icons:a.length?a:[Bi],status:o,serviceMapEntry:e}},dr=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,ur=p.div`
|
|
405
405
|
width: 100%;
|
|
406
406
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
407
407
|
position: relative;
|
|
408
|
-
`,
|
|
408
|
+
`,pr={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},hr=({heightToRemove:e,serviceMap:i})=>{const n=m(),{sources:o,sourcesLoading:r}=W(),{containerRef:l,containerHeight:s,containerWidth:c}=Ue(),[d,u,p]=nn([]),[h,y,v]=an([]);return a(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:i,containerWidth:n})=>{const a=[],o=new Map,r=((e,t)=>{const i=new Map,n=new Map,a=new Map,o=new Set;e.forEach(e=>{o.add(e.serviceName),e.services.forEach(e=>{o.add(e.serviceName)})}),o.forEach(e=>{n.set(e,[]),a.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{n.get(e.serviceName)?.push(t.serviceName);const i=a.get(t.serviceName)||0;a.set(t.serviceName,i+1)})});const r=[],l=[];for(o.forEach(e=>{0===(a.get(e)||0)&&l.push(e)});l.length>0;){const e=[],t=l.length;for(let i=0;i<t;i++){const t=l.shift();e.push(t),n.get(t)?.forEach(e=>{const t=a.get(e)||0;a.set(e,t-1),t-1==0&&l.push(e)})}e.length>0&&r.push(e)}return o.forEach(e=>{r.flat().includes(e)||(0===r.length?r.push([e]):r[r.length-1].push(e))}),r.forEach((e,n)=>{const a=100+150*n,o=150*(e.length-1),r=(t-o)/2;e.forEach((e,t)=>{const n=r+150*t,o=a;i.set(e,{x:n,y:o})})}),i})(t,n);if(t.length&&e.length){t.forEach(t=>{const i=t.serviceName;if(a.find(e=>e.id===`${B.Source}-${i}-${Xt.MapItem}`))return;const n=e.find(e=>i===e.otelServiceName||i===e.name);o.set(i,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),a.push({id:`${B.Source}-${i}-${Xt.MapItem}`,type:Xt.MapItem,position:r.get(i),data:cr(t,n,dr(n))})}),o.forEach((t,i)=>{if(a.find(e=>e.id===`${B.Source}-${i}-${Xt.MapItem}`))return;const n=e.find(e=>i===e.otelServiceName||i===e.name);a.push({id:`${B.Source}-${i}-${Xt.MapItem}`,type:Xt.MapItem,position:r.get(i),data:cr(t,n,dr(n))})});let i=50;e.forEach(e=>{const t=e.otelServiceName||e.name;a.find(e=>e.id===`${B.Source}-${t}-${Xt.MapItem}`)||(a.push({id:`${B.Source}-${t}-${Xt.MapItem}`,type:Xt.MapItem,position:{x:i,y:10},data:cr(void 0,e,dr(e))}),i+=110)})}else a.push({id:`${B.Source}-${Xt.NoData}`,type:Xt.NoData,position:{x:n/2-150,y:i/4},data:{subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return a})({serviceMap:i,sources:[pr].concat(o),containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const i=e.map(e=>{const i=t.find(t=>t.id===e.id);return e.position=i?.position||e.position,{id:e.id,item:e,type:i?"replace":"add"}});return t.find(e=>e.id===`${B.Source}-${Xt.NoData}`)&&i.push({id:`${B.Source}-${Xt.NoData}`,type:"remove"}),on(i,t)})):u(t)}var e},[i,o,r,s,c]),a(()=>{y((({theme:e,nodes:t,serviceMap:i})=>{const n=[];return t.forEach(({id:t,data:{id:a,status:o}})=>{const{services:r}=i.find(e=>e.serviceName===a)||{services:[]};r.forEach(i=>{const a=t,r=`${B.Source}-${i.serviceName}-${Xt.MapItem}`,l=o===ne.Error;n.push({id:`${a}-to-${r}`,source:a,target:r,markerEnd:{type:tn.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})})}),n})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),t(ur,{ref:l,$heightToRemove:e,children:t(Zt,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:v,zoomOnScroll:!0})})},mr=p.div`
|
|
409
409
|
display: flex;
|
|
410
410
|
flex-direction: column;
|
|
411
411
|
align-items: center;
|
|
@@ -415,12 +415,12 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
415
415
|
max-height: ${({$isModal:e})=>e?"calc(100vh - 510px)":"calc(100vh - 310px)"};
|
|
416
416
|
height: fit-content;
|
|
417
417
|
overflow-y: scroll;
|
|
418
|
-
`,
|
|
418
|
+
`,gr=p.div`
|
|
419
419
|
width: 100%;
|
|
420
420
|
padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
|
|
421
421
|
border-radius: 16px;
|
|
422
|
-
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+
|
|
423
|
-
`,
|
|
422
|
+
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+O["024"]:t.colors.dropdown_bg_2+O["040"]};
|
|
423
|
+
`,yr=p.div`
|
|
424
424
|
display: flex;
|
|
425
425
|
justify-content: space-between;
|
|
426
426
|
gap: 12px;
|
|
@@ -429,29 +429,29 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
429
429
|
border-radius: 16px;
|
|
430
430
|
cursor: ${({$withClick:e})=>e?"pointer":"unset"};
|
|
431
431
|
&:hover {
|
|
432
|
-
background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+
|
|
432
|
+
background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+O["040"]:i.colors.dropdown_bg_2+O["080"])};
|
|
433
433
|
transition: background-color 0.3s;
|
|
434
434
|
}
|
|
435
|
-
`,
|
|
435
|
+
`,vr=p(yr)`
|
|
436
436
|
width: calc(100% - 100px);
|
|
437
437
|
margin: 0 auto;
|
|
438
438
|
padding: 8px;
|
|
439
|
-
`,
|
|
439
|
+
`,br=p.div`
|
|
440
440
|
position: relative;
|
|
441
441
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
442
|
-
`,
|
|
442
|
+
`,fr=p.div`
|
|
443
443
|
position: absolute;
|
|
444
444
|
top: 6px;
|
|
445
445
|
left: 18px;
|
|
446
|
-
`,
|
|
446
|
+
`,xr=p(Te)`
|
|
447
447
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
448
|
-
`,
|
|
448
|
+
`,Sr=p.div`
|
|
449
449
|
width: ${({$width:e})=>`${e||42}px`};
|
|
450
450
|
display: flex;
|
|
451
451
|
align-items: center;
|
|
452
452
|
justify-content: flex-end;
|
|
453
453
|
text-align: right;
|
|
454
|
-
|
|
454
|
+
`,$r=we(B.Namespace),Cr=({isModal:i=!1,withInstances:n=!0,fetchingNamespace:a,fetchedNamespaces:o,filteredNamespacesAndSources:r,selectedNamespace:l,onSelectNamespace:s,selectedSources:c,onSelectSource:d,selectedFutureApps:u,onSelectFutureApps:p})=>{const h=m(),{isVm:y}=Le(),{namespacesLoading:v}=W(),b=Object.entries(r||{});return b?.length?t(mr,{$isModal:i,children:b.map(([i,r])=>{const m=c?.[i]||[],b=u?.[i]?.selected||!1,f=m.filter(({selected:e})=>e),x=m.length>0,$=l===i,C=f.length>0&&f.length===r.length,w=f.length>0&&f.length!==r.length,k=r.length>0,D=1===r.length;return s||k?e(gr,{"data-id":`namespace-${i}`,$selected:C,$isOpen:$,children:[e(yr,{$selected:C,$withClick:!!s,onClick:()=>s?.(i),children:[e(pe,{$gap:12,children:[s&&t(S,{partiallyChecked:w,value:C,onChange:e=>s(i,e)}),t($r,{}),t(P,{children:i})]}),e(pe,{$gap:24,children:[!y&&p&&t(T,{title:g.FUTURE_APPS_TITLE,tooltip:g.FUTURE_APPS_DESCRIPTION,initialValue:b,onChange:e=>p(e,i),flipHorizontally:!0}),t(Sr,{$width:108,children:a!==i||o?.includes(i)?null:t(Qt,{size:10,children:"Retrieving workloads..."})}),t(Sr,{children:t(P,{size:10,color:h.text.grey,children:x?`${f.length}/${r.length}`:null})}),s&&t(gt,{extend:$})]})]}),($||!s)&&(k?e(br,{$addPadding:!d,children:[t(fr,{children:t(re,{orientation:"vertical",length:(D?24:34*r.length)+"px"})}),r.map(e=>{const a=f.some(({name:t})=>t===e.name);return t(wr,{withInstances:n,source:e,namespace:i,isSelected:a,onSelect:d},`source-${e.name}`)})]}):t(xr,{$addPadding:!d,children:v||a===i&&!o?.includes(i)?t(Oe,{}):t(Ne,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${i}`):null})}):t(Te,{children:v||a?t(Oe,{}):t(Ne,{title:g.NO_SOURCES,subTitle:!y&&s?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},wr=({withInstances:i,source:n,namespace:a,isSelected:o,onSelect:r})=>t(vr,{"data-id":`source-${n.name}`,$selected:o,$withClick:!!r,onClick:()=>r?.(n),children:e(pe,{$gap:12,children:[r&&t(S,{value:o,onChange:()=>r(n,a)}),e(pe,{$gap:4,children:[t(P,{children:n.name}),e(P,{opacity:.8,size:10,children:[i?` • ${n.numberOfInstances||0} running instance${1!==n.numberOfInstances?"s":""}`:"",` • ${n.kind}`]})]})]})}),kr=p.div`
|
|
455
455
|
display: flex;
|
|
456
456
|
flex-direction: column;
|
|
457
457
|
align-items: center;
|
|
@@ -460,35 +460,35 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
460
460
|
max-height: calc(100vh - 200px);
|
|
461
461
|
height: fit-content;
|
|
462
462
|
overflow-y: scroll;
|
|
463
|
-
`,
|
|
463
|
+
`,Dr=({onEditStream:i,onEditSources:n,onEditDestinations:a,categories:o})=>{const{selectedStreamName:r}=Je(),{configuredSources:l,configuredDestinations:c,configuredDestinationsUpdateOnly:d}=pt(),u=s(()=>Object.values(l).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[l]);return t(te,{$isNotModal:!0,children:e(se,{$gap:12,children:[t(I,{title:g.SUMMARY,description:g.STREAM_CONFIRM}),e(kr,{children:[t(Y,{title:g.STREAM_NAME,action:()=>t(ei,{onClick:i}),data:[{title:"",value:r}]}),t(Y,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(ei,{onClick:n}),children:t(Cr,{filteredNamespacesAndSources:l,withInstances:!1})}),t(Y,{title:g.SELECTED_DESTINATIONS,titleBadge:c.length+d.length,action:()=>t(ei,{onClick:a}),children:t(So,{categories:o})})]})]})})};var Tr;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Tr||(Tr={}));const Nr=({onClickId:e,defaultSelectedId:i,extendedNavIcons:a})=>{const{isVm:o}=Le(),[r,l]=n(i||""),c=s(()=>[{id:Tr.Overview,icon:Wi,selected:r===Tr.Overview,onClick:()=>{l(Tr.Overview),e(Tr.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=s(()=>{const t=[{id:Tr.Sources,icon:_i,selected:r===Tr.Sources,onClick:()=>{l(Tr.Sources),e(Tr.Sources)},tooltip:"Sources"},{id:Tr.Destinations,icon:Ji,selected:r===Tr.Destinations,onClick:()=>{l(Tr.Destinations),e(Tr.Destinations)},tooltip:"Destinations"}];return o||(t.push({id:Tr.InstrumentationRules,icon:Ui,selected:r===Tr.InstrumentationRules,onClick:()=>{l(Tr.InstrumentationRules),e(Tr.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:Tr.Actions,icon:Gi,selected:r===Tr.Actions,onClick:()=>{l(Tr.Actions),e(Tr.Actions)},tooltip:"Actions"})),t},[o,r]);return t(ti,{orientation:"vertical",mainIcons:c,subIcons:d})},Er=({})=>t(mt,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community",children:t(Yi,{})}),Ar=(e,t)=>{const{name:i,kind:n,namespace:a}=e,o=[{title:g.KIND,value:n},{title:g.NAME,value:i,tooltip:"Resource name"}];return t||(o.unshift({title:g.NAMESPACE,value:a}),o.push({type:y.Divider}),o.push({type:y.CopyText,value:`kubectl get ${n} ${i} -n ${a}`.toLowerCase()})),o},Fr=p.div`
|
|
464
464
|
display: flex;
|
|
465
465
|
flex-direction: column;
|
|
466
466
|
gap: 24px;
|
|
467
467
|
padding: 4px;
|
|
468
|
-
`,Or=({formData:e,handleFormChange:i})=>t(
|
|
468
|
+
`,Or=({formData:e,handleFormChange:i})=>t(Fr,{children:t(C,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>i("otelServiceName",e)})}),Ir=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=ii(e?.status),n=ot(e?.reasonEnum),a=e?.message;return t(pe,{$alignItems:"center",$justifyContent:"center",children:t(de,{status:i,title:n,subtitle:a,withBackground:i!==ue.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},Rr=({source:i,fetchSourceDescribe:o,onClickRestartPod:r})=>{const[l,s]=n(!1),[c,d]=n(null);return a(()=>{i&&o({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[i.namespace,i.name,i.kind]),c||l?t(se,{$gap:12,children:l?t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:n,nodeName:a,phase:o,agentInjected:l,runningLatestWorkloadRevision:s,containers:d,manifestYAML:p})=>{const h=o.status!==ne.Success||ni(d)?ne.Error:ne.Success,m=[];return m.push(t(ai,{value:`kubectl get pod ${n.value} -n ${c?.namespace?.value||i.namespace}`.toLowerCase()},"copy-text")),m.push(t(re,{length:"100%",margin:"0"},"divider-1")),m.push(t(oi,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-1")),m.push(t(re,{length:"100%",margin:"0"},"divider-2")),m.push(t(oi,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-2")),m.push(t(re,{length:"100%",margin:"0"},"divider-3")),m.push(t(oi,{title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}},"describe-row-3")),m.push(t(re,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(t(oi,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(t(re,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(t(ri,{...e},`pod-container-${e.containerName.value}`))}),p&&(m.push(t(re,{length:"100%",margin:"0"},"divider-6")),m.push(t(rn,{yaml:p},"yaml-section-card"))),t(Y,{title:`Pod: ${n.value}`,withExtend:!0,action:({hovered:a})=>e("div",{style:{position:"relative"},children:[t(de,{status:h,title:h,withIcon:!0,withBorder:!0},"status"),a&&t(li,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:si(),label:"Restart",rightIcon:Ri,onClick:()=>r(c?.namespace?.value||i.namespace,n.value)}]:[]},"hover-actions")]}),children:u.toArray(m)},`pod-${n.value}`)}):t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Check if you have any running pods and try again"})})}):t(Te,{$height:"70vh",children:t(Oe,{})})},Mr=p(pe)`
|
|
469
469
|
width: 100%;
|
|
470
470
|
align-items: center;
|
|
471
471
|
justify-content: space-between;
|
|
472
|
-
`,
|
|
472
|
+
`,Lr=({source:i,fetchSourceLibraries:o})=>{const r=m(),[l,s]=n(!1),[d,u]=n(null);return a(()=>{i&&o({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Nt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[i.namespace,i.name,i.kind]),d||l?t(se,{$gap:12,children:l?t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(Y,{title:"Instrumented Libraries",children:d.map(({name:i,healthy:n,message:a,nonIdentifyingAttributes:o},l)=>e(c,{children:[e(se,{$gap:4,$width:"100%",children:[e(Mr,{$width:"100%",children:[t(P,{size:12,color:r.text.grey,children:i}),e(pe,{$gap:4,children:[o.map(({key:e,value:n})=>ci(n)&&di(n)&&"is_standard_lib"===e?t(de,{status:ne.Default,title:"STANDARD",withBorder:!0},`${i}-${e}`):null),"boolean"==typeof n&&t(de,{status:n?ne.Success:ne.Error,title:n?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),a&&t(P,{size:10,color:r.text.error,align:"right",children:a})]}),l!==d.length-1&&t(re,{length:"100%",margin:"0"})]},`library-${i}`))}):e(Te,{$height:"70vh",$gap:12,children:[t(Ne,{title:"No libraries found",subTitle:""}),t(ie,{type:ne.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Te,{$height:"70vh",children:t(Oe,{})})};var Pr;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Pr||(Pr={}));const Kr=[pi.Deployment,pi.StatefulSet,pi.DaemonSet,pi.DeploymentConfig,pi.Rollout,pi.StaticPod],jr=[pi.Deployment,pi.StatefulSet,pi.DaemonSet,pi.DeploymentConfig,pi.Rollout,pi.Pod],qr=[hi.Python,hi.Go,hi.Java],Hr=p.div`
|
|
473
473
|
width: 100%;
|
|
474
474
|
height: 100%;
|
|
475
475
|
max-height: calc(100vh - 220px);
|
|
476
476
|
overflow: overlay;
|
|
477
477
|
overflow-y: auto;
|
|
478
|
-
`,
|
|
478
|
+
`,zr=p.div`
|
|
479
479
|
display: flex;
|
|
480
480
|
flex-direction: column;
|
|
481
481
|
gap: 12px;
|
|
482
|
-
|
|
482
|
+
`;var Vr;!function(e){e.Workload="Workload",e.Pod="Pod"}(Vr||(Vr={}));const Br=({persistSources:o,updateSource:l,restartWorkloads:c,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,restartPod:h})=>{const{isVm:m}=Le(),{sources:y}=W(),{selectedStreamName:v}=Je(),{drawerType:b,drawerEntityId:f}=K(),x=s(()=>Ge(y,v),[y,v]),S=r(null),$=b===B.Source,[C,w]=n(!1),[k,D]=n(!1),[T,N]=n(Pr.Overview),[E,A]=n(null);a(()=>{$&&f&&d(f).then(e=>A(e||null))},[$,f]);const{formData:F,handleFormChange:O,resetFormData:I,loadFormWithDrawerItem:R}=ui(),M=s(()=>{if(f)return E&&JSON.stringify(Ut(E))===JSON.stringify(Ut(f))?E:x?.find(e=>JSON.stringify(Ut(e))===JSON.stringify(Ut(f)))},[f,x,E]);a(()=>{$&&M?R(M):I()},[$,M]);const L=s(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ue.Loading,containers:M?.containers||[]}},[M]),j=s(()=>{const e=[{label:Pr.Overview,onClick:()=>N(Pr.Overview),selected:T===Pr.Overview}];return m||(Kr.includes(M?.kind)&&e.push({label:Pr.Pods,onClick:()=>N(Pr.Pods),selected:T===Pr.Pods}),M?.containers?.some(({language:e})=>qr.includes(e))&&e.push({label:Pr.Libraries,onClick:()=>N(Pr.Libraries),selected:T===Pr.Libraries})),e},[T,M,m]),q=jr.includes(M?.kind),[H,z]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return M?e(En,{ref:S,onClose:()=>{N(Pr.Overview),A(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:ze(M.containers),isEdit:C,isFormDirty:k,onEdit:T===Pr.Overview?e=>{w("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=F.otelServiceName!==M.name?F.otelServiceName:"";O("otelServiceName",e),await l(f,{...F,otelServiceName:e}),A(null),D(!1),w(!1)},onDelete:T===Pr.Overview?async()=>{const{namespace:e}=M;o({[e]:[{...M,selected:!1,currentStreamName:v}]},{}),A(null),D(!1),w(!1),S.current?.closeDrawer()}:void 0,onCancel:()=>{D(!1),w(!1),O("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===x.length,tabs:j,headerActionButtons:m?[]:q?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>z({openFor:Vr.Workload,workloadId:f}),children:e(i,{children:[t(Hi,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[T===Pr.Overview?C?t(Hr,{children:t(Or,{formData:F,handleFormChange:(...e)=>{D(!0),O(...e),O("currentStreamName",v)}})}):e(zr,{children:[t(Ir,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),t(G,{conditions:M.conditions||[]}),t(Y,{title:g.SOURCE_DETAILS,data:M?Ar(M,m):[]}),t(Y,{title:m?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:L.isLoading?ue.Loading:L.containers.length,description:L.description||(m?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:L.containers.map(e=>t(mi,{...e,callbackRuntimeOverride:e=>l(f,e)},`source-container-${e.containerName}`))}),M.manifestYAML&&t(rn,{title:`${M.kind} YAML`,yaml:M.manifestYAML,defaultOpen:!M.instrumentationConfigYAML}),M.instrumentationConfigYAML&&t(rn,{title:"Instrumentation Config YAML",yaml:M.instrumentationConfigYAML,defaultOpen:!M.manifestYAML})]}):T===Pr.Pods?t(Rr,{source:M,fetchSourceDescribe:u,onClickRestartPod:q?(e,t)=>z({openFor:Vr.Pod,podNamespace:e,podName:t}):void 0}):t(Lr,{source:M,fetchSourceLibraries:p}),t(_t,{isOpen:!!H.openFor,title:`Rollout Restart ${H.openFor}`,description:`Are you sure you want to rollout restart this ${H.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:ne.Warning,onClick:()=>{H.openFor===Vr.Workload&&H.workloadId?c([H.workloadId]):H.openFor===Vr.Pod&&H.podNamespace&&H.podName&&h(H.podNamespace,H.podName),z({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{z({openFor:null})}}})]}):null},Wr=p.div`
|
|
483
483
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
484
484
|
width: 100%;
|
|
485
|
-
`,
|
|
485
|
+
`,_r=o(({isModal:i,fetchSingleNamespace:n,onClickSummary:a},o)=>{const r=m(),{isVm:s}=Le(),c=gi({fetchSingleNamespace:n}),{selectedSources:d,fetchingNamespace:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:b,setSearchText:f,searchBy:x,setSearchBy:S,showSelectedOnly:$,setShowSelectedOnly:w,showRunningOnly:k,setShowRunningOnly:D}=c;l(o,()=>({getFormValues:()=>({apps:y(),futureApps:v()})}));const N=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(te,{$isNotModal:!i,children:e(se,{$gap:12,children:[e(se,{$gap:24,children:[a&&t(vt,{onClick:a}),t(I,{title:g.SELECT_SOURCES,badgeLabel:N,description:g.SELECT_SOURCES_DESCRIPTION}),e(pe,{$justifyContent:"space-between",children:[t(Wr,{$fullWidth:s,children:t(C,{placeholder:x===B.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:Mi,value:b,onChange:e=>f(e.target.value.toLowerCase())})}),!s&&t(F,{options:[{label:g.SOURCE,value:B.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:B.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:x,setSelected:S})]}),e(pe,{$gap:36,children:[t(T,{title:g.SELECT_ALL,initialValue:p,onChange:h,disabled:!!u}),t(T,{title:g.ONLY_SELECTED,initialValue:$,onChange:w}),t(T,{title:g.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:D})]})]}),t(re,{}),t(Cr,{isModal:i,...c})]})})});_r.displayName=_r.name;const Jr=({fetchSingleNamespace:e,persistSources:i})=>{const{currentModal:n,setCurrentModal:a}=Q(),o=n===B.Source,l=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),l()}},c=r(null);return j({key:"Enter",active:o},s),o?t(ee,{isOpen:o,onClose:l,header:{title:"Add Source"},actionComponent:t(le,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(_r,{ref:c,isModal:!0,fetchSingleNamespace:e})}):null},Ur=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:g.NAMESPACE,sortable:!0}),t.push({key:"containers",title:g.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Gr=({metrics:i,maxHeight:n,maxWidth:a})=>{const o=m(),{isVm:r}=Le(),l=ye(),{selectedStreamName:c}=Je(),{sources:u,sourcesLoading:p}=W(),{setDrawerType:h,setDrawerEntityId:y}=K(),{selectedSources:v,setSelectedSources:b}=Re(),{progress:f}=Be(),x=s(()=>f[We.Instrumenting]||f[We.Uninstrumenting]?f[We.Instrumenting]?.percentage||f[We.Uninstrumenting]?.percentage||0:void 0,[f[We.Instrumenting],f[We.Uninstrumenting]]),$=s(()=>Ge(u,c),[u,c]),C=s(()=>jn({instrumentationRules:[],sources:Xe($,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[$,l]),[w,k]=s(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),D=d(e=>{if(e){const e={};C.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),b(e)}else b({})},[C]),T=d(e=>{const{namespace:t,name:i,kind:n}=e,a={...v};a[t]||(a[t]=[]);const o=a[t].findIndex(e=>e.name===i&&e.kind===n);-1===o?a[t].push(e):a[t].splice(o,1),b(a)},[v]),N=s(()=>C.map(n=>{const a=Ut(n),r=JSON.stringify(a),{hasErrors:l,hasWarnings:s,hasDisableds:c}=ce(n.conditions||[]),d=!!v[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?ne.Error:s?ne.Warning:void 0,faded:c,onClick:()=>{h(B.Source),y(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(pe,{$gap:16,children:[t(S,{value:d,onChange:()=>T(n)}),t(yi,{icons:ze(n.containers),id:r})]})},{columnKey:"name",value:fe(n,B.Source,{extended:!0})},{columnKey:"kind",value:n.kind,textColor:o.text.info},{columnKey:"namespace",value:n.namespace,textColor:o.text.info},{columnKey:"throughput",value:Ke(Ot(i,B.Source,a).throughput),textColor:o.text.info},{columnKey:"conditions",component:()=>t(Pn,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:ne.Info,title:vi(n.containers),withBorder:!0})})}]}}),[C,v,i,T]),{badge:E,badgeTooltip:A}=s(()=>C.length!==$.length?{badge:`${C.length}/${$.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:$.length,badgeTooltip:void 0},[C,$]);return e(Se,{$maxWidth:a,children:[e($e,{children:[t(S,{partiallyChecked:w&&C?.length!==k,value:w&&C?.length===k,onChange:D,disabled:!C?.length}),t(Ce,{icon:we(B.Source),title:g.SOURCES,badge:E,badgeTooltip:A,loading:p||"number"==typeof x})]}),t(ke,{$maxHeight:n,children:t(De,{columns:Ur(r),rows:N})}),"number"!=typeof x||N.length?N.length?null:t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})}):e(Te,{style:{marginTop:"2rem",gap:"24px"},children:[t(Ee,{width:420}),e(pe,{$gap:16,children:[e(P,{color:o.text.info,children:[f[We.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Ae,{label:`${x}%`})]})]})]})},Yr=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=Gt(),a=n(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),r=bi(t,0)?i.text.error:bi(t,6048e5)?i.text.warning:i.text.success;return e(P,{size:14,color:r,children:[a," (",o,")"]})},Xr=p.div`
|
|
486
486
|
position: relative;
|
|
487
|
-
`,
|
|
487
|
+
`,Zr=({token:i,saveToken:a})=>{const{CopyButton:o}=fi(),{formData:r,handleFormChange:l,resetFormData:s}=xi({token:i}),[c,d]=n(!1),u=()=>{d(!1),s()};return e(pe,{$gap:0,children:[t(o,{value:i,size:Si.L}),t(re,{orientation:"vertical",length:"12px"}),e(Xr,{children:[t(mt,{size:32,onClick:()=>{d(!0)},children:t(Ai,{})}),c&&t($i,{flipX:!0,clientX:36,isOpen:c,onClose:u,onSave:()=>{a(r.token).then(u)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one",children:t(C,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>l("token",e.target.value)})})]})]})},Qr=({tokens:e,saveToken:i})=>t(Y,{title:"Authorization Tokens",titleBadge:e.length,data:[{type:y.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:e.map(({name:e,token:n,expiresAt:a})=>({cells:[{columnKey:"icon",icon:Xi},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(Yr,{expiresAt:a})},{columnKey:"actions",component:()=>t(Zr,{token:n,saveToken:i})}]}))}}]}),el=({fetchDescribeOdigos:o})=>{const[r,l]=n(null);if(a(()=>{o().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Te,{children:t(Oe,{})});const s=e=>e?.name?[t(re,{},`divider-${e.name}`),t(oi,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(ci(e.value)?di(e.value)?ne.Success:ne.Error:ne.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(i,{children:[t(Y,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:r?.odigosVersion?.name,value:r?.odigosVersion?.value},{title:r?.kubernetesVersion?.name,value:r?.kubernetesVersion?.value},{title:r?.installationMethod?.name,value:r?.installationMethod?.value},{title:r?.tier?.name,value:r?.tier?.value},{title:"# of sources",value:r?.numberOfSources?.toString()},{title:"# of destinations",value:r?.numberOfDestinations?.toString()}]}),t(Y,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(s)}),t(Y,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},tl=p.div`
|
|
488
488
|
display: flex;
|
|
489
489
|
flex-direction: column;
|
|
490
490
|
gap: 12px;
|
|
491
|
-
`,
|
|
491
|
+
`,il="System Overview",nl=({tokens:a,saveToken:o,fetchDescribeOdigos:r})=>{const[l,s]=n(!1),c=()=>s(e=>!e);return e(i,{children:[t(mt,{onClick:c,tooltip:il,children:t(Zi,{size:18})},il),t(H,{width:"750px",isOpen:l,onClose:c,header:{icons:[Zi],title:il},footer:{isOpen:!1},children:e(tl,{children:[!!a?.length&&t(Qr,{tokens:a,saveToken:o}),t(el,{fetchDescribeOdigos:r})]})})]})},al=p.div`
|
|
492
492
|
position: fixed;
|
|
493
493
|
bottom: 12px;
|
|
494
494
|
left: 12px;
|
|
@@ -497,7 +497,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
497
497
|
flex-direction: column-reverse;
|
|
498
498
|
gap: 6px;
|
|
499
499
|
max-width: 600px;
|
|
500
|
-
`,
|
|
500
|
+
`,ol=()=>{const{notifications:e,markAsDismissed:i,markAsSeen:n}=zt(),{onClickNotification:a}=Yt();return t(al,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:o,title:r,message:l,crdType:s,target:c})=>t(ie,{id:e,type:o,title:r,message:l,action:s&&c?{label:"go to details",onClick:()=>a({id:e,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{i(e),n(e)})({id:e,asSeen:!0})},`toast-${e}`))})},rl=p.div`
|
|
501
501
|
position: relative;
|
|
502
502
|
display: flex;
|
|
503
503
|
align-items: center;
|
|
@@ -516,7 +516,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
516
516
|
stroke: ${({theme:e})=>e.text.secondary};
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
`,
|
|
519
|
+
`,ll=p.div`
|
|
520
520
|
position: absolute;
|
|
521
521
|
top: 2px;
|
|
522
522
|
left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
|
|
@@ -526,50 +526,50 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
526
526
|
background-color: ${({theme:e})=>e.colors.border};
|
|
527
527
|
border-radius: 100%;
|
|
528
528
|
transition: all 0.3s;
|
|
529
|
-
`,
|
|
529
|
+
`,sl=({path:e})=>t("svg",{width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),cl=()=>{const{darkMode:i,setDarkMode:n}=Ci();return e(rl,{onClick:()=>n(!i),children:[t(sl,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(sl,{path:"M8 15.333v-.666m-5.185-1.482.471-.471M.666 8h.667m1.482-5.185.471.47M8 1.334V.667m4.714 2.619.471-.471M14.667 8h.666m-2.619 4.714.471.471M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}),t(ll,{$darkMode:i})]})},dl=e=>{const{spans:t}=e,i=new Map;t.forEach(e=>{i.set(e.spanID,{...e,spans:[]})});const n=[];return t.forEach(e=>{const t=i.get(e.spanID);let a=!1;if(e.references.length){const t=e.references.find(e=>"CHILD_OF"===e.refType);t&&t.spanID&&i.has(t.spanID)||(a=!0)}else a=!0;if(a)n.push(t);else{const n=e.references.find(e=>"CHILD_OF"===e.refType);if(n){const e=i.get(n.spanID);e&&(e.spans=e.spans||[],e.spans.push(t),e.spans=e.spans.sort((e,t)=>e.startTime-t.startTime))}}}),n.sort((e,t)=>e.startTime-t.startTime)},ul=(e,t)=>{const{tags:i}=e,n={},a=[];return i.forEach(e=>{n[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),a},pl=e=>{const{logs:t}=e,i=[];return t.forEach((e,n)=>{e.fields.forEach(e=>{i.push({title:e.key,value:e.value})}),n!==t.length-1&&i.push({type:y.Divider})}),i},hl=e=>{const{traceID:t,spanID:i,processID:n,operationName:a,duration:o,startTime:r,warnings:l}=e,s=[];return s.push({type:y.CopyText,title:"Trace ID",value:t}),s.push({type:y.CopyText,title:"Span ID",value:i}),s.push({type:y.Divider}),s.push({title:"Service",value:n}),s.push({title:"Operation",value:a}),s.push({title:"Duration",value:wi(o)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:y.Divider}),s.push({title:"Warnings",titleIcon:Qi,value:l})),s},ml=(e,t)=>{const{tags:i}=e,n={},a=[];return i.forEach(e=>{n[e.key]=e.value}),a.push({type:y.Code,value:{language:"json",code:JSON.stringify(n,null,2),pretty:t}}),a},gl=p.div`
|
|
530
530
|
display: flex;
|
|
531
531
|
flex-direction: column;
|
|
532
532
|
gap: 12px;
|
|
533
533
|
max-height: 100vh;
|
|
534
534
|
overflow-y: auto;
|
|
535
|
-
`,
|
|
535
|
+
`,yl=({span:i,process:a,onClose:o})=>{const[r,l]=n(!0),[s,c]=n(!0);return t(H,{width:"750px",isOpen:!0,onClose:o,header:{icons:[en],title:i.operationName},footer:{isOpen:!1},children:e(gl,{children:[t(Y,{title:"Details",data:hl(i)}),i.logs.length>0&&t(Y,{title:"Errors",titleBadge:i.logs.length,titleIcon:Qi,data:pl(i)}),t(Y,{title:"Tags",data:ul(i,r),action:t(ki,{isPrettyMode:r,setIsPrettyMode:l})}),a&&t(Y,{title:`Process (${a.serviceName})`,data:ml(a,s),action:t(ki,{isPrettyMode:s,setIsPrettyMode:c})})]})})},vl=370,bl=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),fl=p.div`
|
|
536
536
|
display: flex;
|
|
537
537
|
align-items: center;
|
|
538
|
-
width: ${
|
|
539
|
-
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+
|
|
538
|
+
width: ${vl}px;
|
|
539
|
+
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+O["042"]:t.colors.dark_grey};
|
|
540
540
|
&:hover {
|
|
541
|
-
${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+
|
|
541
|
+
${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+O["010"]};`}
|
|
542
542
|
cursor: ${({$preventHover:e})=>e?"default":"pointer"};
|
|
543
543
|
}
|
|
544
|
-
`,
|
|
544
|
+
`,xl=p(pe)`
|
|
545
545
|
align-items: center;
|
|
546
546
|
justify-content: space-between;
|
|
547
547
|
gap: 4px;
|
|
548
548
|
padding: 12px;
|
|
549
549
|
padding-left: ${({$depth:e})=>12*e||12}px;
|
|
550
|
-
width: calc(${
|
|
551
|
-
`,
|
|
550
|
+
width: calc(${vl}px - ${({$depth:e})=>12*e}px);
|
|
551
|
+
`,Sl=p(pe)`
|
|
552
552
|
align-items: center;
|
|
553
553
|
gap: 4px;
|
|
554
554
|
position: absolute;
|
|
555
555
|
right: 56px;
|
|
556
556
|
width: calc(100% - ${434}px);
|
|
557
|
-
|
|
557
|
+
`,$l=p.div`
|
|
558
558
|
position: absolute;
|
|
559
559
|
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:i})=>(e-t)/(i-t)*100+"%"};
|
|
560
560
|
width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
|
|
561
561
|
height: 12px;
|
|
562
562
|
border-radius: 32px;
|
|
563
|
-
background-color: ${({$indexInMatrix:e})=>
|
|
564
|
-
`,
|
|
563
|
+
background-color: ${({$indexInMatrix:e})=>bl[e%bl.length]};
|
|
564
|
+
`,Cl=p(P)`
|
|
565
565
|
padding-left: calc(100% + 8px);
|
|
566
566
|
font-size: 10px;
|
|
567
567
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
568
568
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
569
569
|
white-space: nowrap;
|
|
570
|
-
|
|
570
|
+
`,wl=({span:i,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:c,errorTooltip:d,isOpen:u,withToggle:p,onToggleOpen:h,onSelect:g})=>{const y=m(),[v,b]=n(!1),f=vl-12*a-20-(c?12:0),x=c&&(1===a||i.logs.length>0);return e(fl,{className:"span-container",$withErrors:c,$preventHover:v,onClick:g,children:[e(xl,{$depth:a,className:"span-left",children:[e(pe,{$gap:4,$alignItems:"center",children:[t("div",p?{onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:t(mt,{onClick:e=>{e.stopPropagation(),h?.()},size:24,children:t(gt,{extend:u??!1})})}:{style:{width:"24px"}}),t(Ti,{maxWidth:f/2,text:i.processID,textSize:14}),t(P,{size:12,color:y.text.darker_grey,children:"•"}),t(Ti,{maxWidth:f/2,text:i.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(x?t(me,{...d,children:t(Qi,{fill:y.text.error})}):t("div",{style:{position:"relative"},children:t("div",{style:{position:"absolute",top:"-24px",right:"8px"},children:t(re,{type:ne.Error,orientation:"vertical",thickness:1,length:"48px",margin:"0",opacity:.5})})}))]}),t(Sl,{className:"span-right",children:t($l,{$indexInMatrix:o,$duration:i.duration,$maxDuration:r,$startTime:i.startTime,$minStartTime:l,$maxEndTime:s,children:t(Cl,{children:wi(i.duration)})})})]})},kl=({spans:i,logs:n,depth:a,indexInMatrix:o,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d})=>{const u=m();return i.map((i,p)=>{const h=i.spanID,m=c.value.includes(h),g=!!i.spans?.length,y=n.length?n:Di(i,"spans","logs"),v=y.length>0,b=v?y.length>1?`(${y.length}) errors`:y[0].fields.find(e=>"exception.message"===e.key)?.value:void 0,f=v?y.length>1?void 0:y[0].fields.find(e=>"exception.stacktrace"===e.key)?.value:void 0;return e("div",{style:{borderBottom:1===a?`1px dotted ${u.colors.border}`:"none"},children:[t(wl,{span:i,depth:a,indexInMatrix:o+p+a,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:Qi,title:b,text:f},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...Di(i,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:i)}),m&&g?t(kl,{spans:i.spans||[],logs:y,depth:a+1,indexInMatrix:o+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},Dl=p.div`
|
|
571
571
|
width: 100%;
|
|
572
|
-
`,
|
|
572
|
+
`,Tl=p.div`
|
|
573
573
|
max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
574
574
|
overflow: auto;
|
|
575
575
|
|
|
@@ -579,22 +579,22 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
579
579
|
border-radius: 24px;
|
|
580
580
|
border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
581
581
|
position: relative;
|
|
582
|
-
`,
|
|
582
|
+
`,Nl=p.div`
|
|
583
583
|
padding: 12px 12px 12px 24px;
|
|
584
|
-
width: calc(${
|
|
584
|
+
width: calc(${vl}px - 36px);
|
|
585
585
|
background-color: ${({theme:e})=>e.colors.dark_grey};
|
|
586
|
-
`,
|
|
586
|
+
`,El=p.div`
|
|
587
587
|
width: 1px;
|
|
588
588
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
589
589
|
background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
|
|
590
590
|
|
|
591
591
|
position: absolute;
|
|
592
|
-
left: calc(${
|
|
593
|
-
`,
|
|
592
|
+
left: calc(${vl}px + ((100% - ${vl}px) / ${5}) * ${({index:e})=>e});
|
|
593
|
+
`,Al=p(P)`
|
|
594
594
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
595
595
|
font-size: 12px;
|
|
596
596
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
597
597
|
padding-top: 12px;
|
|
598
598
|
padding-left: 12px;
|
|
599
599
|
white-space: nowrap;
|
|
600
|
-
`,
|
|
600
|
+
`,Fl=({heightToRemove:a,traces:o,isLoading:r})=>{const[l,c]=n([]),[d,u]=n(null),p=s(()=>Nt(o).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:dl(e)})),[o]),h=s(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),m=s(()=>{const e=p.find(e=>e.spans.some(e=>e.spanID===d?.spanID)),t=e?.processes.find(e=>e.serviceName===d?.processID);return t},[p,d]);return e(i,{children:[t(Dl,{$heightToRemove:a,children:r?t(Te,{$height:"50vh",children:t(Oe,{scale:1.5})}):p.length?e(Tl,{$heightToRemove:a,children:[t(Nl,{children:t(P,{children:"Service & operation"})}),new Array(5).fill(null).map((e,i)=>t(El,{$heightToRemove:a,index:i,children:t(Al,{children:wi(h/5*i)})},`${i}-divider`)),p.map((e,i)=>{const{spans:n}=e,a=n.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),o=n.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(kl,{spans:n,logs:[],depth:1,indexInMatrix:i,maxDuration:h,minStartTime:a,maxEndTime:o,openSpanIdsState:{value:l,set:c},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Te,{$height:"50vh",children:t(Ne,{title:g.NO_TRACES_FOUND,subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(yl,{span:d,process:m,onClose:()=>u(null)})]})};export{In as ActionDrawer,Nn as ActionForm,Mn as ActionModal,Hn as ActionTable,_n as AwaitPipeline,ha as ConditionDropdown,sa as DataFlow,ja as DataFlowActionsMenu,Ea as DataStreamDrawer,Ta as DataStreamForm,Ha as DataStreamModal,qa as DataStreamSelectionForm,Qa as DestinationDrawer,Ya as DestinationForm,fo as DestinationModal,wo as DestinationSelectionForm,Do as DestinationTable,ma as ErrorDropdown,zo as InstrumentationRuleDrawer,jo as InstrumentationRuleForm,Wo as InstrumentationRuleModal,Uo as InstrumentationRuleTable,ba as KindDropdown,ga as LanguageDropdown,ya as MonitorDropdown,Yo as MultiSourceControl,va as NamespaceDropdown,Tr as NavIconIds,ir as NotificationManager,En as OverviewDrawer,fa as PodsAgentInjectionStatusDropdown,hr as ServiceMap,Dr as SetupSummary,Nr as SideNav,Er as SlackInvite,Br as SourceDrawer,Or as SourceForm,Jr as SourceModal,_r as SourceSelectionForm,Gr as SourceTable,nl as SystemOverview,Pn as TableCellConditions,ol as ToastList,cl as ToggleDarkMode,Fl as TraceView};
|