@odigos/ui-kit 0.0.118-dev.384 → 0.0.118-dev.387
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/lib/chunks/{ui-components-1b9ade2a.js → ui-components-62ddbe0d.js} +31 -31
- package/lib/components.js +1 -1
- package/lib/constants/strings/index.d.ts +2 -0
- package/lib/constants.js +1 -1
- package/lib/containers.js +4 -4
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/package.json +1 -1
package/lib/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{V as AutocompleteInput,ag as Badge,aM as Button,t as CancelWarning,ad as CenterThis,C as Checkbox,cv as Code,G as ConditionDetails,H as DataCard,a as DataCardFieldTypes,b7 as DataCardFields,cw as DataFinger,b3 as DataTab,s as DeleteWarning,bu as DescribeRow,W as Divider,m as DocsButton,r as Drawer,cy as DrawerFooter,cx as DrawerHeader,aJ as Dropdown,cz as ErrorBoundary,aS as ExtendArrow,aZ as FadeLoader,b as FieldError,F as FieldLabel,L as FlexColumn,Z as FlexRow,cA as Header,aR as IconButton,bD as IconGroup,a9 as IconTitleBadge,a4 as IconWrapped,bq as IconsNav,cB as ImageControlled,I as Input,h as InputList,e as InputTable,ac as InteractiveTable,g as KeyValueInputsList,O as Modal,Q as ModalBody,M as MonitorsCheckboxes,a6 as MonitorsIcons,P as NavigationButtons,ae as NoDataFound,R as NotificationNote,cI as Overlay,aD as Popup,bI as PopupForm,bR as ScrollX,l as SectionTitle,S as Segment,aE as SelectionButton,cC as SkeletonLoader,Y as Status,b6 as Stepper,cD as TabList,a7 as TableContainer,a8 as TableTitleWrap,ab as TableWrap,bg as Tag,k as Text,n as TextArea,f as Toggle,bP as ToggleCodeComponent,$ as Tooltip,af as TraceLoader,aF as VerticalScroll,cH as WarningModal,cE as getLinksFromText,cF as getStrongsFromText,cG as renderText}from"./chunks/ui-components-
|
|
1
|
+
export{V as AutocompleteInput,ag as Badge,aM as Button,t as CancelWarning,ad as CenterThis,C as Checkbox,cv as Code,G as ConditionDetails,H as DataCard,a as DataCardFieldTypes,b7 as DataCardFields,cw as DataFinger,b3 as DataTab,s as DeleteWarning,bu as DescribeRow,W as Divider,m as DocsButton,r as Drawer,cy as DrawerFooter,cx as DrawerHeader,aJ as Dropdown,cz as ErrorBoundary,aS as ExtendArrow,aZ as FadeLoader,b as FieldError,F as FieldLabel,L as FlexColumn,Z as FlexRow,cA as Header,aR as IconButton,bD as IconGroup,a9 as IconTitleBadge,a4 as IconWrapped,bq as IconsNav,cB as ImageControlled,I as Input,h as InputList,e as InputTable,ac as InteractiveTable,g as KeyValueInputsList,O as Modal,Q as ModalBody,M as MonitorsCheckboxes,a6 as MonitorsIcons,P as NavigationButtons,ae as NoDataFound,R as NotificationNote,cI as Overlay,aD as Popup,bI as PopupForm,bR as ScrollX,l as SectionTitle,S as Segment,aE as SelectionButton,cC as SkeletonLoader,Y as Status,b6 as Stepper,cD as TabList,a7 as TableContainer,a8 as TableTitleWrap,ab as TableWrap,bg as Tag,k as Text,n as TextArea,f as Toggle,bP as ToggleCodeComponent,$ as Tooltip,af as TraceLoader,aF as VerticalScroll,cH as WarningModal,cE as getLinksFromText,cF as getStrongsFromText,cG as renderText}from"./chunks/ui-components-62ddbe0d.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
|
@@ -84,6 +84,8 @@ export declare const DISPLAY_TITLES: {
|
|
|
84
84
|
DESCRIBE_SOURCE: string;
|
|
85
85
|
DETECTED_CONTAINERS: string;
|
|
86
86
|
DETECTED_CONTAINERS_DESCRIPTION: string;
|
|
87
|
+
DETECTED_PROCESSES: string;
|
|
88
|
+
DETECTED_PROCESSES_DESCRIPTION: string;
|
|
87
89
|
CONTAINER_NAME: string;
|
|
88
90
|
FILTERED_COUNT_TOOLTIP: string;
|
|
89
91
|
SEARCH_NAMESPACES: string;
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{y as ACTION_OPTIONS,B as BUTTON_TEXTS,aQ as DEFAULT_DATA_STREAM_NAME,b4 as DESTINATION_CATEGORIES,aK as DISPLAY_LANGUAGES,D as DISPLAY_TITLES,U as FORM_ALERTS,bj as INSTRUMENTATION_RULE_OPTIONS,ch as LANGUAGE_OPTIONS,aL as MONITORS_OPTIONS,aN as STORAGE_KEYS,ci as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-
|
|
1
|
+
export{y as ACTION_OPTIONS,B as BUTTON_TEXTS,aQ as DEFAULT_DATA_STREAM_NAME,b4 as DESTINATION_CATEGORIES,aK as DISPLAY_LANGUAGES,D as DISPLAY_TITLES,U as FORM_ALERTS,bj as INSTRUMENTATION_RULE_OPTIONS,ch as LANGUAGE_OPTIONS,aL as MONITORS_OPTIONS,aN as STORAGE_KEYS,ci as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-62ddbe0d.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperativeHandle as a,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b as f,c as b,I as x,d as C,i as $,e as k,f as S,g as w,h as D,j as N,k as T,T as I,S as E,l as O,m as M,M as A,n as F,u as R,o as L,p as P,q,B as K,r as H,s as z,t as W,E as j,v as V,w as B,x as U,y as _,z as G,G as J,H as Y,J as Q,L as X,N as Z,O as ee,P as te,Q as oe,R as ie,U as ne,V as ae,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as fe,a7 as be,a8 as xe,a9 as Ce,aa as $e,ab as ke,ac as Se,ad as we,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Me,al as Ae,am as Fe,an as Re,ao as Le,ap as Pe,aq as qe,ar as Ke,as as He,at as ze,au as We,av as je,aw as Ve,ax as Be,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Qe,aE as Xe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as nt,aL as at,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as ft,aZ as bt,a_ as xt,a$ as Ct,b0 as $t,b1 as kt,b2 as St,b3 as wt,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as Mt,bb as At,bc as Ft,bd as Rt,be as Lt,bf as Pt,bg as qt,bh as Kt,bi as Ht,bj as zt,bk as Wt,bl as jt,bm as Vt,bn as Bt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Qt,bu as Xt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as no,bB as ao,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo,bN as fo,bO as bo,bP as xo,bQ as Co,bR as $o}from"./chunks/ui-components-
|
|
1
|
+
import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperativeHandle as a,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b as f,c as b,I as x,d as C,i as $,e as k,f as S,g as w,h as D,j as N,k as T,T as I,S as E,l as O,m as M,M as A,n as F,u as R,o as L,p as P,q,B as K,r as H,s as z,t as W,E as j,v as V,w as B,x as U,y as _,z as G,G as J,H as Y,J as Q,L as X,N as Z,O as ee,P as te,Q as oe,R as ie,U as ne,V as ae,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as fe,a7 as be,a8 as xe,a9 as Ce,aa as $e,ab as ke,ac as Se,ad as we,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Me,al as Ae,am as Fe,an as Re,ao as Le,ap as Pe,aq as qe,ar as Ke,as as He,at as ze,au as We,av as je,aw as Ve,ax as Be,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Qe,aE as Xe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as nt,aL as at,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as ft,aZ as bt,a_ as xt,a$ as Ct,b0 as $t,b1 as kt,b2 as St,b3 as wt,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as Mt,bb as At,bc as Ft,bd as Rt,be as Lt,bf as Pt,bg as qt,bh as Kt,bi as Ht,bj as zt,bk as Wt,bl as jt,bm as Vt,bn as Bt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Qt,bu as Xt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as no,bB as ao,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo,bN as fo,bO as bo,bP as xo,bQ as Co,bR as $o}from"./chunks/ui-components-62ddbe0d.js";import{CheckCircledIcon as ko,CrossCircledIcon as So,EditIcon as wo,TrashIcon as Do,OdigosLogoText as No,SearchIcon as To,FilterIcon as Io,DataStreamsIcon as Eo,CheckIcon as Oo,OdigosLogo as Mo,ArrowIcon as Ao,PlusIcon as Fo,RefreshLeftArrowIcon as Ro,NotificationIcon as Lo,UserIcon as Po,ImageErrorIcon as qo,OverviewIcon as Ko,RulesIcon as Ho,ActionsIcon as zo,SourcesIcon as Wo,DestinationsIcon as jo,SlackLogo as Vo,CopyIcon as Bo,KeyIcon as Uo,TerminalIcon as _o,GearIcon as Go,WarningTriangleIcon as Jo,TraceViewIcon as Yo,ErrorTriangleIcon as Qo}from"./icons.js";import{useNodesState as Xo,useEdgesState as Zo,applyNodeChanges as ei,MarkerType as ti}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const oi=e=>{const{type:t,name:o,notes:i,signals:n,disabled:a,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:f,renames:b,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:$,endpointsFilters:k,servicesNameFilters:S,attributeFilters:w}}=e,D=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:p.NAME,value:o||""},{title:p.NOTES,value:i||""},{type:m.Divider}];if(t===h.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(l)}),D.push({title:"Collect ReplicaSet Attributes",value:String(r)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Label Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:n})}),u?.length&&D.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Annotation Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:n})})),t===h.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:o},i)=>{e+=`${t}: ${o}`,i<y.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";f?.forEach((t,o)=>{e+=t,o<f.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(b||{});t.forEach(([o,i],n)=>{e+=`${o}: ${i}`,n<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,o)=>{e+=t,o<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===h.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(C)}),t===h.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===h.LatencySampler&&k?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${o}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(k.length>1?` #${n+1}`:""),value:a})}),t===h.ServiceNameSampler&&S?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${o}`,D.push({title:"Filter"+(S.length>1?` #${i+1}`:""),value:n})}),t===h.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${o}\n`;const l=Object.keys(i)[0];a+=`Condition: ${l}\n`,a+=`Operation: ${i[l]?.operation}\n`,a+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(a+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:a})}),D},ii=b.PiiCategories,ni=d.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -49,7 +49,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
49
49
|
width: 100%;
|
|
50
50
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
51
51
|
position: relative;
|
|
52
|
-
`,un=({heightToRemove:t,metrics:i})=>{const n=I.useTheme(),{isVm:a}=He(),r=he(),{selectedStreamName:s}=ze(),{isAwaitingInstrumentation:c}=We(),{containerRef:d,containerWidth:u,containerHeight:m}=je(),{sources:h,sourcesLoading:g,destinations:y,destinationsLoading:v,actions:f,actionsLoading:b,instrumentationRules:x,instrumentationRulesLoading:C}=B(),[$,k,S]=Xo([]),[w,D,N]=Zo([]);o(()=>D((({theme:e,isVm:t,nodes:o,metrics:i,containerHeight:n})=>{const a=[],l=o.find(({id:e})=>(t?[`${j.Namespace}-${Ee.OdiLogo}`]:[`${j.Action}-${Ee.Frame}`,`${j.Action}-${Ee.Add}`]).includes(e))?.id,r=-Wi/2+ji,s=Math.floor(n/Wi)*Wi-(Wi/2+ji),c=e=>e===Ee.Base||e===Ee.Edged;return o.forEach(({type:t,id:o,data:{type:n,id:d,status:u},position:p})=>{if(n===j.Source&&c(t)){const{namespace:t,name:n,kind:c}=d,m=i?.sources.find(e=>e.kind===c&&e.name===n&&e.namespace===t);p.y>=r&&p.y<=s&&a.push(Vi(`${o}-to-${l}`,{theme:e,animated:!1,isMultiTarget:!1,label:Oe(m?.throughput),isError:u===V.Error}))}if(n===j.Destination&&c(t)){const t=i?.destinations.find(e=>e.id===d);p.y>=r&&p.y<=s&&a.push(Vi(`${l}-to-${o}`,{theme:e,animated:!1,isMultiTarget:!0,label:Oe(t?.throughput),isError:u===V.Error}))}}),a})({theme:n,isVm:a,nodes:$,metrics:i,containerHeight:m})),[n,a,$,i,m]);const T=l(()=>(({isVm:e,containerWidth:t})=>{const o=(!e&&t<=1500?1500:t)-nn-24,i=e=>an*((e||0)+1),n={[j.Namespace]:{x:0,y:()=>0},[j.InstrumentationRule]:{x:24,y:i},[j.Source]:{x:Pe(t,[[0,1600,o/3.5],[1600,null,o/4]]),y:i},[j.Action]:{x:Pe(t,[[0,1600,o/1.55],[1600,null,o/1.6]]),y:i},[j.Destination]:{x:o,y:i}},a={[j.Namespace]:{x:o/2+100,y:()=>i(2)},[j.InstrumentationRule]:{x:0,y:()=>0},[j.Source]:{x:24,y:i},[j.Action]:{x:0,y:()=>0},[j.Destination]:{x:o,y:i}};return e?a:n})({isVm:a,containerWidth:u}),[a,u]),E=(e,t)=>{k(o=>{const i=[...o].filter(({id:e})=>e.split("-")[0]!==t);return i.push(...e),i})},O=(e,t,o)=>{k(i=>ei(e.filter(e=>"parent"===e.extent&&e.parentId===`${t}-${Ee.Scroll}`).map(e=>({id:e.id,type:"position",position:{...e.position,y:e.position.y-o}})),i))};return o(()=>{const e=Ve(h,s),t=(({isVm:e,loading:t,entities:o,positions:i,unfilteredCount:n,containerHeight:a,onScroll:l})=>{const r=[],s=i[j.Source],c=o.length!==n;return r.push({id:`${j.Source}-${Ee.Header}`,type:Ee.Header,position:{x:i[j.Source].x,y:0},data:{nodeWidth:Zi,title:p.SOURCES,icon:$e(j.Source),badge:c?`${o.length}/${n}`:n,badgeTooltip:c?p.FILTERED_COUNT_TOOLTIP:void 0,isFetching:t,sources:o}}),o.length?(r.push({id:`${j.Source}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:s.x,y:s.y()-tn},style:{zIndex:1},data:{nodeWidth:Zi,nodeHeight:a-en+2*tn,items:o.map((t,o)=>({id:`${j.Source}-${o}`,data:on(e,t)})),onScroll:l}}),o.forEach((t,o)=>{r.push({id:`${j.Source}-${o}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.Source}-${Ee.Scroll}`,position:{x:tn,y:s.y(o)-(en-tn/2)},style:{zIndex:-1},data:on(e,t)})})):t?r.push({id:`${j.Source}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:s.x,y:s.y()},data:{nodeWidth:Zi}}):r.push({id:`${j.Source}-${Ee.Add}`,type:Ee.Add,position:{x:s.x,y:s.y()},data:{nodeWidth:Zi,type:Fe.AddSource,title:p.ADD_SOURCE,subTitle:p.TO_COLLECT_OTEL_DATA}}),r})({isVm:a,entities:Be(e,r),loading:g||c,unfilteredCount:e.length,positions:T,containerHeight:m,onScroll:({scrollTop:e})=>O(t,j.Source,e)});E(t,j.Source)},[a,s,h,g,c,T[j.Source],r,m]),o(()=>{const e=Ue(y,s),t=
|
|
52
|
+
`,un=({heightToRemove:t,metrics:i})=>{const n=I.useTheme(),{isVm:a}=He(),r=he(),{selectedStreamName:s}=ze(),{isAwaitingInstrumentation:c}=We(),{containerRef:d,containerWidth:u,containerHeight:m}=je(),{sources:h,sourcesLoading:g,destinations:y,destinationsLoading:v,actions:f,actionsLoading:b,instrumentationRules:x,instrumentationRulesLoading:C}=B(),[$,k,S]=Xo([]),[w,D,N]=Zo([]);o(()=>D((({theme:e,isVm:t,nodes:o,metrics:i,containerHeight:n})=>{const a=[],l=o.find(({id:e})=>(t?[`${j.Namespace}-${Ee.OdiLogo}`]:[`${j.Action}-${Ee.Frame}`,`${j.Action}-${Ee.Add}`]).includes(e))?.id,r=-Wi/2+ji,s=Math.floor(n/Wi)*Wi-(Wi/2+ji),c=e=>e===Ee.Base||e===Ee.Edged;return o.forEach(({type:t,id:o,data:{type:n,id:d,status:u},position:p})=>{if(n===j.Source&&c(t)){const{namespace:t,name:n,kind:c}=d,m=i?.sources.find(e=>e.kind===c&&e.name===n&&e.namespace===t);p.y>=r&&p.y<=s&&a.push(Vi(`${o}-to-${l}`,{theme:e,animated:!1,isMultiTarget:!1,label:Oe(m?.throughput),isError:u===V.Error}))}if(n===j.Destination&&c(t)){const t=i?.destinations.find(e=>e.id===d);p.y>=r&&p.y<=s&&a.push(Vi(`${l}-to-${o}`,{theme:e,animated:!1,isMultiTarget:!0,label:Oe(t?.throughput),isError:u===V.Error}))}}),a})({theme:n,isVm:a,nodes:$,metrics:i,containerHeight:m})),[n,a,$,i,m]);const T=l(()=>(({isVm:e,containerWidth:t})=>{const o=(!e&&t<=1500?1500:t)-nn-24,i=e=>an*((e||0)+1),n={[j.Namespace]:{x:0,y:()=>0},[j.InstrumentationRule]:{x:24,y:i},[j.Source]:{x:Pe(t,[[0,1600,o/3.5],[1600,null,o/4]]),y:i},[j.Action]:{x:Pe(t,[[0,1600,o/1.55],[1600,null,o/1.6]]),y:i},[j.Destination]:{x:o,y:i}},a={[j.Namespace]:{x:o/2+100,y:()=>i(2)},[j.InstrumentationRule]:{x:0,y:()=>0},[j.Source]:{x:24,y:i},[j.Action]:{x:0,y:()=>0},[j.Destination]:{x:o,y:i}};return e?a:n})({isVm:a,containerWidth:u}),[a,u]),E=(e,t)=>{k(o=>{const i=[...o].filter(({id:e})=>e.split("-")[0]!==t);return i.push(...e),i})},O=(e,t,o)=>{k(i=>ei(e.filter(e=>"parent"===e.extent&&e.parentId===`${t}-${Ee.Scroll}`).map(e=>({id:e.id,type:"position",position:{...e.position,y:e.position.y-o}})),i))};return o(()=>{const e=Ve(h,s),t=(({isVm:e,loading:t,entities:o,positions:i,unfilteredCount:n,containerHeight:a,onScroll:l})=>{const r=[],s=i[j.Source],c=o.length!==n;return r.push({id:`${j.Source}-${Ee.Header}`,type:Ee.Header,position:{x:i[j.Source].x,y:0},data:{nodeWidth:Zi,title:p.SOURCES,icon:$e(j.Source),badge:c?`${o.length}/${n}`:n,badgeTooltip:c?p.FILTERED_COUNT_TOOLTIP:void 0,isFetching:t,sources:o}}),o.length?(r.push({id:`${j.Source}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:s.x,y:s.y()-tn},style:{zIndex:1},data:{nodeWidth:Zi,nodeHeight:a-en+2*tn,items:o.map((t,o)=>({id:`${j.Source}-${o}`,data:on(e,t)})),onScroll:l}}),o.forEach((t,o)=>{r.push({id:`${j.Source}-${o}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.Source}-${Ee.Scroll}`,position:{x:tn,y:s.y(o)-(en-tn/2)},style:{zIndex:-1},data:on(e,t)})})):t?r.push({id:`${j.Source}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:s.x,y:s.y()},data:{nodeWidth:Zi}}):r.push({id:`${j.Source}-${Ee.Add}`,type:Ee.Add,position:{x:s.x,y:s.y()},data:{nodeWidth:Zi,type:Fe.AddSource,title:p.ADD_SOURCE,subTitle:p.TO_COLLECT_OTEL_DATA}}),r})({isVm:a,entities:Be(e,r),loading:g||c,unfilteredCount:e.length,positions:T,containerHeight:m,onScroll:({scrollTop:e})=>O(t,j.Source,e)});E(t,j.Source)},[a,s,h,g,c,T[j.Source],r,m]),o(()=>{const e=Ue(y,s),t=(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[j.Destination];return l.push({id:`${j.Destination}-${Ee.Header}`,type:Ee.Header,position:{x:o[j.Destination].x,y:0},data:{nodeWidth:ln,title:p.DESTINATIONS,icon:$e(j.Destination),badge:i,isFetching:e}}),t.length?(l.push({id:`${j.Destination}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-sn},style:{zIndex:1},data:{nodeWidth:ln,nodeHeight:n-rn+2*sn,items:t.map((e,t)=>({id:`${j.Destination}-${t}`,data:cn(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${j.Destination}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.Destination}-${Ee.Scroll}`,position:{x:sn,y:r.y(t)-(rn-sn/2)},style:{zIndex:-1},data:cn(e)})})):e?l.push({id:`${j.Destination}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:ln}}):l.push({id:`${j.Destination}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:ln,type:Fe.AddDestination,title:p.ADD_DESTINATION,subTitle:p.TO_MONITOR_OTEL_DATA}}),l})({entities:_e(e,r),loading:v,unfilteredCount:e.length,positions:T,containerHeight:m,onScroll:({scrollTop:e})=>O(t,j.Destination,e)});E(t,j.Destination)},[a,s,y,v,T[j.Destination],r,m]),o(()=>{const e=a?[]:(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[j.Action];return l.push({id:`${j.Action}-${Ee.Header}`,type:Ee.Header,position:{x:o[j.Action].x,y:0},data:{nodeWidth:Ji,title:p.ACTIONS,icon:$e(j.Action),badge:i,isFetching:e}}),t.length?(l.push({id:`${j.Action}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-Qi},style:{zIndex:1},data:{nodeWidth:Ji,nodeHeight:n-Yi+2*Qi,items:t.map((e,t)=>({id:`${j.Action}-${t}`,data:Xi(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${j.Action}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.Action}-${Ee.Scroll}`,position:{x:Qi,y:r.y(t)-(Yi-Qi/2)},style:{zIndex:-1},data:Xi(e)})}),l.push({id:`${j.Action}-${Ee.Frame}`,type:Ee.Frame,position:{x:r.x-Qi,y:r.y()-Qi},data:{nodeWidth:Ji+2*Qi,nodeHeight:Math.min(n,Yi*t.length+Qi)}})):e?l.push({id:`${j.Action}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Ji}}):l.push({id:`${j.Action}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Ji,type:Fe.AddAction,title:p.ADD_ACTION,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:ge(f,r),loading:b,unfilteredCount:f.length,positions:T,containerHeight:m,onScroll:({scrollTop:t})=>O(e,j.Action,t)});E(e,j.Action)},[a,f,b,T[j.Action],r,m]),o(()=>{const e=a?[]:(({loading:e,entities:t,positions:o,unfilteredCount:i,containerHeight:n,onScroll:a})=>{const l=[],r=o[j.InstrumentationRule];return l.push({id:`${j.InstrumentationRule}-${Ee.Header}`,type:Ee.Header,position:{x:o[j.InstrumentationRule].x,y:0},data:{nodeWidth:Bi,title:p.INSTRUMENTATION_RULES,icon:$e(j.InstrumentationRule),badge:i,isFetching:e}}),t.length?(l.push({id:`${j.InstrumentationRule}-${Ee.Scroll}`,type:Ee.Scroll,position:{x:r.x,y:r.y()-_i},style:{zIndex:1},data:{nodeWidth:Bi,nodeHeight:n-Ui+2*_i,items:t.map((e,t)=>({id:`${j.InstrumentationRule}-${t}`,data:Gi(e)})),onScroll:a}}),t.forEach((e,t)=>{l.push({id:`${j.InstrumentationRule}-${t}-hidden`,type:Ee.Edged,extent:"parent",parentId:`${j.InstrumentationRule}-${Ee.Scroll}`,position:{x:_i,y:r.y(t)-(Ui-_i/2)},style:{zIndex:-1},data:Gi(e)})})):e?l.push({id:`${j.InstrumentationRule}-${Ee.Skeleton}`,type:Ee.Skeleton,position:{x:r.x,y:r.y()},data:{nodeWidth:Bi}}):l.push({id:`${j.InstrumentationRule}-${Ee.Add}`,type:Ee.Add,position:{x:r.x,y:r.y()},data:{nodeWidth:Bi,type:Fe.AddRule,title:p.ADD_INSTRUMENTATION_RULE,subTitle:p.TO_MODIFY_OTEL_DATA}}),l})({entities:x,loading:C,unfilteredCount:x.length,positions:T,containerHeight:m,onScroll:({scrollTop:t})=>O(e,j.InstrumentationRule,t)});E(e,j.InstrumentationRule)},[a,x,C,T[j.InstrumentationRule],m]),o(()=>{const e=(({isVm:e,positions:t})=>{const o=[];if(!e)return o;const i=t[j.Namespace];return o.push({id:`${j.Namespace}-${Ee.OdiLogo}`,type:Ee.OdiLogo,position:{x:i.x,y:i.y()},data:{}}),o})({isVm:a,positions:T});E(e,j.Namespace)},[a,T[j.Namespace],m]),e.createElement(dn,{ref:d,$heightToRemove:t},e.createElement(Ge,{nodes:$,edges:w,onNodesChange:S,onEdgesChange:N}))},pn=d.div`
|
|
53
53
|
position: relative;
|
|
54
54
|
max-width: 200px;
|
|
55
55
|
`;d.div`
|
|
@@ -375,7 +375,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
375
375
|
max-height: calc(100vh - 200px);
|
|
376
376
|
height: fit-content;
|
|
377
377
|
overflow-y: scroll;
|
|
378
|
-
`,Il=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:n})=>{const{selectedStreamName:a}=ze(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=kt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(O,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(Tl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(_t,{onClick:t}),data:[{title:"",value:a}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(_t,{onClick:o})},e.createElement(Dl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(_t,{onClick:i})},e.createElement(ka,{categories:n})))))};var El;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(El||(El={}));const Ol=({onClickId:o,defaultSelectedId:i,extendedNavIcons:n})=>{const{isVm:a}=He(),[r,s]=t(i||""),c=l(()=>[{id:El.Overview,icon:Ko,selected:r===El.Overview,onClick:()=>{s(El.Overview),o(El.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:El.Sources,icon:Wo,selected:r===El.Sources,onClick:()=>{s(El.Sources),o(El.Sources)},tooltip:"Sources"},{id:El.Destinations,icon:jo,selected:r===El.Destinations,onClick:()=>{s(El.Destinations),o(El.Destinations)},tooltip:"Destinations"}];return a
|
|
378
|
+
`,Il=({onEditStream:t,onEditSources:o,onEditDestinations:i,categories:n})=>{const{selectedStreamName:a}=ze(),{configuredSources:r,configuredDestinations:s,configuredDestinationsUpdateOnly:c}=kt(),d=l(()=>Object.values(r).reduce((e,t)=>e+t.filter(e=>e.selected).length,0),[r]);return e.createElement(oe,{$isNotModal:!0},e.createElement(X,{$gap:12},e.createElement(O,{title:p.SUMMARY,description:p.STREAM_CONFIRM}),e.createElement(Tl,null,e.createElement(Y,{title:p.STREAM_NAME,action:()=>e.createElement(_t,{onClick:t}),data:[{title:"",value:a}]}),e.createElement(Y,{title:p.SELECTED_SOURCES,titleBadge:d,action:()=>e.createElement(_t,{onClick:o})},e.createElement(Dl,{filteredNamespacesAndSources:r,withInstances:!1})),e.createElement(Y,{title:p.SELECTED_DESTINATIONS,titleBadge:s.length+c.length,action:()=>e.createElement(_t,{onClick:i})},e.createElement(ka,{categories:n})))))};var El;!function(e){e.Overview="overview",e.InstrumentationRules="InstrumentationRule",e.Sources="Source",e.Actions="Action",e.Destinations="Destination"}(El||(El={}));const Ol=({onClickId:o,defaultSelectedId:i,extendedNavIcons:n})=>{const{isVm:a}=He(),[r,s]=t(i||""),c=l(()=>[{id:El.Overview,icon:Ko,selected:r===El.Overview,onClick:()=>{s(El.Overview),o(El.Overview)},tooltip:"Overview"},...(n||[]).map(e=>({...e,selected:r===e.id,onClick:()=>{s(e.id),e.onClick()}}))],[r]),d=l(()=>{const e=[{id:El.Sources,icon:Wo,selected:r===El.Sources,onClick:()=>{s(El.Sources),o(El.Sources)},tooltip:"Sources"},{id:El.Destinations,icon:jo,selected:r===El.Destinations,onClick:()=>{s(El.Destinations),o(El.Destinations)},tooltip:"Destinations"}];return a||(e.push({id:El.InstrumentationRules,icon:Ho,selected:r===El.InstrumentationRules,onClick:()=>{s(El.InstrumentationRules),o(El.InstrumentationRules)},tooltip:"Instrumentation Rules"}),e.push({id:El.Actions,icon:zo,selected:r===El.Actions,onClick:()=>{s(El.Actions),o(El.Actions)},tooltip:"Actions"})),e},[a,r]);return e.createElement(Gt,{orientation:"vertical",mainIcons:c,subIcons:d})},Ml=({})=>e.createElement(ut,{onClick:()=>window.open("https://join.slack.com/t/odigos/shared_invite/zt-2wc6gm4j9-EhcVFYrLwHqvcIErO9sVzw","_blank","noopener noreferrer"),tooltip:"Join our Slack community"},e.createElement(Vo,null)),Al=(e,t)=>{const{name:o,kind:i,namespace:n}=e,a=[{title:p.KIND,value:i},{title:p.NAME,value:o,tooltip:"Resource name"}];return t||(a.unshift({title:p.NAMESPACE,value:n}),a.push({type:m.Divider}),a.push({type:m.CopyText,value:`kubectl get ${i} ${o} -n ${n}`.toLowerCase()})),a},Fl=d.div`
|
|
379
379
|
display: flex;
|
|
380
380
|
flex-direction: column;
|
|
381
381
|
gap: 24px;
|
|
@@ -394,7 +394,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
394
394
|
display: flex;
|
|
395
395
|
flex-direction: column;
|
|
396
396
|
gap: 12px;
|
|
397
|
-
`,Bl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{isVm:u}=He(),{sources:m}=B(),{selectedStreamName:h}=ze(),{drawerType:g,drawerEntityId:y}=P(),v=l(()=>Ve(m,h),[m,h]),f=n(null),b=g===j.Source,[x,C]=t(!1),[$,k]=t(!1),[S,w]=t(Hl.Overview),[D,N]=t(null);o(()=>{b&&y&&s(y).then(e=>N(e||null))},[b,y]);const{formData:I,handleFormChange:E,resetFormData:O,loadFormWithDrawerItem:M}=oo(),A=l(()=>{if(!b)return O();const e=(D&&JSON.stringify(Vt(D))===JSON.stringify(Vt(y))?D:null)||v?.find(e=>e.namespace===y.namespace&&e.name===y.name&&e.kind===y.kind);return e?M(e):O(),e},[b,y,v,D]),F=l(()=>{const e=A?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:A?.containers||[]}},[A]),R=l(()=>{const e=[{label:Hl.Overview,onClick:()=>w(Hl.Overview),selected:S===Hl.Overview}];return zl.includes(A?.kind)&&e.push({label:Hl.Pods,onClick:()=>w(Hl.Pods),selected:S===Hl.Pods}),A?.containers?.some(({language:e})=>Wl.includes(e))&&e.push({label:Hl.Libraries,onClick:()=>w(Hl.Libraries),selected:S===Hl.Libraries}),e},[S,A]);return A?e.createElement(Si,{ref:f,onClose:()=>{w(Hl.Overview),N(null)},title:A.otelServiceName||A.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:Le(A.containers),isEdit:x,isFormDirty:$,onEdit:S===Hl.Overview?e=>{C("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==A.name?I.otelServiceName:"";E("otelServiceName",e),await a(y,{...I,otelServiceName:e}),N(null),k(!1),C(!1)},onDelete:S===Hl.Overview?async()=>{const{namespace:e}=A;i({[e]:[{...A,selected:!1,currentStreamName:h}]},{}),N(null),k(!1),C(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{k(!1),C(!1),E("otelServiceName",A.otelServiceName||A.name||"")},isLastItem:1===v.length,tabs:R,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([y]),children:e.createElement(e.Fragment,null,e.createElement(Ro,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},S===Hl.Overview?x?e.createElement(jl,null,e.createElement(Rl,{formData:I,handleFormChange:(...e)=>{k(!0),E(...e),E("currentStreamName",h)}})):e.createElement(Vl,null,e.createElement(Ll,{workloadOdigosHealthStatus:A.workloadOdigosHealthStatus}),e.createElement(J,{conditions:A.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:A?Al(A,u):[]}),e.createElement(Y,{title:p.DETECTED_CONTAINERS,titleBadge:F.isLoading?pe.Loading:F.containers.length,description:F.description||p.DETECTED_CONTAINERS_DESCRIPTION},F.containers.map(t=>e.createElement(io,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await a(y,e)})))):S===Hl.Pods?e.createElement(Pl,{source:A,fetchSourceDescribe:c}):e.createElement(Kl,{source:A,fetchSourceLibraries:d})):null},Ul=d.div`
|
|
397
|
+
`,Bl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{isVm:u}=He(),{sources:m}=B(),{selectedStreamName:h}=ze(),{drawerType:g,drawerEntityId:y}=P(),v=l(()=>Ve(m,h),[m,h]),f=n(null),b=g===j.Source,[x,C]=t(!1),[$,k]=t(!1),[S,w]=t(Hl.Overview),[D,N]=t(null);o(()=>{b&&y&&s(y).then(e=>N(e||null))},[b,y]);const{formData:I,handleFormChange:E,resetFormData:O,loadFormWithDrawerItem:M}=oo(),A=l(()=>{if(!b)return O();const e=(D&&JSON.stringify(Vt(D))===JSON.stringify(Vt(y))?D:null)||v?.find(e=>e.namespace===y.namespace&&e.name===y.name&&e.kind===y.kind);return e?M(e):O(),e},[b,y,v,D]),F=l(()=>{const e=A?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:A?.containers||[]}},[A]),R=l(()=>{const e=[{label:Hl.Overview,onClick:()=>w(Hl.Overview),selected:S===Hl.Overview}];return zl.includes(A?.kind)&&e.push({label:Hl.Pods,onClick:()=>w(Hl.Pods),selected:S===Hl.Pods}),A?.containers?.some(({language:e})=>Wl.includes(e))&&e.push({label:Hl.Libraries,onClick:()=>w(Hl.Libraries),selected:S===Hl.Libraries}),e},[S,A]);return A?e.createElement(Si,{ref:f,onClose:()=>{w(Hl.Overview),N(null)},title:A.otelServiceName||A.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:Le(A.containers),isEdit:x,isFormDirty:$,onEdit:S===Hl.Overview?e=>{C("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=I.otelServiceName!==A.name?I.otelServiceName:"";E("otelServiceName",e),await a(y,{...I,otelServiceName:e}),N(null),k(!1),C(!1)},onDelete:S===Hl.Overview?async()=>{const{namespace:e}=A;i({[e]:[{...A,selected:!1,currentStreamName:h}]},{}),N(null),k(!1),C(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{k(!1),C(!1),E("otelServiceName",A.otelServiceName||A.name||"")},isLastItem:1===v.length,tabs:R,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([y]),children:e.createElement(e.Fragment,null,e.createElement(Ro,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},S===Hl.Overview?x?e.createElement(jl,null,e.createElement(Rl,{formData:I,handleFormChange:(...e)=>{k(!0),E(...e),E("currentStreamName",h)}})):e.createElement(Vl,null,e.createElement(Ll,{workloadOdigosHealthStatus:A.workloadOdigosHealthStatus}),e.createElement(J,{conditions:A.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:A?Al(A,u):[]}),e.createElement(Y,{title:u?p.DETECTED_PROCESSES:p.DETECTED_CONTAINERS,titleBadge:F.isLoading?pe.Loading:F.containers.length,description:F.description||(u?p.DETECTED_PROCESSES_DESCRIPTION:p.DETECTED_CONTAINERS_DESCRIPTION)},F.containers.map(t=>e.createElement(io,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await a(y,e)})))):S===Hl.Pods?e.createElement(Pl,{source:A,fetchSourceDescribe:c}):e.createElement(Kl,{source:A,fetchSourceLibraries:d})):null},Ul=d.div`
|
|
398
398
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
399
399
|
width: 100%;
|
|
400
400
|
`,_l=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),{isVm:r}=He(),s=lo({fetchSingleNamespace:o}),{availableSources:c,selectedSources:d,fetchingNamespace:u,selectedAllNamespaces:m,onSelectAllNamespaces:h,getApiSourcesPayload:g,getApiFutureAppsPayload:y,searchText:v,setSearchText:f,searchBy:b,setSearchBy:C,showSelectedOnly:$,setShowSelectedOnly:k,showRunningOnly:w,setShowRunningOnly:D}=s;a(n,()=>({getFormValues:()=>({initial:c,apps:g(),futureApps:y()})}));const N=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(oe,{$isNotModal:!t},e.createElement(X,{$gap:12},e.createElement(X,{$gap:24},i&&e.createElement(ht,{onClick:i}),e.createElement(O,{title:p.SELECT_SOURCES,badgeLabel:N,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Ul,{$fullWidth:r},e.createElement(x,{placeholder:b===j.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:To,value:v,onChange:e=>f(e.target.value.toLowerCase())})),!r&&e.createElement(E,{options:[{label:p.SOURCE,value:j.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:j.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:C})),e.createElement(ce,{$gap:36},e.createElement(S,{title:p.SELECT_ALL,initialValue:m,onChange:h,disabled:!!u}),e.createElement(S,{title:p.ONLY_SELECTED,initialValue:$,onChange:k}),e.createElement(S,{title:p.ONLY_RUNNING_INSTANCES,initialValue:w,onChange:D}))),e.createElement(le,null),e.createElement(Dl,{isModal:t,...s})))});_l.displayName=_l.name;const Gl=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:a}=Z(),l=i===j.Source,r=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=n(null);return q({key:"Enter",active:l},s),l?e.createElement(ee,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(_l,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Jl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:p.NAMESPACE,sortable:!0}),t.push({key:"containers",title:p.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Yl=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),{isVm:a}=He(),r=he(),{isThisPending:c}=R(),{selectedStreamName:d}=ze(),{sources:u,sourcesLoading:m}=B(),{setDrawerType:h,setDrawerEntityId:g}=P(),{selectedSources:y,setSelectedSources:f}=jt(),{isAwaitingInstrumentation:b,sourcesToCreate:x,sourcesCreated:C,sourcesToDelete:$,sourcesDeleted:k}=We(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,C):$?e($,k):1},[x,C,$,k]),w=l(()=>Ve(u,d),[u,d]),D=l(()=>Fi({instrumentationRules:[],sources:Be(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:j.Source}).searchResults.find(({category:e})=>e===j.Source)?.entities||[],[w,r]),[N,E]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),O=s(e=>{if(e){const e={};D.forEach(t=>{const o={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:j.Source,entityId:o})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),f(e)}else f({})},[D]),M=s(e=>{const{namespace:t,name:o,kind:i}=e,n={...y};n[t]||(n[t]=[]);const a=n[t].findIndex(e=>e.name===o&&e.kind===i);-1===a?n[t].push(e):n[t].splice(a,1),f(n)},[y]),A=l(()=>D.map(o=>{const i=Vt(o),a=JSON.stringify(i),{hasErrors:l,hasWarnings:r,hasDisableds:s}=re(o.conditions||[]),d=c({entityType:j.Source,entityId:i}),u=!!y[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?V.Error:r?V.Warning:void 0,faded:s,onClick:()=>{h(j.Source),g(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>M(o)}),e.createElement(ro,{icons:Le(o.containers),id:a}))},{columnKey:"name",value:ve(o,j.Source,{extended:!0})},{columnKey:"kind",value:o.kind,textColor:n.text.info},{columnKey:"namespace",value:o.namespace,textColor:n.text.info},{columnKey:"throughput",value:Oe(Et(t,j.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Mi,{conditions:o.conditions||[],id:a})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:V.Info,title:so(o.containers),withBorder:!0}))}]}}),[D,y,t,M]),{badge:F,badgeTooltip:L}=l(()=>D.length!==w.length?{badge:`${D.length}/${w.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[D,w]);return e.createElement(be,{$maxWidth:i},e.createElement(xe,null,e.createElement(v,{partiallyChecked:N&&D?.length!==E,value:N&&D?.length===E,onChange:O,disabled:!D?.length}),e.createElement(Ce,{icon:$e(j.Source),title:p.SOURCES,badge:F,badgeTooltip:L,loading:m||b})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:Jl(a),rows:A})),b&&!A.length?e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ne,{width:420}),e.createElement(ce,{$gap:16},e.createElement(T,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Te,{label:`${S}%`}))):A.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ql=({expiresAt:t})=>{const o=I.useTheme(),i=Bt().format(t),n=new Date(t).toDateString().split(" ").slice(1).join(" "),a=co(t,0)?o.text.error:co(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:a},i," (",n,")")},Xl=d.div`
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b2 as capitalizeFirstLetter,c1 as cleanObjectEmptyStringsValues,aX as compareCondition,b5 as deepClone,a3 as filterActions,az as filterDestinations,ay as filterDestinationsByStream,ax as filterSources,aw as filterSourcesByStream,c2 as flattenObjectKeys,aj as formatBytes,bO as formatDuration,z as getActionIcon,X as getConditionsBooleans,ao as getContainersIcons,bE as getContainersInstrumentedCount,ar as getDestinationIcon,aa as getEntityIcon,aG as getEntityId,a5 as getEntityLabel,c3 as getIdFromSseTarget,an as getInstrumentationRuleIcon,c4 as getMainContainerLanguage,b8 as getMetricForEntity,c5 as getMonitorIcon,c6 as getPlatformIcon,c7 as getPlatformLabel,bh as getProgrammingLanguageIcon,bQ as getRecursiveValues,c8 as getSseTargetFromId,a1 as getStatusIcon,br as getStatusTypeFromOdigosHealth,ap as getValueForRange,bm as getWorkloadId,b0 as getYamlFieldsForDestination,bs as hasUnhealthyInstances,i as isEmpty,c9 as isLegalK8sLabel,bF as isOverTime,bw as isStringABoolean,ca as isTimeElapsed,cb as isValidVersion,_ as mapConditions,aW as mapDestinationFieldsForDisplay,aq as mapExportedSignals,cc as numbersOnly,bx as parseBooleanFromString,cd as parseJsonStringToPrettyString,ce as removeEmptyValuesFromObject,aY as safeJsonParse,cf as safeJsonStringify,ah as sleep,aI as splitCamelString,cg as stringifyNonStringValues}from"./chunks/ui-components-
|
|
1
|
+
export{b2 as capitalizeFirstLetter,c1 as cleanObjectEmptyStringsValues,aX as compareCondition,b5 as deepClone,a3 as filterActions,az as filterDestinations,ay as filterDestinationsByStream,ax as filterSources,aw as filterSourcesByStream,c2 as flattenObjectKeys,aj as formatBytes,bO as formatDuration,z as getActionIcon,X as getConditionsBooleans,ao as getContainersIcons,bE as getContainersInstrumentedCount,ar as getDestinationIcon,aa as getEntityIcon,aG as getEntityId,a5 as getEntityLabel,c3 as getIdFromSseTarget,an as getInstrumentationRuleIcon,c4 as getMainContainerLanguage,b8 as getMetricForEntity,c5 as getMonitorIcon,c6 as getPlatformIcon,c7 as getPlatformLabel,bh as getProgrammingLanguageIcon,bQ as getRecursiveValues,c8 as getSseTargetFromId,a1 as getStatusIcon,br as getStatusTypeFromOdigosHealth,ap as getValueForRange,bm as getWorkloadId,b0 as getYamlFieldsForDestination,bs as hasUnhealthyInstances,i as isEmpty,c9 as isLegalK8sLabel,bF as isOverTime,bw as isStringABoolean,ca as isTimeElapsed,cb as isValidVersion,_ as mapConditions,aW as mapDestinationFieldsForDisplay,aq as mapExportedSignals,cc as numbersOnly,bx as parseBooleanFromString,cd as parseJsonStringToPrettyString,ce as removeEmptyValuesFromObject,aY as safeJsonParse,cf as safeJsonStringify,ah as sleep,aI as splitCamelString,cg as stringifyNonStringValues}from"./chunks/ui-components-62ddbe0d.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{x as useActionFormData,ck as useBodyScroll,aB as useClickNode,bo as useClickNotification,as as useConnection,av as useContainerSize,bG as useCopy,aP as useDataStreamFormData,a$ as useDestinationFormData,bH as useGenericForm,bi as useInstrumentationRuleFormData,q as useKeyDown,aH as useOnClickOutside,aC as usePopup,aO as useSessionStorage,by as useSourceFormData,bC as useSourceSelectionFormData,bn as useTimeAgo,bk as useTransition}from"./chunks/ui-components-
|
|
1
|
+
export{x as useActionFormData,ck as useBodyScroll,aB as useClickNode,bo as useClickNotification,as as useConnection,av as useContainerSize,bG as useCopy,aP as useDataStreamFormData,a$ as useDestinationFormData,bH as useGenericForm,bi as useInstrumentationRuleFormData,q as useKeyDown,aH as useOnClickOutside,aC as usePopup,aO as useSessionStorage,by as useSourceFormData,bC as useSourceSelectionFormData,bn as useTimeAgo,bk as useTransition}from"./chunks/ui-components-62ddbe0d.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|