@odigos/ui-kit 0.0.195 → 0.0.196
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 +16 -0
- package/lib/chunks/index-CjudHPMe.js +3 -0
- package/lib/chunks/ui-components-OrgB9V7b.js +2381 -0
- package/lib/chunks/vendor-DUWBN0Mg.js +1 -0
- package/lib/components/_v2/index.d.ts +1 -0
- package/lib/components/_v2/loader/index.d.ts +1 -0
- package/lib/components/_v2/no-data/index.d.ts +10 -0
- package/lib/components/_v2/table/styled.d.ts +5 -8
- package/lib/components/_v2/table/table-rows/index.d.ts +1 -1
- package/lib/components/scroll-y/index.d.ts +5 -3
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/destinations/index.d.ts +10 -4
- package/lib/constants/sources/index.d.ts +1 -1
- package/lib/constants/strings/index.d.ts +16 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/add-action-drawer/index.d.ts +1 -1
- package/lib/containers/_v2/_drawers/add-destination-drawer/form-column/index.d.ts +9 -0
- package/lib/containers/_v2/_drawers/add-destination-drawer/helpers.d.ts +14 -0
- package/lib/containers/_v2/_drawers/add-destination-drawer/index.d.ts +12 -0
- package/lib/containers/_v2/_drawers/add-destination-drawer/lists-column/index.d.ts +13 -0
- package/lib/containers/_v2/_drawers/add-destination-drawer/lists-filters/index.d.ts +9 -0
- package/lib/containers/_v2/_drawers/add-destination-drawer/types.d.ts +11 -0
- package/lib/containers/_v2/_drawers/add-source-drawer/namespaces-column/index.d.ts +5 -7
- package/lib/containers/_v2/_drawers/add-source-drawer/namespaces-column/list/index.d.ts +12 -0
- package/lib/containers/_v2/_drawers/add-source-drawer/namespaces-column/list/list-item/index.d.ts +20 -0
- package/lib/containers/_v2/_drawers/add-source-drawer/utils.d.ts +15 -0
- package/lib/containers/_v2/_drawers/index.d.ts +1 -0
- package/lib/containers/_v2/_forms/add-destination-form/dynamic-fields/index.d.ts +8 -0
- package/lib/containers/_v2/_forms/add-destination-form/index.d.ts +8 -0
- package/lib/containers/_v2/_forms/index.d.ts +1 -0
- package/lib/containers/_v2/central-connections/index.d.ts +4 -1
- package/lib/containers/v2.js +54 -22
- package/lib/containers.js +112 -122
- package/lib/contexts.js +1 -1
- package/lib/functions/compare-condition/index.d.ts +2 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +0 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/wide-drawer/column-list-collapse/index.d.ts +1 -0
- package/lib/snippets/_v2/wide-drawer/index.d.ts +1 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/destinations/index.d.ts +28 -11
- package/lib/types/enum/index.d.ts +0 -1
- package/lib/types/snapshot/index.d.ts +2 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +12 -12
- package/lib/chunks/index-DvMzoRJQ.js +0 -3
- package/lib/chunks/ui-components-ymRfS19x.js +0 -2374
- package/lib/chunks/vendor-C-kwkNJP.js +0 -1
- package/lib/hooks/useInfiniteScroll.d.ts +0 -10
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{
|
|
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{a4 as g,aN as y,h as v,K as b,A as f,aO as x,aP as S,aQ as $,aR as C,c as w,i as k,aS as D,aT as T,aU as N,aV as E,g as O,aW as F,a0 as A,aX as I,aY as R,aZ as M,a_ as L,a$ as P,b0 as j,am as K,az as q,b1 as z,b2 as H,b3 as V,aj as B,aq as W,b4 as _,b5 as J,b6 as U,b7 as Y,b8 as G,b9 as X,ba as Q,bb as Z,bc as ee,bd as te,be as ie,p as ne,a5 as ae,bf as oe,bg as re,bh as le,F as se,bi as ce,bj as de,bk as ue,k as pe,bl as he,J as me,bm as ge,bn as ye,bo as ve,bp as be,bq as fe,br as xe,bs as Se,bt as $e,bu as Ce,bv as we,bw as ke,bx as De,l as Te,by as Ne,bz as Ee,bA as Oe,bB as Fe,aF as Ae,bC as Ie,bD as Re,bE as Me,au as Le,G as Pe,bF as je,S as Ke,bG as qe,aa as ze,bH as He,bI as Ve,ah as Be,ak as We,bJ as _e,ac as Je,bK as Ue,bL as Ye,bM as Ge,bN as Xe,bO as Qe,bP as Ze,bQ as et,bR as tt,bS as it,bT as nt,bU as at,bV as ot,bW as rt,_ as lt,M as st,bX as ct,bY as dt,bZ as ut,b_ as pt,ai as ht,b$ as mt,c0 as gt,c1 as yt,c2 as vt,c3 as bt,c4 as ft,w as xt,y as St,E as $t,c5 as Ct,c6 as wt,c7 as kt,z as Dt,a9 as Tt,a8 as Nt,j as Et,c8 as Ot,c9 as Ft,ca as At,cb as It,O as Rt,U as Mt,X as Lt,Q as Pt,H as jt,P as Kt,Y as qt,cc as zt,$ as Ht,cd as Vt,ce as Bt,ad as Wt,cf as _t,cg as Jt,ch as Ut,ci as Yt,an as Gt,cj as Xt,ck as Qt,cl as Zt,cm as ei,cn as ti,co as ii,cp as ni,cq as ai,cr as oi,cs as ri,ct as li,cu as si,aw as ci,cv as di,cw as ui,cx as pi,cy as hi,cz as mi,cA as gi,cB as yi,cC as vi,cD as bi,ao as fi,al as xi,a3 as Si,a7 as $i,cE as Ci,cF as wi,cG as ki,cH as Di,cI as Ti,cJ as Ni}from"./chunks/ui-components-OrgB9V7b.js";import{VSquareIcon as Ei,XSquareIcon as Oi,EditIcon as Fi,TrashIcon as Ai,OdigosLogoText as Ii,PlusIcon as Ri,RefreshIcon as Mi,SearchIcon as Li,FilterIcon as Pi,DataStreamIcon as ji,VIcon as Ki,OdigosLogo as qi,ArrowIcon as zi,RefreshLeftArrowIcon as Hi,NotificationIcon as Vi,UserIcon as Bi,ImageErrorIcon as Wi,OverviewIcon as _i,SourceIcon as Ji,DestinationIcon as Ui,InstrumentationRuleIcon as Yi,ActionIcon as Gi,SlackLogo as Xi,KeyIcon as Qi,TerminalIcon as Zi,ExclamationTriangleIcon as en,TraceViewIcon as tn}from"./icons.js";import{MarkerType as nn,useNodesState as an,useEdgesState as on,applyNodeChanges as rn}from"@xyflow/react";import{Y as ln}from"./chunks/index-CjudHPMe.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const sn=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},cn=f.PiiCategories,dn=p.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -7,45 +7,45 @@ 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
|
-
`,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`
|
|
10
|
+
`,un=[{id:"CREDIT_CARD",label:"Credit Card"}],pn=f.FallbackSamplingRatio,hn=[{value:b.Pod,id:b.Pod},{value:b.Namespace,id:b.Namespace},{value:b.Node,id:b.Node}],mn=[{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:hn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],gn=[{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:hn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],yn=f.EndpointsFilters,vn=[{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}],bn=f.AttributeNamesToDelete,fn=f.Renames,xn=f.ServicesNameFilters,Sn=[{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}],$n=f.SamplingPercentage,Cn=f.AttributeFilters,wn=[{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:O.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:O.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}],kn={[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:mn,value:n[f.LabelsAttributes]||[],onChange:e=>o(f.LabelsAttributes,e),errorMessage:r[f.LabelsAttributes]}),t(D,{columns:gn,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[bn],o=e[bn]||[];return t(E,{title:"Attributes to delete",value:o,onChange:e=>i(bn,e),required:!0,errorMessage:a})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[fn],o=Object.entries(e[fn]||{}).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(fn,t)},required:!0,errorMessage:a})},[v.PiiMasking]:({value:i,setValue:o,formErrors:r})=>{const l=r[cn],s=i[cn]||[],[c,d]=n(1===s.length);return a(()=>{if(!s.length){const e=un.map(({id:e})=>e);o(cn,e),d(1===un.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(dn,{$hasError:!!l,children:un.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(cn,i),d(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[pn],o=e[pn];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(pn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[$n],o=e[$n];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($n,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[yn],o=e[yn]||[];return t(D,{columns:vn,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(yn,t)},errorMessage:a})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[xn],o=e[xn]||[];return t(D,{columns:Sn,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(xn,t)},errorMessage:a})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[Cn],o=(e[Cn]||[]).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:wn,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(Cn,t)},errorMessage:a,limitFieldsPerRow:3})}},Dn=({actionType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=kn[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Tn=p.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
gap: 24px;
|
|
14
14
|
padding: 4px;
|
|
15
|
-
`,
|
|
15
|
+
`,Nn=p(P)`
|
|
16
16
|
margin-bottom: 12px;
|
|
17
|
-
`,
|
|
17
|
+
`,En=({isUpdate:i,action:n,formData:a,formErrors:o,handleFormChange:r})=>{const l=m();return e(Tn,{children:[i&&e("div",{children:[t(Nn,{children:"Status"}),t(F,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+A["050"]},{icon:Oi,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+A["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(Dn,{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})]})},On=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}=j();K({key:"Enter",active:h},()=>U());const[E,O]=n(!1),[F,A]=n(!1),I=r(null),R=D===B.Source,M=()=>{O(!1),A(!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?A(!0):W()},J=()=>{O(!0)},U=()=>{f&&f(I.current?.getTitle()||"")},Y=C||[];return b&&!h&&Y.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>b(!0),children:e(i,{children:[t(Fi,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),x&&!h&&Y.push({"data-id":"drawer-delete",variant:"tertiary",onClick:J,children:e(i,{children:[t(Ai,{}),t(P,{color:k.text.error,size:14,family:"secondary",decoration:"underline",children:R?q.UNINSTRUMENT:q.DELETE})]})}),e(i,{children:[t(z,{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(Fn,{ref:I,title:s}):void 0,actionButtons:Y,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(Ai,{}),t(P,{size:14,color:k.text.error,family:"secondary",decoration:"underline",children:q.DELETE})]})}]:[]},children:a}),t(H,{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})]})}),Fn=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)})});Fn.displayName=Fn.name,On.displayName=On.name;const An=p.div`
|
|
18
18
|
width: 100%;
|
|
19
19
|
height: 100%;
|
|
20
20
|
max-height: calc(100vh - 220px);
|
|
21
21
|
overflow: overlay;
|
|
22
22
|
overflow-y: auto;
|
|
23
|
-
`,
|
|
23
|
+
`,In=p.div`
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
gap: 12px;
|
|
27
|
-
`,
|
|
27
|
+
`,Rn=({updateAction:i,deleteAction:o})=>{const{actions:l}=W(),{drawerType:c,drawerEntityId:d}=j(),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(On,{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:Q.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(An,{children:t(En,{isUpdate:!0,action:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(In,{children:[t(Y,{conditions:w.conditions||[]}),t(G,{title:g.ACTION_DETAILS,data:w?sn(w):[]})]})})},Mn=p(se)`
|
|
28
28
|
margin-top: 24px;
|
|
29
29
|
gap: 12px;
|
|
30
|
-
`,
|
|
30
|
+
`,Ln=({createAction:i})=>{const{currentModal:a,setCurrentModal:o}=Z(),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:Q.Create}))return null;i(l),m()};return K({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(Mn,{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(En,{action:p,formData:l,formErrors:s,handleFormChange:c})]}):null]})})},Pn=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},jn=({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}`)})})},qn=({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}},zn=[{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}=j(),u=s(()=>qn({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:Pn(e),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(xe,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(jn,{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:zn,rows:p})}),!u.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},Vn=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
|
+
`,Bn=p(se)`
|
|
37
37
|
max-width: 400px;
|
|
38
38
|
gap: 12px;
|
|
39
39
|
align-items: center;
|
|
40
40
|
justify-content: center;
|
|
41
|
-
`,
|
|
41
|
+
`,Wn=p(P)`
|
|
42
42
|
text-align: center;
|
|
43
43
|
font-size: 24px;
|
|
44
|
-
`,
|
|
44
|
+
`,_n=p(P)`
|
|
45
45
|
text-align: center;
|
|
46
46
|
line-height: 26px;
|
|
47
47
|
color: ${({theme:e})=>e.text.info};
|
|
48
|
-
`,
|
|
48
|
+
`,Jn=()=>{const[i,o]=n(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Fe(500),o(e)})()},[]),e(Vn,{children:[t(Ii,{size:100}),t(Ee,{width:400}),e(Bn,{children:[e(pe,{$gap:16,children:[t(Wn,{children:"Preparing your workspace..."}),t(Oe,{label:`${i}%`})]}),t(_n,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Un=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+A["030"]};
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,Yn=({entityType:i,description:n})=>{const{setCurrentModal:a}=Z();return e(Un,{onClick:()=>a(i),children:[e(pe,{$gap:4,children:[t(Ri,{}),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;
|
|
@@ -71,9 +71,9 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
71
71
|
display: flex;
|
|
72
72
|
align-items: center;
|
|
73
73
|
border-bottom: 1px solid ${({theme:e})=>e.colors.border};
|
|
74
|
-
`,
|
|
74
|
+
`,Xn=p(pe)`
|
|
75
75
|
margin-left: ${({$marginLeft:e})=>e};
|
|
76
|
-
`,
|
|
76
|
+
`,Qn=p(Ie)`
|
|
77
77
|
width: 24px;
|
|
78
78
|
height: 24px;
|
|
79
79
|
padding: 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
|
+
`,ea=({entityType:i,badge:n,badgeTooltip:a,isLoading:o,refetch:r,partiallySelected:l,allSelected:s,onSelectAll:c,progressPercent:d})=>{const u=m(),{setCurrentModal:p}=Z(),h=we(i);return e(Gn,{children:[c&&t(Xn,{$marginLeft:"28px",children:t(S,{partiallyChecked:l,value:s,onChange:c})}),t(Xn,{$marginLeft:i===B.Source?"0":"28px",children:t(Ce,{icon:h,title:`${i}s`,badge:n,badgeTooltip:a,loading:!1})}),e(Xn,{$marginLeft:"auto",children:[t(Qn,{"data-id":`refresh-${i}`,variant:"secondary",onClick:r,disabled:o,children:o?t(Ae,{scale:.8}):t(Mi,{fill:u.colors.secondary,size:18})}),t(Qn,{"data-id":`add-${i}`,variant:"primary",onClick:()=>p(i),children:t(Ri,{fill:u.colors.primary,size:18})})]}),"number"==typeof d&&t(Zn,{percent:d})]})},ta=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
|
+
`,ia=({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:$}=j(),{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(Ae,{scale:.8}):n?t(n,{size:14}):null;return c?e(ta,{$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)}}})},na=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
|
+
`,aa=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
|
+
`,oa=({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?je(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:He(t.containers),icon:we(e)};case B.Destination:return ze(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(ia,{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(na,{$height:i,children:[t(Ke,{gap:8,elements:l}),t(aa,{$hide:!0})]})},ra=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
|
+
`,la=({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),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(ra,{$isVm:d,children:[t(ea,{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(oa,{height:u,entityType:i,entities:n,metrics:o}):r?t(_e,{size:3}):t(Yn,{entityType:i,description:g.TO_COLLECT_OTEL_DATA})]})},sa=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
|
+
`,ca=({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(()=>Ye(g,p),[g,p]),w=s(()=>Ge(v,p),[v,p]),[k,D]=n([]),[T,N]=n([]),[E,O]=n([]),[F,A]=n([]);return a(()=>{D(Xe(C,u))},[C,u]),a(()=>{N(Qe(w,u))},[w,u]),a(()=>{O(ve(f,u))},[f,u]),a(()=>{A(S)},[S]),e(sa,{ref:h,$height:i,children:[t(la,{entityType:B.InstrumentationRule,entities:F,unfilteredCount:S.length,loading:$,maxHeight:m,refetch:d}),t(la,{entityType:B.Source,entities:k,unfilteredCount:C.length,metrics:o,loading:y,maxHeight:m,refetch:r}),t(la,{entityType:B.Action,entities:E,unfilteredCount:f.length,loading:x,maxHeight:m,refetch:c}),t(la,{entityType:B.Destination,entities:T,unfilteredCount:w.length,metrics:o,loading:b,maxHeight:m,refetch:l})]})},da=p.div`
|
|
139
139
|
position: relative;
|
|
140
140
|
max-width: 200px;
|
|
141
141
|
`;p.div`
|
|
@@ -149,60 +149,60 @@ 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 ua=p.div`
|
|
153
153
|
display: flex;
|
|
154
154
|
align-items: center;
|
|
155
155
|
overflow-x: scroll;
|
|
156
|
-
`,
|
|
156
|
+
`,pa=({onClose:i})=>{const o=m(),{onClickNode:r}=Ze(),{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(()=>qn({instrumentationRules:g,sources:Ye(u,d),actions:h,destinations:Ge(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(ua,{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,{})})},ha=({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),K({key:"Escape",active:c},d),e(da,{ref:u,children:[t(C,{placeholder:"Search",icon:Li,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>s(!0)}),c&&!i?t(pa,{onClose:d}):null]})},ma=({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})},ga=({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})},ya=({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})},va=({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})},ba=({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})},fa=({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})},xa=({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})},Sa=p.div`
|
|
157
157
|
display: flex;
|
|
158
158
|
flex-direction: column;
|
|
159
159
|
gap: 12px;
|
|
160
160
|
padding: 12px;
|
|
161
|
-
|
|
161
|
+
`,$a=p.div`
|
|
162
162
|
padding: 12px 6px 6px 6px;
|
|
163
|
-
|
|
163
|
+
`,Ca=p(Ie)`
|
|
164
164
|
font-size: 14px;
|
|
165
165
|
${({$color:e})=>`color: ${e};`}
|
|
166
|
-
`,
|
|
166
|
+
`,wa=p.div`
|
|
167
167
|
margin-left: auto;
|
|
168
|
-
`,
|
|
168
|
+
`,ka=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},Da=()=>{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:O}=ye(),F=s(()=>Ye(l,c),[l,c]),[A,I]=n({namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k,podsAgentInjectionStatus:D}),[R,M]=n(ka(A));a(()=>{const e=d(ct.OVERVIEW_FILTERS,O());N(e)},[]),a(()=>{if(!g){const e={namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k};I(e),M(ka(e))}},[g,f,x,S,$,C,w,k]);const L=()=>{y(!1)},P=r(null);return at(P,L),K({key:"Escape",active:g},L),e(da,{ref:P,children:[t(nt,{label:"Filters",icon:Pi,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(Ca,{variant:"primary",onClick:()=>{u(ct.OVERVIEW_FILTERS,A),N(A),M(ka(A)),y(!1)},children:"Apply"}),t(Ca,{variant:"secondary",onClick:L,children:"Cancel"}),t(wa,{children:t(Ca,{variant:"tertiary",onClick:()=>{p(ct.OVERVIEW_FILTERS),E(),I(O()),M(0),y(!1)},$color:i.text.error,children:"Reset"})})]}),children:e(Sa,{children:[t(ba,{namespaces:o,value:A.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(fa,{sources:F,value:A.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(ya,{sources:F,value:A.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(va,{value:A.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(ma,{sources:F,value:A.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(xa,{sources:F,value:A.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($a,{children:t(T,{title:"Show only sources with errors",initialValue:A.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})}),t(ga,{sources:F,value:A.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:!A.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},Ta=p.div`
|
|
169
169
|
display: flex;
|
|
170
170
|
flex-direction: column;
|
|
171
171
|
gap: 24px;
|
|
172
172
|
padding: 4px;
|
|
173
|
-
`,
|
|
173
|
+
`,Na=({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(Ta,{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)})]})},Ea=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
|
+
`,Oa=({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(On,{ref:c,title:f.name,icons:[ji],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(o(a,h),p(!1),i())},onCancel:()=>{v(),p(!1),i()},children:t(Ea,{children:t(Na,{formData:h,handleFormChange:x,formErrors:g,editingStreamName:a})})}):null},Fa=p.div`
|
|
180
180
|
position: relative;
|
|
181
|
-
`,
|
|
181
|
+
`,Aa=p(pe)`
|
|
182
182
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
183
183
|
border-radius: 32px;
|
|
184
184
|
|
|
185
185
|
& button {
|
|
186
186
|
max-height: 28px;
|
|
187
187
|
}
|
|
188
|
-
`,
|
|
188
|
+
`,Ia=p(P)`
|
|
189
189
|
text-wrap: nowrap;
|
|
190
|
-
`,
|
|
190
|
+
`,Ra=p(it)`
|
|
191
191
|
max-height: 240px;
|
|
192
192
|
padding: 0px !important;
|
|
193
|
-
`,
|
|
193
|
+
`,Ma=p(pe)`
|
|
194
194
|
width: 100%;
|
|
195
|
-
`,
|
|
195
|
+
`,La=p.div`
|
|
196
196
|
width: 100%;
|
|
197
|
-
`,
|
|
197
|
+
`,Pa=({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(Ma,{children:[t(La,{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(Ai,{})}),t(mt,{onClick:()=>x(i),tooltip:q.EDIT,children:t(Fi,{})})]},`stream-${i}`)),[y,v,w]);return e(i,{children:[e(Fa,{children:[e(Aa,{$gap:0,children:[e(Ie,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(ji,{fill:l.text.info}),e(Ia,{children:["Data Stream: ",v]}),t(gt,{extend:u}),t(Oe,{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:Li,value:w,onChange:e=>k(e.target.value)}),children:t(Ra,{children:D})})]}),t(H,{isOpen:""!==S,name:S,onApprove:()=>{r(S),$("")},onDeny:()=>{$("")}}),t(Oa,{isOpen:""!==f,onClose:()=>{x("")},dataStreamName:f,updateDataStream:o})]})},ja=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
|
+
`,qa=({addEntity:i,preventSearchPopup:n,onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const{isVm:l}=Le(),{setCurrentModal:s}=Z();return e(ja,{children:[!l&&t(Pa,{onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r}),t(ha,{preventPopup:n}),t(Da,{}),i&&t(Ka,{children:t(yt,{"data-id":`add-${i}`,onClick:()=>s(i),label:`${q.ADD} ${ot(i)}`,variant:"primary",textProps:{weight:900}})})]})},za=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(Na,{formData:r,handleFormChange:s,formErrors:c})]})})});za.displayName=za.name;const Ha=({createDataStream:e})=>{const{currentModal:i,setCurrentModal:n}=Z(),{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 K({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(za,{ref:d,isModal:!0})})},Va=(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},Ba=({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 O.Input:return t(C,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case O.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 O.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 O.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 O.TextArea:return t(L,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case O.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}}),Wa=p(Ie)`
|
|
206
206
|
display: flex;
|
|
207
207
|
align-items: center;
|
|
208
208
|
gap: 8px;
|
|
@@ -216,18 +216,18 @@ 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
|
+
`,_a=({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(Wa,{$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(Ae,{}):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"})]})},Ja=p(se)`
|
|
220
220
|
align-items: unset;
|
|
221
221
|
padding: 0 4px;
|
|
222
|
-
`,
|
|
222
|
+
`,Ua=p.div`
|
|
223
223
|
display: flex;
|
|
224
224
|
flex-direction: column;
|
|
225
225
|
gap: 12px;
|
|
226
|
-
`,
|
|
226
|
+
`,Ya=p(pe)`
|
|
227
227
|
justify-content: space-between;
|
|
228
228
|
`,Ga=p(P)`
|
|
229
229
|
margin-bottom: 12px;
|
|
230
|
-
`,
|
|
230
|
+
`,Xa=({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 O=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(Ja,{$gap:24,children:[e(Ja,{$gap:12,children:[t(I,{title:i?"Update destination":"Create destination",description:`Connect ${b} with Odigos.`,actionButton:x&&t(_a,{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(Ua,{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(Ya,{children:[t(M,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:O,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:Ei,label:g.ENABLED,value:!1,selectedBgColor:S.text.success+A["050"]},{icon:Oi,label:g.DISABLED,value:!0,selectedBgColor:S.text.error+A["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(Ba,{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})]})},Qa=p.div`
|
|
231
231
|
width: 100%;
|
|
232
232
|
height: 100%;
|
|
233
233
|
max-height: calc(100vh - 220px);
|
|
@@ -237,22 +237,22 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
237
237
|
display: flex;
|
|
238
238
|
flex-direction: column;
|
|
239
239
|
gap: 12px;
|
|
240
|
-
`,
|
|
240
|
+
`,eo=({categories:i,updateDestination:o,deleteDestination:l,testConnection:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{drawerType:p,drawerEntityId:h}=j(),m=s(()=>Ge(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:O,setDynamicFields:F}=Ct({}),A=s(()=>{if(h)return m?.find(e=>J(e)===h)},[h,m]);if(a(()=>{v&&A?(E(wt(i,A)),T(A)):k()},[v,A,i]),!A)return null;const I=i.flatMap(e=>e.items).find(e=>e.type===A.destinationType.type),{icon:R,iconSrc:M}=I?ze(I?.type):{icon:void 0,iconSrc:void 0};return t(On,{ref:y,title:A.name||A.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:Q.Update})){const t=e!==A.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(A)},isLastItem:1===m.length,children:b?t(Qa,{children:t(Xa,{isUpdate:!0,categoryItem:I,formData:$,formErrors:C,handleFormChange:(...e)=>{S(!0),w(...e)},dynamicFields:O,setDynamicFields:(...e)=>{S(!0),F(...e)},validateForm:D,testConnection:c})}):e(Za,{children:[A.conditions?.length?t(Y,{conditions:A.conditions}):null,t(G,{title:g.DESTINATION_DETAILS,data:A?Va(A,N):[]})]})})},to=p.div`
|
|
241
241
|
display: flex;
|
|
242
242
|
flex-direction: column;
|
|
243
243
|
gap: 12px;
|
|
244
|
-
`,
|
|
244
|
+
`,io=({items:i,onSelectNew:n,onSelectConfigured:a,isLoadingForDestinationIds:o})=>{const{configuredDestinationsUpdateOnly:r}=pt();return i.map(i=>{const l=i.name===Tt[Nt.EXISTS].TITLE;return e(to,{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}=ze(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}`)})},no=p.div`
|
|
245
245
|
display: flex;
|
|
246
246
|
flex-direction: column;
|
|
247
247
|
gap: 24px;
|
|
248
|
-
`,
|
|
248
|
+
`,ao=p.div`
|
|
249
249
|
display: flex;
|
|
250
250
|
align-items: center;
|
|
251
251
|
gap: 12px;
|
|
252
|
-
`,
|
|
252
|
+
`,oo=p.div`
|
|
253
253
|
width: 170px;
|
|
254
254
|
margin-right: 8px;
|
|
255
|
-
`,
|
|
255
|
+
`,ro=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
|
+
`,lo=p(no)`
|
|
267
267
|
margin-top: 80px;
|
|
268
|
-
`,
|
|
268
|
+
`,so=Object.values(Nt).map(e=>({value:Tt[e].TITLE,id:e})),co=so[0],uo=[$t.Logs,$t.Metrics,$t.Traces],po=(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}}}}),ho=({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(co),[b,f]=n(uo),x=s(()=>{const e=Et(a);return e.unshift({name:Nt.EXISTS,description:Tt[Nt.EXISTS].DESCRIPTION,icon:Ki,items:po(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:Nt.DETECTED,description:Tt[Nt.DETECTED].DESCRIPTION,icon:qi,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[Ot[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(no,{children:[t(I,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(ao,{children:[t(oo,{children:t(C,{placeholder:"Search...",icon:Li,value:m,onChange:({target:{value:e}})=>g(e)})}),t(oo,{children:t(rt,{options:so,value:y,onSelect:v,onDeselect:()=>{}})}),t(M,{title:"",selectedSignals:b,setSelectedSignals:f})]}),t(re,{}),x.length?t(ro,{children:t(io,{items:x,onSelectNew:e=>r(e,b),onSelectConfigured:l,isLoadingForDestinationIds:c})}):t(lo,{children:t(Ne,{title:"No destinations found"})})]})},mo=p.div`
|
|
269
269
|
display: flex;
|
|
270
|
-
`,
|
|
270
|
+
`,go=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
|
+
`,yo=({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}=Z(),{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:O}=Ct({supportedSignals:x?.supportedSignals,preLoadedFields:x?.fields}),[F,A]=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);A(t=>[...t,e.id]),i?await s(e.id):await l(e.id,O(t)),A(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:Q.Create}))return null;R()}M()};return K({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(zi,{rotate:-90}),variant:"secondary",onClick:L}),e})()}),children:e(mo,{children:[t(go,{children:t(Ft,{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(ho,{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[Ot[t]].supported).forEach(e=>i[Ot[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(Xa,{categoryItem:x,formData:$,formErrors:C,handleFormChange:w,dynamicFields:N,setDynamicFields:E,validateForm:D,testConnection:c})]})]})})},vo=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
|
+
`,bo=({categories:e,withDelete:i})=>{const{configuredDestinations:n,configuredDestinationsUpdateOnly:a}=pt();return n.length||a.length?t(vo,{children:n.concat(a).map((o,r)=>t(fo,{"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"})})},fo=({item:a,yamlFields:o,isLastItem:r,withDelete:l})=>{const[c,d]=n(!1),{icon:u,iconSrc:p}=ze(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(At,{data:g})},renderActions:l?()=>t(mt,{onClick:()=>d(!0),children:t(Ai,{})}):void 0}),l&&t(H,{isOpen:c,name:a.destinationType.displayName||a.name,type:B.Destination,isLastItem:r,onApprove:()=>{a.id?m(a):h(a)},onDeny:()=>d(!1)})]})},xo=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
|
+
`,So=({isSourcesListEmpty:n,goToSources:a,categories:o,potentialDestinations:r,testConnection:l,onClickSummary:s})=>{const c=m(),{setCurrentModal:d}=Z(),{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(xo,{variant:"secondary",onClick:()=>d(B.Destination),children:[t(Ri,{}),t(P,{color:c.colors.secondary,size:14,decoration:"underline",family:"secondary",children:g.ADD_DESTINATION})]})]}),t(bo,{categories:o,withDelete:!0})]})}),t(yo,{isOnboarding:!0,categories:o,potentialDestinations:r,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:l})]})},$o=[{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}],Co=({metrics:i,maxHeight:n,maxWidth:a})=>{const o=m(),r=ye(),{selectedStreamName:l}=Je(),{setDrawerType:c,setDrawerEntityId:d}=j(),{destinations:u,destinationsLoading:p}=W(),h=s(()=>Ge(u,l),[u,l]),y=s(()=>qn({instrumentationRules:[],sources:[],actions:[],destinations:Qe(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}=ze(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:je(It(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(jn,{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:$o,rows:v})}),!y.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},wo=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[Rt.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[Lt.Java]||[]).map(e=>new Mt(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:g.JAVA_CUSTOM_PROBES,value:e});const t=(c[Lt.Golang]||[]).map(e=>new Pt(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},ko=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
|
+
`,Do=[{id:jt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:jt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:jt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],To=[{id:jt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:jt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:jt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],No={[Lt.Java]:[new Mt("","")],[Lt.Golang]:[new Pt("")]},Eo=["*"],Oo=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
|
+
`,Fo=[{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"}],Ao={[qt.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={[jt.Column]:null,[jt.FilePath]:!0,[jt.Function]:!0,[jt.LineNumber]:!0,[jt.Namespace]:null,[jt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(jt).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(ko,{$hasError:!!c,children:Do.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(ko,{$hasError:!!c,children:To.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})]})]})},[qt.CustomInstrumentation]:({value:i,setValue:n,formErrors:o})=>{const r=o.customInstrumentations,l=s(()=>(i?.customInstrumentations?.[Lt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[i]),c=s(()=>(i?.customInstrumentations?.[Lt.Golang]||[]).map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=(e,t)=>{const i={};switch(t){case"java":i[Lt.Java]=e.map(e=>new Mt(e.className,e.methodName)),i[Lt.Golang]=c.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[Lt.Golang]=e.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[Lt.Java]=l.map(({key:e,value:t})=>new Mt(e,t))}n("customInstrumentations",i)};return a(()=>{i?.customInstrumentations||n("customInstrumentations",{[Lt.Golang]:No[Lt.Golang],[Lt.Java]:No[Lt.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"})]})},[qt.HeadersCollection]:({value:e,setValue:i,formErrors:n})=>{const o=n.headersCollection,r=s(()=>e?.headersCollection?.[Rt.HeaderKeys]||[],[e]),l=e=>{const t={[Rt.HeaderKeys]:e};i("headersCollection",t)};return a(()=>{r.length||l(Eo)},[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})})},[qt.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(Oo,{$hasError:!!l,children:Fo.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})]})},[qt.UnknownType]:null},Io=({ruleType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=Ao[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Ro=p.div`
|
|
316
316
|
display: flex;
|
|
317
317
|
flex-direction: column;
|
|
318
318
|
gap: 24px;
|
|
319
319
|
padding: 4px;
|
|
320
|
-
`,
|
|
320
|
+
`,Mo=p(P)`
|
|
321
321
|
margin-bottom: 12px;
|
|
322
|
-
`,
|
|
322
|
+
`,Lo=({isUpdate:n,rule:a,formData:o,formErrors:r,handleFormChange:l})=>{const s=m();return e(Ro,{children:[t(pe,{children:a.supportedLanguages.map(e=>t(zt,{icon:Ht(e),type:ne.Info,children:lt[e]},e))}),n?e("div",{children:[t(Mo,{children:"Status"}),t(F,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+A["050"]},{icon:Oi,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+A["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(Io,{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})]})},Po=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
|
+
`,jo=p.div`
|
|
329
329
|
display: flex;
|
|
330
330
|
flex-direction: column;
|
|
331
331
|
gap: 12px;
|
|
332
|
-
`,
|
|
332
|
+
`,Ko=({updateInstrumentationRule:i,deleteInstrumentationRule:o})=>{const{instrumentationRules:l}=W(),{addNotification:c}=Vt(),{drawerType:d,drawerEntityId:u}=j(),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}=Bt(),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=Wt.find(({type:e})=>e===w.type);return t(On,{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(Po,{children:t(Lo,{isUpdate:!0,rule:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(jo,{children:[t(Y,{conditions:w.conditions||[]}),t(G,{title:"Instrumentation Rule Details",data:w?wo(w):[]})]})})},qo=p(se)`
|
|
333
333
|
margin-top: 24px;
|
|
334
334
|
gap: 12px;
|
|
335
|
-
`,
|
|
335
|
+
`,zo=Wt,Ho=({createInstrumentationRule:i})=>{const{tier:a}=Le(),o=a===_t.Onprem,{currentModal:r,setCurrentModal:l}=Z(),s=r===B.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Bt(),[m,y]=n(void 0),v=()=>{p(),y(void 0),l("")},b=()=>{if(!h())return null;i(c),v()};return K({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(qo,{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:zo,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(Lo,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},Vo=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(Lt).forEach(e=>{const t=(n[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},Bo=[{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}],Wo=({maxHeight:i,maxWidth:n})=>{const a=m(),o=ye(),{setDrawerType:r,setDrawerEntityId:l}=j(),{instrumentationRules:c,instrumentationRulesLoading:d}=W(),u=s(()=>qn({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:Vo(e),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(jn,{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:Bo,rows:p})}),!u.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},_o=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
|
-
`,
|
|
348
|
+
animation-name: ${Ut.in.center};
|
|
349
|
+
`,Jo=({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(_o,{"data-id":"multi-source-control",children:[t(P,{children:"Selected sources"}),t(Oe,{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(Ai,{}),t(P,{family:"secondary",decoration:"underline",color:r.text.error,children:"Uninstrument"})]})]}),t(H,{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(Jt,{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=>Yt(e)))}),o(e),v()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},Uo=p.div`
|
|
350
350
|
position: relative;
|
|
351
351
|
width: fit-content;
|
|
352
|
-
`,
|
|
352
|
+
`,Yo=p(pe)`
|
|
353
353
|
gap: 12px;
|
|
354
354
|
padding: 0 12px;
|
|
355
|
-
`,
|
|
355
|
+
`,Go=p(se)`
|
|
356
356
|
gap: 12px;
|
|
357
357
|
max-height: 400px;
|
|
358
358
|
overflow-y: auto;
|
|
359
|
-
`,
|
|
359
|
+
`,Xo=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
|
+
`,Qo=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
|
+
`,Zo=()=>{const i=m(),{notifications:n,markAsSeen:a}=Vt(),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(Uo,{children:[t(mt,{onClick:()=>{p(0,0),d(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:i.colors.orange_og,children:t(Vi,{size:18})}),e(tt,{ref:s,isOpen:c,right:u.left,maxWidth:"400px",header:e(Yo,{children:[t(P,{size:20,children:"Notifications"}),!!l&&e(Qo,{size:12,family:"secondary",children:[l," new"]})]}),children:[t(Go,{children:o.length?o.map(e=>t(or,{...e,onClick:()=>d(!1)},`notification-${e.id}`)):t(Ne,{title:"No notifications",subTitle:""})}),t(Xo,{})]})]})},er=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+A["080"]};
|
|
381
381
|
cursor: not-allowed;
|
|
382
382
|
&.click-enabled {
|
|
383
383
|
cursor: pointer;
|
|
@@ -385,42 +385,32 @@ 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
|
+
`,tr=p.div`
|
|
389
|
+
background-color: ${({$type:e,theme:t})=>t.text[e]+A["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
|
-
`,
|
|
396
|
+
`,ir=p.div`
|
|
397
397
|
width: 290px;
|
|
398
|
-
`,
|
|
398
|
+
`,nr=p.div`
|
|
399
399
|
margin-bottom: 6px;
|
|
400
|
-
`,
|
|
400
|
+
`,ar=p.div`
|
|
401
401
|
display: flex;
|
|
402
402
|
align-items: center;
|
|
403
403
|
gap: 6px;
|
|
404
|
-
`,
|
|
404
|
+
`,or=({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}=Xt(),y=!!c&&!!d,v=r?.toLowerCase().includes(Q.Delete.toLowerCase())||!1,b=ge(o,p);return e(er,{className:y?"click-enabled":"",onClick:()=>{y&&(u(),g({id:n,crdType:c,target:d}))},children:[t(tr,{$type:v?ne.Error:o,children:t(v?Ai:b,{})}),e(ir,{children:[t(nr,{children:t(P,{size:14,children:l})}),e(ar,{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}`)},rr=(e,t,i)=>{const n=e?.serviceName||t?.otelServiceName||t?.name,a=i?[Bi]:He(t?.containers||[]),{priorotizedStatus:o}=ce(t?.conditions||[]);return{id:n,title:n,icons:a.length?a:[Wi],status:o,serviceMapEntry:e}},lr=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,sr=p.div`
|
|
405
405
|
width: 100%;
|
|
406
406
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
407
407
|
position: relative;
|
|
408
|
-
`,
|
|
409
|
-
display: flex;
|
|
410
|
-
flex-direction: column;
|
|
411
|
-
align-items: center;
|
|
412
|
-
|
|
413
|
-
gap: 12px;
|
|
414
|
-
width: 100%;
|
|
415
|
-
max-height: ${({$isModal:e})=>e?"calc(100vh - 510px)":"calc(100vh - 310px)"};
|
|
416
|
-
height: fit-content;
|
|
417
|
-
overflow-y: scroll;
|
|
418
|
-
`,gr=p.div`
|
|
408
|
+
`,cr={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},dr=({heightToRemove:e,serviceMap:i})=>{const n=m(),{sources:o,sourcesLoading:r}=W(),{containerRef:l,containerHeight:s,containerWidth:c}=Ue(),[d,u,p]=an([]),[h,y,v]=on([]);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}-${Qt.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}-${Qt.MapItem}`,type:Qt.MapItem,position:r.get(i),data:rr(t,n,lr(n))})}),o.forEach((t,i)=>{if(a.find(e=>e.id===`${B.Source}-${i}-${Qt.MapItem}`))return;const n=e.find(e=>i===e.otelServiceName||i===e.name);a.push({id:`${B.Source}-${i}-${Qt.MapItem}`,type:Qt.MapItem,position:r.get(i),data:rr(t,n,lr(n))})});let i=50;e.forEach(e=>{const t=e.otelServiceName||e.name;a.find(e=>e.id===`${B.Source}-${t}-${Qt.MapItem}`)||(a.push({id:`${B.Source}-${t}-${Qt.MapItem}`,type:Qt.MapItem,position:{x:i,y:10},data:rr(void 0,e,lr(e))}),i+=110)})}else a.push({id:`${B.Source}-${Qt.NoData}`,type:Qt.NoData,position:{x:n/2-150,y:i/4},data:{subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return a})({serviceMap:i,sources:[cr].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}-${Qt.NoData}`)&&i.push({id:`${B.Source}-${Qt.NoData}`,type:"remove"}),rn(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}-${Qt.MapItem}`,l=o===ne.Error;n.push({id:`${a}-to-${r}`,source:a,target:r,markerEnd:{type:nn.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})})}),n})({theme:n,nodes:d,serviceMap:i}))},[n,d,i]),t(sr,{ref:l,$heightToRemove:e,children:t(Zt,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:v,zoomOnScroll:!0})})},ur=p.div`
|
|
419
409
|
width: 100%;
|
|
420
410
|
padding-bottom: ${({$isOpen:e})=>e?"18px":"0"};
|
|
421
411
|
border-radius: 16px;
|
|
422
|
-
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+
|
|
423
|
-
`,
|
|
412
|
+
background-color: ${({$selected:e,theme:t})=>e?t.colors.majestic_blue+A["024"]:t.colors.dropdown_bg_2+A["040"]};
|
|
413
|
+
`,pr=p.div`
|
|
424
414
|
display: flex;
|
|
425
415
|
justify-content: space-between;
|
|
426
416
|
gap: 12px;
|
|
@@ -429,29 +419,29 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
429
419
|
border-radius: 16px;
|
|
430
420
|
cursor: ${({$withClick:e})=>e?"pointer":"unset"};
|
|
431
421
|
&:hover {
|
|
432
|
-
background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+
|
|
422
|
+
background-color: ${({$withClick:e,$selected:t,theme:i})=>e&&(t?i.colors.majestic_blue+A["040"]:i.colors.dropdown_bg_2+A["080"])};
|
|
433
423
|
transition: background-color 0.3s;
|
|
434
424
|
}
|
|
435
|
-
`,
|
|
425
|
+
`,hr=p(pr)`
|
|
436
426
|
width: calc(100% - 100px);
|
|
437
427
|
margin: 0 auto;
|
|
438
428
|
padding: 8px;
|
|
439
|
-
`,
|
|
429
|
+
`,mr=p.div`
|
|
440
430
|
position: relative;
|
|
441
431
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
442
|
-
`,
|
|
432
|
+
`,gr=p.div`
|
|
443
433
|
position: absolute;
|
|
444
434
|
top: 6px;
|
|
445
435
|
left: 18px;
|
|
446
|
-
`,
|
|
436
|
+
`,yr=p(Te)`
|
|
447
437
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
448
|
-
`,
|
|
438
|
+
`,vr=p.div`
|
|
449
439
|
width: ${({$width:e})=>`${e||42}px`};
|
|
450
440
|
display: flex;
|
|
451
441
|
align-items: center;
|
|
452
442
|
justify-content: flex-end;
|
|
453
443
|
text-align: right;
|
|
454
|
-
|
|
444
|
+
`,br=we(B.Namespace),fr=({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(Ke,{height:i?"calc(100vh - 510px)":"calc(100vh - 310px)",gap:12,noAnimation:!0,elements: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(ur,{"data-id":`namespace-${i}`,$selected:C,$isOpen:$,children:[e(pr,{$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(br,{}),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(vr,{$width:108,children:a!==i||o?.includes(i)?null:t(ei,{size:10,children:"Retrieving workloads..."})}),t(vr,{children:t(P,{size:10,color:h.text.grey,children:x?`${f.length}/${r.length}`:null})}),s&&t(gt,{extend:$})]})]}),($||!s)&&(k?e(mr,{$addPadding:!d,children:[t(gr,{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(xr,{withInstances:n,source:e,namespace:i,isSelected:a,onSelect:d},`source-${e.name}`)})]}):t(yr,{$addPadding:!d,children:v||a===i&&!o?.includes(i)?t(Ae,{}):t(Ne,{title:g.NO_SOURCES_NAMESPACE,subTitle:g.TRY_SEARCH_OR_OTHER_NAMESPACE})}))]},`namespace-${i}`):null})}):t(Te,{children:v||a?t(Ae,{}):t(Ne,{title:g.NO_SOURCES,subTitle:!y&&s?g.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:g.PLEASE_ADD_SOURCE})})},xr=({withInstances:i,source:n,namespace:a,isSelected:o,onSelect:r})=>t(hr,{"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}`]})]})]})}),Sr=p.div`
|
|
455
445
|
display: flex;
|
|
456
446
|
flex-direction: column;
|
|
457
447
|
align-items: center;
|
|
@@ -460,35 +450,35 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
460
450
|
max-height: calc(100vh - 200px);
|
|
461
451
|
height: fit-content;
|
|
462
452
|
overflow-y: scroll;
|
|
463
|
-
|
|
453
|
+
`,$r=({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(Sr,{children:[t(G,{title:g.STREAM_NAME,action:()=>t(ti,{onClick:i}),data:[{title:"",value:r}]}),t(G,{title:g.SELECTED_SOURCES,titleBadge:u,action:()=>t(ti,{onClick:n}),children:t(fr,{filteredNamespacesAndSources:l,withInstances:!1})}),t(G,{title:g.SELECTED_DESTINATIONS,titleBadge:c.length+d.length,action:()=>t(ti,{onClick:a}),children:t(bo,{categories:o})})]})]})})};var Cr;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(Cr||(Cr={}));const wr=({onClickId:e,defaultSelectedId:i,extendedNavIcons:a})=>{const{isVm:o}=Le(),[r,l]=n(i||""),c=s(()=>[{id:Cr.Overview,icon:_i,selected:r===Cr.Overview,onClick:()=>{l(Cr.Overview),e(Cr.Overview)},tooltip:"Overview"},...(a||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{l(e.id),e.onClick()}}))],[r]),d=s(()=>{const t=[{id:Cr.Sources,icon:Ji,selected:r===Cr.Sources,onClick:()=>{l(Cr.Sources),e(Cr.Sources)},tooltip:"Sources"},{id:Cr.Destinations,icon:Ui,selected:r===Cr.Destinations,onClick:()=>{l(Cr.Destinations),e(Cr.Destinations)},tooltip:"Destinations"}];return o||(t.push({id:Cr.InstrumentationRules,icon:Yi,selected:r===Cr.InstrumentationRules,onClick:()=>{l(Cr.InstrumentationRules),e(Cr.InstrumentationRules)},tooltip:"Instrumentation Rules"}),t.push({id:Cr.Actions,icon:Gi,selected:r===Cr.Actions,onClick:()=>{l(Cr.Actions),e(Cr.Actions)},tooltip:"Actions"})),t},[o,r]);return t(ii,{orientation:"vertical",mainIcons:c,subIcons:d})},kr=({})=>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(Xi,{})}),Dr=(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},Tr=p.div`
|
|
464
454
|
display: flex;
|
|
465
455
|
flex-direction: column;
|
|
466
456
|
gap: 24px;
|
|
467
457
|
padding: 4px;
|
|
468
|
-
`,
|
|
458
|
+
`,Nr=({formData:e,handleFormChange:i})=>t(Tr,{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)})}),Er=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=ni(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)"})})},Or=({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||ai(d)?ne.Error:ne.Success,m=[];return m.push(t(oi,{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(ri,{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(ri,{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(ri,{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(ri,{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(li,{...e},`pod-container-${e.containerName.value}`))}),p&&(m.push(t(re,{length:"100%",margin:"0"},"divider-6")),m.push(t(ln,{yaml:p},"yaml-section-card"))),t(G,{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(si,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:ci(),label:"Restart",rightIcon:Mi,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(Ae,{})})},Fr=p(pe)`
|
|
469
459
|
width: 100%;
|
|
470
460
|
align-items: center;
|
|
471
461
|
justify-content: space-between;
|
|
472
|
-
`,
|
|
462
|
+
`,Ar=({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(Et(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(G,{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(Fr,{$width:"100%",children:[t(P,{size:12,color:r.text.grey,children:i}),e(pe,{$gap:4,children:[o.map(({key:e,value:n})=>di(n)&&ui(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(Ae,{})})};var Ir;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Ir||(Ir={}));const Rr=[hi.Deployment,hi.StatefulSet,hi.DaemonSet,hi.DeploymentConfig,hi.Rollout,hi.StaticPod],Mr=[hi.Deployment,hi.StatefulSet,hi.DaemonSet,hi.DeploymentConfig,hi.Rollout,hi.Pod],Lr=[mi.Python,mi.Go,mi.Java],Pr=p.div`
|
|
473
463
|
width: 100%;
|
|
474
464
|
height: 100%;
|
|
475
465
|
max-height: calc(100vh - 220px);
|
|
476
466
|
overflow: overlay;
|
|
477
467
|
overflow-y: auto;
|
|
478
|
-
`,
|
|
468
|
+
`,jr=p.div`
|
|
479
469
|
display: flex;
|
|
480
470
|
flex-direction: column;
|
|
481
471
|
gap: 12px;
|
|
482
|
-
`;var
|
|
472
|
+
`;var Kr;!function(e){e.Workload="Workload",e.Pod="Pod"}(Kr||(Kr={}));const qr=({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}=j(),x=s(()=>Ye(y,v),[y,v]),S=r(null),$=b===B.Source,[C,w]=n(!1),[k,D]=n(!1),[T,N]=n(Ir.Overview),[E,O]=n(null);a(()=>{$&&f&&d(f).then(e=>O(e||null))},[$,f]);const{formData:F,handleFormChange:A,resetFormData:I,loadFormWithDrawerItem:R}=pi(),M=s(()=>{if(f)return E&&JSON.stringify(Yt(E))===JSON.stringify(Yt(f))?E:x?.find(e=>JSON.stringify(Yt(e))===JSON.stringify(Yt(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]),K=s(()=>{const e=[{label:Ir.Overview,onClick:()=>N(Ir.Overview),selected:T===Ir.Overview}];return m||(Rr.includes(M?.kind)&&e.push({label:Ir.Pods,onClick:()=>N(Ir.Pods),selected:T===Ir.Pods}),M?.containers?.some(({language:e})=>Lr.includes(e))&&e.push({label:Ir.Libraries,onClick:()=>N(Ir.Libraries),selected:T===Ir.Libraries})),e},[T,M,m]),q=Mr.includes(M?.kind),[z,H]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return M?e(On,{ref:S,onClose:()=>{N(Ir.Overview),O(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:He(M.containers),isEdit:C,isFormDirty:k,onEdit:T===Ir.Overview?e=>{w("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=F.otelServiceName!==M.name?F.otelServiceName:"";A("otelServiceName",e),await l(f,{...F,otelServiceName:e}),O(null),D(!1),w(!1)},onDelete:T===Ir.Overview?async()=>{const{namespace:e}=M;o({[e]:[{...M,selected:!1,currentStreamName:v}]},{}),O(null),D(!1),w(!1),S.current?.closeDrawer()}:void 0,onCancel:()=>{D(!1),w(!1),A("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===x.length,tabs:K,headerActionButtons:m?[]:q?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>H({openFor:Kr.Workload,workloadId:f}),children:e(i,{children:[t(Hi,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[T===Ir.Overview?C?t(Pr,{children:t(Nr,{formData:F,handleFormChange:(...e)=>{D(!0),A(...e),A("currentStreamName",v)}})}):e(jr,{children:[t(Er,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),t(Y,{conditions:M.conditions||[]}),t(G,{title:g.SOURCE_DETAILS,data:M?Dr(M,m):[]}),t(G,{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(gi,{...e,callbackRuntimeOverride:e=>l(f,e)},`source-container-${e.containerName}`))}),M.manifestYAML&&t(ln,{title:`${M.kind} YAML`,yaml:M.manifestYAML,defaultOpen:!M.instrumentationConfigYAML}),M.instrumentationConfigYAML&&t(ln,{title:"Instrumentation Config YAML",yaml:M.instrumentationConfigYAML,defaultOpen:!M.manifestYAML})]}):T===Ir.Pods?t(Or,{source:M,fetchSourceDescribe:u,onClickRestartPod:q?(e,t)=>H({openFor:Kr.Pod,podNamespace:e,podName:t}):void 0}):t(Ar,{source:M,fetchSourceLibraries:p}),t(Jt,{isOpen:!!z.openFor,title:`Rollout Restart ${z.openFor}`,description:`Are you sure you want to rollout restart this ${z.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:ne.Warning,onClick:()=>{z.openFor===Kr.Workload&&z.workloadId?c([z.workloadId]):z.openFor===Kr.Pod&&z.podNamespace&&z.podName&&h(z.podNamespace,z.podName),H({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{H({openFor:null})}}})]}):null},zr=p.div`
|
|
483
473
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
484
474
|
width: 100%;
|
|
485
|
-
`,
|
|
475
|
+
`,Hr=o(({isModal:i,fetchSingleNamespace:n,onClickSummary:a},o)=>{const r=m(),{isVm:s}=Le(),c=yi({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(zr,{$fullWidth:s,children:t(C,{placeholder:x===B.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:Li,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(fr,{isModal:i,...c})]})})});Hr.displayName=Hr.name;const Vr=({fetchSingleNamespace:e,persistSources:i})=>{const{currentModal:n,setCurrentModal:a}=Z(),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 K({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(Hr,{ref:c,isModal:!0,fetchSingleNamespace:e})}):null},Br=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},Wr=({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}=j(),{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(()=>Ye(u,c),[u,c]),C=s(()=>qn({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=Yt(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(vi,{icons:He(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:je(It(i,B.Source,a).throughput),textColor:o.text.info},{columnKey:"conditions",component:()=>t(jn,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:ne.Info,title:bi(n.containers),withBorder:!0})})}]}}),[C,v,i,T]),{badge:E,badgeTooltip:O}=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:O,loading:p||"number"==typeof x})]}),t(ke,{$maxHeight:n,children:t(De,{columns:Br(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(Oe,{label:`${x}%`})]})]})]})},_r=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=Gt(),a=n(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),r=fi(t,0)?i.text.error:fi(t,6048e5)?i.text.warning:i.text.success;return e(P,{size:14,color:r,children:[a," (",o,")"]})},Jr=p.div`
|
|
486
476
|
position: relative;
|
|
487
|
-
`,
|
|
477
|
+
`,Ur=({token:i,saveToken:a})=>{const{CopyButton:o}=xi(),{formData:r,handleFormChange:l,resetFormData:s}=Si({token:i}),[c,d]=n(!1),u=()=>{d(!1),s()};return e(pe,{$gap:0,children:[t(o,{value:i,size:$i.L}),t(re,{orientation:"vertical",length:"12px"}),e(Jr,{children:[t(mt,{size:32,onClick:()=>{d(!0)},children:t(Fi,{})}),c&&t(Ci,{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)})})]})]})},Yr=({tokens:e,saveToken:i})=>t(G,{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:Qi},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(_r,{expiresAt:a})},{columnKey:"actions",component:()=>t(Ur,{token:n,saveToken:i})}]}))}}]}),Gr=({fetchDescribeOdigos:o})=>{const[r,l]=n(null);if(a(()=>{o().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Te,{children:t(Ae,{})});const s=e=>e?.name?[t(re,{},`divider-${e.name}`),t(ri,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(di(e.value)?ui(e.value)?ne.Success:ne.Error:ne.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(i,{children:[t(G,{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(G,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(s)}),t(G,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},Xr=p.div`
|
|
488
478
|
display: flex;
|
|
489
479
|
flex-direction: column;
|
|
490
480
|
gap: 12px;
|
|
491
|
-
`,
|
|
481
|
+
`,Qr="System Overview",Zr=({tokens:a,saveToken:o,fetchDescribeOdigos:r})=>{const[l,s]=n(!1),c=()=>s(e=>!e);return e(i,{children:[t(mt,{onClick:c,tooltip:Qr,children:t(Zi,{size:18})},Qr),t(z,{width:"750px",isOpen:l,onClose:c,header:{icons:[Zi],title:Qr},footer:{isOpen:!1},children:e(Xr,{children:[!!a?.length&&t(Yr,{tokens:a,saveToken:o}),t(Gr,{fetchDescribeOdigos:r})]})})]})},el=p.div`
|
|
492
482
|
position: fixed;
|
|
493
483
|
bottom: 12px;
|
|
494
484
|
left: 12px;
|
|
@@ -497,7 +487,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
497
487
|
flex-direction: column-reverse;
|
|
498
488
|
gap: 6px;
|
|
499
489
|
max-width: 600px;
|
|
500
|
-
`,
|
|
490
|
+
`,tl=()=>{const{notifications:e,markAsDismissed:i,markAsSeen:n}=Vt(),{onClickNotification:a}=Xt();return t(el,{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}`))})},il=p.div`
|
|
501
491
|
position: relative;
|
|
502
492
|
display: flex;
|
|
503
493
|
align-items: center;
|
|
@@ -516,7 +506,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
516
506
|
stroke: ${({theme:e})=>e.text.secondary};
|
|
517
507
|
}
|
|
518
508
|
}
|
|
519
|
-
`,
|
|
509
|
+
`,nl=p.div`
|
|
520
510
|
position: absolute;
|
|
521
511
|
top: 2px;
|
|
522
512
|
left: ${({$darkMode:e})=>e?"2px":"calc(100% - 2px - 24px)"};
|
|
@@ -526,50 +516,50 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
526
516
|
background-color: ${({theme:e})=>e.colors.border};
|
|
527
517
|
border-radius: 100%;
|
|
528
518
|
transition: all 0.3s;
|
|
529
|
-
`,
|
|
519
|
+
`,al=({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})}),ol=()=>{const{darkMode:i,setDarkMode:n}=wi();return e(il,{onClick:()=>n(!i),children:[t(al,{path:"M14 7.977A4.333 4.333 0 1 1 8.023 2H8a6 6 0 1 0 6 6v-.023Z"}),t(al,{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(nl,{$darkMode:i})]})},rl=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)},ll=(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},sl=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},cl=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:ki(o)}),s.push({title:"Start time",value:new Date(r/1e3).toLocaleString()}),l.length&&(s.push({type:y.Divider}),s.push({title:"Warnings",titleIcon:en,value:l})),s},dl=(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},ul=p.div`
|
|
530
520
|
display: flex;
|
|
531
521
|
flex-direction: column;
|
|
532
522
|
gap: 12px;
|
|
533
523
|
max-height: 100vh;
|
|
534
524
|
overflow-y: auto;
|
|
535
|
-
`,
|
|
525
|
+
`,pl=({span:i,process:a,onClose:o})=>{const[r,l]=n(!0),[s,c]=n(!0);return t(z,{width:"750px",isOpen:!0,onClose:o,header:{icons:[tn],title:i.operationName},footer:{isOpen:!1},children:e(ul,{children:[t(G,{title:"Details",data:cl(i)}),i.logs.length>0&&t(G,{title:"Errors",titleBadge:i.logs.length,titleIcon:en,data:sl(i)}),t(G,{title:"Tags",data:ll(i,r),action:t(Di,{isPrettyMode:r,setIsPrettyMode:l})}),a&&t(G,{title:`Process (${a.serviceName})`,data:dl(a,s),action:t(Di,{isPrettyMode:s,setIsPrettyMode:c})})]})})},hl=370,ml=["#33DCA7","#50F6E8","#444AD9","#8B55FF","#FF7CA9"].reverse(),gl=p.div`
|
|
536
526
|
display: flex;
|
|
537
527
|
align-items: center;
|
|
538
|
-
width: ${
|
|
539
|
-
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+
|
|
528
|
+
width: ${hl}px;
|
|
529
|
+
background-color: ${({$withErrors:e,theme:t})=>e?t.colors.error+A["042"]:t.colors.dark_grey};
|
|
540
530
|
&:hover {
|
|
541
|
-
${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+
|
|
531
|
+
${({$withErrors:e,$preventHover:t,theme:i})=>!t&&`background-color: ${e?i.colors.error:i.colors.secondary+A["010"]};`}
|
|
542
532
|
cursor: ${({$preventHover:e})=>e?"default":"pointer"};
|
|
543
533
|
}
|
|
544
|
-
`,
|
|
534
|
+
`,yl=p(pe)`
|
|
545
535
|
align-items: center;
|
|
546
536
|
justify-content: space-between;
|
|
547
537
|
gap: 4px;
|
|
548
538
|
padding: 12px;
|
|
549
539
|
padding-left: ${({$depth:e})=>12*e||12}px;
|
|
550
|
-
width: calc(${
|
|
551
|
-
`,
|
|
540
|
+
width: calc(${hl}px - ${({$depth:e})=>12*e}px);
|
|
541
|
+
`,vl=p(pe)`
|
|
552
542
|
align-items: center;
|
|
553
543
|
gap: 4px;
|
|
554
544
|
position: absolute;
|
|
555
545
|
right: 56px;
|
|
556
546
|
width: calc(100% - ${434}px);
|
|
557
|
-
|
|
547
|
+
`,bl=p.div`
|
|
558
548
|
position: absolute;
|
|
559
549
|
left: ${({$startTime:e,$minStartTime:t,$maxEndTime:i})=>(e-t)/(i-t)*100+"%"};
|
|
560
550
|
width: ${({$duration:e,$maxDuration:t})=>e/t*100+"%"};
|
|
561
551
|
height: 12px;
|
|
562
552
|
border-radius: 32px;
|
|
563
|
-
background-color: ${({$indexInMatrix:e})=>
|
|
564
|
-
`,
|
|
553
|
+
background-color: ${({$indexInMatrix:e})=>ml[e%ml.length]};
|
|
554
|
+
`,fl=p(P)`
|
|
565
555
|
padding-left: calc(100% + 8px);
|
|
566
556
|
font-size: 10px;
|
|
567
557
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
568
558
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
569
559
|
white-space: nowrap;
|
|
570
|
-
`,
|
|
560
|
+
`,xl=({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=hl-12*a-20-(c?12:0),x=c&&(1===a||i.logs.length>0);return e(gl,{className:"span-container",$withErrors:c,$preventHover:v,onClick:g,children:[e(yl,{$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(Ni,{maxWidth:f/2,text:i.processID,textSize:14}),t(P,{size:12,color:y.text.darker_grey,children:"•"}),t(Ni,{maxWidth:f/2,text:i.operationName,textSize:12,textColor:y.text.darker_grey})]}),c&&(x?t(me,{...d,children:t(en,{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(vl,{className:"span-right",children:t(bl,{$indexInMatrix:o,$duration:i.duration,$maxDuration:r,$startTime:i.startTime,$minStartTime:l,$maxEndTime:s,children:t(fl,{children:ki(i.duration)})})})]})},Sl=({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:Ti(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(xl,{span:i,depth:a,indexInMatrix:o+p+a,maxDuration:r,minStartTime:l,maxEndTime:s,withErrors:v,errorTooltip:{titleIcon:en,title:b,text:f},isOpen:m,withToggle:g,onToggleOpen:()=>c.set(e=>e.some(e=>e===h)?e.filter(e=>e!=h):[...e,h,...Ti(i,"spans","spanID")]),onSelect:()=>d.set(e=>e?.spanID===h?null:i)}),m&&g?t(Sl,{spans:i.spans||[],logs:y,depth:a+1,indexInMatrix:o+p,maxDuration:r,minStartTime:l,maxEndTime:s,openSpanIdsState:c,selectedSpanState:d}):null]},`span-${h}`)})},$l=p.div`
|
|
571
561
|
width: 100%;
|
|
572
|
-
`,
|
|
562
|
+
`,Cl=p.div`
|
|
573
563
|
max-height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
574
564
|
overflow: auto;
|
|
575
565
|
|
|
@@ -579,22 +569,22 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
|
|
|
579
569
|
border-radius: 24px;
|
|
580
570
|
border: 1px solid ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
581
571
|
position: relative;
|
|
582
|
-
`,
|
|
572
|
+
`,wl=p.div`
|
|
583
573
|
padding: 12px 12px 12px 24px;
|
|
584
|
-
width: calc(${
|
|
574
|
+
width: calc(${hl}px - 36px);
|
|
585
575
|
background-color: ${({theme:e})=>e.colors.dark_grey};
|
|
586
|
-
`,
|
|
576
|
+
`,kl=p.div`
|
|
587
577
|
width: 1px;
|
|
588
578
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px + 2px)`};
|
|
589
579
|
background: ${({theme:e})=>`linear-gradient(to bottom, ${e.colors.border}, transparent)`};
|
|
590
580
|
|
|
591
581
|
position: absolute;
|
|
592
|
-
left: calc(${
|
|
593
|
-
`,
|
|
582
|
+
left: calc(${hl}px + ((100% - ${hl}px) / ${5}) * ${({index:e})=>e});
|
|
583
|
+
`,Dl=p(P)`
|
|
594
584
|
color: ${({theme:e})=>e.text.darker_grey};
|
|
595
585
|
font-size: 12px;
|
|
596
586
|
font-family: ${({theme:e})=>e.font_family.secondary};
|
|
597
587
|
padding-top: 12px;
|
|
598
588
|
padding-left: 12px;
|
|
599
589
|
white-space: nowrap;
|
|
600
|
-
`,
|
|
590
|
+
`,Tl=({heightToRemove:a,traces:o,isLoading:r})=>{const[l,c]=n([]),[d,u]=n(null),p=s(()=>Et(o).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:rl(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($l,{$heightToRemove:a,children:r?t(Te,{$height:"50vh",children:t(Ae,{scale:1.5})}):p.length?e(Cl,{$heightToRemove:a,children:[t(wl,{children:t(P,{children:"Service & operation"})}),new Array(5).fill(null).map((e,i)=>t(kl,{$heightToRemove:a,index:i,children:t(Dl,{children:ki(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(Sl,{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(pl,{span:d,process:m,onClose:()=>u(null)})]})};export{Rn as ActionDrawer,En as ActionForm,Ln as ActionModal,Hn as ActionTable,Jn as AwaitPipeline,ma as ConditionDropdown,ca as DataFlow,qa as DataFlowActionsMenu,Oa as DataStreamDrawer,Na as DataStreamForm,Ha as DataStreamModal,za as DataStreamSelectionForm,eo as DestinationDrawer,Xa as DestinationForm,yo as DestinationModal,So as DestinationSelectionForm,Co as DestinationTable,ga as ErrorDropdown,Ko as InstrumentationRuleDrawer,Lo as InstrumentationRuleForm,Ho as InstrumentationRuleModal,Wo as InstrumentationRuleTable,fa as KindDropdown,ya as LanguageDropdown,va as MonitorDropdown,Jo as MultiSourceControl,ba as NamespaceDropdown,Cr as NavIconIds,Zo as NotificationManager,On as OverviewDrawer,xa as PodsAgentInjectionStatusDropdown,dr as ServiceMap,$r as SetupSummary,wr as SideNav,kr as SlackInvite,qr as SourceDrawer,Nr as SourceForm,Vr as SourceModal,Hr as SourceSelectionForm,Wr as SourceTable,Zr as SystemOverview,jn as TableCellConditions,tl as ToastList,ol as ToggleDarkMode,Tl as TraceView};
|