@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.
- package/CHANGELOG.md +409 -0
- package/README.md +16 -12
- package/lib/chunks/ui-components-DKFg9nOZ.js +2296 -0
- package/lib/components/_v2/drop-data/index.d.ts +9 -7
- package/lib/components/_v2/input/index.d.ts +3 -1
- package/lib/components/_v2/loader/index.d.ts +3 -1
- package/lib/components/_v2/segment/index.d.ts +1 -2
- package/lib/components/_v2/table/styled.d.ts +29 -18
- package/lib/components/_v2/table/types.d.ts +2 -0
- package/lib/components/selection-button/index.d.ts +1 -1
- package/lib/components/styled.d.ts +46 -50
- package/lib/components/tab-list/index.d.ts +4 -3
- package/lib/components/text/index.d.ts +1 -1
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/sources/index.d.ts +5 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/central-connections/config-drawer/index.d.ts +6 -8
- package/lib/containers/_v2/central-connections/index.d.ts +5 -6
- package/lib/containers/_v2/central-connections/source-drawer/index.d.ts +1 -1
- package/lib/containers/_v2/central-connections/source-drawer/styled.d.ts +15 -15
- package/lib/containers/_v2/index.d.ts +1 -0
- package/lib/containers/_v2/pipeline-collectors/pods-info/index.d.ts +1 -1
- package/lib/containers/_v2/system-drawer/describe/index.d.ts +10 -0
- package/lib/containers/_v2/system-drawer/diagnose/index.d.ts +6 -0
- package/lib/containers/_v2/system-drawer/index.d.ts +11 -0
- package/lib/containers/_v2/system-drawer/tokens/index.d.ts +7 -0
- package/lib/containers/_v2/system-drawer/tokens/token-actions.d.ts +12 -0
- package/lib/containers/_v2/system-drawer/tokens/token-expires-at.d.ts +6 -0
- package/lib/containers/_v2/system-drawer/tokens/token-input.d.ts +8 -0
- package/lib/containers/data-flow/column/frame.d.ts +0 -1
- package/lib/containers/data-flow/column/index.d.ts +0 -1
- package/lib/containers/data-flow-actions-menu/search/search-results/builder.d.ts +1 -1
- package/lib/containers/data-flow-actions-menu/styled.d.ts +9 -5
- package/lib/containers/instrumentation-rule-modal/index.d.ts +0 -1
- package/lib/containers/source-drawer/describe/index.d.ts +1 -1
- package/lib/containers/source-drawer/odigos-health/index.d.ts +1 -2
- package/lib/containers/v2.js +27 -20
- package/lib/containers.js +128 -130
- package/lib/contexts/odigos-context.d.ts +11 -9
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +0 -1
- package/lib/hooks/useActionFormData.d.ts +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons/auth/index.d.ts +1 -0
- package/lib/icons/auth/okta-icon/index.d.ts +2 -0
- package/lib/icons/common/diagnose-icon/index.d.ts +2 -0
- package/lib/icons/common/index.d.ts +1 -0
- package/lib/icons.js +1 -1
- package/lib/mock-data/sources/index.d.ts +2 -19
- package/lib/snippets/_v2/yaml-section-card/index.d.ts +2 -0
- package/lib/snippets/add-button/index.d.ts +1 -1
- package/lib/snippets/source-container/index.d.ts +1 -1
- package/lib/snippets/source-container/override-runtime.d.ts +2 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme/animations/index.d.ts +28 -22
- package/lib/theme/index.d.ts +3 -12
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +1 -1
- package/lib/types/diagnose/index.d.ts +6 -0
- package/lib/types/enum/index.d.ts +23 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/instrumentation-instances/index.d.ts +1 -0
- package/lib/types/pipeline-collectors/index.d.ts +9 -0
- package/lib/types/sources/index.d.ts +4 -2
- package/lib/types.js +1 -1
- package/lib/visuals/index.d.ts +1 -2
- package/lib/visuals/visual-green-rings/index.d.ts +7 -0
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/ui-components-BtsFYm8P.js +0 -2286
- package/lib/hooks/useConnection.d.ts +0 -3
- package/lib/visuals/visual-star/index.d.ts +0 -2
- package/lib/visuals/visual-success/index.d.ts +0 -2
- /package/lib/theme/{palletes → palettes}/index.d.ts +0 -0
package/lib/containers/v2.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import e,{useMemo as
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
41
|
+
`,Xe=s.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
gap: 12px;
|
|
44
44
|
padding: 16px;
|
|
45
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
68
|
+
`,lt=s.div`
|
|
69
69
|
display: flex;
|
|
70
70
|
gap: 12px;
|
|
71
71
|
padding: 16px;
|
|
72
|
-
`,
|
|
72
|
+
`,at=s(c)`
|
|
73
73
|
width: ${({$width:e})=>e};
|
|
74
74
|
gap: 12px;
|
|
75
75
|
justify-content: space-between;
|
|
76
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
117
|
-
animation-name: ${
|
|
118
|
-
`,
|
|
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
|
-
`,
|
|
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};
|