@odigos/ui-kit 0.0.167 → 0.0.169

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.
@@ -11,5 +11,6 @@ export interface BadgeProps {
11
11
  textSize?: TypographySize;
12
12
  textColor?: CSSProperties['color'];
13
13
  backgroundColor?: CSSProperties['backgroundColor'];
14
+ minWidth?: CSSProperties['minWidth'];
14
15
  }
15
16
  export declare const Badge: FC<BadgeProps>;
@@ -5,5 +5,6 @@ export interface HeaderProps {
5
5
  title: string;
6
6
  actions?: [];
7
7
  onClose: () => void;
8
+ onCloseDisabled?: boolean;
8
9
  }
9
10
  export declare const Header: FC<HeaderProps>;
@@ -3,6 +3,7 @@ import { type ButtonProps } from '../button';
3
3
  export interface HoverAction extends Pick<ButtonProps, 'label' | 'leftIcon' | 'rightIcon' | 'loading' | 'disabled'> {
4
4
  id: string;
5
5
  onClick: () => void;
6
+ tooltip?: string;
6
7
  }
7
8
  export interface HoverActionsProps {
8
9
  isOpen: boolean;
@@ -1,12 +1,18 @@
1
- import { type FC } from 'react';
1
+ import { CSSProperties, type FC } from 'react';
2
2
  import type { SVG } from '@/types';
3
- import { type TypographyProps } from '../typography';
3
+ import { TypographySize } from '../typography';
4
4
  export interface LoaderProps {
5
- label?: string;
6
5
  icon?: SVG;
6
+ title?: string;
7
+ titleColor?: CSSProperties['color'];
8
+ titleSize?: TypographySize;
9
+ subTitle?: string;
10
+ subTitleColor?: CSSProperties['color'];
11
+ subTitleSize?: TypographySize;
7
12
  withGradient?: boolean;
8
- textColor?: string;
9
- stripColor?: string;
10
- typographyProps?: Omit<TypographyProps, 'children'>;
13
+ gradientColor?: string;
14
+ withSpinner?: boolean;
15
+ prettySpinner?: boolean;
16
+ percentage?: number;
11
17
  }
12
18
  export declare const Loader: FC<LoaderProps>;
@@ -0,0 +1,5 @@
1
+ import { type FC } from 'react';
2
+ export interface SpinnerProps {
3
+ percentage?: number;
4
+ }
5
+ export declare const Spinner: FC<SpinnerProps>;
@@ -0,0 +1 @@
1
+ export declare const createAnimation: (loaderName: string, frames: string, suffix: string) => string;
@@ -0,0 +1,22 @@
1
+ interface LengthObject {
2
+ value: number;
3
+ unit: string;
4
+ }
5
+ /**
6
+ * If size is a number, append px to the value as default unit.
7
+ * If size is a string, validate against list of valid units.
8
+ * If unit is valid, return size as is.
9
+ * If unit is invalid, console warn issue, replace with px as the unit.
10
+ *
11
+ * @param {(number | string)} size
12
+ * @return {LengthObject} LengthObject
13
+ */
14
+ export declare function parseLengthAndUnit(size: number | string): LengthObject;
15
+ /**
16
+ * Take value as an input and return valid css value
17
+ *
18
+ * @param {(number | string)} value
19
+ * @return {string} valid css value
20
+ */
21
+ export declare function cssValue(value: number | string): string;
22
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type CSSProperties, type DetailedHTMLProps, type FC, type HTMLAttributes } from 'react';
2
+ interface SpinnerOldProps extends DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> {
3
+ loading?: boolean;
4
+ color?: string;
5
+ scale?: number;
6
+ speedMultiplier?: number;
7
+ cssOverride?: CSSProperties;
8
+ }
9
+ declare const SpinnerOld: FC<SpinnerOldProps>;
10
+ export { SpinnerOld, type SpinnerOldProps };
@@ -1 +1 @@
1
- export{B as Badge,j as Button,r as ButtonSize,dn as ButtonTab,dp as ButtonTabList,k as ButtonVariants,C as Checkbox,ds as CheckboxList,dr as CheckboxSize,J as CliCommand,G as DataCard,g as Drawer,du as DropData,w as DropDataAlignX,dt as DropDataAlignY,dv as Header,c5 as HoverActions,H as IconButton,ch as IconButtonSize,dw as Input,I as Island,L as Loader,dx as Modal,dy as Navbar,i as Note,dA as Radio,dB as RadioGroup,dz as RadioSize,h as Search,p as SectionCard,dq as SectionCardSize,K as Segment,dC as SegmentSize,Q as StatusCard,s as Table,t as TableVariant,dD as Tag,U as TextCard,d as Toggle,dF as ToggleLabelAlign,dG as ToggleList,e as ToggleSize,dE as ToggleVariant,T as Typography,b as TypographySize,dH as TypographyVariants,dI as WarningModal}from"../chunks/ui-components-548ceb33.js";import"../icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"../chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
1
+ export{B as Badge,m as Button,w as ButtonSize,dq as ButtonTab,dr as ButtonTabList,n as ButtonVariants,C as Checkbox,du as CheckboxList,dt as CheckboxSize,Q as CliCommand,K as DataCard,i as Drawer,dw as DropData,G as DropDataAlignX,dv as DropDataAlignY,dx as Header,c7 as HoverActions,M as IconButton,cj as IconButtonSize,dy as Input,I as Island,L as Loader,dz as Modal,dA as Navbar,l as Note,dC as Radio,dD as RadioGroup,dB as RadioSize,k as Search,t as SectionCard,ds as SectionCardSize,U as Segment,dE as SegmentSize,W as StatusCard,x as Table,y as TableVariant,dF as Tag,X as TextCard,d as Toggle,dH as ToggleLabelAlign,dI as ToggleList,e as ToggleSize,dG as ToggleVariant,T as Typography,b as TypographySize,f as TypographyVariants,dJ as WarningModal}from"../chunks/ui-components-e54e1ba5.js";import"../icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"../chunks/vendor-0965fadc.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{aE as AutocompleteInput,aX as Badge,aZ as Button,ap as CancelWarning,z as CenterThis,a3 as Checkbox,d5 as Code,av as ConditionDetails,aw as DataCard,$ as DataCardFieldTypes,bH as DataCardFields,d6 as DataFinger,a$ as DataTab,ao as DeleteWarning,c3 as DescribeRow,aF as Divider,ah as DocsButton,an as Drawer,d8 as DrawerFooter,d7 as DrawerHeader,bm as Dropdown,d9 as ErrorBoundary,bu as ExtendArrow,n as FadeLoader,a4 as FieldError,a2 as FieldLabel,F as FlexColumn,a as FlexRow,da as Header,bt as IconButton,cd as IconGroup,aS as IconTitleBadge,aN as IconWrapped,b$ as IconsNav,db as ImageControlled,a6 as Input,ac as InputList,a9 as InputTable,aV as InteractiveTable,ab as KeyValueInputsList,bZ as LoadingText,az as Modal,aB as ModalBody,ai as MonitorsCheckboxes,aP as MonitorsIcons,aA as NavigationButtons,N as NoDataFound,aC as NotificationNote,dh as Overlay,P as PageContent,bh as Popup,ci as PopupForm,cn as ScrollX,b2 as ScrollY,ag as SectionTitle,af as Segment,bi as SelectionButton,b8 as SkeletonLoader,aH as Status,bG as Stepper,dc as TabList,aQ as TableContainer,aR as TableTitleWrap,aU as TableWrap,bQ as Tag,ae as Text,aj as TextArea,aa as Toggle,cl as ToggleCodeComponent,c as Tooltip,aW as TraceLoader,X as UpgradeRequiredWrapper,bj as VerticalScroll,dg as WarningModal,dd as getLinksFromText,de as getStrongsFromText,df as renderText}from"./chunks/ui-components-548ceb33.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
1
+ export{aH as AutocompleteInput,a_ as Badge,b0 as Button,as as CancelWarning,j as CenterThis,a6 as Checkbox,d7 as Code,ay as ConditionDetails,az as DataCard,a2 as DataCardFieldTypes,bJ as DataCardFields,d8 as DataFinger,b2 as DataTab,ar as DeleteWarning,c5 as DescribeRow,aI as Divider,ak as DocsButton,aq as Drawer,da as DrawerFooter,d9 as DrawerHeader,bo as Dropdown,db as ErrorBoundary,bw as ExtendArrow,q as FadeLoader,a7 as FieldError,a5 as FieldLabel,F as FlexColumn,a as FlexRow,dc as Header,bv as IconButton,cf as IconGroup,aV as IconTitleBadge,aQ as IconWrapped,c1 as IconsNav,dd as ImageControlled,a9 as Input,af as InputList,ac as InputTable,aY as InteractiveTable,ae as KeyValueInputsList,b$ as LoadingText,aC as Modal,aE as ModalBody,al as MonitorsCheckboxes,aS as MonitorsIcons,aD as NavigationButtons,N as NoDataFound,aF as NotificationNote,dj as Overlay,s as PageContent,bj as Popup,ck as PopupForm,cp as ScrollX,b5 as ScrollY,aj as SectionTitle,ai as Segment,bk as SelectionButton,ba as SkeletonLoader,aK as Status,bI as Stepper,de as TabList,aT as TableContainer,aU as TableTitleWrap,aX as TableWrap,bS as Tag,ah as Text,am as TextArea,ad as Toggle,cn as ToggleCodeComponent,c as Tooltip,aZ as TraceLoader,$ as UpgradeRequiredWrapper,bl as VerticalScroll,di as WarningModal,df as getLinksFromText,dg as getStrongsFromText,dh as renderText}from"./chunks/ui-components-e54e1ba5.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.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{at as ACTION_OPTIONS,am as BUTTON_TEXTS,D as DEFAULT_DATA_STREAM_NAME,bF as DESTINATION_CATEGORIES,bn as DISPLAY_LANGUAGES,_ as DISPLAY_TITLES,aD as FORM_ALERTS,bU as INSTRUMENTATION_RULE_OPTIONS,cZ as LANGUAGE_OPTIONS,bo as MONITORS_OPTIONS,bp as STORAGE_KEYS,c_ as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-548ceb33.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
1
+ export{aw as ACTION_OPTIONS,ap as BUTTON_TEXTS,D as DEFAULT_DATA_STREAM_NAME,bH as DESTINATION_CATEGORIES,bp as DISPLAY_LANGUAGES,a1 as DISPLAY_TITLES,aG as FORM_ALERTS,bW as INSTRUMENTATION_RULE_OPTIONS,c$ as LANGUAGE_OPTIONS,bq as MONITORS_OPTIONS,br as STORAGE_KEYS,d0 as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-e54e1ba5.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
@@ -8,5 +8,5 @@ export interface SourceDrawerProps {
8
8
  setSelectedConnectionIds: Dispatch<SetStateAction<string[]>>;
9
9
  persistSources: PersistSourcesFunc;
10
10
  }
11
- export declare const SOURCE_DRAWER_WIDTH = "80vw";
11
+ export declare const SOURCE_DRAWER_WIDTH = "75vw";
12
12
  export declare const SourceDrawer: FC<SourceDrawerProps>;
@@ -16,6 +16,6 @@ export type HandleSelectAllFunc = (opts: {
16
16
  export type HandleSourceChangeFunc = (opts: {
17
17
  clusterId: string;
18
18
  workloadId: Partial<WorkloadId>;
19
- boolean?: boolean;
20
- forceDirty?: boolean;
19
+ selected?: boolean;
20
+ auto?: boolean;
21
21
  }) => void;
@@ -1,19 +1,19 @@
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-548ceb33.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-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const xe=o(i)`
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,f as w,u as C,g as v,D as k,E as x,h as $,i as S,j as I,L as A,P as R,R as P,k as T,l as D,m as z,n as N,o as L,p as V,q as M,r as O,s as W,t as j,v as F,A as U,w as E,x as H,y as G,z as q,I as Y,G as B,H as K,J as X,K as J,M as Q,Q as Z,Y as _,U as ee,V as te,W as ae,X as le,Z as ne,_ as oe,$ as se,a0 as ie}from"../chunks/ui-components-e54e1ba5.js";import{SourceIcon as re,VSquareIcon as ce,SettingsIcon as de,OdigosLogo as ue,ConnectionsIcon as pe,RefreshIcon as ge,DeleteIcon as me,VIcon as he,XIcon as be,XSquareIcon as fe,PodIcon as ye,ChevronUpIcon as we,ChevronDownIcon as Ce,TerminalIcon as ve,DownloadIcon as ke,PipelineCollectorIcon as xe,GatewayIcon as $e,YamlIcon as Se}from"../icons.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const Ie=o(i)`
2
2
  width: ${({$width:e})=>e};
3
3
  gap: 12px;
4
4
  justify-content: space-between;
5
- `,$e=o.div`
5
+ `,Ae=o.div`
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  padding: 12px;
9
9
  gap: ${({$gap:e=0})=>e}px;
10
10
  width: calc(100% - 24px);
11
- height: calc(100vh - 280px);
11
+ height: calc(100vh - 300px);
12
12
  border-radius: ${({$borderRadius:e})=>e};
13
13
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
14
14
  overflow-y: auto;
15
15
  overflow-x: hidden;
16
- `,Se=o.div`
16
+ `,Re=o.div`
17
17
  display: flex;
18
18
  align-items: center;
19
19
  justify-content: space-between;
@@ -25,51 +25,55 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
25
25
  &:hover {
26
26
  background-color: ${({theme:e})=>e.v2.colors.silver[600]};
27
27
  }
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:24},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`
28
+ `,Pe=({formData:a,handleSourceChange:l,handleSelectAll:n,selectedArea:o,searchText:i,filters:f})=>{const y=s(),{activeNamespace:w,isAll:C,isSome:v}=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]),k=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(Re,{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(Ie,{$width:"50%"},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:v,value:C,onChange:()=>n({clusterId:o.value.clusterId,namespaceName:o.value.namespaceName,boolean:!C}),disabled:!k.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:k.length,status:h.Unknown}))),e.createElement(Ae,{$borderRadius:"0 16px 16px 0"},k.length?k:e.createElement(b,{title:"Workloads not found",subTitle:"Please select a namespace to view workloads"})))},Te=({formData:a,handleSourceChange:l,handleSelectAll:n,selectedArea:o,searchText:i,filters:C})=>{const v=s(),{isAll:k,isSome:x}=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]),$=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,x=k>0&&k===s.length,$=k>0&&k<s.length,S=b||!1;if(C.showOnlySelected&&!x&&!$&&!S)return null;const I=o.value.clusterId===t&&o.value.namespaceName===n,A=()=>o.setValue({clusterId:t,clusterName:a,namespaceName:n}),R=e=>{A(),l({clusterId:t,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return e.createElement(Re,{key:`${t}#${n}`,$isSelected:I,onClick:A},e.createElement(r,{$gap:12},e.createElement(c,{partiallyChecked:$,value:x,onChange:e=>R({auto:e,all:e})}),e.createElement(d,{size:u.XS},`${a} > ${n}`)),e.createElement(r,{$gap:12},e.createElement(m,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future"},e.createElement(f,{label:"Auto",size:y.S,value:S,onChange:e=>R({auto:e,all:e||void 0})})),e.createElement(r,{$gap:8},e.createElement(d,{variant:w.Span,size:u.XXXS,color:v.v2.colors.silver[200],align:"right"},"Selected"),e.createElement(p,{label:`${k}/${s.length}`,status:I?g.Default:h.Unknown,minWidth:"42px"}))))})),[a,o.value.clusterId,o.value.namespaceName,i,C]);return e.createElement(Ie,{$width:"50%"},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:x,value:k,onChange:()=>n({boolean:!k}),disabled:!$.length})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS,nowrap:!0},"Namespaces"),e.createElement(p,{label:$.length,status:h.Unknown}))),e.createElement(Ae,{$borderRadius:"16px 0 0 16px"},$.length?$:e.createElement(b,{title:"Namespaces not found",subTitle:""})))},De="75vw",ze=o.div`
29
29
  display: flex;
30
30
  flex-direction: column;
31
31
  border-radius: 16px;
32
32
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
33
33
  overflow: hidden;
34
- `,De=o.div`
34
+ `,Ne=o.div`
35
35
  display: flex;
36
36
  gap: 12px;
37
37
  padding: 16px;
38
- background-color: ${({theme:e})=>e.v2.colors.silver[900]};
38
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
39
39
  position: sticky;
40
40
  top: 0;
41
- `,Te=o.div`
41
+ `,Le=o.div`
42
42
  display: flex;
43
43
  gap: 12px;
44
44
  padding: 16px;
45
- `,Ne=o.div`
45
+ `,Ve=o.div`
46
+ padding: 5vh 10vw;
47
+ border-radius: 12px;
48
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
49
+ `,Me=o.div`
46
50
  display: flex;
47
51
  align-items: center;
48
52
  justify-content: flex-end;
49
53
  gap: 16px;
50
54
  padding: 0 12px;
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 e=await m(K);U(!1),e?.error?H(e.error):(p([]),o())},disabled:!X||F})))),e.createElement(D,{isOpen:W,onClose:()=>j(!1),onApprove:Z}))},Le="75vw",Ve=o.div`
55
+ `,Oe=({onClose:o,snapshots:i,selectedConnectionIds:c,setSelectedConnectionIds:p,persistSources:m})=>{const h=s(),{selectedStreamName:b}=C(),{progress:w,resetProgress:V}=v(),M=t(()=>b||k,[b]),[O,W]=a(""),[j,F]=a(x.Namespace),[U,E]=a({showOnlySelected:!1}),[H,G]=a(!1),[q,Y]=a(!1),[B,K]=a(void 0),[X,J]=a({clusterId:"",clusterName:"",namespaceName:""}),[Q,Z]=a([]);l(()=>{Z(e=>{const t=((e,t)=>$(((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:_,isFormDirty:ee}=t(()=>{const e=((e,t,a)=>{const l={};return e.forEach(e=>{e.namespaces.forEach(n=>{const o=t.find(t=>t.clusterId===e.clusterId)?.namespaces.find(e=>e.name===n.name),s=n.selected||!1,i=s!==o?.selected;if(i&&(l[e.clusterId]||(l[e.clusterId]=[]),l[e.clusterId].push({namespace:n.name,selected:s,currentStreamName:a}),s&&(l[e.clusterId]=l[e.clusterId].filter(e=>e.namespace!==n.name||e.namespace===n.name&&(!e.name||!e.kind)))),!i||!s){const t=((e,t,a)=>{const l=[];return t.workloads.forEach(n=>{const o=e?.workloads.find(e=>e.name===n.name&&e.kind===n.kind);n.selected!==o?.selected&&l.push({namespace:t.name,name:n.name,kind:n.kind,selected:n.selected||!1,currentStreamName:a})}),l})(o,n,a);t.length>0&&(l[e.clusterId]||(l[e.clusterId]=[]),l[e.clusterId].push(...t))}})}),l})(Q,i.clusters,M);return{formDiff:e,isFormDirty:Object.keys(e).length>0}},[Q,i,M]),te=n(({clusterId:e,workloadId:t,selected:a,auto:l})=>{Z(n=>{const o=$(n),s=o.findIndex(t=>t.clusterId===e);if(-1===s)return o;const i=o[s].namespaces.findIndex(e=>e.name===t.namespace);if(-1===i)return o;if(t.kind&&t.name){const e=o[s].namespaces[i].workloads.findIndex(e=>e.name===t.name&&e.kind===t.kind);if(-1===e)return o;const l="boolean"==typeof a?a:!o[s].namespaces[i].workloads[e].selected;o[s].namespaces[i].workloads[e].selected=l,l?o[s].namespaces[i].workloads.every(e=>e.selected)&&(o[s].namespaces[i].selected=!0):o[s].namespaces[i].selected=!1}else{const e="boolean"==typeof l?l:!o[s].namespaces[i].selected;o[s].namespaces[i].selected=e,e?o[s].namespaces[i].workloads.forEach(e=>{e.selected=!0}):"boolean"!=typeof a||a||o[s].namespaces[i].workloads.forEach(e=>{e.selected=!1})}return o})},[]),ae=n(({clusterId:e,namespaceName:t,boolean:a})=>{Z(l=>{const n=$(l);return n.forEach((l,o)=>{e&&l.clusterId!==e||l.namespaces.forEach(({name:e,workloads:l},s)=>{t&&e!==t||(n[o].namespaces[s].selected=a,l.forEach((e,t)=>{n[o].namespaces[s].workloads[t].selected=a}))})}),n})},[]),le=()=>{G(!1),o()};return e.createElement(S,{isOpen:!0,hideOverlay:!q,width:De,header:{icon:re,title:"Manage Sources",onClose:o,onCloseDisabled:q}},q?e.createElement(I,{$height:"calc(100vh - 136px)"},e.createElement(Ve,null,e.createElement(A,{title:"Creating Sources...",titleSize:u.S,subTitle:"This may take a few moments while sources are being created.",subTitleSize:u.XXXS,withGradient:!0,withSpinner:!0,prettySpinner:!0,percentage:w[R.BulkInstrumenting]?.percentage||0}))):e.createElement(ze,null,e.createElement(Ne,null,e.createElement(P,{icon:ce,title:"Selected Clusters",badge:{label:c.length}}),e.createElement(T,{width:"300px",value:O,onChange:W,segment:{options:[{label:"Namespace",value:x.Namespace},{label:"Source",value:x.Source}],selected:j,setSelected:F}}),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:U.showOnlySelected,onChange:e=>E(t=>({...t,showOnlySelected:e}))}))),e.createElement(Le,null,e.createElement(Te,{formData:Q,handleSourceChange:te,handleSelectAll:ae,selectedArea:{value:X,setValue:J},searchText:j===x.Namespace?O:"",filters:U}),e.createElement(Pe,{formData:Q,handleSourceChange:te,handleSelectAll:ae,selectedArea:{value:X,setValue:J},searchText:j===x.Source?O:"",filters:U}))),e.createElement(Me,null,q?null:B?e.createElement(D,{fullWidth:!0,status:g.Error,message:B}):ee?e.createElement(D,{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.'}):ee?null:e.createElement(D,{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(z,{fullWidth:!0,variant:N.Secondary,label:"Cancel",onClick:()=>ee?G(!0):le(),disabled:!ee||q})),e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Primary,label:"Save",onClick:async()=>{Y(!0);const e=await m(_);V(R.BulkInstrumenting),Y(!1),e?.error?K(e.error):(p([]),o())},disabled:!ee||q})))),e.createElement(L,{isOpen:H,onClose:()=>G(!1),onApprove:le}))},We="75vw",je=o.div`
52
56
  display: flex;
53
57
  flex-direction: column;
54
58
  border-radius: 16px;
55
59
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
56
60
  overflow: hidden;
57
- `,Me=o.div`
61
+ `,Fe=o.div`
58
62
  display: flex;
59
63
  gap: 12px;
60
64
  padding: 16px;
61
- background-color: ${({theme:e})=>e.v2.colors.silver[900]};
65
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
62
66
  position: sticky;
63
67
  top: 0;
64
- `,Oe=o.div`
68
+ `,Ue=o.div`
65
69
  display: flex;
66
70
  gap: 12px;
67
71
  padding: 16px;
68
- `,We=o(i)`
72
+ `,Ee=o(i)`
69
73
  width: ${({$width:e})=>e};
70
74
  gap: 12px;
71
75
  justify-content: space-between;
72
- `,je=o.div`
76
+ `,He=o.div`
73
77
  display: flex;
74
78
  flex-direction: column;
75
79
  padding: 12px;
@@ -80,7 +84,7 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
80
84
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
81
85
  overflow-y: auto;
82
86
  overflow-x: hidden;
83
- `,Fe=o.div`
87
+ `,Ge=o.div`
84
88
  display: flex;
85
89
  align-items: center;
86
90
  gap: 12px;
@@ -91,13 +95,13 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
91
95
  &:hover {
92
96
  background-color: ${({theme:e})=>e.v2.colors.silver[600]};
93
97
  }
94
- `,Ue=o.div`
98
+ `,qe=o.div`
95
99
  display: flex;
96
100
  align-items: center;
97
101
  justify-content: flex-end;
98
102
  gap: 16px;
99
103
  padding: 0 12px;
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 e=await w(i,B);F(!1),e?.error?E(e.error):(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:async e=>{if(!f)return{error:"Persist sources function is not defined"};const t=await f(e);return t?.error||await D(),t}}),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`
104
+ `,Ye=({onClose:n,connections:o,selectedConnectionIds:i,setSelectedConnectionIds:m,getConnectionRemoteConfig:b,onApply:w})=>{const C=s(),[v,k]=a(""),[x,$]=a({showOnlySelected:!1}),I=t(()=>o.filter(e=>(!v||e.name.toLowerCase().includes(v.toLowerCase()))&&(!x.showOnlySelected||i.includes(e.id))),[o,i.length,v,x]),R=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}=V(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(S,{isOpen:!0,hideOverlay:!0,width:We,header:{icon:de,title:"Cluster Configuration",onClose:n}},e.createElement(je,null,e.createElement(Fe,null,e.createElement(P,{icon:ce,title:"Selected Clusters",badge:{label:i.length}}),e.createElement(T,{width:"300px",placeholder:"Search by cluster name",value:v,onChange:k}),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:x.showOnlySelected,onChange:e=>$(t=>({...t,showOnlySelected:e}))}))),e.createElement(Ue,null,e.createElement(Ee,{$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(He,{$borderRadius:"16px 0 0 16px"},I.map(t=>e.createElement(Ge,{key:t.id,onClick:()=>R(t.id)},e.createElement(c,{value:i.includes(t.id),onChange:()=>R(t.id)}),e.createElement(d,{size:u.XS},t.name))))),e.createElement(Ee,{$width:"60%"},e.createElement(r,{$padding:"0 12px"},e.createElement(d,{size:u.XS},"Configurations")),e.createElement(He,{$borderRadius:"0 16px 16px 0",$gap:12},H?e.createElement(M,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(qe,null,H?e.createElement(A,{icon:ue,title:"Fetching Configuration...",titleSize:u.XXS,withGradient:!0}):j?e.createElement(A,{icon:ue,title:"Applying Configurations...",titleSize:u.XXS,withGradient:!0}):U?e.createElement(D,{fullWidth:!0,status:g.Error,message:U}):Q?e.createElement(D,{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(D,{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(z,{fullWidth:!0,variant:N.Secondary,label:"Cancel",onClick:()=>Q?W(!0):_(),disabled:j})),e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Primary,label:"Save",onClick:async()=>{F(!0);const e=await w(i,B);F(!1),e?.error?E(e.error):(m([]),n())},disabled:!Q||j})))),e.createElement(L,{isOpen:O,onClose:()=>W(!1),onApprove:_}))};var Be,Ke;!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"}(Be||(Be={})),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 Xe=[{key:Ke.Name,label:"Name"},{key:Ke.Type,label:"Type",textAlign:"right"},{key:Ke.Status,label:"Status"},{key:Ke.OdigosVersion,label:"Odigos Version"},{key:Ke.ConnectedSince,label:"Connected Since"},{key:Ke.LastActivity,label:"Last Activity"}],Je=(e,t)=>{const a=e.find(e=>e.key===Ke.Id)?.rawValue;a&&t(a.toString())},Qe=({tableRowsMaxHeight:o,connections:i,getConnections:r,onClickConnection:c,deleteConnection:d,getConnectionRemoteConfig:u,applyConfigurations:m,getAllClusterSnapshots:b,persistSources:f})=>{const y=s(),{formatTimeAgo:w}=O(),[C,v]=a(!1),[k,x]=a(i||[]),[$,S]=a(!1),[I,A]=a(null),R=n(async()=>{try{v(!0),x(await r()??[])}catch(e){}finally{v(!1)}},[]),P=n(async()=>{if(b)try{S(!0),A(await b()??null)}catch(e){}finally{S(!1)}},[]);l(()=>{k.length||R()},[k.length,R]),l(()=>{I||P()},[I,P]);const[T,D]=a(""),[z,L]=a(null),[V,M]=a([]),K=t(()=>k.filter(e=>e.status===g.Success),[k]),X=t(()=>k.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(t=>({cells:[{key:Ke.Id,rawValue:t.id},{key:Ke.Name,rawValue:t.name},{key:Ke.Type,rawValue:t.type},{key:Ke.Status,rawValue:t.status,component:()=>(t=>{const a=t===g.Success?"Connection live":"Connection lost",l=t===g.Success?he:be;return e.createElement(p,{status:t,label:a,leftIcon:l})})(t.status)},{key:Ke.OdigosVersion,rawValue:t.odigosVersion},{key:Ke.ConnectedSince,rawValue:t.connectedAt?w(t.connectedAt):"-"},{key:Ke.LastActivity,rawValue:t.lastSeenAt?w(t.lastSeenAt):"-"}],onClick:t.status===g.Success?()=>c(t):void 0,isSelected:V.includes(t.id),onSelect:()=>M(e=>Array.from(new Set([...e,t.id]))),onDeselect:()=>M(e=>e.filter(e=>e!==t.id)),hideCheckbox:t.status!==g.Success})),[k,V,T]);return e.createElement(W,null,e.createElement(j,{richTitle:{icon:pe,title:"Connections",badge:{label:k.length.toString(),status:h.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>D(e),width:"300px"},actions:[{id:F(),type:U.Button,buttonProps:{variant:N.Secondary,size:E.S,leftIcon:ge,onClick:async()=>{await R(),await P()},disabled:C||$}}]},e.createElement(H,{variant:G.Pretty,maxHeight:o,headerBackgroundColor:y.v2.colors.silver[1e3],isLoading:C,withCheckboxes:!0,columns:Xe,rows:X,rowActionsPushRightPosition:z?`calc(${z===Be.BulkConfig?We:De} - 24px)`:void 0,getRowActions:({cells:e})=>(e=>e.find(e=>e.key===Ke.Status)?.rawValue===g.Success)(e)?[I&&f?{id:F(),tooltip:"Manage Sources",rightIcon:re,onClick:async()=>{Je(e,e=>{M([e]),L(Be.BulkSource)})}}:null,u&&m?{id:F(),tooltip:"Edit Configuration",rightIcon:de,onClick:async()=>{Je(e,e=>{M([e]),L(Be.BulkConfig)})}}:null]:[{id:F(),label:"Delete Connection",rightIcon:me,onClick:()=>{Je(e,e=>{M([e]),L(Be.Delete)})}}]}),z===Be.BulkConfig&&u&&m&&e.createElement(Ye,{onClose:()=>L(null),connections:K,selectedConnectionIds:V,setSelectedConnectionIds:M,getConnectionRemoteConfig:u,onApply:m}),z===Be.BulkSource&&I&&f&&e.createElement(Oe,{onClose:()=>L(null),snapshots:I,selectedConnectionIds:V,setSelectedConnectionIds:M,persistSources:async e=>{if(!f)return{error:"Persist sources function is not defined"};const t=await f(e);return t?.error||await P(),t}}),e.createElement(q,{target:"connection",isOpen:z===Be.Delete,onClose:()=>{M([]),L(null)},onApprove:async()=>{const e=V[0];e&&(await d(e),await R())}}),e.createElement(Y,{isOpen:!!V.length&&!z,richTitle:{icon:ce,title:"Selected Clusters",badge:{label:V.length}},actions:[{id:F(),type:U.Button,buttonProps:{variant:N.Text,size:E.S,label:"Cancel",onClick:()=>M([])}},I&&f?{id:F(),type:U.ButtonDropData,buttonProps:{variant:N.Secondary,size:E.S,label:"Add Component",onClick:e=>L(e)},dropDataProps:{alignX:B.Left,items:[{id:Be.BulkSource,label:"Add Source",icon:re}]}}:null,u&&m?{id:F(),type:U.Button,buttonProps:{variant:N.Primary,size:E.S,label:"Manage Configurations",rightIcon:de,onClick:()=>L(Be.BulkConfig)}}:null]})))},Ze=o.div`
101
105
  display: flex;
102
106
  align-items: center;
103
107
  justify-content: space-between;
@@ -109,10 +113,10 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
109
113
  &:hover {
110
114
  background: ${({theme:e})=>e.v2.colors.silver[700]};
111
115
  }
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`
116
+ `,_e=o.div`
117
+ animation-name: ${K.animations.fade.in};
118
+ `,et=({pod:n,getExtendedPodInfo:o,onClose:s})=>{const{formatTimeAgo:r}=O(),[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:F(),title:"Node",label:c?.node??"-",withCopy:!0},{id:F(),title:"Status",badge:{status:X(c?.status),label:c?.status??"-"}}],[c]),b=t(()=>c?.containers?.map(e=>({id:F(),items:[{id:F(),title:"Container",label:e.name??"-"},{id:F(),title:"Status",label:e.startedAt?`${e.status} (since ${r(e.startedAt)})`:e.status},{id:F(),title:"Ready",badge:{status:e.ready?g.Success:g.Error,leftIcon:e.ready?ce:fe,label:e.ready?"True":"False",invertColors:!0}},{id:F(),title:"Started",badge:{status:e.started?g.Success:g.Error,leftIcon:e.started?ce:fe,label:e.started?"True":"False",invertColors:!0}},{id:F(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:F(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:F(),title:"Restarts",label:e.restarts.toString()},{id:F(),title:"State Reason",label:e.stateReason??"-"},{id:F(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:F(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return e.createElement(S,{isOpen:!!n,header:{icon:ye,title:"Pod Information",onClose:s}},c?null:e.createElement(I,null,e.createElement(M,null)),c?e.createElement(e.Fragment,null,e.createElement(j,{richTitle:{icon:ye,title:c.name,withCopy:!0}},e.createElement(i,{$gap:24},e.createElement(J,{cellsPerRow:2,items:h}),b.length>0&&e.createElement(i,{$gap:12},e.createElement(Ze,{onClick:()=>m(e=>!e)},e.createElement(d,null,"Containers Overview"),e.createElement(Q,{icon:p?we:Ce})),p&&b.map(({id:t,items:a})=>e.createElement(_e,{key:t},e.createElement(J,{cellsPerRow:2,items:a})))))),e.createElement(j,{richTitle:{icon:ve,title:"Kubectl Commands"}},e.createElement(i,{$gap:12},e.createElement(Z,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),e.createElement(Z,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),e.createElement(Z,{value:`kubectl logs ${c.name} -n ${c.namespace}`}))),e.createElement(_,{yaml:c.manifestYAML})):null)};var tt;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(tt||(tt={}));const at=[{key:tt.PodName,label:"Pod Name"},{key:tt.Status,label:"Status"},{key:tt.Restarts,label:"Restarts",textAlign:"right"},{key:tt.NodeName,label:"Node Name"},{key:tt.Age,label:"Age",textAlign:"right"},{key:tt.DockerImage,label:"Docker Image",textAlign:"right"}],lt=({isLoading:l,tableRowsMaxHeight:n,pods:o,getExtendedPodInfo:i})=>{const r=s(),{formatTimeAgo:c}=O(),[d,u]=a(null),g=t(()=>o.map(t=>({onClick:()=>u(t),cells:[{key:tt.PodName,rawValue:t.name},{key:tt.Status,rawValue:t.status,component:()=>{return a=t.status,e.createElement(p,{status:X(a),label:a});var a}},{key:tt.Restarts,rawValue:t.restartsCount.toString()},{key:tt.NodeName,rawValue:t.nodeName},{key:tt.Age,rawValue:c(t.creationTimestamp)},{key:tt.DockerImage,rawValue:t.image}]})),[o,r]);return e.createElement(j,{richTitle:{icon:ye,title:"Pods"}},e.createElement(H,{variant:G.Data,maxHeight:n,isLoading:l,columns:at,rows:g}),e.createElement(et,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)}))};var nt;!function(e){e.Gateway="gateway",e.Node="node"}(nt||(nt={}));const ot=[{value:nt.Gateway,label:"Gateway"},{value:nt.Node,label:"Node Collector"}],st=o.div`
115
119
  display: flex;
116
120
  align-items: center;
117
121
  justify-content: space-between;
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};
122
+ `,it=({selectedTab:a,setSelectedTab:l,onClickDownloadDiagnose:n,onClickRefresh:o,loading:s,disabled:i})=>{const c=t(()=>{const e=[];return n&&e.push({id:F(),type:U.Button,buttonProps:{label:"Download Diagnose",leftIcon:ke,size:E.S,variant:N.Text,onClick:n,disabled:i}}),o&&e.push({id:F(),type:U.Button,buttonProps:{label:"Refresh",leftIcon:ge,size:E.S,variant:N.Text,onClick:o,disabled:i,loading:s}}),e},[n,o,i,s]);return e.createElement(st,null,e.createElement(r,{$gap:12},e.createElement(r,{$gap:8},e.createElement(xe,{size:32}),e.createElement(d,{size:u.M,weight:500},"Pipeline Collectors")),e.createElement(ee,{options:ot,selected:a,setSelected:l,disabled:i})),e.createElement(te,{actions:c}))},rt=({isOpen:t,onClose:a,title:l,yaml:n})=>e.createElement(S,{isOpen:t,header:{icon:$e,title:l,onClose:a}},e.createElement(_,{yaml:n}));var ct;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(ct||(ct={}));const dt=({richTitle:t,statusCard:l,textCards:n,manifestYaml:o,configMapYaml:s})=>{const[i,c]=a(null);return e.createElement(j,{richTitle:t,actions:[{id:F(),type:U.ButtonDropData,buttonProps:{variant:N.Secondary,size:E.S,label:"View YAML",onClick:e=>c(e)},dropDataProps:{items:[{id:ct.ManifestYaml,label:t.title,icon:Se},{id:ct.ConfigMapYaml,label:"ConfigMap",icon:Se}]}}]},e.createElement(r,{$gap:16},e.createElement(ae,{...l}),n.map(t=>e.createElement(le,{key:t.title,...t}))),e.createElement(rt,{isOpen:i===ct.ManifestYaml,onClose:()=>c(null),title:t.title,yaml:o}),e.createElement(rt,{isOpen:i===ct.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:s}))},ut=e=>{switch(e){case ne.Healthy:return"All desired replicas are updated, available, and ready";case ne.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ne.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ne.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ne.Down:return"No available replicas";case ne.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},pt=({tableRowsMaxHeight:o,getGatewayInfo:s,getGatewayPods:i,getNodeCollectorInfo:r,getNodeCollectorPods:c,getExtendedPodInfo:d})=>{const{formatTimeAgo:u}=O(),{isVersionSupported:p,version:m}=oe(1.12),[b,f]=a(!1),[y,w]=a(nt.Gateway),[C,v]=a(null),[k,x]=a([]),[$,S]=a(null),[I,A]=a([]),R=n(async()=>{f(!0);try{switch(y){case nt.Gateway:v(await s()??null),x(await i()??[]);break;case nt.Node:S(await r()??null),A(await c()??[])}}catch(e){}f(!1)},[y]);l(()=>{R()},[R]);const P=t(()=>(e=>{switch(e){case nt.Gateway:return"Deployment";case nt.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(y),[y]),T=t(()=>((e,t,a,l)=>{const n={status:h.Disabled,label:"No rollouts yet"};let o=!1,s=null;switch(e){case nt.Gateway:o=t?.rolloutInProgress??!1,s=t?.lastRolloutAt??null;break;case nt.Node:o=a?.rolloutInProgress??!1,s=a?.lastRolloutAt??null;break;default:return n}return o?{status:g.Info,label:"Rollout in progress",rightIcon:ge,useSecondaryTone:!0}:s?{status:h.Disabled,label:`Last Rollout: ${l(s)}`}:n})(y,C,$,u),[C,$,y,u]),D=t(()=>((e,t,a,l)=>{let n=l?g.Info:h.Unknown,o=l?"Loading":ne.Unknown,s=l?"Fetching data...":ut(ne.Unknown);switch(e){case nt.Gateway:n=t?.status?X(t?.status):n,o=t?.status??o,s=t?.status?ut(t.status):s;break;case nt.Node:n=a?.status?X(a?.status):n,o=a?.status??o,s=a?.status?ut(a.status):s}return{status:n,title:o,description:s}})(y,C,$,b),[C,$,y,b]),z=t(()=>((e,t,a,l)=>{switch(e){case nt.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 nt.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]),N=t(()=>(y===nt.Gateway?C?.manifestYAML:$?.manifestYAML)??"",[C,$,y]),L=t(()=>(y===nt.Gateway?C?.configMapYAML:$?.configMapYAML)??"",[C,$,y]),V=t(()=>y===nt.Gateway?k:I,[k,I,y]);return e.createElement(W,null,e.createElement(it,{disabled:!p,loading:b,selectedTab:y,setSelectedTab:w,onClickDownloadDiagnose:void 0,onClickRefresh:R}),e.createElement(se,null,e.createElement(dt,{richTitle:{icon:$e,title:P,badge:T},statusCard:D,textCards:z,manifestYaml:N,configMapYaml:L}),e.createElement(lt,{isLoading:b,tableRowsMaxHeight:o,pods:V,getExtendedPodInfo:d}),!p&&e.createElement(ie,{minSupportedVersion:1.12,currentVersion:m||""})))};export{Qe as CentralConnections,pt as PipelineCollectors};