@odigos/ui-kit 0.0.186 → 0.0.188

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +409 -0
  2. package/README.md +16 -12
  3. package/lib/chunks/ui-components-DKFg9nOZ.js +2296 -0
  4. package/lib/components/_v2/drop-data/index.d.ts +9 -7
  5. package/lib/components/_v2/input/index.d.ts +3 -1
  6. package/lib/components/_v2/loader/index.d.ts +3 -1
  7. package/lib/components/_v2/segment/index.d.ts +1 -2
  8. package/lib/components/_v2/table/styled.d.ts +29 -18
  9. package/lib/components/_v2/table/types.d.ts +2 -0
  10. package/lib/components/selection-button/index.d.ts +1 -1
  11. package/lib/components/styled.d.ts +46 -50
  12. package/lib/components/tab-list/index.d.ts +4 -3
  13. package/lib/components/text/index.d.ts +1 -1
  14. package/lib/components/v2.js +1 -1
  15. package/lib/components.js +1 -1
  16. package/lib/constants/sources/index.d.ts +5 -1
  17. package/lib/constants.js +1 -1
  18. package/lib/containers/_v2/central-connections/config-drawer/index.d.ts +6 -8
  19. package/lib/containers/_v2/central-connections/index.d.ts +5 -6
  20. package/lib/containers/_v2/central-connections/source-drawer/index.d.ts +1 -1
  21. package/lib/containers/_v2/central-connections/source-drawer/styled.d.ts +15 -15
  22. package/lib/containers/_v2/index.d.ts +1 -0
  23. package/lib/containers/_v2/pipeline-collectors/pods-info/index.d.ts +1 -1
  24. package/lib/containers/_v2/system-drawer/describe/index.d.ts +10 -0
  25. package/lib/containers/_v2/system-drawer/diagnose/index.d.ts +6 -0
  26. package/lib/containers/_v2/system-drawer/index.d.ts +11 -0
  27. package/lib/containers/_v2/system-drawer/tokens/index.d.ts +7 -0
  28. package/lib/containers/_v2/system-drawer/tokens/token-actions.d.ts +12 -0
  29. package/lib/containers/_v2/system-drawer/tokens/token-expires-at.d.ts +6 -0
  30. package/lib/containers/_v2/system-drawer/tokens/token-input.d.ts +8 -0
  31. package/lib/containers/data-flow/column/frame.d.ts +0 -1
  32. package/lib/containers/data-flow/column/index.d.ts +0 -1
  33. package/lib/containers/data-flow-actions-menu/search/search-results/builder.d.ts +1 -1
  34. package/lib/containers/data-flow-actions-menu/styled.d.ts +9 -5
  35. package/lib/containers/instrumentation-rule-modal/index.d.ts +0 -1
  36. package/lib/containers/source-drawer/describe/index.d.ts +1 -1
  37. package/lib/containers/source-drawer/odigos-health/index.d.ts +1 -2
  38. package/lib/containers/v2.js +27 -20
  39. package/lib/containers.js +128 -130
  40. package/lib/contexts/odigos-context.d.ts +11 -9
  41. package/lib/contexts.js +1 -1
  42. package/lib/functions.js +1 -1
  43. package/lib/hooks/index.d.ts +0 -1
  44. package/lib/hooks/useActionFormData.d.ts +1 -1
  45. package/lib/hooks.js +1 -1
  46. package/lib/icons/auth/index.d.ts +1 -0
  47. package/lib/icons/auth/okta-icon/index.d.ts +2 -0
  48. package/lib/icons/common/diagnose-icon/index.d.ts +2 -0
  49. package/lib/icons/common/index.d.ts +1 -0
  50. package/lib/icons.js +1 -1
  51. package/lib/mock-data/sources/index.d.ts +2 -19
  52. package/lib/snippets/_v2/yaml-section-card/index.d.ts +2 -0
  53. package/lib/snippets/add-button/index.d.ts +1 -1
  54. package/lib/snippets/source-container/index.d.ts +1 -1
  55. package/lib/snippets/source-container/override-runtime.d.ts +2 -1
  56. package/lib/snippets.js +1 -1
  57. package/lib/store.js +1 -1
  58. package/lib/theme/animations/index.d.ts +28 -22
  59. package/lib/theme/index.d.ts +3 -12
  60. package/lib/theme.js +1 -1
  61. package/lib/types/common/index.d.ts +1 -1
  62. package/lib/types/diagnose/index.d.ts +6 -0
  63. package/lib/types/enum/index.d.ts +23 -1
  64. package/lib/types/index.d.ts +1 -0
  65. package/lib/types/instrumentation-instances/index.d.ts +1 -0
  66. package/lib/types/pipeline-collectors/index.d.ts +9 -0
  67. package/lib/types/sources/index.d.ts +4 -2
  68. package/lib/types.js +1 -1
  69. package/lib/visuals/index.d.ts +1 -2
  70. package/lib/visuals/visual-green-rings/index.d.ts +7 -0
  71. package/lib/visuals.js +1 -1
  72. package/package.json +1 -1
  73. package/lib/chunks/ui-components-BtsFYm8P.js +0 -2286
  74. package/lib/hooks/useConnection.d.ts +0 -3
  75. package/lib/visuals/visual-star/index.d.ts +0 -2
  76. package/lib/visuals/visual-success/index.d.ts +0 -2
  77. /package/lib/theme/{palletes → palettes}/index.d.ts +0 -0
@@ -1,8 +1,8 @@
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,Y as Z,Q 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-BtsFYm8P.js";import{SourceIcon as re,VSquareIcon as ce,SettingsIcon as de,OdigosLogo as ue,RefreshIcon as pe,ConnectionsIcon 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-1oZp1FpB.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const Ie=o(i)`
1
+ import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useMemo as a,useState as n,useEffect as i,useCallback as o}from"react";import s,{useTheme as r}from"styled-components";import{F as c,a as d,C as u,T as p,b as h,B as g,S as m,c as b,O as f,N as w,d as y,e as k,f as C,u as v,g as x,D as $,E as S,h as I,i as T,j as D,L as A,P,R as z,k as R,l as N,m as O,n as V,o as M,p as L,q as W,r as F,s as j,t as E,v as G,A as U,w as H,x as Y,y as q,z as B,G as X,H as K,I as J,J as Q,K as Z,M as _,Q as ee,Y as te,U as le,V as ae,W as ne,X as ie,Z as oe,_ as se,$ as re,a0 as ce,a1 as de,a2 as ue,a3 as pe,a4 as he,a5 as ge,a6 as me,a7 as be}from"../chunks/ui-components-DKFg9nOZ.js";import{SourceIcon as fe,VSquareIcon as we,SettingsIcon as ye,OdigosLogo as ke,DeleteIcon as Ce,RefreshIcon as ve,ConnectionsIcon as xe,VIcon as $e,XIcon as Se,XSquareIcon as Ie,PodIcon as Te,ChevronUpIcon as De,ChevronDownIcon as Ae,TerminalIcon as Pe,ArrowDownSquareIcon as ze,ArrowUpSquareIcon as Re,DownloadIcon as Ne,PipelineCollectorIcon as Oe,GatewayIcon as Ve,YamlIcon as Me,EditIcon as Le,KeyIcon as We,DiagnoseIcon as Fe}from"../icons.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-1oZp1FpB.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const je=s(c)`
2
2
  width: ${({$width:e})=>e};
3
3
  gap: 12px;
4
4
  justify-content: space-between;
5
- `,Ae=o.div`
5
+ `,Ee=s.div`
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  padding: 12px;
@@ -13,7 +13,7 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
13
13
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
14
14
  overflow-y: auto;
15
15
  overflow-x: hidden;
16
- `,Re=o.div`
16
+ `,Ge=s.div`
17
17
  display: flex;
18
18
  align-items: center;
19
19
  justify-content: space-between;
@@ -25,55 +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
- `,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`
28
+ `,Ue=({formData:l,handleSourceChange:n,handleSelectAll:i,selectedArea:o,searchText:s,filters:c})=>{const y=r(),{activeNamespace:k,isAll:C,isSome:v}=a(()=>{const e=o.value.clusterId&&o.value.namespaceName?l.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}},[l,o.value.clusterId,o.value.namespaceName]),x=a(()=>{if(!k)return[];const{clusterId:l}=o.value,{name:a,workloads:i}=k;return i.map(({name:i,selected:o,kind:r})=>{if(s&&!i.toLowerCase().includes(s.toLowerCase()))return null;const b=o||!1;if(c.showOnlySelected&&!b)return null;const f=()=>n({clusterId:l,workloadId:{namespace:a,name:i,kind:r}});return e(Ge,{onClick:f,children:[e(d,{$gap:12,children:[t(u,{value:b,onChange:f}),t(p,{size:h.XS,children:i})]}),t(g,{label:r,status:m.Info,textSize:h.XXXS,backgroundColor:y.v2.colors.blue[900]})]},`${l}#${a}#${i}#${r}`)})},[l,o.value.clusterId,k,s,c]);return e(je,{$width:"50%",children:[e(d,{$padding:"0 12px 0 28px",$gap:12,children:[t(b,{text:(C?"Unselect":"Select")+" all workloads in the selected namespace",children:t(u,{partiallyChecked:v,value:C,onChange:()=>i({clusterId:o.value.clusterId,namespaceName:o.value.namespaceName,boolean:!C}),disabled:!x.length})}),e(d,{$gap:8,children:[t(p,{size:h.XS,nowrap:!0,children:o.value.clusterId?`${o.value.clusterName} > ${o.value.namespaceName} > Workloads`:"Workloads"}),t(g,{label:x.length,status:f.Unknown})]})]}),t(Ee,{$borderRadius:"0 16px 16px 0",children:x.length?x:t(w,{title:"Workloads not found",subTitle:"Please select a namespace to view workloads"})})]})},He=({formData:l,handleSourceChange:n,handleSelectAll:i,selectedArea:o,searchText:s,filters:c})=>{const v=r(),{isAll:x,isSome:$}=a(()=>{const e=l.length>0&&l.every(({namespaces:e})=>e.every(({workloads:e})=>e.every(({selected:e})=>e)));return{isAll:e,isSome:!e&&l.length>0&&l.some(({namespaces:e})=>e.some(({workloads:e})=>e.some(({selected:e})=>e)))}},[l]),S=a(()=>l.flatMap(({clusterId:l,clusterName:a,namespaces:i})=>i.map(({name:i,workloads:r,selected:w})=>{if(s&&!i.toLowerCase().includes(s.toLowerCase()))return null;const x=r.filter(({selected:e})=>e).length,$=x>0&&x===r.length,S=x>0&&x<r.length,I=w||!1;if(c.showOnlySelected&&!$&&!S&&!I)return null;const T=o.value.clusterId===l&&o.value.namespaceName===i,D=()=>o.setValue({clusterId:l,clusterName:a,namespaceName:i}),A=e=>{D(),n({clusterId:l,workloadId:{namespace:i},auto:e.auto,selected:e.all})};return e(Ge,{$isSelected:T,onClick:D,children:[e(d,{$gap:12,children:[t(u,{partiallyChecked:S,value:$,onChange:e=>A({auto:e,all:e})}),t(p,{size:h.XS,children:`${a} > ${i}`})]}),e(d,{$gap:12,children:[t(b,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(y,{label:"Auto",size:k.S,value:I,onChange:e=>A({auto:e,all:e||void 0})})}),e(d,{$gap:8,children:[t(p,{variant:C.Span,size:h.XXXS,color:v.v2.colors.silver[200],align:"right",children:"Selected"}),t(g,{label:`${x}/${r.length}`,status:T?m.Default:f.Unknown,minWidth:"42px"})]})]})]},`${l}#${i}`)})),[l,o.value.clusterId,o.value.namespaceName,s,c]);return e(je,{$width:"50%",children:[e(d,{$padding:"0 12px 0 28px",$gap:12,children:[t(b,{text:(x?"Unselect":"Select")+" all workloads in all namespaces",children:t(u,{partiallyChecked:$,value:x,onChange:()=>i({boolean:!x}),disabled:!S.length})}),e(d,{$gap:8,children:[t(p,{size:h.XS,nowrap:!0,children:"Namespaces"}),t(g,{label:S.length,status:f.Unknown})]})]}),t(Ee,{$borderRadius:"16px 0 0 16px",children:S.length?S:t(w,{title:"Namespaces not found",subTitle:""})})]})},Ye="75vw",qe=s.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
- `,Ne=o.div`
34
+ `,Be=s.div`
35
35
  display: flex;
36
36
  gap: 12px;
37
37
  padding: 16px;
38
38
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
39
39
  position: sticky;
40
40
  top: 0;
41
- `,Le=o.div`
41
+ `,Xe=s.div`
42
42
  display: flex;
43
43
  gap: 12px;
44
44
  padding: 16px;
45
- `,Ve=o.div`
45
+ `,Ke=s.div`
46
46
  padding: 5vh 10vw;
47
47
  border-radius: 12px;
48
48
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
49
- `,Me=o.div`
49
+ `,Je=s.div`
50
50
  display: flex;
51
51
  align-items: center;
52
52
  justify-content: flex-end;
53
53
  gap: 16px;
54
54
  padding: 0 12px;
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`
55
+ `,Qe=({onClose:l,snapshots:s,selectedConnectionIds:c,setSelectedConnectionIds:u,persistSources:g})=>{const b=r(),{selectedStreamName:f}=v(),{progress:w,resetProgress:C}=x(),L=a(()=>f||$,[f]),[W,F]=n(""),[j,E]=n(S.Namespace),[G,U]=n({showOnlySelected:!1}),[H,Y]=n(!1),[q,B]=n(!1),[X,K]=n(void 0),[J,Q]=n({clusterId:"",clusterName:"",namespaceName:""}),[Z,_]=n([]);i(()=>{_(e=>{const t=((e,t)=>I(((e,t)=>e.clusters.filter(({clusterId:e})=>t.includes(e)))(e,t)))(s,c);return t.map(t=>{const l=e?.find(e=>e.clusterId===t.clusterId);return l??t})})},[s,c]);const{formDiff:ee,isFormDirty:te}=a(()=>{const e=((e,t,l)=>{const a={};return e.forEach(e=>{e.namespaces.forEach(n=>{const i=t.find(t=>t.clusterId===e.clusterId)?.namespaces.find(e=>e.name===n.name),o=n.selected||!1,s=o!==i?.selected;if(s&&(a[e.clusterId]||(a[e.clusterId]=[]),a[e.clusterId].push({namespace:n.name,selected:o,currentStreamName:l}),o&&(a[e.clusterId]=a[e.clusterId].filter(e=>e.namespace!==n.name||e.namespace===n.name&&(!e.name||!e.kind)))),!s||!o){const t=((e,t,l)=>{const a=[];return t.workloads.forEach(n=>{const i=e?.workloads.find(e=>e.name===n.name&&e.kind===n.kind);n.selected!==i?.selected&&a.push({namespace:t.name,name:n.name,kind:n.kind,selected:n.selected||!1,currentStreamName:l})}),a})(i,n,l);t.length>0&&(a[e.clusterId]||(a[e.clusterId]=[]),a[e.clusterId].push(...t))}})}),a})(Z,s.clusters,L);return{formDiff:e,isFormDirty:Object.keys(e).length>0}},[Z,s,L]),le=o(({clusterId:e,workloadId:t,selected:l,auto:a})=>{_(n=>{const i=I(n),o=i.findIndex(t=>t.clusterId===e);if(-1===o)return i;const s=i[o].namespaces.findIndex(e=>e.name===t.namespace);if(-1===s)return i;if(t.kind&&t.name){const e=i[o].namespaces[s].workloads.findIndex(e=>e.name===t.name&&e.kind===t.kind);if(-1===e)return i;const a="boolean"==typeof l?l:!i[o].namespaces[s].workloads[e].selected;i[o].namespaces[s].workloads[e].selected=a,a?i[o].namespaces[s].workloads.every(e=>e.selected)&&(i[o].namespaces[s].selected=!0):i[o].namespaces[s].selected=!1}else{const e="boolean"==typeof a?a:!i[o].namespaces[s].selected;i[o].namespaces[s].selected=e,e?i[o].namespaces[s].workloads.forEach(e=>{e.selected=!0}):"boolean"!=typeof l||l||i[o].namespaces[s].workloads.forEach(e=>{e.selected=!1})}return i})},[]),ae=o(({clusterId:e,namespaceName:t,boolean:l})=>{_(a=>{const n=I(a);return n.forEach((a,i)=>{e&&a.clusterId!==e||a.namespaces.forEach(({name:e,workloads:a},o)=>{t&&e!==t||(n[i].namespaces[o].selected=l,a.forEach((e,t)=>{n[i].namespaces[o].workloads[t].selected=l}))})}),n})},[]),ne=()=>{Y(!1),l()};return e(T,{isOpen:!0,hideOverlay:!q,width:Ye,header:{icon:fe,title:"Manage Sources",onClose:l,onCloseDisabled:q},children:[q?t(D,{$height:"calc(100vh - 136px)",children:t(Ke,{children:t(A,{title:"Creating Sources...",titleSize:h.S,subTitle:"This may take a few moments while sources are being created.",subTitleSize:h.XXXS,withGradient:!0,withSpinner:!0,percentage:w[P.BulkInstrumenting]?.percentage||0})})}):e(qe,{children:[e(Be,{children:[t(z,{icon:we,title:"Selected Clusters",badge:{label:c.length}}),t(R,{width:"300px",value:W,onChange:F,segment:{options:[{label:"Namespace",value:S.Namespace},{label:"Source",value:S.Source}],selected:j,setSelected:E}}),e(d,{$gap:8,children:[t(p,{size:h.XXXS,color:b.v2.colors.silver[200],nowrap:!0,children:"Show only:"}),t(y,{size:k.S,label:"Selected",value:G.showOnlySelected,onChange:e=>U(t=>({...t,showOnlySelected:e}))})]})]}),e(Xe,{children:[t(He,{formData:Z,handleSourceChange:le,handleSelectAll:ae,selectedArea:{value:J,setValue:Q},searchText:j===S.Namespace?W:"",filters:G}),t(Ue,{formData:Z,handleSourceChange:le,handleSelectAll:ae,selectedArea:{value:J,setValue:Q},searchText:j===S.Source?W:"",filters:G})]})]}),e(Je,{children:[q?null:X?t(N,{fullWidth:!0,status:m.Error,message:X}):te?t(N,{fullWidth:!0,status:m.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):te?null:t(N,{fullWidth:!0,status:m.Success,message:"The values reflect the current configuration of the selected cluster."}),e(d,{$gap:8,children:[t("div",{style:{width:"150px"},children:t(O,{fullWidth:!0,variant:V.Secondary,label:"Cancel",onClick:()=>te?Y(!0):ne(),disabled:!te||q})}),t("div",{style:{width:"150px"},children:t(O,{fullWidth:!0,variant:V.Primary,label:"Save",onClick:async()=>{B(!0);const e=await g(ee);C(P.BulkInstrumenting),B(!1),e?.error?K(e.error):(u([]),l())},disabled:!te||q})})]})]}),t(M,{isOpen:H,onClose:()=>Y(!1),onApprove:ne})]})},Ze="75vw",_e=1.16,et=s.div`
56
56
  display: flex;
57
57
  flex-direction: column;
58
58
  border-radius: 16px;
59
59
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
60
60
  overflow: hidden;
61
- `,Fe=o.div`
61
+ `,tt=s.div`
62
62
  display: flex;
63
63
  gap: 12px;
64
64
  padding: 16px;
65
65
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
66
66
  position: sticky;
67
67
  top: 0;
68
- `,Ue=o.div`
68
+ `,lt=s.div`
69
69
  display: flex;
70
70
  gap: 12px;
71
71
  padding: 16px;
72
- `,Ee=o(i)`
72
+ `,at=s(c)`
73
73
  width: ${({$width:e})=>e};
74
74
  gap: 12px;
75
75
  justify-content: space-between;
76
- `,He=o.div`
76
+ `,nt=s.div`
77
77
  display: flex;
78
78
  flex-direction: column;
79
79
  padding: 12px;
@@ -84,7 +84,7 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
84
84
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
85
85
  overflow-y: auto;
86
86
  overflow-x: hidden;
87
- `,Ge=o.div`
87
+ `,it=s.div`
88
88
  display: flex;
89
89
  align-items: center;
90
90
  gap: 12px;
@@ -95,13 +95,13 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
95
95
  &:hover {
96
96
  background-color: ${({theme:e})=>e.v2.colors.silver[600]};
97
97
  }
98
- `,qe=o.div`
98
+ `,ot=s.div`
99
99
  display: flex;
100
100
  align-items: center;
101
101
  justify-content: flex-end;
102
102
  gap: 16px;
103
103
  padding: 0 12px;
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:ge,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:E(),type:U.Button,buttonProps:{variant:N.Secondary,size:F.S,leftIcon:pe,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:E(),tooltip:"Manage Sources",rightIcon:re,onClick:async()=>{Je(e,e=>{M([e]),L(Be.BulkSource)})}}:null,u&&m?{id:E(),tooltip:"Edit Configuration",rightIcon:de,onClick:async()=>{Je(e,e=>{M([e]),L(Be.BulkConfig)})}}:null]:[{id:E(),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:E(),type:U.Button,buttonProps:{variant:N.Text,size:F.S,label:"Cancel",onClick:()=>M([])}},I&&f?{id:E(),type:U.ButtonDropData,buttonProps:{variant:N.Secondary,size:F.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:E(),type:U.Button,buttonProps:{variant:N.Primary,size:F.S,label:"Manage Configurations",rightIcon:de,onClick:()=>L(Be.BulkConfig)}}:null]})))},Ze=o.div`
104
+ `,st=({onClose:l,connections:o,selectedConnectionIds:s,setSelectedConnectionIds:c,getEffectiveConfig:b,onApply:C})=>{const v=r(),[x,$]=n(""),[S,I]=n({showOnlySelected:!1}),D=a(()=>{const e=[],t=[];for(const l of o){const a=L(l.odigosVersion,_e),n=l.status===m.Success,i=s.includes(l.id),o=!S.showOnlySelected||i,r=!x||l.name.toLowerCase().includes(x.toLowerCase());a&&n&&o&&r?e.push(l):i&&t.push(l.id)}return t.length>0&&c(e=>e.filter(e=>!t.includes(e))),e},[o.length,s.length,x,S]),P=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[j,E]=n(!1),[G,U]=n(!1),[H,Y]=n(void 0),[q,B]=n(!1),[X,K]=n(void 0),{formData:J,handleFormChange:Q,areFormValuesEqual:Z,resetFormData:_}=W(X||{rollout:{automaticRolloutDisabled:!1}}),{isFormDirty:ee,isFormMatch:te}=a(()=>({isFormDirty:s.length>1||void 0!==X&&!Z(X,J),isFormMatch:1===s.length&&void 0!==X&&Z(X,J)}),[s.length,X,J]);i(()=>{1===s.length?(async e=>{if(q)return;B(!0);const t=await b(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled||!1}};K(e),_(e)}B(!1)})(s[0]):K(void 0)},[s.length]);const le=()=>{E(!1),l()};return e(T,{isOpen:!0,hideOverlay:!0,width:Ze,header:{icon:ye,title:"Cluster Configuration",onClose:l},children:[e(et,{children:[e(tt,{children:[t(z,{icon:we,title:"Selected Clusters",badge:{label:s.length}}),t(R,{width:"300px",placeholder:"Search by cluster name",value:x,onChange:$}),e(d,{$gap:8,children:[t(p,{size:h.XXXS,color:v.v2.colors.silver[200],nowrap:!0,children:"Show only:"}),t(y,{size:k.S,label:"Selected",value:S.showOnlySelected,onChange:e=>I(t=>({...t,showOnlySelected:e}))})]})]}),e(lt,{children:[e(at,{$width:"40%",children:[e(d,{$padding:"0 12px",$justifyContent:"space-between",children:[e(d,{$gap:8,children:[t(p,{size:h.XS,children:"Clusters"}),t(g,{label:D.length,status:f.Unknown})]}),e(d,{$gap:8,children:[t(p,{size:h.XXXS,color:v.v2.colors.silver[200],align:"right",children:"Selected clusters"}),t(g,{label:`${s.length}/${D.length}`,status:f.Unknown})]})]}),t(nt,{$borderRadius:"16px 0 0 16px",children:D.length?D.map(l=>e(it,{onClick:()=>P(l.id),children:[t(u,{value:s.includes(l.id),onChange:()=>P(l.id)}),t(p,{size:h.XS,children:l.name})]},l.id)):t(w,{title:"Clusters not found",subTitle:"Please select a cluster to update it's configuration"})})]}),e(at,{$width:"60%",children:[t(d,{$padding:"0 12px",children:t(p,{size:h.XS,children:"Configurations"})}),t(nt,{$borderRadius:"0 16px 16px 0",$gap:12,children:q?t(F,{}):t(y,{label:"Automatic Rollout 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 disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:J.rollout?.automaticRolloutDisabled||!1,onChange:e=>Q("rollout.automaticRolloutDisabled",e)})})]})]})]}),e(ot,{children:[q?t(A,{icon:ke,title:"Fetching Configuration...",titleSize:h.XXS,withGradient:!0}):G?t(A,{icon:ke,title:"Applying Configurations...",titleSize:h.XXS,withGradient:!0}):H?t(N,{fullWidth:!0,status:m.Error,message:H}):ee?t(N,{fullWidth:!0,status:m.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):te?t(N,{fullWidth:!0,status:m.Success,message:"The values reflect the current configuration of the selected cluster."}):null,e(d,{$gap:8,children:[t("div",{style:{width:"150px"},children:t(O,{fullWidth:!0,variant:V.Secondary,label:"Cancel",onClick:()=>ee?E(!0):le(),disabled:G})}),t("div",{style:{width:"150px"},children:t(O,{fullWidth:!0,variant:V.Primary,label:"Save",onClick:async()=>{U(!0);const e=await C(s,J);U(!1),e?.error?Y(e.error):(c([]),l())},disabled:!ee||G})})]})]}),t(M,{isOpen:j,onClose:()=>E(!1),onApprove:le})]})};var rt,ct;!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"}(rt||(rt={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(ct||(ct={}));const dt=[{key:ct.Name,label:"Name"},{key:ct.Type,label:"Type",textAlign:"right"},{key:ct.Status,label:"Status"},{key:ct.OdigosVersion,label:"Odigos Version"},{key:ct.ConnectedSince,label:"Connected Since"},{key:ct.LastActivity,label:"Last Activity"}],ut=(e,t)=>{const l=e.find(e=>e.key===ct.Id)?.rawValue;return t(l?.toString()||"")},pt=({tableRowsMaxHeight:l,connections:s,getConnections:c,onClickConnection:d,deleteConnection:u,getEffectiveConfig:p,applyConfigurations:h,getAllClusterSnapshots:b,persistSources:w})=>{const y=r(),{formatTimeAgo:k}=j(),[C,v]=n(!1),[x,$]=n(s||[]),[S,I]=n(!1),[T,D]=n(null),A=o(async()=>{try{v(!0),$(await c()??[])}catch(e){}finally{v(!1)}},[]),P=o(async()=>{if(b)try{I(!0),D(await b()??null)}catch(e){}finally{I(!1)}},[]);i(()=>{x.length||A()},[x.length,A]),i(()=>{T||P()},[T,P]);const[z,R]=n(""),[N,O]=n(null),[M,W]=n([]),F=a(()=>x.filter(e=>!z||e.name.toLowerCase().includes(z.toLowerCase())).map(e=>({cells:[{key:ct.Id,rawValue:e.id},{key:ct.Name,rawValue:e.name},{key:ct.Type,rawValue:e.type},{key:ct.Status,rawValue:e.status,component:()=>(e=>{const l=e===m.Success?"Connection live":"Connection lost",a=e===m.Success?$e:Se;return t(g,{status:e,label:l,leftIcon:a})})(e.status)},{key:ct.OdigosVersion,rawValue:e.odigosVersion},{key:ct.ConnectedSince,rawValue:e.connectedAt?k(e.connectedAt):"-"},{key:ct.LastActivity,rawValue:e.lastSeenAt?k(e.lastSeenAt):"-"}],onClick:e.status===m.Success?()=>d(e):void 0,isSelected:M.includes(e.id),onSelect:()=>W(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>W(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==m.Success||N===rt.BulkConfig&&!L(e.odigosVersion,_e)})),[x,M,z,N]),Q=o(({cells:e})=>{if(!(e=>e.find(e=>e.key===ct.Status)?.rawValue===m.Success)(e))return[{id:E(),label:"Delete Connection",rightIcon:Ce,onClick:()=>{ut(e,e=>{W([e]),O(rt.Delete)})}}];const t=ut(e,e=>{const t=x.find(t=>t.id===e);return t&&L(t.odigosVersion,_e)||!1});return[T&&w?{id:E(),tooltip:"Manage Sources",rightIcon:fe,onClick:async()=>{ut(e,e=>{W([e]),O(rt.BulkSource)})}}:null,p&&h?{id:E(),tooltip:t?"Edit Configuration":"To use this feature, please upgrade to Odigos v1.16 or later.",rightIcon:ye,disabled:!t,onClick:async()=>{ut(e,e=>{W([e]),O(rt.BulkConfig)})}}:null]},[x.length,T]),Z=a(()=>[{id:E(),type:U.Button,buttonProps:{variant:V.Text,size:G.S,label:"Cancel",onClick:()=>W([])}},T&&w?{id:E(),type:U.ButtonDropData,buttonProps:{variant:V.Secondary,size:G.S,label:"Add Component",onClick:e=>O(e)},dropDataProps:{alignX:H.Left,items:[{id:rt.BulkSource,label:"Add Source",icon:fe}]}}:null,p&&h?{id:E(),type:U.Button,buttonProps:{variant:V.Primary,size:G.S,label:"Manage Configurations",rightIcon:ye,onClick:()=>O(rt.BulkConfig)}}:null],[T]);return t(Y,{children:e(q,{richTitle:{icon:xe,title:"Connections",badge:{label:x.length.toString(),status:f.Unknown}},search:{placeholder:"Search by cluster name",value:z,onChange:e=>R(e),width:"300px"},actions:[{id:E(),type:U.Button,buttonProps:{variant:V.Secondary,size:G.S,leftIcon:ve,onClick:async()=>{await A(),await P()},disabled:C||S}}],children:[t(B,{variant:X.Pretty,maxHeight:l,headerBackgroundColor:y.v2.colors.silver[1e3],isLoading:C,withCheckboxes:!0,columns:dt,rows:F,rowActionsPushRightPosition:N?`calc(${N===rt.BulkConfig?Ze:Ye} - 24px)`:void 0,getRowActions:Q}),N===rt.BulkConfig&&p&&h&&t(st,{onClose:()=>O(null),connections:x,selectedConnectionIds:M,setSelectedConnectionIds:W,getEffectiveConfig:p,onApply:h}),N===rt.BulkSource&&T&&w&&t(Qe,{onClose:()=>O(null),snapshots:T,selectedConnectionIds:M,setSelectedConnectionIds:W,persistSources:async e=>{if(!w)return{error:"Persist sources function is not defined"};const t=await w(e);return t?.error||await P(),t}}),t(K,{target:"connection",isOpen:N===rt.Delete,onClose:()=>{W([]),O(null)},onApprove:async()=>{const e=M[0];e&&(await u(e),await A())}}),t(J,{isOpen:!!M.length&&!N,richTitle:{icon:we,title:"Selected Clusters",badge:{label:M.length}},actions:Z})]})})},ht=s.div`
105
105
  display: flex;
106
106
  align-items: center;
107
107
  justify-content: space-between;
@@ -113,10 +113,17 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
113
113
  &:hover {
114
114
  background: ${({theme:e})=>e.v2.colors.silver[700]};
115
115
  }
116
- `,_e=o.div`
117
- animation-name: ${_.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:E(),title:"Node",label:c?.node??"-",withCopy:!0},{id:E(),title:"Status",badge:{status:K(c?.status),label:c?.status??"-"}}],[c]),b=t(()=>c?.containers?.map(e=>({id:E(),items:[{id:E(),title:"Container",label:e.name??"-"},{id:E(),title:"Status",label:e.startedAt?`${e.status} (since ${r(e.startedAt)})`:e.status},{id:E(),title:"Ready",badge:{status:e.ready?g.Success:g.Error,leftIcon:e.ready?ce:fe,label:e.ready?"True":"False",invertColors:!0}},{id:E(),title:"Started",badge:{status:e.started?g.Success:g.Error,leftIcon:e.started?ce:fe,label:e.started?"True":"False",invertColors:!0}},{id:E(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:E(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:E(),title:"Restarts",label:e.restarts.toString()},{id:E(),title:"State Reason",label:e.stateReason??"-"},{id:E(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:E(),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(X,{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(J,{icon:p?we:Ce})),p&&b.map(({id:t,items:a})=>e.createElement(_e,{key:t},e.createElement(X,{cellsPerRow:2,items:a})))))),e.createElement(j,{richTitle:{icon:ve,title:"Kubectl Commands"}},e.createElement(i,{$gap:12},e.createElement(Q,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),e.createElement(Q,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),e.createElement(Q,{value:`kubectl logs ${c.name} -n ${c.namespace}`}))),e.createElement(Z,{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:K(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`
116
+ `,gt=s.div`
117
+ animation-name: ${le.in};
118
+ `,mt=({pod:o,getExtendedPodInfo:s,onClose:r})=>{const{formatTimeAgo:d}=j(),[u,h]=n(null),[g,b]=n(!1);i(()=>{o?s(o.namespace,o.name).then(e=>h(e??null)):(h(null),b(!1))},[o]);const f=a(()=>[{id:E(),title:"Node",label:u?.node??"-",withCopy:!0},{id:E(),title:"Status",badge:{status:Q(u?.status),label:u?.status??"-"}}],[u]),w=a(()=>u?.containers?.map(e=>({id:E(),items:[{id:E(),title:"Container",label:e.name??"-"},{id:E(),title:"Status",label:e.startedAt?`${e.status} (since ${d(e.startedAt)})`:e.status},{id:E(),title:"Ready",badge:{status:e.ready?m.Success:m.Error,leftIcon:e.ready?we:Ie,label:e.ready?"True":"False",invertColors:!0}},{id:E(),title:"Started",badge:{status:e.started?m.Success:m.Error,leftIcon:e.started?we:Ie,label:e.started?"True":"False",invertColors:!0}},{id:E(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:E(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:E(),title:"Restarts",label:e.restarts.toString()},{id:E(),title:"State Reason",label:e.stateReason??"-"},{id:E(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:E(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[u]);return e(T,{isOpen:!!o,header:{icon:Te,title:"Pod Information",onClose:r},children:[u?null:t(D,{children:t(F,{})}),u?e(l,{children:[t(q,{richTitle:{icon:Te,title:u.name,withCopy:!0},children:e(c,{$gap:24,children:[t(Z,{cellsPerRow:2,items:f}),w.length>0&&e(c,{$gap:12,children:[e(ht,{onClick:()=>b(e=>!e),children:[t(p,{children:"Containers Overview"}),t(_,{icon:g?De:Ae})]}),g&&w.map(({id:e,items:l})=>t(gt,{children:t(Z,{cellsPerRow:2,items:l})},e))]})]})}),t(q,{richTitle:{icon:Pe,title:"Kubectl Commands"},children:e(c,{$gap:12,children:[t(ee,{value:`kubectl get pod ${u.name} -n ${u.namespace} -o yaml`}),t(ee,{value:`kubectl describe pod ${u.name} -n ${u.namespace}`}),t(ee,{value:`kubectl logs ${u.name} -n ${u.namespace}`})]})}),t(te,{yaml:u.manifestYAML,defaultOpen:!0})]}):null]})};var bt;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropDrate="spanDropDrate",e.Age="age",e.DockerImage="dockerImage"}(bt||(bt={}));const ft=[{key:bt.PodName,label:"Pod Name"},{key:bt.Status,label:"Status"},{key:bt.Restarts,label:"Restarts",textAlign:"right"},{key:bt.NodeName,label:"Node Name"},{key:bt.Age,label:"Age",textAlign:"right"},{key:bt.DockerImage,label:"Docker Image",textAlign:"right"}],wt=({isLoading:l,tableRowsMaxHeight:i,pods:o,getExtendedPodInfo:s})=>{const c=r(),{formatTimeAgo:u}=j(),[h,f]=n(null),w=a(()=>o.map(l=>({onClick:()=>f(l),cells:[{key:bt.PodName,rawValue:l.name},{key:bt.Status,rawValue:l.status,component:()=>{return e=l.status,t(g,{status:Q(e),label:e});var e}},{key:bt.Restarts,rawValue:l.restartsCount.toString()},{key:bt.NodeName,rawValue:l.nodeName},{key:bt.SpanDropDrate,rawValue:0,component:()=>{const{collectorMetrics:a}=l;if(!a)return t(p,{children:"-"});const n=(a?.metricsAcceptedRps??0)+(a?.metricsDroppedRps??0),i=n>0?Math.round((a?.metricsDroppedRps??0)/n*100):0,o=i>0?m.Error:m.Success,s=(a?.exporterSuccessRps??0)+(a?.exporterFailedRps??0),r=s>0?Math.round((a?.exporterFailedRps??0)/s*100):0,c=r>0?m.Error:m.Success;return e(d,{$gap:4,children:[t(b,{text:`Accepted: ${a.metricsAcceptedRps.toLocaleString()}, Dropped: ${a.metricsDroppedRps.toLocaleString()}`,children:t(g,{status:o,label:`Receiver ${i}%`,leftIcon:o===m.Error?ze:Re,useSecondaryTone:!0,invertColors:!0})}),t(b,{text:`Success: ${a.exporterSuccessRps.toLocaleString()}, Failed: ${a.exporterFailedRps.toLocaleString()}`,children:t(g,{status:c,label:`Exporter ${r}%`,leftIcon:c===m.Error?ze:Re,useSecondaryTone:!0,invertColors:!0})})]})}},{key:bt.Age,rawValue:u(l.creationTimestamp)},{key:bt.DockerImage,rawValue:l.image}]})),[o,c]);return e(q,{richTitle:{icon:Te,title:"Pods"},children:[t(B,{variant:X.Data,maxHeight:i,isLoading:l,columns:ft,rows:w}),t(mt,{pod:h,getExtendedPodInfo:s,onClose:()=>f(null)})]})};var yt;!function(e){e.Gateway="gateway",e.Node="node"}(yt||(yt={}));const kt=[{value:yt.Gateway,label:"Gateway"},{value:yt.Node,label:"Node Collector"}],Ct=s.div`
119
119
  display: flex;
120
120
  align-items: center;
121
121
  justify-content: space-between;
122
- `,it=({selectedTab:a,setSelectedTab:l,onClickDownloadDiagnose:n,onClickRefresh:o,loading:s,disabled:i})=>{const c=t(()=>{const e=[];return n&&e.push({id:E(),type:U.Button,buttonProps:{label:"Download Diagnose",leftIcon:ke,size:F.S,variant:N.Text,onClick:n,disabled:i}}),o&&e.push({id:E(),type:U.Button,buttonProps:{label:"Refresh",leftIcon:pe,size:F.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(Z,{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:E(),type:U.ButtonDropData,buttonProps:{variant:N.Secondary,size:F.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:pe,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?K(t?.status):n,o=t?.status??o,s=t?.status?ut(t.status):s;break;case nt.Node:n=a?.status?K(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};
122
+ `,vt=({selectedTab:l,setSelectedTab:n,onClickDownloadDiagnose:i,onClickRefresh:o,loading:s,disabled:r})=>{const c=a(()=>{const e=[];return i&&e.push({id:E(),type:U.Button,buttonProps:{label:"Download Diagnose",leftIcon:Ne,size:G.S,variant:V.Text,onClick:i,disabled:r}}),o&&e.push({id:E(),type:U.Button,buttonProps:{label:"Refresh",leftIcon:ve,size:G.S,variant:V.Text,onClick:o,disabled:r,loading:s}}),e},[i,o,r,s]);return e(Ct,{children:[e(d,{$gap:12,children:[e(d,{$gap:8,children:[t(Oe,{size:32}),t(p,{size:h.M,weight:500,children:"Pipeline Collectors"})]}),t(ae,{options:kt,selected:l,setSelected:n,disabled:r})]}),t(ne,{actions:c})]})},xt=({isOpen:e,onClose:l,title:a,yaml:n})=>t(T,{isOpen:e,header:{icon:Ve,title:a,onClose:l},children:t(te,{yaml:n,defaultOpen:!0})});var $t;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}($t||($t={}));const St=({richTitle:l,statusCard:a,textCards:i,manifestYaml:o,configMapYaml:s})=>{const[r,c]=n(null);return e(q,{richTitle:l,actions:[{id:E(),type:U.ButtonDropData,buttonProps:{variant:V.Secondary,size:G.S,label:"View YAML",onClick:e=>c(e)},dropDataProps:{items:[{id:$t.ManifestYaml,label:l.title,icon:Me},{id:$t.ConfigMapYaml,label:"ConfigMap",icon:Me}]}}],children:[e(d,{$gap:16,children:[t(ie,{...a}),i.map(e=>t(oe,{...e},e.title))]}),t(xt,{isOpen:r===$t.ManifestYaml,onClose:()=>c(null),title:l.title,yaml:o}),t(xt,{isOpen:r===$t.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:s})]})},It=e=>{switch(e){case se.Healthy:return"All desired replicas are updated, available, and ready";case se.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case se.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case se.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case se.Down:return"No available replicas";case se.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},Tt=({tableRowsMaxHeight:l,getGatewayInfo:s,getGatewayPods:r,getNodeCollectorInfo:c,getNodeCollectorPods:d,getExtendedPodInfo:u})=>{const{formatTimeAgo:p}=j(),{isVersionSupported:h,version:g}=re(1.12),[b,w]=n(!1),[y,k]=n(yt.Gateway),[C,v]=n(null),[x,$]=n([]),[S,I]=n(null),[T,D]=n([]),A=o(async()=>{w(!0);try{switch(y){case yt.Gateway:v(await s()??null),$(await r()??[]);break;case yt.Node:I(await c()??null),D(await d()??[])}}catch(e){}w(!1)},[y]);i(()=>{A()},[A]);const P=a(()=>(e=>{switch(e){case yt.Gateway:return"Deployment";case yt.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(y),[y]),z=a(()=>((e,t,l,a)=>{const n={status:f.Disabled,label:"No rollouts yet"};let i=!1,o=null;switch(e){case yt.Gateway:i=t?.rolloutInProgress??!1,o=t?.lastRolloutAt??null;break;case yt.Node:i=l?.rolloutInProgress??!1,o=l?.lastRolloutAt??null;break;default:return n}return i?{status:m.Info,label:"Rollout in progress",rightIcon:ve,useSecondaryTone:!0}:o?{status:f.Disabled,label:`Last Rollout: ${a(o)}`}:n})(y,C,S,p),[C,S,y,p]),R=a(()=>((e,t,l,a)=>{let n=a?m.Info:f.Unknown,i=a?"Loading":se.Unknown,o=a?"Fetching data...":It(se.Unknown);switch(e){case yt.Gateway:n=t?.status?Q(t?.status):n,i=t?.status??i,o=t?.status?It(t.status):o;break;case yt.Node:n=l?.status?Q(l?.status):n,i=l?.status??i,o=l?.status?It(l.status):o}return{status:n,title:i,description:o}})(y,C,S,b),[C,S,y,b]),N=a(()=>((e,t,l,a)=>{switch(e){case yt.Gateway:return[{title:"HPA Spec (Replicas)",cells:[{label:"Min.",value:t?.hpa?.min.toString()??"-",isLoading:a},{label:"Max.",value:t?.hpa?.max.toString()??"-",isLoading:a},{label:"Current",value:t?.hpa?.current.toString()??"-",isLoading:a},{label:"Desired",value:t?.hpa?.desired.toString()??"-",isLoading:a}]},{title:"Requests",cells:[{label:"CPU",value:t?.resources?.requests.cpu??"-",isLoading:a},{label:"Memory",value:t?.resources?.requests.memory??"-",isLoading:a}]},{title:"Limits",cells:[{label:"CPU",value:t?.resources?.limits.cpu??"-",isLoading:a},{label:"Memory",value:t?.resources?.limits.memory??"-",isLoading:a}]},{title:"Docker Image",cells:[{value:t?.imageVersion??"-",isLoading:a}]}];case yt.Node:return[{title:"Nodes",cells:[{label:"Desired",value:l?.nodes?.desired.toString()??"-",isLoading:a},{label:"Ready",value:l?.nodes?.ready.toString()??"-",isLoading:a}]},{title:"Requests",cells:[{label:"CPU",value:l?.resources?.requests.cpu??"-",isLoading:a},{label:"Memory",value:l?.resources?.requests.memory??"-",isLoading:a}]},{title:"Limits",cells:[{label:"CPU",value:l?.resources?.limits.cpu??"-",isLoading:a},{label:"Memory",value:l?.resources?.limits.memory??"-",isLoading:a}]},{title:"Docker Image",cells:[{value:l?.imageVersion??"-",isLoading:a}]}];default:return[]}})(y,C,S,b),[C,S,y,b]),O=a(()=>(y===yt.Gateway?C?.manifestYAML:S?.manifestYAML)??"",[C,S,y]),V=a(()=>(y===yt.Gateway?C?.configMapYAML:S?.configMapYAML)??"",[C,S,y]),M=a(()=>y===yt.Gateway?x:T,[x,T,y]);return e(Y,{children:[t(vt,{disabled:!h,loading:b,selectedTab:y,setSelectedTab:k,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e(ce,{children:[t(St,{richTitle:{icon:Ve,title:P,badge:z},statusCard:R,textCards:N,manifestYaml:O,configMapYaml:V}),t(wt,{isLoading:b,tableRowsMaxHeight:l,pods:M,getExtendedPodInfo:u}),!h&&t(de,{minSupportedVersion:1.12,currentVersion:g||""})]})]})},Dt=({value:e,setValue:l,error:a})=>t(ue,{small:!0,maxWidth:"88px",type:"password",value:e,onChange:e=>l(e.target.value),autoFocus:!0,errorMessage:a}),At=({token:l,newToken:a,isLoading:n,isEditing:i,onEdit:o,onCancel:s,onSave:r})=>{const{CopyButton:c}=pe();return n?t(d,{$width:"70px",$height:"32px",$alignItems:"center",$justifyContent:"center",children:t(A,{title:"Saving...",withGradient:!0})}):e(d,i?{$width:"70px",$height:"32px",$alignItems:"center",$justifyContent:"space-between",children:[t(O,{variant:V.Secondary,size:G.S,leftIcon:Se,onClick:s,disabled:n}),t(O,{variant:V.Primary,size:G.S,leftIcon:$e,onClick:r,disabled:n||!a})]}:{$width:"70px",$height:"32px",$alignItems:"center",$justifyContent:"space-between",children:[t(c,{value:l}),t(_,{icon:Le,onClick:o,disabled:n})]})},Pt=({expiresAt:e})=>{const l=new Date(e).toDateString().split(" ").slice(1).join(" "),a=he(e,0)?m.Error:he(e,6048e5)?m.Warning:m.Success;return t(g,{label:l,status:a,invertColors:!0,useSecondaryTone:!0})},zt=({tokens:e,updateToken:l})=>{const[i,o]=n(null),[s,r]=n(null),{formData:c,handleFormChange:d,resetFormData:u}=W({newToken:""}),p=a(()=>[{key:"name",label:"Name",noFilter:!0,noSort:!0},{key:"expiresAt",label:"Expires",noFilter:!0,noSort:!0},{key:"token",label:"Token",noFilter:!0,noSort:!0},{key:"actions",label:"Actions",noFilter:!0,noSort:!0}],[]),h=a(()=>e?.map((a,n)=>{const p=i===n,h=s===n;return{cells:[{key:"name",rawValue:a.name},{key:"expiresAt",rawValue:a.expiresAt,component:()=>t(Pt,{expiresAt:a.expiresAt})},{key:"token",rawValue:`${new Array(15).fill("•").join("")}`,component:p?()=>t(Dt,{value:c.newToken,setValue:e=>d("newToken",e.trim())}):void 0},{key:"actions",rawValue:"",component:()=>t(At,{token:a.token,newToken:c.newToken,isLoading:h,isEditing:p,onEdit:()=>o(n),onCancel:()=>(o(null),r(null),void d("newToken","")),onSave:()=>(async t=>{r(t),await l(e?.[t]?.token??"",c.newToken),r(null),o(null),u()})(n)})}]}})||[],[e,s,i,c.newToken]);return t(q,{richTitle:{icon:We,title:"Authorization Tokens"},children:t(B,{variant:X.Pretty,columns:p,rows:h})})},Rt=s.div`
123
+ display: flex;
124
+ align-items: center;
125
+ justify-content: center;
126
+ padding: 12px 24px;
127
+ border-radius: 8px;
128
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
129
+ `,Nt=({downloadDiagnose:l})=>{const a=r(),{namespaces:i}=ge(),[o,s]=n(null),{formData:b,handleFormChange:f,resetFormData:w}=W({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(q,{richTitle:{icon:Fe,title:"Diagnose"},children:o?t(Rt,{children:t(A,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",startedAt:o,withGradient:!0,withVisual:!0,visualIcon:Ne})}):e(c,{$gap:24,children:[t(p,{size:h.XXS,color:a.v2.colors.silver[200],children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(c,{$gap:16,children:[e(d,{$gap:8,children:[t(u,{label:"Profiles",value:b.includeProfiles,onChange:e=>f("includeProfiles",e)}),t(p,{size:h.XXXS,color:a.v2.colors.silver[200],children:"Include pprof profiles"})]}),e(d,{$gap:8,children:[t(u,{label:"Metrics",value:b.includeMetrics,onChange:e=>f("includeMetrics",e)}),t(p,{size:h.XXXS,color:a.v2.colors.silver[200],children:"Include Prometheus metrics"})]}),e(d,{$gap:8,children:[t(u,{label:"Source Workloads",value:b.includeSourceWorkloads,onChange:e=>{f("includeSourceWorkloads",e),e&&f("sourceWorkloadNamespaces",[])}}),t(p,{size:h.XXXS,color:a.v2.colors.silver[200],children:"Include workload and pod manifests for instrumented sources"})]})]}),t(me,{alignX:H.Left,alignY:be.Bottom,items:i.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:b.sourceWorkloadNamespaces,setSelectedIds:e=>f("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(b.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:V.Secondary,disabled:b.includeSourceWorkloads,leftIcon:b.sourceWorkloadNamespaces.length?()=>t(g,{label:b.sourceWorkloadNamespaces.length,status:m.Default}):void 0}}),t(d,{$justifyContent:"flex-end",children:t(O,{label:"Download Diagnose",rightIcon:Ne,variant:V.Primary,onClick:async()=>{s(Date.now()),await l(b),s(null),w()},disabled:null!==o})})]})})},Ot=({fetchDescribeOdigos:e})=>{const{platformType:l,version:a,tier:o}=re(),[s,r]=n(null);return i(()=>{e().then(({data:e})=>r(e?.describeOdigos||null))},[]),t(q,{richTitle:{icon:Pe,title:"General Information"},children:t(Z,{cellsPerRow:2,items:[{id:E(),title:"Odigos Version",label:a},{id:E(),title:`${l.toUpperCase()} Version`,label:s?.kubernetesVersion?.value||"-"},{id:E(),title:"Installation Method",label:s?.installationMethod?.value||"-"},{id:E(),title:"Tier",label:o}]})})},Vt=({isOpen:l,onClose:a,tokens:n,updateToken:i,fetchDescribeOdigos:o,downloadDiagnose:s})=>e(T,{isOpen:l,header:{icon:Pe,title:"System Overview",onClose:a},children:[t(Ot,{fetchDescribeOdigos:o}),t(zt,{tokens:n,updateToken:i}),t(Nt,{downloadDiagnose:s})]});export{pt as CentralConnections,Tt as PipelineCollectors,Vt as SystemDrawer};