@odigos/ui-kit 0.0.142 → 0.0.144

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/lib/chunks/ui-components-c5321fb4.js +2193 -0
  3. package/lib/components/_v2/button/index.d.ts +1 -1
  4. package/lib/components/_v2/button-tab/index.d.ts +4 -0
  5. package/lib/components/_v2/checkbox/index.d.ts +20 -1
  6. package/lib/components/_v2/hover-actions/index.d.ts +12 -0
  7. package/lib/components/_v2/icon-button/index.d.ts +1 -0
  8. package/lib/components/_v2/index.d.ts +1 -3
  9. package/lib/components/_v2/radio/index.d.ts +19 -1
  10. package/lib/components/_v2/search/index.d.ts +2 -1
  11. package/lib/components/_v2/table/index.d.ts +3 -2
  12. package/lib/components/_v2/table/table-rows/index.d.ts +3 -2
  13. package/lib/components/_v2/table/types.d.ts +0 -5
  14. package/lib/components/_v2/tag/index.d.ts +1 -0
  15. package/lib/components/_v2/toggle/index.d.ts +28 -2
  16. package/lib/components/data-card/index.d.ts +4 -2
  17. package/lib/components/v2.js +1 -1
  18. package/lib/components.js +1 -1
  19. package/lib/constants.js +1 -1
  20. package/lib/containers/v2.js +11 -11
  21. package/lib/containers.js +108 -108
  22. package/lib/functions.js +1 -1
  23. package/lib/hooks.js +1 -1
  24. package/lib/snippets.js +1 -1
  25. package/lib/store.js +1 -1
  26. package/lib/theme.js +1 -1
  27. package/lib/types/common/index.d.ts +8 -4
  28. package/lib/types/describe/index.d.ts +1 -0
  29. package/lib/types.js +1 -1
  30. package/package.json +2 -1
  31. package/lib/chunks/ui-components-6220f061.js +0 -2182
  32. package/lib/components/_v2/button-tab-list/index.d.ts +0 -6
  33. package/lib/components/_v2/checkbox-list/index.d.ts +0 -24
  34. package/lib/components/_v2/radio-group/index.d.ts +0 -23
  35. package/lib/components/_v2/table/table-rows/actions/index.d.ts +0 -8
@@ -11,7 +11,7 @@ export declare enum ButtonSize {
11
11
  L = "large"
12
12
  }
13
13
  export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
14
- label: string;
14
+ label?: string;
15
15
  leftIcon?: SVG;
16
16
  rightIcon?: SVG;
17
17
  variant?: ButtonVariants;
@@ -7,3 +7,7 @@ export interface ButtonTabProps {
7
7
  onClick: () => void;
8
8
  }
9
9
  export declare const ButtonTab: FC<ButtonTabProps>;
10
+ export interface ButtonTabListProps {
11
+ buttons: ButtonTabProps[];
12
+ }
13
+ export declare const ButtonTabList: FC<ButtonTabListProps>;
@@ -1,4 +1,5 @@
1
- import { type FC } from 'react';
1
+ import { type FC, Dispatch, SetStateAction } from 'react';
2
+ import { ListDirection } from '@/types';
2
3
  export declare enum CheckboxSize {
3
4
  S = "small",
4
5
  L = "large"
@@ -12,3 +13,21 @@ export interface CheckboxProps {
12
13
  onChange: (value: boolean) => void;
13
14
  }
14
15
  export declare const Checkbox: FC<CheckboxProps>;
16
+ interface Option extends Pick<CheckboxProps, 'label'> {
17
+ id: string;
18
+ }
19
+ interface Values {
20
+ [key: string]: boolean;
21
+ }
22
+ export interface CheckboxListProps {
23
+ direction?: ListDirection;
24
+ title?: string;
25
+ size?: CheckboxSize;
26
+ disabled?: boolean;
27
+ withSelectAll?: boolean;
28
+ options: Option[];
29
+ values: Values;
30
+ setValues: Dispatch<SetStateAction<Values>>;
31
+ }
32
+ export declare const CheckboxList: FC<CheckboxListProps>;
33
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type CSSProperties, type FC } from 'react';
2
+ import { type ButtonProps } from '../button';
3
+ export interface HoverAction extends Pick<ButtonProps, 'label' | 'leftIcon' | 'rightIcon' | 'loading' | 'disabled'> {
4
+ id: string;
5
+ onClick: () => void;
6
+ }
7
+ export interface HoverActionsProps {
8
+ isOpen: boolean;
9
+ actions: HoverAction[];
10
+ positionRight?: CSSProperties['right'];
11
+ }
12
+ export declare const HoverActions: FC<HoverActionsProps>;
@@ -10,5 +10,6 @@ export interface IconButtonProps {
10
10
  icon: SVG;
11
11
  size?: IconButtonSize;
12
12
  onClick?: MouseEventHandler;
13
+ disabled?: boolean;
13
14
  }
14
15
  export declare const IconButton: FC<IconButtonProps>;
@@ -1,14 +1,13 @@
1
1
  export * from './badge';
2
2
  export * from './button';
3
3
  export * from './button-tab';
4
- export * from './button-tab-list';
5
4
  export * from './cards';
6
5
  export * from './checkbox';
7
- export * from './checkbox-list';
8
6
  export * from './cli-command';
9
7
  export * from './drawer';
10
8
  export * from './drop-data';
11
9
  export * from './header';
10
+ export * from './hover-actions';
12
11
  export * from './icon-button';
13
12
  export * from './input';
14
13
  export * from './loader';
@@ -16,7 +15,6 @@ export * from './modal';
16
15
  export * from './navbar';
17
16
  export * from './note';
18
17
  export * from './radio';
19
- export * from './radio-group';
20
18
  export * from './search';
21
19
  export * from './segment';
22
20
  export * from './table';
@@ -1,4 +1,5 @@
1
- import { type FC } from 'react';
1
+ import { type FC, Dispatch, SetStateAction } from 'react';
2
+ import { ListDirection } from '@/types';
2
3
  export declare enum RadioSize {
3
4
  S = "small",
4
5
  L = "large"
@@ -11,3 +12,20 @@ export interface RadioProps {
11
12
  onChange: (value: boolean) => void;
12
13
  }
13
14
  export declare const Radio: FC<RadioProps>;
15
+ interface Option extends Pick<RadioProps, 'label'> {
16
+ id: string;
17
+ }
18
+ interface Values {
19
+ [key: string]: boolean;
20
+ }
21
+ export interface RadioGroupProps {
22
+ label?: string;
23
+ size?: RadioSize;
24
+ disabled?: boolean;
25
+ direction?: ListDirection;
26
+ options: Option[];
27
+ values: Values;
28
+ setValues: Dispatch<SetStateAction<Values>>;
29
+ }
30
+ export declare const RadioGroup: FC<RadioGroupProps>;
31
+ export {};
@@ -1,7 +1,8 @@
1
- import { type FC } from 'react';
1
+ import { type FC, CSSProperties } from 'react';
2
2
  export interface SearchProps {
3
3
  placeholder?: string;
4
4
  value: string;
5
5
  onChange: (value: string) => void;
6
+ width?: CSSProperties['width'];
6
7
  }
7
8
  export declare const Search: FC<SearchProps>;
@@ -1,6 +1,7 @@
1
1
  import { type FC } from 'react';
2
2
  import { CSSProperties } from 'styled-components';
3
- import { type TableColumn, type TableRow, type TableRowAction, TableVariant } from './types';
3
+ import { type TableColumn, type TableRow, TableVariant } from './types';
4
+ import { HoverAction } from '..';
4
5
  export * from './types';
5
6
  export interface TableProps {
6
7
  variant: TableVariant;
@@ -8,7 +9,7 @@ export interface TableProps {
8
9
  isLoading?: boolean;
9
10
  columns: TableColumn[];
10
11
  rows: TableRow[];
11
- getRowActions?: (row: TableRow) => TableRowAction[];
12
+ getRowActions?: (row: TableRow) => HoverAction[];
12
13
  rowActionsPushRightPosition?: CSSProperties['width'];
13
14
  withCheckboxes?: boolean;
14
15
  }
@@ -1,10 +1,11 @@
1
1
  import { type FC, type CSSProperties } from 'react';
2
- import type { TableColumn, TableRow, TableRowAction, TableVariant } from '../types';
2
+ import { HoverAction } from '../../hover-actions';
3
+ import type { TableColumn, TableRow, TableVariant } from '../types';
3
4
  interface TableRowsProps {
4
5
  variant: TableVariant;
5
6
  columns: TableColumn[];
6
7
  rows: TableRow[];
7
- getRowActions: (row: TableRow) => TableRowAction[];
8
+ getRowActions: (row: TableRow) => HoverAction[];
8
9
  rowActionsPushRightPosition?: CSSProperties['width'];
9
10
  withCheckboxes?: boolean;
10
11
  }
@@ -1,5 +1,4 @@
1
1
  import { type CSSProperties, type FC } from 'react';
2
- import { type ButtonProps } from '../button';
3
2
  export declare enum TableVariant {
4
3
  Data = "data",
5
4
  Pretty = "pretty"
@@ -22,7 +21,3 @@ export interface TableRow {
22
21
  component?: FC;
23
22
  }[];
24
23
  }
25
- export interface TableRowAction extends Pick<ButtonProps, 'label' | 'leftIcon' | 'rightIcon' | 'variant' | 'size' | 'loading' | 'disabled'> {
26
- id: string;
27
- onClick: () => void;
28
- }
@@ -4,6 +4,7 @@ export interface TagProps {
4
4
  label: string;
5
5
  leftIcon?: SVG;
6
6
  rightIcon?: SVG;
7
+ onClick?: () => void;
7
8
  disabled?: boolean;
8
9
  }
9
10
  export declare const Tag: FC<TagProps>;
@@ -1,5 +1,5 @@
1
- import { type FC } from 'react';
2
- import type { SVG } from '@/types';
1
+ import { SetStateAction, type FC, Dispatch } from 'react';
2
+ import { ListDirection, type SVG } from '@/types';
3
3
  export declare enum ToggleVariant {
4
4
  Default = "default",
5
5
  SuccessError = "successError"
@@ -8,14 +8,40 @@ export declare enum ToggleSize {
8
8
  S = "small",
9
9
  L = "large"
10
10
  }
11
+ export declare enum ToggleLabelAlign {
12
+ Left = "left",
13
+ Right = "right"
14
+ }
11
15
  export interface ToggleProps {
12
16
  variant?: ToggleVariant;
13
17
  size?: ToggleSize;
18
+ label?: string;
19
+ labelAlign?: ToggleLabelAlign;
20
+ tooltip?: string;
14
21
  value: boolean;
15
22
  onChange: (value: boolean) => void;
16
23
  disabled?: boolean;
17
24
  withIcon?: boolean;
18
25
  onIcon?: SVG;
19
26
  offIcon?: SVG;
27
+ onBgColor?: string;
28
+ offBgColor?: string;
20
29
  }
21
30
  export declare const Toggle: FC<ToggleProps>;
31
+ interface Option extends Omit<ToggleProps, 'size' | 'disabled' | 'value' | 'onChange'> {
32
+ id: string;
33
+ }
34
+ interface Values {
35
+ [key: string]: boolean;
36
+ }
37
+ export interface ToggleListProps {
38
+ direction?: ListDirection;
39
+ title?: string;
40
+ size?: ToggleSize;
41
+ disabled?: boolean;
42
+ options: Option[];
43
+ values: Values;
44
+ setValues: Dispatch<SetStateAction<Values>>;
45
+ }
46
+ export declare const ToggleList: FC<ToggleListProps>;
47
+ export {};
@@ -1,12 +1,14 @@
1
1
  import { type ReactNode, type FC, type PropsWithChildren } from 'react';
2
- import { OtherStatus, SVG } from '@/types';
2
+ import { OtherStatus, type SVG } from '@/types';
3
3
  import { DataCardFields, type DataCardFieldsProps, DataCardFieldTypes } from './data-card-fields';
4
4
  interface DataCardProps extends PropsWithChildren {
5
5
  title?: string;
6
6
  titleBadge?: string | number | OtherStatus.Loading;
7
7
  titleIcon?: SVG;
8
8
  description?: string;
9
- action?: ReactNode | (() => ReactNode);
9
+ action?: ReactNode | ((props: {
10
+ hovered: boolean;
11
+ }) => ReactNode);
10
12
  withExtend?: boolean;
11
13
  initialExtended?: boolean;
12
14
  data?: DataCardFieldsProps['data'];
@@ -1 +1 @@
1
- export{B as Badge,f as Button,l as ButtonSize,d5 as ButtonTab,d6 as ButtonTabList,g as ButtonVariants,C as Checkbox,da as CheckboxList,d9 as CheckboxListDirection,d8 as CheckboxSize,w as CliCommand,v as DataCard,D as Drawer,db as DropData,dc as Header,I as IconButton,c8 as IconButtonSize,dd as Input,L as Loader,de as Modal,df as Navbar,dg as Note,di as Radio,dk as RadioGroup,dj as RadioGroupDirection,dh as RadioSize,S as Search,i as SectionCard,k as SectionCardActionType,d7 as SectionCardSize,z as Segment,A as StatusCard,m as Table,n as TableVariant,dl as Tag,E as TextCard,c as Toggle,d as ToggleSize,dm as ToggleVariant,T as Typography,b as TypographySize,dn as TypographyVariants}from"../chunks/ui-components-6220f061.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{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,v as CliCommand,t as DataCard,D as Drawer,dc as DropData,dd as Header,b_ as HoverActions,I as IconButton,c9 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,y as Segment,z as StatusCard,l as Table,m as TableVariant,dl as Tag,A 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-c5321fb4.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{au as AutocompleteInput,aN as Badge,aQ as Button,af as CancelWarning,s as CenterThis,Q as Checkbox,x as Code,al as ConditionDetails,am as DataCard,H as DataCardFieldTypes,bB as DataCardFields,cV as DataFinger,aT as DataTab,ae as DeleteWarning,bY as DescribeRow,av as Divider,a5 as DocsButton,ad as Drawer,cX as DrawerFooter,cW as DrawerHeader,be as Dropdown,cY as ErrorBoundary,bn as ExtendArrow,t as FadeLoader,R as FieldError,M as FieldLabel,F as FlexColumn,a as FlexRow,cZ as Header,bm as IconButton,c5 as IconGroup,aI as IconTitleBadge,aD as IconWrapped,bU as IconsNav,c_ as ImageControlled,V as Input,a0 as InputList,Z as InputTable,aL as InteractiveTable,$ as KeyValueInputsList,aP as LoadingText,ap as Modal,ar as ModalBody,a6 as MonitorsCheckboxes,aF as MonitorsIcons,aq as NavigationButtons,N as NoDataFound,as as NotificationNote,d4 as Overlay,P as PageContent,b9 as Popup,c9 as PopupForm,ce as ScrollX,aX as ScrollY,a4 as SectionTitle,a3 as Segment,ba as SelectionButton,a$ as SkeletonLoader,ax as Status,bA as Stepper,c$ as TabList,aG as TableContainer,aH as TableTitleWrap,aK as TableWrap,bK as Tag,a2 as Text,a7 as TextArea,_ as Toggle,cc as ToggleCodeComponent,e as Tooltip,aM as TraceLoader,bb as VerticalScroll,d3 as WarningModal,d0 as getLinksFromText,d1 as getStrongsFromText,d2 as renderText}from"./chunks/ui-components-6220f061.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{at as AutocompleteInput,aN as Badge,aQ as Button,ae as CancelWarning,r as CenterThis,M as Checkbox,w as Code,ak as ConditionDetails,al as DataCard,G as DataCardFieldTypes,bB as DataCardFields,cX as DataFinger,aT as DataTab,ad as DeleteWarning,bY as DescribeRow,au as Divider,a4 as DocsButton,ac as Drawer,cZ as DrawerFooter,cY as DrawerHeader,be as Dropdown,c_ as ErrorBoundary,bn as ExtendArrow,s as FadeLoader,Q as FieldError,J as FieldLabel,F as FlexColumn,a as FlexRow,c$ as Header,bm as IconButton,c6 as IconGroup,aI as IconTitleBadge,aD as IconWrapped,bU as IconsNav,d0 as ImageControlled,U as Input,$ as InputList,Y as InputTable,aL as InteractiveTable,_ as KeyValueInputsList,aP as LoadingText,ao as Modal,aq as ModalBody,a5 as MonitorsCheckboxes,aF as MonitorsIcons,ap as NavigationButtons,N as NoDataFound,ar as NotificationNote,d6 as Overlay,P as PageContent,b9 as Popup,ca as PopupForm,cf as ScrollX,aX as ScrollY,a3 as SectionTitle,a2 as Segment,ba as SelectionButton,a$ as SkeletonLoader,aw as Status,bA as Stepper,d1 as TabList,aG as TableContainer,aH as TableTitleWrap,aK as TableWrap,bK as Tag,a1 as Text,a6 as TextArea,Z as Toggle,cd as ToggleCodeComponent,ay as Tooltip,aM as TraceLoader,bb as VerticalScroll,d5 as WarningModal,d2 as getLinksFromText,d3 as getStrongsFromText,d4 as renderText}from"./chunks/ui-components-c5321fb4.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{aj as ACTION_OPTIONS,ac as BUTTON_TEXTS,bl as DEFAULT_DATA_STREAM_NAME,by as DESTINATION_CATEGORIES,bf as DISPLAY_LANGUAGES,G as DISPLAY_TITLES,at as FORM_ALERTS,bN as INSTRUMENTATION_RULE_OPTIONS,cO as LANGUAGE_OPTIONS,bg as MONITORS_OPTIONS,bh as STORAGE_KEYS,cP as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-6220f061.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{ai as ACTION_OPTIONS,ab as BUTTON_TEXTS,bl as DEFAULT_DATA_STREAM_NAME,by as DESTINATION_CATEGORIES,bf as DISPLAY_LANGUAGES,E as DISPLAY_TITLES,as as FORM_ALERTS,bN as INSTRUMENTATION_RULE_OPTIONS,cQ as LANGUAGE_OPTIONS,bg as MONITORS_OPTIONS,bh as STORAGE_KEYS,cR as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-c5321fb4.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,4 +1,4 @@
1
- import e,{useState as a,useMemo as t,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 p,b as g,B as b,O as m,C as y,c as h,d as C,e as k,L as f,f as w,g as v,h as x,P as $,i as L,j as P,k as R,l as I,m as A,n as z,o as S,p as M,q as D,r as V,s as N,t as O,v as T,I as j,w as Y,x as F,y as H,z as E,N as U,A as W,E as q,W as G}from"../chunks/ui-components-6220f061.js";import{ConnectionsIcon as B,OdigosLogo as K,RefreshIcon as J,SettingsIcon as Q,DeleteIcon as X,VIcon as Z,XIcon as _,PodIcon as ee,ChevronUpIcon as ae,ChevronDownIcon as te,TerminalIcon as le,YamlIcon as oe,CopyIcon as ie,VSquareIcon as ne,XSquareIcon as se,PipelineCollectorIcon as re,DownloadIcon as ce,GatewayIcon as de}from"../icons.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",pe=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,u as r,D as d,S as c,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 k,e as C,f as w,g as v,P as x,h as $,i as L,j as P,k as R,l as I,m as A,n as S,o as D,p as M,q as z,r as V,s as O,t as N,I as T,v as j,w as Y,x as F,y as H,N as U,z as W,A as E,W as q}from"../chunks/ui-components-c5321fb4.js";import{ConnectionsIcon as G,OdigosLogo as B,RefreshIcon as K,SettingsIcon as J,DeleteIcon as Q,VIcon as X,XIcon as Z,PodIcon as _,ChevronUpIcon as ee,ChevronDownIcon as te,TerminalIcon as ae,YamlIcon as le,CopyIcon as oe,VSquareIcon as ie,XSquareIcon as ne,PipelineCollectorIcon as se,DownloadIcon as re,GatewayIcon as de}from"../icons.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 ce="75vw",ue=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  border-radius: 16px;
@@ -11,15 +11,15 @@ import e,{useState as a,useMemo as t,useCallback as l,useEffect as o}from"react"
11
11
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
12
12
  position: sticky;
13
13
  top: 0;
14
- `,be=i.div`
14
+ `,pe=i.div`
15
15
  display: flex;
16
16
  gap: 12px;
17
17
  padding: 16px;
18
- `,me=i(s)`
18
+ `,be=i(s)`
19
19
  width: ${({$width:e})=>e};
20
20
  gap: 12px;
21
21
  justify-content: space-between;
22
- `,ye=i.div`
22
+ `,me=i.div`
23
23
  display: flex;
24
24
  flex-direction: column;
25
25
  padding: 12px;
@@ -29,7 +29,7 @@ import e,{useState as a,useMemo as t,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
- `,he=i.div`
32
+ `,ye=i.div`
33
33
  display: flex;
34
34
  align-items: center;
35
35
  gap: 12px;
@@ -40,13 +40,13 @@ import e,{useState as a,useMemo as t,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
- `,Ce=i.div`
43
+ `,he=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
- `,ke=({isOpen:l,onClose:o,connections:i,selectedConnectionIds:s,setSelectedConnectionIds:x,onApply:$})=>{const L=n(),[P,R]=a(""),I=t(()=>i.filter(e=>!P||e.name.toLowerCase().includes(P.toLowerCase())),[i,P]),A=s.length>0,z=e=>{x(a=>a.includes(e)?a.filter(a=>a!==e):[...a,e])},[S,M]=a(!1),[D,V]=a(void 0),{formData:N,handleFormChange:O,resetFormData:T}=r({automaticRollout:!0});return e.createElement(c,{isOpen:l,hideOverlay:!0,width:ue,header:{icon:B,title:"Cluster Configuration",onClose:o}},e.createElement(pe,null,e.createElement(ge,null,e.createElement(d,{value:P,onChange:R})),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(p,{size:g.XS},"Clusters"),e.createElement(b,{label:i.length,status:m.Unknown})),e.createElement(u,{$gap:8},e.createElement(p,{size:g.XXXS,color:L.v2.colors.silver[200]},"Selected"),e.createElement(b,{label:`${s.length}/${i.length}`,status:m.Unknown}))),e.createElement(ye,{$isFooterOpen:A,$borderRadius:"16px 0 0 16px"},I.map(a=>e.createElement(he,{key:a.id,onClick:()=>z(a.id)},e.createElement(y,{value:s.includes(a.id),onChange:()=>z(a.id)}),e.createElement(p,{size:g.XS},a.name))))),e.createElement(me,{$width:"60%"},e.createElement(u,{$padding:"2px 12px"},e.createElement(p,{size:g.XS},"Configurations")),e.createElement(ye,{$isFooterOpen:A,$borderRadius:"0 16px 16px 0"},e.createElement(u,{$gap:12},e.createElement(p,{size:g.XS},"Automatic Rollout"),e.createElement(h,{size:C.S,value:N.automaticRollout,onChange:e=>O("automaticRollout",e)}),e.createElement(k,{text:"Automatic Rollout",withIcon:!0})))))),A&&e.createElement(Ce,null,S?e.createElement(f,{label:"Applying configurations...",icon:K,withGradient:!0,typographyProps:{size:g.XXS}}):D?e.createElement(p,{size:g.XXS,color:L.v2.colors.red[500]},D):null,e.createElement("div",{style:{width:"150px"}},e.createElement(w,{variant:v.Secondary,label:"Cancel",fullWidth:!0,onClick:()=>{T(),x([])},disabled:S})),e.createElement("div",{style:{width:"150px"}},e.createElement(w,{variant:v.Primary,label:"Apply",fullWidth:!0,onClick:async()=>{M(!0);const{error:e}=await $(s,N);M(!1),e?V(e):o()},disabled:S}))))};var fe;!function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(fe||(fe={}));const we=[{key:fe.Name,label:"Name",sortable:!0},{key:fe.Type,label:"Type",sortable:!0,textAlign:"right"},{key:fe.Status,label:"Status",sortable:!0},{key:fe.OdigosVersion,label:"Odigos Version",sortable:!0},{key:fe.ConnectedSince,label:"Connected Since",sortable:!0},{key:fe.LastActivity,label:"Last Activity",sortable:!0}],ve=({tableRowsMaxHeight:i,connections:n,getConnections:s,onClickConnection:r,deleteConnection:c,applyConfigurations:d})=>{const{formatTimeAgo:u}=x(),[p,g]=a(!1),[y,h]=a(n||[]),[C,k]=a(""),f=l(async()=>{try{g(!0),h(await s()??[])}catch(e){}finally{g(!1)}},[]);o(()=>{y.length||f()},[y.length,f]);const[w,M]=a([]),[D,V]=a(!1),N=t(()=>y.filter(e=>!C||e.name.toLowerCase().includes(C.toLowerCase())).map(a=>({onClick:()=>r(a.id),isSelected:w.includes(a.id),onSelect:()=>M(e=>[...e,a.id]),onDeselect:()=>M(e=>e.filter(e=>e!==a.id)),cells:[{key:fe.Id,rawValue:a.id},{key:fe.Name,rawValue:a.name},{key:fe.Type,rawValue:a.type},{key:fe.Status,rawValue:a.status,component:()=>(a=>{const t=a===S.Success?"Connection live":"Connection lost",l=a===S.Success?Z:_;return e.createElement(b,{status:a,label:t,leftIcon:l})})(a.status)},{key:fe.OdigosVersion,rawValue:a.odigosVersion},{key:fe.ConnectedSince,rawValue:a.connectedAt?u(a.connectedAt):"-"},{key:fe.LastActivity,rawValue:a.lastSeenAt?u(a.lastSeenAt):"-"}]})),[y,w,C]);return e.createElement($,null,e.createElement(L,{backgroundWeight:"1000",icon:B,title:"Connections",badge:{label:y.length.toString(),status:m.Unknown},search:{placeholder:"Search by cluster name",value:C,onChange:e=>k(e)},actions:[{id:P(),type:R.Button,buttonProps:{variant:v.Secondary,size:I.S,label:"",leftIcon:J,onClick:()=>f(),disabled:p}},{id:P(),type:R.Button,buttonProps:{variant:v.Primary,size:I.S,label:"Configurations",rightIcon:Q,onClick:()=>V(!0)}}]},e.createElement(A,{variant:z.Pretty,maxHeight:i,isLoading:p,withCheckboxes:!0,columns:we,rows:N,rowActionsPushRightPosition:D?`calc(${ue} - 24px)`:void 0,getRowActions:({cells:e})=>[{id:P(),label:"",leftIcon:Q,onClick:()=>{const a=e.find(e=>e.key===fe.Id)?.rawValue;a&&(M([a.toString()]),V(!0))},variant:v.Secondary,size:I.S},{id:P(),label:"",leftIcon:X,disabled:e.find(e=>e.key===fe.Status)?.rawValue===S.Success,onClick:async()=>{const a=e.find(e=>e.key===fe.Id)?.rawValue;a&&(await c(a.toString()),f())},variant:v.Secondary,size:I.S}]}),e.createElement(ke,{isOpen:D,onClose:()=>{M([]),V(!1)},connections:y,selectedConnectionIds:w,setSelectedConnectionIds:M,onApply:d})))},xe=i.div`
49
+ `,fe=({isOpen:l,onClose:o,connections:i,selectedConnectionIds:s,setSelectedConnectionIds:v,onApply:x})=>{const $=n(),[L,P]=t(""),R=a(()=>i.filter(e=>!L||e.name.toLowerCase().includes(L.toLowerCase())),[i,L]),I=s.length>0,A=e=>{v(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[S,D]=t(!1),[M,z]=t(void 0),{formData:V,handleFormChange:O,resetFormData:N}=r({automaticRollout:!0});return e.createElement(d,{isOpen:l,hideOverlay:!0,width:ce,header:{icon:G,title:"Cluster Configuration",onClose:o}},e.createElement(ue,null,e.createElement(ge,null,e.createElement(c,{width:"40%",value:L,onChange:P})),e.createElement(pe,null,e.createElement(be,{$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(me,{$isFooterOpen:I,$borderRadius:"16px 0 0 16px"},R.map(t=>e.createElement(ye,{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(be,{$width:"60%"},e.createElement(u,{$padding:"2px 12px"},e.createElement(g,{size:p.XS},"Configurations")),e.createElement(me,{$isFooterOpen:I,$borderRadius:"0 16px 16px 0"},e.createElement(u,{$gap:12},e.createElement(h,{size:f.S,label:"Automatic Rollout "+(V.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:V.automaticRollout,onChange:e=>O("automaticRollout",e)})))))),I&&e.createElement(he,null,S?e.createElement(k,{label:"Applying configurations...",icon:B,withGradient:!0,typographyProps:{size:p.XXS}}):M?e.createElement(g,{size:p.XXS,color:$.v2.colors.red[500]},M):null,e.createElement("div",{style:{width:"150px"}},e.createElement(C,{variant:w.Secondary,label:"Cancel",fullWidth:!0,onClick:()=>{N(),v([])},disabled:S})),e.createElement("div",{style:{width:"150px"}},e.createElement(C,{variant:w.Primary,label:"Apply",fullWidth:!0,onClick:async()=>{D(!0);const{error:e}=await x(s,V);D(!1),e?z(e):o()},disabled:S}))))};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}],we=({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,k]=t(""),C=l(async()=>{try{p(!0),h(await s()??[])}catch(e){}finally{p(!1)}},[]);o(()=>{y.length||C()},[y.length,C]);const[D,M]=t([]),[z,V]=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:()=>M(e=>[...e,t.id]),onDeselect:()=>M(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===S.Success?"Connection live":"Connection lost",l=t===S.Success?X:Z;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,D,f]);return e.createElement(x,null,e.createElement($,{backgroundWeight:"1000",icon:G,title:"Connections",badge:{label:y.length.toString(),status:m.Unknown},search:{placeholder:"Search by cluster name",value:f,onChange:e=>k(e)},actions:[{id:L(),type:P.Button,buttonProps:{variant:w.Secondary,size:R.S,leftIcon:K,onClick:()=>C(),disabled:g}},{id:L(),type:P.Button,buttonProps:{variant:w.Primary,size:R.S,label:"Configurations",rightIcon:J,onClick:()=>V(!0)}}]},e.createElement(I,{variant:A.Pretty,maxHeight:i,isLoading:g,withCheckboxes:!0,columns:Ce,rows:O,rowActionsPushRightPosition:z?`calc(${ce} - 24px)`:void 0,getRowActions:({cells:e})=>[{id:L(),leftIcon:J,onClick:()=>{const t=e.find(e=>e.key===ke.Id)?.rawValue;t&&(M([t.toString()]),V(!0))}},{id:L(),leftIcon:Q,disabled:e.find(e=>e.key===ke.Status)?.rawValue===S.Success,onClick:async()=>{const t=e.find(e=>e.key===ke.Id)?.rawValue;t&&(await d(t.toString()),C())}}]}),e.createElement(fe,{isOpen:z,onClose:()=>{M([]),V(!1)},connections:y,selectedConnectionIds:D,setSelectedConnectionIds:M,onApply:c})))},ve=i.div`
50
50
  display: flex;
51
51
  align-items: center;
52
52
  justify-content: space-between;
@@ -58,10 +58,10 @@ import e,{useState as a,useMemo as t,useCallback as l,useEffect as o}from"react"
58
58
  &:hover {
59
59
  background: ${({theme:e})=>e.v2.colors.silver[700]};
60
60
  }
61
- `,$e=i.div`
62
- animation-name: ${M.animations.fade.in};
63
- `,Le=({pod:l,getExtendedPodInfo:i,onClose:n})=>{const{formatTimeAgo:r}=x(),{clickCopy:d,isCopied:u}=D(),[g,b]=a(null),[m,y]=a(!1);o(()=>{l?i(l.namespace,l.name).then(e=>b(e??null)):(b(null),y(!1))},[l]);const h=t(()=>[{id:P(),title:"Node",label:g?.node??"-",withCopy:!0},{id:P(),title:"Status",badge:{status:V(g?.status),label:g?.status??"-"}}],[g]),C=t(()=>g?.containers?.map(e=>({id:P(),items:[{id:P(),title:"Container",label:e.name??"-"},{id:P(),title:"Status",badge:{status:V(e.status),label:e.status??"-"},label:e.startedAt?`(since ${r(e.startedAt)})`:""},{id:P(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:P(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:P(),title:"Restarts",label:e.restarts.toString()},{id:P(),title:"State Reason",label:e.stateReason??"-"},{id:P(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:P(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[g]);return e.createElement(c,{isOpen:!!l,header:{icon:ee,title:"Pod Information",onClose:n}},g?null:e.createElement(N,null,e.createElement(O,null)),g?e.createElement(e.Fragment,null,e.createElement(L,{icon:ee,title:g.name,withCopyTitle:!0},e.createElement(s,{$gap:24},e.createElement(T,{cellsPerRow:2,items:h}),C.length>0&&e.createElement(s,{$gap:12},e.createElement(xe,{onClick:()=>y(e=>!e)},e.createElement(p,null,"Containers Overview"),e.createElement(j,{icon:m?ae:te})),m&&C.map(({id:a,items:t})=>e.createElement($e,{key:a},e.createElement(T,{cellsPerRow:2,items:t})))))),e.createElement(L,{icon:le,title:"Kubectl Commands"},e.createElement(s,{$gap:12},e.createElement(Y,{value:`kubectl get pod ${g.name} -n ${g.namespace} -o yaml`}),e.createElement(Y,{value:`kubectl describe pod ${g.name} -n ${g.namespace}`}),e.createElement(Y,{value:`kubectl logs ${g.name} -n ${g.namespace}`}))),e.createElement(L,{icon:oe,title:"YAML",actions:[{id:P(),type:R.Button,buttonProps:{label:"",leftIcon:u?Z:ie,onClick:()=>d(g.manifestYAML),disabled:u,size:I.S,variant:v.Secondary}}]},e.createElement("div",{style:{padding:"0 12px"}},e.createElement(F,{code:g.manifestYAML,language:"yaml",theme:"duotoneDark"})))):null)};var Pe;!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"}(Pe||(Pe={}));const Re=[{key:Pe.PodName,label:"Pod Name",sortable:!0},{key:Pe.Ready,label:"Ready",sortable:!0,textAlign:"right"},{key:Pe.Started,label:"Started",sortable:!0,textAlign:"right"},{key:Pe.Status,label:"Status",sortable:!0},{key:Pe.Restarts,label:"Restarts",sortable:!0,textAlign:"right"},{key:Pe.NodeName,label:"Node Name",sortable:!0},{key:Pe.Age,label:"Age",sortable:!0,textAlign:"right"},{key:Pe.DockerImage,label:"Docker Image",sortable:!0,textAlign:"right"}],Ie=({isLoading:l,tableRowsMaxHeight:o,pods:i,getExtendedPodInfo:s})=>{const r=n(),{formatTimeAgo:c}=x(),[d,u]=a(null),p=t(()=>{const a=a=>a?e.createElement(ne,{fill:H(r,S.Success,"500"),size:20}):e.createElement(se,{fill:H(r,S.Error,"500"),size:20});return i.map(t=>({onClick:()=>u(t),cells:[{key:Pe.PodName,rawValue:t.name},{key:Pe.Ready,rawValue:t.ready,component:()=>a(t.ready)},{key:Pe.Started,rawValue:t.started,component:()=>a(t.started)},{key:Pe.Status,rawValue:t.status,component:()=>{return a=t.status,e.createElement(b,{status:V(a),label:a});var a}},{key:Pe.Restarts,rawValue:t.restartsCount.toString()},{key:Pe.NodeName,rawValue:t.nodeName},{key:Pe.Age,rawValue:c(t.creationTimestamp)},{key:Pe.DockerImage,rawValue:t.image}]}))},[i,r]);return e.createElement(L,{icon:ee,title:"Pods"},e.createElement(A,{variant:z.Data,maxHeight:o,isLoading:l,columns:Re,rows:p}),e.createElement(Le,{pod:d,getExtendedPodInfo:s,onClose:()=>u(null)}))};var Ae;!function(e){e.Gateway="gateway",e.Node="node"}(Ae||(Ae={}));const ze=[{value:Ae.Gateway,label:"Gateway"},{value:Ae.Node,label:"Node Collector"}],Se=i.div`
61
+ `,xe=i.div`
62
+ animation-name: ${D.animations.fade.in};
63
+ `,$e=({pod:l,getExtendedPodInfo:i,onClose:n})=>{const{formatTimeAgo:r}=v(),{clickCopy:c,isCopied:u}=M(),[p,b]=t(null),[m,y]=t(!1);o(()=>{l?i(l.namespace,l.name).then(e=>b(e??null)):(b(null),y(!1))},[l]);const h=a(()=>[{id:L(),title:"Node",label:p?.node??"-",withCopy:!0},{id:L(),title:"Status",badge:{status:z(p?.status),label:p?.status??"-"}}],[p]),f=a(()=>p?.containers?.map(e=>({id:L(),items:[{id:L(),title:"Container",label:e.name??"-"},{id:L(),title:"Status",badge:{status:z(e.status),label:e.status??"-"},label:e.startedAt?`(since ${r(e.startedAt)})`:""},{id:L(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:L(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:L(),title:"Restarts",label:e.restarts.toString()},{id:L(),title:"State Reason",label:e.stateReason??"-"},{id:L(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:L(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[p]);return e.createElement(d,{isOpen:!!l,header:{icon:_,title:"Pod Information",onClose:n}},p?null:e.createElement(V,null,e.createElement(O,null)),p?e.createElement(e.Fragment,null,e.createElement($,{icon:_,title:p.name,withCopyTitle:!0},e.createElement(s,{$gap:24},e.createElement(N,{cellsPerRow:2,items:h}),f.length>0&&e.createElement(s,{$gap:12},e.createElement(ve,{onClick:()=>y(e=>!e)},e.createElement(g,null,"Containers Overview"),e.createElement(T,{icon:m?ee:te})),m&&f.map(({id:t,items:a})=>e.createElement(xe,{key:t},e.createElement(N,{cellsPerRow:2,items:a})))))),e.createElement($,{icon:ae,title:"Kubectl Commands"},e.createElement(s,{$gap:12},e.createElement(j,{value:`kubectl get pod ${p.name} -n ${p.namespace} -o yaml`}),e.createElement(j,{value:`kubectl describe pod ${p.name} -n ${p.namespace}`}),e.createElement(j,{value:`kubectl logs ${p.name} -n ${p.namespace}`}))),e.createElement($,{icon:le,title:"YAML",actions:[{id:L(),type:P.Button,buttonProps:{label:"",leftIcon:u?X:oe,onClick:()=>c(p.manifestYAML),disabled:u,size:R.S,variant:w.Secondary}}]},e.createElement("div",{style:{padding:"0 12px"}},e.createElement(Y,{code:p.manifestYAML,language:"yaml",theme:"duotoneDark"})))):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 Pe=[{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"}],Re=({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(ie,{fill:F(r,S.Success,"500"),size:20}):e.createElement(ne,{fill:F(r,S.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:z(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:_,title:"Pods"},e.createElement(I,{variant:A.Data,maxHeight:o,isLoading:l,columns:Pe,rows:g}),e.createElement($e,{pod:c,getExtendedPodInfo:s,onClose:()=>u(null)}))};var Ie;!function(e){e.Gateway="gateway",e.Node="node"}(Ie||(Ie={}));const Ae=[{value:Ie.Gateway,label:"Gateway"},{value:Ie.Node,label:"Node Collector"}],Se=i.div`
64
64
  display: flex;
65
65
  align-items: center;
66
66
  justify-content: space-between;
67
- `,Me=({selectedTab:a,setSelectedTab:t,onClickDownloadDiagnose:l,onClickRefresh:o,isLoading:i})=>e.createElement(Se,null,e.createElement(u,{$gap:12},e.createElement(u,{$gap:8},e.createElement(re,{size:32}),e.createElement(p,{size:g.M,weight:500},"Pipeline Collectors")),e.createElement(E,{options:ze,selected:a,setSelected:t})),e.createElement(u,{$gap:8},l&&e.createElement(w,{label:"Download Diagnose",leftIcon:ce,size:I.S,variant:v.Text,onClick:l}),o&&e.createElement(w,{label:"Refresh",leftIcon:J,size:I.S,variant:v.Text,onClick:o,loading:i}))),De=({isOpen:a,onClose:t,title:l,yaml:o})=>{const{clickCopy:i,isCopied:n}=D();return e.createElement(c,{isOpen:a,header:{icon:de,title:l,onClose:t}},o?e.createElement(L,{icon:oe,title:"YAML",actions:[{id:P(),type:R.Button,buttonProps:{label:"",leftIcon:n?Z:ie,onClick:()=>i(o),disabled:n,size:I.S,variant:v.Secondary}}]},e.createElement("div",{style:{padding:"0 12px"}},e.createElement(F,{code:o,language:"yaml",theme:"duotoneDark"}))):e.createElement(U,{title:"No YAML found",subTitle:"The YAML for this resource is not available"}))};var Ve;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Ve||(Ve={}));const Ne=({icon:t,title:l,badge:o,statusCard:i,textCards:n,manifestYaml:s,configMapYaml:r})=>{const[c,d]=a(null);return e.createElement(L,{icon:t,title:l,badge:o,actions:[{id:P(),type:R.ButtonDropData,buttonProps:{variant:v.Secondary,size:I.S,label:"View YAML",onClick:e=>d(e)},dropDataItems:[{id:Ve.ManifestYaml,label:l,icon:oe},{id:Ve.ConfigMapYaml,label:"ConfigMap",icon:oe}]}]},e.createElement(u,{$gap:16},e.createElement(W,{...i}),n.map(a=>e.createElement(q,{key:a.title,...a}))),e.createElement(De,{isOpen:c===Ve.ManifestYaml,onClose:()=>d(null),title:l,yaml:s}),e.createElement(De,{isOpen:c===Ve.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:r}))},Oe=e=>{switch(e){case G.Healthy:return"All desired replicas are updated, available, and ready";case G.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case G.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case G.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case G.Down:return"No available replicas";case G.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},Te=({tableRowsMaxHeight:i,getGatewayInfo:n,getGatewayPods:s,getNodeCollectorInfo:r,getNodeCollectorPods:c,getExtendedPodInfo:d})=>{const{formatTimeAgo:u}=x(),[p,g]=a(!1),[b,y]=a(Ae.Gateway),[h,C]=a(null),[k,f]=a([]),[w,v]=a(null),[L,P]=a([]),R=l(async()=>{g(!0);try{switch(b){case Ae.Gateway:C(await n()??null),f(await s()??[]);break;case Ae.Node:v(await r()??null),P(await c()??[])}}catch(e){}g(!1)},[b]);o(()=>{R()},[R]);const I=t(()=>(e=>{switch(e){case Ae.Gateway:return"Deployment";case Ae.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(b),[b]),A=t(()=>((e,a,t,l)=>{const o={status:m.Disabled,label:"No rollouts yet"};let i=!1,n=null;switch(e){case Ae.Gateway:i=a?.rolloutInProgress??!1,n=a?.lastRolloutAt??null;break;case Ae.Node:i=t?.rolloutInProgress??!1,n=t?.lastRolloutAt??null;break;default:return o}return i?{status:S.Info,label:"Rollout in progress",rightIcon:J,useSecondaryTone:!0}:n?{status:m.Disabled,label:`Last Rollout: ${l(n)}`}:o})(b,h,w,u),[h,w,b,u]),z=t(()=>((e,a,t,l)=>{let o=l?S.Info:m.Unknown,i=l?"Loading":G.Unknown,n=l?"Fetching data...":Oe(G.Unknown);switch(e){case Ae.Gateway:o=a?.status?V(a?.status):o,i=a?.status??i,n=a?.status?Oe(a.status):n;break;case Ae.Node:o=t?.status?V(t?.status):o,i=t?.status??i,n=t?.status?Oe(t.status):n}return{status:o,title:i,description:n}})(b,h,w,p),[h,w,b,p]),M=t(()=>((e,a,t,l)=>{switch(e){case Ae.Gateway:return[{title:"HPA Spec (Replicas)",cells:[{label:"Min.",value:a?.hpa?.min.toString()??"-",isLoading:l},{label:"Max.",value:a?.hpa?.max.toString()??"-",isLoading:l},{label:"Current",value:a?.hpa?.current.toString()??"-",isLoading:l},{label:"Desired",value:a?.hpa?.desired.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}]}];case Ae.Node:return[{title:"Nodes",cells:[{label:"Desired",value:t?.nodes?.desired.toString()??"-",isLoading:l},{label:"Ready",value:t?.nodes?.ready.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}]}];default:return[]}})(b,h,w,p),[h,w,b,p]),D=t(()=>(b===Ae.Gateway?h?.manifestYAML:w?.manifestYAML)??"",[h,w,b]),N=t(()=>(b===Ae.Gateway?h?.configMapYAML:w?.configMapYAML)??"",[h,w,b]),O=t(()=>b===Ae.Gateway?k:L,[k,L,b]);return e.createElement($,null,e.createElement(Me,{isLoading:p,selectedTab:b,setSelectedTab:y,onClickDownloadDiagnose:void 0,onClickRefresh:R}),e.createElement(Ne,{icon:de,title:I,badge:A,statusCard:z,textCards:M,manifestYaml:D,configMapYaml:N}),e.createElement(Ie,{isLoading:p,tableRowsMaxHeight:i,pods:O,getExtendedPodInfo:d}))};export{ve as CentralConnections,Te as PipelineCollectors};
67
+ `,De=({selectedTab:t,setSelectedTab:a,onClickDownloadDiagnose:l,onClickRefresh:o,isLoading:i})=>e.createElement(Se,null,e.createElement(u,{$gap:12},e.createElement(u,{$gap:8},e.createElement(se,{size:32}),e.createElement(g,{size:p.M,weight:500},"Pipeline Collectors")),e.createElement(H,{options:Ae,selected:t,setSelected:a})),e.createElement(u,{$gap:8},l&&e.createElement(C,{label:"Download Diagnose",leftIcon:re,size:R.S,variant:w.Text,onClick:l}),o&&e.createElement(C,{label:"Refresh",leftIcon:K,size:R.S,variant:w.Text,onClick:o,loading:i}))),Me=({isOpen:t,onClose:a,title:l,yaml:o})=>{const{clickCopy:i,isCopied:n}=M();return e.createElement(d,{isOpen:t,header:{icon:de,title:l,onClose:a}},o?e.createElement($,{icon:le,title:"YAML",actions:[{id:L(),type:P.Button,buttonProps:{label:"",leftIcon:n?X:oe,onClick:()=>i(o),disabled:n,size:R.S,variant:w.Secondary}}]},e.createElement("div",{style:{padding:"0 12px"}},e.createElement(Y,{code:o,language:"yaml",theme:"duotoneDark"}))):e.createElement(U,{title:"No YAML found",subTitle:"The YAML for this resource is not available"}))};var ze;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(ze||(ze={}));const Ve=({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:L(),type:P.ButtonDropData,buttonProps:{variant:w.Secondary,size:R.S,label:"View YAML",onClick:e=>c(e)},dropDataItems:[{id:ze.ManifestYaml,label:l,icon:le},{id:ze.ConfigMapYaml,label:"ConfigMap",icon:le}]}]},e.createElement(u,{$gap:16},e.createElement(W,{...i}),n.map(t=>e.createElement(E,{key:t.title,...t}))),e.createElement(Me,{isOpen:d===ze.ManifestYaml,onClose:()=>c(null),title:l,yaml:s}),e.createElement(Me,{isOpen:d===ze.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:r}))},Oe=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"}},Ne=({tableRowsMaxHeight:i,getGatewayInfo:n,getGatewayPods:s,getNodeCollectorInfo:r,getNodeCollectorPods:d,getExtendedPodInfo:c})=>{const{formatTimeAgo:u}=v(),[g,p]=t(!1),[b,y]=t(Ie.Gateway),[h,f]=t(null),[k,C]=t([]),[w,$]=t(null),[L,P]=t([]),R=l(async()=>{p(!0);try{switch(b){case Ie.Gateway:f(await n()??null),C(await s()??[]);break;case Ie.Node:$(await r()??null),P(await d()??[])}}catch(e){}p(!1)},[b]);o(()=>{R()},[R]);const I=a(()=>(e=>{switch(e){case Ie.Gateway:return"Deployment";case Ie.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 Ie.Gateway:i=t?.rolloutInProgress??!1,n=t?.lastRolloutAt??null;break;case Ie.Node:i=a?.rolloutInProgress??!1,n=a?.lastRolloutAt??null;break;default:return o}return i?{status:S.Info,label:"Rollout in progress",rightIcon:K,useSecondaryTone:!0}:n?{status:m.Disabled,label:`Last Rollout: ${l(n)}`}:o})(b,h,w,u),[h,w,b,u]),D=a(()=>((e,t,a,l)=>{let o=l?S.Info:m.Unknown,i=l?"Loading":q.Unknown,n=l?"Fetching data...":Oe(q.Unknown);switch(e){case Ie.Gateway:o=t?.status?z(t?.status):o,i=t?.status??i,n=t?.status?Oe(t.status):n;break;case Ie.Node:o=a?.status?z(a?.status):o,i=a?.status??i,n=a?.status?Oe(a.status):n}return{status:o,title:i,description:n}})(b,h,w,g),[h,w,b,g]),M=a(()=>((e,t,a,l)=>{switch(e){case Ie.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 Ie.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,w,g),[h,w,b,g]),V=a(()=>(b===Ie.Gateway?h?.manifestYAML:w?.manifestYAML)??"",[h,w,b]),O=a(()=>(b===Ie.Gateway?h?.configMapYAML:w?.configMapYAML)??"",[h,w,b]),N=a(()=>b===Ie.Gateway?k:L,[k,L,b]);return e.createElement(x,null,e.createElement(De,{isLoading:g,selectedTab:b,setSelectedTab:y,onClickDownloadDiagnose:void 0,onClickRefresh:R}),e.createElement(Ve,{icon:de,title:I,badge:A,statusCard:D,textCards:M,manifestYaml:V,configMapYaml:O}),e.createElement(Re,{isLoading:g,tableRowsMaxHeight:i,pods:N,getExtendedPodInfo:c}))};export{we as CentralConnections,Ne as PipelineCollectors};