@odigos/ui-kit 0.0.149 → 0.0.151
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 +15 -0
- package/lib/chunks/index-64bb5a64.js +9 -0
- package/lib/chunks/index-fe2a432e.js +3 -0
- package/lib/chunks/{ui-components-2ec876fd.js → ui-components-92e29f4b.js} +393 -369
- package/lib/components/_v2/index.d.ts +1 -0
- package/lib/components/_v2/modal/index.d.ts +2 -0
- package/lib/components/_v2/segment/index.d.ts +2 -1
- package/lib/components/_v2/table/table-columns/index.d.ts +1 -0
- package/lib/components/_v2/warning-modal/index.d.ts +12 -0
- package/lib/components/styled.d.ts +4 -1
- 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 +1 -1
- package/lib/containers/_v2/pipeline-collectors/toolbar/index.d.ts +2 -1
- package/lib/containers/v2.js +12 -12
- package/lib/containers.js +19 -19
- package/lib/contexts/index.d.ts +1 -0
- package/lib/contexts/odigos-context.d.ts +13 -0
- package/lib/contexts.js +1 -0
- package/lib/functions/index.d.ts +1 -0
- package/lib/functions/trim-version/index.d.ts +1 -0
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/cancel-modal/index.d.ts +4 -0
- package/lib/snippets/_v2/delete-modal/index.d.ts +7 -0
- package/lib/snippets/_v2/index.d.ts +3 -0
- package/lib/snippets/_v2/upgrade-modal/index.d.ts +6 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals/index.d.ts +1 -0
- package/lib/visuals/visual-star/index.d.ts +2 -0
- package/lib/visuals.js +3 -3
- package/package.json +10 -5
- package/lib/chunks/index-ef6b1ee4.js +0 -3
|
@@ -9,6 +9,7 @@ export interface SegmentProps<T = any> {
|
|
|
9
9
|
options: Option<T>[];
|
|
10
10
|
selected: T;
|
|
11
11
|
setSelected: (value: T) => void;
|
|
12
|
+
disabled?: boolean;
|
|
12
13
|
}
|
|
13
|
-
export declare const Segment: <T>({ options, selected, setSelected }: SegmentProps<T>) => React.JSX.Element;
|
|
14
|
+
export declare const Segment: <T>({ options, selected, setSelected, disabled }: SegmentProps<T>) => React.JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type ModalProps } from '@/components/_v2';
|
|
3
|
+
export interface WarningModalProps extends Pick<ModalProps, 'relativeToParent'> {
|
|
4
|
+
visual?: FC;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
onDeny?: () => void;
|
|
8
|
+
denyLabel?: string;
|
|
9
|
+
onApprove?: () => void;
|
|
10
|
+
approveLabel?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const WarningModal: FC<WarningModalProps>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties } from 'styled-components';
|
|
2
2
|
export declare const PageContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const UpgradeRequiredWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
4
|
export declare const FlexRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
4
5
|
$gap?: number;
|
|
5
6
|
$alignItems?: CSSProperties["alignItems"];
|
|
@@ -25,7 +26,9 @@ export declare const CenterThis: import("styled-components/dist/types").IStyledC
|
|
|
25
26
|
$height?: CSSProperties["height"];
|
|
26
27
|
}>> & string;
|
|
27
28
|
export declare const VerticalScroll: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
28
|
-
export declare const Overlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
29
|
+
export declare const Overlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
30
|
+
$relativeToParent?: boolean;
|
|
31
|
+
}>> & string;
|
|
29
32
|
export declare const ModalBody: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
30
33
|
$isNotModal?: boolean;
|
|
31
34
|
$minHeight?: CSSProperties["minHeight"];
|
package/lib/components/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{i as Badge,m as Button,B as ButtonSize,da as ButtonTab,db as ButtonTabList,a as ButtonVariants,j as Checkbox,de as CheckboxList,dd as CheckboxSize,w as CliCommand,v as DataCard,D as Drawer,df as DropData,dg as Header,c0 as HoverActions,I as IconButton,cb as IconButtonSize,dh as Input,L as Loader,di as Modal,dj as Navbar,dk as Note,dm as Radio,dn as RadioGroup,dl as RadioSize,e as Search,b as SectionCard,S as SectionCardActionType,dc as SectionCardSize,y as Segment,z as StatusCard,o as Table,p as TableVariant,dp as Tag,A as TextCard,k as Toggle,dr as ToggleLabelAlign,ds as ToggleList,l as ToggleSize,dq as ToggleVariant,T as Typography,h as TypographySize,dt as TypographyVariants,W as WarningModal}from"../chunks/ui-components-92e29f4b.js";import"../icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{av as AutocompleteInput,aP as Badge,aS as Button,ag as CancelWarning,c as CenterThis,Q as Checkbox,C as Code,am as ConditionDetails,an as DataCard,H as DataCardFieldTypes,bD as DataCardFields,c_ as DataFinger,aV as DataTab,af as DeleteWarning,b_ as DescribeRow,aw as Divider,a6 as DocsButton,ae as Drawer,d0 as DrawerFooter,c$ as DrawerHeader,bg as Dropdown,d1 as ErrorBoundary,bp as ExtendArrow,t as FadeLoader,R as FieldError,M as FieldLabel,F as FlexColumn,f as FlexRow,d2 as Header,bo as IconButton,c8 as IconGroup,aK as IconTitleBadge,aF as IconWrapped,bW as IconsNav,d3 as ImageControlled,X as Input,a1 as InputList,_ as InputTable,aN as InteractiveTable,a0 as KeyValueInputsList,aR as LoadingText,aq as Modal,as as ModalBody,a7 as MonitorsCheckboxes,aH as MonitorsIcons,ar as NavigationButtons,N as NoDataFound,at as NotificationNote,d9 as Overlay,P as PageContent,bb as Popup,cc as PopupForm,ch as ScrollX,aZ as ScrollY,a5 as SectionTitle,a4 as Segment,bc as SelectionButton,b1 as SkeletonLoader,ay as Status,bC as Stepper,d4 as TabList,aI as TableContainer,aJ as TableTitleWrap,aM as TableWrap,bM as Tag,a3 as Text,a8 as TextArea,$ as Toggle,cf as ToggleCodeComponent,aA as Tooltip,aO as TraceLoader,U as UpgradeRequiredWrapper,bd as VerticalScroll,d8 as WarningModal,d5 as getLinksFromText,d6 as getStrongsFromText,d7 as renderText}from"./chunks/ui-components-92e29f4b.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{ak as ACTION_OPTIONS,ad as BUTTON_TEXTS,bn as DEFAULT_DATA_STREAM_NAME,bA as DESTINATION_CATEGORIES,bh as DISPLAY_LANGUAGES,G as DISPLAY_TITLES,au as FORM_ALERTS,bP as INSTRUMENTATION_RULE_OPTIONS,cT as LANGUAGE_OPTIONS,bi as MONITORS_OPTIONS,bj as STORAGE_KEYS,cU as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-92e29f4b.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
|
@@ -7,7 +7,7 @@ export interface CentralConnectionsProps {
|
|
|
7
7
|
tableRowsMaxHeight: CSSProperties['maxHeight'];
|
|
8
8
|
connections?: Connection[];
|
|
9
9
|
getConnections: () => Promise<Connection[]>;
|
|
10
|
-
onClickConnection: (
|
|
10
|
+
onClickConnection: (connection: Connection) => void;
|
|
11
11
|
deleteConnection: (id: string) => Promise<void>;
|
|
12
12
|
applyConfigurations: ApplyConnectionsConfigurationsFunc;
|
|
13
13
|
}
|
package/lib/containers/v2.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react";import
|
|
1
|
+
import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react";import n,{useTheme as i}from"styled-components";import{W as s,F as r,d,D as c,e as u,f as p,T as g,h as b,i as m,O as y,j as h,k as f,l as v,L as w,m as k,a as C,n as x,P as $,b as A,g as L,S as R,B as P,o as I,p as D,q as S,r as V,s as z,c as O,t as M,v as j,I as T,w as N,x as U,y as E,z as F,A as H,E as W,U as Y}from"../chunks/ui-components-92e29f4b.js";import{ConnectionsIcon as q,OdigosLogo as G,RefreshIcon as K,SettingsIcon as B,DeleteIcon as J,VIcon as Q,XIcon as X,PodIcon as Z,ChevronUpIcon as _,ChevronDownIcon as ee,TerminalIcon as te,VSquareIcon as ae,XSquareIcon as le,PipelineCollectorIcon as oe,DownloadIcon as ne,GatewayIcon as ie,YamlIcon as se}from"../icons.js";import{Y as re}from"../chunks/index-fe2a432e.js";import{useOdigos as de}from"../contexts.js";import{V as ce}from"../chunks/index-64bb5a64.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const ue=({onDeny:t,onApprove:a})=>e.createElement(s,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",onDeny:t,denyLabel:"Keep editing",onApprove:a,approveLabel:"Discard changes"}),pe=({onDeny:t,onApprove:a,action:l="delete",target:o})=>{const n=l.charAt(0).toUpperCase()+l.substring(1),i=o?.endsWith("s")?"these":"this";return e.createElement(s,{title:`${n}${o?` ${o}`:""}?`,description:`Are you sure you want to ${l}${o?` ${i} ${o}`:""}?`,onDeny:t,denyLabel:"Go back",onApprove:a,approveLabel:n})},ge=({minSupportedVersion:t,currentVersion:a})=>e.createElement(s,{relativeToParent:!0,visual:ce,title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${t} or later.\nCurrent version: ${a}.`}),be="75vw",me=n.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
border-radius: 16px;
|
|
5
5
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
6
6
|
overflow: hidden;
|
|
7
|
-
`,
|
|
7
|
+
`,ye=n.div`
|
|
8
8
|
display: flex;
|
|
9
9
|
gap: 12px;
|
|
10
10
|
padding: 16px;
|
|
11
11
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
12
12
|
position: sticky;
|
|
13
13
|
top: 0;
|
|
14
|
-
`,
|
|
14
|
+
`,he=n.div`
|
|
15
15
|
display: flex;
|
|
16
16
|
gap: 12px;
|
|
17
17
|
padding: 16px;
|
|
18
|
-
`,
|
|
18
|
+
`,fe=n(r)`
|
|
19
19
|
width: ${({$width:e})=>e};
|
|
20
20
|
gap: 12px;
|
|
21
21
|
justify-content: space-between;
|
|
22
|
-
`,
|
|
22
|
+
`,ve=n.div`
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
25
|
padding: 12px;
|
|
@@ -29,7 +29,7 @@ import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react"
|
|
|
29
29
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
30
30
|
overflow-y: auto;
|
|
31
31
|
overflow-x: hidden;
|
|
32
|
-
`,
|
|
32
|
+
`,we=n.div`
|
|
33
33
|
display: flex;
|
|
34
34
|
align-items: center;
|
|
35
35
|
gap: 12px;
|
|
@@ -40,13 +40,13 @@ import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react"
|
|
|
40
40
|
&:hover {
|
|
41
41
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
42
42
|
}
|
|
43
|
-
`,
|
|
43
|
+
`,ke=n.div`
|
|
44
44
|
display: flex;
|
|
45
45
|
align-items: center;
|
|
46
46
|
justify-content: flex-end;
|
|
47
47
|
gap: 16px;
|
|
48
48
|
padding: 0 24px;
|
|
49
|
-
`,
|
|
49
|
+
`,Ce=({isOpen:l,onClose:o,connections:n,selectedConnectionIds:s,setSelectedConnectionIds:r,onApply:x})=>{const $=i(),[A,L]=t(""),R=a(()=>n.filter(e=>!A||e.name.toLowerCase().includes(A.toLowerCase())),[n,A]),P=s.length>0,I=e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[D,S]=t(!1),[V,z]=t(!1),[O,M]=t(void 0),{formData:j,handleFormChange:T,resetFormData:N}=d({automaticRollout:!0});return e.createElement(c,{isOpen:l,hideOverlay:!0,width:be,header:{icon:q,title:"Cluster Configuration",onClose:o}},e.createElement(me,null,e.createElement(ye,null,e.createElement(u,{width:"40%",value:A,onChange:L})),e.createElement(he,null,e.createElement(fe,{$width:"40%"},e.createElement(p,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(p,{$gap:8},e.createElement(g,{size:b.XS},"Clusters"),e.createElement(m,{label:n.length,status:y.Unknown})),e.createElement(p,{$gap:8},e.createElement(g,{size:b.XXXS,color:$.v2.colors.silver[200]},"Selected"),e.createElement(m,{label:`${s.length}/${n.length}`,status:y.Unknown}))),e.createElement(ve,{$isFooterOpen:P,$borderRadius:"16px 0 0 16px"},R.map(t=>e.createElement(we,{key:t.id,onClick:()=>I(t.id)},e.createElement(h,{value:s.includes(t.id),onChange:()=>I(t.id)}),e.createElement(g,{size:b.XS},t.name))))),e.createElement(fe,{$width:"60%"},e.createElement(p,{$padding:"2px 12px"},e.createElement(g,{size:b.XS},"Configurations")),e.createElement(ve,{$isFooterOpen:P,$borderRadius:"0 16px 16px 0"},e.createElement(p,{$gap:12},e.createElement(f,{size:v.S,label:"Automatic Rollout "+(j.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:j.automaticRollout,onChange:e=>T("automaticRollout",e)})))))),P&&e.createElement(ke,null,V?e.createElement(w,{label:"Applying configurations...",icon:G,withGradient:!0,typographyProps:{size:b.XXS}}):O?e.createElement(g,{size:b.XXS,color:$.v2.colors.red[500]},O):null,e.createElement("div",{style:{width:"150px"}},e.createElement(k,{variant:C.Secondary,label:"Cancel",fullWidth:!0,onClick:()=>S(!0),disabled:V})),e.createElement("div",{style:{width:"150px"}},e.createElement(k,{variant:C.Primary,label:"Apply",fullWidth:!0,onClick:async()=>{z(!0);const{error:e}=await x(s,j);z(!1),e?M(e):o()},disabled:V}))),D&&e.createElement(ue,{onDeny:()=>S(!1),onApprove:()=>{N(),r([]),S(!1),o()}}))};var xe;!function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(xe||(xe={}));const $e=[{key:xe.Name,label:"Name",sortable:!0},{key:xe.Type,label:"Type",sortable:!0,textAlign:"right"},{key:xe.Status,label:"Status",sortable:!0},{key:xe.OdigosVersion,label:"Odigos Version",sortable:!0},{key:xe.ConnectedSince,label:"Connected Since",sortable:!0},{key:xe.LastActivity,label:"Last Activity",sortable:!0}],Ae=({tableRowsMaxHeight:n,connections:i,getConnections:s,onClickConnection:r,deleteConnection:d,applyConfigurations:c})=>{const{formatTimeAgo:u}=x(),[p,g]=t(!1),[b,h]=t(i||[]),[f,v]=t(""),w=l(async()=>{try{g(!0),h(await s()??[])}catch(e){}finally{g(!1)}},[]);o(()=>{b.length||w()},[b.length,w]);const[k,V]=t(null),[z,O]=t([]),[M,j]=t(!1),T=a(()=>b.filter(e=>!f||e.name.toLowerCase().includes(f.toLowerCase())).map(t=>({onClick:()=>r(t),isSelected:z.includes(t.id),onSelect:()=>O(e=>[...e,t.id]),onDeselect:()=>O(e=>e.filter(e=>e!==t.id)),cells:[{key:xe.Id,rawValue:t.id},{key:xe.Name,rawValue:t.name},{key:xe.Type,rawValue:t.type},{key:xe.Status,rawValue:t.status,component:()=>(t=>{const a=t===S.Success?"Connection live":"Connection lost",l=t===S.Success?Q:X;return e.createElement(m,{status:t,label:a,leftIcon:l})})(t.status)},{key:xe.OdigosVersion,rawValue:t.odigosVersion},{key:xe.ConnectedSince,rawValue:t.connectedAt?u(t.connectedAt):"-"},{key:xe.LastActivity,rawValue:t.lastSeenAt?u(t.lastSeenAt):"-"}]})),[b,z,f]);return e.createElement($,null,e.createElement(A,{backgroundWeight:"1000",icon:q,title:"Connections",badge:{label:b.length.toString(),status:y.Unknown},search:{placeholder:"Search by cluster name",value:f,onChange:e=>v(e)},actions:[{id:L(),type:R.Button,buttonProps:{variant:C.Secondary,size:P.S,leftIcon:K,onClick:()=>w(),disabled:p}},{id:L(),type:R.Button,buttonProps:{variant:C.Primary,size:P.S,label:"Configurations",rightIcon:B,onClick:()=>j(!0)}}]},e.createElement(I,{variant:D.Pretty,maxHeight:n,isLoading:p,withCheckboxes:!0,columns:$e,rows:T,rowActionsPushRightPosition:M?`calc(${be} - 24px)`:void 0,getRowActions:({cells:e})=>[{id:L(),leftIcon:B,onClick:()=>{const t=e.find(e=>e.key===xe.Id)?.rawValue;t&&(O([t.toString()]),j(!0))}},{id:L(),leftIcon:J,disabled:e.find(e=>e.key===xe.Status)?.rawValue===S.Success,onClick:()=>{const t=e.find(e=>e.key===xe.Id)?.rawValue;t&&V(t.toString())}}]}),e.createElement(Ce,{isOpen:M,onClose:()=>{O([]),j(!1)},connections:b,selectedConnectionIds:z,setSelectedConnectionIds:O,onApply:c}),k&&e.createElement(pe,{target:"connection",onDeny:()=>V(null),onApprove:async()=>{k&&(await d(k),w())}})))},Le=n.div`
|
|
50
50
|
display: flex;
|
|
51
51
|
align-items: center;
|
|
52
52
|
justify-content: space-between;
|
|
@@ -58,10 +58,10 @@ import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react"
|
|
|
58
58
|
&:hover {
|
|
59
59
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
62
|
-
animation-name: ${
|
|
63
|
-
`,
|
|
61
|
+
`,Re=n.div`
|
|
62
|
+
animation-name: ${V.animations.fade.in};
|
|
63
|
+
`,Pe=({pod:l,getExtendedPodInfo:n,onClose:i})=>{const{formatTimeAgo:s}=x(),[d,u]=t(null),[p,b]=t(!1);o(()=>{l?n(l.namespace,l.name).then(e=>u(e??null)):(u(null),b(!1))},[l]);const m=a(()=>[{id:L(),title:"Node",label:d?.node??"-",withCopy:!0},{id:L(),title:"Status",badge:{status:z(d?.status),label:d?.status??"-"}}],[d]),y=a(()=>d?.containers?.map(e=>({id:L(),items:[{id:L(),title:"Container",label:e.name??"-"},{id:L(),title:"Status",badge:{status:z(e.status),label:e.status??"-"},label:e.startedAt?`(since ${s(e.startedAt)})`:""},{id:L(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:L(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:L(),title:"Restarts",label:e.restarts.toString()},{id:L(),title:"State Reason",label:e.stateReason??"-"},{id:L(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:L(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[d]);return e.createElement(c,{isOpen:!!l,header:{icon:Z,title:"Pod Information",onClose:i}},d?null:e.createElement(O,null,e.createElement(M,null)),d?e.createElement(e.Fragment,null,e.createElement(A,{icon:Z,title:d.name,withCopyTitle:!0},e.createElement(r,{$gap:24},e.createElement(j,{cellsPerRow:2,items:m}),y.length>0&&e.createElement(r,{$gap:12},e.createElement(Le,{onClick:()=>b(e=>!e)},e.createElement(g,null,"Containers Overview"),e.createElement(T,{icon:p?_:ee})),p&&y.map(({id:t,items:a})=>e.createElement(Re,{key:t},e.createElement(j,{cellsPerRow:2,items:a})))))),e.createElement(A,{icon:te,title:"Kubectl Commands"},e.createElement(r,{$gap:12},e.createElement(N,{value:`kubectl get pod ${d.name} -n ${d.namespace} -o yaml`}),e.createElement(N,{value:`kubectl describe pod ${d.name} -n ${d.namespace}`}),e.createElement(N,{value:`kubectl logs ${d.name} -n ${d.namespace}`}))),e.createElement(re,{yaml:d.manifestYAML})):null)};var Ie;!function(e){e.PodName="podName",e.Ready="ready",e.Started="started",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(Ie||(Ie={}));const De=[{key:Ie.PodName,label:"Pod Name",sortable:!0},{key:Ie.Ready,label:"Ready",sortable:!0,textAlign:"right"},{key:Ie.Started,label:"Started",sortable:!0,textAlign:"right"},{key:Ie.Status,label:"Status",sortable:!0},{key:Ie.Restarts,label:"Restarts",sortable:!0,textAlign:"right"},{key:Ie.NodeName,label:"Node Name",sortable:!0},{key:Ie.Age,label:"Age",sortable:!0,textAlign:"right"},{key:Ie.DockerImage,label:"Docker Image",sortable:!0,textAlign:"right"}],Se=({isLoading:l,tableRowsMaxHeight:o,pods:n,getExtendedPodInfo:s})=>{const r=i(),{formatTimeAgo:d}=x(),[c,u]=t(null),p=a(()=>{const t=t=>t?e.createElement(ae,{fill:U(r,S.Success,"500"),size:20}):e.createElement(le,{fill:U(r,S.Error,"500"),size:20});return n.map(a=>({onClick:()=>u(a),cells:[{key:Ie.PodName,rawValue:a.name},{key:Ie.Ready,rawValue:a.ready,component:()=>t(a.ready)},{key:Ie.Started,rawValue:a.started,component:()=>t(a.started)},{key:Ie.Status,rawValue:a.status,component:()=>{return t=a.status,e.createElement(m,{status:z(t),label:t});var t}},{key:Ie.Restarts,rawValue:a.restartsCount.toString()},{key:Ie.NodeName,rawValue:a.nodeName},{key:Ie.Age,rawValue:d(a.creationTimestamp)},{key:Ie.DockerImage,rawValue:a.image}]}))},[n,r]);return e.createElement(A,{icon:Z,title:"Pods"},e.createElement(I,{variant:D.Data,maxHeight:o,isLoading:l,columns:De,rows:p}),e.createElement(Pe,{pod:c,getExtendedPodInfo:s,onClose:()=>u(null)}))};var Ve;!function(e){e.Gateway="gateway",e.Node="node"}(Ve||(Ve={}));const ze=[{value:Ve.Gateway,label:"Gateway"},{value:Ve.Node,label:"Node Collector"}],Oe=n.div`
|
|
64
64
|
display: flex;
|
|
65
65
|
align-items: center;
|
|
66
66
|
justify-content: space-between;
|
|
67
|
-
`,
|
|
67
|
+
`,Me=({selectedTab:t,setSelectedTab:a,onClickDownloadDiagnose:l,onClickRefresh:o,loading:n,disabled:i})=>e.createElement(Oe,null,e.createElement(p,{$gap:12},e.createElement(p,{$gap:8},e.createElement(oe,{size:32}),e.createElement(g,{size:b.M,weight:500},"Pipeline Collectors")),e.createElement(E,{options:ze,selected:t,setSelected:a,disabled:i})),e.createElement(p,{$gap:8},l&&e.createElement(k,{label:"Download Diagnose",leftIcon:ne,size:P.S,variant:C.Text,onClick:l,disabled:i}),o&&e.createElement(k,{label:"Refresh",leftIcon:K,size:P.S,variant:C.Text,onClick:o,loading:n,disabled:i}))),je=({isOpen:t,onClose:a,title:l,yaml:o})=>e.createElement(c,{isOpen:t,header:{icon:ie,title:l,onClose:a}},e.createElement(re,{yaml:o}));var Te;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Te||(Te={}));const Ne=({icon:a,title:l,badge:o,statusCard:n,textCards:i,manifestYaml:s,configMapYaml:r})=>{const[d,c]=t(null);return e.createElement(A,{icon:a,title:l,badge:o,actions:[{id:L(),type:R.ButtonDropData,buttonProps:{variant:C.Secondary,size:P.S,label:"View YAML",onClick:e=>c(e)},dropDataItems:[{id:Te.ManifestYaml,label:l,icon:se},{id:Te.ConfigMapYaml,label:"ConfigMap",icon:se}]}]},e.createElement(p,{$gap:16},e.createElement(F,{...n}),i.map(t=>e.createElement(H,{key:t.title,...t}))),e.createElement(je,{isOpen:d===Te.ManifestYaml,onClose:()=>c(null),title:l,yaml:s}),e.createElement(je,{isOpen:d===Te.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:r}))},Ue=e=>{switch(e){case W.Healthy:return"All desired replicas are updated, available, and ready";case W.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case W.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case W.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case W.Down:return"No available replicas";case W.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},Ee=({tableRowsMaxHeight:n,getGatewayInfo:i,getGatewayPods:s,getNodeCollectorInfo:r,getNodeCollectorPods:d,getExtendedPodInfo:c})=>{const{formatTimeAgo:u}=x(),{isVersionSupported:p,version:g}=de(1.12),[b,m]=t(!1),[h,f]=t(Ve.Gateway),[v,w]=t(null),[k,C]=t([]),[A,L]=t(null),[R,P]=t([]),I=l(async()=>{m(!0);try{switch(h){case Ve.Gateway:w(await i()??null),C(await s()??[]);break;case Ve.Node:L(await r()??null),P(await d()??[])}}catch(e){}m(!1)},[h]);o(()=>{I()},[I]);const D=a(()=>(e=>{switch(e){case Ve.Gateway:return"Deployment";case Ve.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(h),[h]),V=a(()=>((e,t,a,l)=>{const o={status:y.Disabled,label:"No rollouts yet"};let n=!1,i=null;switch(e){case Ve.Gateway:n=t?.rolloutInProgress??!1,i=t?.lastRolloutAt??null;break;case Ve.Node:n=a?.rolloutInProgress??!1,i=a?.lastRolloutAt??null;break;default:return o}return n?{status:S.Info,label:"Rollout in progress",rightIcon:K,useSecondaryTone:!0}:i?{status:y.Disabled,label:`Last Rollout: ${l(i)}`}:o})(h,v,A,u),[v,A,h,u]),O=a(()=>((e,t,a,l)=>{let o=l?S.Info:y.Unknown,n=l?"Loading":W.Unknown,i=l?"Fetching data...":Ue(W.Unknown);switch(e){case Ve.Gateway:o=t?.status?z(t?.status):o,n=t?.status??n,i=t?.status?Ue(t.status):i;break;case Ve.Node:o=a?.status?z(a?.status):o,n=a?.status??n,i=a?.status?Ue(a.status):i}return{status:o,title:n,description:i}})(h,v,A,b),[v,A,h,b]),M=a(()=>((e,t,a,l)=>{switch(e){case Ve.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 Ve.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[]}})(h,v,A,b),[v,A,h,b]),j=a(()=>(h===Ve.Gateway?v?.manifestYAML:A?.manifestYAML)??"",[v,A,h]),T=a(()=>(h===Ve.Gateway?v?.configMapYAML:A?.configMapYAML)??"",[v,A,h]),N=a(()=>h===Ve.Gateway?k:R,[k,R,h]);return e.createElement($,null,e.createElement(Me,{disabled:!p,loading:b,selectedTab:h,setSelectedTab:f,onClickDownloadDiagnose:void 0,onClickRefresh:I}),e.createElement(Y,null,e.createElement(Ne,{icon:ie,title:D,badge:V,statusCard:O,textCards:M,manifestYaml:j,configMapYaml:T}),e.createElement(Se,{isLoading:b,tableRowsMaxHeight:n,pods:N,getExtendedPodInfo:c}),!p&&e.createElement(ge,{minSupportedVersion:1.12,currentVersion:g||""})))};export{Ae as CentralConnections,Ee as PipelineCollectors};
|