@odigos/ui-kit 0.0.164 → 0.0.165

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 (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/lib/chunks/ui-components-76a424df.js +2266 -0
  3. package/lib/components/_v2/badge/index.d.ts +5 -1
  4. package/lib/components/_v2/cards/section-card/index.d.ts +3 -20
  5. package/lib/components/_v2/drop-data/index.d.ts +8 -3
  6. package/lib/components/_v2/hover-actions/index.d.ts +1 -1
  7. package/lib/components/_v2/index.d.ts +1 -0
  8. package/lib/components/_v2/island/index.d.ts +9 -0
  9. package/lib/components/_v2/table/index.d.ts +1 -1
  10. package/lib/components/_v2/table/table-rows/index.d.ts +1 -1
  11. package/lib/components/_v2/table/types.d.ts +2 -1
  12. package/lib/components/no-data-found/index.d.ts +2 -3
  13. package/lib/components/v2.js +1 -1
  14. package/lib/components.js +1 -1
  15. package/lib/constants.js +1 -1
  16. package/lib/containers/_v2/central-connections/index.d.ts +7 -5
  17. package/lib/containers/_v2/central-connections/source-drawer/index.d.ts +4 -7
  18. package/lib/containers/_v2/central-connections/source-drawer/namespaces-column/index.d.ts +14 -0
  19. package/lib/containers/_v2/central-connections/source-drawer/styled.d.ts +17 -0
  20. package/lib/containers/_v2/central-connections/source-drawer/types.d.ts +21 -0
  21. package/lib/containers/_v2/central-connections/source-drawer/workloads-column/index.d.ts +14 -0
  22. package/lib/containers/v2.js +37 -36
  23. package/lib/containers.js +44 -44
  24. package/lib/contexts.js +1 -1
  25. package/lib/functions.js +1 -1
  26. package/lib/hooks.js +1 -1
  27. package/lib/snippets/_v2/actions/index.d.ts +20 -0
  28. package/lib/snippets/_v2/index.d.ts +2 -0
  29. package/lib/snippets/_v2/rich-title/index.d.ts +11 -0
  30. package/lib/snippets.js +1 -1
  31. package/lib/store.js +1 -1
  32. package/lib/theme.js +1 -1
  33. package/lib/types/snapshot/index.d.ts +2 -1
  34. package/lib/types/sources/index.d.ts +13 -0
  35. package/lib/types.js +1 -1
  36. package/lib/visuals.js +1 -24
  37. package/package.json +1 -1
  38. package/lib/chunks/index-53f81cb1.js +0 -3
  39. package/lib/chunks/index-64bb5a64.js +0 -9
  40. package/lib/chunks/ui-components-fabd01fd.js +0 -2235
@@ -1,4 +1,5 @@
1
- import { type FC } from 'react';
1
+ import { CSSProperties, type FC } from 'react';
2
+ import { TypographySize } from '../typography';
2
3
  import { type SVG, StatusType, OtherStatusType } from '@/types';
3
4
  export interface BadgeProps {
4
5
  label: string | number;
@@ -7,5 +8,8 @@ export interface BadgeProps {
7
8
  status?: StatusType | OtherStatusType;
8
9
  useSecondaryTone?: boolean;
9
10
  invertColors?: boolean;
11
+ textSize?: TypographySize;
12
+ textColor?: CSSProperties['color'];
13
+ backgroundColor?: CSSProperties['backgroundColor'];
10
14
  }
11
15
  export declare const Badge: FC<BadgeProps>;
@@ -1,32 +1,15 @@
1
1
  import { type ReactNode, type FC } from 'react';
2
- import type { SVG } from '@/types';
3
- import { type BadgeProps } from '../../badge';
4
2
  import { type SearchProps } from '../../search';
5
- import { type ButtonProps } from '../../button';
6
- import { type DropDataProps } from '../../drop-data';
3
+ import { ActionsProps, RichTitleProps } from '@/snippets/_v2';
7
4
  export declare enum SectionCardSize {
8
5
  S = "small",
9
6
  M = "medium"
10
7
  }
11
- export declare enum SectionCardActionType {
12
- Button = "button",
13
- ButtonDropData = "button-drop-data"
14
- }
15
8
  export interface SectionCardProps {
16
9
  size?: SectionCardSize;
17
- icon: SVG;
18
- title: string;
19
- withCopyTitle?: boolean;
20
- badge?: BadgeProps;
10
+ richTitle: RichTitleProps;
21
11
  search?: SearchProps;
22
- actions?: {
23
- id: string;
24
- type: SectionCardActionType;
25
- buttonProps?: ButtonProps & {
26
- onClick?: (id: string) => void;
27
- };
28
- dropDataItems?: DropDataProps['items'];
29
- }[];
12
+ actions?: ActionsProps['actions'];
30
13
  children?: ReactNode;
31
14
  }
32
15
  export declare const SectionCard: FC<SectionCardProps>;
@@ -2,10 +2,14 @@ import { type FC } from 'react';
2
2
  import type { SVG } from '@/types';
3
3
  import { type ButtonProps } from '../button';
4
4
  import { type IconButtonProps } from '../icon-button';
5
- export declare enum DropDataAlign {
5
+ export declare enum DropDataAlignX {
6
6
  Left = "left",
7
7
  Right = "right"
8
8
  }
9
+ export declare enum DropDataAlignY {
10
+ Top = "top",
11
+ Bottom = "bottom"
12
+ }
9
13
  interface DropDataOption {
10
14
  id: string;
11
15
  label: string;
@@ -13,11 +17,12 @@ interface DropDataOption {
13
17
  withCheckbox?: boolean;
14
18
  }
15
19
  export interface DropDataProps {
16
- items: DropDataOption[];
20
+ items: (DropDataOption | null)[];
17
21
  selectedIds: DropDataOption['id'][];
18
22
  setSelectedIds: (ids: DropDataOption['id'][]) => void;
19
23
  withMultiSelect?: boolean;
20
- align?: DropDataAlign;
24
+ alignX?: DropDataAlignX;
25
+ alignY?: DropDataAlignY;
21
26
  defaultOpen?: boolean;
22
27
  buttonProps?: ButtonProps;
23
28
  iconButtonProps?: IconButtonProps;
@@ -6,7 +6,7 @@ export interface HoverAction extends Pick<ButtonProps, 'label' | 'leftIcon' | 'r
6
6
  }
7
7
  export interface HoverActionsProps {
8
8
  isOpen: boolean;
9
- actions: HoverAction[];
9
+ actions: (HoverAction | null)[];
10
10
  positionRight?: CSSProperties['right'];
11
11
  }
12
12
  export declare const HoverActions: FC<HoverActionsProps>;
@@ -10,6 +10,7 @@ export * from './header';
10
10
  export * from './hover-actions';
11
11
  export * from './icon-button';
12
12
  export * from './input';
13
+ export * from './island';
13
14
  export * from './loader';
14
15
  export * from './modal';
15
16
  export * from './navbar';
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { ActionsProps, RichTitleProps } from '@/snippets/_v2';
3
+ export interface IslandProps {
4
+ isOpen: boolean;
5
+ onClose?: () => void;
6
+ richTitle: RichTitleProps;
7
+ actions: ActionsProps['actions'];
8
+ }
9
+ export declare const Island: FC<IslandProps>;
@@ -9,7 +9,7 @@ export interface TableProps {
9
9
  isLoading?: boolean;
10
10
  columns: TableColumn[];
11
11
  rows: TableRow[];
12
- getRowActions?: (row: TableRow) => HoverAction[];
12
+ getRowActions?: (row: TableRow) => (HoverAction | null)[];
13
13
  rowActionsPushRightPosition?: CSSProperties['width'];
14
14
  withCheckboxes?: boolean;
15
15
  }
@@ -5,7 +5,7 @@ interface TableRowsProps {
5
5
  variant: TableVariant;
6
6
  columns: TableColumn[];
7
7
  rows: TableRow[];
8
- getRowActions: (row: TableRow) => HoverAction[];
8
+ getRowActions: (row: TableRow) => (HoverAction | null)[];
9
9
  rowActionsPushRightPosition?: CSSProperties['width'];
10
10
  withCheckboxes?: boolean;
11
11
  }
@@ -15,9 +15,10 @@ export interface TableRowCell {
15
15
  component?: FC;
16
16
  }
17
17
  export interface TableRow {
18
+ cells: TableRowCell[];
18
19
  onClick?: () => void;
19
20
  isSelected?: boolean;
20
21
  onSelect?: () => void;
21
22
  onDeselect?: () => void;
22
- cells: TableRowCell[];
23
+ hideCheckbox?: boolean;
23
24
  }
@@ -1,7 +1,6 @@
1
1
  import { type FC } from 'react';
2
- interface NoDataFoundProps {
2
+ export interface NoDataFoundProps {
3
3
  title?: string;
4
4
  subTitle?: string;
5
5
  }
6
- declare const NoDataFound: FC<NoDataFoundProps>;
7
- export { NoDataFound, type NoDataFoundProps };
6
+ export declare const NoDataFound: FC<NoDataFoundProps>;
@@ -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,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";
1
+ export{B as Badge,j as Button,r as ButtonSize,dp as ButtonTab,dq as ButtonTabList,k as ButtonVariants,C as Checkbox,dt as CheckboxList,ds as CheckboxSize,J as CliCommand,G as DataCard,g as Drawer,dv as DropData,w as DropDataAlignX,du as DropDataAlignY,dw as Header,c6 as HoverActions,H as IconButton,ci as IconButtonSize,dx as Input,I as Island,L as Loader,dy as Modal,dz as Navbar,i as Note,dB as Radio,dC as RadioGroup,dA as RadioSize,h as Search,p as SectionCard,dr as SectionCardSize,K as Segment,dD as SegmentSize,Q as StatusCard,s as Table,t as TableVariant,dE as Tag,U as TextCard,d as Toggle,dG as ToggleLabelAlign,dH as ToggleList,e as ToggleSize,dF as ToggleVariant,T as Typography,b as TypographySize,dI as TypographyVariants,dJ as WarningModal}from"../chunks/ui-components-76a424df.js";import"../icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
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,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";
1
+ export{aG as AutocompleteInput,aZ as Badge,b0 as Button,ar as CancelWarning,z as CenterThis,a3 as Checkbox,d6 as Code,ax as ConditionDetails,ay as DataCard,$ as DataCardFieldTypes,bK as DataCardFields,d7 as DataFinger,b3 as DataTab,aq as DeleteWarning,c4 as DescribeRow,aH as Divider,ah as DocsButton,ap as Drawer,d9 as DrawerFooter,d8 as DrawerHeader,bp as Dropdown,da as ErrorBoundary,bx as ExtendArrow,n as FadeLoader,a4 as FieldError,a2 as FieldLabel,F as FlexColumn,a as FlexRow,db as Header,bw as IconButton,ce as IconGroup,aU as IconTitleBadge,aP as IconWrapped,c0 as IconsNav,dc as ImageControlled,a6 as Input,ac as InputList,a9 as InputTable,aX as InteractiveTable,ab as KeyValueInputsList,a$ as LoadingText,aB as Modal,aD as ModalBody,ai as MonitorsCheckboxes,aR as MonitorsIcons,aC as NavigationButtons,N as NoDataFound,aE as NotificationNote,di as Overlay,P as PageContent,bk as Popup,cj as PopupForm,co as ScrollX,b6 as ScrollY,ag as SectionTitle,af as Segment,bl as SelectionButton,bb as SkeletonLoader,aJ as Status,bJ as Stepper,dd as TabList,aS as TableContainer,aT as TableTitleWrap,aW as TableWrap,bT as Tag,ae as Text,aj as TextArea,aa as Toggle,cm as ToggleCodeComponent,c as Tooltip,aY as TraceLoader,X as UpgradeRequiredWrapper,bm as VerticalScroll,dh as WarningModal,de as getLinksFromText,df as getStrongsFromText,dg as renderText}from"./chunks/ui-components-76a424df.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
package/lib/constants.js CHANGED
@@ -1 +1 @@
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";
1
+ export{av as ACTION_OPTIONS,ao as BUTTON_TEXTS,D as DEFAULT_DATA_STREAM_NAME,bI as DESTINATION_CATEGORIES,bq as DISPLAY_LANGUAGES,_ as DISPLAY_TITLES,aF as FORM_ALERTS,bW as INSTRUMENTATION_RULE_OPTIONS,c_ as LANGUAGE_OPTIONS,br as MONITORS_OPTIONS,bs as STORAGE_KEYS,c$ as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-76a424df.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
@@ -1,15 +1,17 @@
1
1
  import { type FC } from 'react';
2
2
  import { CSSProperties } from 'styled-components';
3
- import { type Connection } from '@/types';
4
- import { type ApplyConnectionsConfigurationsFunc, GetConnectionRemoteConfig } from './config-drawer';
5
- export { type ApplyConnectionsConfigurationsFunc, type ConnectionConfigurationsFormData, type GetConnectionRemoteConfig } from './config-drawer';
3
+ import { type Connection, type GetAllClusterSnapshots, type PersistSourcesFunc } from '@/types';
4
+ import { type ApplyConnectionsConfigurationsFunc, type ConnectionConfigurationsFormData, GetConnectionRemoteConfig } from './config-drawer';
5
+ export { type ApplyConnectionsConfigurationsFunc, type ConnectionConfigurationsFormData, type GetConnectionRemoteConfig };
6
6
  export interface CentralConnectionsProps {
7
7
  tableRowsMaxHeight: CSSProperties['maxHeight'];
8
8
  connections?: Connection[];
9
9
  getConnections: () => Promise<Connection[]>;
10
10
  onClickConnection: (connection: Connection) => void;
11
11
  deleteConnection: (id: string) => Promise<void>;
12
- getConnectionRemoteConfig: GetConnectionRemoteConfig;
13
- applyConfigurations: ApplyConnectionsConfigurationsFunc;
12
+ getConnectionRemoteConfig?: GetConnectionRemoteConfig;
13
+ applyConfigurations?: ApplyConnectionsConfigurationsFunc;
14
+ getAllClusterSnapshots?: GetAllClusterSnapshots;
15
+ persistSources?: PersistSourcesFunc;
14
16
  }
15
17
  export declare const CentralConnections: FC<CentralConnectionsProps>;
@@ -1,15 +1,12 @@
1
1
  import { type FC, type Dispatch, type SetStateAction } from 'react';
2
- import { type AllClusterSnapshots } from '@/types';
2
+ import { type AllClusterSnapshots, type PersistSourcesFunc } from '@/types';
3
3
  import { DrawerProps } from '@/components/_v2';
4
4
  export interface SourceDrawerProps {
5
5
  onClose: DrawerProps['header']['onClose'];
6
- isLoading: boolean;
7
- snapshots: AllClusterSnapshots | null;
6
+ snapshots: AllClusterSnapshots;
8
7
  selectedConnectionIds: string[];
9
8
  setSelectedConnectionIds: Dispatch<SetStateAction<string[]>>;
10
- onApply: (selectedConnectionIds: string[], formData: unknown) => Promise<{
11
- error?: string;
12
- }>;
9
+ persistSources: PersistSourcesFunc;
13
10
  }
14
- export declare const SOURCE_DRAWER_WIDTH = "75vw";
11
+ export declare const SOURCE_DRAWER_WIDTH = "80vw";
15
12
  export declare const SourceDrawer: FC<SourceDrawerProps>;
@@ -0,0 +1,14 @@
1
+ import { type FC, Dispatch, SetStateAction } from 'react';
2
+ import type { Filters, FormData, HandleSelectAllFunc, HandleSourceChangeFunc, SelectedArea } from '../types';
3
+ export interface NamespacesColumnProps {
4
+ formData: FormData;
5
+ handleSourceChange: HandleSourceChangeFunc;
6
+ handleSelectAll: HandleSelectAllFunc;
7
+ selectedArea: {
8
+ value: SelectedArea;
9
+ setValue: Dispatch<SetStateAction<SelectedArea>>;
10
+ };
11
+ searchText: string;
12
+ filters: Filters;
13
+ }
14
+ export declare const NamespacesColumn: FC<NamespacesColumnProps>;
@@ -0,0 +1,17 @@
1
+ import { type CSSProperties } from 'react';
2
+ export declare const Column: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$gap" | "$alignItems" | "$justifyContent" | "$wrap" | "$padding"> & {
3
+ $gap?: number;
4
+ $alignItems?: import("styled-components").CSSProperties["alignItems"];
5
+ $justifyContent?: import("styled-components").CSSProperties["justifyContent"];
6
+ $wrap?: import("styled-components").CSSProperties["flexWrap"];
7
+ $padding?: import("styled-components").CSSProperties["padding"];
8
+ }, {
9
+ $width: CSSProperties["width"];
10
+ }>> & string;
11
+ export declare const List: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
12
+ $borderRadius: CSSProperties["borderRadius"];
13
+ $gap?: number;
14
+ }>> & string;
15
+ export declare const SelectionWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
16
+ $isSelected?: boolean;
17
+ }>> & string;
@@ -0,0 +1,21 @@
1
+ import type { AllClusterSnapshots, WorkloadId } from '@/types';
2
+ export type FormData = AllClusterSnapshots['clusters'];
3
+ export interface Filters {
4
+ showOnlySelected: boolean;
5
+ }
6
+ export interface SelectedArea {
7
+ clusterId: string;
8
+ clusterName: string;
9
+ namespaceName: string;
10
+ }
11
+ export type HandleSelectAllFunc = (opts: {
12
+ clusterId?: string;
13
+ namespaceName?: string;
14
+ boolean: boolean;
15
+ }) => void;
16
+ export type HandleSourceChangeFunc = (opts: {
17
+ clusterId: string;
18
+ workloadId: Partial<WorkloadId>;
19
+ boolean?: boolean;
20
+ forceDirty?: boolean;
21
+ }) => void;
@@ -0,0 +1,14 @@
1
+ import { type FC, Dispatch, SetStateAction } from 'react';
2
+ import type { Filters, FormData, HandleSelectAllFunc, HandleSourceChangeFunc, SelectedArea } from '../types';
3
+ export interface WorkloadsColumnProps {
4
+ formData: FormData;
5
+ handleSourceChange: HandleSourceChangeFunc;
6
+ handleSelectAll: HandleSelectAllFunc;
7
+ selectedArea: {
8
+ value: SelectedArea;
9
+ setValue: Dispatch<SetStateAction<SelectedArea>>;
10
+ };
11
+ searchText: string;
12
+ filters: Filters;
13
+ }
14
+ export declare const WorkloadsColumn: FC<WorkloadsColumnProps>;
@@ -1,25 +1,8 @@
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)`
1
+ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react";import o,{useTheme as s}from"styled-components";import{F as i,a as r,C as c,T as d,b as u,B as p,S as g,c as m,O as h,N as b,d as f,e as y,u as w,D as C,E as k,f as v,g as x,R as $,h as S,L as I,i as A,j as P,k as R,l as D,m as T,n as N,o as z,P as L,p as V,q as M,A as O,r as W,s as j,t as F,v as U,I as E,w as H,x as G,y as q,z as Y,G as B,H as K,J as X,Y as J,K as Q,M as Z,Q as _,U as ee,W as te,V as ae,X as le,Z as ne}from"../chunks/ui-components-76a424df.js";import{SourceIcon as oe,VSquareIcon as se,OdigosLogo as ie,SettingsIcon as re,ConnectionsIcon as ce,RefreshIcon as de,DeleteIcon as ue,VIcon as pe,XIcon as ge,XSquareIcon as me,PodIcon as he,ChevronUpIcon as be,ChevronDownIcon as fe,TerminalIcon as ye,DownloadIcon as we,PipelineCollectorIcon as Ce,GatewayIcon as ke,YamlIcon as ve}from"../icons.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const xe=o(i)`
19
2
  width: ${({$width:e})=>e};
20
3
  gap: 12px;
21
4
  justify-content: space-between;
22
- `,n.div`
5
+ `,$e=o.div`
23
6
  display: flex;
24
7
  flex-direction: column;
25
8
  padding: 12px;
@@ -30,45 +13,63 @@ import e,{useState as t,useMemo as a,useEffect as o,useCallback as l}from"react"
30
13
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
31
14
  overflow-y: auto;
32
15
  overflow-x: hidden;
33
- `,n.div`
16
+ `,Se=o.div`
34
17
  display: flex;
35
18
  align-items: center;
19
+ justify-content: space-between;
36
20
  gap: 12px;
37
21
  padding: 8px 16px;
38
22
  border-radius: 12px;
39
- background-color: transparent;
23
+ background-color: ${({$isSelected:e,theme:t})=>e?t.v2.colors.silver[600]:"transparent"};
40
24
  cursor: pointer;
41
25
  &:hover {
42
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
26
+ background-color: ${({theme:e})=>e.v2.colors.silver[600]};
43
27
  }
44
- `,n.div`
28
+ `,Ie=({formData:a,handleSourceChange:l,handleSelectAll:n,selectedArea:o,searchText:i,filters:f})=>{const y=s(),{activeNamespace:w,isAll:C,isSome:k}=t(()=>{const e=o.value.clusterId&&o.value.namespaceName?a.find(({clusterId:e})=>e===o.value.clusterId)?.namespaces.find(({name:e})=>e===o.value.namespaceName):void 0;if(!e)return{activeNamespace:void 0,isAll:!1,isSome:!1};const t=e.workloads.filter(({selected:e})=>e).length;return{activeNamespace:e,isAll:t>0&&t===e.workloads.length,isSome:t>0&&t<e.workloads.length}},[a,o.value.clusterId,o.value.namespaceName]),v=t(()=>{if(!w)return[];const{clusterId:t}=o.value,{name:a,workloads:n}=w;return n.map(({name:n,selected:o,kind:s})=>{if(i&&!n.toLowerCase().includes(i.toLowerCase()))return null;const m=o||!1;if(f.showOnlySelected&&!m)return null;const h=()=>l({clusterId:t,workloadId:{namespace:a,name:n,kind:s}});return e.createElement(Se,{key:`${t}#${a}#${n}#${s}`,onClick:h},e.createElement(r,{$gap:12},e.createElement(c,{value:m,onChange:h}),e.createElement(d,{size:u.XS},n)),e.createElement(p,{label:s,status:g.Info,textSize:u.XXXS,backgroundColor:y.v2.colors.blue[900]}))})},[a,o.value.clusterId,w,i,f]);return e.createElement(xe,{$width:"40%"},e.createElement(r,{$padding:"0 12px 0 28px",$gap:12},e.createElement(m,{text:(C?"Unselect":"Select")+" all workloads in the selected namespace"},e.createElement(c,{partiallyChecked:k,value:C,onChange:()=>n({clusterId:o.value.clusterId,namespaceName:o.value.namespaceName,boolean:!C}),disabled:!v.length})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS,nowrap:!0},o.value.clusterId?`${o.value.clusterName} > ${o.value.namespaceName} > Workloads`:"Workloads"),e.createElement(p,{label:v.length,status:h.Unknown}))),e.createElement($e,{$borderRadius:"0 16px 16px 0"},v.length?v:e.createElement(b,{title:"Workloads not found",subTitle:"Please select a namespace to view workloads"})))},Ae=({formData:a,handleSourceChange:l,handleSelectAll:n,selectedArea:o,searchText:i,filters:w})=>{const C=s(),{isAll:k,isSome:v}=t(()=>{const e=a.length>0&&a.every(({namespaces:e})=>e.every(({workloads:e})=>e.every(({selected:e})=>e)));return{isAll:e,isSome:!e&&a.length>0&&a.some(({namespaces:e})=>e.some(({workloads:e})=>e.some(({selected:e})=>e)))}},[a]),x=t(()=>a.flatMap(({clusterId:t,clusterName:a,namespaces:n})=>n.map(({name:n,workloads:s,selected:b})=>{if(i&&!n.toLowerCase().includes(i.toLowerCase()))return null;const k=s.filter(({selected:e})=>e).length,v=k>0&&k===s.length,x=k>0&&k<s.length,$=b||!1;if(w.showOnlySelected&&!v&&!x&&!$)return null;const S=o.value.clusterId===t&&o.value.namespaceName===n,I=()=>o.setValue({clusterId:t,clusterName:a,namespaceName:n});return e.createElement(Se,{key:`${t}#${n}`,$isSelected:S,onClick:I},e.createElement(r,{$gap:12},e.createElement(c,{partiallyChecked:x,value:v,onChange:()=>{I(),s.forEach(({name:e,kind:a})=>{l({clusterId:t,workloadId:{namespace:n,name:e,kind:a},boolean:!v})})}}),e.createElement(d,{size:u.XS},`${a} > ${n}`)),e.createElement(r,{$gap:8},e.createElement(m,{text:"Automatically instrument new workloads that are deployed to this namespace in the future"},e.createElement(f,{label:"Auto",size:y.S,value:$,onChange:()=>{l({clusterId:t,workloadId:{namespace:n},boolean:!$}),s.forEach(({name:e,kind:a,selected:o})=>{l({clusterId:t,workloadId:{namespace:n,name:e,kind:a},boolean:o,forceDirty:!$})})}}))),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:C.v2.colors.silver[200],align:"right"},"Selected Sources"),e.createElement(p,{label:`${k}/${s.length}`,status:S?g.Default:h.Unknown})))})),[a,o.value.clusterId,o.value.namespaceName,i,w]);return e.createElement(xe,{$width:"60%"},e.createElement(r,{$padding:"0 12px 0 28px",$gap:12},e.createElement(m,{text:(k?"Unselect":"Select")+" all workloads in all namespaces"},e.createElement(c,{partiallyChecked:v,value:k,onChange:()=>n({boolean:!k}),disabled:!x.length})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS,nowrap:!0},"Namespaces"),e.createElement(p,{label:x.length,status:h.Unknown}))),e.createElement($e,{$borderRadius:"16px 0 0 16px"},x.length?x:e.createElement(b,{title:"Namespaces not found",subTitle:""})))},Pe="80vw",Re=o.div`
29
+ display: flex;
30
+ flex-direction: column;
31
+ border-radius: 16px;
32
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
33
+ overflow: hidden;
34
+ `,De=o.div`
35
+ display: flex;
36
+ gap: 12px;
37
+ padding: 16px;
38
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
39
+ position: sticky;
40
+ top: 0;
41
+ `,Te=o.div`
42
+ display: flex;
43
+ gap: 12px;
44
+ padding: 16px;
45
+ `,Ne=o.div`
45
46
  display: flex;
46
47
  align-items: center;
47
48
  justify-content: flex-end;
48
49
  gap: 16px;
49
50
  padding: 0 12px;
50
- `;const be="75vw",me=n.div`
51
+ `,ze=({onClose:o,snapshots:i,selectedConnectionIds:c,setSelectedConnectionIds:p,persistSources:m})=>{const h=s(),{selectedStreamName:b}=w(),T=t(()=>b||C,[b]),[N,z]=a(""),[L,V]=a(k.Namespace),[M,O]=a({showOnlySelected:!1}),[W,j]=a(!1),[F,U]=a(!1),[E,H]=a(void 0),[G,q]=a({clusterId:"",clusterName:"",namespaceName:""}),[Y,B]=a([]);l(()=>{B(e=>{const t=((e,t)=>v(((e,t)=>e.clusters.filter(({clusterId:e})=>t.includes(e)))(e,t)))(i,c);return t.map(t=>{const a=e?.find(e=>e.clusterId===t.clusterId);return a??t})})},[i,c]);const{formDiff:K,isFormDirty:X}=t(()=>{const e=((e,t,a)=>{const l=new Set,n={};return e.forEach(e=>{e.namespaces.forEach(o=>{const s=t.find(t=>t.clusterId===e.clusterId)?.namespaces.find(e=>e.name===o.name);if(o.selected!==s?.selected){const t=`${e.clusterId}#${o.name}`;l.has(t)||(l.add(t),n[e.clusterId]||(n[e.clusterId]=[]),n[e.clusterId].push({namespace:o.name,selected:o.selected||!1,currentStreamName:a}))}o.workloads.forEach(t=>{const i=s?.workloads.find(e=>e.name===t.name&&e.kind===t.kind);if(t.forceDirty||t.selected!==i?.selected){const s=`${e.clusterId}#${o.name}#${t.name}#${t.kind}`;l.has(s)||(l.add(s),n[e.clusterId]||(n[e.clusterId]=[]),n[e.clusterId].push({namespace:o.name,name:t.name,kind:t.kind,selected:t.selected||!1,currentStreamName:a}))}})})}),n})(Y,i.clusters,T);return{formDiff:e,isFormDirty:Object.keys(e).length>0}},[Y,i,T]),J=n(({clusterId:e,workloadId:t,boolean:a,forceDirty:l})=>{B(n=>{const o=v(n),s=o.findIndex(t=>t.clusterId===e);if(-1!==s){const e=o[s].namespaces.findIndex(e=>e.name===t.namespace);if(-1===e)return o;if(t.kind&&t.name){const n=o[s].namespaces[e].workloads.findIndex(e=>e.name===t.name&&e.kind===t.kind);if(-1===n)return o;o[s].namespaces[e].workloads[n].selected="boolean"==typeof a?a:!o[s].namespaces[e].workloads[n].selected,o[s].namespaces[e].workloads[n].forceDirty=l||!1}else o[s].namespaces[e].selected="boolean"==typeof a?a:!o[s].namespaces[e].selected}return o})},[]),Q=n(({clusterId:e,namespaceName:t,boolean:a})=>{B(l=>{const n=v(l);return n.forEach((l,o)=>{e&&l.clusterId!==e||l.namespaces.forEach(({name:e,workloads:l},s)=>{t&&e!==t||l.forEach((e,t)=>{n[o].namespaces[s].workloads[t].selected=a})})}),n})},[]),Z=()=>{j(!1),o()};return e.createElement(x,{isOpen:!0,hideOverlay:!0,width:Pe,header:{icon:oe,title:"Manage Sources",onClose:o}},e.createElement(Re,null,e.createElement(De,null,e.createElement($,{icon:se,title:"Selected Clusters",badge:{label:c.length}}),e.createElement(S,{width:"300px",value:N,onChange:z,segment:{options:[{label:"Namespace",value:k.Namespace},{label:"Source",value:k.Source}],selected:L,setSelected:V}}),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:h.v2.colors.silver[200],nowrap:!0},"Show only:"),e.createElement(f,{size:y.S,label:"Selected",value:M.showOnlySelected,onChange:e=>O(t=>({...t,showOnlySelected:e}))}))),e.createElement(Te,null,e.createElement(Ae,{formData:Y,handleSourceChange:J,handleSelectAll:Q,selectedArea:{value:G,setValue:q},searchText:L===k.Namespace?N:"",filters:M}),e.createElement(Ie,{formData:Y,handleSourceChange:J,handleSelectAll:Q,selectedArea:{value:G,setValue:q},searchText:L===k.Source?N:"",filters:M}))),e.createElement(Ne,null,F?e.createElement(I,{label:"Applying sources...",icon:ie,withGradient:!0,typographyProps:{size:u.XXS}}):E?e.createElement(A,{fullWidth:!0,status:g.Error,message:E}):X?e.createElement(A,{fullWidth:!0,status:g.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):X?null:e.createElement(A,{fullWidth:!0,status:g.Success,message:"The values reflect the current configuration of the selected cluster."}),e.createElement(r,{$gap:8},e.createElement("div",{style:{width:"150px"}},e.createElement(P,{fullWidth:!0,variant:R.Secondary,label:"Cancel",onClick:()=>X?j(!0):Z(),disabled:!X||F})),e.createElement("div",{style:{width:"150px"}},e.createElement(P,{fullWidth:!0,variant:R.Primary,label:"Save",onClick:async()=>{U(!0);const{error:e}=await m(K);U(!1),e?H(e):(p([]),o())},disabled:!X||F})))),e.createElement(D,{isOpen:W,onClose:()=>j(!1),onApprove:Z}))},Le="75vw",Ve=o.div`
51
52
  display: flex;
52
53
  flex-direction: column;
53
54
  border-radius: 16px;
54
55
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
55
56
  overflow: hidden;
56
- `,ye=n.div`
57
+ `,Me=o.div`
57
58
  display: flex;
58
59
  gap: 12px;
59
60
  padding: 16px;
60
61
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
61
62
  position: sticky;
62
63
  top: 0;
63
- `,he=n.div`
64
+ `,Oe=o.div`
64
65
  display: flex;
65
66
  gap: 12px;
66
67
  padding: 16px;
67
- `,fe=n(r)`
68
+ `,We=o(i)`
68
69
  width: ${({$width:e})=>e};
69
70
  gap: 12px;
70
71
  justify-content: space-between;
71
- `,ve=n.div`
72
+ `,je=o.div`
72
73
  display: flex;
73
74
  flex-direction: column;
74
75
  padding: 12px;
@@ -79,7 +80,7 @@ import e,{useState as t,useMemo as a,useEffect as o,useCallback as l}from"react"
79
80
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
80
81
  overflow-y: auto;
81
82
  overflow-x: hidden;
82
- `,we=n.div`
83
+ `,Fe=o.div`
83
84
  display: flex;
84
85
  align-items: center;
85
86
  gap: 12px;
@@ -88,15 +89,15 @@ import e,{useState as t,useMemo as a,useEffect as o,useCallback as l}from"react"
88
89
  background-color: transparent;
89
90
  cursor: pointer;
90
91
  &:hover {
91
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
92
+ background-color: ${({theme:e})=>e.v2.colors.silver[600]};
92
93
  }
93
- `,Ce=n.div`
94
+ `,Ue=o.div`
94
95
  display: flex;
95
96
  align-items: center;
96
97
  justify-content: flex-end;
97
98
  gap: 16px;
98
99
  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`
100
+ `,Ee=({onClose:n,connections:o,selectedConnectionIds:i,setSelectedConnectionIds:m,getConnectionRemoteConfig:b,onApply:w})=>{const C=s(),[k,v]=a(""),[z,L]=a({showOnlySelected:!1}),V=t(()=>o.filter(e=>(!k||e.name.toLowerCase().includes(k.toLowerCase()))&&(!z.showOnlySelected||i.includes(e.id))),[o,i.length,k,z]),M=e=>{m(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[O,W]=a(!1),[j,F]=a(!1),[U,E]=a(void 0),[H,G]=a(!1),[q,Y]=a(void 0),{formData:B,handleFormChange:K,areFormValuesEqual:X,resetFormData:J}=T(q||{automaticRollout:!0}),{isFormDirty:Q,isFormMatch:Z}=t(()=>({isFormDirty:i.length>1||void 0!==q&&!X(q,B),isFormMatch:1===i.length&&void 0!==q&&X(q,B)}),[i.length,q,B]);l(()=>{1===i.length?(async e=>{if(H)return;G(!0);const t=await b(e);if(t){const e={automaticRollout:!t.rollout?.automaticRolloutDisabled};Y(e),J(e)}G(!1)})(i[0]):Y(void 0)},[i.length]);const _=()=>{W(!1),n()};return e.createElement(x,{isOpen:!0,hideOverlay:!0,width:Le,header:{icon:re,title:"Cluster Configuration",onClose:n}},e.createElement(Ve,null,e.createElement(Me,null,e.createElement($,{icon:se,title:"Selected Clusters",badge:{label:i.length}}),e.createElement(S,{width:"300px",placeholder:"Search by cluster name",value:k,onChange:v}),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:C.v2.colors.silver[200],nowrap:!0},"Show only:"),e.createElement(f,{size:y.S,label:"Selected",value:z.showOnlySelected,onChange:e=>L(t=>({...t,showOnlySelected:e}))}))),e.createElement(Oe,null,e.createElement(We,{$width:"40%"},e.createElement(r,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS},"Clusters"),e.createElement(p,{label:o.length,status:h.Unknown})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:C.v2.colors.silver[200],align:"right"},"Selected clusters"),e.createElement(p,{label:`${i.length}/${o.length}`,status:h.Unknown}))),e.createElement(je,{$borderRadius:"16px 0 0 16px"},V.map(t=>e.createElement(Fe,{key:t.id,onClick:()=>M(t.id)},e.createElement(c,{value:i.includes(t.id),onChange:()=>M(t.id)}),e.createElement(d,{size:u.XS},t.name))))),e.createElement(We,{$width:"60%"},e.createElement(r,{$padding:"0 12px"},e.createElement(d,{size:u.XS},"Configurations")),e.createElement(je,{$borderRadius:"0 16px 16px 0",$gap:12},H?e.createElement(N,null):e.createElement(f,{label:"Automatic Rollout "+(B.automaticRollout?"Enabled":"Disabled"),tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is enabled, Odigos will proactively restart workloads as needed to apply updated instrumentation. Users do not need to manually trigger rollouts after adding or removing sources. Any new pods created after enabling or disabling the agent (via automatic rollout, autoscaling, etc.) will still have the agent injected, regardless of this setting. When set to false, additional configurations related to automated rollouts or rollbacks take effect.",value:B.automaticRollout,onChange:e=>K("automaticRollout",e)}))))),e.createElement(Ue,null,H?e.createElement(I,{label:"Fetching configuration...",icon:ie,withGradient:!0,typographyProps:{size:u.XXS}}):j?e.createElement(I,{label:"Applying configurations...",icon:ie,withGradient:!0,typographyProps:{size:u.XXS}}):U?e.createElement(A,{fullWidth:!0,status:g.Error,message:U}):Q?e.createElement(A,{fullWidth:!0,status:g.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):Z?e.createElement(A,{fullWidth:!0,status:g.Success,message:"The values reflect the current configuration of the selected cluster."}):null,e.createElement(r,{$gap:8},e.createElement("div",{style:{width:"150px"}},e.createElement(P,{fullWidth:!0,variant:R.Secondary,label:"Cancel",onClick:()=>Q?W(!0):_(),disabled:j})),e.createElement("div",{style:{width:"150px"}},e.createElement(P,{fullWidth:!0,variant:R.Primary,label:"Save",onClick:async()=>{F(!0);const{error:e}=await w(i,B);F(!1),e?E(e):(m([]),n())},disabled:!Q||j})))),e.createElement(D,{isOpen:O,onClose:()=>W(!1),onApprove:_}))};var He,Ge;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(He||(He={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Ge||(Ge={}));const qe=[{key:Ge.Name,label:"Name"},{key:Ge.Type,label:"Type",textAlign:"right"},{key:Ge.Status,label:"Status"},{key:Ge.OdigosVersion,label:"Odigos Version"},{key:Ge.ConnectedSince,label:"Connected Since"},{key:Ge.LastActivity,label:"Last Activity"}],Ye=(e,t)=>{const a=e.find(e=>e.key===Ge.Id)?.rawValue;a&&t(a.toString())},Be=({tableRowsMaxHeight:o,connections:i,getConnections:r,onClickConnection:c,deleteConnection:d,getConnectionRemoteConfig:u,applyConfigurations:m,getAllClusterSnapshots:b,persistSources:f})=>{const y=s(),{formatTimeAgo:w}=z(),[C,k]=a(!1),[v,x]=a(i||[]),[$,S]=a(!1),[I,A]=a(null),P=n(async()=>{try{k(!0),x(await r()??[])}catch(e){}finally{k(!1)}},[]),D=n(async()=>{if(b)try{S(!0),A(await b()??null)}catch(e){}finally{S(!1)}},[]);l(()=>{v.length||P()},[v.length,P]),l(()=>{I||D()},[I,D]);const[T,N]=a(""),[G,q]=a(null),[Y,B]=a([]),K=t(()=>v.filter(e=>e.status===g.Success),[v]),X=t(()=>v.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(t=>({cells:[{key:Ge.Id,rawValue:t.id},{key:Ge.Name,rawValue:t.name},{key:Ge.Type,rawValue:t.type},{key:Ge.Status,rawValue:t.status,component:()=>(t=>{const a=t===g.Success?"Connection live":"Connection lost",l=t===g.Success?pe:ge;return e.createElement(p,{status:t,label:a,leftIcon:l})})(t.status)},{key:Ge.OdigosVersion,rawValue:t.odigosVersion},{key:Ge.ConnectedSince,rawValue:t.connectedAt?w(t.connectedAt):"-"},{key:Ge.LastActivity,rawValue:t.lastSeenAt?w(t.lastSeenAt):"-"}],onClick:t.status===g.Success?()=>c(t):void 0,isSelected:Y.includes(t.id),onSelect:()=>B(e=>Array.from(new Set([...e,t.id]))),onDeselect:()=>B(e=>e.filter(e=>e!==t.id)),hideCheckbox:t.status!==g.Success})),[v,Y,T]);return e.createElement(L,null,e.createElement(V,{richTitle:{icon:ce,title:"Connections",badge:{label:v.length.toString(),status:h.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>N(e),width:"300px"},actions:[{id:M(),type:O.Button,buttonProps:{variant:R.Secondary,size:W.S,leftIcon:de,onClick:async()=>{await P(),await D()},disabled:C||$}}]},e.createElement(j,{variant:F.Pretty,maxHeight:o,headerBackgroundColor:y.v2.colors.silver[1e3],isLoading:C,withCheckboxes:!0,columns:qe,rows:X,rowActionsPushRightPosition:G?`calc(${G===He.BulkConfig?Le:Pe} - 24px)`:void 0,getRowActions:({cells:e})=>(e=>e.find(e=>e.key===Ge.Status)?.rawValue===g.Success)(e)?[I&&f?{id:M(),label:"Manage Sources",rightIcon:oe,onClick:async()=>{Ye(e,e=>{B([e]),q(He.BulkSource)})}}:null,u&&m?{id:M(),label:"Edit Configuration",rightIcon:re,onClick:async()=>{Ye(e,e=>{B([e]),q(He.BulkConfig)})}}:null]:[{id:M(),label:"Delete Connection",rightIcon:ue,onClick:()=>{Ye(e,e=>{B([e]),q(He.Delete)})}}]}),G===He.BulkConfig&&u&&m&&e.createElement(Ee,{onClose:()=>q(null),connections:K,selectedConnectionIds:Y,setSelectedConnectionIds:B,getConnectionRemoteConfig:u,onApply:m}),G===He.BulkSource&&I&&f&&e.createElement(ze,{onClose:()=>q(null),snapshots:I,selectedConnectionIds:Y,setSelectedConnectionIds:B,persistSources:f}),e.createElement(U,{target:"connection",isOpen:G===He.Delete,onClose:()=>{B([]),q(null)},onApprove:async()=>{const e=Y[0];e&&(await d(e),await P())}}),e.createElement(E,{isOpen:!!Y.length&&!G,richTitle:{icon:se,title:"Selected Clusters",badge:{label:Y.length}},actions:[{id:M(),type:O.Button,buttonProps:{variant:R.Text,size:W.S,label:"Cancel",onClick:()=>B([])}},I&&f?{id:M(),type:O.ButtonDropData,buttonProps:{variant:R.Secondary,size:W.S,label:"Add Component",onClick:e=>q(e)},dropDataProps:{alignX:H.Left,items:[{id:He.BulkSource,label:"Add Source",icon:oe}]}}:null,u&&m?{id:M(),type:O.Button,buttonProps:{variant:R.Primary,size:W.S,label:"Manage Configurations",rightIcon:re,onClick:()=>q(He.BulkConfig)}}:null]})))},Ke=o.div`
100
101
  display: flex;
101
102
  align-items: center;
102
103
  justify-content: space-between;
@@ -108,10 +109,10 @@ import e,{useState as t,useMemo as a,useEffect as o,useCallback as l}from"react"
108
109
  &:hover {
109
110
  background: ${({theme:e})=>e.v2.colors.silver[700]};
110
111
  }
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`
112
+ `,Xe=o.div`
113
+ animation-name: ${G.animations.fade.in};
114
+ `,Je=({pod:n,getExtendedPodInfo:o,onClose:s})=>{const{formatTimeAgo:r}=z(),[c,u]=a(null),[p,m]=a(!1);l(()=>{n?o(n.namespace,n.name).then(e=>u(e??null)):(u(null),m(!1))},[n]);const h=t(()=>[{id:M(),title:"Node",label:c?.node??"-",withCopy:!0},{id:M(),title:"Status",badge:{status:q(c?.status),label:c?.status??"-"}}],[c]),b=t(()=>c?.containers?.map(e=>({id:M(),items:[{id:M(),title:"Container",label:e.name??"-"},{id:M(),title:"Status",label:e.startedAt?`${e.status} (since ${r(e.startedAt)})`:e.status},{id:M(),title:"Ready",badge:{status:e.ready?g.Success:g.Error,leftIcon:e.ready?se:me,label:e.ready?"True":"False",invertColors:!0}},{id:M(),title:"Started",badge:{status:e.started?g.Success:g.Error,leftIcon:e.started?se:me,label:e.started?"True":"False",invertColors:!0}},{id:M(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:M(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:M(),title:"Restarts",label:e.restarts.toString()},{id:M(),title:"State Reason",label:e.stateReason??"-"},{id:M(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:M(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return e.createElement(x,{isOpen:!!n,header:{icon:he,title:"Pod Information",onClose:s}},c?null:e.createElement(Y,null,e.createElement(N,null)),c?e.createElement(e.Fragment,null,e.createElement(V,{richTitle:{icon:he,title:c.name,withCopy:!0}},e.createElement(i,{$gap:24},e.createElement(B,{cellsPerRow:2,items:h}),b.length>0&&e.createElement(i,{$gap:12},e.createElement(Ke,{onClick:()=>m(e=>!e)},e.createElement(d,null,"Containers Overview"),e.createElement(K,{icon:p?be:fe})),p&&b.map(({id:t,items:a})=>e.createElement(Xe,{key:t},e.createElement(B,{cellsPerRow:2,items:a})))))),e.createElement(V,{richTitle:{icon:ye,title:"Kubectl Commands"}},e.createElement(i,{$gap:12},e.createElement(X,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),e.createElement(X,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),e.createElement(X,{value:`kubectl logs ${c.name} -n ${c.namespace}`}))),e.createElement(J,{yaml:c.manifestYAML})):null)};var Qe;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(Qe||(Qe={}));const Ze=[{key:Qe.PodName,label:"Pod Name"},{key:Qe.Status,label:"Status"},{key:Qe.Restarts,label:"Restarts",textAlign:"right"},{key:Qe.NodeName,label:"Node Name"},{key:Qe.Age,label:"Age",textAlign:"right"},{key:Qe.DockerImage,label:"Docker Image",textAlign:"right"}],_e=({isLoading:l,tableRowsMaxHeight:n,pods:o,getExtendedPodInfo:i})=>{const r=s(),{formatTimeAgo:c}=z(),[d,u]=a(null),g=t(()=>o.map(t=>({onClick:()=>u(t),cells:[{key:Qe.PodName,rawValue:t.name},{key:Qe.Status,rawValue:t.status,component:()=>{return a=t.status,e.createElement(p,{status:q(a),label:a});var a}},{key:Qe.Restarts,rawValue:t.restartsCount.toString()},{key:Qe.NodeName,rawValue:t.nodeName},{key:Qe.Age,rawValue:c(t.creationTimestamp)},{key:Qe.DockerImage,rawValue:t.image}]})),[o,r]);return e.createElement(V,{richTitle:{icon:he,title:"Pods"}},e.createElement(j,{variant:F.Data,maxHeight:n,isLoading:l,columns:Ze,rows:g}),e.createElement(Je,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)}))};var et;!function(e){e.Gateway="gateway",e.Node="node"}(et||(et={}));const tt=[{value:et.Gateway,label:"Gateway"},{value:et.Node,label:"Node Collector"}],at=o.div`
114
115
  display: flex;
115
116
  align-items: center;
116
117
  justify-content: space-between;
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};
118
+ `,lt=({selectedTab:a,setSelectedTab:l,onClickDownloadDiagnose:n,onClickRefresh:o,loading:s,disabled:i})=>{const c=t(()=>{const e=[];return n&&e.push({id:M(),type:O.Button,buttonProps:{label:"Download Diagnose",leftIcon:we,size:W.S,variant:R.Text,onClick:n,disabled:i}}),o&&e.push({id:M(),type:O.Button,buttonProps:{label:"Refresh",leftIcon:de,size:W.S,variant:R.Text,onClick:o,disabled:i,loading:s}}),e},[n,o,i,s]);return e.createElement(at,null,e.createElement(r,{$gap:12},e.createElement(r,{$gap:8},e.createElement(Ce,{size:32}),e.createElement(d,{size:u.M,weight:500},"Pipeline Collectors")),e.createElement(Q,{options:tt,selected:a,setSelected:l,disabled:i})),e.createElement(Z,{actions:c}))},nt=({isOpen:t,onClose:a,title:l,yaml:n})=>e.createElement(x,{isOpen:t,header:{icon:ke,title:l,onClose:a}},e.createElement(J,{yaml:n}));var ot;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(ot||(ot={}));const st=({richTitle:t,statusCard:l,textCards:n,manifestYaml:o,configMapYaml:s})=>{const[i,c]=a(null);return e.createElement(V,{richTitle:t,actions:[{id:M(),type:O.ButtonDropData,buttonProps:{variant:R.Secondary,size:W.S,label:"View YAML",onClick:e=>c(e)},dropDataProps:{items:[{id:ot.ManifestYaml,label:t.title,icon:ve},{id:ot.ConfigMapYaml,label:"ConfigMap",icon:ve}]}}]},e.createElement(r,{$gap:16},e.createElement(_,{...l}),n.map(t=>e.createElement(ee,{key:t.title,...t}))),e.createElement(nt,{isOpen:i===ot.ManifestYaml,onClose:()=>c(null),title:t.title,yaml:o}),e.createElement(nt,{isOpen:i===ot.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:s}))},it=e=>{switch(e){case te.Healthy:return"All desired replicas are updated, available, and ready";case te.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case te.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case te.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case te.Down:return"No available replicas";case te.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},rt=({tableRowsMaxHeight:o,getGatewayInfo:s,getGatewayPods:i,getNodeCollectorInfo:r,getNodeCollectorPods:c,getExtendedPodInfo:d})=>{const{formatTimeAgo:u}=z(),{isVersionSupported:p,version:m}=ae(1.12),[b,f]=a(!1),[y,w]=a(et.Gateway),[C,k]=a(null),[v,x]=a([]),[$,S]=a(null),[I,A]=a([]),P=n(async()=>{f(!0);try{switch(y){case et.Gateway:k(await s()??null),x(await i()??[]);break;case et.Node:S(await r()??null),A(await c()??[])}}catch(e){}f(!1)},[y]);l(()=>{P()},[P]);const R=t(()=>(e=>{switch(e){case et.Gateway:return"Deployment";case et.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(y),[y]),D=t(()=>((e,t,a,l)=>{const n={status:h.Disabled,label:"No rollouts yet"};let o=!1,s=null;switch(e){case et.Gateway:o=t?.rolloutInProgress??!1,s=t?.lastRolloutAt??null;break;case et.Node:o=a?.rolloutInProgress??!1,s=a?.lastRolloutAt??null;break;default:return n}return o?{status:g.Info,label:"Rollout in progress",rightIcon:de,useSecondaryTone:!0}:s?{status:h.Disabled,label:`Last Rollout: ${l(s)}`}:n})(y,C,$,u),[C,$,y,u]),T=t(()=>((e,t,a,l)=>{let n=l?g.Info:h.Unknown,o=l?"Loading":te.Unknown,s=l?"Fetching data...":it(te.Unknown);switch(e){case et.Gateway:n=t?.status?q(t?.status):n,o=t?.status??o,s=t?.status?it(t.status):s;break;case et.Node:n=a?.status?q(a?.status):n,o=a?.status??o,s=a?.status?it(a.status):s}return{status:n,title:o,description:s}})(y,C,$,b),[C,$,y,b]),N=t(()=>((e,t,a,l)=>{switch(e){case et.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 et.Node:return[{title:"Nodes",cells:[{label:"Desired",value:a?.nodes?.desired.toString()??"-",isLoading:l},{label:"Ready",value:a?.nodes?.ready.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:a?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:a?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:a?.imageVersion??"-",isLoading:l}]}];default:return[]}})(y,C,$,b),[C,$,y,b]),V=t(()=>(y===et.Gateway?C?.manifestYAML:$?.manifestYAML)??"",[C,$,y]),M=t(()=>(y===et.Gateway?C?.configMapYAML:$?.configMapYAML)??"",[C,$,y]),O=t(()=>y===et.Gateway?v:I,[v,I,y]);return e.createElement(L,null,e.createElement(lt,{disabled:!p,loading:b,selectedTab:y,setSelectedTab:w,onClickDownloadDiagnose:void 0,onClickRefresh:P}),e.createElement(le,null,e.createElement(st,{richTitle:{icon:ke,title:R,badge:D},statusCard:T,textCards:N,manifestYaml:V,configMapYaml:M}),e.createElement(_e,{isLoading:b,tableRowsMaxHeight:o,pods:O,getExtendedPodInfo:d}),!p&&e.createElement(ne,{minSupportedVersion:1.12,currentVersion:m||""})))};export{Be as CentralConnections,rt as PipelineCollectors};