@odigos/ui-kit 0.0.137 → 0.0.139

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 (41) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/lib/chunks/ui-components-eab2149b.js +2163 -0
  3. package/lib/components/_v2/cards/section-card/index.d.ts +2 -0
  4. package/lib/components/_v2/drawer/index.d.ts +4 -2
  5. package/lib/components/_v2/index.d.ts +3 -0
  6. package/lib/components/_v2/loader/index.d.ts +12 -0
  7. package/lib/components/_v2/search/index.d.ts +7 -0
  8. package/lib/components/_v2/table/index.d.ts +9 -20
  9. package/lib/components/_v2/table/styled.d.ts +26 -0
  10. package/lib/components/_v2/table/table-columns/index.d.ts +12 -0
  11. package/lib/components/_v2/table/table-rows/actions/index.d.ts +9 -0
  12. package/lib/components/_v2/table/table-rows/index.d.ts +11 -0
  13. package/lib/components/_v2/table/types.d.ts +24 -0
  14. package/lib/components/_v2/toggle/index.d.ts +21 -0
  15. package/lib/components/styled.d.ts +8 -3
  16. package/lib/components/v2.js +1 -1
  17. package/lib/components.js +1 -1
  18. package/lib/constants.js +1 -1
  19. package/lib/containers/_v2/central-connections/config-drawer/index.d.ts +18 -0
  20. package/lib/containers/_v2/central-connections/index.d.ts +13 -0
  21. package/lib/containers/_v2/index.d.ts +1 -0
  22. package/lib/containers/v2.js +53 -5
  23. package/lib/containers.js +116 -116
  24. package/lib/functions.js +1 -1
  25. package/lib/hooks.js +1 -1
  26. package/lib/icons/common/index.d.ts +1 -0
  27. package/lib/icons/common/question-circle-icon/index.d.ts +1 -1
  28. package/lib/icons/common/settings-icon/index.d.ts +2 -0
  29. package/lib/icons.js +1 -1
  30. package/lib/mock-data/connections/index.d.ts +2 -0
  31. package/lib/mock-data/index.d.ts +1 -0
  32. package/lib/snippets/add-button/index.d.ts +2 -1
  33. package/lib/snippets/edit-button/index.d.ts +1 -1
  34. package/lib/snippets.js +1 -1
  35. package/lib/store.js +1 -1
  36. package/lib/theme.js +1 -1
  37. package/lib/types/common/index.d.ts +3 -0
  38. package/lib/types.js +1 -1
  39. package/lib/visuals.js +4 -4
  40. package/package.json +1 -1
  41. package/lib/chunks/ui-components-a8941c5a.js +0 -2081
@@ -1,6 +1,7 @@
1
1
  import { type ReactNode, type FC } from 'react';
2
2
  import type { SVG } from '@/types';
3
3
  import { type BadgeProps } from '../../badge';
4
+ import { type SearchProps } from '../../search';
4
5
  import { type ButtonProps } from '../../button';
5
6
  import { type DropDataProps } from '../../drop-data';
6
7
  export declare enum SectionCardSize {
@@ -17,6 +18,7 @@ export interface SectionCardProps {
17
18
  title: string;
18
19
  withCopyTitle?: boolean;
19
20
  badge?: BadgeProps;
21
+ search?: SearchProps;
20
22
  actions?: {
21
23
  id: string;
22
24
  type: SectionCardActionType;
@@ -1,9 +1,11 @@
1
- import React, { type FC } from 'react';
1
+ import { type CSSProperties, type ReactNode, type FC } from 'react';
2
2
  import { HeaderProps } from './header';
3
3
  export interface DrawerProps {
4
4
  isOpen: boolean;
5
+ hideOverlay?: boolean;
5
6
  position?: 'left' | 'right';
7
+ width?: CSSProperties['width'];
6
8
  header: HeaderProps;
7
- children: React.ReactNode;
9
+ children: ReactNode;
8
10
  }
9
11
  export declare const Drawer: FC<DrawerProps>;
@@ -11,12 +11,15 @@ export * from './drop-data';
11
11
  export * from './header';
12
12
  export * from './icon-button';
13
13
  export * from './input';
14
+ export * from './loader';
14
15
  export * from './modal';
15
16
  export * from './navbar';
16
17
  export * from './note';
17
18
  export * from './radio';
18
19
  export * from './radio-group';
20
+ export * from './search';
19
21
  export * from './segment';
20
22
  export * from './table';
21
23
  export * from './tag';
24
+ export * from './toggle';
22
25
  export * from './typography';
@@ -0,0 +1,12 @@
1
+ import { type FC } from 'react';
2
+ import type { SVG } from '@/types';
3
+ import { type TypographyProps } from '../typography';
4
+ export interface LoaderProps {
5
+ label?: string;
6
+ icon?: SVG;
7
+ withGradient?: boolean;
8
+ textColor?: string;
9
+ stripColor?: string;
10
+ typographyProps?: Omit<TypographyProps, 'children'>;
11
+ }
12
+ export declare const Loader: FC<LoaderProps>;
@@ -0,0 +1,7 @@
1
+ import { type FC } from 'react';
2
+ export interface SearchProps {
3
+ placeholder?: string;
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ }
7
+ export declare const Search: FC<SearchProps>;
@@ -1,25 +1,14 @@
1
- import { type CSSProperties, type FC } from 'react';
2
- interface Column {
3
- key: string;
4
- label: string;
5
- sortable?: boolean;
6
- minWidth?: CSSProperties['minWidth'];
7
- textAlign?: CSSProperties['textAlign'];
8
- }
9
- interface RowCell {
10
- key: string;
11
- rawValue: string | number | boolean;
12
- component?: FC;
13
- }
14
- interface Row {
15
- onClick?: () => void;
16
- cells: RowCell[];
17
- }
1
+ import { type FC } from 'react';
2
+ import { CSSProperties } from 'styled-components';
3
+ import type { TableColumn, TableRow, TableRowAction } from './types';
4
+ export * from './types';
18
5
  export interface TableProps {
19
6
  maxHeight?: CSSProperties['maxHeight'];
20
7
  isLoading?: boolean;
21
- columns: Column[];
22
- rows: Row[];
8
+ columns: TableColumn[];
9
+ rows: TableRow[];
10
+ rowActions?: TableRowAction[];
11
+ rowActionsPushRightPosition?: CSSProperties['width'];
12
+ withCheckboxes?: boolean;
23
13
  }
24
14
  export declare const Table: FC<TableProps>;
25
- export {};
@@ -0,0 +1,26 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { TableColumn } from './types';
3
+ export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
+ $maxHeight: CSSProperties["maxHeight"];
5
+ }>> & string;
6
+ export declare const TableRoot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>> & string;
7
+ export declare const THead: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, never>> & string;
8
+ export declare const Th: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, {
9
+ $minWidth?: TableColumn["minWidth"];
10
+ $isFirst: boolean;
11
+ $isLast: boolean;
12
+ }>> & string;
13
+ export declare const ThBorder: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
14
+ export declare const TBody: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, never>> & string;
15
+ export declare const Td: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {
16
+ $withClick: boolean;
17
+ $hovered: boolean;
18
+ $selected: boolean;
19
+ $isLastRow: boolean;
20
+ $isFirstCell: boolean;
21
+ $isLastCell: boolean;
22
+ }>> & string;
23
+ export declare const Sortable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
24
+ $textAlign?: TableColumn["textAlign"];
25
+ $withClick: boolean;
26
+ }>> & string;
@@ -0,0 +1,12 @@
1
+ import { type FC } from 'react';
2
+ import { SortDirection } from '@/types';
3
+ import type { TableColumn } from '../types';
4
+ interface TableColumnsProps {
5
+ columns: TableColumn[];
6
+ sortDirection: SortDirection;
7
+ sortByKey: string;
8
+ onSort: (key: string) => void;
9
+ withCheckboxes?: boolean;
10
+ }
11
+ export declare const TableColumns: FC<TableColumnsProps>;
12
+ export {};
@@ -0,0 +1,9 @@
1
+ import { type CSSProperties, type FC } from 'react';
2
+ import type { TableRow, TableRowAction } from '../../types';
3
+ interface ActionsProps {
4
+ rowActions: TableRowAction[];
5
+ rowActionsPushRightPosition?: CSSProperties['width'];
6
+ row: TableRow;
7
+ }
8
+ export declare const Actions: FC<ActionsProps>;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import { type FC, type CSSProperties } from 'react';
2
+ import type { TableColumn, TableRow, TableRowAction } from '../types';
3
+ interface TableRowsProps {
4
+ columns: TableColumn[];
5
+ rows: TableRow[];
6
+ rowActions: TableRowAction[];
7
+ rowActionsPushRightPosition?: CSSProperties['width'];
8
+ withCheckboxes?: boolean;
9
+ }
10
+ export declare const TableRows: FC<TableRowsProps>;
11
+ export {};
@@ -0,0 +1,24 @@
1
+ import { type CSSProperties, type FC } from 'react';
2
+ import { type ButtonProps } from '../button';
3
+ export interface TableColumn {
4
+ key: string;
5
+ label: string;
6
+ sortable?: boolean;
7
+ minWidth?: CSSProperties['minWidth'];
8
+ textAlign?: CSSProperties['textAlign'];
9
+ }
10
+ export interface TableRow {
11
+ onClick?: () => void;
12
+ isSelected?: boolean;
13
+ onSelect?: () => void;
14
+ onDeselect?: () => void;
15
+ cells: {
16
+ key: string;
17
+ rawValue: string | number | boolean;
18
+ component?: FC;
19
+ }[];
20
+ }
21
+ export interface TableRowAction extends Pick<ButtonProps, 'label' | 'leftIcon' | 'rightIcon' | 'variant' | 'size' | 'loading' | 'disabled'> {
22
+ id: string;
23
+ onClick: (row: TableRow) => void;
24
+ }
@@ -0,0 +1,21 @@
1
+ import { type FC } from 'react';
2
+ import type { SVG } from '@/types';
3
+ export declare enum ToggleVariant {
4
+ Default = "default",
5
+ SuccessError = "successError"
6
+ }
7
+ export declare enum ToggleSize {
8
+ S = "small",
9
+ L = "large"
10
+ }
11
+ export interface ToggleProps {
12
+ variant?: ToggleVariant;
13
+ size?: ToggleSize;
14
+ value: boolean;
15
+ onChange: (value: boolean) => void;
16
+ disabled?: boolean;
17
+ withIcon?: boolean;
18
+ onIcon?: SVG;
19
+ offIcon?: SVG;
20
+ }
21
+ export declare const Toggle: FC<ToggleProps>;
@@ -5,18 +5,21 @@ export declare const FlexRow: import("styled-components/dist/types").IStyledComp
5
5
  $alignItems?: CSSProperties["alignItems"];
6
6
  $justifyContent?: CSSProperties["justifyContent"];
7
7
  $wrap?: CSSProperties["flexWrap"];
8
+ $padding?: CSSProperties["padding"];
8
9
  }>> & string;
9
10
  export declare const FlexColumn: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
10
11
  $gap?: number;
11
12
  $alignItems?: CSSProperties["alignItems"];
12
13
  $justifyContent?: CSSProperties["justifyContent"];
13
14
  $wrap?: CSSProperties["flexWrap"];
15
+ $padding?: CSSProperties["padding"];
14
16
  }>> & string;
15
- export declare const CenterThis: 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"> & {
17
+ export declare const CenterThis: 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"> & {
16
18
  $gap?: number;
17
19
  $alignItems?: CSSProperties["alignItems"];
18
20
  $justifyContent?: CSSProperties["justifyContent"];
19
21
  $wrap?: CSSProperties["flexWrap"];
22
+ $padding?: CSSProperties["padding"];
20
23
  }, {
21
24
  $width?: CSSProperties["width"];
22
25
  $height?: CSSProperties["height"];
@@ -27,19 +30,21 @@ export declare const ModalBody: import("styled-components/dist/types").IStyledCo
27
30
  $isNotModal?: boolean;
28
31
  $minHeight?: CSSProperties["minHeight"];
29
32
  }>> & string;
30
- export declare const TableContainer: 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"> & {
33
+ export declare const TableContainer: 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"> & {
31
34
  $gap?: number;
32
35
  $alignItems?: CSSProperties["alignItems"];
33
36
  $justifyContent?: CSSProperties["justifyContent"];
34
37
  $wrap?: CSSProperties["flexWrap"];
38
+ $padding?: CSSProperties["padding"];
35
39
  }, {
36
40
  $maxWidth: CSSProperties["maxWidth"];
37
41
  }>> & string;
38
- export declare const TableTitleWrap: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$gap" | "$alignItems" | "$justifyContent" | "$wrap"> & {
42
+ export declare const TableTitleWrap: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$gap" | "$alignItems" | "$justifyContent" | "$wrap" | "$padding"> & {
39
43
  $gap?: number;
40
44
  $alignItems?: CSSProperties["alignItems"];
41
45
  $justifyContent?: CSSProperties["justifyContent"];
42
46
  $wrap?: CSSProperties["flexWrap"];
47
+ $padding?: CSSProperties["padding"];
43
48
  }, never>> & string;
44
49
  export declare const TableWrap: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
45
50
  $maxHeight: CSSProperties["maxHeight"];
@@ -1 +1 @@
1
- export{n as Badge,r as Button,B as ButtonSize,c$ as ButtonTab,d0 as ButtonTabList,i as ButtonVariants,d3 as Checkbox,d5 as CheckboxList,d4 as CheckboxListDirection,d2 as CheckboxSize,f as CliCommand,d as DataCard,D as Drawer,d6 as DropData,d7 as Header,I as IconButton,c2 as IconButtonSize,d8 as Input,d9 as Modal,da as Navbar,db as Note,dd as Radio,df as RadioGroup,de as RadioGroupDirection,dc as RadioSize,S as SectionCard,h as SectionCardActionType,d1 as SectionCardSize,q as Segment,s as StatusCard,k as Table,dg as Tag,t as TextCard,e as Typography,p as TypographySize,dh as TypographyVariants}from"../chunks/ui-components-a8941c5a.js";import"../icons.js";import"react";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"styled-components";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{B as Badge,f as Button,l as ButtonSize,d4 as ButtonTab,d5 as ButtonTabList,g as ButtonVariants,C as Checkbox,d9 as CheckboxList,d8 as CheckboxListDirection,d7 as CheckboxSize,v as CliCommand,t as DataCard,D as Drawer,da as DropData,db as Header,I as IconButton,c7 as IconButtonSize,dc as Input,L as Loader,dd as Modal,de as Navbar,df as Note,dh as Radio,dj as RadioGroup,di as RadioGroupDirection,dg as RadioSize,S as Search,i as SectionCard,k as SectionCardActionType,d6 as SectionCardSize,y as Segment,z as StatusCard,m as Table,dk as Tag,A as TextCard,c as Toggle,d as ToggleSize,dl as ToggleVariant,T as Typography,b as TypographySize,dm as TypographyVariants}from"../chunks/ui-components-eab2149b.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{am as AutocompleteInput,aG as Badge,aJ as Button,a7 as CancelWarning,C as CenterThis,y as Checkbox,j as Code,ad as ConditionDetails,ae as DataCard,w as DataCardFieldTypes,bu as DataCardFields,cP as DataFinger,aM as DataTab,a6 as DeleteWarning,bR as DescribeRow,an as Divider,Z as DocsButton,a5 as Drawer,cR as DrawerFooter,cQ as DrawerHeader,b7 as Dropdown,cS as ErrorBoundary,bg as ExtendArrow,F as FadeLoader,z as FieldError,x as FieldLabel,c as FlexColumn,o as FlexRow,cT as Header,bf as IconButton,b_ as IconGroup,aB as IconTitleBadge,aw as IconWrapped,bN as IconsNav,cU as ImageControlled,G as Input,R as InputList,L as InputTable,aE as InteractiveTable,Q as KeyValueInputsList,aI as LoadingText,ah as Modal,aj as ModalBody,_ as MonitorsCheckboxes,ay as MonitorsIcons,ai as NavigationButtons,N as NoDataFound,ak as NotificationNote,c_ as Overlay,P as PageContent,b2 as Popup,c3 as PopupForm,c8 as ScrollX,aQ as ScrollY,Y as SectionTitle,X as Segment,b3 as SelectionButton,aU as SkeletonLoader,ap as Status,bt as Stepper,cV as TabList,az as TableContainer,aA as TableTitleWrap,aD as TableWrap,bD as Tag,V as Text,$ as TextArea,M as Toggle,c6 as ToggleCodeComponent,ar as Tooltip,aF as TraceLoader,b4 as VerticalScroll,cZ as WarningModal,cW as getLinksFromText,cX as getStrongsFromText,cY as renderText}from"./chunks/ui-components-a8941c5a.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"styled-components";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{at as AutocompleteInput,aM as Badge,aP as Button,ae as CancelWarning,r as CenterThis,M as Checkbox,w as Code,ak as ConditionDetails,al as DataCard,G as DataCardFieldTypes,bA as DataCardFields,cU as DataFinger,aS as DataTab,ad as DeleteWarning,bX as DescribeRow,au as Divider,a4 as DocsButton,ac as Drawer,cW as DrawerFooter,cV as DrawerHeader,bd as Dropdown,cX as ErrorBoundary,bm as ExtendArrow,s as FadeLoader,Q as FieldError,J as FieldLabel,F as FlexColumn,a as FlexRow,cY as Header,bl as IconButton,c4 as IconGroup,aH as IconTitleBadge,aC as IconWrapped,bT as IconsNav,cZ as ImageControlled,U as Input,$ as InputList,Y as InputTable,aK as InteractiveTable,_ as KeyValueInputsList,aO as LoadingText,ao as Modal,aq as ModalBody,a5 as MonitorsCheckboxes,aE as MonitorsIcons,ap as NavigationButtons,N as NoDataFound,ar as NotificationNote,d3 as Overlay,P as PageContent,b8 as Popup,c8 as PopupForm,cd as ScrollX,aW as ScrollY,a3 as SectionTitle,a2 as Segment,b9 as SelectionButton,a_ as SkeletonLoader,aw as Status,bz as Stepper,c_ as TabList,aF as TableContainer,aG as TableTitleWrap,aJ as TableWrap,bJ as Tag,a1 as Text,a6 as TextArea,Z as Toggle,cb as ToggleCodeComponent,e as Tooltip,aL as TraceLoader,ba as VerticalScroll,d2 as WarningModal,c$ as getLinksFromText,d0 as getStrongsFromText,d1 as renderText}from"./chunks/ui-components-eab2149b.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{ab as ACTION_OPTIONS,a4 as BUTTON_TEXTS,be as DEFAULT_DATA_STREAM_NAME,br as DESTINATION_CATEGORIES,b8 as DISPLAY_LANGUAGES,v as DISPLAY_TITLES,al as FORM_ALERTS,bG as INSTRUMENTATION_RULE_OPTIONS,cI as LANGUAGE_OPTIONS,b9 as MONITORS_OPTIONS,ba as STORAGE_KEYS,cJ as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-a8941c5a.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"styled-components";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
1
+ export{ai as ACTION_OPTIONS,ab as BUTTON_TEXTS,bk as DEFAULT_DATA_STREAM_NAME,bx as DESTINATION_CATEGORIES,be as DISPLAY_LANGUAGES,E as DISPLAY_TITLES,as as FORM_ALERTS,bM as INSTRUMENTATION_RULE_OPTIONS,cN as LANGUAGE_OPTIONS,bf as MONITORS_OPTIONS,bg as STORAGE_KEYS,cO as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-eab2149b.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,18 @@
1
+ import { type FC, type Dispatch, type SetStateAction } from 'react';
2
+ import { type Connection } from '@/types';
3
+ import { DrawerProps } from '@/components/_v2';
4
+ interface ConnectionConfigurationsFormData {
5
+ automaticRollout: boolean;
6
+ }
7
+ export type ApplyConfigurationsFunc = (connectionIds: string[], formData: ConnectionConfigurationsFormData) => Promise<void>;
8
+ export interface ConfigDrawerProps {
9
+ isOpen: boolean;
10
+ onClose: DrawerProps['header']['onClose'];
11
+ connections: Connection[];
12
+ selectedConnectionIds: string[];
13
+ setSelectedConnectionIds: Dispatch<SetStateAction<string[]>>;
14
+ onApply: ApplyConfigurationsFunc;
15
+ }
16
+ export declare const CONFIG_DRAWER_WIDTH = "75vw";
17
+ export declare const ConfigDrawer: FC<ConfigDrawerProps>;
18
+ export {};
@@ -0,0 +1,13 @@
1
+ import { type FC } from 'react';
2
+ import { CSSProperties } from 'styled-components';
3
+ import { type Connection } from '@/types';
4
+ import { type ApplyConfigurationsFunc } from './config-drawer';
5
+ export interface CentralConnectionsProps {
6
+ tableRowsMaxHeight: CSSProperties['maxHeight'];
7
+ connections?: Connection[];
8
+ getConnections: () => Promise<Connection[]>;
9
+ onClickConnection: (id: string) => void;
10
+ deleteConnection: (id: string) => Promise<void>;
11
+ applyConfigurations: ApplyConfigurationsFunc;
12
+ }
13
+ export declare const CentralConnections: FC<CentralConnectionsProps>;
@@ -1 +1,2 @@
1
+ export * from './central-connections';
1
2
  export * from './pipeline-collectors';
@@ -1,4 +1,52 @@
1
- import e,{useState as a,useEffect as t,useMemo as l,useCallback as i}from"react";import{T as o,u as s,a as n,g as r,b as d,D as c,C as u,F as g,S as b,c as m,d as p,e as y,I as k,f,h as C,B as v,i as w,j as h,k as L,l as x,m as P,n as R,o as $,p as I,q as M,r as D,N as A,s as N,t as S,O as T,W as z,P as V}from"../chunks/ui-components-a8941c5a.js";import Y,{useTheme as j}from"styled-components";import{PodIcon as O,ChevronUpIcon as U,ChevronDownIcon as E,TerminalIcon as H,YamlIcon as q,VIcon as G,CopyIcon as F,VSquareIcon as W,XSquareIcon as B,PipelineCollectorIcon as K,DownloadIcon as J,RefreshIcon as Q,GatewayIcon as X}from"../icons.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Z=Y.div`
1
+ import e,{useState as a,useMemo as t,useCallback as l,useEffect as o}from"react";import i,{useTheme as n}from"styled-components";import{F as s,u as r,D as c,S as d,a as u,T as p,b as g,B as b,O as m,C as y,c as C,d as h,e as k,L as f,f as w,g as x,h as v,P as $,i as L,j as P,k as I,l as R,m as A,n as S,o as z,p as M,q as D,r as V,s as N,t as O,I as T,v as j,w as Y,x as F,y as H,N as U,z as E,A as q,W as G}from"../chunks/ui-components-eab2149b.js";import{ConnectionsIcon as W,OdigosLogo as B,RefreshIcon as K,SettingsIcon as J,DeleteIcon as Q,VIcon as X,XIcon as Z,PodIcon as _,ChevronUpIcon as ee,ChevronDownIcon as ae,TerminalIcon as te,YamlIcon as le,CopyIcon as oe,VSquareIcon as ie,XSquareIcon as ne,PipelineCollectorIcon as se,DownloadIcon as re,GatewayIcon as ce}from"../icons.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const de="75vw",ue=i.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
+ `,pe=i.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
+ `,ge=i.div`
15
+ display: flex;
16
+ gap: 12px;
17
+ padding: 16px;
18
+ `,be=i(s)`
19
+ width: ${({$width:e})=>e};
20
+ gap: 12px;
21
+ justify-content: space-between;
22
+ `,me=i.div`
23
+ display: flex;
24
+ flex-direction: column;
25
+ padding: 12px;
26
+ width: calc(100% - 24px);
27
+ height: calc(100vh - ${({$isFooterOpen:e})=>e?"300px":"240px"});
28
+ border-radius: ${({$borderRadius:e})=>e};
29
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
30
+ overflow-y: auto;
31
+ overflow-x: hidden;
32
+ `,ye=i.div`
33
+ display: flex;
34
+ align-items: center;
35
+ gap: 12px;
36
+ padding: 8px 16px;
37
+ border-radius: 12px;
38
+ background-color: transparent;
39
+ cursor: pointer;
40
+ &:hover {
41
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
42
+ }
43
+ `,Ce=i.div`
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: flex-end;
47
+ gap: 16px;
48
+ padding: 0 24px;
49
+ `,he=({isOpen:l,onClose:o,connections:i,selectedConnectionIds:s,setSelectedConnectionIds:v,onApply:$})=>{const L=n(),[P,I]=a(""),R=t(()=>i.filter(e=>!P||e.name.toLowerCase().includes(P.toLowerCase())),[i,P]),A=s.length>0,S=e=>{v(a=>a.includes(e)?a.filter(a=>a!==e):[...a,e])},[z,M]=a(!1),{formData:D,handleFormChange:V,resetFormData:N}=r({automaticRollout:!0});return e.createElement(c,{isOpen:l,hideOverlay:!0,width:de,header:{icon:W,title:"Cluster Configuration",onClose:o}},e.createElement(ue,null,e.createElement(pe,null,e.createElement(d,{value:P,onChange:I})),e.createElement(ge,null,e.createElement(be,{$width:"40%"},e.createElement(u,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(u,{$gap:8},e.createElement(p,{size:g.XS},"Clusters"),e.createElement(b,{label:i.length,status:m.Unknown})),e.createElement(u,{$gap:8},e.createElement(p,{size:g.XXXS,color:L.v2.colors.silver[200]},"Selected"),e.createElement(b,{label:`${s.length}/${i.length}`,status:m.Unknown}))),e.createElement(me,{$isFooterOpen:A,$borderRadius:"16px 0 0 16px"},R.map(a=>e.createElement(ye,{key:a.id,onClick:()=>S(a.id)},e.createElement(y,{value:s.includes(a.id),onChange:()=>S(a.id)}),e.createElement(p,{size:g.XS},a.name))))),e.createElement(be,{$width:"60%"},e.createElement(u,{$padding:"2px 12px"},e.createElement(p,{size:g.XS},"Configurations")),e.createElement(me,{$isFooterOpen:A,$borderRadius:"0 16px 16px 0"},e.createElement(u,{$gap:12},e.createElement(p,{size:g.XS},"Automatic Rollout"),e.createElement(C,{size:h.S,value:D.automaticRollout,onChange:e=>V("automaticRollout",e)}),e.createElement(k,{text:"Automatic Rollout",withIcon:!0})))))),A&&e.createElement(Ce,null,z&&e.createElement(f,{label:"Applying configurations...",icon:B,withGradient:!0,typographyProps:{size:g.XXS}}),e.createElement("div",{style:{width:"150px"}},e.createElement(w,{variant:x.Secondary,label:"Cancel",fullWidth:!0,onClick:()=>{N(),v([])}})),e.createElement("div",{style:{width:"150px"}},e.createElement(w,{variant:x.Primary,label:"Apply",fullWidth:!0,onClick:async()=>{M(!0),await $(s,D),M(!1),o()}}))))};var ke;!function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(ke||(ke={}));const fe=[{key:ke.Name,label:"Name",sortable:!0},{key:ke.Type,label:"Type",sortable:!0,textAlign:"right"},{key:ke.Status,label:"Status",sortable:!0},{key:ke.OdigosVersion,label:"Odigos Version",sortable:!0},{key:ke.ConnectedSince,label:"Connected Since",sortable:!0},{key:ke.LastActivity,label:"Last Activity",sortable:!0}],we=({tableRowsMaxHeight:i,connections:n,getConnections:s,onClickConnection:r,deleteConnection:c,applyConfigurations:d})=>{const{formatTimeAgo:u}=v(),[p,g]=a(!1),[y,C]=a(n||[]),[h,k]=a(""),f=l(async()=>{try{g(!0),C(await s()??[])}catch(e){}finally{g(!1)}},[]);o(()=>{y.length||f()},[y.length,f]);const[w,z]=a([]),[M,D]=a(!1),V=t(()=>y.map(a=>({onClick:()=>r(a.id),isSelected:w.includes(a.id),onSelect:()=>z(e=>[...e,a.id]),onDeselect:()=>z(e=>e.filter(e=>e!==a.id)),cells:[{key:ke.Id,rawValue:a.id},{key:ke.Name,rawValue:a.name},{key:ke.Type,rawValue:a.type},{key:ke.Status,rawValue:a.status,component:()=>(a=>{const t=a===S.Success?"Connection live":"Connection lost",l=a===S.Success?X:Z;return e.createElement(b,{status:a,label:t,leftIcon:l})})(a.status)},{key:ke.OdigosVersion,rawValue:a.odigosVersion},{key:ke.ConnectedSince,rawValue:a.connectedAt?u(a.connectedAt):"-"},{key:ke.LastActivity,rawValue:a.lastSeenAt?u(a.lastSeenAt):"-"}]})),[y,w]);return e.createElement($,null,e.createElement(L,{icon:W,title:"Connections",badge:{label:y.length.toString(),status:m.Unknown},search:{placeholder:"Search by cluster name",value:h,onChange:e=>k(e)},actions:[{id:P(),type:I.Button,buttonProps:{variant:x.Secondary,size:R.S,label:"",leftIcon:K,onClick:()=>f(),disabled:p}},{id:P(),type:I.Button,buttonProps:{variant:x.Primary,size:R.S,label:"Configurations",rightIcon:J,onClick:()=>D(!0)}}]},e.createElement(A,{maxHeight:i,isLoading:p,withCheckboxes:!0,columns:fe,rows:V,rowActionsPushRightPosition:M?`calc(${de} - 24px)`:void 0,rowActions:[{id:P(),label:"",leftIcon:J,onClick:({cells:e})=>{const a=e.find(e=>e.key===ke.Id)?.rawValue;a&&(z([a.toString()]),D(!0))},variant:x.Secondary,size:R.S},{id:P(),label:"",leftIcon:Q,onClick:async({cells:e})=>{const a=e.find(e=>e.key===ke.Id)?.rawValue;a&&(await c(a.toString()),f())},variant:x.Secondary,size:R.S}]}),e.createElement(he,{isOpen:M,onClose:()=>{z([]),D(!1)},connections:y,selectedConnectionIds:w,setSelectedConnectionIds:z,onApply:d})))},xe=i.div`
2
50
  display: flex;
3
51
  align-items: center;
4
52
  justify-content: space-between;
@@ -10,10 +58,10 @@ import e,{useState as a,useEffect as t,useMemo as l,useCallback as i}from"react"
10
58
  &:hover {
11
59
  background: ${({theme:e})=>e.v2.colors.silver[700]};
12
60
  }
13
- `,_=Y.div`
14
- animation-name: ${o.animations.fade.in};
15
- `,ee=({pod:i,getExtendedPodInfo:o,onClose:L})=>{const{formatTimeAgo:x}=s(),{clickCopy:P,isCopied:R}=n(),[$,I]=a(null),[M,D]=a(!1);t(()=>{i?o(i.namespace,i.name).then(e=>I(e??null)):(I(null),D(!1))},[i]);const A=l(()=>[{id:r(),title:"Node",label:$?.node??"-",withCopy:!0},{id:r(),title:"Status",badge:{status:d($?.status),label:$?.status??"-"}}],[$]),N=l(()=>$?.containers?.map(e=>({id:r(),items:[{id:r(),title:"Container",label:e.name??"-"},{id:r(),title:"Status",badge:{status:d(e.status),label:e.status??"-"},label:e.startedAt?`(since ${x(e.startedAt)})`:""},{id:r(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:r(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:r(),title:"Restarts",label:e.restarts.toString()},{id:r(),title:"State Reason",label:e.stateReason??"-"},{id:r(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:r(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[$]);return e.createElement(c,{isOpen:!!i,header:{icon:O,title:"Pod Information",onClose:L}},$?null:e.createElement(u,null,e.createElement(g,null)),$?e.createElement(e.Fragment,null,e.createElement(b,{icon:O,title:$.name,withCopyTitle:!0},e.createElement(m,{$gap:24},e.createElement(p,{cellsPerRow:2,items:A}),N.length>0&&e.createElement(m,{$gap:12},e.createElement(Z,{onClick:()=>D(e=>!e)},e.createElement(y,null,"Containers Overview"),e.createElement(k,{icon:M?U:E})),M&&N.map(({id:a,items:t})=>e.createElement(_,{key:a},e.createElement(p,{cellsPerRow:2,items:t})))))),e.createElement(b,{icon:H,title:"Kubectl Commands"},e.createElement(m,{$gap:12},e.createElement(f,{value:`kubectl get pod ${$.name} -n ${$.namespace} -o yaml`}),e.createElement(f,{value:`kubectl describe pod ${$.name} -n ${$.namespace}`}),e.createElement(f,{value:`kubectl logs ${$.name} -n ${$.namespace}`}))),e.createElement(b,{icon:q,title:"YAML",actions:[{id:r(),type:C.Button,buttonProps:{label:"",leftIcon:R?G:F,onClick:()=>P($.manifestYAML),disabled:R,size:v.S,variant:w.Secondary}}]},e.createElement("div",{style:{padding:"0 12px"}},e.createElement(h,{code:$.manifestYAML,language:"yaml",theme:"duotoneDark"})))):null)};var ae;!function(e){e.PodName="podName",e.Ready="ready",e.Started="started",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(ae||(ae={}));const te=[{key:ae.PodName,label:"Pod Name",sortable:!0},{key:ae.Ready,label:"Ready",sortable:!0,textAlign:"right"},{key:ae.Started,label:"Started",sortable:!0,textAlign:"right"},{key:ae.Status,label:"Status",sortable:!0},{key:ae.Restarts,label:"Restarts",sortable:!0,textAlign:"right"},{key:ae.NodeName,label:"Node Name",sortable:!0},{key:ae.Age,label:"Age",sortable:!0,textAlign:"right"},{key:ae.DockerImage,label:"Docker Image",sortable:!0,textAlign:"right"}],le=({isLoading:t,tableRowsMaxHeight:i,pods:o,getExtendedPodInfo:n})=>{const r=j(),{formatTimeAgo:c}=s(),[u,g]=a(null),m=l(()=>{const a=a=>a?e.createElement(W,{fill:x(r,P.Success,"500"),size:20}):e.createElement(B,{fill:x(r,P.Error,"500"),size:20});return o.map(t=>({onClick:()=>g(t),cells:[{key:ae.PodName,rawValue:t.name},{key:ae.Ready,rawValue:t.ready,component:()=>a(t.ready)},{key:ae.Started,rawValue:t.started,component:()=>a(t.started)},{key:ae.Status,rawValue:t.status,component:()=>{return a=t.status,e.createElement(R,{status:d(a),label:a});var a}},{key:ae.Restarts,rawValue:t.restartsCount.toString()},{key:ae.NodeName,rawValue:t.nodeName},{key:ae.Age,rawValue:c(t.creationTimestamp)},{key:ae.DockerImage,rawValue:t.image}]}))},[o,r]);return e.createElement(b,{icon:O,title:"Pods"},e.createElement(L,{maxHeight:i,isLoading:t,columns:te,rows:m}),e.createElement(ee,{pod:u,getExtendedPodInfo:n,onClose:()=>g(null)}))};var ie;!function(e){e.Gateway="gateway",e.Node="node"}(ie||(ie={}));const oe=[{value:ie.Gateway,label:"Gateway"},{value:ie.Node,label:"Node Collector"}],se=Y.div`
61
+ `,ve=i.div`
62
+ animation-name: ${z.animations.fade.in};
63
+ `,$e=({pod:l,getExtendedPodInfo:i,onClose:n})=>{const{formatTimeAgo:r}=v(),{clickCopy:d,isCopied:u}=M(),[g,b]=a(null),[m,y]=a(!1);o(()=>{l?i(l.namespace,l.name).then(e=>b(e??null)):(b(null),y(!1))},[l]);const C=t(()=>[{id:P(),title:"Node",label:g?.node??"-",withCopy:!0},{id:P(),title:"Status",badge:{status:D(g?.status),label:g?.status??"-"}}],[g]),h=t(()=>g?.containers?.map(e=>({id:P(),items:[{id:P(),title:"Container",label:e.name??"-"},{id:P(),title:"Status",badge:{status:D(e.status),label:e.status??"-"},label:e.startedAt?`(since ${r(e.startedAt)})`:""},{id:P(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:P(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:P(),title:"Restarts",label:e.restarts.toString()},{id:P(),title:"State Reason",label:e.stateReason??"-"},{id:P(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:P(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[g]);return e.createElement(c,{isOpen:!!l,header:{icon:_,title:"Pod Information",onClose:n}},g?null:e.createElement(V,null,e.createElement(N,null)),g?e.createElement(e.Fragment,null,e.createElement(L,{icon:_,title:g.name,withCopyTitle:!0},e.createElement(s,{$gap:24},e.createElement(O,{cellsPerRow:2,items:C}),h.length>0&&e.createElement(s,{$gap:12},e.createElement(xe,{onClick:()=>y(e=>!e)},e.createElement(p,null,"Containers Overview"),e.createElement(T,{icon:m?ee:ae})),m&&h.map(({id:a,items:t})=>e.createElement(ve,{key:a},e.createElement(O,{cellsPerRow:2,items:t})))))),e.createElement(L,{icon:te,title:"Kubectl Commands"},e.createElement(s,{$gap:12},e.createElement(j,{value:`kubectl get pod ${g.name} -n ${g.namespace} -o yaml`}),e.createElement(j,{value:`kubectl describe pod ${g.name} -n ${g.namespace}`}),e.createElement(j,{value:`kubectl logs ${g.name} -n ${g.namespace}`}))),e.createElement(L,{icon:le,title:"YAML",actions:[{id:P(),type:I.Button,buttonProps:{label:"",leftIcon:u?X:oe,onClick:()=>d(g.manifestYAML),disabled:u,size:R.S,variant:x.Secondary}}]},e.createElement("div",{style:{padding:"0 12px"}},e.createElement(Y,{code:g.manifestYAML,language:"yaml",theme:"duotoneDark"})))):null)};var Le;!function(e){e.PodName="podName",e.Ready="ready",e.Started="started",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(Le||(Le={}));const Pe=[{key:Le.PodName,label:"Pod Name",sortable:!0},{key:Le.Ready,label:"Ready",sortable:!0,textAlign:"right"},{key:Le.Started,label:"Started",sortable:!0,textAlign:"right"},{key:Le.Status,label:"Status",sortable:!0},{key:Le.Restarts,label:"Restarts",sortable:!0,textAlign:"right"},{key:Le.NodeName,label:"Node Name",sortable:!0},{key:Le.Age,label:"Age",sortable:!0,textAlign:"right"},{key:Le.DockerImage,label:"Docker Image",sortable:!0,textAlign:"right"}],Ie=({isLoading:l,tableRowsMaxHeight:o,pods:i,getExtendedPodInfo:s})=>{const r=n(),{formatTimeAgo:c}=v(),[d,u]=a(null),p=t(()=>{const a=a=>a?e.createElement(ie,{fill:F(r,S.Success,"500"),size:20}):e.createElement(ne,{fill:F(r,S.Error,"500"),size:20});return i.map(t=>({onClick:()=>u(t),cells:[{key:Le.PodName,rawValue:t.name},{key:Le.Ready,rawValue:t.ready,component:()=>a(t.ready)},{key:Le.Started,rawValue:t.started,component:()=>a(t.started)},{key:Le.Status,rawValue:t.status,component:()=>{return a=t.status,e.createElement(b,{status:D(a),label:a});var a}},{key:Le.Restarts,rawValue:t.restartsCount.toString()},{key:Le.NodeName,rawValue:t.nodeName},{key:Le.Age,rawValue:c(t.creationTimestamp)},{key:Le.DockerImage,rawValue:t.image}]}))},[i,r]);return e.createElement(L,{icon:_,title:"Pods"},e.createElement(A,{maxHeight:o,isLoading:l,columns:Pe,rows:p}),e.createElement($e,{pod:d,getExtendedPodInfo:s,onClose:()=>u(null)}))};var Re;!function(e){e.Gateway="gateway",e.Node="node"}(Re||(Re={}));const Ae=[{value:Re.Gateway,label:"Gateway"},{value:Re.Node,label:"Node Collector"}],Se=i.div`
16
64
  display: flex;
17
65
  align-items: center;
18
66
  justify-content: space-between;
19
- `,ne=({selectedTab:a,setSelectedTab:t,onClickDownloadDiagnose:l,onClickRefresh:i,isLoading:o})=>e.createElement(se,null,e.createElement($,{$gap:12},e.createElement($,{$gap:8},e.createElement(K,{size:32}),e.createElement(y,{size:I.M,weight:500},"Pipeline Collectors")),e.createElement(M,{options:oe,selected:a,setSelected:t})),e.createElement($,{$gap:8},l&&e.createElement(D,{label:"Download Diagnose",leftIcon:J,size:v.S,variant:w.Text,onClick:l}),i&&e.createElement(D,{label:"Refresh",leftIcon:Q,size:v.S,variant:w.Text,onClick:i,loading:o}))),re=({isOpen:a,onClose:t,title:l,yaml:i})=>{const{clickCopy:o,isCopied:s}=n();return e.createElement(c,{isOpen:a,header:{icon:X,title:l,onClose:t}},i?e.createElement(b,{icon:q,title:"YAML",actions:[{id:r(),type:C.Button,buttonProps:{label:"",leftIcon:s?G:F,onClick:()=>o(i),disabled:s,size:v.S,variant:w.Secondary}}]},e.createElement("div",{style:{padding:"0 12px"}},e.createElement(h,{code:i,language:"yaml",theme:"duotoneDark"}))):e.createElement(A,{title:"No YAML found",subTitle:"The YAML for this resource is not available"}))};var de;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(de||(de={}));const ce=({icon:t,title:l,badge:i,statusCard:o,textCards:s,manifestYaml:n,configMapYaml:d})=>{const[c,u]=a(null);return e.createElement(b,{icon:t,title:l,badge:i,actions:[{id:r(),type:C.ButtonDropData,buttonProps:{variant:w.Secondary,size:v.S,label:"View YAML",onClick:e=>u(e)},dropDataItems:[{id:de.ManifestYaml,label:l,icon:q},{id:de.ConfigMapYaml,label:"ConfigMap",icon:q}]}]},e.createElement($,{$gap:16},e.createElement(N,{...o}),s.map(a=>e.createElement(S,{key:a.title,...a}))),e.createElement(re,{isOpen:c===de.ManifestYaml,onClose:()=>u(null),title:l,yaml:n}),e.createElement(re,{isOpen:c===de.ConfigMapYaml,onClose:()=>u(null),title:"ConfigMap",yaml:d}))},ue=e=>{switch(e){case z.Healthy:return"All desired replicas are updated, available, and ready";case z.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case z.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case z.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case z.Down:return"No available replicas";case z.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},ge=({tableRowsMaxHeight:o,getGatewayInfo:n,getGatewayPods:r,getNodeCollectorInfo:c,getNodeCollectorPods:u,getExtendedPodInfo:g})=>{const{formatTimeAgo:b}=s(),[m,p]=a(!1),[y,k]=a(ie.Gateway),[f,C]=a(null),[v,w]=a([]),[h,L]=a(null),[x,R]=a([]),$=i(async()=>{switch(p(!0),y){case ie.Gateway:C(await n()??null),w(await r()??[]);break;case ie.Node:L(await c()??null),R(await u()??[])}p(!1)},[y]);t(()=>{$().catch(e=>{})},[$]);const I=l(()=>(e=>{switch(e){case ie.Gateway:return"Deployment";case ie.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(y),[y]),M=l(()=>((e,a,t,l)=>{const i={status:T.Disabled,label:"No rollouts yet"};let o=!1,s=null;switch(e){case ie.Gateway:o=a?.rolloutInProgress??!1,s=a?.lastRolloutAt??null;break;case ie.Node:o=t?.rolloutInProgress??!1,s=t?.lastRolloutAt??null;break;default:return i}return o?{status:P.Info,label:"Rollout in progress",rightIcon:Q,useSecondaryTone:!0}:s?{status:T.Disabled,label:`Last Rollout: ${l(s)}`}:i})(y,f,h,b),[f,h,y,b]),D=l(()=>((e,a,t,l)=>{let i=l?P.Info:T.Unknown,o=l?"Loading":z.Unknown,s=l?"Fetching data...":ue(z.Unknown);switch(e){case ie.Gateway:i=a?.status?d(a?.status):i,o=a?.status??o,s=a?.status?ue(a.status):s;break;case ie.Node:i=t?.status?d(t?.status):i,o=t?.status??o,s=t?.status?ue(t.status):s}return{status:i,title:o,description:s}})(y,f,h,m),[f,h,y,m]),A=l(()=>((e,a,t,l)=>{switch(e){case ie.Gateway:return[{title:"HPA Spec (Replicas)",cells:[{label:"Min.",value:a?.hpa?.min.toString()??"-",isLoading:l},{label:"Max.",value:a?.hpa?.max.toString()??"-",isLoading:l},{label:"Current",value:a?.hpa?.current.toString()??"-",isLoading:l},{label:"Desired",value:a?.hpa?.desired.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:a?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:a?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:a?.imageVersion??"-",isLoading:l}]}];case ie.Node:return[{title:"Nodes",cells:[{label:"Desired",value:t?.nodes?.desired.toString()??"-",isLoading:l},{label:"Ready",value:t?.nodes?.ready.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:t?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:t?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:t?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:t?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:t?.imageVersion??"-",isLoading:l}]}];default:return[]}})(y,f,h,m),[f,h,y,m]),N=l(()=>(y===ie.Gateway?f?.manifestYAML:h?.manifestYAML)??"",[f,h,y]),S=l(()=>(y===ie.Gateway?f?.configMapYAML:h?.configMapYAML)??"",[f,h,y]),Y=l(()=>y===ie.Gateway?v:x,[v,x,y]);return e.createElement(V,null,e.createElement(ne,{isLoading:m,selectedTab:y,setSelectedTab:k,onClickDownloadDiagnose:void 0,onClickRefresh:$}),e.createElement(ce,{icon:X,title:I,badge:M,statusCard:D,textCards:A,manifestYaml:N,configMapYaml:S}),e.createElement(le,{isLoading:m,tableRowsMaxHeight:o,pods:Y,getExtendedPodInfo:g}))};export{ge as PipelineCollectors};
67
+ `,ze=({selectedTab:a,setSelectedTab:t,onClickDownloadDiagnose:l,onClickRefresh:o,isLoading:i})=>e.createElement(Se,null,e.createElement(u,{$gap:12},e.createElement(u,{$gap:8},e.createElement(se,{size:32}),e.createElement(p,{size:g.M,weight:500},"Pipeline Collectors")),e.createElement(H,{options:Ae,selected:a,setSelected:t})),e.createElement(u,{$gap:8},l&&e.createElement(w,{label:"Download Diagnose",leftIcon:re,size:R.S,variant:x.Text,onClick:l}),o&&e.createElement(w,{label:"Refresh",leftIcon:K,size:R.S,variant:x.Text,onClick:o,loading:i}))),Me=({isOpen:a,onClose:t,title:l,yaml:o})=>{const{clickCopy:i,isCopied:n}=M();return e.createElement(c,{isOpen:a,header:{icon:ce,title:l,onClose:t}},o?e.createElement(L,{icon:le,title:"YAML",actions:[{id:P(),type:I.Button,buttonProps:{label:"",leftIcon:n?X:oe,onClick:()=>i(o),disabled:n,size:R.S,variant:x.Secondary}}]},e.createElement("div",{style:{padding:"0 12px"}},e.createElement(Y,{code:o,language:"yaml",theme:"duotoneDark"}))):e.createElement(U,{title:"No YAML found",subTitle:"The YAML for this resource is not available"}))};var De;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(De||(De={}));const Ve=({icon:t,title:l,badge:o,statusCard:i,textCards:n,manifestYaml:s,configMapYaml:r})=>{const[c,d]=a(null);return e.createElement(L,{icon:t,title:l,badge:o,actions:[{id:P(),type:I.ButtonDropData,buttonProps:{variant:x.Secondary,size:R.S,label:"View YAML",onClick:e=>d(e)},dropDataItems:[{id:De.ManifestYaml,label:l,icon:le},{id:De.ConfigMapYaml,label:"ConfigMap",icon:le}]}]},e.createElement(u,{$gap:16},e.createElement(E,{...i}),n.map(a=>e.createElement(q,{key:a.title,...a}))),e.createElement(Me,{isOpen:c===De.ManifestYaml,onClose:()=>d(null),title:l,yaml:s}),e.createElement(Me,{isOpen:c===De.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:r}))},Ne=e=>{switch(e){case G.Healthy:return"All desired replicas are updated, available, and ready";case G.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case G.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case G.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case G.Down:return"No available replicas";case G.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},Oe=({tableRowsMaxHeight:i,getGatewayInfo:n,getGatewayPods:s,getNodeCollectorInfo:r,getNodeCollectorPods:c,getExtendedPodInfo:d})=>{const{formatTimeAgo:u}=v(),[p,g]=a(!1),[b,y]=a(Re.Gateway),[C,h]=a(null),[k,f]=a([]),[w,x]=a(null),[L,P]=a([]),I=l(async()=>{g(!0);try{switch(b){case Re.Gateway:h(await n()??null),f(await s()??[]);break;case Re.Node:x(await r()??null),P(await c()??[])}}catch(e){}g(!1)},[b]);o(()=>{I()},[I]);const R=t(()=>(e=>{switch(e){case Re.Gateway:return"Deployment";case Re.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(b),[b]),A=t(()=>((e,a,t,l)=>{const o={status:m.Disabled,label:"No rollouts yet"};let i=!1,n=null;switch(e){case Re.Gateway:i=a?.rolloutInProgress??!1,n=a?.lastRolloutAt??null;break;case Re.Node:i=t?.rolloutInProgress??!1,n=t?.lastRolloutAt??null;break;default:return o}return i?{status:S.Info,label:"Rollout in progress",rightIcon:K,useSecondaryTone:!0}:n?{status:m.Disabled,label:`Last Rollout: ${l(n)}`}:o})(b,C,w,u),[C,w,b,u]),z=t(()=>((e,a,t,l)=>{let o=l?S.Info:m.Unknown,i=l?"Loading":G.Unknown,n=l?"Fetching data...":Ne(G.Unknown);switch(e){case Re.Gateway:o=a?.status?D(a?.status):o,i=a?.status??i,n=a?.status?Ne(a.status):n;break;case Re.Node:o=t?.status?D(t?.status):o,i=t?.status??i,n=t?.status?Ne(t.status):n}return{status:o,title:i,description:n}})(b,C,w,p),[C,w,b,p]),M=t(()=>((e,a,t,l)=>{switch(e){case Re.Gateway:return[{title:"HPA Spec (Replicas)",cells:[{label:"Min.",value:a?.hpa?.min.toString()??"-",isLoading:l},{label:"Max.",value:a?.hpa?.max.toString()??"-",isLoading:l},{label:"Current",value:a?.hpa?.current.toString()??"-",isLoading:l},{label:"Desired",value:a?.hpa?.desired.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:a?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:a?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:a?.imageVersion??"-",isLoading:l}]}];case Re.Node:return[{title:"Nodes",cells:[{label:"Desired",value:t?.nodes?.desired.toString()??"-",isLoading:l},{label:"Ready",value:t?.nodes?.ready.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:t?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:t?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:t?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:t?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:t?.imageVersion??"-",isLoading:l}]}];default:return[]}})(b,C,w,p),[C,w,b,p]),V=t(()=>(b===Re.Gateway?C?.manifestYAML:w?.manifestYAML)??"",[C,w,b]),N=t(()=>(b===Re.Gateway?C?.configMapYAML:w?.configMapYAML)??"",[C,w,b]),O=t(()=>b===Re.Gateway?k:L,[k,L,b]);return e.createElement($,null,e.createElement(ze,{isLoading:p,selectedTab:b,setSelectedTab:y,onClickDownloadDiagnose:void 0,onClickRefresh:I}),e.createElement(Ve,{icon:ce,title:R,badge:A,statusCard:z,textCards:M,manifestYaml:V,configMapYaml:N}),e.createElement(Ie,{isLoading:p,tableRowsMaxHeight:i,pods:O,getExtendedPodInfo:d}))};export{we as CentralConnections,Oe as PipelineCollectors};