@odigos/ui-kit 0.0.163 → 0.0.164
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
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.164](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.163...ui-kit-v0.0.164) (2025-12-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **DataFlow:** add refetch functionality for sources, destinations, actions, and instrumentation rules ([#582](https://github.com/odigos-io/ui-kit/issues/582)) ([3c3e387](https://github.com/odigos-io/ui-kit/commit/3c3e3879d9fd4857e214223014df66cabed7a4c7))
|
|
9
|
+
|
|
3
10
|
## [0.0.163](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.162...ui-kit-v0.0.163) (2025-12-25)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -3,6 +3,10 @@ import { type Metrics } from '@/types';
|
|
|
3
3
|
interface DataFlowProps {
|
|
4
4
|
height: CSSProperties['height'];
|
|
5
5
|
metrics: Metrics;
|
|
6
|
+
refetchSources: () => void;
|
|
7
|
+
refetchDestinations: () => void;
|
|
8
|
+
refetchActions: () => void;
|
|
9
|
+
refetchInstrumentationRules: () => void;
|
|
6
10
|
}
|
|
7
11
|
declare const DataFlow: React.FC<DataFlowProps>;
|
|
8
12
|
export { DataFlow, type DataFlowProps };
|
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u,useTheme as p}from"styled-components";import{A as m,E as h,G as g,K as y,H as v,J as b,M as f,Q as x,R as $,V as S,X as k,Y as C,Z as w,_ as T,$ as D,a0 as N,a1 as E,p as I,a2 as O,a3 as A,a4 as F,a5 as M,a6 as R,a7 as L,a8 as P,a9 as K,aa as j,ab as V,ac as q,ad as H,ae as z,af as B,f as W,ag as _,ah as J,ai as U,aj as G,ak as Y,al as X,am as Z,an as Q,F as ee,ao as te,ap as ie,aq as ae,ar as ne,as as oe,at as le,au as re,av as se,aw as ce,ax as de,a as ue,ay as pe,az as me,aA as he,aB as ge,aC as ye,aD as ve,aE as be,aF as fe,aG as xe,aH as $e,aI as Se,aJ as ke,aK as Ce,aL as we,aM as Te,r as De,aN as Ne,aO as Ee,aP as Ie,aQ as Oe,aR as Ae,aS as Fe,aT as Me,aU as Re,
|
|
1
|
+
import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u,useTheme as p}from"styled-components";import{A as m,E as h,G as g,K as y,H as v,J as b,M as f,Q as x,R as $,V as S,X as k,Y as C,Z as w,_ as T,$ as D,a0 as N,a1 as E,p as I,a2 as O,a3 as A,a4 as F,a5 as M,a6 as R,a7 as L,a8 as P,a9 as K,aa as j,ab as V,ac as q,ad as H,ae as z,af as B,f as W,ag as _,ah as J,ai as U,aj as G,ak as Y,al as X,am as Z,an as Q,F as ee,ao as te,ap as ie,aq as ae,ar as ne,as as oe,at as le,au as re,av as se,aw as ce,ax as de,a as ue,ay as pe,az as me,aA as he,aB as ge,aC as ye,aD as ve,aE as be,aF as fe,aG as xe,aH as $e,aI as Se,aJ as ke,aK as Ce,aL as we,aM as Te,r as De,aN as Ne,aO as Ee,aP as Ie,aQ as Oe,aR as Ae,aS as Fe,aT as Me,aU as Re,e as Le,aV as Pe,aW as Ke,aX as je,aY as Ve,aZ as qe,a_ as He,a$ as ze,b0 as Be,b1 as We,b2 as _e,b3 as Je,b4 as Ue,b5 as Ge,b6 as Ye,b7 as Xe,b8 as Ze,b9 as Qe,ba as et,bb as tt,bc as it,bd as at,be as nt,bf as ot,bg as lt,bh as rt,bi as st,bj as ct,bk as dt,bl as ut,bm as pt,bn as mt,bo as ht,bp as gt,bq as yt,br as vt,bs as bt,bt as ft,bu as xt,bv as $t,bw as St,bx as kt,by as Ct,bz as wt,bA as Tt,bB as Dt,bC as Nt,bD as Et,bE as It,bF as Ot,bG as At,bH as Ft,bI as Mt,bJ as Rt,bK as Lt,bL as Pt,bM as Kt,bN as jt,bO as Vt,bP as qt,bQ as Ht,i as zt,bR as Bt,bS as Wt,bT as _t,bU as Jt,bV as Ut,bW as Gt,bX as Yt,bY as Xt,bZ as Zt,b_ as Qt,b$ as ei,k as ti,c0 as ii,c1 as ai,c2 as ni,c3 as oi,c4 as li,c5 as ri,c6 as si,c7 as ci,c8 as di,c9 as ui,ca as pi,u as mi,cb as hi,cc as gi,cd as yi,ce as vi,cf as bi,cg as fi,ch as xi}from"./chunks/ui-components-fabd01fd.js";import{VSquareIcon as $i,XSquareIcon as Si,EditIcon as ki,TrashIcon as Ci,OdigosLogoText as wi,PlusIcon as Ti,RefreshIcon as Di,SearchIcon as Ni,FilterIcon as Ei,DataStreamIcon as Ii,VIcon as Oi,OdigosLogo as Ai,ArrowIcon as Fi,RefreshLeftArrowIcon as Mi,NotificationIcon as Ri,UserIcon as Li,ImageErrorIcon as Pi,OverviewIcon as Ki,InstrumentationRuleIcon as ji,ActionIcon as Vi,SourceIcon as qi,DestinationIcon as Hi,SlackLogo as zi,KeyIcon as Bi,TerminalIcon as Wi,ExclamationTriangleIcon as _i,TraceViewIcon as Ji}from"./icons.js";import{MarkerType as Ui,useNodesState as Gi,useEdgesState as Yi,applyNodeChanges as Xi}from"@xyflow/react";import{Y as Zi}from"./chunks/index-53f81cb1.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Qi=e=>{const{type:t,name:i,notes:a,signals:n,disabled:o,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:$,samplingPercentage:S,endpointsFilters:k,servicesNameFilters:C,attributeFilters:w}}=e,T=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!o)},{type:h.Monitors,title:m.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:m.NAME,value:i||""},{title:m.NOTES,value:a||""},{type:h.Divider}];if(t===g.K8sAttributes&&(T.push({title:"Collect Container Attributes",value:String(l)}),T.push({title:"Collect ReplicaSet Attributes",value:String(r)}),T.push({title:"Collect Workload ID",value:String(s)}),T.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&T.push({type:h.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:a},n)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${a?.length?a.join(", "):i||y.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${n+1}`:""),value:o})}),u?.length&&T.push({type:h.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:a},n)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${a?.length?a.join(", "):i||y.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${n+1}`:""),value:o})})),t===g.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},a)=>{e+=`${t}: ${i}`,a<p.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.DeleteAttributes){let e="";b?.forEach((t,i)=>{e+=t,i<b.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([i,a],n)=>{e+=`${i}: ${a}`,n<t.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===g.ErrorSampler&&T.push({title:"Sampling Ratio",value:String($)}),t===g.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String(S)}),t===g.LatencySampler&&k?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${i}\n`,o+=`Fallback Sampling Ratio: ${a}`,T.push({title:"Endpoint"+(k.length>1?` #${n+1}`:""),value:o})}),t===g.ServiceNameSampler&&C?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${i}`,T.push({title:"Filter"+(C.length>1?` #${a+1}`:""),value:n})}),t===g.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}\n`;const l=Object.keys(a)[0];o+=`Condition: ${l}\n`,o+=`Operation: ${a[l]?.operation}\n`,o+=`Expected Value: ${a[l]?.expectedValue}`,"jsonCondition"===l&&(o+=`\nJSON Path: ${a[l].jsonPath}`),T.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:o})}),T},ea=x.PiiCategories,ta=d.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -86,7 +86,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
86
86
|
height: 4px;
|
|
87
87
|
width: ${({percent:e})=>`${e}%`};
|
|
88
88
|
transition: width 0.3s;
|
|
89
|
-
`,Wa=({entityType:t,badge:i,badgeTooltip:a,isLoading:n})=>{const
|
|
89
|
+
`,Wa=({entityType:t,badge:i,badgeTooltip:a,isLoading:n,refetch:o})=>{const r=I.useTheme(),{sources:s}=_(),{isThisPending:c}=L(),{setCurrentModal:d}=te(),{selectedSources:u,setSelectedSources:p}=Me(),{isAwaitingInstrumentation:m,sourcesToCreate:h,sourcesCreated:g,sourcesToDelete:y,sourcesDeleted:v}=Re(),f=Ce(t),x=t===B.Source&&m,$=(h?Math.floor(100/h*g):y?Math.floor(100/y*v):0)||1,[S,k]=l(()=>{let e=0;return Object.values(u).forEach(t=>e+=t.length),[0!==e,e]},[u]);return e.createElement(qa,null,t===B.Source&&e.createElement(Ha,{$marginLeft:"28px"},e.createElement(b,{partiallyChecked:S&&s?.length!==k,value:S&&s?.length===k,onChange:e=>{if(e){const e={};s?.forEach(t=>{const i={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:B.Source,entityId:i})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),p(e)}else p({})},disabled:!s?.length})),e.createElement(Ha,{$marginLeft:t===B.Source?"0":"28px"},e.createElement(ke,{icon:f,title:`${t}s`,badge:x?`${$}%`:i,badgeTooltip:a,loading:!1})),e.createElement(Ha,{$marginLeft:"auto"},e.createElement(za,{"data-id":`refresh-${t}`,variant:"secondary",onClick:o,disabled:n},n?e.createElement(Le,{scale:.8}):e.createElement(Di,{fill:r.colors.secondary,size:18})),e.createElement(za,{"data-id":`add-${t}`,variant:"primary",onClick:()=>d(t)},e.createElement(Ti,{fill:r.colors.primary,size:18}))),x&&e.createElement(Ba,{percent:$}))},_a=d.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 e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
101
101
|
align-items: center;
|
|
102
102
|
justify-content: center;
|
|
103
103
|
white-space: nowrap;
|
|
104
|
-
`,Ja=({entityId:t,entityType:i,status:a,faded:n,title:o,subTitle:l,tooltip:r,label:s,icon:c,icons:d,iconSrc:u,iconSrcs:p,monitors:m,isActive:h,raw:g})=>{const y=I.useTheme(),v=i===B.Source,b="boolean"==typeof h,{setDrawerType:f,setDrawerEntityId:x}=K(),{isThisPending:$}=L(),S=$({entityType:i,entityId:t}),{selectedSources:k,setSelectedSources:C}=Me(),w={...k},{namespace:T,name:D,kind:N}=g;v&&!w[T]&&(w[T]=[]);const E=v?w[T].findIndex(e=>e.name===D&&e.kind===N):-1;return e.createElement(
|
|
104
|
+
`,Ja=({entityId:t,entityType:i,status:a,faded:n,title:o,subTitle:l,tooltip:r,label:s,icon:c,icons:d,iconSrc:u,iconSrcs:p,monitors:m,isActive:h,raw:g})=>{const y=I.useTheme(),v=i===B.Source,b="boolean"==typeof h,{setDrawerType:f,setDrawerEntityId:x}=K(),{isThisPending:$}=L(),S=$({entityType:i,entityId:t}),{selectedSources:k,setSelectedSources:C}=Me(),w={...k},{namespace:T,name:D,kind:N}=g;v&&!w[T]&&(w[T]=[]);const E=v?w[T].findIndex(e=>e.name===D&&e.kind===N):-1;return e.createElement(Pe,{"data-id":i===B.Source?`${t.namespace}-${t.name}-${t.kind}`:t,title:o,subTitle:l,onClick:()=>{f(i),x(t)},renderActions:()=>{const t=v&&(!g.conditions?.length||g.conditions?.some(({status:e})=>"loading"===e)),i=b&&!h?ge(W.Info,y):a?ge(a,y):void 0,n=S||t?e.createElement(Le,{scale:.8}):i?e.createElement(i,{size:14}):null;return s?e.createElement(_a,{$isError:a===W.Error},e.createElement(me,{text:r||"Heads up! The data-flow metrics you see are calculated over 10-second intervals."},s),n):n||null},iconProps:{icon:c,icons:d,iconSrc:u,iconSrcs:p},visualProps:{status:a,faded:n||b&&!h,monitors:m||void 0},checkboxProps:{withCheckbox:v,isChecked:-1!==E,onCheckboxChange:()=>{-1===E?w[T].push(g):w[T].splice(E,1),C(w)},isCheckboxDisabled:S}})},Ua=d.div`
|
|
105
105
|
height: calc(${({$height:e})=>e}px - 24px);
|
|
106
106
|
width: calc(100% - 24px);
|
|
107
107
|
padding: 12px;
|
|
@@ -130,14 +130,14 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
130
130
|
display: flex;
|
|
131
131
|
flex-direction: column;
|
|
132
132
|
gap: 12px;
|
|
133
|
-
`,Za=({entityType:t,entities:i,unfilteredCount:a,metrics:n,loading:o,maxHeight:l,isVm:r})=>{const
|
|
133
|
+
`,Za=({entityType:t,entities:i,unfilteredCount:a,metrics:n,loading:o,maxHeight:l,isVm:r,refetch:s})=>{const c=i.length!==a,d=Math.min(l,80*i.length+12);return r&&[B.InstrumentationRule,B.Action].includes(t)?null:e.createElement(Xa,{$isVm:r},e.createElement(Wa,{entityType:t,badge:c?`${i.length}/${a}`:a,badgeTooltip:c?m.FILTERED_COUNT_TOOLTIP:void 0,isLoading:o,refetch:s}),i.length?e.createElement(Ya,{height:d,entityType:t,entities:i,metrics:n,isVm:r}):o?e.createElement(We,{size:3}):e.createElement(Va,{entityType:t,description:m.TO_COLLECT_OTEL_DATA}))},Qa=d.div`
|
|
134
134
|
width: 100%;
|
|
135
135
|
height: ${({$height:e})=>e};
|
|
136
136
|
|
|
137
137
|
display: flex;
|
|
138
138
|
justify-content: space-evenly;
|
|
139
139
|
gap: 24px;
|
|
140
|
-
`,en=({height:a,metrics:n})=>{const{isVm:
|
|
140
|
+
`,en=({height:a,metrics:n,refetchSources:o,refetchDestinations:l,refetchActions:r,refetchInstrumentationRules:s})=>{const{isVm:c}=_e(),d=ye(),{selectedStreamName:u}=Je(),{containerRef:p,containerHeight:m}=Ue(),{sources:h,sourcesLoading:g,destinations:y,destinationsLoading:v,actions:b,actionsLoading:f,instrumentationRules:x,instrumentationRulesLoading:$}=_(),[S,k]=t([]),[C,w]=t([]),[T,D]=t([]),[N,E]=t([]);return i(()=>{k(Ge(Ye(h,u),d))},[h,u,d]),i(()=>{w(Xe(Ze(y,u),d))},[y,u,d]),i(()=>{D(ve(b,d))},[b,d]),i(()=>{E(x)},[x]),e.createElement(Qa,{ref:p,$height:a},e.createElement(Za,{entityType:B.InstrumentationRule,entities:N,unfilteredCount:x.length,loading:$,maxHeight:m,isVm:c,refetch:s}),e.createElement(Za,{entityType:B.Source,entities:S,unfilteredCount:h.length,metrics:n,loading:g,maxHeight:m,isVm:c,refetch:o}),e.createElement(Za,{entityType:B.Action,entities:T,unfilteredCount:b.length,loading:f,maxHeight:m,isVm:c,refetch:r}),e.createElement(Za,{entityType:B.Destination,entities:C,unfilteredCount:y.length,metrics:n,loading:v,maxHeight:m,isVm:c,refetch:l}))},tn=d.div`
|
|
141
141
|
position: relative;
|
|
142
142
|
max-width: 200px;
|
|
143
143
|
`;d.div`
|
|
@@ -155,7 +155,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
155
155
|
display: flex;
|
|
156
156
|
align-items: center;
|
|
157
157
|
overflow-x: scroll;
|
|
158
|
-
`,nn=({onClose:a})=>{const n=I.useTheme(),{onClickNode:o}=Qe(),{searchText:s}=ye(),{selectedStreamName:c}=Je(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=_(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=et();i(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:$,searchResults:S}=l(()=>Oa({instrumentationRules:m,sources:Ye(d,c),actions:p,destinations:Ze(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return S.length?e.createElement(tt,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(an,null,$.map(({category:t,label:i,count:a})=>!!a&&e.createElement(it,{key:`category-select-${t}`,label:i,badgeLabel:a,isSelected:f===t,onClick:()=>x(t)})))},S.map(({category:t,label:i,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(at,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(E,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},i),l.map((i,n)=>e.createElement(it,{key:`entity-${s}-${n}`,icon:Ce(t),label:fe(i,t,{extended:!0}),onClick:()=>{const e=U(i);o(null,{data:{type:t,id:e}}),a()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(se,{thickness:s===S.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(tt,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(Ne,null))},on=({preventPopup:i=!1})=>{const{searchText:a,setSearchText:o}=ye(),[l,r]=t(!1),s=!!a||l,c=()=>{o(""),r(!1)},d=n(null);return nt(d,c),j({key:"Escape",active:s},c),e.createElement(tn,{ref:d},e.createElement($,{placeholder:"Search",icon:
|
|
158
|
+
`,nn=({onClose:a})=>{const n=I.useTheme(),{onClickNode:o}=Qe(),{searchText:s}=ye(),{selectedStreamName:c}=Je(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=_(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=et();i(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:$,searchResults:S}=l(()=>Oa({instrumentationRules:m,sources:Ye(d,c),actions:p,destinations:Ze(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return S.length?e.createElement(tt,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(an,null,$.map(({category:t,label:i,count:a})=>!!a&&e.createElement(it,{key:`category-select-${t}`,label:i,badgeLabel:a,isSelected:f===t,onClick:()=>x(t)})))},S.map(({category:t,label:i,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(at,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(E,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},i),l.map((i,n)=>e.createElement(it,{key:`entity-${s}-${n}`,icon:Ce(t),label:fe(i,t,{extended:!0}),onClick:()=>{const e=U(i);o(null,{data:{type:t,id:e}}),a()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(se,{thickness:s===S.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(tt,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(Ne,null))},on=({preventPopup:i=!1})=>{const{searchText:a,setSearchText:o}=ye(),[l,r]=t(!1),s=!!a||l,c=()=>{o(""),r(!1)},d=n(null);return nt(d,c),j({key:"Escape",active:s},c),e.createElement(tn,{ref:d},e.createElement($,{placeholder:"Search",icon:Ni,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!i?e.createElement(nn,{onClose:c}):null)},ln=({sources:t,title:i="Condition",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:i})=>{e.find(e=>e.id===`${t}#${i}`)||e.push({id:`${t}#${i}`,value:`${ot(t)} - ${ot(i)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},rn=({sources:t,title:i="Error Message",value:a,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{pe(t||[]).forEach(({status:t,message:i,reason:a})=>{t!==W.Error||e.find(e=>e.id===i)||(i?e.find(e=>e.id===i)||e.push({id:i,value:i}):a&&(e.find(e=>e.id===a)||e.push({id:a,value:a})))})}),e},[t]);return e.createElement(lt,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:a,onSelect:n,onDeselect:o,...s})},sn=({sources:t,title:i="Programming Language",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({containers:t})=>{t?.forEach(({language:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:rt[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},cn=({title:t="Monitors",value:i,onSelect:a,onDeselect:n,...o})=>{const r=l(()=>{const e=[];return st.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return e.createElement(lt,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:i,onSelect:a,onDeselect:n,...o})},dn=({namespaces:t,title:i="Namespace",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t?.forEach(({name:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"Select namespace",options:s,value:a,onSelect:n,onDeselect:o,...r})},un=({sources:t,title:i="Kind",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({kind:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(lt,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},pn=({sources:t,title:i="Agent Injection Status",value:a,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({podsAgentInjectionStatus:t})=>{const{status:i,message:a}=t||{};a&&!e.find(e=>e.id===a)&&e.push({id:a,value:`${i} - ${a}`})}),e},[t]);return e.createElement(lt,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:a,onSelect:n,onDeselect:o,...s})},mn=d.div`
|
|
159
159
|
display: flex;
|
|
160
160
|
flex-direction: column;
|
|
161
161
|
gap: 12px;
|
|
@@ -167,7 +167,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
167
167
|
${({$color:e})=>`color: ${e};`}
|
|
168
168
|
`,yn=d.div`
|
|
169
169
|
margin-left: auto;
|
|
170
|
-
`,vn=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},bn=()=>{const a=I.useTheme(),{isVm:o}=_e(),{namespaces:r,sources:s}=_(),{selectedStreamName:c}=Je(),{getItemSS:d,setItemSS:u,removeItemSS:p}=dt(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=et(),{namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C,podsAgentInjectionStatus:T,setAll:D,clearAll:N,getEmptyState:E}=ye(),O=l(()=>Ye(s,c),[s,c]),[A,F]=t({namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C,podsAgentInjectionStatus:T}),[M,R]=t(vn(A));i(()=>{const e=d(ct.OVERVIEW_FILTERS,E());D(e)},[]),i(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C};F(e),R(vn(e))}},[h,b,f,x,$,S,k,C]);const L=()=>{g(!1)},P=n(null);return nt(P,L),j({key:"Escape",active:h},L),e.createElement(tn,{ref:P},e.createElement(it,{label:"Filters",icon:
|
|
170
|
+
`,vn=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},bn=()=>{const a=I.useTheme(),{isVm:o}=_e(),{namespaces:r,sources:s}=_(),{selectedStreamName:c}=Je(),{getItemSS:d,setItemSS:u,removeItemSS:p}=dt(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=et(),{namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C,podsAgentInjectionStatus:T,setAll:D,clearAll:N,getEmptyState:E}=ye(),O=l(()=>Ye(s,c),[s,c]),[A,F]=t({namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C,podsAgentInjectionStatus:T}),[M,R]=t(vn(A));i(()=>{const e=d(ct.OVERVIEW_FILTERS,E());D(e)},[]),i(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:$,conditions:S,errors:k,onlyErrors:C};F(e),R(vn(e))}},[h,b,f,x,$,S,k,C]);const L=()=>{g(!1)},P=n(null);return nt(P,L),j({key:"Escape",active:h},L),e.createElement(tn,{ref:P},e.createElement(it,{label:"Filters",icon:Ei,badgeLabel:M,badgeFilled:!!M,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(tt,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(ue,null,e.createElement(gn,{variant:"primary",onClick:()=>{u(ct.OVERVIEW_FILTERS,A),D(A),R(vn(A)),g(!1)}},"Apply"),e.createElement(gn,{variant:"secondary",onClick:L},"Cancel"),e.createElement(yn,null,e.createElement(gn,{variant:"tertiary",onClick:()=>{p(ct.OVERVIEW_FILTERS),N(),F(E()),R(0),g(!1)},$color:a.text.error},"Reset")))},e.createElement(mn,null,!o&&e.createElement(dn,{namespaces:r,value:A.namespaces,onSelect:e=>F(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>F(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(un,{sources:O,value:A.kinds,onSelect:e=>F(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>F(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(sn,{sources:O,value:A.languages,onSelect:e=>F(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>F(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(cn,{value:A.monitors,onSelect:e=>F(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>F(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ln,{sources:O,value:A.conditions,onSelect:e=>F(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>F(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(pn,{sources:O,value:A.podsAgentInjectionStatus,onSelect:e=>F(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>F(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(hn,null,e.createElement(w,{title:"Show only sources with errors",initialValue:A.onlyErrors,onChange:e=>F(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(rn,{sources:O,value:A.errors,onSelect:e=>F(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>F(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!A.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},fn=d.div`
|
|
171
171
|
display: flex;
|
|
172
172
|
flex-direction: column;
|
|
173
173
|
gap: 24px;
|
|
@@ -178,7 +178,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
178
178
|
max-height: calc(100vh - 220px);
|
|
179
179
|
overflow: overlay;
|
|
180
180
|
overflow-y: auto;
|
|
181
|
-
`,Sn=({isOpen:i,onClose:a,dataStreamName:o,updateDataStream:r})=>{const{dataStreams:c}=Je(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ut({name:o}),f=l(()=>{if(!i)return v();const e=c?.find(e=>e.name===o);return e?b(e):v(),e},[i,c,o]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement($a,{ref:d,title:f.name,icons:[
|
|
181
|
+
`,Sn=({isOpen:i,onClose:a,dataStreamName:o,updateDataStream:r})=>{const{dataStreams:c}=Je(),d=n(null),[u,p]=t(!1),{formData:m,handleFormChange:h,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ut({name:o}),f=l(()=>{if(!i)return v();const e=c?.find(e=>e.name===o);return e?b(e):v(),e},[i,c,o]),x=s((e,t)=>{h(e,t),p(!0)},[h]);return f?e.createElement($a,{ref:d,title:f.name,icons:[Ii],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(r(o,m),p(!1),a())},onCancel:()=>{v(),p(!1),a()}},e.createElement($n,null,e.createElement(xn,{formData:m,handleFormChange:x,formErrors:g}))):null},kn=d.div`
|
|
182
182
|
position: relative;
|
|
183
183
|
`,Cn=d(ue)`
|
|
184
184
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
@@ -196,7 +196,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
196
196
|
width: 100%;
|
|
197
197
|
`,Nn=d.div`
|
|
198
198
|
width: 100%;
|
|
199
|
-
`,En=({onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n})=>{const o=I.useTheme(),{clearStore:r}=pt(),{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=et(),{dataStreams:m,selectedStreamName:h,setSelectedStreamName:g}=Je(),[y,v]=t(""),[b,f]=t(""),[x,S]=t(""),k=l(()=>m.filter(({name:e})=>!x||e.toLowerCase().includes(x.toLowerCase())).map(({name:t})=>e.createElement(Dn,{key:`stream-${t}`},e.createElement(Nn,null,e.createElement(it,{label:t,isSelected:h===t,onClick:()=>{r(),g(t),d(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==mt&&e.createElement(ht,{onClick:()=>f(t),tooltip:V.DELETE},e.createElement(Ci,null)),e.createElement(ht,{onClick:()=>v(t),tooltip:V.EDIT},e.createElement(ki,null)))),[m,h,x]);return e.createElement(e.Fragment,null,e.createElement(kn,null,e.createElement(Cn,{$gap:0},e.createElement(Fe,{variant:"tertiary",onClick:()=>{p(0,50),d(e=>!e)}},e.createElement(
|
|
199
|
+
`,En=({onClickNewDataStream:i,updateDataStream:a,deleteDataStream:n})=>{const o=I.useTheme(),{clearStore:r}=pt(),{popupRef:s,popupOpen:c,setPopupOpen:d,popupPosition:u,handlePosition:p}=et(),{dataStreams:m,selectedStreamName:h,setSelectedStreamName:g}=Je(),[y,v]=t(""),[b,f]=t(""),[x,S]=t(""),k=l(()=>m.filter(({name:e})=>!x||e.toLowerCase().includes(x.toLowerCase())).map(({name:t})=>e.createElement(Dn,{key:`stream-${t}`},e.createElement(Nn,null,e.createElement(it,{label:t,isSelected:h===t,onClick:()=>{r(),g(t),d(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==mt&&e.createElement(ht,{onClick:()=>f(t),tooltip:V.DELETE},e.createElement(Ci,null)),e.createElement(ht,{onClick:()=>v(t),tooltip:V.EDIT},e.createElement(ki,null)))),[m,h,x]);return e.createElement(e.Fragment,null,e.createElement(kn,null,e.createElement(Cn,{$gap:0},e.createElement(Fe,{variant:"tertiary",onClick:()=>{p(0,50),d(e=>!e)}},e.createElement(Ii,{fill:o.text.info}),e.createElement(wn,null,"Data Stream: ",h),e.createElement(gt,{extend:c}),e.createElement(Ie,{label:m.length})),e.createElement(se,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(yt,{onClick:()=>{r(),i()},label:V.NEW})),e.createElement(tt,{ref:s,isOpen:c,top:u.top,left:u.left,header:e.createElement($,{placeholder:"Search...",icon:Ni,value:x,onChange:e=>S(e.target.value)})},e.createElement(Tn,null,k))),e.createElement(H,{isOpen:""!==b,name:b,onApprove:()=>{n(b),f("")},onDeny:()=>{f("")}}),e.createElement(Sn,{isOpen:""!==y,onClose:()=>{v("")},dataStreamName:y,updateDataStream:a}))},In=d.div`
|
|
200
200
|
display: flex;
|
|
201
201
|
align-items: center;
|
|
202
202
|
margin: 20px 0;
|
|
@@ -218,7 +218,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
218
218
|
`:u`
|
|
219
219
|
background-color: transparent;
|
|
220
220
|
`}
|
|
221
|
-
`,jn=({destination:i,validateForm:a,status:n,testConnection:o,onSuccess:l,onError:r})=>{const s=I.useTheme(),{selectedStreamName:c}=Je(),[d,u]=t(!1),p=n?ge(n,s):void 0;return e.createElement(Kn,{$status:n,variant:"secondary",onClick:async()=>{if(a()){u(!0);const e=await o({...i,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(
|
|
221
|
+
`,jn=({destination:i,validateForm:a,status:n,testConnection:o,onSuccess:l,onError:r})=>{const s=I.useTheme(),{selectedStreamName:c}=Je(),[d,u]=t(!1),p=n?ge(n,s):void 0;return e.createElement(Kn,{$status:n,variant:"secondary",onClick:async()=>{if(a()){u(!0);const e=await o({...i,currentStreamName:c});e&&(e.succeeded?l(e):r(e)),u(!1)}}},d?e.createElement(Le,null):p?e.createElement(p,null):null,e.createElement(E,{family:"secondary",decoration:"underline",size:14,color:n?s.text[n]:void 0},d?"Checking":n===W.Success?"Connection OK":"error"===n?"Connection Failed":"Test Connection"))},Vn=d(ee)`
|
|
222
222
|
align-items: unset;
|
|
223
223
|
padding: 0 4px;
|
|
224
224
|
`,qn=d.div`
|
|
@@ -243,7 +243,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
243
243
|
display: flex;
|
|
244
244
|
flex-direction: column;
|
|
245
245
|
gap: 12px;
|
|
246
|
-
`,Gn=({items:t,onSelectNew:i,onSelectConfigured:a,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:o}=pt();return t.map(t=>{const l=t.name===Tt.EXISTS.TITLE;return e.createElement(Un,{key:`category-${t.name}`},e.createElement(A,{size:"small",icon:t.icon,title:wt(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=He(r.type),p=r.selected||o.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>a(r.id):()=>i(r);return e.createElement(
|
|
246
|
+
`,Gn=({items:t,onSelectNew:i,onSelectConfigured:a,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:o}=pt();return t.map(t=>{const l=t.name===Tt.EXISTS.TITLE;return e.createElement(Un,{key:`category-${t.name}`},e.createElement(A,{size:"small",icon:t.icon,title:wt(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=He(r.type),p=r.selected||o.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>a(r.id):()=>i(r);return e.createElement(Pe,{key:s,"data-id":s,title:r.displayName,hoverText:V.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>a(r.id)}})}))})},Yn=d.div`
|
|
247
247
|
display: flex;
|
|
248
248
|
flex-direction: column;
|
|
249
249
|
gap: 24px;
|
|
@@ -267,7 +267,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
267
267
|
}
|
|
268
268
|
`,eo=d(Yn)`
|
|
269
269
|
margin-top: 80px;
|
|
270
|
-
`,{MANAGED:to,SELF_HOSTED:io,DETECTED:ao,EXISTS:no}=Tt,oo=[{value:"All types",id:"all"},{value:to.TITLE,id:to.TITLE},{value:io.TITLE,id:io.TITLE},{value:ao.TITLE,id:ao.TITLE},{value:no.TITLE,id:no.TITLE}],lo=oo[0],ro=[St.Logs,St.Metrics,St.Traces],so=(e,t,i)=>e.map(e=>{const{type:a,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=i.has(e.id);return{id:e.id,type:a,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[St.Logs]:{supported:e.exportedSignals.logs},[St.Metrics]:{supported:e.exportedSignals.metrics},[St.Traces]:{supported:e.exportedSignals.traces}}}}),co=({hidden:i,categories:a,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=Je(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=pt(),[m,h]=t(""),[g,y]=t(lo),[v,b]=t(ro),f=l(()=>{const e=Dt(a);return e.unshift({name:no.TITLE,description:no.DESCRIPTION,icon:
|
|
270
|
+
`,{MANAGED:to,SELF_HOSTED:io,DETECTED:ao,EXISTS:no}=Tt,oo=[{value:"All types",id:"all"},{value:to.TITLE,id:to.TITLE},{value:io.TITLE,id:io.TITLE},{value:ao.TITLE,id:ao.TITLE},{value:no.TITLE,id:no.TITLE}],lo=oo[0],ro=[St.Logs,St.Metrics,St.Traces],so=(e,t,i)=>e.map(e=>{const{type:a,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=i.has(e.id);return{id:e.id,type:a,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[St.Logs]:{supported:e.exportedSignals.logs},[St.Metrics]:{supported:e.exportedSignals.metrics},[St.Traces]:{supported:e.exportedSignals.traces}}}}),co=({hidden:i,categories:a,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=Je(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=pt(),[m,h]=t(""),[g,y]=t(lo),[v,b]=t(ro),f=l(()=>{const e=Dt(a);return e.unshift({name:no.TITLE,description:no.DESCRIPTION,icon:Oi,items:so(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:ao.TITLE,description:ao.DESCRIPTION,icon:Ai,items:n}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),a="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return i&&a&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,n,c,m,g,v,d,u,p]);return i?null:e.createElement(Yn,null,e.createElement(A,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Xn,null,e.createElement(Zn,null,e.createElement($,{placeholder:"Search...",icon:Ni,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Zn,null,e.createElement(lt,{options:oo,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(M,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(se,null),f.length?e.createElement(Qn,null,e.createElement(Gn,{items:f,onSelectNew:e=>o(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(eo,null,e.createElement(Ne,{title:"No destinations found"})))},uo=d.div`
|
|
271
271
|
display: flex;
|
|
272
272
|
`,po=d.div`
|
|
273
273
|
border-right: 1px solid ${({theme:e})=>e.colors.border};
|
|
@@ -276,7 +276,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
276
276
|
@media (max-width: 1050px) {
|
|
277
277
|
display: none;
|
|
278
278
|
}
|
|
279
|
-
`,mo=({isOnboarding:i,categories:a,potentialDestinations:n,createDestination:o,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=Je(),{currentModal:u,setCurrentModal:p}=te(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=pt(),b=u===B.Destination,[f,x]=t(void 0),{formData:$,formErrors:S,handleFormChange:k,resetFormData:C,validateForm:w,setYamlFields:T,dynamicFields:D,setDynamicFields:N,loadFormWithDrawerItem:E}=kt({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[I,O]=t([]),A=e=>{const t={};return e||D.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:f.type,displayName:f.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},F=async e=>{if(i&&!e){const e=A();h(e)}else if(i&&e){const t=A(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(i||e){if(!i&&e){const t=A(e),i=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),i?await r(e.id):await l(e.id,E(t)),O(t=>t.filter(t=>t!==e.id))}}else o($)},M=()=>{C(),x(void 0),p("")},R=()=>{C(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!i,alertTitle:Q.Create}))return null;F()}M()};return j({key:"Enter",active:b},()=>L()),e.createElement(ie,{isOpen:b,onClose:M,header:{title:m.ADD_DESTINATION},actionComponent:e.createElement(ae,{buttons:(()=>{const t=[{label:"DONE",variant:"primary",onClick:L}];return f&&t.unshift({label:"BACK",icon:()=>e.createElement(
|
|
279
|
+
`,mo=({isOnboarding:i,categories:a,potentialDestinations:n,createDestination:o,updateDestination:l,deleteDestination:r,testConnection:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=Je(),{currentModal:u,setCurrentModal:p}=te(),{addConfiguredDestination:h,addConfiguredDestinationUpdateOnly:g,removeConfiguredDestinationUpdateOnly:y,configuredDestinationsUpdateOnly:v}=pt(),b=u===B.Destination,[f,x]=t(void 0),{formData:$,formErrors:S,handleFormChange:k,resetFormData:C,validateForm:w,setYamlFields:T,dynamicFields:D,setDynamicFields:N,loadFormWithDrawerItem:E}=kt({supportedSignals:f?.supportedSignals,preLoadedFields:f?.fields}),[I,O]=t([]),A=e=>{const t={};return e||D.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:f.type,displayName:f.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},F=async e=>{if(i&&!e){const e=A();h(e)}else if(i&&e){const t=A(e);v.some(t=>t.id===e.id)?y(e):g(t)}else if(i||e){if(!i&&e){const t=A(e),i=t.dataStreamNames.some(e=>e===d);O(t=>[...t,e.id]),i?await r(e.id):await l(e.id,E(t)),O(t=>t.filter(t=>t!==e.id))}}else o($)},M=()=>{C(),x(void 0),p("")},R=()=>{C(),x(void 0)},L=async()=>{if(f){if(!w({withAlert:!i,alertTitle:Q.Create}))return null;F()}M()};return j({key:"Enter",active:b},()=>L()),e.createElement(ie,{isOpen:b,onClose:M,header:{title:m.ADD_DESTINATION},actionComponent:e.createElement(ae,{buttons:(()=>{const t=[{label:"DONE",variant:"primary",onClick:L}];return f&&t.unshift({label:"BACK",icon:()=>e.createElement(Fi,{rotate:-90}),variant:"secondary",onClick:R}),t})()})},e.createElement(uo,null,e.createElement(po,null,e.createElement(Nt,{currentStep:f?2:1,data:[{stepNumber:1,title:m.DESTINATIONS},{stepNumber:2,title:m.CONNECTION}]})),e.createElement(ne,{style:{margin:"32px 24px 12px 24px"}},e.createElement(co,{hidden:void 0!==f,categories:a,potentialDestinations:n,onSelectNew:(e,t)=>{C(),k("type",e?.type||""),k("currentStreamName",d);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[t].supported).forEach(e=>i[e]=!0),k("exportedSignals",i),T(e?.fields||[]),x(e)},onSelectConfigured:e=>{const t=c.find(t=>t.id===e);t&&F(t)},isLoadingForDestinationIds:I}),f&&e.createElement(Bn,{categoryItem:f,formData:$,formErrors:S,handleFormChange:k,dynamicFields:D,setDynamicFields:N,validateForm:w,testConnection:s}))))},ho=d.div`
|
|
280
280
|
display: flex;
|
|
281
281
|
flex-direction: column;
|
|
282
282
|
align-items: center;
|
|
@@ -285,7 +285,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
285
285
|
max-height: calc(100vh - 310px);
|
|
286
286
|
height: fit-content;
|
|
287
287
|
overflow-y: scroll;
|
|
288
|
-
`,go=({categories:t,withDelete:i})=>{const{configuredDestinations:a,configuredDestinationsUpdateOnly:n}=pt();return a.length||n.length?e.createElement(ho,null,a.concat(n).map((o,l)=>e.createElement(yo,{key:`configured-destination-${o.destinationType.type}-${l}`,"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:Ct(t,o),isLastItem:a.length+n.length===1,withDelete:i}))):e.createElement(De,null,e.createElement(Ne,{title:"No destinations",subTitle:"Please add a destination"}))},yo=({item:i,yamlFields:a,isLastItem:n,withDelete:o})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=He(i.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=pt(),m=l(()=>ft(i,a).map(e=>({title:e.name,value:e.value})),[i,a]);return e.createElement(e.Fragment,null,e.createElement(
|
|
288
|
+
`,go=({categories:t,withDelete:i})=>{const{configuredDestinations:a,configuredDestinationsUpdateOnly:n}=pt();return a.length||n.length?e.createElement(ho,null,a.concat(n).map((o,l)=>e.createElement(yo,{key:`configured-destination-${o.destinationType.type}-${l}`,"data-id":`configured-destination-${o.destinationType.type}`,item:o,yamlFields:Ct(t,o),isLastItem:a.length+n.length===1,withDelete:i}))):e.createElement(De,null,e.createElement(Ne,{title:"No destinations",subTitle:"Please add a destination"}))},yo=({item:i,yamlFields:a,isLastItem:n,withDelete:o})=>{const[r,s]=t(!1),{icon:c,iconSrc:d}=He(i.destinationType.type),{removeConfiguredDestination:u,removeConfiguredDestinationUpdateOnly:p}=pt(),m=l(()=>ft(i,a).map(e=>({title:e.name,value:e.value})),[i,a]);return e.createElement(e.Fragment,null,e.createElement(Pe,{title:i.name||i.destinationType.displayName,subTitle:i.destinationType.type,iconProps:{icon:c,iconSrc:d},visualProps:{monitors:Ke(i.exportedSignals),monitorsWithLabels:!0},extendableProps:{withExtend:!0,renderExtended:()=>e.createElement(Et,{data:m})},renderActions:o?()=>e.createElement(ht,{onClick:()=>s(!0)},e.createElement(Ci,null)):void 0}),o&&e.createElement(H,{isOpen:r,name:i.destinationType.displayName||i.name,type:B.Destination,isLastItem:n,onApprove:()=>{i.id?p(i):u(i)},onDeny:()=>s(!1)}))},vo=d(Fe)`
|
|
289
289
|
display: flex;
|
|
290
290
|
align-items: center;
|
|
291
291
|
justify-content: center;
|
|
@@ -348,7 +348,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
348
348
|
border: 1px solid ${({theme:e})=>e.colors.border};
|
|
349
349
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
350
350
|
animation-name: ${I.animations.slide.in.center};
|
|
351
|
-
`,Bo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:n})=>{const o=I.useTheme(),{selectedSources:s,setSelectedSources:c}=Me(),[d,u]=t(!1),p=l(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),m=()=>{c({})};return p?e.createElement(r,null,e.createElement(zo,{"data-id":"multi-source-control"},e.createElement(E,null,"Selected sources"),e.createElement(Ie,{label:p,filled:!0}),e.createElement(se,{orientation:"vertical",length:"16px"}),e.createElement(Fe,{variant:"tertiary",onClick:m},e.createElement(E,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Fe,{variant:"tertiary",onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>Ht(e)))}),n(e),m()}},e.createElement(
|
|
351
|
+
`,Bo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:n})=>{const o=I.useTheme(),{selectedSources:s,setSelectedSources:c}=Me(),[d,u]=t(!1),p=l(()=>{let e=0;return Object.values(s).forEach(t=>{e+=t.length}),e},[s]),m=()=>{c({})};return p?e.createElement(r,null,e.createElement(zo,{"data-id":"multi-source-control"},e.createElement(E,null,"Selected sources"),e.createElement(Ie,{label:p,filled:!0}),e.createElement(se,{orientation:"vertical",length:"16px"}),e.createElement(Fe,{variant:"tertiary",onClick:m},e.createElement(E,{family:"secondary",decoration:"underline"},"Deselect")),e.createElement(Fe,{variant:"tertiary",onClick:()=>{const e=[];Object.values(s).forEach(t=>{e.push(...t.map(e=>Ht(e)))}),n(e),m()}},e.createElement(Mi,null),e.createElement(E,{family:"secondary",decoration:"underline"},"Restart")),e.createElement(Fe,{variant:"tertiary",onClick:()=>u(!0)},e.createElement(Ci,null),e.createElement(E,{family:"secondary",decoration:"underline",color:o.text.error},"Uninstrument"))),e.createElement(H,{isOpen:d,name:`${p} sources`,type:B.Source,isLastItem:p===i,onApprove:()=>{const e={};Object.entries(s).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),a(e),u(!1),m()},onDeny:()=>u(!1)})):null},Wo=d.div`
|
|
352
352
|
position: relative;
|
|
353
353
|
width: fit-content;
|
|
354
354
|
`,_o=d(ue)`
|
|
@@ -373,7 +373,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
373
373
|
border-radius: 32px;
|
|
374
374
|
width: fit-content;
|
|
375
375
|
padding: 2px 8px;
|
|
376
|
-
`,Yo=()=>{const t=I.useTheme(),{notifications:i,markAsSeen:a}=P(),n=i.filter(({hideFromHistory:e})=>!e),o=n.filter(({seen:e})=>!e),l=o.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=et({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>a(e))}});return e.createElement(Wo,null,e.createElement(ht,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(
|
|
376
|
+
`,Yo=()=>{const t=I.useTheme(),{notifications:i,markAsSeen:a}=P(),n=i.filter(({hideFromHistory:e})=>!e),o=n.filter(({seen:e})=>!e),l=o.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=et({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>a(e))}});return e.createElement(Wo,null,e.createElement(ht,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Ri,{size:18})),e.createElement(tt,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(_o,null,e.createElement(E,{size:20},"Notifications"),!!l&&e.createElement(Go,{size:12,family:"secondary"},l," new"))},e.createElement(Jo,null,n.length?n.map(t=>e.createElement(il,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(Ne,{title:"No notifications",subTitle:""})),e.createElement(Uo,null)))},Xo=d.div`
|
|
377
377
|
display: flex;
|
|
378
378
|
align-items: flex-start;
|
|
379
379
|
gap: 12px;
|
|
@@ -403,7 +403,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
403
403
|
display: flex;
|
|
404
404
|
align-items: center;
|
|
405
405
|
gap: 6px;
|
|
406
|
-
`,il=({id:t,seen:i,type:a,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=I.useTheme(),{formatTimeAgo:u}=zt(),{onClickNotification:p}=Bt(),m=!!r&&!!s,h=n?.toLowerCase().includes(Q.Delete.toLowerCase())||!1,g=ge(a,d);return e.createElement(Xo,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Zo,{$type:h?W.Error:a},h?e.createElement(Ci,null):e.createElement(g,null)),e.createElement(Qo,null,e.createElement(el,null,e.createElement(E,{size:14},o)),e.createElement(tl,null,e.createElement(E,{size:10,color:d.text.grey},u(l)),!i&&e.createElement(e.Fragment,null,e.createElement(E,{size:10},"·"),e.createElement(E,{size:10,color:d.colors.orange_soft},"new")))))},al=(e,t,i)=>{const a=e?.serviceName||t?.otelServiceName||t?.name,n=i?[
|
|
406
|
+
`,il=({id:t,seen:i,type:a,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=I.useTheme(),{formatTimeAgo:u}=zt(),{onClickNotification:p}=Bt(),m=!!r&&!!s,h=n?.toLowerCase().includes(Q.Delete.toLowerCase())||!1,g=ge(a,d);return e.createElement(Xo,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Zo,{$type:h?W.Error:a},h?e.createElement(Ci,null):e.createElement(g,null)),e.createElement(Qo,null,e.createElement(el,null,e.createElement(E,{size:14},o)),e.createElement(tl,null,e.createElement(E,{size:10,color:d.text.grey},u(l)),!i&&e.createElement(e.Fragment,null,e.createElement(E,{size:10},"·"),e.createElement(E,{size:10,color:d.colors.orange_soft},"new")))))},al=(e,t,i)=>{const a=e?.serviceName||t?.otelServiceName||t?.name,n=i?[Li]:ze(t?.containers||[]),{priorotizedStatus:o}=ce(t?.conditions||[]);return{id:a,title:a,icons:n.length?n:[Pi],status:o,serviceMapEntry:e}},nl=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,ol=d.div`
|
|
407
407
|
width: 100%;
|
|
408
408
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
409
409
|
position: relative;
|
|
@@ -453,7 +453,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
453
453
|
align-items: center;
|
|
454
454
|
justify-content: flex-end;
|
|
455
455
|
text-align: right;
|
|
456
|
-
`,yl=Ce(B.Namespace),vl=({isModal:t=!1,withInstances:i=!0,fetchingNamespace:a,fetchedNamespaces:n,filteredNamespacesAndSources:o,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=I.useTheme(),{isVm:h}=_e(),{namespacesLoading:g}=_(),y=Object.entries(o||{});return y?.length?e.createElement(sl,{$isModal:t},y.map(([t,o])=>{const y=s?.[t]||[],v=d?.[t]?.selected||!1,f=y.filter(({selected:e})=>e),x=y.length>0,$=l===t,S=f.length>0&&f.length===o.length,k=f.length>0&&f.length!==o.length,C=o.length>0,T=1===o.length;return r||C?e.createElement(cl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:S,$isOpen:$},e.createElement(dl,{$selected:S,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ue,{$gap:12},r&&e.createElement(b,{partiallyChecked:k,value:S,onChange:e=>r(t,e)}),e.createElement(yl,null),e.createElement(E,null,t)),e.createElement(ue,{$gap:24},!h&&u&&e.createElement(w,{title:m.FUTURE_APPS_TITLE,tooltip:m.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(gl,{$width:108},a!==t||n?.includes(t)?null:e.createElement(Ae,{size:10},"Retrieving workloads...")),e.createElement(gl,null,e.createElement(E,{size:10,color:p.text.grey},x?`${f.length}/${o.length}`:null)),r&&e.createElement(gt,{extend:$}))),($||!r)&&(C?e.createElement(pl,{$addPadding:!c},e.createElement(ml,null,e.createElement(se,{orientation:"vertical",length:(T?24:34*o.length)+"px"})),o.map(a=>{const n=f.some(({name:e})=>e===a.name);return e.createElement(bl,{key:`source-${a.name}`,withInstances:i,source:a,namespace:t,isSelected:n,onSelect:c})})):e.createElement(hl,{$addPadding:!c},g||a===t&&!n?.includes(t)?e.createElement(
|
|
456
|
+
`,yl=Ce(B.Namespace),vl=({isModal:t=!1,withInstances:i=!0,fetchingNamespace:a,fetchedNamespaces:n,filteredNamespacesAndSources:o,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const p=I.useTheme(),{isVm:h}=_e(),{namespacesLoading:g}=_(),y=Object.entries(o||{});return y?.length?e.createElement(sl,{$isModal:t},y.map(([t,o])=>{const y=s?.[t]||[],v=d?.[t]?.selected||!1,f=y.filter(({selected:e})=>e),x=y.length>0,$=l===t,S=f.length>0&&f.length===o.length,k=f.length>0&&f.length!==o.length,C=o.length>0,T=1===o.length;return r||C?e.createElement(cl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:S,$isOpen:$},e.createElement(dl,{$selected:S,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ue,{$gap:12},r&&e.createElement(b,{partiallyChecked:k,value:S,onChange:e=>r(t,e)}),e.createElement(yl,null),e.createElement(E,null,t)),e.createElement(ue,{$gap:24},!h&&u&&e.createElement(w,{title:m.FUTURE_APPS_TITLE,tooltip:m.FUTURE_APPS_DESCRIPTION,initialValue:v,onChange:e=>u(e,t),flipHorizontally:!0}),e.createElement(gl,{$width:108},a!==t||n?.includes(t)?null:e.createElement(Ae,{size:10},"Retrieving workloads...")),e.createElement(gl,null,e.createElement(E,{size:10,color:p.text.grey},x?`${f.length}/${o.length}`:null)),r&&e.createElement(gt,{extend:$}))),($||!r)&&(C?e.createElement(pl,{$addPadding:!c},e.createElement(ml,null,e.createElement(se,{orientation:"vertical",length:(T?24:34*o.length)+"px"})),o.map(a=>{const n=f.some(({name:e})=>e===a.name);return e.createElement(bl,{key:`source-${a.name}`,withInstances:i,source:a,namespace:t,isSelected:n,onSelect:c})})):e.createElement(hl,{$addPadding:!c},g||a===t&&!n?.includes(t)?e.createElement(Le,null):e.createElement(Ne,{title:m.NO_SOURCES_NAMESPACE,subTitle:m.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null})):e.createElement(De,null,g||a?e.createElement(Le,null):e.createElement(Ne,{title:m.NO_SOURCES,subTitle:!h&&r?m.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:m.PLEASE_ADD_SOURCE}))},bl=({withInstances:t,source:i,namespace:a,isSelected:n,onSelect:o})=>e.createElement(ul,{"data-id":`source-${i.name}`,$selected:n,$withClick:!!o,onClick:()=>o?.(i)},e.createElement(ue,{$gap:12},o&&e.createElement(b,{value:n,onChange:()=>o(i,a)}),e.createElement(ue,{$gap:4},e.createElement(E,null,i.name),e.createElement(E,{opacity:.8,size:10},t?` • ${i.numberOfInstances||0} running instance${1!==i.numberOfInstances?"s":""}`:"",` • ${i.kind}`)))),fl=d.div`
|
|
457
457
|
display: flex;
|
|
458
458
|
flex-direction: column;
|
|
459
459
|
align-items: center;
|
|
@@ -462,16 +462,16 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
462
462
|
max-height: calc(100vh - 200px);
|
|
463
463
|
height: fit-content;
|
|
464
464
|
overflow-y: scroll;
|
|
465
|
-
`,xl=({onEditStream:t,onEditSources:i,onEditDestinations:a,categories:n})=>{const{selectedStreamName:o}=Je(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=pt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(ne,{$isNotModal:!0},e.createElement(ee,{$gap:12},e.createElement(A,{title:m.SUMMARY,description:m.STREAM_CONFIRM}),e.createElement(fl,null,e.createElement(Z,{title:m.STREAM_NAME,action:()=>e.createElement(Jt,{onClick:t}),data:[{title:"",value:o}]}),e.createElement(Z,{title:m.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Jt,{onClick:i})},e.createElement(vl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Z,{title:m.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Jt,{onClick:a})},e.createElement(go,{categories:n})))))};var $l;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}($l||($l={}));const Sl=({onClickId:i,defaultSelectedId:a,extendedNavIcons:n})=>{const{isVm:o}=_e(),[r,s]=t(a||""),c=l(()=>[{id:$l.Overview,icon:
|
|
465
|
+
`,xl=({onEditStream:t,onEditSources:i,onEditDestinations:a,categories:n})=>{const{selectedStreamName:o}=Je(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=pt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(ne,{$isNotModal:!0},e.createElement(ee,{$gap:12},e.createElement(A,{title:m.SUMMARY,description:m.STREAM_CONFIRM}),e.createElement(fl,null,e.createElement(Z,{title:m.STREAM_NAME,action:()=>e.createElement(Jt,{onClick:t}),data:[{title:"",value:o}]}),e.createElement(Z,{title:m.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(Jt,{onClick:i})},e.createElement(vl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Z,{title:m.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(Jt,{onClick:a})},e.createElement(go,{categories:n})))))};var $l;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}($l||($l={}));const Sl=({onClickId:i,defaultSelectedId:a,extendedNavIcons:n})=>{const{isVm:o}=_e(),[r,s]=t(a||""),c=l(()=>[{id:$l.Overview,icon:Ki,selected:r===$l.Overview,onClick:()=>{s($l.Overview),i($l.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:$l.Sources,icon:qi,selected:r===$l.Sources,onClick:()=>{s($l.Sources),i($l.Sources)},tooltip:"Sources"},{id:$l.Destinations,icon:Hi,selected:r===$l.Destinations,onClick:()=>{s($l.Destinations),i($l.Destinations)},tooltip:"Destinations"}];return o||(e.push({id:$l.InstrumentationRules,icon:ji,selected:r===$l.InstrumentationRules,onClick:()=>{s($l.InstrumentationRules),i($l.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:$l.Actions,icon:Vi,selected:r===$l.Actions,onClick:()=>{s($l.Actions),i($l.Actions)},tooltip:"Actions"})),e},[o,r]);return e.createElement(Ut,{orientation:"vertical",mainIcons:c,subIcons:d})},kl=({})=>e.createElement(ht,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(zi,null)),Cl=(e,t)=>{const{name:i,kind:a,namespace:n}=e,o=[{title:m.KIND,value:a},{title:m.NAME,value:i,tooltip:"Resource name"}];return t||(o.unshift({title:m.NAMESPACE,value:n}),o.push({type:h.Divider}),o.push({type:h.CopyText,value:`kubectl get ${a} ${i} -n ${n}`.toLowerCase()})),o},wl=d.div`
|
|
466
466
|
display: flex;
|
|
467
467
|
flex-direction: column;
|
|
468
468
|
gap: 24px;
|
|
469
469
|
padding: 4px;
|
|
470
|
-
`,Tl=({formData:t,handleFormChange:i})=>e.createElement(wl,null,e.createElement($,{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:t.otelServiceName,onChange:({target:{value:e}})=>i("otelServiceName",e)})),Dl=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const i=Gt(t?.status),a=ot(t?.reasonEnum),n=t?.message;return e.createElement(ue,{$alignItems:"center",$justifyContent:"center"},e.createElement(de,{status:i,title:a,subtitle:n,withBackground:i!==he.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Nl=({source:a,fetchSourceDescribe:n,restartPod:o})=>{const[l,r]=t(!1),[s,d]=t(null);return i(()=>{a&&n({namespace:a.namespace,name:a.name,kind:a.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):r(!0)})},[a.namespace,a.name,a.kind]),s||l?e.createElement(ee,{$gap:12},l?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch describe for this source"})):s?.pods?.length?s.pods.map(({podName:t,nodeName:i,phase:n,agentInjected:l,runningLatestWorkloadRevision:r,containers:d,manifestYAML:u})=>{const p=n.status!==W.Success||Yt(d)?W.Error:W.Success,m=[];return m.push(e.createElement(Xt,{key:"copy-text",value:`kubectl get pod ${t.value} -n ${s?.namespace?.value||a.namespace}`.toLowerCase()})),m.push(e.createElement(se,{key:"divider-1",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-1",title:i.name,tooltip:i.explain||"",value:{status:i.status||void 0,text:i.value}})),m.push(e.createElement(se,{key:"divider-2",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-2",title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),m.push(e.createElement(se,{key:"divider-3",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-3",title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}})),m.push(e.createElement(se,{key:"divider-4",length:"100%",margin:"0"})),r?.name&&(m.push(e.createElement(Zt,{key:"describe-row-4",title:r.name,tooltip:r.explain||void 0,value:{status:r.status||void 0,text:r.value}})),m.push(e.createElement(se,{key:"divider-5",length:"100%",margin:"0"}))),d.forEach(t=>{m.push(e.createElement(Qt,{key:`pod-container-${t.containerName.value}`,...t}))}),u&&(m.push(e.createElement(se,{key:"divider-6",length:"100%",margin:"0"})),m.push(e.createElement(Zi,{key:"yaml-section-card",yaml:u}))),e.createElement(Z,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:({hovered:i})=>e.createElement("div",{style:{position:"relative"}},e.createElement(de,{key:"status",status:p,title:p,withIcon:!0,withBorder:!0}),i&&e.createElement(ei,{key:"hover-actions",isOpen:!0,positionRight:"calc(100% + 12px)",actions:[{id:ti(),label:"Restart",rightIcon:
|
|
470
|
+
`,Tl=({formData:t,handleFormChange:i})=>e.createElement(wl,null,e.createElement($,{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:t.otelServiceName,onChange:({target:{value:e}})=>i("otelServiceName",e)})),Dl=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const i=Gt(t?.status),a=ot(t?.reasonEnum),n=t?.message;return e.createElement(ue,{$alignItems:"center",$justifyContent:"center"},e.createElement(de,{status:i,title:a,subtitle:n,withBackground:i!==he.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Nl=({source:a,fetchSourceDescribe:n,restartPod:o})=>{const[l,r]=t(!1),[s,d]=t(null);return i(()=>{a&&n({namespace:a.namespace,name:a.name,kind:a.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):r(!0)})},[a.namespace,a.name,a.kind]),s||l?e.createElement(ee,{$gap:12},l?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch describe for this source"})):s?.pods?.length?s.pods.map(({podName:t,nodeName:i,phase:n,agentInjected:l,runningLatestWorkloadRevision:r,containers:d,manifestYAML:u})=>{const p=n.status!==W.Success||Yt(d)?W.Error:W.Success,m=[];return m.push(e.createElement(Xt,{key:"copy-text",value:`kubectl get pod ${t.value} -n ${s?.namespace?.value||a.namespace}`.toLowerCase()})),m.push(e.createElement(se,{key:"divider-1",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-1",title:i.name,tooltip:i.explain||"",value:{status:i.status||void 0,text:i.value}})),m.push(e.createElement(se,{key:"divider-2",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-2",title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),m.push(e.createElement(se,{key:"divider-3",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-3",title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}})),m.push(e.createElement(se,{key:"divider-4",length:"100%",margin:"0"})),r?.name&&(m.push(e.createElement(Zt,{key:"describe-row-4",title:r.name,tooltip:r.explain||void 0,value:{status:r.status||void 0,text:r.value}})),m.push(e.createElement(se,{key:"divider-5",length:"100%",margin:"0"}))),d.forEach(t=>{m.push(e.createElement(Qt,{key:`pod-container-${t.containerName.value}`,...t}))}),u&&(m.push(e.createElement(se,{key:"divider-6",length:"100%",margin:"0"})),m.push(e.createElement(Zi,{key:"yaml-section-card",yaml:u}))),e.createElement(Z,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:({hovered:i})=>e.createElement("div",{style:{position:"relative"}},e.createElement(de,{key:"status",status:p,title:p,withIcon:!0,withBorder:!0}),i&&e.createElement(ei,{key:"hover-actions",isOpen:!0,positionRight:"calc(100% + 12px)",actions:[{id:ti(),label:"Restart",rightIcon:Di,onClick:()=>o(s?.namespace?.value||a.namespace,t.value)}]}))},c.toArray(m))}):e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(De,{$height:"70vh"},e.createElement(Le,null))},El=d(ue)`
|
|
471
471
|
width: 100%;
|
|
472
472
|
align-items: center;
|
|
473
473
|
justify-content: space-between;
|
|
474
|
-
`,Il=({source:a,fetchSourceLibraries:n})=>{const o=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return i(()=>{a&&n({namespace:a.namespace,name:a.name,kind:a.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(Dt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[a.namespace,a.name,a.kind]),c||l?e.createElement(ee,{$gap:12},l?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Z,{title:"Instrumented Libraries"},c.map(({name:t,healthy:i,nonIdentifyingAttributes:a},n)=>e.createElement(r,{key:`library-${t}`},e.createElement(El,null,e.createElement(E,{size:12,color:o.text.grey},t),e.createElement(ue,{$gap:4},a.map(({key:i,value:a})=>ii(a)&&ai(a)&&"is_standard_lib"===i?e.createElement(de,{key:`${t}-${i}`,status:W.Default,title:"STANDARD",withBorder:!0}):null),"boolean"==typeof i&&e.createElement(de,{status:i?W.Success:W.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0}))),n!==c.length-1&&e.createElement(se,{length:"100%",margin:"0"})))):e.createElement(De,{$height:"70vh",$gap:12},e.createElement(Ne,{title:"No libraries found",subTitle:""}),e.createElement(oe,{type:W.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(De,{$height:"70vh"},e.createElement(
|
|
474
|
+
`,Il=({source:a,fetchSourceLibraries:n})=>{const o=I.useTheme(),[l,s]=t(!1),[c,d]=t(null);return i(()=>{a&&n({namespace:a.namespace,name:a.name,kind:a.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(Dt(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[a.namespace,a.name,a.kind]),c||l?e.createElement(ee,{$gap:12},l?e.createElement(De,{$height:"70vh"},e.createElement(Ne,{subTitle:"Could not fetch libraries for this source"})):c?.length?e.createElement(Z,{title:"Instrumented Libraries"},c.map(({name:t,healthy:i,nonIdentifyingAttributes:a},n)=>e.createElement(r,{key:`library-${t}`},e.createElement(El,null,e.createElement(E,{size:12,color:o.text.grey},t),e.createElement(ue,{$gap:4},a.map(({key:i,value:a})=>ii(a)&&ai(a)&&"is_standard_lib"===i?e.createElement(de,{key:`${t}-${i}`,status:W.Default,title:"STANDARD",withBorder:!0}):null),"boolean"==typeof i&&e.createElement(de,{status:i?W.Success:W.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0}))),n!==c.length-1&&e.createElement(se,{length:"100%",margin:"0"})))):e.createElement(De,{$height:"70vh",$gap:12},e.createElement(Ne,{title:"No libraries found",subTitle:""}),e.createElement(oe,{type:W.Warning,message:"This feature is in early development, and has very limited support"}))):e.createElement(De,{$height:"70vh"},e.createElement(Le,null))};var Ol;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Ol||(Ol={}));const Al=[li.Deployment,li.StatefulSet,li.DaemonSet,li.DeploymentConfig],Fl=[ri.Python,ri.Go,ri.Java],Ml=d.div`
|
|
475
475
|
width: 100%;
|
|
476
476
|
height: 100%;
|
|
477
477
|
max-height: calc(100vh - 220px);
|
|
@@ -481,12 +481,12 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
481
481
|
display: flex;
|
|
482
482
|
flex-direction: column;
|
|
483
483
|
gap: 12px;
|
|
484
|
-
`,Ll=({persistSources:a,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d,restartPod:u})=>{const{isVm:p}=_e(),{sources:h}=_(),{selectedStreamName:g}=Je(),{drawerType:y,drawerEntityId:v}=K(),b=l(()=>Ye(h,g),[h,g]),f=n(null),x=y===B.Source,[$,S]=t(!1),[k,C]=t(!1),[w,T]=t(Ol.Overview),[D,N]=t(null);i(()=>{x&&v&&s(v).then(e=>N(e||null))},[x,v]);const{formData:I,handleFormChange:O,resetFormData:A,loadFormWithDrawerItem:F}=ni(),M=l(()=>{if(v)return D&&JSON.stringify(Ht(D))===JSON.stringify(Ht(v))?D:b?.find(e=>JSON.stringify(Ht(e))===JSON.stringify(Ht(v)))},[v,b,D]);i(()=>{x&&M?F(M):A()},[x,M]);const R=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===he.Loading,containers:M?.containers||[]}},[M]),L=l(()=>{const e=[{label:Ol.Overview,onClick:()=>T(Ol.Overview),selected:w===Ol.Overview}];return Al.includes(M?.kind)&&e.push({label:Ol.Pods,onClick:()=>T(Ol.Pods),selected:w===Ol.Pods}),M?.containers?.some(({language:e})=>Fl.includes(e))&&e.push({label:Ol.Libraries,onClick:()=>T(Ol.Libraries),selected:w===Ol.Libraries}),e},[w,M]);return M?e.createElement($a,{ref:f,onClose:()=>{T(Ol.Overview),N(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:ze(M.containers),isEdit:$,isFormDirty:k,onEdit:w===Ol.Overview?e=>{S("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==M.name?I.otelServiceName:"";O("otelServiceName",e),await o(v,{...I,otelServiceName:e}),N(null),C(!1),S(!1)},onDelete:w===Ol.Overview?async()=>{const{namespace:e}=M;a({[e]:[{...M,selected:!1,currentStreamName:g}]},{}),N(null),C(!1),S(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{C(!1),S(!1),O("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===b.length,tabs:L,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([v]),children:e.createElement(e.Fragment,null,e.createElement(
|
|
484
|
+
`,Ll=({persistSources:a,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d,restartPod:u})=>{const{isVm:p}=_e(),{sources:h}=_(),{selectedStreamName:g}=Je(),{drawerType:y,drawerEntityId:v}=K(),b=l(()=>Ye(h,g),[h,g]),f=n(null),x=y===B.Source,[$,S]=t(!1),[k,C]=t(!1),[w,T]=t(Ol.Overview),[D,N]=t(null);i(()=>{x&&v&&s(v).then(e=>N(e||null))},[x,v]);const{formData:I,handleFormChange:O,resetFormData:A,loadFormWithDrawerItem:F}=ni(),M=l(()=>{if(v)return D&&JSON.stringify(Ht(D))===JSON.stringify(Ht(v))?D:b?.find(e=>JSON.stringify(Ht(e))===JSON.stringify(Ht(v)))},[v,b,D]);i(()=>{x&&M?F(M):A()},[x,M]);const R=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===he.Loading,containers:M?.containers||[]}},[M]),L=l(()=>{const e=[{label:Ol.Overview,onClick:()=>T(Ol.Overview),selected:w===Ol.Overview}];return Al.includes(M?.kind)&&e.push({label:Ol.Pods,onClick:()=>T(Ol.Pods),selected:w===Ol.Pods}),M?.containers?.some(({language:e})=>Fl.includes(e))&&e.push({label:Ol.Libraries,onClick:()=>T(Ol.Libraries),selected:w===Ol.Libraries}),e},[w,M]);return M?e.createElement($a,{ref:f,onClose:()=>{T(Ol.Overview),N(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:ze(M.containers),isEdit:$,isFormDirty:k,onEdit:w===Ol.Overview?e=>{S("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==M.name?I.otelServiceName:"";O("otelServiceName",e),await o(v,{...I,otelServiceName:e}),N(null),C(!1),S(!1)},onDelete:w===Ol.Overview?async()=>{const{namespace:e}=M;a({[e]:[{...M,selected:!1,currentStreamName:g}]},{}),N(null),C(!1),S(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{C(!1),S(!1),O("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===b.length,tabs:L,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([v]),children:e.createElement(e.Fragment,null,e.createElement(Mi,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},w===Ol.Overview?$?e.createElement(Ml,null,e.createElement(Tl,{formData:I,handleFormChange:(...e)=>{C(!0),O(...e),O("currentStreamName",g)}})):e.createElement(Rl,null,e.createElement(Dl,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(X,{conditions:M.conditions||[]}),e.createElement(Z,{title:m.SOURCE_DETAILS,data:M?Cl(M,p):[]}),e.createElement(Z,{title:p?m.DETECTED_PROCESSES:m.DETECTED_CONTAINERS,titleBadge:R.isLoading?he.Loading:R.containers.length,description:R.description||(p?m.DETECTED_PROCESSES_DESCRIPTION:m.DETECTED_CONTAINERS_DESCRIPTION)},R.containers.map(t=>e.createElement(oi,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await o(v,e)}))),e.createElement(Zi,{yaml:M.manifestYAML})):w===Ol.Pods?e.createElement(Nl,{source:M,fetchSourceDescribe:c,restartPod:u}):e.createElement(Il,{source:M,fetchSourceLibraries:d})):null},Pl=d.div`
|
|
485
485
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
486
486
|
width: 100%;
|
|
487
|
-
`,Kl=a(({isModal:t,fetchSingleNamespace:i,onClickSummary:a},n)=>{const l=I.useTheme(),{isVm:r}=_e(),s=si({fetchSingleNamespace:i}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:p,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:x,setShowSelectedOnly:S,showRunningOnly:k,setShowRunningOnly:C}=s;o(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const T=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(ne,{$isNotModal:!t},e.createElement(ee,{$gap:12},e.createElement(ee,{$gap:24},a&&e.createElement(vt,{onClick:a}),e.createElement(A,{title:m.SELECT_SOURCES,badgeLabel:T,description:m.SELECT_SOURCES_DESCRIPTION}),e.createElement(ue,{$justifyContent:"space-between"},e.createElement(Pl,{$fullWidth:r},e.createElement($,{placeholder:b===B.Source?m.SEARCH_SOURCES:m.SEARCH_NAMESPACES,icon:
|
|
487
|
+
`,Kl=a(({isModal:t,fetchSingleNamespace:i,onClickSummary:a},n)=>{const l=I.useTheme(),{isVm:r}=_e(),s=si({fetchSingleNamespace:i}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:p,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:x,setShowSelectedOnly:S,showRunningOnly:k,setShowRunningOnly:C}=s;o(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const T=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(ne,{$isNotModal:!t},e.createElement(ee,{$gap:12},e.createElement(ee,{$gap:24},a&&e.createElement(vt,{onClick:a}),e.createElement(A,{title:m.SELECT_SOURCES,badgeLabel:T,description:m.SELECT_SOURCES_DESCRIPTION}),e.createElement(ue,{$justifyContent:"space-between"},e.createElement(Pl,{$fullWidth:r},e.createElement($,{placeholder:b===B.Source?m.SEARCH_SOURCES:m.SEARCH_NAMESPACES,icon:Ni,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(O,{options:[{label:m.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:m.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ue,{$gap:36},e.createElement(w,{title:m.SELECT_ALL,initialValue:u,onChange:p,disabled:!!d}),e.createElement(w,{title:m.ONLY_SELECTED,initialValue:x,onChange:S}),e.createElement(w,{title:m.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:C}))),e.createElement(se,null),e.createElement(vl,{isModal:t,...s})))});Kl.displayName=Kl.name;const jl=({fetchSingleNamespace:t,persistSources:i})=>{const{currentModal:a,setCurrentModal:o}=te(),l=a===B.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),r()}},c=n(null);return j({key:"Enter",active:l},s),l?e.createElement(ie,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(ae,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(Kl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Vl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:m.NAMESPACE,sortable:!0}),t.push({key:"containers",title:m.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},ql=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=I.useTheme(),{isVm:o}=_e(),r=ye(),{isThisPending:c}=L(),{selectedStreamName:d}=Je(),{sources:u,sourcesLoading:p}=_(),{setDrawerType:h,setDrawerEntityId:g}=K(),{selectedSources:y,setSelectedSources:v}=Me(),{isAwaitingInstrumentation:f,sourcesToCreate:x,sourcesCreated:$,sourcesToDelete:S,sourcesDeleted:k}=Re(),C=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,$):S?e(S,k):1},[x,$,S,k]),w=l(()=>Ye(u,d),[u,d]),T=l(()=>Oa({instrumentationRules:[],sources:Ge(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[w,r]),[D,N]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),O=s(e=>{if(e){const e={};T.forEach(t=>{const i={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:B.Source,entityId:i})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),v(e)}else v({})},[T]),A=s(e=>{const{namespace:t,name:i,kind:a}=e,n={...y};n[t]||(n[t]=[]);const o=n[t].findIndex(e=>e.name===i&&e.kind===a);-1===o?n[t].push(e):n[t].splice(o,1),v(n)},[y]),F=l(()=>T.map(i=>{const a=Ht(i),o=JSON.stringify(a),{hasErrors:l,hasWarnings:r,hasDisableds:s}=ce(i.conditions||[]),d=c({entityType:B.Source,entityId:a}),u=!!y[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?W.Error:r?W.Warning:void 0,faded:s,onClick:()=>{h(B.Source),g(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ue,{$gap:16},e.createElement(b,{disabled:d,value:u,onChange:()=>A(i)}),e.createElement(ci,{icons:ze(i.containers),id:o}))},{columnKey:"name",value:fe(i,B.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:n.text.info},{columnKey:"namespace",value:i.namespace,textColor:n.text.info},{columnKey:"throughput",value:je(It(t,B.Source,a).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ea,{conditions:i.conditions||[],id:o})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(de,{status:W.Info,title:di(i.containers),withBorder:!0}))}]}}),[T,y,t,A]),{badge:M,badgeTooltip:R}=l(()=>T.length!==w.length?{badge:`${T.length}/${w.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[T,w]);return e.createElement($e,{$maxWidth:a},e.createElement(Se,null,e.createElement(b,{partiallyChecked:D&&T?.length!==N,value:D&&T?.length===N,onChange:O,disabled:!T?.length}),e.createElement(ke,{icon:Ce(B.Source),title:m.SOURCES,badge:M,badgeTooltip:R,loading:p||f})),e.createElement(we,{$maxHeight:i},e.createElement(Te,{columns:Vl(o),rows:F})),f&&!F.length?e.createElement(De,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ee,{width:420}),e.createElement(ue,{$gap:16},e.createElement(E,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ie,{label:`${C}%`}))):F.length?null:e.createElement(De,{style:{marginTop:"2rem"}},e.createElement(Ne,null)))},Hl=({expiresAt:t})=>{const i=I.useTheme(),{formatTimeAgo:a}=zt(),n=a(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),l=ui(t,0)?i.text.error:ui(t,6048e5)?i.text.warning:i.text.success;return e.createElement(E,{size:14,color:l},n," (",o,")")},zl=d.div`
|
|
488
488
|
position: relative;
|
|
489
|
-
`,Bl=({token:i,saveToken:a})=>{const{CopyButton:n}=pi(),{formData:o,handleFormChange:l,resetFormData:r}=mi({token:i}),[s,c]=t(!1),d=()=>{c(!1),r()};return e.createElement(ue,{$gap:0},e.createElement(n,{value:i,size:hi.L}),e.createElement(se,{orientation:"vertical",length:"12px"}),e.createElement(zl,null,e.createElement(ht,{size:32,onClick:()=>{c(!0)}},e.createElement(ki,null)),s&&e.createElement(gi,{flipX:!0,clientX:36,isOpen:s,onClose:d,onSave:()=>{a(o.token).then(d)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement($,{placeholder:"API Token",type:"password",value:o.token,onChange:e=>l("token",e.target.value)}))))},Wl=({tokens:t,saveToken:i})=>e.createElement(Z,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:h.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:a,expiresAt:n})=>({cells:[{columnKey:"icon",icon:Bi},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Hl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Bl,{token:a,saveToken:i})}]}))}}]}),_l=({fetchDescribeOdigos:a})=>{const[n,o]=t(null);if(i(()=>{a().then(({data:e})=>o(e?.describeOdigos||null))},[]),!n)return e.createElement(De,null,e.createElement(
|
|
489
|
+
`,Bl=({token:i,saveToken:a})=>{const{CopyButton:n}=pi(),{formData:o,handleFormChange:l,resetFormData:r}=mi({token:i}),[s,c]=t(!1),d=()=>{c(!1),r()};return e.createElement(ue,{$gap:0},e.createElement(n,{value:i,size:hi.L}),e.createElement(se,{orientation:"vertical",length:"12px"}),e.createElement(zl,null,e.createElement(ht,{size:32,onClick:()=>{c(!0)}},e.createElement(ki,null)),s&&e.createElement(gi,{flipX:!0,clientX:36,isOpen:s,onClose:d,onSave:()=>{a(o.token).then(d)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement($,{placeholder:"API Token",type:"password",value:o.token,onChange:e=>l("token",e.target.value)}))))},Wl=({tokens:t,saveToken:i})=>e.createElement(Z,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:h.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:a,expiresAt:n})=>({cells:[{columnKey:"icon",icon:Bi},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Hl,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Bl,{token:a,saveToken:i})}]}))}}]}),_l=({fetchDescribeOdigos:a})=>{const[n,o]=t(null);if(i(()=>{a().then(({data:e})=>o(e?.describeOdigos||null))},[]),!n)return e.createElement(De,null,e.createElement(Le,null));const l=t=>t?.name?[e.createElement(se,{key:`divider-${t.name}`}),e.createElement(Zt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(ii(t.value)?ai(t.value)?W.Success:W.Error:W.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Z,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:n?.odigosVersion?.name,value:n?.odigosVersion?.value},{title:n?.kubernetesVersion?.name,value:n?.kubernetesVersion?.value},{title:n?.installationMethod?.name,value:n?.installationMethod?.value},{title:n?.tier?.name,value:n?.tier?.value},{title:"# of sources",value:n?.numberOfSources?.toString()},{title:"# of destinations",value:n?.numberOfDestinations?.toString()}]}),e.createElement(Z,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(Z,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},Jl=d.div`
|
|
490
490
|
display: flex;
|
|
491
491
|
flex-direction: column;
|
|
492
492
|
gap: 12px;
|
|
@@ -599,4 +599,4 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
599
599
|
padding-top: 12px;
|
|
600
600
|
padding-left: 12px;
|
|
601
601
|
white-space: nowrap;
|
|
602
|
-
`,kr=({heightToRemove:i,traces:a,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>Dt(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:ir(e)})),[a]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),p=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(br,{$heightToRemove:i},n?e.createElement(De,{$height:"50vh"},e.createElement(
|
|
602
|
+
`,kr=({heightToRemove:i,traces:a,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>Dt(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:ir(e)})),[a]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),p=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(br,{$heightToRemove:i},n?e.createElement(De,{$height:"50vh"},e.createElement(Le,{scale:1.5})):d.length?e.createElement(fr,{$heightToRemove:i},e.createElement(xr,null,e.createElement(E,null,"Service & operation")),new Array(5).fill(null).map((t,a)=>e.createElement($r,{key:`${a}-divider`,$heightToRemove:i,index:a},e.createElement(Sr,null,vi(u/5*a)))),d.map((t,i)=>{const{spans:a}=t,n=a.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=a.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(vr,{key:`recursive-spans-${t.traceID}`,spans:a,logs:[],depth:1,indexInMatrix:i,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:o,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(De,{$height:"50vh"},e.createElement(Ne,{title:m.NO_TRACES_FOUND,subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(sr,{span:s,process:p,onClose:()=>c(null)}))};export{wa as ActionDrawer,xa as ActionForm,Da as ActionModal,Fa as ActionTable,Ka as AwaitPipeline,ln as ConditionDropdown,en as DataFlow,An as DataFlowActionsMenu,Sn as DataStreamDrawer,xn as DataStreamForm,Mn as DataStreamModal,Fn as DataStreamSelectionForm,Jn as DestinationDrawer,Bn as DestinationForm,mo as DestinationModal,bo as DestinationSelectionForm,xo as DestinationTable,rn as ErrorDropdown,Lo as InstrumentationRuleDrawer,Fo as InstrumentationRuleForm,jo as InstrumentationRuleModal,Ho as InstrumentationRuleTable,un as KindDropdown,sn as LanguageDropdown,cn as MonitorDropdown,Bo as MultiSourceControl,dn as NamespaceDropdown,$l as NavIconIds,Yo as NotificationManager,$a as OverviewDrawer,pn as PodsAgentInjectionStatusDropdown,rl as ServiceMap,xl as SetupSummary,Sl as SideNav,kl as SlackInvite,Ll as SourceDrawer,Tl as SourceForm,jl as SourceModal,Kl as SourceSelectionForm,ql as SourceTable,Gl as SystemOverview,Ea as TableCellConditions,Xl as ToastList,tr as ToggleDarkMode,kr as TraceView};
|