@odigos/ui-kit 0.0.162 → 0.0.164

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 (42) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/lib/chunks/index-53f81cb1.js +3 -0
  3. package/lib/chunks/{ui-components-48696fb2.js → ui-components-fabd01fd.js} +125 -123
  4. package/lib/components/_v2/search/index.d.ts +3 -1
  5. package/lib/components/_v2/segment/index.d.ts +6 -1
  6. package/lib/components/input-table/map-columns-to-fields/index.d.ts +1 -1
  7. package/lib/components/input-table/types.d.ts +1 -1
  8. package/lib/components/v2.js +1 -1
  9. package/lib/components.js +1 -1
  10. package/lib/constants.js +1 -1
  11. package/lib/containers/_v2/central-connections/source-drawer/index.d.ts +15 -0
  12. package/lib/containers/data-flow/column/base.d.ts +1 -0
  13. package/lib/containers/data-flow/column/head.d.ts +1 -0
  14. package/lib/containers/data-flow/column/index.d.ts +1 -0
  15. package/lib/containers/data-flow/index.d.ts +4 -0
  16. package/lib/containers/dropdowns/index.d.ts +1 -0
  17. package/lib/containers/dropdowns/pods-agent-injection-status-dropdown/index.d.ts +16 -0
  18. package/lib/containers/v2.js +61 -11
  19. package/lib/containers.js +115 -115
  20. package/lib/contexts.js +1 -1
  21. package/lib/functions/get-status-type-from-odigos-health/index.d.ts +2 -2
  22. package/lib/functions.js +1 -1
  23. package/lib/hooks.js +1 -1
  24. package/lib/mock-data/index.d.ts +2 -0
  25. package/lib/mock-data/snapshot/index.d.ts +5 -0
  26. package/lib/mock-data/workload/index.d.ts +2 -0
  27. package/lib/snippets.js +1 -1
  28. package/lib/store/useFilterStore.d.ts +3 -0
  29. package/lib/store.js +1 -1
  30. package/lib/theme.js +1 -1
  31. package/lib/types/actions/index.d.ts +4 -1
  32. package/lib/types/destinations/index.d.ts +1 -0
  33. package/lib/types/enum/index.d.ts +21 -0
  34. package/lib/types/index.d.ts +3 -0
  35. package/lib/types/instrumentation-rules/index.d.ts +1 -1
  36. package/lib/types/metrics/index.d.ts +1 -1
  37. package/lib/types/snapshot/index.d.ts +27 -0
  38. package/lib/types/sources/index.d.ts +3 -29
  39. package/lib/types/workload/index.d.ts +23 -0
  40. package/lib/types.js +1 -1
  41. package/package.json +1 -1
  42. package/lib/chunks/index-166ada2d.js +0 -3
@@ -1,8 +1,10 @@
1
1
  import { type FC, CSSProperties } from 'react';
2
+ import { type SegmentProps } from '../segment';
2
3
  export interface SearchProps {
3
- placeholder?: string;
4
4
  value: string;
5
5
  onChange: (value: string) => void;
6
+ placeholder?: string;
6
7
  width?: CSSProperties['width'];
8
+ segment?: Pick<SegmentProps, 'options' | 'selected' | 'setSelected'>;
7
9
  }
8
10
  export declare const Search: FC<SearchProps>;
@@ -1,15 +1,20 @@
1
1
  import React from 'react';
2
2
  import type { SVG } from '@/types';
3
+ export declare enum SegmentSize {
4
+ S = "s",
5
+ L = "l"
6
+ }
3
7
  interface Option<T> {
4
8
  value: T;
5
9
  label?: string;
6
10
  icon?: SVG;
7
11
  }
8
12
  export interface SegmentProps<T = any> {
13
+ size?: SegmentSize;
9
14
  options: Option<T>[];
10
15
  selected: T;
11
16
  setSelected: (value: T) => void;
12
17
  disabled?: boolean;
13
18
  }
14
- export declare const Segment: <T>({ options, selected, setSelected, disabled }: SegmentProps<T>) => React.JSX.Element;
19
+ export declare const Segment: <T>({ size, options, selected, setSelected, disabled }: SegmentProps<T>) => React.JSX.Element;
15
20
  export {};
@@ -7,7 +7,7 @@ interface ColumnsToFieldsProps {
7
7
  rowIdx: number;
8
8
  rowsLength: number;
9
9
  maxWidth: CSSProperties['maxWidth'];
10
- handleChange: (key: string, val: string | number, idx: number) => void;
10
+ handleChange: (key: string, val: string | number | string[], idx: number) => void;
11
11
  errorMessage?: string;
12
12
  limitFieldsPerRow?: number;
13
13
  }
@@ -9,7 +9,7 @@ export interface Column {
9
9
  placeholder?: string;
10
10
  required?: boolean;
11
11
  type?: 'number';
12
- componentType?: 'dropdown';
12
+ componentType?: 'dropdown' | 'multi-dropdown';
13
13
  options?: DropdownOption[];
14
14
  renderCondition?: (row: Row) => boolean;
15
15
  }
@@ -1 +1 @@
1
- export{B as Badge,g as Button,m as ButtonSize,dc as ButtonTab,dd as ButtonTabList,h as ButtonVariants,C as Checkbox,dg as CheckboxList,df as CheckboxSize,t as CliCommand,s as DataCard,D as Drawer,di as DropData,dh as DropDataAlign,dj as Header,b_ as HoverActions,I as IconButton,ca as IconButtonSize,dk as Input,L as Loader,dl as Modal,dm as Navbar,N as Note,dp as Radio,dq as RadioGroup,dn as RadioSize,S as Search,j as SectionCard,l as SectionCardActionType,de as SectionCardSize,v as Segment,w as StatusCard,n as Table,o as TableVariant,dr as Tag,x as TextCard,e as Toggle,dt as ToggleLabelAlign,du as ToggleList,f as ToggleSize,ds as ToggleVariant,T as Typography,c as TypographySize,dv as TypographyVariants,W as WarningModal}from"../chunks/ui-components-48696fb2.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,g as Button,m as ButtonSize,dc as ButtonTab,dd as ButtonTabList,h as ButtonVariants,C as Checkbox,dg as CheckboxList,df as CheckboxSize,t as CliCommand,s as DataCard,D as Drawer,di as DropData,dh as DropDataAlign,dj as Header,b$ as HoverActions,I as IconButton,cb as IconButtonSize,dk as Input,L as Loader,dl as Modal,dm as Navbar,N as Note,dp as Radio,dq as RadioGroup,dn as RadioSize,S as Search,j as SectionCard,l as SectionCardActionType,de as SectionCardSize,v as Segment,dr as SegmentSize,w as StatusCard,n as Table,o as TableVariant,ds as Tag,x as TextCard,c as Toggle,du as ToggleLabelAlign,dv as ToggleList,d as ToggleSize,dt as ToggleVariant,T as Typography,b as TypographySize,dw as TypographyVariants,W as WarningModal}from"../chunks/ui-components-fabd01fd.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,aP as Badge,aS as Button,ae as CancelWarning,r as CenterThis,J as Checkbox,ch as Code,al as ConditionDetails,am as DataCard,E as DataCardFieldTypes,bC as DataCardFields,d0 as DataFinger,aV as DataTab,ad as DeleteWarning,bY as DescribeRow,av as Divider,a4 as DocsButton,ac as Drawer,d2 as DrawerFooter,d1 as DrawerHeader,bf as Dropdown,d3 as ErrorBoundary,bo as ExtendArrow,d as FadeLoader,M as FieldError,H as FieldLabel,F as FlexColumn,b as FlexRow,d4 as Header,bn as IconButton,c6 as IconGroup,aJ as IconTitleBadge,aE as IconWrapped,bU as IconsNav,d5 as ImageControlled,R as Input,$ as InputList,Y as InputTable,aM as InteractiveTable,_ as KeyValueInputsList,aR as LoadingText,ap as Modal,ar as ModalBody,a5 as MonitorsCheckboxes,aG as MonitorsIcons,aq as NavigationButtons,aN as NoDataFound,as as NotificationNote,db as Overlay,P as PageContent,ba as Popup,cb as PopupForm,cg as ScrollX,aY as ScrollY,a3 as SectionTitle,a2 as Segment,bb as SelectionButton,b0 as SkeletonLoader,ax as Status,bB as Stepper,d6 as TabList,aH as TableContainer,aI as TableTitleWrap,aL as TableWrap,bL as Tag,a1 as Text,a6 as TextArea,Z as Toggle,ce as ToggleCodeComponent,az as Tooltip,aO as TraceLoader,U as UpgradeRequiredWrapper,bc as VerticalScroll,da as WarningModal,d7 as getLinksFromText,d8 as getStrongsFromText,d9 as renderText}from"./chunks/ui-components-48696fb2.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{au as AutocompleteInput,aP as Badge,aS as Button,ae as CancelWarning,r as CenterThis,J as Checkbox,ci as Code,al as ConditionDetails,am as DataCard,E as DataCardFieldTypes,bD as DataCardFields,d0 as DataFinger,aV as DataTab,ad as DeleteWarning,bZ as DescribeRow,av as Divider,a4 as DocsButton,ac as Drawer,d2 as DrawerFooter,d1 as DrawerHeader,bg as Dropdown,d3 as ErrorBoundary,bp as ExtendArrow,e as FadeLoader,M as FieldError,H as FieldLabel,F as FlexColumn,a as FlexRow,d4 as Header,bo as IconButton,c7 as IconGroup,aJ as IconTitleBadge,aE as IconWrapped,bV as IconsNav,d5 as ImageControlled,R as Input,$ as InputList,Y as InputTable,aM as InteractiveTable,_ as KeyValueInputsList,aR as LoadingText,ap as Modal,ar as ModalBody,a5 as MonitorsCheckboxes,aG as MonitorsIcons,aq as NavigationButtons,aN as NoDataFound,as as NotificationNote,db as Overlay,P as PageContent,bb as Popup,cc as PopupForm,ch as ScrollX,aY as ScrollY,a3 as SectionTitle,a2 as Segment,bc as SelectionButton,b1 as SkeletonLoader,ax as Status,bC as Stepper,d6 as TabList,aH as TableContainer,aI as TableTitleWrap,aL as TableWrap,bM as Tag,a1 as Text,a6 as TextArea,Z as Toggle,cf as ToggleCodeComponent,az as Tooltip,aO as TraceLoader,U as UpgradeRequiredWrapper,bd as VerticalScroll,da as WarningModal,d7 as getLinksFromText,d8 as getStrongsFromText,d9 as renderText}from"./chunks/ui-components-fabd01fd.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,ab as BUTTON_TEXTS,bm as DEFAULT_DATA_STREAM_NAME,bz as DESTINATION_CATEGORIES,bg as DISPLAY_LANGUAGES,A as DISPLAY_TITLES,at as FORM_ALERTS,bO as INSTRUMENTATION_RULE_OPTIONS,cU as LANGUAGE_OPTIONS,bh as MONITORS_OPTIONS,bi as STORAGE_KEYS,cV as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-48696fb2.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{aj as ACTION_OPTIONS,ab as BUTTON_TEXTS,bn as DEFAULT_DATA_STREAM_NAME,bA as DESTINATION_CATEGORIES,bh as DISPLAY_LANGUAGES,A as DISPLAY_TITLES,at as FORM_ALERTS,bP as INSTRUMENTATION_RULE_OPTIONS,cU as LANGUAGE_OPTIONS,bi as MONITORS_OPTIONS,bj as STORAGE_KEYS,cV as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-fabd01fd.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";
@@ -0,0 +1,15 @@
1
+ import { type FC, type Dispatch, type SetStateAction } from 'react';
2
+ import { type AllClusterSnapshots } from '@/types';
3
+ import { DrawerProps } from '@/components/_v2';
4
+ export interface SourceDrawerProps {
5
+ onClose: DrawerProps['header']['onClose'];
6
+ isLoading: boolean;
7
+ snapshots: AllClusterSnapshots | null;
8
+ selectedConnectionIds: string[];
9
+ setSelectedConnectionIds: Dispatch<SetStateAction<string[]>>;
10
+ onApply: (selectedConnectionIds: string[], formData: unknown) => Promise<{
11
+ error?: string;
12
+ }>;
13
+ }
14
+ export declare const SOURCE_DRAWER_WIDTH = "75vw";
15
+ export declare const SourceDrawer: FC<SourceDrawerProps>;
@@ -7,6 +7,7 @@ interface BaseProps {
7
7
  faded?: boolean;
8
8
  title: string;
9
9
  subTitle: string;
10
+ tooltip?: string;
10
11
  label?: string;
11
12
  icon?: SVG;
12
13
  icons?: SVG[];
@@ -5,6 +5,7 @@ interface HeadProps {
5
5
  badge: string | number;
6
6
  badgeTooltip?: string;
7
7
  isLoading?: boolean;
8
+ refetch: () => void;
8
9
  }
9
10
  declare const Head: FC<HeadProps>;
10
11
  export { Head, type HeadProps };
@@ -8,6 +8,7 @@ interface ColumnProps {
8
8
  loading: boolean;
9
9
  maxHeight: number;
10
10
  isVm: boolean;
11
+ refetch: () => void;
11
12
  }
12
13
  declare const Column: FC<ColumnProps>;
13
14
  export { Column, type ColumnProps };
@@ -3,6 +3,10 @@ import { type Metrics } from '@/types';
3
3
  interface DataFlowProps {
4
4
  height: CSSProperties['height'];
5
5
  metrics: Metrics;
6
+ refetchSources: () => void;
7
+ refetchDestinations: () => void;
8
+ refetchActions: () => void;
9
+ refetchInstrumentationRules: () => void;
6
10
  }
7
11
  declare const DataFlow: React.FC<DataFlowProps>;
8
12
  export { DataFlow, type DataFlowProps };
@@ -4,3 +4,4 @@ export * from './language-dropdown';
4
4
  export * from './monitor-dropdown';
5
5
  export * from './namespace-dropdown';
6
6
  export * from './kind-dropdown';
7
+ export * from './pods-agent-injection-status-dropdown';
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { type Source } from '@/types';
3
+ import { type DropdownProps } from '@/components';
4
+ interface PodsAgentInjectionStatusDropdownProps {
5
+ sources: Source[];
6
+ title?: string;
7
+ value?: DropdownProps['options'];
8
+ onSelect: (val: DropdownProps['options'][0]) => void;
9
+ onDeselect: (val: DropdownProps['options'][0]) => void;
10
+ disabled?: boolean;
11
+ isMulti?: boolean;
12
+ required?: boolean;
13
+ showSearch?: boolean;
14
+ }
15
+ declare const PodsAgentInjectionStatusDropdown: React.FC<PodsAgentInjectionStatusDropdownProps>;
16
+ export { PodsAgentInjectionStatusDropdown, type PodsAgentInjectionStatusDropdownProps };
@@ -1,4 +1,53 @@
1
- import e,{useState as t,useMemo as a,useEffect as o,useCallback as l}from"react";import n,{useTheme as i}from"styled-components";import{W as s,F as r,u as d,D as c,S as u,N as p,a as g,b,T as m,c as y,B as h,O as f,C,d as v,e as w,f as k,L as x,g as $,h as R,i as L,P as I,j as P,k as A,l as D,m as S,n as V,o as O,p as T,q as M,r as z,s as N,I as j,t as F,v as U,w as E,x as W,y as q,z as H,U as Y}from"../chunks/ui-components-48696fb2.js";import{ConnectionsIcon as G,OdigosLogo as B,RefreshIcon as K,SettingsIcon as J,DeleteIcon as Q,VIcon as X,XIcon as Z,VSquareIcon as _,XSquareIcon as ee,PodIcon as te,ChevronUpIcon as ae,ChevronDownIcon as oe,TerminalIcon as le,PipelineCollectorIcon as ne,DownloadIcon as ie,GatewayIcon as se,YamlIcon as re}from"../icons.js";import{Y as de}from"../chunks/index-166ada2d.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=({isOpen:t,onClose:a,onDeny:o,onApprove:l})=>e.createElement(s,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:t,onClose:a,onDeny:o,denyLabel:"Keep editing",onApprove:l,approveLabel:"Discard changes"}),pe=({isOpen:t,onClose:a,onDeny:o,onApprove:l,action:n="delete",target:i})=>{const r=n.charAt(0).toUpperCase()+n.substring(1),d=i?.endsWith("s")?"these":"this";return e.createElement(s,{title:`${r}${i?` ${i}`:""}?`,description:`Are you sure you want to ${n}${i?` ${d} ${i}`:""}?`,isOpen:t,onClose:a,onDeny:o,denyLabel:"Go back",onApprove:l,approveLabel:r})},ge=({minSupportedVersion:t,currentVersion:a})=>e.createElement(s,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:ce,title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${t} or later.\nCurrent version: ${a}.`}),be="75vw",me=n.div`
1
+ import e,{useState as t,useMemo as a,useEffect as o,useCallback as l}from"react";import n,{useTheme as i}from"styled-components";import{W as s,F as r,u as d,D as c,S as u,a as p,T as g,b,c as m,d as y,B as h,O as f,C as v,e as w,L as C,N as x,f as k,g as $,h as R,i as L,P,j as I,k as S,l as A,m as D,n as V,o as O,p as M,q as z,r as T,s as j,I as N,t as F,v as U,w as W,x as E,y as q,z as H,U as Y}from"../chunks/ui-components-fabd01fd.js";import{SettingsIcon as G,OdigosLogo as B,ConnectionsIcon as K,RefreshIcon as J,DeleteIcon as Q,VIcon as X,XIcon as Z,VSquareIcon as _,XSquareIcon as ee,PodIcon as te,ChevronUpIcon as ae,ChevronDownIcon as oe,TerminalIcon as le,PipelineCollectorIcon as ne,DownloadIcon as ie,GatewayIcon as se,YamlIcon as re}from"../icons.js";import{Y as de}from"../chunks/index-53f81cb1.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=({isOpen:t,onClose:a,onDeny:o,onApprove:l})=>e.createElement(s,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:t,onClose:a,onDeny:o,denyLabel:"Keep editing",onApprove:l,approveLabel:"Discard changes"}),pe=({isOpen:t,onClose:a,onDeny:o,onApprove:l,action:n="delete",target:i})=>{const r=n.charAt(0).toUpperCase()+n.substring(1),d=i?.endsWith("s")?"these":"this";return e.createElement(s,{title:`${r}${i?` ${i}`:""}?`,description:`Are you sure you want to ${n}${i?` ${d} ${i}`:""}?`,isOpen:t,onClose:a,onDeny:o,denyLabel:"Go back",onApprove:l,approveLabel:r})},ge=({minSupportedVersion:t,currentVersion:a})=>e.createElement(s,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:ce,title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${t} or later.\nCurrent version: ${a}.`});n.div`
2
+ display: flex;
3
+ flex-direction: column;
4
+ border-radius: 16px;
5
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
6
+ overflow: hidden;
7
+ `,n.div`
8
+ display: flex;
9
+ gap: 12px;
10
+ padding: 16px;
11
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
12
+ position: sticky;
13
+ top: 0;
14
+ `,n.div`
15
+ display: flex;
16
+ gap: 12px;
17
+ padding: 16px;
18
+ `,n(r)`
19
+ width: ${({$width:e})=>e};
20
+ gap: 12px;
21
+ justify-content: space-between;
22
+ `,n.div`
23
+ display: flex;
24
+ flex-direction: column;
25
+ padding: 12px;
26
+ gap: ${({$gap:e=0})=>e}px;
27
+ width: calc(100% - 24px);
28
+ height: calc(100vh - 280px);
29
+ border-radius: ${({$borderRadius:e})=>e};
30
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
31
+ overflow-y: auto;
32
+ overflow-x: hidden;
33
+ `,n.div`
34
+ display: flex;
35
+ align-items: center;
36
+ gap: 12px;
37
+ padding: 8px 16px;
38
+ border-radius: 12px;
39
+ background-color: transparent;
40
+ cursor: pointer;
41
+ &:hover {
42
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
43
+ }
44
+ `,n.div`
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: flex-end;
48
+ gap: 16px;
49
+ padding: 0 12px;
50
+ `;const be="75vw",me=n.div`
2
51
  display: flex;
3
52
  flex-direction: column;
4
53
  border-radius: 16px;
@@ -19,17 +68,18 @@ import e,{useState as t,useMemo as a,useEffect as o,useCallback as l}from"react"
19
68
  width: ${({$width:e})=>e};
20
69
  gap: 12px;
21
70
  justify-content: space-between;
22
- `,Ce=n.div`
71
+ `,ve=n.div`
23
72
  display: flex;
24
73
  flex-direction: column;
25
74
  padding: 12px;
75
+ gap: ${({$gap:e=0})=>e}px;
26
76
  width: calc(100% - 24px);
27
- height: calc(100vh - ${({$isFooterOpen:e})=>e?"300px":"240px"});
77
+ height: calc(100vh - 280px);
28
78
  border-radius: ${({$borderRadius:e})=>e};
29
79
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
30
80
  overflow-y: auto;
31
81
  overflow-x: hidden;
32
- `,ve=n.div`
82
+ `,we=n.div`
33
83
  display: flex;
34
84
  align-items: center;
35
85
  gap: 12px;
@@ -40,13 +90,13 @@ import e,{useState as t,useMemo as a,useEffect as o,useCallback as l}from"react"
40
90
  &:hover {
41
91
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
42
92
  }
43
- `,we=n.div`
93
+ `,Ce=n.div`
44
94
  display: flex;
45
95
  align-items: center;
46
96
  justify-content: flex-end;
47
97
  gap: 16px;
48
- padding: 0 24px;
49
- `,ke=({onClose:l,connections:n,selectedConnectionIds:s,setSelectedConnectionIds:r,getConnectionRemoteConfig:L,onApply:I})=>{const P=i(),[A,D]=t(""),S=a(()=>n.filter(e=>!A||e.name.toLowerCase().includes(A.toLowerCase())),[n,A]),V=e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[O,T]=t(!1),[M,z]=t(!1),[N,j]=t(void 0),[F,U]=t(!1),[E,W]=t(void 0),{formData:q,handleFormChange:H,areFormValuesEqual:Y,resetFormData:K}=d({automaticRollout:!0}),J=a(()=>s.length>1||void 0!==E&&!Y(E,q),[s.length,E,q]);return o(()=>{1===s.length?(async e=>{if(F)return;U(!0);const t=await L(e);if(t){const e={automaticRollout:!t.rollout?.automaticRolloutDisabled};W(e),K(e)}U(!1)})(s[0]):W(void 0)},[s.length]),e.createElement(c,{isOpen:!0,hideOverlay:!0,width:be,header:{icon:G,title:"Cluster Configuration",onClose:l}},e.createElement(me,null,e.createElement(ye,null,e.createElement(u,{width:"40%",value:A,onChange:D}),J?e.createElement(p,{fullWidth:!0,status:g.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):1===s.length&&void 0!==E?e.createElement(p,{fullWidth:!0,status:g.Success,message:"The values reflect the current configuration of the selected cluster."}):null),e.createElement(he,null,e.createElement(fe,{$width:"40%"},e.createElement(b,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(b,{$gap:8},e.createElement(m,{size:y.XS},"Clusters"),e.createElement(h,{label:n.length,status:f.Unknown})),e.createElement(b,{$gap:8},e.createElement(m,{size:y.XXXS,color:P.v2.colors.silver[200]},"Selected"),e.createElement(h,{label:`${s.length}/${n.length}`,status:f.Unknown}))),e.createElement(Ce,{$isFooterOpen:J,$borderRadius:"16px 0 0 16px"},S.map(t=>e.createElement(ve,{key:t.id,onClick:()=>V(t.id)},e.createElement(C,{value:s.includes(t.id),onChange:()=>V(t.id)}),e.createElement(m,{size:y.XS},t.name))))),e.createElement(fe,{$width:"60%"},e.createElement(b,{$padding:"2px 12px"},e.createElement(m,{size:y.XS},"Configurations")),e.createElement(Ce,{$isFooterOpen:J,$borderRadius:"0 16px 16px 0"},F?e.createElement(v,null):e.createElement(b,{$gap:12},e.createElement(w,{size:k.S,label:"Automatic Rollout "+(q.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:q.automaticRollout,onChange:e=>H("automaticRollout",e)})))))),J&&e.createElement(we,null,M?e.createElement(x,{label:"Applying configurations...",icon:B,withGradient:!0,typographyProps:{size:y.XXS}}):N?e.createElement(m,{size:y.XXS,color:P.v2.colors.red[500]},N):null,e.createElement("div",{style:{width:"150px"}},e.createElement($,{variant:R.Secondary,label:"Cancel",fullWidth:!0,onClick:()=>T(!0),disabled:M})),e.createElement("div",{style:{width:"150px"}},e.createElement($,{variant:R.Primary,label:"Apply",fullWidth:!0,onClick:async()=>{z(!0);const{error:e}=await I(s,q);z(!1),e?j(e):(r([]),l())},disabled:M}))),e.createElement(ue,{isOpen:O,onClose:()=>T(!1),onApprove:()=>{T(!1),r([]),l()}}))};var xe;!function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(xe||(xe={}));const $e=[{key:xe.Name,label:"Name"},{key:xe.Type,label:"Type",textAlign:"right"},{key:xe.Status,label:"Status"},{key:xe.OdigosVersion,label:"Odigos Version"},{key:xe.ConnectedSince,label:"Connected Since"},{key:xe.LastActivity,label:"Last Activity"}],Re=({tableRowsMaxHeight:n,connections:s,getConnections:r,onClickConnection:d,deleteConnection:c,getConnectionRemoteConfig:u,applyConfigurations:p})=>{const b=i(),{formatTimeAgo:m}=L(),[y,C]=t(!1),[v,w]=t(s||[]),[k,x]=t(""),$=l(async()=>{try{C(!0),w(await r()??[])}catch(e){}finally{C(!1)}},[]);o(()=>{v.length||$()},[v.length,$]);const[T,M]=t(null),[z,N]=t([]),[j,F]=t(!1),U=a(()=>v.filter(e=>!k||e.name.toLowerCase().includes(k.toLowerCase())).map(t=>({onClick:()=>d(t),isSelected:z.includes(t.id),onSelect:()=>N(e=>[...e,t.id]),onDeselect:()=>N(e=>e.filter(e=>e!==t.id)),cells:[{key:xe.Id,rawValue:t.id},{key:xe.Name,rawValue:t.name},{key:xe.Type,rawValue:t.type},{key:xe.Status,rawValue:t.status,component:()=>(t=>{const a=t===g.Success?"Connection live":"Connection lost",o=t===g.Success?X:Z;return e.createElement(h,{status:t,label:a,leftIcon:o})})(t.status)},{key:xe.OdigosVersion,rawValue:t.odigosVersion},{key:xe.ConnectedSince,rawValue:t.connectedAt?m(t.connectedAt):"-"},{key:xe.LastActivity,rawValue:t.lastSeenAt?m(t.lastSeenAt):"-"}]})),[v,z,k]);return e.createElement(I,null,e.createElement(P,{icon:G,title:"Connections",badge:{label:v.length.toString(),status:f.Unknown},search:{placeholder:"Search by cluster name",value:k,onChange:e=>x(e)},actions:[{id:A(),type:D.Button,buttonProps:{variant:R.Secondary,size:S.S,leftIcon:K,onClick:()=>$(),disabled:y}},{id:A(),type:D.Button,buttonProps:{variant:R.Primary,size:S.S,label:"Configurations",rightIcon:J,onClick:()=>F(!0)}}]},e.createElement(V,{variant:O.Pretty,maxHeight:n,headerBackgroundColor:b.v2.colors.silver[1e3],isLoading:y,withCheckboxes:!0,columns:$e,rows:U,rowActionsPushRightPosition:j?`calc(${be} - 24px)`:void 0,getRowActions:({cells:e})=>[{id:A(),label:"Edit Configuration",rightIcon:J,onClick:async()=>{const t=e.find(e=>e.key===xe.Id)?.rawValue;t&&(N([t.toString()]),F(!0))}},{id:A(),label:"Delete Connection",rightIcon:Q,disabled:e.find(e=>e.key===xe.Status)?.rawValue===g.Success,onClick:()=>{const t=e.find(e=>e.key===xe.Id)?.rawValue;t&&M(t.toString())}}]}),j&&e.createElement(ke,{onClose:()=>F(!1),connections:v,selectedConnectionIds:z,setSelectedConnectionIds:N,getConnectionRemoteConfig:u,onApply:p}),e.createElement(pe,{target:"connection",isOpen:!!T,onClose:()=>M(null),onApprove:async()=>{T&&(await c(T),$())}})))},Le=n.div`
98
+ padding: 0 12px;
99
+ `,xe=({onClose:l,connections:n,selectedConnectionIds:s,setSelectedConnectionIds:r,getConnectionRemoteConfig:L,onApply:P})=>{const I=i(),[S,A]=t(""),[D,V]=t({showOnlySelected:!1}),O=a(()=>n.filter(e=>(!S||e.name.toLowerCase().includes(S.toLowerCase()))&&(!D.showOnlySelected||s.includes(e.id))),[n,S,D,s]),M=e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[z,T]=t(!1),[j,N]=t(!1),[F,U]=t(void 0),[W,E]=t(!1),[q,H]=t(void 0),{formData:Y,handleFormChange:K,areFormValuesEqual:J,resetFormData:Q}=d({automaticRollout:!0}),{isFormDirty:X,isFormMatch:Z}=a(()=>({isFormDirty:s.length>1||void 0!==q&&!J(q,Y),isFormMatch:1===s.length&&void 0!==q&&J(q,Y)}),[s.length,q,Y]);o(()=>{1===s.length?(async e=>{if(W)return;E(!0);const t=await L(e);if(t){const e={automaticRollout:!t.rollout?.automaticRolloutDisabled};H(e),Q(e)}E(!1)})(s[0]):H(void 0)},[s.length]);const _=()=>{T(!1),r([]),l()};return e.createElement(c,{isOpen:!0,hideOverlay:!0,width:be,header:{icon:G,title:"Cluster Configuration",onClose:l}},e.createElement(me,null,e.createElement(ye,null,e.createElement(u,{width:"30%",value:S,onChange:A}),e.createElement(p,{$gap:8},e.createElement(g,{size:b.XXS,color:I.v2.colors.silver[200],nowrap:!0},"Show only:"),e.createElement(m,{label:"Selected",value:D.showOnlySelected,onChange:e=>V(t=>({...t,showOnlySelected:e})),size:y.S}))),e.createElement(he,null,e.createElement(fe,{$width:"40%"},e.createElement(p,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(p,{$gap:8},e.createElement(g,{size:b.XS},"Clusters"),e.createElement(h,{label:n.length,status:f.Unknown})),e.createElement(p,{$gap:8},e.createElement(g,{size:b.XXXS,color:I.v2.colors.silver[200]},"Selected clusters"),e.createElement(h,{label:`${s.length}/${n.length}`,status:f.Unknown}))),e.createElement(ve,{$borderRadius:"16px 0 0 16px"},O.map(t=>e.createElement(we,{key:t.id,onClick:()=>M(t.id)},e.createElement(v,{value:s.includes(t.id),onChange:()=>M(t.id)}),e.createElement(g,{size:b.XS},t.name))))),e.createElement(fe,{$width:"60%"},e.createElement(p,{$padding:"0 12px"},e.createElement(g,{size:b.XS},"Configurations")),e.createElement(ve,{$borderRadius:"0 16px 16px 0",$gap:12},W?e.createElement(w,null):e.createElement(m,{size:y.S,label:"Automatic Rollout "+(Y.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:Y.automaticRollout,onChange:e=>K("automaticRollout",e)}))))),e.createElement(Ce,null,W?e.createElement(C,{label:"Fetching configuration...",icon:B,withGradient:!0,typographyProps:{size:b.XXS}}):j?e.createElement(C,{label:"Applying configurations...",icon:B,withGradient:!0,typographyProps:{size:b.XXS}}):F?e.createElement(x,{fullWidth:!0,status:k.Error,message:F}):X?e.createElement(x,{fullWidth:!0,status:k.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):Z?e.createElement(x,{fullWidth:!0,status:k.Success,message:"The values reflect the current configuration of the selected cluster."}):null,e.createElement(p,{$gap:8},e.createElement("div",{style:{width:"150px"}},e.createElement($,{fullWidth:!0,variant:R.Secondary,label:"Cancel",onClick:()=>X?T(!0):_(),disabled:j})),e.createElement("div",{style:{width:"150px"}},e.createElement($,{fullWidth:!0,variant:R.Primary,label:"Save",onClick:async()=>{N(!0);const{error:e}=await P(s,Y);N(!1),e?U(e):(r([]),l())},disabled:!X||j})))),e.createElement(ue,{isOpen:z,onClose:()=>T(!1),onApprove:_}))};var ke,$e;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.Delete="delete"}(ke||(ke={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}($e||($e={}));const Re=[{key:$e.Name,label:"Name"},{key:$e.Type,label:"Type",textAlign:"right"},{key:$e.Status,label:"Status"},{key:$e.OdigosVersion,label:"Odigos Version"},{key:$e.ConnectedSince,label:"Connected Since"},{key:$e.LastActivity,label:"Last Activity"}],Le=(e,t)=>{const a=e.find(e=>e.key===$e.Id)?.rawValue;a&&t(a.toString())},Pe=({tableRowsMaxHeight:n,connections:s,getConnections:r,onClickConnection:d,deleteConnection:c,getConnectionRemoteConfig:u,applyConfigurations:p})=>{const g=i(),{formatTimeAgo:b}=L(),[m,y]=t(!1),[v,w]=t(s||[]),[C,x]=t(""),$=l(async()=>{try{y(!0),w(await r()??[])}catch(e){}finally{y(!1)}},[]);o(()=>{v.length||$()},[v.length,$]);const[M,z]=t(null),[T,j]=t([]),N=a(()=>v.filter(e=>!C||e.name.toLowerCase().includes(C.toLowerCase())).map(t=>({onClick:t.status===k.Success?()=>d(t):void 0,isSelected:T.includes(t.id),onSelect:()=>j(e=>[...e,t.id]),onDeselect:()=>j(e=>e.filter(e=>e!==t.id)),cells:[{key:$e.Id,rawValue:t.id},{key:$e.Name,rawValue:t.name},{key:$e.Type,rawValue:t.type},{key:$e.Status,rawValue:t.status,component:()=>(t=>{const a=t===k.Success?"Connection live":"Connection lost",o=t===k.Success?X:Z;return e.createElement(h,{status:t,label:a,leftIcon:o})})(t.status)},{key:$e.OdigosVersion,rawValue:t.odigosVersion},{key:$e.ConnectedSince,rawValue:t.connectedAt?b(t.connectedAt):"-"},{key:$e.LastActivity,rawValue:t.lastSeenAt?b(t.lastSeenAt):"-"}]})),[v,T,C]);return e.createElement(P,null,e.createElement(I,{icon:K,title:"Connections",badge:{label:v.length.toString(),status:f.Unknown},search:{placeholder:"Search by cluster name",value:C,onChange:e=>x(e)},actions:[{id:S(),type:A.Button,buttonProps:{variant:R.Secondary,size:D.S,leftIcon:J,onClick:async()=>{await $()},disabled:m}},{id:S(),type:A.Button,buttonProps:{variant:R.Primary,size:D.S,label:"Configurations",rightIcon:G,onClick:()=>z(ke.BulkConfig)}}]},e.createElement(V,{variant:O.Pretty,maxHeight:n,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:m,withCheckboxes:!0,columns:Re,rows:N,rowActionsPushRightPosition:M?`calc(${M===ke.BulkConfig?be:"75vw"} - 24px)`:void 0,getRowActions:({cells:e})=>(e=>e.find(e=>e.key===$e.Status)?.rawValue===k.Success)(e)?[{id:S(),label:"Edit Configuration",rightIcon:G,onClick:async()=>{Le(e,e=>{j([e]),z(ke.BulkConfig)})}}]:[{id:S(),label:"Delete Connection",rightIcon:Q,onClick:()=>{Le(e,e=>{j([e]),z(ke.Delete)})}}]}),M===ke.BulkConfig&&e.createElement(xe,{onClose:()=>z(null),connections:v,selectedConnectionIds:T,setSelectedConnectionIds:j,getConnectionRemoteConfig:u,onApply:p}),e.createElement(pe,{target:"connection",isOpen:M===ke.Delete,onClose:()=>{j([]),z(null)},onApprove:async()=>{const e=T[0];e&&(await c(e),await $())}})))},Ie=n.div`
50
100
  display: flex;
51
101
  align-items: center;
52
102
  justify-content: space-between;
@@ -58,10 +108,10 @@ import e,{useState as t,useMemo as a,useEffect as o,useCallback as l}from"react"
58
108
  &:hover {
59
109
  background: ${({theme:e})=>e.v2.colors.silver[700]};
60
110
  }
61
- `,Ie=n.div`
62
- animation-name: ${T.animations.fade.in};
63
- `,Pe=({pod:l,getExtendedPodInfo:n,onClose:i})=>{const{formatTimeAgo:s}=L(),[d,u]=t(null),[p,b]=t(!1);o(()=>{l?n(l.namespace,l.name).then(e=>u(e??null)):(u(null),b(!1))},[l]);const y=a(()=>[{id:A(),title:"Node",label:d?.node??"-",withCopy:!0},{id:A(),title:"Status",badge:{status:M(d?.status),label:d?.status??"-"}}],[d]),h=a(()=>d?.containers?.map(e=>({id:A(),items:[{id:A(),title:"Container",label:e.name??"-"},{id:A(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:A(),title:"Ready",badge:{status:e.ready?g.Success:g.Error,leftIcon:e.ready?_:ee,label:e.ready?"True":"False",invertColors:!0}},{id:A(),title:"Started",badge:{status:e.started?g.Success:g.Error,leftIcon:e.started?_:ee,label:e.started?"True":"False",invertColors:!0}},{id:A(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:A(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:A(),title:"Restarts",label:e.restarts.toString()},{id:A(),title:"State Reason",label:e.stateReason??"-"},{id:A(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:A(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[d]);return e.createElement(c,{isOpen:!!l,header:{icon:te,title:"Pod Information",onClose:i}},d?null:e.createElement(z,null,e.createElement(v,null)),d?e.createElement(e.Fragment,null,e.createElement(P,{icon:te,title:d.name,withCopyTitle:!0},e.createElement(r,{$gap:24},e.createElement(N,{cellsPerRow:2,items:y}),h.length>0&&e.createElement(r,{$gap:12},e.createElement(Le,{onClick:()=>b(e=>!e)},e.createElement(m,null,"Containers Overview"),e.createElement(j,{icon:p?ae:oe})),p&&h.map(({id:t,items:a})=>e.createElement(Ie,{key:t},e.createElement(N,{cellsPerRow:2,items:a})))))),e.createElement(P,{icon:le,title:"Kubectl Commands"},e.createElement(r,{$gap:12},e.createElement(F,{value:`kubectl get pod ${d.name} -n ${d.namespace} -o yaml`}),e.createElement(F,{value:`kubectl describe pod ${d.name} -n ${d.namespace}`}),e.createElement(F,{value:`kubectl logs ${d.name} -n ${d.namespace}`}))),e.createElement(de,{yaml:d.manifestYAML})):null)};var Ae;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(Ae||(Ae={}));const De=[{key:Ae.PodName,label:"Pod Name"},{key:Ae.Status,label:"Status"},{key:Ae.Restarts,label:"Restarts",textAlign:"right"},{key:Ae.NodeName,label:"Node Name"},{key:Ae.Age,label:"Age",textAlign:"right"},{key:Ae.DockerImage,label:"Docker Image",textAlign:"right"}],Se=({isLoading:o,tableRowsMaxHeight:l,pods:n,getExtendedPodInfo:s})=>{const r=i(),{formatTimeAgo:d}=L(),[c,u]=t(null),p=a(()=>n.map(t=>({onClick:()=>u(t),cells:[{key:Ae.PodName,rawValue:t.name},{key:Ae.Status,rawValue:t.status,component:()=>{return a=t.status,e.createElement(h,{status:M(a),label:a});var a}},{key:Ae.Restarts,rawValue:t.restartsCount.toString()},{key:Ae.NodeName,rawValue:t.nodeName},{key:Ae.Age,rawValue:d(t.creationTimestamp)},{key:Ae.DockerImage,rawValue:t.image}]})),[n,r]);return e.createElement(P,{icon:te,title:"Pods"},e.createElement(V,{variant:O.Data,maxHeight:l,isLoading:o,columns:De,rows:p}),e.createElement(Pe,{pod:c,getExtendedPodInfo:s,onClose:()=>u(null)}))};var Ve;!function(e){e.Gateway="gateway",e.Node="node"}(Ve||(Ve={}));const Oe=[{value:Ve.Gateway,label:"Gateway"},{value:Ve.Node,label:"Node Collector"}],Te=n.div`
111
+ `,Se=n.div`
112
+ animation-name: ${M.animations.fade.in};
113
+ `,Ae=({pod:l,getExtendedPodInfo:n,onClose:i})=>{const{formatTimeAgo:s}=L(),[d,u]=t(null),[p,b]=t(!1);o(()=>{l?n(l.namespace,l.name).then(e=>u(e??null)):(u(null),b(!1))},[l]);const m=a(()=>[{id:S(),title:"Node",label:d?.node??"-",withCopy:!0},{id:S(),title:"Status",badge:{status:z(d?.status),label:d?.status??"-"}}],[d]),y=a(()=>d?.containers?.map(e=>({id:S(),items:[{id:S(),title:"Container",label:e.name??"-"},{id:S(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:S(),title:"Ready",badge:{status:e.ready?k.Success:k.Error,leftIcon:e.ready?_:ee,label:e.ready?"True":"False",invertColors:!0}},{id:S(),title:"Started",badge:{status:e.started?k.Success:k.Error,leftIcon:e.started?_:ee,label:e.started?"True":"False",invertColors:!0}},{id:S(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:S(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:S(),title:"Restarts",label:e.restarts.toString()},{id:S(),title:"State Reason",label:e.stateReason??"-"},{id:S(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:S(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[d]);return e.createElement(c,{isOpen:!!l,header:{icon:te,title:"Pod Information",onClose:i}},d?null:e.createElement(T,null,e.createElement(w,null)),d?e.createElement(e.Fragment,null,e.createElement(I,{icon:te,title:d.name,withCopyTitle:!0},e.createElement(r,{$gap:24},e.createElement(j,{cellsPerRow:2,items:m}),y.length>0&&e.createElement(r,{$gap:12},e.createElement(Ie,{onClick:()=>b(e=>!e)},e.createElement(g,null,"Containers Overview"),e.createElement(N,{icon:p?ae:oe})),p&&y.map(({id:t,items:a})=>e.createElement(Se,{key:t},e.createElement(j,{cellsPerRow:2,items:a})))))),e.createElement(I,{icon:le,title:"Kubectl Commands"},e.createElement(r,{$gap:12},e.createElement(F,{value:`kubectl get pod ${d.name} -n ${d.namespace} -o yaml`}),e.createElement(F,{value:`kubectl describe pod ${d.name} -n ${d.namespace}`}),e.createElement(F,{value:`kubectl logs ${d.name} -n ${d.namespace}`}))),e.createElement(de,{yaml:d.manifestYAML})):null)};var De;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(De||(De={}));const Ve=[{key:De.PodName,label:"Pod Name"},{key:De.Status,label:"Status"},{key:De.Restarts,label:"Restarts",textAlign:"right"},{key:De.NodeName,label:"Node Name"},{key:De.Age,label:"Age",textAlign:"right"},{key:De.DockerImage,label:"Docker Image",textAlign:"right"}],Oe=({isLoading:o,tableRowsMaxHeight:l,pods:n,getExtendedPodInfo:s})=>{const r=i(),{formatTimeAgo:d}=L(),[c,u]=t(null),p=a(()=>n.map(t=>({onClick:()=>u(t),cells:[{key:De.PodName,rawValue:t.name},{key:De.Status,rawValue:t.status,component:()=>{return a=t.status,e.createElement(h,{status:z(a),label:a});var a}},{key:De.Restarts,rawValue:t.restartsCount.toString()},{key:De.NodeName,rawValue:t.nodeName},{key:De.Age,rawValue:d(t.creationTimestamp)},{key:De.DockerImage,rawValue:t.image}]})),[n,r]);return e.createElement(I,{icon:te,title:"Pods"},e.createElement(V,{variant:O.Data,maxHeight:l,isLoading:o,columns:Ve,rows:p}),e.createElement(Ae,{pod:c,getExtendedPodInfo:s,onClose:()=>u(null)}))};var Me;!function(e){e.Gateway="gateway",e.Node="node"}(Me||(Me={}));const ze=[{value:Me.Gateway,label:"Gateway"},{value:Me.Node,label:"Node Collector"}],Te=n.div`
64
114
  display: flex;
65
115
  align-items: center;
66
116
  justify-content: space-between;
67
- `,Me=({selectedTab:t,setSelectedTab:a,onClickDownloadDiagnose:o,onClickRefresh:l,loading:n,disabled:i})=>e.createElement(Te,null,e.createElement(b,{$gap:12},e.createElement(b,{$gap:8},e.createElement(ne,{size:32}),e.createElement(m,{size:y.M,weight:500},"Pipeline Collectors")),e.createElement(U,{options:Oe,selected:t,setSelected:a,disabled:i})),e.createElement(b,{$gap:8},o&&e.createElement($,{label:"Download Diagnose",leftIcon:ie,size:S.S,variant:R.Text,onClick:o,disabled:i}),l&&e.createElement($,{label:"Refresh",leftIcon:K,size:S.S,variant:R.Text,onClick:l,loading:n,disabled:i}))),ze=({isOpen:t,onClose:a,title:o,yaml:l})=>e.createElement(c,{isOpen:t,header:{icon:se,title:o,onClose:a}},e.createElement(de,{yaml:l}));var Ne;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Ne||(Ne={}));const je=({icon:a,title:o,badge:l,statusCard:n,textCards:i,manifestYaml:s,configMapYaml:r})=>{const[d,c]=t(null);return e.createElement(P,{icon:a,title:o,badge:l,actions:[{id:A(),type:D.ButtonDropData,buttonProps:{variant:R.Secondary,size:S.S,label:"View YAML",onClick:e=>c(e)},dropDataItems:[{id:Ne.ManifestYaml,label:o,icon:re},{id:Ne.ConfigMapYaml,label:"ConfigMap",icon:re}]}]},e.createElement(b,{$gap:16},e.createElement(E,{...n}),i.map(t=>e.createElement(W,{key:t.title,...t}))),e.createElement(ze,{isOpen:d===Ne.ManifestYaml,onClose:()=>c(null),title:o,yaml:s}),e.createElement(ze,{isOpen:d===Ne.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:r}))},Fe=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:n,getGatewayInfo:i,getGatewayPods:s,getNodeCollectorInfo:r,getNodeCollectorPods:d,getExtendedPodInfo:c})=>{const{formatTimeAgo:u}=L(),{isVersionSupported:p,version:b}=H(1.12),[m,y]=t(!1),[h,C]=t(Ve.Gateway),[v,w]=t(null),[k,x]=t([]),[$,R]=t(null),[P,A]=t([]),D=l(async()=>{y(!0);try{switch(h){case Ve.Gateway:w(await i()??null),x(await s()??[]);break;case Ve.Node:R(await r()??null),A(await d()??[])}}catch(e){}y(!1)},[h]);o(()=>{D()},[D]);const S=a(()=>(e=>{switch(e){case Ve.Gateway:return"Deployment";case Ve.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(h),[h]),V=a(()=>((e,t,a,o)=>{const l={status:f.Disabled,label:"No rollouts yet"};let n=!1,i=null;switch(e){case Ve.Gateway:n=t?.rolloutInProgress??!1,i=t?.lastRolloutAt??null;break;case Ve.Node:n=a?.rolloutInProgress??!1,i=a?.lastRolloutAt??null;break;default:return l}return n?{status:g.Info,label:"Rollout in progress",rightIcon:K,useSecondaryTone:!0}:i?{status:f.Disabled,label:`Last Rollout: ${o(i)}`}:l})(h,v,$,u),[v,$,h,u]),O=a(()=>((e,t,a,o)=>{let l=o?g.Info:f.Unknown,n=o?"Loading":q.Unknown,i=o?"Fetching data...":Fe(q.Unknown);switch(e){case Ve.Gateway:l=t?.status?M(t?.status):l,n=t?.status??n,i=t?.status?Fe(t.status):i;break;case Ve.Node:l=a?.status?M(a?.status):l,n=a?.status??n,i=a?.status?Fe(a.status):i}return{status:l,title:n,description:i}})(h,v,$,m),[v,$,h,m]),T=a(()=>((e,t,a,o)=>{switch(e){case Ve.Gateway:return[{title:"HPA Spec (Replicas)",cells:[{label:"Min.",value:t?.hpa?.min.toString()??"-",isLoading:o},{label:"Max.",value:t?.hpa?.max.toString()??"-",isLoading:o},{label:"Current",value:t?.hpa?.current.toString()??"-",isLoading:o},{label:"Desired",value:t?.hpa?.desired.toString()??"-",isLoading:o}]},{title:"Requests",cells:[{label:"CPU",value:t?.resources?.requests.cpu??"-",isLoading:o},{label:"Memory",value:t?.resources?.requests.memory??"-",isLoading:o}]},{title:"Limits",cells:[{label:"CPU",value:t?.resources?.limits.cpu??"-",isLoading:o},{label:"Memory",value:t?.resources?.limits.memory??"-",isLoading:o}]},{title:"Docker Image",cells:[{value:t?.imageVersion??"-",isLoading:o}]}];case Ve.Node:return[{title:"Nodes",cells:[{label:"Desired",value:a?.nodes?.desired.toString()??"-",isLoading:o},{label:"Ready",value:a?.nodes?.ready.toString()??"-",isLoading:o}]},{title:"Requests",cells:[{label:"CPU",value:a?.resources?.requests.cpu??"-",isLoading:o},{label:"Memory",value:a?.resources?.requests.memory??"-",isLoading:o}]},{title:"Limits",cells:[{label:"CPU",value:a?.resources?.limits.cpu??"-",isLoading:o},{label:"Memory",value:a?.resources?.limits.memory??"-",isLoading:o}]},{title:"Docker Image",cells:[{value:a?.imageVersion??"-",isLoading:o}]}];default:return[]}})(h,v,$,m),[v,$,h,m]),z=a(()=>(h===Ve.Gateway?v?.manifestYAML:$?.manifestYAML)??"",[v,$,h]),N=a(()=>(h===Ve.Gateway?v?.configMapYAML:$?.configMapYAML)??"",[v,$,h]),j=a(()=>h===Ve.Gateway?k:P,[k,P,h]);return e.createElement(I,null,e.createElement(Me,{disabled:!p,loading:m,selectedTab:h,setSelectedTab:C,onClickDownloadDiagnose:void 0,onClickRefresh:D}),e.createElement(Y,null,e.createElement(je,{icon:se,title:S,badge:V,statusCard:O,textCards:T,manifestYaml:z,configMapYaml:N}),e.createElement(Se,{isLoading:m,tableRowsMaxHeight:n,pods:j,getExtendedPodInfo:c}),!p&&e.createElement(ge,{minSupportedVersion:1.12,currentVersion:b||""})))};export{Re as CentralConnections,Ue as PipelineCollectors};
117
+ `,je=({selectedTab:t,setSelectedTab:a,onClickDownloadDiagnose:o,onClickRefresh:l,loading:n,disabled:i})=>e.createElement(Te,null,e.createElement(p,{$gap:12},e.createElement(p,{$gap:8},e.createElement(ne,{size:32}),e.createElement(g,{size:b.M,weight:500},"Pipeline Collectors")),e.createElement(U,{options:ze,selected:t,setSelected:a,disabled:i})),e.createElement(p,{$gap:8},o&&e.createElement($,{label:"Download Diagnose",leftIcon:ie,size:D.S,variant:R.Text,onClick:o,disabled:i}),l&&e.createElement($,{label:"Refresh",leftIcon:J,size:D.S,variant:R.Text,onClick:l,loading:n,disabled:i}))),Ne=({isOpen:t,onClose:a,title:o,yaml:l})=>e.createElement(c,{isOpen:t,header:{icon:se,title:o,onClose:a}},e.createElement(de,{yaml:l}));var Fe;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Fe||(Fe={}));const Ue=({icon:a,title:o,badge:l,statusCard:n,textCards:i,manifestYaml:s,configMapYaml:r})=>{const[d,c]=t(null);return e.createElement(I,{icon:a,title:o,badge:l,actions:[{id:S(),type:A.ButtonDropData,buttonProps:{variant:R.Secondary,size:D.S,label:"View YAML",onClick:e=>c(e)},dropDataItems:[{id:Fe.ManifestYaml,label:o,icon:re},{id:Fe.ConfigMapYaml,label:"ConfigMap",icon:re}]}]},e.createElement(p,{$gap:16},e.createElement(W,{...n}),i.map(t=>e.createElement(E,{key:t.title,...t}))),e.createElement(Ne,{isOpen:d===Fe.ManifestYaml,onClose:()=>c(null),title:o,yaml:s}),e.createElement(Ne,{isOpen:d===Fe.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:r}))},We=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"}},Ee=({tableRowsMaxHeight:n,getGatewayInfo:i,getGatewayPods:s,getNodeCollectorInfo:r,getNodeCollectorPods:d,getExtendedPodInfo:c})=>{const{formatTimeAgo:u}=L(),{isVersionSupported:p,version:g}=H(1.12),[b,m]=t(!1),[y,h]=t(Me.Gateway),[v,w]=t(null),[C,x]=t([]),[$,R]=t(null),[I,S]=t([]),A=l(async()=>{m(!0);try{switch(y){case Me.Gateway:w(await i()??null),x(await s()??[]);break;case Me.Node:R(await r()??null),S(await d()??[])}}catch(e){}m(!1)},[y]);o(()=>{A()},[A]);const D=a(()=>(e=>{switch(e){case Me.Gateway:return"Deployment";case Me.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(y),[y]),V=a(()=>((e,t,a,o)=>{const l={status:f.Disabled,label:"No rollouts yet"};let n=!1,i=null;switch(e){case Me.Gateway:n=t?.rolloutInProgress??!1,i=t?.lastRolloutAt??null;break;case Me.Node:n=a?.rolloutInProgress??!1,i=a?.lastRolloutAt??null;break;default:return l}return n?{status:k.Info,label:"Rollout in progress",rightIcon:J,useSecondaryTone:!0}:i?{status:f.Disabled,label:`Last Rollout: ${o(i)}`}:l})(y,v,$,u),[v,$,y,u]),O=a(()=>((e,t,a,o)=>{let l=o?k.Info:f.Unknown,n=o?"Loading":q.Unknown,i=o?"Fetching data...":We(q.Unknown);switch(e){case Me.Gateway:l=t?.status?z(t?.status):l,n=t?.status??n,i=t?.status?We(t.status):i;break;case Me.Node:l=a?.status?z(a?.status):l,n=a?.status??n,i=a?.status?We(a.status):i}return{status:l,title:n,description:i}})(y,v,$,b),[v,$,y,b]),M=a(()=>((e,t,a,o)=>{switch(e){case Me.Gateway:return[{title:"HPA Spec (Replicas)",cells:[{label:"Min.",value:t?.hpa?.min.toString()??"-",isLoading:o},{label:"Max.",value:t?.hpa?.max.toString()??"-",isLoading:o},{label:"Current",value:t?.hpa?.current.toString()??"-",isLoading:o},{label:"Desired",value:t?.hpa?.desired.toString()??"-",isLoading:o}]},{title:"Requests",cells:[{label:"CPU",value:t?.resources?.requests.cpu??"-",isLoading:o},{label:"Memory",value:t?.resources?.requests.memory??"-",isLoading:o}]},{title:"Limits",cells:[{label:"CPU",value:t?.resources?.limits.cpu??"-",isLoading:o},{label:"Memory",value:t?.resources?.limits.memory??"-",isLoading:o}]},{title:"Docker Image",cells:[{value:t?.imageVersion??"-",isLoading:o}]}];case Me.Node:return[{title:"Nodes",cells:[{label:"Desired",value:a?.nodes?.desired.toString()??"-",isLoading:o},{label:"Ready",value:a?.nodes?.ready.toString()??"-",isLoading:o}]},{title:"Requests",cells:[{label:"CPU",value:a?.resources?.requests.cpu??"-",isLoading:o},{label:"Memory",value:a?.resources?.requests.memory??"-",isLoading:o}]},{title:"Limits",cells:[{label:"CPU",value:a?.resources?.limits.cpu??"-",isLoading:o},{label:"Memory",value:a?.resources?.limits.memory??"-",isLoading:o}]},{title:"Docker Image",cells:[{value:a?.imageVersion??"-",isLoading:o}]}];default:return[]}})(y,v,$,b),[v,$,y,b]),T=a(()=>(y===Me.Gateway?v?.manifestYAML:$?.manifestYAML)??"",[v,$,y]),j=a(()=>(y===Me.Gateway?v?.configMapYAML:$?.configMapYAML)??"",[v,$,y]),N=a(()=>y===Me.Gateway?C:I,[C,I,y]);return e.createElement(P,null,e.createElement(je,{disabled:!p,loading:b,selectedTab:y,setSelectedTab:h,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e.createElement(Y,null,e.createElement(Ue,{icon:se,title:D,badge:V,statusCard:O,textCards:M,manifestYaml:T,configMapYaml:j}),e.createElement(Oe,{isLoading:b,tableRowsMaxHeight:n,pods:N,getExtendedPodInfo:c}),!p&&e.createElement(ge,{minSupportedVersion:1.12,currentVersion:g||""})))};export{Pe as CentralConnections,Ee as PipelineCollectors};