@odigos/ui-kit 0.0.149 → 0.0.150

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,6 +1,8 @@
1
1
  import React, { type FC } from 'react';
2
2
  export interface ModalProps {
3
3
  isOpen: boolean;
4
+ hideOverlay?: boolean;
5
+ relativeToParent?: boolean;
4
6
  onBack?: () => void;
5
7
  onClose?: () => void;
6
8
  children: React.ReactNode;
@@ -9,6 +9,7 @@ export interface SegmentProps<T = any> {
9
9
  options: Option<T>[];
10
10
  selected: T;
11
11
  setSelected: (value: T) => void;
12
+ disabled?: boolean;
12
13
  }
13
- export declare const Segment: <T>({ options, selected, setSelected }: SegmentProps<T>) => React.JSX.Element;
14
+ export declare const Segment: <T>({ options, selected, setSelected, disabled }: SegmentProps<T>) => React.JSX.Element;
14
15
  export {};
@@ -1,5 +1,6 @@
1
1
  import { type CSSProperties } from 'styled-components';
2
2
  export declare const PageContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ export declare const UpgradeRequiredWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
4
  export declare const FlexRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
5
  $gap?: number;
5
6
  $alignItems?: CSSProperties["alignItems"];
@@ -25,7 +26,9 @@ export declare const CenterThis: import("styled-components/dist/types").IStyledC
25
26
  $height?: CSSProperties["height"];
26
27
  }>> & string;
27
28
  export declare const VerticalScroll: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
28
- export declare const Overlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
29
+ export declare const Overlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
30
+ $relativeToParent?: boolean;
31
+ }>> & string;
29
32
  export declare const ModalBody: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
30
33
  $isNotModal?: boolean;
31
34
  $minHeight?: CSSProperties["minHeight"];
@@ -1 +1 @@
1
- export{B as Badge,e as Button,k as ButtonSize,d7 as ButtonTab,d8 as ButtonTabList,f as ButtonVariants,C as Checkbox,db as CheckboxList,da as CheckboxSize,t as CliCommand,s as DataCard,D as Drawer,dc as DropData,dd as Header,bY as HoverActions,I as IconButton,c8 as IconButtonSize,de as Input,L as Loader,df as Modal,dg as Navbar,dh as Note,dj as Radio,dk as RadioGroup,di as RadioSize,S as Search,h as SectionCard,j as SectionCardActionType,d9 as SectionCardSize,w as Segment,x as StatusCard,l as Table,m as TableVariant,dl as Tag,y as TextCard,c as Toggle,dn as ToggleLabelAlign,dp as ToggleList,d as ToggleSize,dm as ToggleVariant,T as Typography,b as TypographySize,dq as TypographyVariants}from"../chunks/ui-components-2ec876fd.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"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{i as Badge,m as Button,B as ButtonSize,da as ButtonTab,db as ButtonTabList,a as ButtonVariants,j as Checkbox,de as CheckboxList,dd as CheckboxSize,w as CliCommand,v as DataCard,D as Drawer,df as DropData,dg as Header,c0 as HoverActions,I as IconButton,cb as IconButtonSize,dh as Input,L as Loader,M as Modal,di as Navbar,dj as Note,dl as Radio,dm as RadioGroup,dk as RadioSize,e as Search,b as SectionCard,S as SectionCardActionType,dc as SectionCardSize,y as Segment,z as StatusCard,o as Table,p as TableVariant,dn as Tag,A as TextCard,k as Toggle,dq as ToggleLabelAlign,dr as ToggleList,l as ToggleSize,dp as ToggleVariant,T as Typography,h as TypographySize,ds as TypographyVariants}from"../chunks/ui-components-82b524d5.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"prism-react-renderer";import"react-error-boundary";import"lottie-react";
package/lib/components.js CHANGED
@@ -1 +1 @@
1
- export{aq as AutocompleteInput,aL as Badge,aO as Button,ab as CancelWarning,q as CenterThis,H as Checkbox,cf as Code,ah as ConditionDetails,ai as DataCard,A as DataCardFieldTypes,bz as DataCardFields,cX as DataFinger,aR as DataTab,aa as DeleteWarning,bW as DescribeRow,ar as Divider,a1 as DocsButton,a9 as Drawer,cZ as DrawerFooter,cY as DrawerHeader,bc as Dropdown,c_ as ErrorBoundary,bl as ExtendArrow,r as FadeLoader,J as FieldError,G as FieldLabel,F as FlexColumn,a as FlexRow,c$ as Header,bk as IconButton,c4 as IconGroup,aF as IconTitleBadge,aA as IconWrapped,bS as IconsNav,d0 as ImageControlled,N as Input,Y as InputList,U as InputTable,aI as InteractiveTable,X as KeyValueInputsList,aN as LoadingText,al as Modal,an as ModalBody,a2 as MonitorsCheckboxes,aC as MonitorsIcons,am as NavigationButtons,aJ as NoDataFound,ao as NotificationNote,d6 as Overlay,P as PageContent,b7 as Popup,c9 as PopupForm,ce as ScrollX,aV as ScrollY,a0 as SectionTitle,$ as Segment,b8 as SelectionButton,aZ as SkeletonLoader,at as Status,by as Stepper,d1 as TabList,aD as TableContainer,aE as TableTitleWrap,aH as TableWrap,bI as Tag,_ as Text,a3 as TextArea,V as Toggle,cc as ToggleCodeComponent,av as Tooltip,aK as TraceLoader,b9 as VerticalScroll,d5 as WarningModal,d2 as getLinksFromText,d3 as getStrongsFromText,d4 as renderText}from"./chunks/ui-components-2ec876fd.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"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{av as AutocompleteInput,aP as Badge,aS as Button,ag as CancelWarning,c as CenterThis,Q as Checkbox,C as Code,am as ConditionDetails,an as DataCard,G as DataCardFieldTypes,bD as DataCardFields,c_ as DataFinger,aV as DataTab,af as DeleteWarning,b_ as DescribeRow,aw as Divider,a6 as DocsButton,ae as Drawer,d0 as DrawerFooter,c$ as DrawerHeader,bg as Dropdown,d1 as ErrorBoundary,bp as ExtendArrow,t as FadeLoader,R as FieldError,J as FieldLabel,F as FlexColumn,f as FlexRow,d2 as Header,bo as IconButton,c8 as IconGroup,aK as IconTitleBadge,aF as IconWrapped,bW as IconsNav,d3 as ImageControlled,X as Input,a1 as InputList,_ as InputTable,aN as InteractiveTable,a0 as KeyValueInputsList,aR as LoadingText,aq as Modal,as as ModalBody,a7 as MonitorsCheckboxes,aH as MonitorsIcons,ar as NavigationButtons,N as NoDataFound,at as NotificationNote,d9 as Overlay,P as PageContent,bb as Popup,cc as PopupForm,ch as ScrollX,aZ as ScrollY,a5 as SectionTitle,a4 as Segment,bc as SelectionButton,b1 as SkeletonLoader,ay as Status,bC as Stepper,d4 as TabList,aI as TableContainer,aJ as TableTitleWrap,aM as TableWrap,bM as Tag,a3 as Text,a8 as TextArea,$ as Toggle,cf as ToggleCodeComponent,aA as Tooltip,aO as TraceLoader,U as UpgradeRequiredWrapper,bd as VerticalScroll,d8 as WarningModal,d5 as getLinksFromText,d6 as getStrongsFromText,d7 as renderText}from"./chunks/ui-components-82b524d5.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"prism-react-renderer";import"react-error-boundary";import"lottie-react";
package/lib/constants.js CHANGED
@@ -1 +1 @@
1
- export{af as ACTION_OPTIONS,a8 as BUTTON_TEXTS,bj as DEFAULT_DATA_STREAM_NAME,bw as DESTINATION_CATEGORIES,bd as DISPLAY_LANGUAGES,z as DISPLAY_TITLES,ap as FORM_ALERTS,bL as INSTRUMENTATION_RULE_OPTIONS,cQ as LANGUAGE_OPTIONS,be as MONITORS_OPTIONS,bf as STORAGE_KEYS,cR as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-2ec876fd.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"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{ak as ACTION_OPTIONS,ad as BUTTON_TEXTS,bn as DEFAULT_DATA_STREAM_NAME,bA as DESTINATION_CATEGORIES,bh as DISPLAY_LANGUAGES,E as DISPLAY_TITLES,au as FORM_ALERTS,bP as INSTRUMENTATION_RULE_OPTIONS,cT as LANGUAGE_OPTIONS,bi as MONITORS_OPTIONS,bj as STORAGE_KEYS,cU as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-82b524d5.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"prism-react-renderer";import"react-error-boundary";import"lottie-react";
@@ -7,7 +7,7 @@ export interface CentralConnectionsProps {
7
7
  tableRowsMaxHeight: CSSProperties['maxHeight'];
8
8
  connections?: Connection[];
9
9
  getConnections: () => Promise<Connection[]>;
10
- onClickConnection: (id: string) => void;
10
+ onClickConnection: (connection: Connection) => void;
11
11
  deleteConnection: (id: string) => Promise<void>;
12
12
  applyConfigurations: ApplyConnectionsConfigurationsFunc;
13
13
  }
@@ -4,7 +4,8 @@ export declare enum Tabs {
4
4
  Node = "node"
5
5
  }
6
6
  export interface ToolbarProps {
7
- isLoading?: boolean;
7
+ disabled?: boolean;
8
+ loading?: boolean;
8
9
  selectedTab: Tabs;
9
10
  setSelectedTab: Dispatch<SetStateAction<Tabs>>;
10
11
  onClickDownloadDiagnose?: () => void;
@@ -1,25 +1,25 @@
1
- import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react";import i,{useTheme as n}from"styled-components";import{F as s,u as r,D as c,S as d,a as u,T as g,b as p,B as b,O as m,C as y,c as h,d as f,L as w,e as k,f as C,g as v,P as x,h as $,i as R,j as L,k as P,l as I,m as A,n as S,o as D,p as V,q as z,r as M,s as O,I as N,t as j,v as T,w as F,x as H,y as U,W}from"../chunks/ui-components-2ec876fd.js";import{ConnectionsIcon as E,OdigosLogo as Y,RefreshIcon as q,SettingsIcon as G,DeleteIcon as B,VIcon as K,XIcon as J,PodIcon as Q,ChevronUpIcon as X,ChevronDownIcon as Z,TerminalIcon as _,VSquareIcon as ee,XSquareIcon as te,PipelineCollectorIcon as ae,DownloadIcon as le,GatewayIcon as oe,YamlIcon as ie}from"../icons.js";import{Y as ne}from"../chunks/index-ef6b1ee4.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const se="75vw",re=i.div`
1
+ import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react";import i,{useTheme as n}from"styled-components";import{F as s,d as r,D as d,e as c,f as u,T as g,h as p,i as b,O as m,j as y,k as h,l as f,L as w,m as k,a as C,n as v,P as x,b as $,g as R,S as P,B as I,o as L,p as S,q as A,M as V,r as z,s as D,c as O,t as M,v as j,I as T,w as N,x as U,y as F,z as H,A as W,W as q,U as E}from"../chunks/ui-components-82b524d5.js";import{ConnectionsIcon as Y,OdigosLogo as G,RefreshIcon as B,SettingsIcon as K,DeleteIcon as J,VIcon as Q,XIcon as X,PodIcon as Z,ChevronUpIcon as _,ChevronDownIcon as ee,TerminalIcon as te,VSquareIcon as ae,XSquareIcon as le,PipelineCollectorIcon as oe,DownloadIcon as ie,GatewayIcon as ne,YamlIcon as se}from"../icons.js";import{Y as re}from"../chunks/index-13c41ca4.js";import{useOdigos as de}from"../contexts.js";import{V as ce}from"../chunks/index-64bb5a64.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const ue="75vw",ge=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  border-radius: 16px;
5
5
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
6
6
  overflow: hidden;
7
- `,ce=i.div`
7
+ `,pe=i.div`
8
8
  display: flex;
9
9
  gap: 12px;
10
10
  padding: 16px;
11
11
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
12
12
  position: sticky;
13
13
  top: 0;
14
- `,de=i.div`
14
+ `,be=i.div`
15
15
  display: flex;
16
16
  gap: 12px;
17
17
  padding: 16px;
18
- `,ue=i(s)`
18
+ `,me=i(s)`
19
19
  width: ${({$width:e})=>e};
20
20
  gap: 12px;
21
21
  justify-content: space-between;
22
- `,ge=i.div`
22
+ `,ye=i.div`
23
23
  display: flex;
24
24
  flex-direction: column;
25
25
  padding: 12px;
@@ -29,7 +29,7 @@ import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react"
29
29
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
30
30
  overflow-y: auto;
31
31
  overflow-x: hidden;
32
- `,pe=i.div`
32
+ `,he=i.div`
33
33
  display: flex;
34
34
  align-items: center;
35
35
  gap: 12px;
@@ -40,13 +40,15 @@ import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react"
40
40
  &:hover {
41
41
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
42
42
  }
43
- `,be=i.div`
43
+ `,fe=i.div`
44
44
  display: flex;
45
45
  align-items: center;
46
46
  justify-content: flex-end;
47
47
  gap: 16px;
48
48
  padding: 0 24px;
49
- `,me=({isOpen:l,onClose:o,connections:i,selectedConnectionIds:s,setSelectedConnectionIds:v,onApply:x})=>{const $=n(),[R,L]=t(""),P=a(()=>i.filter(e=>!R||e.name.toLowerCase().includes(R.toLowerCase())),[i,R]),I=s.length>0,A=e=>{v(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[S,D]=t(!1),[V,z]=t(void 0),{formData:M,handleFormChange:O,resetFormData:N}=r({automaticRollout:!0});return e.createElement(c,{isOpen:l,hideOverlay:!0,width:se,header:{icon:E,title:"Cluster Configuration",onClose:o}},e.createElement(re,null,e.createElement(ce,null,e.createElement(d,{width:"40%",value:R,onChange:L})),e.createElement(de,null,e.createElement(ue,{$width:"40%"},e.createElement(u,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(u,{$gap:8},e.createElement(g,{size:p.XS},"Clusters"),e.createElement(b,{label:i.length,status:m.Unknown})),e.createElement(u,{$gap:8},e.createElement(g,{size:p.XXXS,color:$.v2.colors.silver[200]},"Selected"),e.createElement(b,{label:`${s.length}/${i.length}`,status:m.Unknown}))),e.createElement(ge,{$isFooterOpen:I,$borderRadius:"16px 0 0 16px"},P.map(t=>e.createElement(pe,{key:t.id,onClick:()=>A(t.id)},e.createElement(y,{value:s.includes(t.id),onChange:()=>A(t.id)}),e.createElement(g,{size:p.XS},t.name))))),e.createElement(ue,{$width:"60%"},e.createElement(u,{$padding:"2px 12px"},e.createElement(g,{size:p.XS},"Configurations")),e.createElement(ge,{$isFooterOpen:I,$borderRadius:"0 16px 16px 0"},e.createElement(u,{$gap:12},e.createElement(h,{size:f.S,label:"Automatic Rollout "+(M.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:M.automaticRollout,onChange:e=>O("automaticRollout",e)})))))),I&&e.createElement(be,null,S?e.createElement(w,{label:"Applying configurations...",icon:Y,withGradient:!0,typographyProps:{size:p.XXS}}):V?e.createElement(g,{size:p.XXS,color:$.v2.colors.red[500]},V):null,e.createElement("div",{style:{width:"150px"}},e.createElement(k,{variant:C.Secondary,label:"Cancel",fullWidth:!0,onClick:()=>{N(),v([])},disabled:S})),e.createElement("div",{style:{width:"150px"}},e.createElement(k,{variant:C.Primary,label:"Apply",fullWidth:!0,onClick:async()=>{D(!0);const{error:e}=await x(s,M);D(!1),e?z(e):o()},disabled:S}))))};var ye;!function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(ye||(ye={}));const he=[{key:ye.Name,label:"Name",sortable:!0},{key:ye.Type,label:"Type",sortable:!0,textAlign:"right"},{key:ye.Status,label:"Status",sortable:!0},{key:ye.OdigosVersion,label:"Odigos Version",sortable:!0},{key:ye.ConnectedSince,label:"Connected Since",sortable:!0},{key:ye.LastActivity,label:"Last Activity",sortable:!0}],fe=({tableRowsMaxHeight:i,connections:n,getConnections:s,onClickConnection:r,deleteConnection:c,applyConfigurations:d})=>{const{formatTimeAgo:u}=v(),[g,p]=t(!1),[y,h]=t(n||[]),[f,w]=t(""),k=l(async()=>{try{p(!0),h(await s()??[])}catch(e){}finally{p(!1)}},[]);o(()=>{y.length||k()},[y.length,k]);const[D,V]=t([]),[z,M]=t(!1),O=a(()=>y.filter(e=>!f||e.name.toLowerCase().includes(f.toLowerCase())).map(t=>({onClick:()=>r(t.id),isSelected:D.includes(t.id),onSelect:()=>V(e=>[...e,t.id]),onDeselect:()=>V(e=>e.filter(e=>e!==t.id)),cells:[{key:ye.Id,rawValue:t.id},{key:ye.Name,rawValue:t.name},{key:ye.Type,rawValue:t.type},{key:ye.Status,rawValue:t.status,component:()=>(t=>{const a=t===S.Success?"Connection live":"Connection lost",l=t===S.Success?K:J;return e.createElement(b,{status:t,label:a,leftIcon:l})})(t.status)},{key:ye.OdigosVersion,rawValue:t.odigosVersion},{key:ye.ConnectedSince,rawValue:t.connectedAt?u(t.connectedAt):"-"},{key:ye.LastActivity,rawValue:t.lastSeenAt?u(t.lastSeenAt):"-"}]})),[y,D,f]);return e.createElement(x,null,e.createElement($,{backgroundWeight:"1000",icon:E,title:"Connections",badge:{label:y.length.toString(),status:m.Unknown},search:{placeholder:"Search by cluster name",value:f,onChange:e=>w(e)},actions:[{id:R(),type:L.Button,buttonProps:{variant:C.Secondary,size:P.S,leftIcon:q,onClick:()=>k(),disabled:g}},{id:R(),type:L.Button,buttonProps:{variant:C.Primary,size:P.S,label:"Configurations",rightIcon:G,onClick:()=>M(!0)}}]},e.createElement(I,{variant:A.Pretty,maxHeight:i,isLoading:g,withCheckboxes:!0,columns:he,rows:O,rowActionsPushRightPosition:z?`calc(${se} - 24px)`:void 0,getRowActions:({cells:e})=>[{id:R(),leftIcon:G,onClick:()=>{const t=e.find(e=>e.key===ye.Id)?.rawValue;t&&(V([t.toString()]),M(!0))}},{id:R(),leftIcon:B,disabled:e.find(e=>e.key===ye.Status)?.rawValue===S.Success,onClick:async()=>{const t=e.find(e=>e.key===ye.Id)?.rawValue;t&&(await c(t.toString()),k())}}]}),e.createElement(me,{isOpen:z,onClose:()=>{V([]),M(!1)},connections:y,selectedConnectionIds:D,setSelectedConnectionIds:V,onApply:d})))},we=i.div`
49
+ `,we=({isOpen:l,onClose:o,connections:i,selectedConnectionIds:s,setSelectedConnectionIds:v,onApply:x})=>{const $=n(),[R,P]=t(""),I=a(()=>i.filter(e=>!R||e.name.toLowerCase().includes(R.toLowerCase())),[i,R]),L=s.length>0,S=e=>{v(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[A,V]=t(!1),[z,D]=t(void 0),{formData:O,handleFormChange:M,resetFormData:j}=r({automaticRollout:!0});return e.createElement(d,{isOpen:l,hideOverlay:!0,width:ue,header:{icon:Y,title:"Cluster Configuration",onClose:o}},e.createElement(ge,null,e.createElement(pe,null,e.createElement(c,{width:"40%",value:R,onChange:P})),e.createElement(be,null,e.createElement(me,{$width:"40%"},e.createElement(u,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(u,{$gap:8},e.createElement(g,{size:p.XS},"Clusters"),e.createElement(b,{label:i.length,status:m.Unknown})),e.createElement(u,{$gap:8},e.createElement(g,{size:p.XXXS,color:$.v2.colors.silver[200]},"Selected"),e.createElement(b,{label:`${s.length}/${i.length}`,status:m.Unknown}))),e.createElement(ye,{$isFooterOpen:L,$borderRadius:"16px 0 0 16px"},I.map(t=>e.createElement(he,{key:t.id,onClick:()=>S(t.id)},e.createElement(y,{value:s.includes(t.id),onChange:()=>S(t.id)}),e.createElement(g,{size:p.XS},t.name))))),e.createElement(me,{$width:"60%"},e.createElement(u,{$padding:"2px 12px"},e.createElement(g,{size:p.XS},"Configurations")),e.createElement(ye,{$isFooterOpen:L,$borderRadius:"0 16px 16px 0"},e.createElement(u,{$gap:12},e.createElement(h,{size:f.S,label:"Automatic Rollout "+(O.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:O.automaticRollout,onChange:e=>M("automaticRollout",e)})))))),L&&e.createElement(fe,null,A?e.createElement(w,{label:"Applying configurations...",icon:G,withGradient:!0,typographyProps:{size:p.XXS}}):z?e.createElement(g,{size:p.XXS,color:$.v2.colors.red[500]},z):null,e.createElement("div",{style:{width:"150px"}},e.createElement(k,{variant:C.Secondary,label:"Cancel",fullWidth:!0,onClick:()=>{j(),v([])},disabled:A})),e.createElement("div",{style:{width:"150px"}},e.createElement(k,{variant:C.Primary,label:"Apply",fullWidth:!0,onClick:async()=>{V(!0);const{error:e}=await x(s,O);V(!1),e?D(e):o()},disabled:A}))))};var ke;!function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(ke||(ke={}));const Ce=[{key:ke.Name,label:"Name",sortable:!0},{key:ke.Type,label:"Type",sortable:!0,textAlign:"right"},{key:ke.Status,label:"Status",sortable:!0},{key:ke.OdigosVersion,label:"Odigos Version",sortable:!0},{key:ke.ConnectedSince,label:"Connected Since",sortable:!0},{key:ke.LastActivity,label:"Last Activity",sortable:!0}],ve=({tableRowsMaxHeight:i,connections:n,getConnections:s,onClickConnection:r,deleteConnection:d,applyConfigurations:c})=>{const{formatTimeAgo:u}=v(),[g,p]=t(!1),[y,h]=t(n||[]),[f,w]=t(""),k=l(async()=>{try{p(!0),h(await s()??[])}catch(e){}finally{p(!1)}},[]);o(()=>{y.length||k()},[y.length,k]);const[V,z]=t([]),[D,O]=t(!1),M=a(()=>y.filter(e=>!f||e.name.toLowerCase().includes(f.toLowerCase())).map(t=>({onClick:()=>r(t),isSelected:V.includes(t.id),onSelect:()=>z(e=>[...e,t.id]),onDeselect:()=>z(e=>e.filter(e=>e!==t.id)),cells:[{key:ke.Id,rawValue:t.id},{key:ke.Name,rawValue:t.name},{key:ke.Type,rawValue:t.type},{key:ke.Status,rawValue:t.status,component:()=>(t=>{const a=t===A.Success?"Connection live":"Connection lost",l=t===A.Success?Q:X;return e.createElement(b,{status:t,label:a,leftIcon:l})})(t.status)},{key:ke.OdigosVersion,rawValue:t.odigosVersion},{key:ke.ConnectedSince,rawValue:t.connectedAt?u(t.connectedAt):"-"},{key:ke.LastActivity,rawValue:t.lastSeenAt?u(t.lastSeenAt):"-"}]})),[y,V,f]);return e.createElement(x,null,e.createElement($,{backgroundWeight:"1000",icon:Y,title:"Connections",badge:{label:y.length.toString(),status:m.Unknown},search:{placeholder:"Search by cluster name",value:f,onChange:e=>w(e)},actions:[{id:R(),type:P.Button,buttonProps:{variant:C.Secondary,size:I.S,leftIcon:B,onClick:()=>k(),disabled:g}},{id:R(),type:P.Button,buttonProps:{variant:C.Primary,size:I.S,label:"Configurations",rightIcon:K,onClick:()=>O(!0)}}]},e.createElement(L,{variant:S.Pretty,maxHeight:i,isLoading:g,withCheckboxes:!0,columns:Ce,rows:M,rowActionsPushRightPosition:D?`calc(${ue} - 24px)`:void 0,getRowActions:({cells:e})=>[{id:R(),leftIcon:K,onClick:()=>{const t=e.find(e=>e.key===ke.Id)?.rawValue;t&&(z([t.toString()]),O(!0))}},{id:R(),leftIcon:J,disabled:e.find(e=>e.key===ke.Status)?.rawValue===A.Success,onClick:async()=>{const t=e.find(e=>e.key===ke.Id)?.rawValue;t&&(await d(t.toString()),k())}}]}),e.createElement(we,{isOpen:D,onClose:()=>{z([]),O(!1)},connections:y,selectedConnectionIds:V,setSelectedConnectionIds:z,onApply:c})))},xe=i.div`
50
+ padding: 64px;
51
+ `,$e=({minSupportedVersion:t,currentVersion:a})=>{const l=n();return e.createElement(V,{isOpen:!0,relativeToParent:!0,onClose:()=>{}},e.createElement(xe,null,e.createElement(s,{$alignItems:"center",$gap:16},e.createElement(ce,null),e.createElement(g,{size:p.M,weight:500,color:l.v2.colors.white[500]},"Upgrade Required"),e.createElement(s,{$alignItems:"center",$gap:4},e.createElement(g,{size:p.XS,weight:400,color:l.v2.colors.silver[200]},`To use this feature, please upgrade to Odigos v${t} or later.`),e.createElement(g,{size:p.XS,weight:400,color:l.v2.colors.silver[200]},`Current version: ${a}.`)))))},Re=i.div`
50
52
  display: flex;
51
53
  align-items: center;
52
54
  justify-content: space-between;
@@ -58,10 +60,10 @@ import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react"
58
60
  &:hover {
59
61
  background: ${({theme:e})=>e.v2.colors.silver[700]};
60
62
  }
61
- `,ke=i.div`
62
- animation-name: ${D.animations.fade.in};
63
- `,Ce=({pod:l,getExtendedPodInfo:i,onClose:n})=>{const{formatTimeAgo:r}=v(),[d,u]=t(null),[p,b]=t(!1);o(()=>{l?i(l.namespace,l.name).then(e=>u(e??null)):(u(null),b(!1))},[l]);const m=a(()=>[{id:R(),title:"Node",label:d?.node??"-",withCopy:!0},{id:R(),title:"Status",badge:{status:V(d?.status),label:d?.status??"-"}}],[d]),y=a(()=>d?.containers?.map(e=>({id:R(),items:[{id:R(),title:"Container",label:e.name??"-"},{id:R(),title:"Status",badge:{status:V(e.status),label:e.status??"-"},label:e.startedAt?`(since ${r(e.startedAt)})`:""},{id:R(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:R(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:R(),title:"Restarts",label:e.restarts.toString()},{id:R(),title:"State Reason",label:e.stateReason??"-"},{id:R(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:R(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[d]);return e.createElement(c,{isOpen:!!l,header:{icon:Q,title:"Pod Information",onClose:n}},d?null:e.createElement(z,null,e.createElement(M,null)),d?e.createElement(e.Fragment,null,e.createElement($,{icon:Q,title:d.name,withCopyTitle:!0},e.createElement(s,{$gap:24},e.createElement(O,{cellsPerRow:2,items:m}),y.length>0&&e.createElement(s,{$gap:12},e.createElement(we,{onClick:()=>b(e=>!e)},e.createElement(g,null,"Containers Overview"),e.createElement(N,{icon:p?X:Z})),p&&y.map(({id:t,items:a})=>e.createElement(ke,{key:t},e.createElement(O,{cellsPerRow:2,items:a})))))),e.createElement($,{icon:_,title:"Kubectl Commands"},e.createElement(s,{$gap:12},e.createElement(j,{value:`kubectl get pod ${d.name} -n ${d.namespace} -o yaml`}),e.createElement(j,{value:`kubectl describe pod ${d.name} -n ${d.namespace}`}),e.createElement(j,{value:`kubectl logs ${d.name} -n ${d.namespace}`}))),e.createElement(ne,{yaml:d.manifestYAML})):null)};var ve;!function(e){e.PodName="podName",e.Ready="ready",e.Started="started",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(ve||(ve={}));const xe=[{key:ve.PodName,label:"Pod Name",sortable:!0},{key:ve.Ready,label:"Ready",sortable:!0,textAlign:"right"},{key:ve.Started,label:"Started",sortable:!0,textAlign:"right"},{key:ve.Status,label:"Status",sortable:!0},{key:ve.Restarts,label:"Restarts",sortable:!0,textAlign:"right"},{key:ve.NodeName,label:"Node Name",sortable:!0},{key:ve.Age,label:"Age",sortable:!0,textAlign:"right"},{key:ve.DockerImage,label:"Docker Image",sortable:!0,textAlign:"right"}],$e=({isLoading:l,tableRowsMaxHeight:o,pods:i,getExtendedPodInfo:s})=>{const r=n(),{formatTimeAgo:c}=v(),[d,u]=t(null),g=a(()=>{const t=t=>t?e.createElement(ee,{fill:T(r,S.Success,"500"),size:20}):e.createElement(te,{fill:T(r,S.Error,"500"),size:20});return i.map(a=>({onClick:()=>u(a),cells:[{key:ve.PodName,rawValue:a.name},{key:ve.Ready,rawValue:a.ready,component:()=>t(a.ready)},{key:ve.Started,rawValue:a.started,component:()=>t(a.started)},{key:ve.Status,rawValue:a.status,component:()=>{return t=a.status,e.createElement(b,{status:V(t),label:t});var t}},{key:ve.Restarts,rawValue:a.restartsCount.toString()},{key:ve.NodeName,rawValue:a.nodeName},{key:ve.Age,rawValue:c(a.creationTimestamp)},{key:ve.DockerImage,rawValue:a.image}]}))},[i,r]);return e.createElement($,{icon:Q,title:"Pods"},e.createElement(I,{variant:A.Data,maxHeight:o,isLoading:l,columns:xe,rows:g}),e.createElement(Ce,{pod:d,getExtendedPodInfo:s,onClose:()=>u(null)}))};var Re;!function(e){e.Gateway="gateway",e.Node="node"}(Re||(Re={}));const Le=[{value:Re.Gateway,label:"Gateway"},{value:Re.Node,label:"Node Collector"}],Pe=i.div`
63
+ `,Pe=i.div`
64
+ animation-name: ${z.animations.fade.in};
65
+ `,Ie=({pod:l,getExtendedPodInfo:i,onClose:n})=>{const{formatTimeAgo:r}=v(),[c,u]=t(null),[p,b]=t(!1);o(()=>{l?i(l.namespace,l.name).then(e=>u(e??null)):(u(null),b(!1))},[l]);const m=a(()=>[{id:R(),title:"Node",label:c?.node??"-",withCopy:!0},{id:R(),title:"Status",badge:{status:D(c?.status),label:c?.status??"-"}}],[c]),y=a(()=>c?.containers?.map(e=>({id:R(),items:[{id:R(),title:"Container",label:e.name??"-"},{id:R(),title:"Status",badge:{status:D(e.status),label:e.status??"-"},label:e.startedAt?`(since ${r(e.startedAt)})`:""},{id:R(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:R(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:R(),title:"Restarts",label:e.restarts.toString()},{id:R(),title:"State Reason",label:e.stateReason??"-"},{id:R(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:R(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return e.createElement(d,{isOpen:!!l,header:{icon:Z,title:"Pod Information",onClose:n}},c?null:e.createElement(O,null,e.createElement(M,null)),c?e.createElement(e.Fragment,null,e.createElement($,{icon:Z,title:c.name,withCopyTitle:!0},e.createElement(s,{$gap:24},e.createElement(j,{cellsPerRow:2,items:m}),y.length>0&&e.createElement(s,{$gap:12},e.createElement(Re,{onClick:()=>b(e=>!e)},e.createElement(g,null,"Containers Overview"),e.createElement(T,{icon:p?_:ee})),p&&y.map(({id:t,items:a})=>e.createElement(Pe,{key:t},e.createElement(j,{cellsPerRow:2,items:a})))))),e.createElement($,{icon:te,title:"Kubectl Commands"},e.createElement(s,{$gap:12},e.createElement(N,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),e.createElement(N,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),e.createElement(N,{value:`kubectl logs ${c.name} -n ${c.namespace}`}))),e.createElement(re,{yaml:c.manifestYAML})):null)};var Le;!function(e){e.PodName="podName",e.Ready="ready",e.Started="started",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(Le||(Le={}));const Se=[{key:Le.PodName,label:"Pod Name",sortable:!0},{key:Le.Ready,label:"Ready",sortable:!0,textAlign:"right"},{key:Le.Started,label:"Started",sortable:!0,textAlign:"right"},{key:Le.Status,label:"Status",sortable:!0},{key:Le.Restarts,label:"Restarts",sortable:!0,textAlign:"right"},{key:Le.NodeName,label:"Node Name",sortable:!0},{key:Le.Age,label:"Age",sortable:!0,textAlign:"right"},{key:Le.DockerImage,label:"Docker Image",sortable:!0,textAlign:"right"}],Ae=({isLoading:l,tableRowsMaxHeight:o,pods:i,getExtendedPodInfo:s})=>{const r=n(),{formatTimeAgo:d}=v(),[c,u]=t(null),g=a(()=>{const t=t=>t?e.createElement(ae,{fill:U(r,A.Success,"500"),size:20}):e.createElement(le,{fill:U(r,A.Error,"500"),size:20});return i.map(a=>({onClick:()=>u(a),cells:[{key:Le.PodName,rawValue:a.name},{key:Le.Ready,rawValue:a.ready,component:()=>t(a.ready)},{key:Le.Started,rawValue:a.started,component:()=>t(a.started)},{key:Le.Status,rawValue:a.status,component:()=>{return t=a.status,e.createElement(b,{status:D(t),label:t});var t}},{key:Le.Restarts,rawValue:a.restartsCount.toString()},{key:Le.NodeName,rawValue:a.nodeName},{key:Le.Age,rawValue:d(a.creationTimestamp)},{key:Le.DockerImage,rawValue:a.image}]}))},[i,r]);return e.createElement($,{icon:Z,title:"Pods"},e.createElement(L,{variant:S.Data,maxHeight:o,isLoading:l,columns:Se,rows:g}),e.createElement(Ie,{pod:c,getExtendedPodInfo:s,onClose:()=>u(null)}))};var Ve;!function(e){e.Gateway="gateway",e.Node="node"}(Ve||(Ve={}));const ze=[{value:Ve.Gateway,label:"Gateway"},{value:Ve.Node,label:"Node Collector"}],De=i.div`
64
66
  display: flex;
65
67
  align-items: center;
66
68
  justify-content: space-between;
67
- `,Ie=({selectedTab:t,setSelectedTab:a,onClickDownloadDiagnose:l,onClickRefresh:o,isLoading:i})=>e.createElement(Pe,null,e.createElement(u,{$gap:12},e.createElement(u,{$gap:8},e.createElement(ae,{size:32}),e.createElement(g,{size:p.M,weight:500},"Pipeline Collectors")),e.createElement(F,{options:Le,selected:t,setSelected:a})),e.createElement(u,{$gap:8},l&&e.createElement(k,{label:"Download Diagnose",leftIcon:le,size:P.S,variant:C.Text,onClick:l}),o&&e.createElement(k,{label:"Refresh",leftIcon:q,size:P.S,variant:C.Text,onClick:o,loading:i}))),Ae=({isOpen:t,onClose:a,title:l,yaml:o})=>e.createElement(c,{isOpen:t,header:{icon:oe,title:l,onClose:a}},e.createElement(ne,{yaml:o}));var Se;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Se||(Se={}));const De=({icon:a,title:l,badge:o,statusCard:i,textCards:n,manifestYaml:s,configMapYaml:r})=>{const[c,d]=t(null);return e.createElement($,{icon:a,title:l,badge:o,actions:[{id:R(),type:L.ButtonDropData,buttonProps:{variant:C.Secondary,size:P.S,label:"View YAML",onClick:e=>d(e)},dropDataItems:[{id:Se.ManifestYaml,label:l,icon:ie},{id:Se.ConfigMapYaml,label:"ConfigMap",icon:ie}]}]},e.createElement(u,{$gap:16},e.createElement(H,{...i}),n.map(t=>e.createElement(U,{key:t.title,...t}))),e.createElement(Ae,{isOpen:c===Se.ManifestYaml,onClose:()=>d(null),title:l,yaml:s}),e.createElement(Ae,{isOpen:c===Se.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:r}))},Ve=e=>{switch(e){case W.Healthy:return"All desired replicas are updated, available, and ready";case W.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case W.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case W.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case W.Down:return"No available replicas";case W.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},ze=({tableRowsMaxHeight:i,getGatewayInfo:n,getGatewayPods:s,getNodeCollectorInfo:r,getNodeCollectorPods:c,getExtendedPodInfo:d})=>{const{formatTimeAgo:u}=v(),[g,p]=t(!1),[b,y]=t(Re.Gateway),[h,f]=t(null),[w,k]=t([]),[C,$]=t(null),[R,L]=t([]),P=l(async()=>{p(!0);try{switch(b){case Re.Gateway:f(await n()??null),k(await s()??[]);break;case Re.Node:$(await r()??null),L(await c()??[])}}catch(e){}p(!1)},[b]);o(()=>{P()},[P]);const I=a(()=>(e=>{switch(e){case Re.Gateway:return"Deployment";case Re.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(b),[b]),A=a(()=>((e,t,a,l)=>{const o={status:m.Disabled,label:"No rollouts yet"};let i=!1,n=null;switch(e){case Re.Gateway:i=t?.rolloutInProgress??!1,n=t?.lastRolloutAt??null;break;case Re.Node:i=a?.rolloutInProgress??!1,n=a?.lastRolloutAt??null;break;default:return o}return i?{status:S.Info,label:"Rollout in progress",rightIcon:q,useSecondaryTone:!0}:n?{status:m.Disabled,label:`Last Rollout: ${l(n)}`}:o})(b,h,C,u),[h,C,b,u]),D=a(()=>((e,t,a,l)=>{let o=l?S.Info:m.Unknown,i=l?"Loading":W.Unknown,n=l?"Fetching data...":Ve(W.Unknown);switch(e){case Re.Gateway:o=t?.status?V(t?.status):o,i=t?.status??i,n=t?.status?Ve(t.status):n;break;case Re.Node:o=a?.status?V(a?.status):o,i=a?.status??i,n=a?.status?Ve(a.status):n}return{status:o,title:i,description:n}})(b,h,C,g),[h,C,b,g]),z=a(()=>((e,t,a,l)=>{switch(e){case Re.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 Re.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[]}})(b,h,C,g),[h,C,b,g]),M=a(()=>(b===Re.Gateway?h?.manifestYAML:C?.manifestYAML)??"",[h,C,b]),O=a(()=>(b===Re.Gateway?h?.configMapYAML:C?.configMapYAML)??"",[h,C,b]),N=a(()=>b===Re.Gateway?w:R,[w,R,b]);return e.createElement(x,null,e.createElement(Ie,{isLoading:g,selectedTab:b,setSelectedTab:y,onClickDownloadDiagnose:void 0,onClickRefresh:P}),e.createElement(De,{icon:oe,title:I,badge:A,statusCard:D,textCards:z,manifestYaml:M,configMapYaml:O}),e.createElement($e,{isLoading:g,tableRowsMaxHeight:i,pods:N,getExtendedPodInfo:d}))};export{fe as CentralConnections,ze as PipelineCollectors};
69
+ `,Oe=({selectedTab:t,setSelectedTab:a,onClickDownloadDiagnose:l,onClickRefresh:o,loading:i,disabled:n})=>e.createElement(De,null,e.createElement(u,{$gap:12},e.createElement(u,{$gap:8},e.createElement(oe,{size:32}),e.createElement(g,{size:p.M,weight:500},"Pipeline Collectors")),e.createElement(F,{options:ze,selected:t,setSelected:a,disabled:n})),e.createElement(u,{$gap:8},l&&e.createElement(k,{label:"Download Diagnose",leftIcon:ie,size:I.S,variant:C.Text,onClick:l,disabled:n}),o&&e.createElement(k,{label:"Refresh",leftIcon:B,size:I.S,variant:C.Text,onClick:o,loading:i,disabled:n}))),Me=({isOpen:t,onClose:a,title:l,yaml:o})=>e.createElement(d,{isOpen:t,header:{icon:ne,title:l,onClose:a}},e.createElement(re,{yaml:o}));var je;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(je||(je={}));const Te=({icon:a,title:l,badge:o,statusCard:i,textCards:n,manifestYaml:s,configMapYaml:r})=>{const[d,c]=t(null);return e.createElement($,{icon:a,title:l,badge:o,actions:[{id:R(),type:P.ButtonDropData,buttonProps:{variant:C.Secondary,size:I.S,label:"View YAML",onClick:e=>c(e)},dropDataItems:[{id:je.ManifestYaml,label:l,icon:se},{id:je.ConfigMapYaml,label:"ConfigMap",icon:se}]}]},e.createElement(u,{$gap:16},e.createElement(H,{...i}),n.map(t=>e.createElement(W,{key:t.title,...t}))),e.createElement(Me,{isOpen:d===je.ManifestYaml,onClose:()=>c(null),title:l,yaml:s}),e.createElement(Me,{isOpen:d===je.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:r}))},Ne=e=>{switch(e){case q.Healthy:return"All desired replicas are updated, available, and ready";case q.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case q.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case q.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case q.Down:return"No available replicas";case q.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},Ue=({tableRowsMaxHeight:i,getGatewayInfo:n,getGatewayPods:s,getNodeCollectorInfo:r,getNodeCollectorPods:d,getExtendedPodInfo:c})=>{const{formatTimeAgo:u}=v(),{isVersionSupported:g,version:p}=de(1.12),[b,y]=t(!1),[h,f]=t(Ve.Gateway),[w,k]=t(null),[C,$]=t([]),[R,P]=t(null),[I,L]=t([]),S=l(async()=>{y(!0);try{switch(h){case Ve.Gateway:k(await n()??null),$(await s()??[]);break;case Ve.Node:P(await r()??null),L(await d()??[])}}catch(e){}y(!1)},[h]);o(()=>{S()},[S]);const V=a(()=>(e=>{switch(e){case Ve.Gateway:return"Deployment";case Ve.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(h),[h]),z=a(()=>((e,t,a,l)=>{const o={status:m.Disabled,label:"No rollouts yet"};let i=!1,n=null;switch(e){case Ve.Gateway:i=t?.rolloutInProgress??!1,n=t?.lastRolloutAt??null;break;case Ve.Node:i=a?.rolloutInProgress??!1,n=a?.lastRolloutAt??null;break;default:return o}return i?{status:A.Info,label:"Rollout in progress",rightIcon:B,useSecondaryTone:!0}:n?{status:m.Disabled,label:`Last Rollout: ${l(n)}`}:o})(h,w,R,u),[w,R,h,u]),O=a(()=>((e,t,a,l)=>{let o=l?A.Info:m.Unknown,i=l?"Loading":q.Unknown,n=l?"Fetching data...":Ne(q.Unknown);switch(e){case Ve.Gateway:o=t?.status?D(t?.status):o,i=t?.status??i,n=t?.status?Ne(t.status):n;break;case Ve.Node:o=a?.status?D(a?.status):o,i=a?.status??i,n=a?.status?Ne(a.status):n}return{status:o,title:i,description:n}})(h,w,R,b),[w,R,h,b]),M=a(()=>((e,t,a,l)=>{switch(e){case Ve.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 Ve.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[]}})(h,w,R,b),[w,R,h,b]),j=a(()=>(h===Ve.Gateway?w?.manifestYAML:R?.manifestYAML)??"",[w,R,h]),T=a(()=>(h===Ve.Gateway?w?.configMapYAML:R?.configMapYAML)??"",[w,R,h]),N=a(()=>h===Ve.Gateway?C:I,[C,I,h]);return e.createElement(x,null,e.createElement(Oe,{disabled:!g,loading:b,selectedTab:h,setSelectedTab:f,onClickDownloadDiagnose:void 0,onClickRefresh:S}),e.createElement(E,null,e.createElement(Te,{icon:ne,title:V,badge:z,statusCard:O,textCards:M,manifestYaml:j,configMapYaml:T}),e.createElement(Ae,{isLoading:b,tableRowsMaxHeight:i,pods:N,getExtendedPodInfo:c}),!g&&e.createElement($e,{minSupportedVersion:1.12,currentVersion:p||""})))};export{ve as CentralConnections,Ue as PipelineCollectors};