@odigos/ui-kit 0.0.163 → 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.
- package/CHANGELOG.md +14 -0
- package/lib/chunks/ui-components-76a424df.js +2266 -0
- package/lib/components/_v2/badge/index.d.ts +5 -1
- package/lib/components/_v2/cards/section-card/index.d.ts +3 -20
- package/lib/components/_v2/drop-data/index.d.ts +8 -3
- package/lib/components/_v2/hover-actions/index.d.ts +1 -1
- package/lib/components/_v2/index.d.ts +1 -0
- package/lib/components/_v2/island/index.d.ts +9 -0
- package/lib/components/_v2/table/index.d.ts +1 -1
- package/lib/components/_v2/table/table-rows/index.d.ts +1 -1
- package/lib/components/_v2/table/types.d.ts +2 -1
- package/lib/components/no-data-found/index.d.ts +2 -3
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/central-connections/index.d.ts +7 -5
- package/lib/containers/_v2/central-connections/source-drawer/index.d.ts +4 -7
- package/lib/containers/_v2/central-connections/source-drawer/namespaces-column/index.d.ts +14 -0
- package/lib/containers/_v2/central-connections/source-drawer/styled.d.ts +17 -0
- package/lib/containers/_v2/central-connections/source-drawer/types.d.ts +21 -0
- package/lib/containers/_v2/central-connections/source-drawer/workloads-column/index.d.ts +14 -0
- package/lib/containers/data-flow/column/head.d.ts +1 -0
- package/lib/containers/data-flow/column/index.d.ts +1 -0
- package/lib/containers/data-flow/index.d.ts +4 -0
- package/lib/containers/v2.js +37 -36
- package/lib/containers.js +47 -47
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/actions/index.d.ts +20 -0
- package/lib/snippets/_v2/index.d.ts +2 -0
- package/lib/snippets/_v2/rich-title/index.d.ts +11 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/snapshot/index.d.ts +2 -1
- package/lib/types/sources/index.d.ts +13 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -24
- package/package.json +1 -1
- package/lib/chunks/index-53f81cb1.js +0 -3
- package/lib/chunks/index-64bb5a64.js +0 -9
- 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 {
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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>;
|
|
@@ -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
|
-
|
|
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>;
|
package/lib/components/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{B as Badge,
|
|
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{
|
|
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{
|
|
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 }
|
|
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
|
|
13
|
-
applyConfigurations
|
|
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
|
-
|
|
7
|
-
snapshots: AllClusterSnapshots | null;
|
|
6
|
+
snapshots: AllClusterSnapshots;
|
|
8
7
|
selectedConnectionIds: string[];
|
|
9
8
|
setSelectedConnectionIds: Dispatch<SetStateAction<string[]>>;
|
|
10
|
-
|
|
11
|
-
error?: string;
|
|
12
|
-
}>;
|
|
9
|
+
persistSources: PersistSourcesFunc;
|
|
13
10
|
}
|
|
14
|
-
export declare const SOURCE_DRAWER_WIDTH = "
|
|
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>;
|
|
@@ -3,6 +3,10 @@ import { type Metrics } from '@/types';
|
|
|
3
3
|
interface DataFlowProps {
|
|
4
4
|
height: CSSProperties['height'];
|
|
5
5
|
metrics: Metrics;
|
|
6
|
+
refetchSources: () => void;
|
|
7
|
+
refetchDestinations: () => void;
|
|
8
|
+
refetchActions: () => void;
|
|
9
|
+
refetchInstrumentationRules: () => void;
|
|
6
10
|
}
|
|
7
11
|
declare const DataFlow: React.FC<DataFlowProps>;
|
|
8
12
|
export { DataFlow, type DataFlowProps };
|
package/lib/containers/v2.js
CHANGED
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
import e,{
|
|
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
|
-
|
|
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
|
-
`,
|
|
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[
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
64
|
+
`,Oe=o.div`
|
|
64
65
|
display: flex;
|
|
65
66
|
gap: 12px;
|
|
66
67
|
padding: 16px;
|
|
67
|
-
`,
|
|
68
|
+
`,We=o(i)`
|
|
68
69
|
width: ${({$width:e})=>e};
|
|
69
70
|
gap: 12px;
|
|
70
71
|
justify-content: space-between;
|
|
71
|
-
`,
|
|
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
|
-
`,
|
|
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[
|
|
92
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
92
93
|
}
|
|
93
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
112
|
-
animation-name: ${
|
|
113
|
-
`,
|
|
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
|
-
`,
|
|
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};
|