@odigos/ui-kit 0.0.165 → 0.0.166

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,j as Button,r as ButtonSize,dp as ButtonTab,dq as ButtonTabList,k as ButtonVariants,C as Checkbox,dt as CheckboxList,ds as CheckboxSize,J as CliCommand,G as DataCard,g as Drawer,dv as DropData,w as DropDataAlignX,du as DropDataAlignY,dw as Header,c6 as HoverActions,H as IconButton,ci as IconButtonSize,dx as Input,I as Island,L as Loader,dy as Modal,dz as Navbar,i as Note,dB as Radio,dC as RadioGroup,dA as RadioSize,h as Search,p as SectionCard,dr as SectionCardSize,K as Segment,dD as SegmentSize,Q as StatusCard,s as Table,t as TableVariant,dE as Tag,U as TextCard,d as Toggle,dG as ToggleLabelAlign,dH as ToggleList,e as ToggleSize,dF as ToggleVariant,T as Typography,b as TypographySize,dI as TypographyVariants,dJ as WarningModal}from"../chunks/ui-components-76a424df.js";import"../icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
1
+ export{B as Badge,j as Button,r as ButtonSize,dn as ButtonTab,dp as ButtonTabList,k as ButtonVariants,C as Checkbox,ds as CheckboxList,dr as CheckboxSize,J as CliCommand,G as DataCard,g as Drawer,du as DropData,w as DropDataAlignX,dt as DropDataAlignY,dv as Header,c5 as HoverActions,H as IconButton,ch as IconButtonSize,dw as Input,I as Island,L as Loader,dx as Modal,dy as Navbar,i as Note,dA as Radio,dB as RadioGroup,dz as RadioSize,h as Search,p as SectionCard,dq as SectionCardSize,K as Segment,dC as SegmentSize,Q as StatusCard,s as Table,t as TableVariant,dD as Tag,U as TextCard,d as Toggle,dF as ToggleLabelAlign,dG as ToggleList,e as ToggleSize,dE as ToggleVariant,T as Typography,b as TypographySize,dH as TypographyVariants,dI as WarningModal}from"../chunks/ui-components-e8819fa0.js";import"../icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.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{aG as AutocompleteInput,aZ as Badge,b0 as Button,ar as CancelWarning,z as CenterThis,a3 as Checkbox,d6 as Code,ax as ConditionDetails,ay as DataCard,$ as DataCardFieldTypes,bK as DataCardFields,d7 as DataFinger,b3 as DataTab,aq as DeleteWarning,c4 as DescribeRow,aH as Divider,ah as DocsButton,ap as Drawer,d9 as DrawerFooter,d8 as DrawerHeader,bp as Dropdown,da as ErrorBoundary,bx as ExtendArrow,n as FadeLoader,a4 as FieldError,a2 as FieldLabel,F as FlexColumn,a as FlexRow,db as Header,bw as IconButton,ce as IconGroup,aU as IconTitleBadge,aP as IconWrapped,c0 as IconsNav,dc as ImageControlled,a6 as Input,ac as InputList,a9 as InputTable,aX as InteractiveTable,ab as KeyValueInputsList,a$ as LoadingText,aB as Modal,aD as ModalBody,ai as MonitorsCheckboxes,aR as MonitorsIcons,aC as NavigationButtons,N as NoDataFound,aE as NotificationNote,di as Overlay,P as PageContent,bk as Popup,cj as PopupForm,co as ScrollX,b6 as ScrollY,ag as SectionTitle,af as Segment,bl as SelectionButton,bb as SkeletonLoader,aJ as Status,bJ as Stepper,dd as TabList,aS as TableContainer,aT as TableTitleWrap,aW as TableWrap,bT as Tag,ae as Text,aj as TextArea,aa as Toggle,cm as ToggleCodeComponent,c as Tooltip,aY as TraceLoader,X as UpgradeRequiredWrapper,bm as VerticalScroll,dh as WarningModal,de as getLinksFromText,df as getStrongsFromText,dg as renderText}from"./chunks/ui-components-76a424df.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
1
+ export{aE as AutocompleteInput,aX as Badge,aZ as Button,ap as CancelWarning,z as CenterThis,a3 as Checkbox,d5 as Code,av as ConditionDetails,aw as DataCard,$ as DataCardFieldTypes,bH as DataCardFields,d6 as DataFinger,a$ as DataTab,ao as DeleteWarning,c3 as DescribeRow,aF as Divider,ah as DocsButton,an as Drawer,d8 as DrawerFooter,d7 as DrawerHeader,bm as Dropdown,d9 as ErrorBoundary,bu as ExtendArrow,n as FadeLoader,a4 as FieldError,a2 as FieldLabel,F as FlexColumn,a as FlexRow,da as Header,bt as IconButton,cd as IconGroup,aS as IconTitleBadge,aN as IconWrapped,b$ as IconsNav,db as ImageControlled,a6 as Input,ac as InputList,a9 as InputTable,aV as InteractiveTable,ab as KeyValueInputsList,bZ as LoadingText,az as Modal,aB as ModalBody,ai as MonitorsCheckboxes,aP as MonitorsIcons,aA as NavigationButtons,N as NoDataFound,aC as NotificationNote,dh as Overlay,P as PageContent,bh as Popup,ci as PopupForm,cn as ScrollX,b2 as ScrollY,ag as SectionTitle,af as Segment,bi as SelectionButton,b8 as SkeletonLoader,aH as Status,bG as Stepper,dc as TabList,aQ as TableContainer,aR as TableTitleWrap,aU as TableWrap,bQ as Tag,ae as Text,aj as TextArea,aa as Toggle,cl as ToggleCodeComponent,c as Tooltip,aW as TraceLoader,X as UpgradeRequiredWrapper,bj as VerticalScroll,dg as WarningModal,dd as getLinksFromText,de as getStrongsFromText,df as renderText}from"./chunks/ui-components-e8819fa0.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.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{av as ACTION_OPTIONS,ao as BUTTON_TEXTS,D as DEFAULT_DATA_STREAM_NAME,bI as DESTINATION_CATEGORIES,bq as DISPLAY_LANGUAGES,_ as DISPLAY_TITLES,aF as FORM_ALERTS,bW as INSTRUMENTATION_RULE_OPTIONS,c_ as LANGUAGE_OPTIONS,br as MONITORS_OPTIONS,bs as STORAGE_KEYS,c$ as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-76a424df.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
1
+ export{at as ACTION_OPTIONS,am as BUTTON_TEXTS,D as DEFAULT_DATA_STREAM_NAME,bF as DESTINATION_CATEGORIES,bn as DISPLAY_LANGUAGES,_ as DISPLAY_TITLES,aD as FORM_ALERTS,bU as INSTRUMENTATION_RULE_OPTIONS,cZ as LANGUAGE_OPTIONS,bo as MONITORS_OPTIONS,bp as STORAGE_KEYS,c_ as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-e8819fa0.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
@@ -6,6 +6,10 @@ interface HeadProps {
6
6
  badgeTooltip?: string;
7
7
  isLoading?: boolean;
8
8
  refetch: () => void;
9
+ partiallySelected?: boolean;
10
+ allSelected?: boolean;
11
+ onSelectAll?: (bool: boolean) => void;
12
+ progressPercent?: number;
9
13
  }
10
14
  declare const Head: FC<HeadProps>;
11
15
  export { Head, type HeadProps };
@@ -1,4 +1,4 @@
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,u as w,D as C,E as k,f as v,g as x,R as $,h as S,L as I,i as A,j as P,k as R,l as D,m as T,n as N,o as z,P as L,p as V,q as M,A as O,r as W,s as j,t as F,v as U,I as E,w as H,x as G,y as q,z as Y,G as B,H as K,J as X,Y as J,K as Q,M as Z,Q as _,U as ee,W as te,V as ae,X as le,Z as ne}from"../chunks/ui-components-76a424df.js";import{SourceIcon as oe,VSquareIcon as se,OdigosLogo as ie,SettingsIcon as re,ConnectionsIcon as ce,RefreshIcon as de,DeleteIcon as ue,VIcon as pe,XIcon as ge,XSquareIcon as me,PodIcon as he,ChevronUpIcon as be,ChevronDownIcon as fe,TerminalIcon as ye,DownloadIcon as we,PipelineCollectorIcon as Ce,GatewayIcon as ke,YamlIcon as ve}from"../icons.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const xe=o(i)`
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,u as w,D as C,E as k,f as v,g as x,R as $,h as S,L as I,i as A,j as P,k as R,l as D,m as T,n as N,o as z,P as L,p as V,q as M,A as O,r as W,s as j,t as F,v as U,I as E,w as H,x as G,y as q,z as Y,G as B,H as K,J as X,Y as J,K as Q,M as Z,Q as _,U as ee,W as te,V as ae,X as le,Z as ne}from"../chunks/ui-components-e8819fa0.js";import{SourceIcon as oe,VSquareIcon as se,OdigosLogo as ie,SettingsIcon as re,ConnectionsIcon as ce,RefreshIcon as de,DeleteIcon as ue,VIcon as pe,XIcon as ge,XSquareIcon as me,PodIcon as he,ChevronUpIcon as be,ChevronDownIcon as fe,TerminalIcon as ye,DownloadIcon as we,PipelineCollectorIcon as Ce,GatewayIcon as ke,YamlIcon as ve}from"../icons.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const xe=o(i)`
2
2
  width: ${({$width:e})=>e};
3
3
  gap: 12px;
4
4
  justify-content: space-between;
@@ -97,7 +97,7 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
97
97
  justify-content: flex-end;
98
98
  gap: 16px;
99
99
  padding: 0 12px;
100
- `,Ee=({onClose:n,connections:o,selectedConnectionIds:i,setSelectedConnectionIds:m,getConnectionRemoteConfig:b,onApply:w})=>{const C=s(),[k,v]=a(""),[z,L]=a({showOnlySelected:!1}),V=t(()=>o.filter(e=>(!k||e.name.toLowerCase().includes(k.toLowerCase()))&&(!z.showOnlySelected||i.includes(e.id))),[o,i.length,k,z]),M=e=>{m(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[O,W]=a(!1),[j,F]=a(!1),[U,E]=a(void 0),[H,G]=a(!1),[q,Y]=a(void 0),{formData:B,handleFormChange:K,areFormValuesEqual:X,resetFormData:J}=T(q||{automaticRollout:!0}),{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={automaticRollout:!t.rollout?.automaticRolloutDisabled};Y(e),J(e)}G(!1)})(i[0]):Y(void 0)},[i.length]);const _=()=>{W(!1),n()};return e.createElement(x,{isOpen:!0,hideOverlay:!0,width:Le,header:{icon:re,title:"Cluster Configuration",onClose:n}},e.createElement(Ve,null,e.createElement(Me,null,e.createElement($,{icon:se,title:"Selected Clusters",badge:{label:i.length}}),e.createElement(S,{width:"300px",placeholder:"Search by cluster name",value:k,onChange:v}),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:z.showOnlySelected,onChange:e=>L(t=>({...t,showOnlySelected:e}))}))),e.createElement(Oe,null,e.createElement(We,{$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(je,{$borderRadius:"16px 0 0 16px"},V.map(t=>e.createElement(Fe,{key:t.id,onClick:()=>M(t.id)},e.createElement(c,{value:i.includes(t.id),onChange:()=>M(t.id)}),e.createElement(d,{size:u.XS},t.name))))),e.createElement(We,{$width:"60%"},e.createElement(r,{$padding:"0 12px"},e.createElement(d,{size:u.XS},"Configurations")),e.createElement(je,{$borderRadius:"0 16px 16px 0",$gap:12},H?e.createElement(N,null):e.createElement(f,{label:"Automatic Rollout "+(B.automaticRollout?"Enabled":"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 enabled, Odigos will proactively restart workloads as needed to apply updated instrumentation. Users do not need to manually trigger rollouts after adding or removing sources. Any new pods created after enabling or disabling the agent (via automatic rollout, autoscaling, etc.) will still have the agent injected, regardless of this setting. When set to false, additional configurations related to automated rollouts or rollbacks take effect.",value:B.automaticRollout,onChange:e=>K("automaticRollout",e)}))))),e.createElement(Ue,null,H?e.createElement(I,{label:"Fetching configuration...",icon:ie,withGradient:!0,typographyProps:{size:u.XXS}}):j?e.createElement(I,{label:"Applying configurations...",icon:ie,withGradient:!0,typographyProps:{size:u.XXS}}):U?e.createElement(A,{fullWidth:!0,status:g.Error,message:U}):Q?e.createElement(A,{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(A,{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(P,{fullWidth:!0,variant:R.Secondary,label:"Cancel",onClick:()=>Q?W(!0):_(),disabled:j})),e.createElement("div",{style:{width:"150px"}},e.createElement(P,{fullWidth:!0,variant:R.Primary,label:"Save",onClick:async()=>{F(!0);const{error:e}=await w(i,B);F(!1),e?E(e):(m([]),n())},disabled:!Q||j})))),e.createElement(D,{isOpen:O,onClose:()=>W(!1),onApprove:_}))};var He,Ge;!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"}(He||(He={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Ge||(Ge={}));const qe=[{key:Ge.Name,label:"Name"},{key:Ge.Type,label:"Type",textAlign:"right"},{key:Ge.Status,label:"Status"},{key:Ge.OdigosVersion,label:"Odigos Version"},{key:Ge.ConnectedSince,label:"Connected Since"},{key:Ge.LastActivity,label:"Last Activity"}],Ye=(e,t)=>{const a=e.find(e=>e.key===Ge.Id)?.rawValue;a&&t(a.toString())},Be=({tableRowsMaxHeight:o,connections:i,getConnections:r,onClickConnection:c,deleteConnection:d,getConnectionRemoteConfig:u,applyConfigurations:m,getAllClusterSnapshots:b,persistSources:f})=>{const y=s(),{formatTimeAgo:w}=z(),[C,k]=a(!1),[v,x]=a(i||[]),[$,S]=a(!1),[I,A]=a(null),P=n(async()=>{try{k(!0),x(await r()??[])}catch(e){}finally{k(!1)}},[]),D=n(async()=>{if(b)try{S(!0),A(await b()??null)}catch(e){}finally{S(!1)}},[]);l(()=>{v.length||P()},[v.length,P]),l(()=>{I||D()},[I,D]);const[T,N]=a(""),[G,q]=a(null),[Y,B]=a([]),K=t(()=>v.filter(e=>e.status===g.Success),[v]),X=t(()=>v.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(t=>({cells:[{key:Ge.Id,rawValue:t.id},{key:Ge.Name,rawValue:t.name},{key:Ge.Type,rawValue:t.type},{key:Ge.Status,rawValue:t.status,component:()=>(t=>{const a=t===g.Success?"Connection live":"Connection lost",l=t===g.Success?pe:ge;return e.createElement(p,{status:t,label:a,leftIcon:l})})(t.status)},{key:Ge.OdigosVersion,rawValue:t.odigosVersion},{key:Ge.ConnectedSince,rawValue:t.connectedAt?w(t.connectedAt):"-"},{key:Ge.LastActivity,rawValue:t.lastSeenAt?w(t.lastSeenAt):"-"}],onClick:t.status===g.Success?()=>c(t):void 0,isSelected:Y.includes(t.id),onSelect:()=>B(e=>Array.from(new Set([...e,t.id]))),onDeselect:()=>B(e=>e.filter(e=>e!==t.id)),hideCheckbox:t.status!==g.Success})),[v,Y,T]);return e.createElement(L,null,e.createElement(V,{richTitle:{icon:ce,title:"Connections",badge:{label:v.length.toString(),status:h.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>N(e),width:"300px"},actions:[{id:M(),type:O.Button,buttonProps:{variant:R.Secondary,size:W.S,leftIcon:de,onClick:async()=>{await P(),await D()},disabled:C||$}}]},e.createElement(j,{variant:F.Pretty,maxHeight:o,headerBackgroundColor:y.v2.colors.silver[1e3],isLoading:C,withCheckboxes:!0,columns:qe,rows:X,rowActionsPushRightPosition:G?`calc(${G===He.BulkConfig?Le:Pe} - 24px)`:void 0,getRowActions:({cells:e})=>(e=>e.find(e=>e.key===Ge.Status)?.rawValue===g.Success)(e)?[I&&f?{id:M(),label:"Manage Sources",rightIcon:oe,onClick:async()=>{Ye(e,e=>{B([e]),q(He.BulkSource)})}}:null,u&&m?{id:M(),label:"Edit Configuration",rightIcon:re,onClick:async()=>{Ye(e,e=>{B([e]),q(He.BulkConfig)})}}:null]:[{id:M(),label:"Delete Connection",rightIcon:ue,onClick:()=>{Ye(e,e=>{B([e]),q(He.Delete)})}}]}),G===He.BulkConfig&&u&&m&&e.createElement(Ee,{onClose:()=>q(null),connections:K,selectedConnectionIds:Y,setSelectedConnectionIds:B,getConnectionRemoteConfig:u,onApply:m}),G===He.BulkSource&&I&&f&&e.createElement(ze,{onClose:()=>q(null),snapshots:I,selectedConnectionIds:Y,setSelectedConnectionIds:B,persistSources:f}),e.createElement(U,{target:"connection",isOpen:G===He.Delete,onClose:()=>{B([]),q(null)},onApprove:async()=>{const e=Y[0];e&&(await d(e),await P())}}),e.createElement(E,{isOpen:!!Y.length&&!G,richTitle:{icon:se,title:"Selected Clusters",badge:{label:Y.length}},actions:[{id:M(),type:O.Button,buttonProps:{variant:R.Text,size:W.S,label:"Cancel",onClick:()=>B([])}},I&&f?{id:M(),type:O.ButtonDropData,buttonProps:{variant:R.Secondary,size:W.S,label:"Add Component",onClick:e=>q(e)},dropDataProps:{alignX:H.Left,items:[{id:He.BulkSource,label:"Add Source",icon:oe}]}}:null,u&&m?{id:M(),type:O.Button,buttonProps:{variant:R.Primary,size:W.S,label:"Manage Configurations",rightIcon:re,onClick:()=>q(He.BulkConfig)}}:null]})))},Ke=o.div`
100
+ `,Ee=({onClose:n,connections:o,selectedConnectionIds:i,setSelectedConnectionIds:m,getConnectionRemoteConfig:b,onApply:w})=>{const C=s(),[k,v]=a(""),[z,L]=a({showOnlySelected:!1}),V=t(()=>o.filter(e=>(!k||e.name.toLowerCase().includes(k.toLowerCase()))&&(!z.showOnlySelected||i.includes(e.id))),[o,i.length,k,z]),M=e=>{m(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[O,W]=a(!1),[j,F]=a(!1),[U,E]=a(void 0),[H,G]=a(!1),[q,Y]=a(void 0),{formData:B,handleFormChange:K,areFormValuesEqual:X,resetFormData:J}=T(q||{automaticRollout:!0}),{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={automaticRollout:!t.rollout?.automaticRolloutDisabled};Y(e),J(e)}G(!1)})(i[0]):Y(void 0)},[i.length]);const _=()=>{W(!1),n()};return e.createElement(x,{isOpen:!0,hideOverlay:!0,width:Le,header:{icon:re,title:"Cluster Configuration",onClose:n}},e.createElement(Ve,null,e.createElement(Me,null,e.createElement($,{icon:se,title:"Selected Clusters",badge:{label:i.length}}),e.createElement(S,{width:"300px",placeholder:"Search by cluster name",value:k,onChange:v}),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:z.showOnlySelected,onChange:e=>L(t=>({...t,showOnlySelected:e}))}))),e.createElement(Oe,null,e.createElement(We,{$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(je,{$borderRadius:"16px 0 0 16px"},V.map(t=>e.createElement(Fe,{key:t.id,onClick:()=>M(t.id)},e.createElement(c,{value:i.includes(t.id),onChange:()=>M(t.id)}),e.createElement(d,{size:u.XS},t.name))))),e.createElement(We,{$width:"60%"},e.createElement(r,{$padding:"0 12px"},e.createElement(d,{size:u.XS},"Configurations")),e.createElement(je,{$borderRadius:"0 16px 16px 0",$gap:12},H?e.createElement(N,null):e.createElement(f,{label:"Automatic Rollout "+(B.automaticRollout?"Enabled":"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 enabled, Odigos will proactively restart workloads as needed to apply updated instrumentation. Users do not need to manually trigger rollouts after adding or removing sources. Any new pods created after enabling or disabling the agent (via automatic rollout, autoscaling, etc.) will still have the agent injected, regardless of this setting. When set to false, additional configurations related to automated rollouts or rollbacks take effect.",value:B.automaticRollout,onChange:e=>K("automaticRollout",e)}))))),e.createElement(Ue,null,H?e.createElement(I,{label:"Fetching configuration...",icon:ie,withGradient:!0,typographyProps:{size:u.XXS}}):j?e.createElement(I,{label:"Applying configurations...",icon:ie,withGradient:!0,typographyProps:{size:u.XXS}}):U?e.createElement(A,{fullWidth:!0,status:g.Error,message:U}):Q?e.createElement(A,{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(A,{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(P,{fullWidth:!0,variant:R.Secondary,label:"Cancel",onClick:()=>Q?W(!0):_(),disabled:j})),e.createElement("div",{style:{width:"150px"}},e.createElement(P,{fullWidth:!0,variant:R.Primary,label:"Save",onClick:async()=>{F(!0);const{error:e}=await w(i,B);F(!1),e?E(e):(m([]),n())},disabled:!Q||j})))),e.createElement(D,{isOpen:O,onClose:()=>W(!1),onApprove:_}))};var He,Ge;!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"}(He||(He={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Ge||(Ge={}));const qe=[{key:Ge.Name,label:"Name"},{key:Ge.Type,label:"Type",textAlign:"right"},{key:Ge.Status,label:"Status"},{key:Ge.OdigosVersion,label:"Odigos Version"},{key:Ge.ConnectedSince,label:"Connected Since"},{key:Ge.LastActivity,label:"Last Activity"}],Ye=(e,t)=>{const a=e.find(e=>e.key===Ge.Id)?.rawValue;a&&t(a.toString())},Be=({tableRowsMaxHeight:o,connections:i,getConnections:r,onClickConnection:c,deleteConnection:d,getConnectionRemoteConfig:u,applyConfigurations:m,getAllClusterSnapshots:b,persistSources:f})=>{const y=s(),{formatTimeAgo:w}=z(),[C,k]=a(!1),[v,x]=a(i||[]),[$,S]=a(!1),[I,A]=a(null),P=n(async()=>{try{k(!0),x(await r()??[])}catch(e){}finally{k(!1)}},[]),D=n(async()=>{if(b)try{S(!0),A(await b()??null)}catch(e){}finally{S(!1)}},[]);l(()=>{v.length||P()},[v.length,P]),l(()=>{I||D()},[I,D]);const[T,N]=a(""),[G,q]=a(null),[Y,B]=a([]),K=t(()=>v.filter(e=>e.status===g.Success),[v]),X=t(()=>v.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(t=>({cells:[{key:Ge.Id,rawValue:t.id},{key:Ge.Name,rawValue:t.name},{key:Ge.Type,rawValue:t.type},{key:Ge.Status,rawValue:t.status,component:()=>(t=>{const a=t===g.Success?"Connection live":"Connection lost",l=t===g.Success?pe:ge;return e.createElement(p,{status:t,label:a,leftIcon:l})})(t.status)},{key:Ge.OdigosVersion,rawValue:t.odigosVersion},{key:Ge.ConnectedSince,rawValue:t.connectedAt?w(t.connectedAt):"-"},{key:Ge.LastActivity,rawValue:t.lastSeenAt?w(t.lastSeenAt):"-"}],onClick:t.status===g.Success?()=>c(t):void 0,isSelected:Y.includes(t.id),onSelect:()=>B(e=>Array.from(new Set([...e,t.id]))),onDeselect:()=>B(e=>e.filter(e=>e!==t.id)),hideCheckbox:t.status!==g.Success})),[v,Y,T]);return e.createElement(L,null,e.createElement(V,{richTitle:{icon:ce,title:"Connections",badge:{label:v.length.toString(),status:h.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>N(e),width:"300px"},actions:[{id:M(),type:O.Button,buttonProps:{variant:R.Secondary,size:W.S,leftIcon:de,onClick:async()=>{await P(),await D()},disabled:C||$}}]},e.createElement(j,{variant:F.Pretty,maxHeight:o,headerBackgroundColor:y.v2.colors.silver[1e3],isLoading:C,withCheckboxes:!0,columns:qe,rows:X,rowActionsPushRightPosition:G?`calc(${G===He.BulkConfig?Le:Pe} - 24px)`:void 0,getRowActions:({cells:e})=>(e=>e.find(e=>e.key===Ge.Status)?.rawValue===g.Success)(e)?[I&&f?{id:M(),label:"Manage Sources",rightIcon:oe,onClick:async()=>{Ye(e,e=>{B([e]),q(He.BulkSource)})}}:null,u&&m?{id:M(),label:"Edit Configuration",rightIcon:re,onClick:async()=>{Ye(e,e=>{B([e]),q(He.BulkConfig)})}}:null]:[{id:M(),label:"Delete Connection",rightIcon:ue,onClick:()=>{Ye(e,e=>{B([e]),q(He.Delete)})}}]}),G===He.BulkConfig&&u&&m&&e.createElement(Ee,{onClose:()=>q(null),connections:K,selectedConnectionIds:Y,setSelectedConnectionIds:B,getConnectionRemoteConfig:u,onApply:m}),G===He.BulkSource&&I&&f&&e.createElement(ze,{onClose:()=>q(null),snapshots:I,selectedConnectionIds:Y,setSelectedConnectionIds:B,persistSources:async e=>{if(!f)return{error:"Persist sources function is not defined"};const{error:t}=await f(e);return t||await D(),{error:t}}}),e.createElement(U,{target:"connection",isOpen:G===He.Delete,onClose:()=>{B([]),q(null)},onApprove:async()=>{const e=Y[0];e&&(await d(e),await P())}}),e.createElement(E,{isOpen:!!Y.length&&!G,richTitle:{icon:se,title:"Selected Clusters",badge:{label:Y.length}},actions:[{id:M(),type:O.Button,buttonProps:{variant:R.Text,size:W.S,label:"Cancel",onClick:()=>B([])}},I&&f?{id:M(),type:O.ButtonDropData,buttonProps:{variant:R.Secondary,size:W.S,label:"Add Component",onClick:e=>q(e)},dropDataProps:{alignX:H.Left,items:[{id:He.BulkSource,label:"Add Source",icon:oe}]}}:null,u&&m?{id:M(),type:O.Button,buttonProps:{variant:R.Primary,size:W.S,label:"Manage Configurations",rightIcon:re,onClick:()=>q(He.BulkConfig)}}:null]})))},Ke=o.div`
101
101
  display: flex;
102
102
  align-items: center;
103
103
  justify-content: space-between;