@odigos/ui-kit 0.0.174 → 0.0.176

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.
@@ -1 +1 @@
1
- export{B as Badge,m as Button,w as ButtonSize,ds as ButtonTab,dt as ButtonTabList,n as ButtonVariants,C as Checkbox,dw as CheckboxList,dv as CheckboxSize,Q as CliCommand,K as DataCard,i as Drawer,dy as DropData,G as DropDataAlignX,dx as DropDataAlignY,dz as Header,c7 as HoverActions,M as IconButton,cj as IconButtonSize,dA as Input,I as Island,L as Loader,dB as Modal,dC as Navbar,l as Note,dE as Radio,dF as RadioGroup,dD as RadioSize,k as Search,t as SectionCard,du as SectionCardSize,U as Segment,dG as SegmentSize,W as StatusCard,x as Table,y as TableVariant,dH as Tag,X as TextCard,d as Toggle,dJ as ToggleLabelAlign,dK as ToggleList,e as ToggleSize,dI as ToggleVariant,T as Typography,b as TypographySize,f as TypographyVariants,dL as WarningModal}from"../chunks/ui-components-e5ad46f1.js";import"../icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"../chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
1
+ export{B as Badge,m as Button,v as ButtonSize,ds as ButtonTab,dt as ButtonTabList,n as ButtonVariants,C as Checkbox,dw as CheckboxList,dv as CheckboxSize,U as CliCommand,M as DataCard,i as Drawer,dy as DropData,w as DropDataAlignX,dx as DropDataAlignY,dz as Header,c8 as HoverActions,Q as IconButton,ck as IconButtonSize,dA as Input,I as Island,L as Loader,dB as Modal,dC as Navbar,l as Note,dE as Radio,dF as RadioGroup,dD as RadioSize,k as Search,y as SectionCard,du as SectionCardSize,V as Segment,dG as SegmentSize,X as StatusCard,z as Table,G as TableVariant,dH as Tag,Z as TextCard,d as Toggle,dJ as ToggleLabelAlign,dK as ToggleList,e as ToggleSize,dI as ToggleVariant,T as Typography,b as TypographySize,f as TypographyVariants,dL as WarningModal}from"../chunks/ui-components-849a6a02.js";import"../icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"../chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
package/lib/components.js CHANGED
@@ -1 +1 @@
1
- export{aH as AutocompleteInput,a_ as Badge,b0 as Button,as as CancelWarning,j as CenterThis,a6 as Checkbox,d9 as Code,ay as ConditionDetails,az as DataCard,a2 as DataCardFieldTypes,bJ as DataCardFields,da as DataFinger,b2 as DataTab,ar as DeleteWarning,c5 as DescribeRow,aI as Divider,ak as DocsButton,aq as Drawer,dc as DrawerFooter,db as DrawerHeader,bo as Dropdown,dd as ErrorBoundary,bw as ExtendArrow,q as FadeLoader,a7 as FieldError,a5 as FieldLabel,F as FlexColumn,a as FlexRow,de as Header,bv as IconButton,cf as IconGroup,aV as IconTitleBadge,aQ as IconWrapped,c1 as IconsNav,df as ImageControlled,a9 as Input,af as InputList,ac as InputTable,aY as InteractiveTable,ae as KeyValueInputsList,b$ as LoadingText,aC as Modal,aE as ModalBody,al as MonitorsCheckboxes,aS as MonitorsIcons,aD as NavigationButtons,N as NoDataFound,aF as NotificationNote,dl as Overlay,s as PageContent,bj as Popup,ck as PopupForm,cp as ScrollX,b5 as ScrollY,aj as SectionTitle,ai as Segment,bk as SelectionButton,ba as SkeletonLoader,aK as Status,bI as Stepper,dg as TabList,aT as TableContainer,aU as TableTitleWrap,aX as TableWrap,bS as Tag,ah as Text,am as TextArea,ad as Toggle,cn as ToggleCodeComponent,c as Tooltip,aZ as TraceLoader,$ as UpgradeRequiredWrapper,bl as VerticalScroll,dk as WarningModal,dh as getLinksFromText,di as getStrongsFromText,dj as renderText}from"./chunks/ui-components-e5ad46f1.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
1
+ export{aI as AutocompleteInput,a$ as Badge,b1 as Button,at as CancelWarning,j as CenterThis,a7 as Checkbox,d9 as Code,az as ConditionDetails,aA as DataCard,a3 as DataCardFieldTypes,bJ as DataCardFields,da as DataFinger,b3 as DataTab,as as DeleteWarning,c6 as DescribeRow,aJ as Divider,al as DocsButton,ar as Drawer,dc as DrawerFooter,db as DrawerHeader,bo as Dropdown,dd as ErrorBoundary,bw as ExtendArrow,r as FadeLoader,a8 as FieldError,a6 as FieldLabel,F as FlexColumn,a as FlexRow,de as Header,bv as IconButton,cg as IconGroup,aW as IconTitleBadge,aR as IconWrapped,c2 as IconsNav,df as ImageControlled,aa as Input,ag as InputList,ad as InputTable,aZ as InteractiveTable,af as KeyValueInputsList,c0 as LoadingText,aD as Modal,aF as ModalBody,am as MonitorsCheckboxes,aT as MonitorsIcons,aE as NavigationButtons,N as NoDataFound,aG as NotificationNote,dl as Overlay,x as PageContent,bj as Popup,cl as PopupForm,cq as ScrollX,b6 as ScrollY,ak as SectionTitle,aj as Segment,bk as SelectionButton,bb as SkeletonLoader,aL as Status,bI as Stepper,dg as TabList,aU as TableContainer,aV as TableTitleWrap,aY as TableWrap,bS as Tag,ai as Text,an as TextArea,ae as Toggle,co as ToggleCodeComponent,c as Tooltip,a_ as TraceLoader,a0 as UpgradeRequiredWrapper,bl as VerticalScroll,dk as WarningModal,dh as getLinksFromText,di as getStrongsFromText,dj as renderText}from"./chunks/ui-components-849a6a02.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
package/lib/constants.js CHANGED
@@ -1 +1 @@
1
- export{aw as ACTION_OPTIONS,ap as BUTTON_TEXTS,D as DEFAULT_DATA_STREAM_NAME,bH as DESTINATION_CATEGORIES,bp as DISPLAY_LANGUAGES,a1 as DISPLAY_TITLES,aG as FORM_ALERTS,bW as INSTRUMENTATION_RULE_OPTIONS,d0 as LANGUAGE_OPTIONS,bq as MONITORS_OPTIONS,d1 as OTEL_DISTRO_NAME_OPTIONS,br as STORAGE_KEYS,d2 as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-e5ad46f1.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
1
+ export{ax as ACTION_OPTIONS,aq as BUTTON_TEXTS,D as DEFAULT_DATA_STREAM_NAME,bH as DESTINATION_CATEGORIES,bp as DISPLAY_LANGUAGES,a2 as DISPLAY_TITLES,aH as FORM_ALERTS,bW as INSTRUMENTATION_RULE_OPTIONS,d0 as LANGUAGE_OPTIONS,bq as MONITORS_OPTIONS,d1 as OTEL_DISTRO_NAME_OPTIONS,br as STORAGE_KEYS,d2 as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-849a6a02.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
@@ -14,4 +14,5 @@ export interface ConfigDrawerProps {
14
14
  onApply: ApplyConfigurationsFunc;
15
15
  }
16
16
  export declare const CONFIG_DRAWER_WIDTH = "75vw";
17
+ export declare const CONFIG_MIN_SUPPORTED_VERSION = 1.16;
17
18
  export declare const ConfigDrawer: FC<ConfigDrawerProps>;
@@ -1,7 +1,7 @@
1
1
  import { type FC } from 'react';
2
2
  import { CSSProperties } from 'styled-components';
3
- import { type GetEffectiveConfig, type ApplyConfigurationsFunc } from './config-drawer';
4
3
  import { type Connection, type GetAllClusterSnapshots, type PersistSourcesFunc } from '@/types';
4
+ import { type GetEffectiveConfig, type ApplyConfigurationsFunc } from './config-drawer';
5
5
  export { type GetEffectiveConfig, type ApplyConfigurationsFunc };
6
6
  export interface CentralConnectionsProps {
7
7
  tableRowsMaxHeight: CSSProperties['maxHeight'];
@@ -5,7 +5,6 @@ interface FrameProps {
5
5
  entityType: EntityTypes;
6
6
  entities: Source[] | Destination[] | Action[] | InstrumentationRule[];
7
7
  metrics?: Metrics;
8
- isVm: boolean;
9
8
  }
10
9
  declare const Frame: FC<FrameProps>;
11
10
  export { Frame, type FrameProps };
@@ -7,7 +7,6 @@ interface ColumnProps {
7
7
  metrics?: Metrics;
8
8
  loading: boolean;
9
9
  maxHeight: number;
10
- isVm: boolean;
11
10
  refetch: () => void;
12
11
  }
13
12
  declare const Column: FC<ColumnProps>;
@@ -1,7 +1,6 @@
1
1
  import { type FC } from 'react';
2
2
  import { type InstrumentationRuleFormData } from '@/types';
3
3
  interface InstrumentationRuleModalProps {
4
- isEnterprise: boolean;
5
4
  createInstrumentationRule: (instrumentationRule: InstrumentationRuleFormData) => void;
6
5
  }
7
6
  declare const InstrumentationRuleModal: FC<InstrumentationRuleModalProps>;
@@ -1,8 +1,8 @@
1
- import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react";import o,{useTheme as s}from"styled-components";import{F as i,a as r,C as c,T as d,b as u,B as p,S as g,c as m,O as h,N as b,d as f,e as y,f as w,u as C,g as v,D as k,E as x,h as $,i as S,j as I,L as A,P as D,R as P,k as R,l as T,m as z,n as N,o as L,p as M,q as V,r as O,s as W,t as F,v as j,A as E,w as U,x as H,y as G,z as q,I as Y,G as B,H as K,J as X,K as J,M as Q,Q as Z,Y as _,U as ee,V as te,W as ae,X as le,Z as ne,_ as oe,$ as se,a0 as ie}from"../chunks/ui-components-e5ad46f1.js";import{SourceIcon as re,VSquareIcon as ce,SettingsIcon as de,OdigosLogo as ue,ConnectionsIcon as pe,RefreshIcon as ge,DeleteIcon as me,VIcon as he,XIcon as be,XSquareIcon as fe,PodIcon as ye,ChevronUpIcon as we,ChevronDownIcon as Ce,TerminalIcon as ve,ArrowDownSquareIcon as ke,ArrowUpSquareIcon as xe,DownloadIcon as $e,PipelineCollectorIcon as Se,GatewayIcon as Ie,YamlIcon as Ae}from"../icons.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const De=o(i)`
1
+ import e,{useMemo as t,useState as a,useEffect as l,useCallback as o}from"react";import n,{useTheme as s}from"styled-components";import{F as i,a as r,C as c,T as d,b as u,B as p,S as g,c as m,O as h,N as b,d as f,e as y,f as w,u as C,g as v,D as k,E as x,h as $,i as S,j as I,L as A,P,R as D,k as T,l as R,m as z,n as N,o as L,p as M,q as V,r as O,s as W,t as F,A as j,v as E,w as U,x as H,y as G,z as q,G as Y,H as B,I as K,J as X,K as J,M as Q,Q as Z,U as _,Y as ee,V as te,W as ae,X as le,Z as oe,_ as ne,$ as se,a0 as ie,a1 as re}from"../chunks/ui-components-849a6a02.js";import{SourceIcon as ce,VSquareIcon as de,SettingsIcon as ue,OdigosLogo as pe,DeleteIcon as ge,ConnectionsIcon as me,RefreshIcon as he,VIcon as be,XIcon as fe,XSquareIcon as ye,PodIcon as we,ChevronUpIcon as Ce,ChevronDownIcon as ve,TerminalIcon as ke,ArrowDownSquareIcon as xe,ArrowUpSquareIcon as $e,DownloadIcon as Se,PipelineCollectorIcon as Ie,GatewayIcon as Ae,YamlIcon as Pe}from"../icons.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const De=n(i)`
2
2
  width: ${({$width:e})=>e};
3
3
  gap: 12px;
4
4
  justify-content: space-between;
5
- `,Pe=o.div`
5
+ `,Te=n.div`
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  padding: 12px;
@@ -13,7 +13,7 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
13
13
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
14
14
  overflow-y: auto;
15
15
  overflow-x: hidden;
16
- `,Re=o.div`
16
+ `,Re=n.div`
17
17
  display: flex;
18
18
  align-items: center;
19
19
  justify-content: space-between;
@@ -25,55 +25,55 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
25
25
  &:hover {
26
26
  background-color: ${({theme:e})=>e.v2.colors.silver[600]};
27
27
  }
28
- `,Te=({formData:a,handleSourceChange:l,handleSelectAll:n,selectedArea:o,searchText:i,filters:f})=>{const y=s(),{activeNamespace:w,isAll:C,isSome:v}=t(()=>{const e=o.value.clusterId&&o.value.namespaceName?a.find(({clusterId:e})=>e===o.value.clusterId)?.namespaces.find(({name:e})=>e===o.value.namespaceName):void 0;if(!e)return{activeNamespace:void 0,isAll:!1,isSome:!1};const t=e.workloads.filter(({selected:e})=>e).length;return{activeNamespace:e,isAll:t>0&&t===e.workloads.length,isSome:t>0&&t<e.workloads.length}},[a,o.value.clusterId,o.value.namespaceName]),k=t(()=>{if(!w)return[];const{clusterId:t}=o.value,{name:a,workloads:n}=w;return n.map(({name:n,selected:o,kind:s})=>{if(i&&!n.toLowerCase().includes(i.toLowerCase()))return null;const m=o||!1;if(f.showOnlySelected&&!m)return null;const h=()=>l({clusterId:t,workloadId:{namespace:a,name:n,kind:s}});return e.createElement(Re,{key:`${t}#${a}#${n}#${s}`,onClick:h},e.createElement(r,{$gap:12},e.createElement(c,{value:m,onChange:h}),e.createElement(d,{size:u.XS},n)),e.createElement(p,{label:s,status:g.Info,textSize:u.XXXS,backgroundColor:y.v2.colors.blue[900]}))})},[a,o.value.clusterId,w,i,f]);return e.createElement(De,{$width:"50%"},e.createElement(r,{$padding:"0 12px 0 28px",$gap:12},e.createElement(m,{text:(C?"Unselect":"Select")+" all workloads in the selected namespace"},e.createElement(c,{partiallyChecked:v,value:C,onChange:()=>n({clusterId:o.value.clusterId,namespaceName:o.value.namespaceName,boolean:!C}),disabled:!k.length})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS,nowrap:!0},o.value.clusterId?`${o.value.clusterName} > ${o.value.namespaceName} > Workloads`:"Workloads"),e.createElement(p,{label:k.length,status:h.Unknown}))),e.createElement(Pe,{$borderRadius:"0 16px 16px 0"},k.length?k:e.createElement(b,{title:"Workloads not found",subTitle:"Please select a namespace to view workloads"})))},ze=({formData:a,handleSourceChange:l,handleSelectAll:n,selectedArea:o,searchText:i,filters:C})=>{const v=s(),{isAll:k,isSome:x}=t(()=>{const e=a.length>0&&a.every(({namespaces:e})=>e.every(({workloads:e})=>e.every(({selected:e})=>e)));return{isAll:e,isSome:!e&&a.length>0&&a.some(({namespaces:e})=>e.some(({workloads:e})=>e.some(({selected:e})=>e)))}},[a]),$=t(()=>a.flatMap(({clusterId:t,clusterName:a,namespaces:n})=>n.map(({name:n,workloads:s,selected:b})=>{if(i&&!n.toLowerCase().includes(i.toLowerCase()))return null;const k=s.filter(({selected:e})=>e).length,x=k>0&&k===s.length,$=k>0&&k<s.length,S=b||!1;if(C.showOnlySelected&&!x&&!$&&!S)return null;const I=o.value.clusterId===t&&o.value.namespaceName===n,A=()=>o.setValue({clusterId:t,clusterName:a,namespaceName:n}),D=e=>{A(),l({clusterId:t,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return e.createElement(Re,{key:`${t}#${n}`,$isSelected:I,onClick:A},e.createElement(r,{$gap:12},e.createElement(c,{partiallyChecked:$,value:x,onChange:e=>D({auto:e,all:e})}),e.createElement(d,{size:u.XS},`${a} > ${n}`)),e.createElement(r,{$gap:12},e.createElement(m,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future"},e.createElement(f,{label:"Auto",size:y.S,value:S,onChange:e=>D({auto:e,all:e||void 0})})),e.createElement(r,{$gap:8},e.createElement(d,{variant:w.Span,size:u.XXXS,color:v.v2.colors.silver[200],align:"right"},"Selected"),e.createElement(p,{label:`${k}/${s.length}`,status:I?g.Default:h.Unknown,minWidth:"42px"}))))})),[a,o.value.clusterId,o.value.namespaceName,i,C]);return e.createElement(De,{$width:"50%"},e.createElement(r,{$padding:"0 12px 0 28px",$gap:12},e.createElement(m,{text:(k?"Unselect":"Select")+" all workloads in all namespaces"},e.createElement(c,{partiallyChecked:x,value:k,onChange:()=>n({boolean:!k}),disabled:!$.length})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS,nowrap:!0},"Namespaces"),e.createElement(p,{label:$.length,status:h.Unknown}))),e.createElement(Pe,{$borderRadius:"16px 0 0 16px"},$.length?$:e.createElement(b,{title:"Namespaces not found",subTitle:""})))},Ne="75vw",Le=o.div`
28
+ `,ze=({formData:a,handleSourceChange:l,handleSelectAll:o,selectedArea:n,searchText:i,filters:f})=>{const y=s(),{activeNamespace:w,isAll:C,isSome:v}=t(()=>{const e=n.value.clusterId&&n.value.namespaceName?a.find(({clusterId:e})=>e===n.value.clusterId)?.namespaces.find(({name:e})=>e===n.value.namespaceName):void 0;if(!e)return{activeNamespace:void 0,isAll:!1,isSome:!1};const t=e.workloads.filter(({selected:e})=>e).length;return{activeNamespace:e,isAll:t>0&&t===e.workloads.length,isSome:t>0&&t<e.workloads.length}},[a,n.value.clusterId,n.value.namespaceName]),k=t(()=>{if(!w)return[];const{clusterId:t}=n.value,{name:a,workloads:o}=w;return o.map(({name:o,selected:n,kind:s})=>{if(i&&!o.toLowerCase().includes(i.toLowerCase()))return null;const m=n||!1;if(f.showOnlySelected&&!m)return null;const h=()=>l({clusterId:t,workloadId:{namespace:a,name:o,kind:s}});return e.createElement(Re,{key:`${t}#${a}#${o}#${s}`,onClick:h},e.createElement(r,{$gap:12},e.createElement(c,{value:m,onChange:h}),e.createElement(d,{size:u.XS},o)),e.createElement(p,{label:s,status:g.Info,textSize:u.XXXS,backgroundColor:y.v2.colors.blue[900]}))})},[a,n.value.clusterId,w,i,f]);return e.createElement(De,{$width:"50%"},e.createElement(r,{$padding:"0 12px 0 28px",$gap:12},e.createElement(m,{text:(C?"Unselect":"Select")+" all workloads in the selected namespace"},e.createElement(c,{partiallyChecked:v,value:C,onChange:()=>o({clusterId:n.value.clusterId,namespaceName:n.value.namespaceName,boolean:!C}),disabled:!k.length})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS,nowrap:!0},n.value.clusterId?`${n.value.clusterName} > ${n.value.namespaceName} > Workloads`:"Workloads"),e.createElement(p,{label:k.length,status:h.Unknown}))),e.createElement(Te,{$borderRadius:"0 16px 16px 0"},k.length?k:e.createElement(b,{title:"Workloads not found",subTitle:"Please select a namespace to view workloads"})))},Ne=({formData:a,handleSourceChange:l,handleSelectAll:o,selectedArea:n,searchText:i,filters:C})=>{const v=s(),{isAll:k,isSome:x}=t(()=>{const e=a.length>0&&a.every(({namespaces:e})=>e.every(({workloads:e})=>e.every(({selected:e})=>e)));return{isAll:e,isSome:!e&&a.length>0&&a.some(({namespaces:e})=>e.some(({workloads:e})=>e.some(({selected:e})=>e)))}},[a]),$=t(()=>a.flatMap(({clusterId:t,clusterName:a,namespaces:o})=>o.map(({name:o,workloads:s,selected:b})=>{if(i&&!o.toLowerCase().includes(i.toLowerCase()))return null;const k=s.filter(({selected:e})=>e).length,x=k>0&&k===s.length,$=k>0&&k<s.length,S=b||!1;if(C.showOnlySelected&&!x&&!$&&!S)return null;const I=n.value.clusterId===t&&n.value.namespaceName===o,A=()=>n.setValue({clusterId:t,clusterName:a,namespaceName:o}),P=e=>{A(),l({clusterId:t,workloadId:{namespace:o},auto:e.auto,selected:e.all})};return e.createElement(Re,{key:`${t}#${o}`,$isSelected:I,onClick:A},e.createElement(r,{$gap:12},e.createElement(c,{partiallyChecked:$,value:x,onChange:e=>P({auto:e,all:e})}),e.createElement(d,{size:u.XS},`${a} > ${o}`)),e.createElement(r,{$gap:12},e.createElement(m,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future"},e.createElement(f,{label:"Auto",size:y.S,value:S,onChange:e=>P({auto:e,all:e||void 0})})),e.createElement(r,{$gap:8},e.createElement(d,{variant:w.Span,size:u.XXXS,color:v.v2.colors.silver[200],align:"right"},"Selected"),e.createElement(p,{label:`${k}/${s.length}`,status:I?g.Default:h.Unknown,minWidth:"42px"}))))})),[a,n.value.clusterId,n.value.namespaceName,i,C]);return e.createElement(De,{$width:"50%"},e.createElement(r,{$padding:"0 12px 0 28px",$gap:12},e.createElement(m,{text:(k?"Unselect":"Select")+" all workloads in all namespaces"},e.createElement(c,{partiallyChecked:x,value:k,onChange:()=>o({boolean:!k}),disabled:!$.length})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS,nowrap:!0},"Namespaces"),e.createElement(p,{label:$.length,status:h.Unknown}))),e.createElement(Te,{$borderRadius:"16px 0 0 16px"},$.length?$:e.createElement(b,{title:"Namespaces not found",subTitle:""})))},Le="75vw",Me=n.div`
29
29
  display: flex;
30
30
  flex-direction: column;
31
31
  border-radius: 16px;
32
32
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
33
33
  overflow: hidden;
34
- `,Me=o.div`
34
+ `,Ve=n.div`
35
35
  display: flex;
36
36
  gap: 12px;
37
37
  padding: 16px;
38
38
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
39
39
  position: sticky;
40
40
  top: 0;
41
- `,Ve=o.div`
41
+ `,Oe=n.div`
42
42
  display: flex;
43
43
  gap: 12px;
44
44
  padding: 16px;
45
- `,Oe=o.div`
45
+ `,We=n.div`
46
46
  padding: 5vh 10vw;
47
47
  border-radius: 12px;
48
48
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
49
- `,We=o.div`
49
+ `,Fe=n.div`
50
50
  display: flex;
51
51
  align-items: center;
52
52
  justify-content: flex-end;
53
53
  gap: 16px;
54
54
  padding: 0 12px;
55
- `,Fe=({onClose:o,snapshots:i,selectedConnectionIds:c,setSelectedConnectionIds:p,persistSources:m})=>{const h=s(),{selectedStreamName:b}=C(),{progress:w,resetProgress:M}=v(),V=t(()=>b||k,[b]),[O,W]=a(""),[F,j]=a(x.Namespace),[E,U]=a({showOnlySelected:!1}),[H,G]=a(!1),[q,Y]=a(!1),[B,K]=a(void 0),[X,J]=a({clusterId:"",clusterName:"",namespaceName:""}),[Q,Z]=a([]);l(()=>{Z(e=>{const t=((e,t)=>$(((e,t)=>e.clusters.filter(({clusterId:e})=>t.includes(e)))(e,t)))(i,c);return t.map(t=>{const a=e?.find(e=>e.clusterId===t.clusterId);return a??t})})},[i,c]);const{formDiff:_,isFormDirty:ee}=t(()=>{const e=((e,t,a)=>{const l={};return e.forEach(e=>{e.namespaces.forEach(n=>{const o=t.find(t=>t.clusterId===e.clusterId)?.namespaces.find(e=>e.name===n.name),s=n.selected||!1,i=s!==o?.selected;if(i&&(l[e.clusterId]||(l[e.clusterId]=[]),l[e.clusterId].push({namespace:n.name,selected:s,currentStreamName:a}),s&&(l[e.clusterId]=l[e.clusterId].filter(e=>e.namespace!==n.name||e.namespace===n.name&&(!e.name||!e.kind)))),!i||!s){const t=((e,t,a)=>{const l=[];return t.workloads.forEach(n=>{const o=e?.workloads.find(e=>e.name===n.name&&e.kind===n.kind);n.selected!==o?.selected&&l.push({namespace:t.name,name:n.name,kind:n.kind,selected:n.selected||!1,currentStreamName:a})}),l})(o,n,a);t.length>0&&(l[e.clusterId]||(l[e.clusterId]=[]),l[e.clusterId].push(...t))}})}),l})(Q,i.clusters,V);return{formDiff:e,isFormDirty:Object.keys(e).length>0}},[Q,i,V]),te=n(({clusterId:e,workloadId:t,selected:a,auto:l})=>{Z(n=>{const o=$(n),s=o.findIndex(t=>t.clusterId===e);if(-1===s)return o;const i=o[s].namespaces.findIndex(e=>e.name===t.namespace);if(-1===i)return o;if(t.kind&&t.name){const e=o[s].namespaces[i].workloads.findIndex(e=>e.name===t.name&&e.kind===t.kind);if(-1===e)return o;const l="boolean"==typeof a?a:!o[s].namespaces[i].workloads[e].selected;o[s].namespaces[i].workloads[e].selected=l,l?o[s].namespaces[i].workloads.every(e=>e.selected)&&(o[s].namespaces[i].selected=!0):o[s].namespaces[i].selected=!1}else{const e="boolean"==typeof l?l:!o[s].namespaces[i].selected;o[s].namespaces[i].selected=e,e?o[s].namespaces[i].workloads.forEach(e=>{e.selected=!0}):"boolean"!=typeof a||a||o[s].namespaces[i].workloads.forEach(e=>{e.selected=!1})}return o})},[]),ae=n(({clusterId:e,namespaceName:t,boolean:a})=>{Z(l=>{const n=$(l);return n.forEach((l,o)=>{e&&l.clusterId!==e||l.namespaces.forEach(({name:e,workloads:l},s)=>{t&&e!==t||(n[o].namespaces[s].selected=a,l.forEach((e,t)=>{n[o].namespaces[s].workloads[t].selected=a}))})}),n})},[]),le=()=>{G(!1),o()};return e.createElement(S,{isOpen:!0,hideOverlay:!q,width:Ne,header:{icon:re,title:"Manage Sources",onClose:o,onCloseDisabled:q}},q?e.createElement(I,{$height:"calc(100vh - 136px)"},e.createElement(Oe,null,e.createElement(A,{title:"Creating Sources...",titleSize:u.S,subTitle:"This may take a few moments while sources are being created.",subTitleSize:u.XXXS,withGradient:!0,withSpinner:!0,prettySpinner:!0,percentage:w[D.BulkInstrumenting]?.percentage||0}))):e.createElement(Le,null,e.createElement(Me,null,e.createElement(P,{icon:ce,title:"Selected Clusters",badge:{label:c.length}}),e.createElement(R,{width:"300px",value:O,onChange:W,segment:{options:[{label:"Namespace",value:x.Namespace},{label:"Source",value:x.Source}],selected:F,setSelected:j}}),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:h.v2.colors.silver[200],nowrap:!0},"Show only:"),e.createElement(f,{size:y.S,label:"Selected",value:E.showOnlySelected,onChange:e=>U(t=>({...t,showOnlySelected:e}))}))),e.createElement(Ve,null,e.createElement(ze,{formData:Q,handleSourceChange:te,handleSelectAll:ae,selectedArea:{value:X,setValue:J},searchText:F===x.Namespace?O:"",filters:E}),e.createElement(Te,{formData:Q,handleSourceChange:te,handleSelectAll:ae,selectedArea:{value:X,setValue:J},searchText:F===x.Source?O:"",filters:E}))),e.createElement(We,null,q?null:B?e.createElement(T,{fullWidth:!0,status:g.Error,message:B}):ee?e.createElement(T,{fullWidth:!0,status:g.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):ee?null:e.createElement(T,{fullWidth:!0,status:g.Success,message:"The values reflect the current configuration of the selected cluster."}),e.createElement(r,{$gap:8},e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Secondary,label:"Cancel",onClick:()=>ee?G(!0):le(),disabled:!ee||q})),e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Primary,label:"Save",onClick:async()=>{Y(!0);const e=await m(_);M(D.BulkInstrumenting),Y(!1),e?.error?K(e.error):(p([]),o())},disabled:!ee||q})))),e.createElement(L,{isOpen:H,onClose:()=>G(!1),onApprove:le}))},je="75vw",Ee=o.div`
55
+ `,je=({onClose:n,snapshots:i,selectedConnectionIds:c,setSelectedConnectionIds:p,persistSources:m})=>{const h=s(),{selectedStreamName:b}=C(),{progress:w,resetProgress:M}=v(),V=t(()=>b||k,[b]),[O,W]=a(""),[F,j]=a(x.Namespace),[E,U]=a({showOnlySelected:!1}),[H,G]=a(!1),[q,Y]=a(!1),[B,K]=a(void 0),[X,J]=a({clusterId:"",clusterName:"",namespaceName:""}),[Q,Z]=a([]);l(()=>{Z(e=>{const t=((e,t)=>$(((e,t)=>e.clusters.filter(({clusterId:e})=>t.includes(e)))(e,t)))(i,c);return t.map(t=>{const a=e?.find(e=>e.clusterId===t.clusterId);return a??t})})},[i,c]);const{formDiff:_,isFormDirty:ee}=t(()=>{const e=((e,t,a)=>{const l={};return e.forEach(e=>{e.namespaces.forEach(o=>{const n=t.find(t=>t.clusterId===e.clusterId)?.namespaces.find(e=>e.name===o.name),s=o.selected||!1,i=s!==n?.selected;if(i&&(l[e.clusterId]||(l[e.clusterId]=[]),l[e.clusterId].push({namespace:o.name,selected:s,currentStreamName:a}),s&&(l[e.clusterId]=l[e.clusterId].filter(e=>e.namespace!==o.name||e.namespace===o.name&&(!e.name||!e.kind)))),!i||!s){const t=((e,t,a)=>{const l=[];return t.workloads.forEach(o=>{const n=e?.workloads.find(e=>e.name===o.name&&e.kind===o.kind);o.selected!==n?.selected&&l.push({namespace:t.name,name:o.name,kind:o.kind,selected:o.selected||!1,currentStreamName:a})}),l})(n,o,a);t.length>0&&(l[e.clusterId]||(l[e.clusterId]=[]),l[e.clusterId].push(...t))}})}),l})(Q,i.clusters,V);return{formDiff:e,isFormDirty:Object.keys(e).length>0}},[Q,i,V]),te=o(({clusterId:e,workloadId:t,selected:a,auto:l})=>{Z(o=>{const n=$(o),s=n.findIndex(t=>t.clusterId===e);if(-1===s)return n;const i=n[s].namespaces.findIndex(e=>e.name===t.namespace);if(-1===i)return n;if(t.kind&&t.name){const e=n[s].namespaces[i].workloads.findIndex(e=>e.name===t.name&&e.kind===t.kind);if(-1===e)return n;const l="boolean"==typeof a?a:!n[s].namespaces[i].workloads[e].selected;n[s].namespaces[i].workloads[e].selected=l,l?n[s].namespaces[i].workloads.every(e=>e.selected)&&(n[s].namespaces[i].selected=!0):n[s].namespaces[i].selected=!1}else{const e="boolean"==typeof l?l:!n[s].namespaces[i].selected;n[s].namespaces[i].selected=e,e?n[s].namespaces[i].workloads.forEach(e=>{e.selected=!0}):"boolean"!=typeof a||a||n[s].namespaces[i].workloads.forEach(e=>{e.selected=!1})}return n})},[]),ae=o(({clusterId:e,namespaceName:t,boolean:a})=>{Z(l=>{const o=$(l);return o.forEach((l,n)=>{e&&l.clusterId!==e||l.namespaces.forEach(({name:e,workloads:l},s)=>{t&&e!==t||(o[n].namespaces[s].selected=a,l.forEach((e,t)=>{o[n].namespaces[s].workloads[t].selected=a}))})}),o})},[]),le=()=>{G(!1),n()};return e.createElement(S,{isOpen:!0,hideOverlay:!q,width:Le,header:{icon:ce,title:"Manage Sources",onClose:n,onCloseDisabled:q}},q?e.createElement(I,{$height:"calc(100vh - 136px)"},e.createElement(We,null,e.createElement(A,{title:"Creating Sources...",titleSize:u.S,subTitle:"This may take a few moments while sources are being created.",subTitleSize:u.XXXS,withGradient:!0,withSpinner:!0,prettySpinner:!0,percentage:w[P.BulkInstrumenting]?.percentage||0}))):e.createElement(Me,null,e.createElement(Ve,null,e.createElement(D,{icon:de,title:"Selected Clusters",badge:{label:c.length}}),e.createElement(T,{width:"300px",value:O,onChange:W,segment:{options:[{label:"Namespace",value:x.Namespace},{label:"Source",value:x.Source}],selected:F,setSelected:j}}),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:h.v2.colors.silver[200],nowrap:!0},"Show only:"),e.createElement(f,{size:y.S,label:"Selected",value:E.showOnlySelected,onChange:e=>U(t=>({...t,showOnlySelected:e}))}))),e.createElement(Oe,null,e.createElement(Ne,{formData:Q,handleSourceChange:te,handleSelectAll:ae,selectedArea:{value:X,setValue:J},searchText:F===x.Namespace?O:"",filters:E}),e.createElement(ze,{formData:Q,handleSourceChange:te,handleSelectAll:ae,selectedArea:{value:X,setValue:J},searchText:F===x.Source?O:"",filters:E}))),e.createElement(Fe,null,q?null:B?e.createElement(R,{fullWidth:!0,status:g.Error,message:B}):ee?e.createElement(R,{fullWidth:!0,status:g.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):ee?null:e.createElement(R,{fullWidth:!0,status:g.Success,message:"The values reflect the current configuration of the selected cluster."}),e.createElement(r,{$gap:8},e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Secondary,label:"Cancel",onClick:()=>ee?G(!0):le(),disabled:!ee||q})),e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Primary,label:"Save",onClick:async()=>{Y(!0);const e=await m(_);M(P.BulkInstrumenting),Y(!1),e?.error?K(e.error):(p([]),n())},disabled:!ee||q})))),e.createElement(L,{isOpen:H,onClose:()=>G(!1),onApprove:le}))},Ee="75vw",Ue=1.16,He=n.div`
56
56
  display: flex;
57
57
  flex-direction: column;
58
58
  border-radius: 16px;
59
59
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
60
60
  overflow: hidden;
61
- `,Ue=o.div`
61
+ `,Ge=n.div`
62
62
  display: flex;
63
63
  gap: 12px;
64
64
  padding: 16px;
65
65
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
66
66
  position: sticky;
67
67
  top: 0;
68
- `,He=o.div`
68
+ `,qe=n.div`
69
69
  display: flex;
70
70
  gap: 12px;
71
71
  padding: 16px;
72
- `,Ge=o(i)`
72
+ `,Ye=n(i)`
73
73
  width: ${({$width:e})=>e};
74
74
  gap: 12px;
75
75
  justify-content: space-between;
76
- `,qe=o.div`
76
+ `,Be=n.div`
77
77
  display: flex;
78
78
  flex-direction: column;
79
79
  padding: 12px;
@@ -84,7 +84,7 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
84
84
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
85
85
  overflow-y: auto;
86
86
  overflow-x: hidden;
87
- `,Ye=o.div`
87
+ `,Ke=n.div`
88
88
  display: flex;
89
89
  align-items: center;
90
90
  gap: 12px;
@@ -95,13 +95,13 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
95
95
  &:hover {
96
96
  background-color: ${({theme:e})=>e.v2.colors.silver[600]};
97
97
  }
98
- `,Be=o.div`
98
+ `,Xe=n.div`
99
99
  display: flex;
100
100
  align-items: center;
101
101
  justify-content: flex-end;
102
102
  gap: 16px;
103
103
  padding: 0 12px;
104
- `,Ke=({onClose:n,connections:o,selectedConnectionIds:i,setSelectedConnectionIds:m,getEffectiveConfig:b,onApply:w})=>{const C=s(),[v,k]=a(""),[x,$]=a({showOnlySelected:!1}),I=t(()=>o.filter(e=>(!v||e.name.toLowerCase().includes(v.toLowerCase()))&&(!x.showOnlySelected||i.includes(e.id))),[o,i.length,v,x]),D=e=>{m(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[O,W]=a(!1),[F,j]=a(!1),[E,U]=a(void 0),[H,G]=a(!1),[q,Y]=a(void 0),{formData:B,handleFormChange:K,areFormValuesEqual:X,resetFormData:J}=M(q||{rollout:{automaticRolloutDisabled:!1}}),{isFormDirty:Q,isFormMatch:Z}=t(()=>({isFormDirty:i.length>1||void 0!==q&&!X(q,B),isFormMatch:1===i.length&&void 0!==q&&X(q,B)}),[i.length,q,B]);l(()=>{1===i.length?(async e=>{if(H)return;G(!0);const t=await b(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled||!1}};Y(e),J(e)}G(!1)})(i[0]):Y(void 0)},[i.length]);const _=()=>{W(!1),n()};return e.createElement(S,{isOpen:!0,hideOverlay:!0,width:je,header:{icon:de,title:"Cluster Configuration",onClose:n}},e.createElement(Ee,null,e.createElement(Ue,null,e.createElement(P,{icon:ce,title:"Selected Clusters",badge:{label:i.length}}),e.createElement(R,{width:"300px",placeholder:"Search by cluster name",value:v,onChange:k}),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:C.v2.colors.silver[200],nowrap:!0},"Show only:"),e.createElement(f,{size:y.S,label:"Selected",value:x.showOnlySelected,onChange:e=>$(t=>({...t,showOnlySelected:e}))}))),e.createElement(He,null,e.createElement(Ge,{$width:"40%"},e.createElement(r,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS},"Clusters"),e.createElement(p,{label:o.length,status:h.Unknown})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:C.v2.colors.silver[200],align:"right"},"Selected clusters"),e.createElement(p,{label:`${i.length}/${o.length}`,status:h.Unknown}))),e.createElement(qe,{$borderRadius:"16px 0 0 16px"},I.map(t=>e.createElement(Ye,{key:t.id,onClick:()=>D(t.id)},e.createElement(c,{value:i.includes(t.id),onChange:()=>D(t.id)}),e.createElement(d,{size:u.XS},t.name))))),e.createElement(Ge,{$width:"60%"},e.createElement(r,{$padding:"0 12px"},e.createElement(d,{size:u.XS},"Configurations")),e.createElement(qe,{$borderRadius:"0 16px 16px 0",$gap:12},H?e.createElement(V,null):e.createElement(f,{label:"Automatic Rollout Disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:B.rollout?.automaticRolloutDisabled||!1,onChange:e=>K("rollout.automaticRolloutDisabled",e)}))))),e.createElement(Be,null,H?e.createElement(A,{icon:ue,title:"Fetching Configuration...",titleSize:u.XXS,withGradient:!0}):F?e.createElement(A,{icon:ue,title:"Applying Configurations...",titleSize:u.XXS,withGradient:!0}):E?e.createElement(T,{fullWidth:!0,status:g.Error,message:E}):Q?e.createElement(T,{fullWidth:!0,status:g.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):Z?e.createElement(T,{fullWidth:!0,status:g.Success,message:"The values reflect the current configuration of the selected cluster."}):null,e.createElement(r,{$gap:8},e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Secondary,label:"Cancel",onClick:()=>Q?W(!0):_(),disabled:F})),e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Primary,label:"Save",onClick:async()=>{j(!0);const e=await w(i,B);j(!1),e?.error?U(e.error):(m([]),n())},disabled:!Q||F})))),e.createElement(L,{isOpen:O,onClose:()=>W(!1),onApprove:_}))};var Xe,Je;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Xe||(Xe={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Je||(Je={}));const Qe=[{key:Je.Name,label:"Name"},{key:Je.Type,label:"Type",textAlign:"right"},{key:Je.Status,label:"Status"},{key:Je.OdigosVersion,label:"Odigos Version"},{key:Je.ConnectedSince,label:"Connected Since"},{key:Je.LastActivity,label:"Last Activity"}],Ze=(e,t)=>{const a=e.find(e=>e.key===Je.Id)?.rawValue;a&&t(a.toString())},_e=({tableRowsMaxHeight:o,connections:i,getConnections:r,onClickConnection:c,deleteConnection:d,getEffectiveConfig:u,applyConfigurations:m,getAllClusterSnapshots:b,persistSources:f})=>{const y=s(),{formatTimeAgo:w}=O(),[C,v]=a(!1),[k,x]=a(i||[]),[$,S]=a(!1),[I,A]=a(null),D=n(async()=>{try{v(!0),x(await r()??[])}catch(e){}finally{v(!1)}},[]),P=n(async()=>{if(b)try{S(!0),A(await b()??null)}catch(e){}finally{S(!1)}},[]);l(()=>{k.length||D()},[k.length,D]),l(()=>{I||P()},[I,P]);const[R,T]=a(""),[z,L]=a(null),[M,V]=a([]),K=t(()=>k.filter(e=>e.status===g.Success),[k]),X=t(()=>k.filter(e=>!R||e.name.toLowerCase().includes(R.toLowerCase())).map(t=>({cells:[{key:Je.Id,rawValue:t.id},{key:Je.Name,rawValue:t.name},{key:Je.Type,rawValue:t.type},{key:Je.Status,rawValue:t.status,component:()=>(t=>{const a=t===g.Success?"Connection live":"Connection lost",l=t===g.Success?he:be;return e.createElement(p,{status:t,label:a,leftIcon:l})})(t.status)},{key:Je.OdigosVersion,rawValue:t.odigosVersion},{key:Je.ConnectedSince,rawValue:t.connectedAt?w(t.connectedAt):"-"},{key:Je.LastActivity,rawValue:t.lastSeenAt?w(t.lastSeenAt):"-"}],onClick:t.status===g.Success?()=>c(t):void 0,isSelected:M.includes(t.id),onSelect:()=>V(e=>Array.from(new Set([...e,t.id]))),onDeselect:()=>V(e=>e.filter(e=>e!==t.id)),hideCheckbox:t.status!==g.Success})),[k,M,R]);return e.createElement(W,null,e.createElement(F,{richTitle:{icon:pe,title:"Connections",badge:{label:k.length.toString(),status:h.Unknown}},search:{placeholder:"Search by cluster name",value:R,onChange:e=>T(e),width:"300px"},actions:[{id:j(),type:E.Button,buttonProps:{variant:N.Secondary,size:U.S,leftIcon:ge,onClick:async()=>{await D(),await P()},disabled:C||$}}]},e.createElement(H,{variant:G.Pretty,maxHeight:o,headerBackgroundColor:y.v2.colors.silver[1e3],isLoading:C,withCheckboxes:!0,columns:Qe,rows:X,rowActionsPushRightPosition:z?`calc(${z===Xe.BulkConfig?je:Ne} - 24px)`:void 0,getRowActions:({cells:e})=>(e=>e.find(e=>e.key===Je.Status)?.rawValue===g.Success)(e)?[I&&f?{id:j(),tooltip:"Manage Sources",rightIcon:re,onClick:async()=>{Ze(e,e=>{V([e]),L(Xe.BulkSource)})}}:null,u&&m?{id:j(),tooltip:"Edit Configuration",rightIcon:de,onClick:async()=>{Ze(e,e=>{V([e]),L(Xe.BulkConfig)})}}:null]:[{id:j(),label:"Delete Connection",rightIcon:me,onClick:()=>{Ze(e,e=>{V([e]),L(Xe.Delete)})}}]}),z===Xe.BulkConfig&&u&&m&&e.createElement(Ke,{onClose:()=>L(null),connections:K,selectedConnectionIds:M,setSelectedConnectionIds:V,getEffectiveConfig:u,onApply:m}),z===Xe.BulkSource&&I&&f&&e.createElement(Fe,{onClose:()=>L(null),snapshots:I,selectedConnectionIds:M,setSelectedConnectionIds:V,persistSources:async e=>{if(!f)return{error:"Persist sources function is not defined"};const t=await f(e);return t?.error||await P(),t}}),e.createElement(q,{target:"connection",isOpen:z===Xe.Delete,onClose:()=>{V([]),L(null)},onApprove:async()=>{const e=M[0];e&&(await d(e),await D())}}),e.createElement(Y,{isOpen:!!M.length&&!z,richTitle:{icon:ce,title:"Selected Clusters",badge:{label:M.length}},actions:[{id:j(),type:E.Button,buttonProps:{variant:N.Text,size:U.S,label:"Cancel",onClick:()=>V([])}},I&&f?{id:j(),type:E.ButtonDropData,buttonProps:{variant:N.Secondary,size:U.S,label:"Add Component",onClick:e=>L(e)},dropDataProps:{alignX:B.Left,items:[{id:Xe.BulkSource,label:"Add Source",icon:re}]}}:null,u&&m?{id:j(),type:E.Button,buttonProps:{variant:N.Primary,size:U.S,label:"Manage Configurations",rightIcon:de,onClick:()=>L(Xe.BulkConfig)}}:null]})))},et=o.div`
104
+ `,Je=({onClose:o,connections:n,selectedConnectionIds:i,setSelectedConnectionIds:m,getEffectiveConfig:w,onApply:C})=>{const v=s(),[k,x]=a(""),[$,I]=a({showOnlySelected:!1}),P=t(()=>{const e=[],t=[];for(const a of n){const l=M(a.odigosVersion,Ue),o=a.status===g.Success,n=i.includes(a.id),s=!$.showOnlySelected||n,r=!k||a.name.toLowerCase().includes(k.toLowerCase());l&&o&&s&&r?e.push(a):n&&t.push(a.id)}return t.length>0&&m(e=>e.filter(e=>!t.includes(e))),e},[n.length,i.length,k,$]),W=e=>{m(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[F,j]=a(!1),[E,U]=a(!1),[H,G]=a(void 0),[q,Y]=a(!1),[B,K]=a(void 0),{formData:X,handleFormChange:J,areFormValuesEqual:Q,resetFormData:Z}=V(B||{rollout:{automaticRolloutDisabled:!1}}),{isFormDirty:_,isFormMatch:ee}=t(()=>({isFormDirty:i.length>1||void 0!==B&&!Q(B,X),isFormMatch:1===i.length&&void 0!==B&&Q(B,X)}),[i.length,B,X]);l(()=>{1===i.length?(async e=>{if(q)return;Y(!0);const t=await w(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled||!1}};K(e),Z(e)}Y(!1)})(i[0]):K(void 0)},[i.length]);const te=()=>{j(!1),o()};return e.createElement(S,{isOpen:!0,hideOverlay:!0,width:Ee,header:{icon:ue,title:"Cluster Configuration",onClose:o}},e.createElement(He,null,e.createElement(Ge,null,e.createElement(D,{icon:de,title:"Selected Clusters",badge:{label:i.length}}),e.createElement(T,{width:"300px",placeholder:"Search by cluster name",value:k,onChange:x}),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:v.v2.colors.silver[200],nowrap:!0},"Show only:"),e.createElement(f,{size:y.S,label:"Selected",value:$.showOnlySelected,onChange:e=>I(t=>({...t,showOnlySelected:e}))}))),e.createElement(qe,null,e.createElement(Ye,{$width:"40%"},e.createElement(r,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS},"Clusters"),e.createElement(p,{label:P.length,status:h.Unknown})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:v.v2.colors.silver[200],align:"right"},"Selected clusters"),e.createElement(p,{label:`${i.length}/${P.length}`,status:h.Unknown}))),e.createElement(Be,{$borderRadius:"16px 0 0 16px"},P.length?P.map(t=>e.createElement(Ke,{key:t.id,onClick:()=>W(t.id)},e.createElement(c,{value:i.includes(t.id),onChange:()=>W(t.id)}),e.createElement(d,{size:u.XS},t.name))):e.createElement(b,{title:"Clusters not found",subTitle:"Please select a cluster to update it's configuration"}))),e.createElement(Ye,{$width:"60%"},e.createElement(r,{$padding:"0 12px"},e.createElement(d,{size:u.XS},"Configurations")),e.createElement(Be,{$borderRadius:"0 16px 16px 0",$gap:12},q?e.createElement(O,null):e.createElement(f,{label:"Automatic Rollout Disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:X.rollout?.automaticRolloutDisabled||!1,onChange:e=>J("rollout.automaticRolloutDisabled",e)}))))),e.createElement(Xe,null,q?e.createElement(A,{icon:pe,title:"Fetching Configuration...",titleSize:u.XXS,withGradient:!0}):E?e.createElement(A,{icon:pe,title:"Applying Configurations...",titleSize:u.XXS,withGradient:!0}):H?e.createElement(R,{fullWidth:!0,status:g.Error,message:H}):_?e.createElement(R,{fullWidth:!0,status:g.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):ee?e.createElement(R,{fullWidth:!0,status:g.Success,message:"The values reflect the current configuration of the selected cluster."}):null,e.createElement(r,{$gap:8},e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Secondary,label:"Cancel",onClick:()=>_?j(!0):te(),disabled:E})),e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Primary,label:"Save",onClick:async()=>{U(!0);const e=await C(i,X);U(!1),e?.error?G(e.error):(m([]),o())},disabled:!_||E})))),e.createElement(L,{isOpen:F,onClose:()=>j(!1),onApprove:te}))};var Qe,Ze;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Qe||(Qe={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Ze||(Ze={}));const _e=[{key:Ze.Name,label:"Name"},{key:Ze.Type,label:"Type",textAlign:"right"},{key:Ze.Status,label:"Status"},{key:Ze.OdigosVersion,label:"Odigos Version"},{key:Ze.ConnectedSince,label:"Connected Since"},{key:Ze.LastActivity,label:"Last Activity"}],et=(e,t)=>{const a=e.find(e=>e.key===Ze.Id)?.rawValue;return t(a?.toString()||"")},tt=({tableRowsMaxHeight:n,connections:i,getConnections:r,onClickConnection:c,deleteConnection:d,getEffectiveConfig:u,applyConfigurations:m,getAllClusterSnapshots:b,persistSources:f})=>{const y=s(),{formatTimeAgo:w}=W(),[C,v]=a(!1),[k,x]=a(i||[]),[$,S]=a(!1),[I,A]=a(null),P=o(async()=>{try{v(!0),x(await r()??[])}catch(e){}finally{v(!1)}},[]),D=o(async()=>{if(b)try{S(!0),A(await b()??null)}catch(e){}finally{S(!1)}},[]);l(()=>{k.length||P()},[k.length,P]),l(()=>{I||D()},[I,D]);const[T,R]=a(""),[z,L]=a(null),[V,O]=a([]),X=t(()=>k.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(t=>({cells:[{key:Ze.Id,rawValue:t.id},{key:Ze.Name,rawValue:t.name},{key:Ze.Type,rawValue:t.type},{key:Ze.Status,rawValue:t.status,component:()=>(t=>{const a=t===g.Success?"Connection live":"Connection lost",l=t===g.Success?be:fe;return e.createElement(p,{status:t,label:a,leftIcon:l})})(t.status)},{key:Ze.OdigosVersion,rawValue:t.odigosVersion},{key:Ze.ConnectedSince,rawValue:t.connectedAt?w(t.connectedAt):"-"},{key:Ze.LastActivity,rawValue:t.lastSeenAt?w(t.lastSeenAt):"-"}],onClick:t.status===g.Success?()=>c(t):void 0,isSelected:V.includes(t.id),onSelect:()=>O(e=>Array.from(new Set([...e,t.id]))),onDeselect:()=>O(e=>e.filter(e=>e!==t.id)),hideCheckbox:t.status!==g.Success||z===Qe.BulkConfig&&!M(t.odigosVersion,Ue)})),[k,V,T,z]),J=o(({cells:e})=>{if(!(e=>e.find(e=>e.key===Ze.Status)?.rawValue===g.Success)(e))return[{id:F(),label:"Delete Connection",rightIcon:ge,onClick:()=>{et(e,e=>{O([e]),L(Qe.Delete)})}}];const t=et(e,e=>{const t=k.find(t=>t.id===e);return t&&M(t.odigosVersion,Ue)||!1});return[I&&f?{id:F(),tooltip:"Manage Sources",rightIcon:ce,onClick:async()=>{et(e,e=>{O([e]),L(Qe.BulkSource)})}}:null,u&&m?{id:F(),tooltip:t?"Edit Configuration":"To use this feature, please upgrade to Odigos v1.16 or later.",rightIcon:ue,disabled:!t,onClick:async()=>{et(e,e=>{O([e]),L(Qe.BulkConfig)})}}:null]},[k.length,I]),Q=t(()=>[{id:F(),type:j.Button,buttonProps:{variant:N.Text,size:E.S,label:"Cancel",onClick:()=>O([])}},I&&f?{id:F(),type:j.ButtonDropData,buttonProps:{variant:N.Secondary,size:E.S,label:"Add Component",onClick:e=>L(e)},dropDataProps:{alignX:U.Left,items:[{id:Qe.BulkSource,label:"Add Source",icon:ce}]}}:null,u&&m?{id:F(),type:j.Button,buttonProps:{variant:N.Primary,size:E.S,label:"Manage Configurations",rightIcon:ue,onClick:()=>L(Qe.BulkConfig)}}:null],[I]);return e.createElement(H,null,e.createElement(G,{richTitle:{icon:me,title:"Connections",badge:{label:k.length.toString(),status:h.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>R(e),width:"300px"},actions:[{id:F(),type:j.Button,buttonProps:{variant:N.Secondary,size:E.S,leftIcon:he,onClick:async()=>{await P(),await D()},disabled:C||$}}]},e.createElement(q,{variant:Y.Pretty,maxHeight:n,headerBackgroundColor:y.v2.colors.silver[1e3],isLoading:C,withCheckboxes:!0,columns:_e,rows:X,rowActionsPushRightPosition:z?`calc(${z===Qe.BulkConfig?Ee:Le} - 24px)`:void 0,getRowActions:J}),z===Qe.BulkConfig&&u&&m&&e.createElement(Je,{onClose:()=>L(null),connections:k,selectedConnectionIds:V,setSelectedConnectionIds:O,getEffectiveConfig:u,onApply:m}),z===Qe.BulkSource&&I&&f&&e.createElement(je,{onClose:()=>L(null),snapshots:I,selectedConnectionIds:V,setSelectedConnectionIds:O,persistSources:async e=>{if(!f)return{error:"Persist sources function is not defined"};const t=await f(e);return t?.error||await D(),t}}),e.createElement(B,{target:"connection",isOpen:z===Qe.Delete,onClose:()=>{O([]),L(null)},onApprove:async()=>{const e=V[0];e&&(await d(e),await P())}}),e.createElement(K,{isOpen:!!V.length&&!z,richTitle:{icon:de,title:"Selected Clusters",badge:{label:V.length}},actions:Q})))},at=n.div`
105
105
  display: flex;
106
106
  align-items: center;
107
107
  justify-content: space-between;
@@ -113,10 +113,10 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
113
113
  &:hover {
114
114
  background: ${({theme:e})=>e.v2.colors.silver[700]};
115
115
  }
116
- `,tt=o.div`
117
- animation-name: ${K.animations.fade.in};
118
- `,at=({pod:n,getExtendedPodInfo:o,onClose:s})=>{const{formatTimeAgo:r}=O(),[c,u]=a(null),[p,m]=a(!1);l(()=>{n?o(n.namespace,n.name).then(e=>u(e??null)):(u(null),m(!1))},[n]);const h=t(()=>[{id:j(),title:"Node",label:c?.node??"-",withCopy:!0},{id:j(),title:"Status",badge:{status:X(c?.status),label:c?.status??"-"}}],[c]),b=t(()=>c?.containers?.map(e=>({id:j(),items:[{id:j(),title:"Container",label:e.name??"-"},{id:j(),title:"Status",label:e.startedAt?`${e.status} (since ${r(e.startedAt)})`:e.status},{id:j(),title:"Ready",badge:{status:e.ready?g.Success:g.Error,leftIcon:e.ready?ce:fe,label:e.ready?"True":"False",invertColors:!0}},{id:j(),title:"Started",badge:{status:e.started?g.Success:g.Error,leftIcon:e.started?ce:fe,label:e.started?"True":"False",invertColors:!0}},{id:j(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:j(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:j(),title:"Restarts",label:e.restarts.toString()},{id:j(),title:"State Reason",label:e.stateReason??"-"},{id:j(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:j(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return e.createElement(S,{isOpen:!!n,header:{icon:ye,title:"Pod Information",onClose:s}},c?null:e.createElement(I,null,e.createElement(V,null)),c?e.createElement(e.Fragment,null,e.createElement(F,{richTitle:{icon:ye,title:c.name,withCopy:!0}},e.createElement(i,{$gap:24},e.createElement(J,{cellsPerRow:2,items:h}),b.length>0&&e.createElement(i,{$gap:12},e.createElement(et,{onClick:()=>m(e=>!e)},e.createElement(d,null,"Containers Overview"),e.createElement(Q,{icon:p?we:Ce})),p&&b.map(({id:t,items:a})=>e.createElement(tt,{key:t},e.createElement(J,{cellsPerRow:2,items:a})))))),e.createElement(F,{richTitle:{icon:ve,title:"Kubectl Commands"}},e.createElement(i,{$gap:12},e.createElement(Z,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),e.createElement(Z,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),e.createElement(Z,{value:`kubectl logs ${c.name} -n ${c.namespace}`}))),e.createElement(_,{yaml:c.manifestYAML})):null)};var lt;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropDrate="spanDropDrate",e.Age="age",e.DockerImage="dockerImage"}(lt||(lt={}));const nt=[{key:lt.PodName,label:"Pod Name"},{key:lt.Status,label:"Status"},{key:lt.Restarts,label:"Restarts",textAlign:"right"},{key:lt.NodeName,label:"Node Name"},{key:lt.Age,label:"Age",textAlign:"right"},{key:lt.DockerImage,label:"Docker Image",textAlign:"right"}],ot=({isLoading:l,tableRowsMaxHeight:n,pods:o,getExtendedPodInfo:i})=>{const c=s(),{formatTimeAgo:u}=O(),[h,b]=a(null),f=t(()=>o.map(t=>({onClick:()=>b(t),cells:[{key:lt.PodName,rawValue:t.name},{key:lt.Status,rawValue:t.status,component:()=>{return a=t.status,e.createElement(p,{status:X(a),label:a});var a}},{key:lt.Restarts,rawValue:t.restartsCount.toString()},{key:lt.NodeName,rawValue:t.nodeName},{key:lt.SpanDropDrate,rawValue:0,component:()=>{const{collectorMetrics:a}=t;if(!a)return e.createElement(d,null,"-");const l=(a?.metricsAcceptedRps??0)+(a?.metricsDroppedRps??0),n=l>0?Math.round((a?.metricsDroppedRps??0)/l*100):0,o=n>0?g.Error:g.Success,s=(a?.exporterSuccessRps??0)+(a?.exporterFailedRps??0),i=s>0?Math.round((a?.exporterFailedRps??0)/s*100):0,c=i>0?g.Error:g.Success;return e.createElement(r,{$gap:4},e.createElement(m,{text:`Accepted: ${a.metricsAcceptedRps.toLocaleString()}, Dropped: ${a.metricsDroppedRps.toLocaleString()}`},e.createElement(p,{status:o,label:`Receiver ${n}%`,leftIcon:o===g.Error?ke:xe,useSecondaryTone:!0,invertColors:!0})),e.createElement(m,{text:`Success: ${a.exporterSuccessRps.toLocaleString()}, Failed: ${a.exporterFailedRps.toLocaleString()}`},e.createElement(p,{status:c,label:`Exporter ${i}%`,leftIcon:c===g.Error?ke:xe,useSecondaryTone:!0,invertColors:!0})))}},{key:lt.Age,rawValue:u(t.creationTimestamp)},{key:lt.DockerImage,rawValue:t.image}]})),[o,c]);return e.createElement(F,{richTitle:{icon:ye,title:"Pods"}},e.createElement(H,{variant:G.Data,maxHeight:n,isLoading:l,columns:nt,rows:f}),e.createElement(at,{pod:h,getExtendedPodInfo:i,onClose:()=>b(null)}))};var st;!function(e){e.Gateway="gateway",e.Node="node"}(st||(st={}));const it=[{value:st.Gateway,label:"Gateway"},{value:st.Node,label:"Node Collector"}],rt=o.div`
116
+ `,lt=n.div`
117
+ animation-name: ${X.animations.fade.in};
118
+ `,ot=({pod:o,getExtendedPodInfo:n,onClose:s})=>{const{formatTimeAgo:r}=W(),[c,u]=a(null),[p,m]=a(!1);l(()=>{o?n(o.namespace,o.name).then(e=>u(e??null)):(u(null),m(!1))},[o]);const h=t(()=>[{id:F(),title:"Node",label:c?.node??"-",withCopy:!0},{id:F(),title:"Status",badge:{status:J(c?.status),label:c?.status??"-"}}],[c]),b=t(()=>c?.containers?.map(e=>({id:F(),items:[{id:F(),title:"Container",label:e.name??"-"},{id:F(),title:"Status",label:e.startedAt?`${e.status} (since ${r(e.startedAt)})`:e.status},{id:F(),title:"Ready",badge:{status:e.ready?g.Success:g.Error,leftIcon:e.ready?de:ye,label:e.ready?"True":"False",invertColors:!0}},{id:F(),title:"Started",badge:{status:e.started?g.Success:g.Error,leftIcon:e.started?de:ye,label:e.started?"True":"False",invertColors:!0}},{id:F(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:F(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:F(),title:"Restarts",label:e.restarts.toString()},{id:F(),title:"State Reason",label:e.stateReason??"-"},{id:F(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:F(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return e.createElement(S,{isOpen:!!o,header:{icon:we,title:"Pod Information",onClose:s}},c?null:e.createElement(I,null,e.createElement(O,null)),c?e.createElement(e.Fragment,null,e.createElement(G,{richTitle:{icon:we,title:c.name,withCopy:!0}},e.createElement(i,{$gap:24},e.createElement(Q,{cellsPerRow:2,items:h}),b.length>0&&e.createElement(i,{$gap:12},e.createElement(at,{onClick:()=>m(e=>!e)},e.createElement(d,null,"Containers Overview"),e.createElement(Z,{icon:p?Ce:ve})),p&&b.map(({id:t,items:a})=>e.createElement(lt,{key:t},e.createElement(Q,{cellsPerRow:2,items:a})))))),e.createElement(G,{richTitle:{icon:ke,title:"Kubectl Commands"}},e.createElement(i,{$gap:12},e.createElement(_,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),e.createElement(_,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),e.createElement(_,{value:`kubectl logs ${c.name} -n ${c.namespace}`}))),e.createElement(ee,{yaml:c.manifestYAML})):null)};var nt;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropDrate="spanDropDrate",e.Age="age",e.DockerImage="dockerImage"}(nt||(nt={}));const st=[{key:nt.PodName,label:"Pod Name"},{key:nt.Status,label:"Status"},{key:nt.Restarts,label:"Restarts",textAlign:"right"},{key:nt.NodeName,label:"Node Name"},{key:nt.Age,label:"Age",textAlign:"right"},{key:nt.DockerImage,label:"Docker Image",textAlign:"right"}],it=({isLoading:l,tableRowsMaxHeight:o,pods:n,getExtendedPodInfo:i})=>{const c=s(),{formatTimeAgo:u}=W(),[h,b]=a(null),f=t(()=>n.map(t=>({onClick:()=>b(t),cells:[{key:nt.PodName,rawValue:t.name},{key:nt.Status,rawValue:t.status,component:()=>{return a=t.status,e.createElement(p,{status:J(a),label:a});var a}},{key:nt.Restarts,rawValue:t.restartsCount.toString()},{key:nt.NodeName,rawValue:t.nodeName},{key:nt.SpanDropDrate,rawValue:0,component:()=>{const{collectorMetrics:a}=t;if(!a)return e.createElement(d,null,"-");const l=(a?.metricsAcceptedRps??0)+(a?.metricsDroppedRps??0),o=l>0?Math.round((a?.metricsDroppedRps??0)/l*100):0,n=o>0?g.Error:g.Success,s=(a?.exporterSuccessRps??0)+(a?.exporterFailedRps??0),i=s>0?Math.round((a?.exporterFailedRps??0)/s*100):0,c=i>0?g.Error:g.Success;return e.createElement(r,{$gap:4},e.createElement(m,{text:`Accepted: ${a.metricsAcceptedRps.toLocaleString()}, Dropped: ${a.metricsDroppedRps.toLocaleString()}`},e.createElement(p,{status:n,label:`Receiver ${o}%`,leftIcon:n===g.Error?xe:$e,useSecondaryTone:!0,invertColors:!0})),e.createElement(m,{text:`Success: ${a.exporterSuccessRps.toLocaleString()}, Failed: ${a.exporterFailedRps.toLocaleString()}`},e.createElement(p,{status:c,label:`Exporter ${i}%`,leftIcon:c===g.Error?xe:$e,useSecondaryTone:!0,invertColors:!0})))}},{key:nt.Age,rawValue:u(t.creationTimestamp)},{key:nt.DockerImage,rawValue:t.image}]})),[n,c]);return e.createElement(G,{richTitle:{icon:we,title:"Pods"}},e.createElement(q,{variant:Y.Data,maxHeight:o,isLoading:l,columns:st,rows:f}),e.createElement(ot,{pod:h,getExtendedPodInfo:i,onClose:()=>b(null)}))};var rt;!function(e){e.Gateway="gateway",e.Node="node"}(rt||(rt={}));const ct=[{value:rt.Gateway,label:"Gateway"},{value:rt.Node,label:"Node Collector"}],dt=n.div`
119
119
  display: flex;
120
120
  align-items: center;
121
121
  justify-content: space-between;
122
- `,ct=({selectedTab:a,setSelectedTab:l,onClickDownloadDiagnose:n,onClickRefresh:o,loading:s,disabled:i})=>{const c=t(()=>{const e=[];return n&&e.push({id:j(),type:E.Button,buttonProps:{label:"Download Diagnose",leftIcon:$e,size:U.S,variant:N.Text,onClick:n,disabled:i}}),o&&e.push({id:j(),type:E.Button,buttonProps:{label:"Refresh",leftIcon:ge,size:U.S,variant:N.Text,onClick:o,disabled:i,loading:s}}),e},[n,o,i,s]);return e.createElement(rt,null,e.createElement(r,{$gap:12},e.createElement(r,{$gap:8},e.createElement(Se,{size:32}),e.createElement(d,{size:u.M,weight:500},"Pipeline Collectors")),e.createElement(ee,{options:it,selected:a,setSelected:l,disabled:i})),e.createElement(te,{actions:c}))},dt=({isOpen:t,onClose:a,title:l,yaml:n})=>e.createElement(S,{isOpen:t,header:{icon:Ie,title:l,onClose:a}},e.createElement(_,{yaml:n}));var ut;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(ut||(ut={}));const pt=({richTitle:t,statusCard:l,textCards:n,manifestYaml:o,configMapYaml:s})=>{const[i,c]=a(null);return e.createElement(F,{richTitle:t,actions:[{id:j(),type:E.ButtonDropData,buttonProps:{variant:N.Secondary,size:U.S,label:"View YAML",onClick:e=>c(e)},dropDataProps:{items:[{id:ut.ManifestYaml,label:t.title,icon:Ae},{id:ut.ConfigMapYaml,label:"ConfigMap",icon:Ae}]}}]},e.createElement(r,{$gap:16},e.createElement(ae,{...l}),n.map(t=>e.createElement(le,{key:t.title,...t}))),e.createElement(dt,{isOpen:i===ut.ManifestYaml,onClose:()=>c(null),title:t.title,yaml:o}),e.createElement(dt,{isOpen:i===ut.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:s}))},gt=e=>{switch(e){case ne.Healthy:return"All desired replicas are updated, available, and ready";case ne.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ne.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ne.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ne.Down:return"No available replicas";case ne.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},mt=({tableRowsMaxHeight:o,getGatewayInfo:s,getGatewayPods:i,getNodeCollectorInfo:r,getNodeCollectorPods:c,getExtendedPodInfo:d})=>{const{formatTimeAgo:u}=O(),{isVersionSupported:p,version:m}=oe(1.12),[b,f]=a(!1),[y,w]=a(st.Gateway),[C,v]=a(null),[k,x]=a([]),[$,S]=a(null),[I,A]=a([]),D=n(async()=>{f(!0);try{switch(y){case st.Gateway:v(await s()??null),x(await i()??[]);break;case st.Node:S(await r()??null),A(await c()??[])}}catch(e){}f(!1)},[y]);l(()=>{D()},[D]);const P=t(()=>(e=>{switch(e){case st.Gateway:return"Deployment";case st.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(y),[y]),R=t(()=>((e,t,a,l)=>{const n={status:h.Disabled,label:"No rollouts yet"};let o=!1,s=null;switch(e){case st.Gateway:o=t?.rolloutInProgress??!1,s=t?.lastRolloutAt??null;break;case st.Node:o=a?.rolloutInProgress??!1,s=a?.lastRolloutAt??null;break;default:return n}return o?{status:g.Info,label:"Rollout in progress",rightIcon:ge,useSecondaryTone:!0}:s?{status:h.Disabled,label:`Last Rollout: ${l(s)}`}:n})(y,C,$,u),[C,$,y,u]),T=t(()=>((e,t,a,l)=>{let n=l?g.Info:h.Unknown,o=l?"Loading":ne.Unknown,s=l?"Fetching data...":gt(ne.Unknown);switch(e){case st.Gateway:n=t?.status?X(t?.status):n,o=t?.status??o,s=t?.status?gt(t.status):s;break;case st.Node:n=a?.status?X(a?.status):n,o=a?.status??o,s=a?.status?gt(a.status):s}return{status:n,title:o,description:s}})(y,C,$,b),[C,$,y,b]),z=t(()=>((e,t,a,l)=>{switch(e){case st.Gateway:return[{title:"HPA Spec (Replicas)",cells:[{label:"Min.",value:t?.hpa?.min.toString()??"-",isLoading:l},{label:"Max.",value:t?.hpa?.max.toString()??"-",isLoading:l},{label:"Current",value:t?.hpa?.current.toString()??"-",isLoading:l},{label:"Desired",value:t?.hpa?.desired.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:t?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:t?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:t?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:t?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:t?.imageVersion??"-",isLoading:l}]}];case st.Node:return[{title:"Nodes",cells:[{label:"Desired",value:a?.nodes?.desired.toString()??"-",isLoading:l},{label:"Ready",value:a?.nodes?.ready.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:a?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:a?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:a?.imageVersion??"-",isLoading:l}]}];default:return[]}})(y,C,$,b),[C,$,y,b]),N=t(()=>(y===st.Gateway?C?.manifestYAML:$?.manifestYAML)??"",[C,$,y]),L=t(()=>(y===st.Gateway?C?.configMapYAML:$?.configMapYAML)??"",[C,$,y]),M=t(()=>y===st.Gateway?k:I,[k,I,y]);return e.createElement(W,null,e.createElement(ct,{disabled:!p,loading:b,selectedTab:y,setSelectedTab:w,onClickDownloadDiagnose:void 0,onClickRefresh:D}),e.createElement(se,null,e.createElement(pt,{richTitle:{icon:Ie,title:P,badge:R},statusCard:T,textCards:z,manifestYaml:N,configMapYaml:L}),e.createElement(ot,{isLoading:b,tableRowsMaxHeight:o,pods:M,getExtendedPodInfo:d}),!p&&e.createElement(ie,{minSupportedVersion:1.12,currentVersion:m||""})))};export{_e as CentralConnections,mt as PipelineCollectors};
122
+ `,ut=({selectedTab:a,setSelectedTab:l,onClickDownloadDiagnose:o,onClickRefresh:n,loading:s,disabled:i})=>{const c=t(()=>{const e=[];return o&&e.push({id:F(),type:j.Button,buttonProps:{label:"Download Diagnose",leftIcon:Se,size:E.S,variant:N.Text,onClick:o,disabled:i}}),n&&e.push({id:F(),type:j.Button,buttonProps:{label:"Refresh",leftIcon:he,size:E.S,variant:N.Text,onClick:n,disabled:i,loading:s}}),e},[o,n,i,s]);return e.createElement(dt,null,e.createElement(r,{$gap:12},e.createElement(r,{$gap:8},e.createElement(Ie,{size:32}),e.createElement(d,{size:u.M,weight:500},"Pipeline Collectors")),e.createElement(te,{options:ct,selected:a,setSelected:l,disabled:i})),e.createElement(ae,{actions:c}))},pt=({isOpen:t,onClose:a,title:l,yaml:o})=>e.createElement(S,{isOpen:t,header:{icon:Ae,title:l,onClose:a}},e.createElement(ee,{yaml:o}));var gt;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(gt||(gt={}));const mt=({richTitle:t,statusCard:l,textCards:o,manifestYaml:n,configMapYaml:s})=>{const[i,c]=a(null);return e.createElement(G,{richTitle:t,actions:[{id:F(),type:j.ButtonDropData,buttonProps:{variant:N.Secondary,size:E.S,label:"View YAML",onClick:e=>c(e)},dropDataProps:{items:[{id:gt.ManifestYaml,label:t.title,icon:Pe},{id:gt.ConfigMapYaml,label:"ConfigMap",icon:Pe}]}}]},e.createElement(r,{$gap:16},e.createElement(le,{...l}),o.map(t=>e.createElement(oe,{key:t.title,...t}))),e.createElement(pt,{isOpen:i===gt.ManifestYaml,onClose:()=>c(null),title:t.title,yaml:n}),e.createElement(pt,{isOpen:i===gt.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:s}))},ht=e=>{switch(e){case ne.Healthy:return"All desired replicas are updated, available, and ready";case ne.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ne.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ne.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ne.Down:return"No available replicas";case ne.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},bt=({tableRowsMaxHeight:n,getGatewayInfo:s,getGatewayPods:i,getNodeCollectorInfo:r,getNodeCollectorPods:c,getExtendedPodInfo:d})=>{const{formatTimeAgo:u}=W(),{isVersionSupported:p,version:m}=se(1.12),[b,f]=a(!1),[y,w]=a(rt.Gateway),[C,v]=a(null),[k,x]=a([]),[$,S]=a(null),[I,A]=a([]),P=o(async()=>{f(!0);try{switch(y){case rt.Gateway:v(await s()??null),x(await i()??[]);break;case rt.Node:S(await r()??null),A(await c()??[])}}catch(e){}f(!1)},[y]);l(()=>{P()},[P]);const D=t(()=>(e=>{switch(e){case rt.Gateway:return"Deployment";case rt.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(y),[y]),T=t(()=>((e,t,a,l)=>{const o={status:h.Disabled,label:"No rollouts yet"};let n=!1,s=null;switch(e){case rt.Gateway:n=t?.rolloutInProgress??!1,s=t?.lastRolloutAt??null;break;case rt.Node:n=a?.rolloutInProgress??!1,s=a?.lastRolloutAt??null;break;default:return o}return n?{status:g.Info,label:"Rollout in progress",rightIcon:he,useSecondaryTone:!0}:s?{status:h.Disabled,label:`Last Rollout: ${l(s)}`}:o})(y,C,$,u),[C,$,y,u]),R=t(()=>((e,t,a,l)=>{let o=l?g.Info:h.Unknown,n=l?"Loading":ne.Unknown,s=l?"Fetching data...":ht(ne.Unknown);switch(e){case rt.Gateway:o=t?.status?J(t?.status):o,n=t?.status??n,s=t?.status?ht(t.status):s;break;case rt.Node:o=a?.status?J(a?.status):o,n=a?.status??n,s=a?.status?ht(a.status):s}return{status:o,title:n,description:s}})(y,C,$,b),[C,$,y,b]),z=t(()=>((e,t,a,l)=>{switch(e){case rt.Gateway:return[{title:"HPA Spec (Replicas)",cells:[{label:"Min.",value:t?.hpa?.min.toString()??"-",isLoading:l},{label:"Max.",value:t?.hpa?.max.toString()??"-",isLoading:l},{label:"Current",value:t?.hpa?.current.toString()??"-",isLoading:l},{label:"Desired",value:t?.hpa?.desired.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:t?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:t?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:t?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:t?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:t?.imageVersion??"-",isLoading:l}]}];case rt.Node:return[{title:"Nodes",cells:[{label:"Desired",value:a?.nodes?.desired.toString()??"-",isLoading:l},{label:"Ready",value:a?.nodes?.ready.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:a?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:a?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:a?.imageVersion??"-",isLoading:l}]}];default:return[]}})(y,C,$,b),[C,$,y,b]),N=t(()=>(y===rt.Gateway?C?.manifestYAML:$?.manifestYAML)??"",[C,$,y]),L=t(()=>(y===rt.Gateway?C?.configMapYAML:$?.configMapYAML)??"",[C,$,y]),M=t(()=>y===rt.Gateway?k:I,[k,I,y]);return e.createElement(H,null,e.createElement(ut,{disabled:!p,loading:b,selectedTab:y,setSelectedTab:w,onClickDownloadDiagnose:void 0,onClickRefresh:P}),e.createElement(ie,null,e.createElement(mt,{richTitle:{icon:Ae,title:D,badge:T},statusCard:R,textCards:z,manifestYaml:N,configMapYaml:L}),e.createElement(it,{isLoading:b,tableRowsMaxHeight:n,pods:M,getExtendedPodInfo:d}),!p&&e.createElement(re,{minSupportedVersion:1.12,currentVersion:m||""})))};export{tt as CentralConnections,bt as PipelineCollectors};