@odigos/ui-kit 0.0.150 → 0.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/lib/chunks/index-b33f952d.js +3 -0
- package/lib/chunks/{ui-components-82b524d5.js → ui-components-693d231b.js} +19 -5
- package/lib/components/_v2/index.d.ts +1 -0
- package/lib/components/_v2/table/table-columns/index.d.ts +1 -0
- package/lib/components/_v2/warning-modal/index.d.ts +12 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/central-connections/config-drawer/index.d.ts +1 -1
- package/lib/containers/_v2/central-connections/index.d.ts +2 -1
- package/lib/containers/v2.js +11 -13
- package/lib/containers.js +26 -26
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/cancel-modal/index.d.ts +4 -0
- package/lib/snippets/_v2/delete-modal/index.d.ts +7 -0
- package/lib/snippets/_v2/index.d.ts +3 -1
- package/lib/snippets/_v2/upgrade-modal/index.d.ts +6 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +5 -0
- package/lib/types.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-13c41ca4.js +0 -3
- package/lib/snippets/_v2/upgrade-required/index.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.152](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.151...ui-kit-v0.0.152) (2025-12-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* enhance hover actions and central connections with remote config support ([#549](https://github.com/odigos-io/ui-kit/issues/549)) ([94d0884](https://github.com/odigos-io/ui-kit/commit/94d08842ba17de28106e2c3b52bcf44274a487e5))
|
|
9
|
+
|
|
10
|
+
## [0.0.151](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.150...ui-kit-v0.0.151) (2025-12-17)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add modal cancel & delete warning modal ([#548](https://github.com/odigos-io/ui-kit/issues/548)) ([97ae029](https://github.com/odigos-io/ui-kit/commit/97ae0297ce100ad2e053aada1faf51133cab92a1))
|
|
16
|
+
* add partially selected state to table component and update checkbox behavior ([#546](https://github.com/odigos-io/ui-kit/issues/546)) ([8d9e306](https://github.com/odigos-io/ui-kit/commit/8d9e30690a2b56df6ae4964935dba7e3b4bb6a12))
|
|
17
|
+
|
|
3
18
|
## [0.0.150](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.149...ui-kit-v0.0.150) (2025-12-17)
|
|
4
19
|
|
|
5
20
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import o,{useMemo as s}from"react";import t from"styled-components";import{u as a,g as e,S as i,B as n,a as r,b as l,C as c,c as m,N as p}from"./ui-components-693d231b.js";import{VIcon as u,CopyIcon as d,YamlIcon as f}from"../icons.js";const b=t.div`
|
|
2
|
+
padding: 0 12px;
|
|
3
|
+
`,y=({yaml:t})=>{const{clickCopy:y,isCopied:g}=a(),C=s(()=>[{id:e(),type:i.Button,buttonProps:{leftIcon:g?u:d,onClick:()=>y(t||""),disabled:g,size:n.S,variant:r.Secondary}}],[t,g]);return o.createElement(l,{icon:f,title:"YAML",actions:C},o.createElement(b,null,t?o.createElement(c,{code:t,language:"yaml",theme:"duotoneDark"}):o.createElement(m,null,o.createElement(p,{title:"No YAML found",subTitle:"The YAML for this resource is not available"}))))};export{y as Y};
|
|
@@ -365,8 +365,8 @@ import{SamplerIcon as e,PiiMaskingIcon as t,ImageErrorIcon as o,K8sLogo as n,Add
|
|
|
365
365
|
right: 0;
|
|
366
366
|
bottom: 0;
|
|
367
367
|
z-index: 1000;
|
|
368
|
-
background: rgba(0, 0, 0, 0.
|
|
369
|
-
backdrop-filter: blur(
|
|
368
|
+
background: rgba(0, 0, 0, 0.6);
|
|
369
|
+
backdrop-filter: blur(2px);
|
|
370
370
|
`,xa=It.div`
|
|
371
371
|
width: 800px;
|
|
372
372
|
min-height: ${({$minHeight:e})=>e||"unset"};
|
|
@@ -1930,7 +1930,7 @@ import{SamplerIcon as e,PiiMaskingIcon as t,ImageErrorIcon as o,K8sLogo as n,Add
|
|
|
1930
1930
|
right: ${({$right:e})=>e||"12px"};
|
|
1931
1931
|
top: 50%;
|
|
1932
1932
|
transform: translateY(-50%);
|
|
1933
|
-
`,pu=({isOpen:e,actions:t,positionRight:o})=>e?xt.createElement(du,{$right:o},t.map(e=>xt.createElement(gp,{key:e.id,...e,variant:up.Secondary,size:hp.S}))):null,uu=It.span`
|
|
1933
|
+
`,pu=({isOpen:e,actions:t,positionRight:o})=>{const[n,i]=bt("");return e?xt.createElement(du,{$right:o},t.map(e=>xt.createElement(gp,{key:e.id,...e,variant:up.Secondary,size:hp.S,label:n===e.id?e.label:void 0,onMouseEnter:()=>i(e.id),onMouseLeave:()=>i("")}))):null},uu=It.span`
|
|
1934
1934
|
font-family: ${({theme:e})=>e.font_family.primary};
|
|
1935
1935
|
font-size: 14px;
|
|
1936
1936
|
font-weight: 400;
|
|
@@ -2159,7 +2159,7 @@ import{SamplerIcon as e,PiiMaskingIcon as t,ImageErrorIcon as o,K8sLogo as n,Add
|
|
|
2159
2159
|
fill: ${({theme:e})=>e.v2.colors.white[500]};
|
|
2160
2160
|
}
|
|
2161
2161
|
}
|
|
2162
|
-
`,Ju=({variant:e,columns:t,rows:o,getRowActions:n,rowActionsPushRightPosition:i,withCheckboxes:a})=>{const[r,s]=bt(null);return xt.createElement(xt.Fragment,null,o.map((l,c)=>{const{onClick:d,isSelected:p=!1,onSelect:u,onDeselect:h,cells:m}=l,g=r===c,x=!!d,$=n(l),f=(e,t,n)=>({$isLastRow:c===o.length-1,$isFirstCell:t,$isLastCell:n,$hovered:g,$selected:p,$withClick:e,onClick:()=>e&&d?.(),onMouseEnter:()=>e&&s(c),onMouseLeave:()=>e&&s(null)});return xt.createElement("tr",{key:`row-${c}`},a&&xt.createElement(Gu,{key:"checkbox-column",$variant:e,...f(!1,!0,!1)},xt.createElement(Np,{value:p,onChange:()=>p?h?.():u?.()})),t.map(({key:o,textAlign:n},r)=>{const s=m.find(e=>e.key===o),l=0===r&&!a,d=r===t.length-1;return xt.createElement(Gu,{key:`row-${c}-cell-${r}`,$variant:e,...f(x,l,d)},s?.component?xt.createElement(pa,{$justifyContent:"right"===n?"flex-end":"flex-start"},xt.createElement(s.component,null)):xt.createElement(Ii,{size:Ti.XS,align:n},s?.rawValue||"-"),$.length?xt.createElement(pu,{isOpen:g&&d,actions:$,positionRight:i}):null)}))}))},Yu=({variant:e,columns:t,sortDirection:o,sortByKey:n,onSort:i,withCheckboxes:a,
|
|
2162
|
+
`,Ju=({variant:e,columns:t,rows:o,getRowActions:n,rowActionsPushRightPosition:i,withCheckboxes:a})=>{const[r,s]=bt(null);return xt.createElement(xt.Fragment,null,o.map((l,c)=>{const{onClick:d,isSelected:p=!1,onSelect:u,onDeselect:h,cells:m}=l,g=r===c,x=!!d,$=n(l),f=(e,t,n)=>({$isLastRow:c===o.length-1,$isFirstCell:t,$isLastCell:n,$hovered:g,$selected:p,$withClick:e,onClick:()=>e&&d?.(),onMouseEnter:()=>e&&s(c),onMouseLeave:()=>e&&s(null)});return xt.createElement("tr",{key:`row-${c}`},a&&xt.createElement(Gu,{key:"checkbox-column",$variant:e,...f(!1,!0,!1)},xt.createElement(Np,{value:p,onChange:()=>p?h?.():u?.()})),t.map(({key:o,textAlign:n},r)=>{const s=m.find(e=>e.key===o),l=0===r&&!a,d=r===t.length-1;return xt.createElement(Gu,{key:`row-${c}-cell-${r}`,$variant:e,...f(x,l,d)},s?.component?xt.createElement(pa,{$justifyContent:"right"===n?"flex-end":"flex-start"},xt.createElement(s.component,null)):xt.createElement(Ii,{size:Ti.XS,align:n},s?.rawValue||"-"),$.length?xt.createElement(pu,{isOpen:g&&d,actions:$,positionRight:i}):null)}))}))},Yu=({variant:e,columns:t,sortDirection:o,sortByKey:n,onSort:i,withCheckboxes:a,partiallySelected:r,allSelected:s,onSelectAll:l})=>{const c=_t();return xt.createElement("tr",null,a&&xt.createElement(Vu,{key:"checkbox-column",$variant:e,$minWidth:24,$isFirst:!0,$isLast:!1},xt.createElement(Np,{partiallyChecked:r&&!s,value:s||!1,onChange:l})),t.map(({key:r,label:s,sortable:l,minWidth:d,textAlign:p},u)=>{const h=0===u&&!a,m=u===t.length-1;return xt.createElement(Vu,{key:`column-${r}`,$variant:e,$minWidth:d,$isFirst:h,$isLast:m},xt.createElement(Ku,{$withClick:l||!1,$textAlign:p,onClick:()=>l?i(r):null},xt.createElement(Ii,{size:Ti.XS,align:p},s),l&&xt.createElement(dt,{fill:n===r?c.v2.colors.white[500]:c.v2.colors.grey[400],rotate:o===oo.Ascending?0:180})),!m&&e===Mu.Data&&xt.createElement(Hu,null))}))},Xu=({variant:e,maxHeight:t="unset",isLoading:o,columns:n,rows:i,getRowActions:a,rowActionsPushRightPosition:r,withCheckboxes:s})=>{const[l,c]=bt(oo.Ascending),[d,p]=bt(""),u=kt(e=>{p(e),c(e=>e===oo.Ascending?oo.Descending:oo.Ascending)},[]),h=ft(()=>{const e=(e,t)=>{const o=e.cells.find(e=>e.key===t);return o&&(o.rawValue||o.component?.({})?.props?.children)||null};return d?[...i].sort((t,o)=>{const n=e(t,d),i=e(o,d);return(l===oo.Ascending?1:-1)*((e,t)=>"string"==typeof e&&"string"==typeof t?e.localeCompare(t):"number"==typeof e&&"number"==typeof t?e-t:"boolean"==typeof e&&"boolean"==typeof t?e===t?0:e?1:-1:String(e).localeCompare(String(t)))(n,i)}):i},[i,d,l]);return xt.createElement(ju,{$maxHeight:t},xt.createElement(Uu,{$variant:e},xt.createElement(Wu,null,xt.createElement(Yu,{variant:e,columns:n,sortDirection:l,sortByKey:d,onSort:u,withCheckboxes:s,partiallySelected:i.length>0&&i.some(e=>e.isSelected),allSelected:i.length>0&&i.every(e=>e.isSelected),onSelectAll:e=>{e?i.forEach(e=>e.onSelect?.()):i.forEach(e=>e.onDeselect?.())}})),xt.createElement(qu,null,xt.createElement(Ju,{variant:e,columns:n,rows:h,getRowActions:a||(()=>[]),rowActionsPushRightPosition:r,withCheckboxes:s}))),!h.length&&xt.createElement(ha,{style:{marginTop:"0.5rem"}},o?xt.createElement(es,{scale:1.2}):xt.createElement(Gs,null)))},Qu=It.div`
|
|
2163
2163
|
display: flex;
|
|
2164
2164
|
align-items: center;
|
|
2165
2165
|
justify-content: center;
|
|
@@ -2213,4 +2213,18 @@ import{SamplerIcon as e,PiiMaskingIcon as t,ImageErrorIcon as o,K8sLogo as n,Add
|
|
|
2213
2213
|
display: flex;
|
|
2214
2214
|
flex-direction: ${({$direction:e})=>e===to.Horizontal?"row":"column"};
|
|
2215
2215
|
gap: ${({$direction:e})=>e===to.Horizontal?16:8}px;
|
|
2216
|
-
`,lh=({direction:e=to.Vertical,title:t,size:o,disabled:n,options:i,values:a,setValues:r})=>{const s=o===th.S?Ti.XS:Ti.S;return xt.createElement(sh,{$direction:e},t&&xt.createElement(Ii,{size:s},t),i.map(e=>xt.createElement(rh,{key:`${t}-toggle-${e.id}`,...e,labelAlign:oh.Right,value:a[e.id],onChange:t=>{return o=e.id,n=t,void r(e=>{const t={...e};return o?t[o]=n:i.forEach(e=>t[e.id]=n),t});var o,n},disabled:n,size:o})))}
|
|
2216
|
+
`,lh=({direction:e=to.Vertical,title:t,size:o,disabled:n,options:i,values:a,setValues:r})=>{const s=o===th.S?Ti.XS:Ti.S;return xt.createElement(sh,{$direction:e},t&&xt.createElement(Ii,{size:s},t),i.map(e=>xt.createElement(rh,{key:`${t}-toggle-${e.id}`,...e,labelAlign:oh.Right,value:a[e.id],onChange:t=>{return o=e.id,n=t,void r(e=>{const t={...e};return o?t[o]=n:i.forEach(e=>t[e.id]=n),t});var o,n},disabled:n,size:o})))},ch=It.div`
|
|
2217
|
+
min-width: 530px;
|
|
2218
|
+
`,dh=It.div`
|
|
2219
|
+
display: flex;
|
|
2220
|
+
flex-direction: column;
|
|
2221
|
+
align-items: center;
|
|
2222
|
+
gap: 16px;
|
|
2223
|
+
padding: 24px;
|
|
2224
|
+
`,ph=It.div`
|
|
2225
|
+
display: flex;
|
|
2226
|
+
justify-content: center;
|
|
2227
|
+
gap: 16px;
|
|
2228
|
+
padding: 16px 24px;
|
|
2229
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
2230
|
+
`,uh=({visual:e,title:t,description:o,onDeny:n,denyLabel:i="Deny",onApprove:a,approveLabel:r="Approve",...s})=>{const l=_t();return xt.createElement(Cu,{isOpen:!0,onClose:n,...s},xt.createElement(ch,null,xt.createElement(dh,null,e&&xt.createElement(e,null),xt.createElement(Ii,{size:Ti.M,weight:500,color:l.v2.colors.white[500]},t),xt.createElement(ua,{$alignItems:"center",$gap:4},o.split("\n").map(e=>xt.createElement(Ii,{key:e,size:Ti.XS,weight:400,color:l.v2.colors.silver[200]},e)))),(n||a)&&xt.createElement(ph,null,n&&xt.createElement(gp,{variant:up.Secondary,label:i,onClick:n}),a&&xt.createElement(gp,{variant:up.Primary,label:r,onClick:a}))))};export{ad as $,Vp as A,hp as B,Kr as C,ru as D,Gp as E,ua as F,Ao as G,en as H,Na as I,Xl as J,Kt as K,yu as L,Yt as M,Gs as N,xo as O,ca as P,cl as Q,Br as R,Pp as S,Ii as T,da as U,ji as V,uh as W,Jt as X,xl as Y,uo as Z,On as _,up as a,Po as a$,lp as a0,ud as a1,td as a2,po as a3,Bi as a4,Fd as a5,Id as a6,$c as a7,fd as a8,ap as a9,jn as aA,mr as aB,go as aC,Sn as aD,si as aE,Go as aF,vs as aG,gn as aH,Ds as aI,$a as aJ,fa as aK,Gc as aL,hn as aM,ba as aN,Yl as aO,pp as aP,ia as aQ,Jn as aR,gd as aS,la as aT,hi as aU,li as aV,_s as aW,mn as aX,Wn as aY,an as aZ,Ed as a_,ui as aa,di as ab,ii as ac,Ba as ad,tn as ae,Bc as af,gc as ag,Fr as ah,lo as ai,ai as aj,ka as ak,Lo as al,Ro as am,cs as an,cc as ao,so as ap,ci as aq,ir as ar,wd as as,xa as at,Sr as au,Zo as av,ta as aw,rr as ax,ln as ay,hs as az,jp as b,Ms as b$,un as b0,pn as b1,Vd as b2,Sa as b3,ni as b4,Aa as b5,Yo as b6,on as b7,Ko as b8,Jo as b9,Uo as bA,Bo as bB,qo as bC,Qd as bD,oc as bE,fn as bF,Co as bG,_o as bH,Eo as bI,Fo as bJ,vo as bK,So as bL,ko as bM,tp as bN,dn as bO,La as bP,Mo as bQ,Ja as bR,Tn as bS,Ea as bT,fo as bU,al as bV,$s as bW,Yc as bX,An as bY,zn as bZ,xs as b_,Ca as ba,Ma as bb,pr as bc,Bd as bd,ma as be,Pa as bf,Mn as bg,wl as bh,Qn as bi,jo as bj,Qo as bk,ja as bl,za as bm,xi as bn,Xo as bo,$r as bp,os as bq,ms as br,fs as bs,co as bt,Un as bu,Ho as bv,Nn as bw,Io as bx,_a as by,In as bz,ha as c,mc as c$,Us as c0,pu as c1,Rn as c2,Hn as c3,Wa as c4,Ll as c5,zo as c6,ro as c7,Ga as c8,Ss as c9,To as cA,No as cB,Oo as cC,Wo as cD,nn as cE,xn as cF,$n as cG,bn as cH,yn as cI,wn as cJ,vn as cK,Dn as cL,_n as cM,Ln as cN,Pn as cO,Vn as cP,qn as cQ,Gn as cR,Kn as cS,Yn as cT,Zn as cU,ei as cV,qt as cW,va as cX,Fa as cY,tl as cZ,Js as c_,cn as ca,Fn as cb,Da as cc,Ol as cd,ti as ce,rn as cf,jr as cg,kn as ch,ys as ci,Xn as cj,Gt as ck,Xt as cl,Qt as cm,Zt as cn,eo as co,to as cp,oo as cq,no as cr,io as cs,ao as ct,mo as cu,$o as cv,bo as cw,yo as cx,wo as cy,Do as cz,ya as d,Dc as d0,_c as d1,Mc as d2,Hc as d3,ws as d4,wc as d5,Fi as d6,Ri as d7,Li as d8,_r as d9,ga as da,bp as db,yp as dc,Bp as dd,Ap as de,zp as df,Lp as dg,cu as dh,$u as di,Cu as dj,Su as dk,Iu as dl,_u as dm,Ru as dn,Zu as dp,eh as dq,oh as dr,lh as ds,Di as dt,Sp as e,Nu as f,sn as g,ho as h,pa as i,Ti as j,Oi as k,Np as l,rh as m,th as n,gp as o,Ka as p,Xu as q,Mu as r,Ai as s,En as t,Ia as u,es as v,vp as w,Qp as x,Cn as y,Pu as z};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type ModalProps } from '@/components/_v2';
|
|
3
|
+
export interface WarningModalProps extends Pick<ModalProps, 'relativeToParent'> {
|
|
4
|
+
visual?: FC;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
onDeny?: () => void;
|
|
8
|
+
denyLabel?: string;
|
|
9
|
+
onApprove?: () => void;
|
|
10
|
+
approveLabel?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const WarningModal: FC<WarningModalProps>;
|
package/lib/components/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{k as Badge,o as Button,B as ButtonSize,db as ButtonTab,dc as ButtonTabList,a as ButtonVariants,l as Checkbox,df as CheckboxList,de as CheckboxSize,x as CliCommand,w as DataCard,D as Drawer,dg as DropData,dh as Header,c1 as HoverActions,I as IconButton,cc as IconButtonSize,di as Input,L as Loader,dj as Modal,dk as Navbar,f as Note,dm as Radio,dn as RadioGroup,dl as RadioSize,e as Search,b as SectionCard,S as SectionCardActionType,dd as SectionCardSize,z as Segment,A as StatusCard,q as Table,r as TableVariant,dp as Tag,E as TextCard,m as Toggle,dr as ToggleLabelAlign,ds as ToggleList,n as ToggleSize,dq as ToggleVariant,T as Typography,j as TypographySize,dt as TypographyVariants,W as WarningModal}from"../chunks/ui-components-693d231b.js";import"../icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{aw as AutocompleteInput,aQ as Badge,aT as Button,ah as CancelWarning,c as CenterThis,R as Checkbox,C as Code,an as ConditionDetails,ao as DataCard,J as DataCardFieldTypes,bE as DataCardFields,c$ as DataFinger,aW as DataTab,ag as DeleteWarning,b$ as DescribeRow,ax as Divider,a7 as DocsButton,af as Drawer,d1 as DrawerFooter,d0 as DrawerHeader,bh as Dropdown,d2 as ErrorBoundary,bq as ExtendArrow,v as FadeLoader,V as FieldError,Q as FieldLabel,F as FlexColumn,i as FlexRow,d3 as Header,bp as IconButton,c9 as IconGroup,aL as IconTitleBadge,aG as IconWrapped,bX as IconsNav,d4 as ImageControlled,Y as Input,a2 as InputList,$ as InputTable,aO as InteractiveTable,a1 as KeyValueInputsList,aS as LoadingText,ar as Modal,at as ModalBody,a8 as MonitorsCheckboxes,aI as MonitorsIcons,as as NavigationButtons,N as NoDataFound,au as NotificationNote,da as Overlay,P as PageContent,bc as Popup,cd as PopupForm,ci as ScrollX,a_ as ScrollY,a6 as SectionTitle,a5 as Segment,bd as SelectionButton,b2 as SkeletonLoader,az as Status,bD as Stepper,d5 as TabList,aJ as TableContainer,aK as TableTitleWrap,aN as TableWrap,bN as Tag,a4 as Text,a9 as TextArea,a0 as Toggle,cg as ToggleCodeComponent,aB as Tooltip,aP as TraceLoader,U as UpgradeRequiredWrapper,be as VerticalScroll,d9 as WarningModal,d6 as getLinksFromText,d7 as getStrongsFromText,d8 as renderText}from"./chunks/ui-components-693d231b.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{al as ACTION_OPTIONS,ae as BUTTON_TEXTS,bo as DEFAULT_DATA_STREAM_NAME,bB as DESTINATION_CATEGORIES,bi as DISPLAY_LANGUAGES,H as DISPLAY_TITLES,av as FORM_ALERTS,bQ as INSTRUMENTATION_RULE_OPTIONS,cU as LANGUAGE_OPTIONS,bj as MONITORS_OPTIONS,bk as STORAGE_KEYS,cV as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-693d231b.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
|
@@ -8,11 +8,11 @@ export type ApplyConnectionsConfigurationsFunc = (connectionIds: string[], formD
|
|
|
8
8
|
error?: string;
|
|
9
9
|
}>;
|
|
10
10
|
export interface ConfigDrawerProps {
|
|
11
|
-
isOpen: boolean;
|
|
12
11
|
onClose: DrawerProps['header']['onClose'];
|
|
13
12
|
connections: Connection[];
|
|
14
13
|
selectedConnectionIds: string[];
|
|
15
14
|
setSelectedConnectionIds: Dispatch<SetStateAction<string[]>>;
|
|
15
|
+
defaultFormData?: ConnectionConfigurationsFormData;
|
|
16
16
|
onApply: ApplyConnectionsConfigurationsFunc;
|
|
17
17
|
}
|
|
18
18
|
export declare const CONFIG_DRAWER_WIDTH = "75vw";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
2
|
import { CSSProperties } from 'styled-components';
|
|
3
|
-
import { type Connection } from '@/types';
|
|
3
|
+
import { type Connection, ConnectionRemoteConfig } from '@/types';
|
|
4
4
|
import { type ApplyConnectionsConfigurationsFunc } from './config-drawer';
|
|
5
5
|
export { type ApplyConnectionsConfigurationsFunc, type ConnectionConfigurationsFormData } from './config-drawer';
|
|
6
6
|
export interface CentralConnectionsProps {
|
|
@@ -9,6 +9,7 @@ export interface CentralConnectionsProps {
|
|
|
9
9
|
getConnections: () => Promise<Connection[]>;
|
|
10
10
|
onClickConnection: (connection: Connection) => void;
|
|
11
11
|
deleteConnection: (id: string) => Promise<void>;
|
|
12
|
+
getConnectionRemoteConfig: (id: string) => Promise<ConnectionRemoteConfig>;
|
|
12
13
|
applyConfigurations: ApplyConnectionsConfigurationsFunc;
|
|
13
14
|
}
|
|
14
15
|
export declare const CentralConnections: FC<CentralConnectionsProps>;
|
package/lib/containers/v2.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react";import
|
|
1
|
+
import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react";import n,{useTheme as i}from"styled-components";import{W as s,F as r,d,D as c,e as u,f as p,h as g,i as b,T as m,j as y,k as h,O as f,l as v,m as w,n as k,L as C,o as x,a as $,p as R,P as A,b as L,g as P,S as D,B as I,q as S,r as V,s as z,t as M,c as O,v as T,w as j,I as N,x as F,y as U,z as E,A as H,E as W,G as Y,U as q}from"../chunks/ui-components-693d231b.js";import{ConnectionsIcon as G,OdigosLogo as K,RefreshIcon as B,SettingsIcon as J,DeleteIcon as Q,VIcon as X,XIcon as Z,PodIcon as _,ChevronUpIcon as ee,ChevronDownIcon as te,TerminalIcon as ae,VSquareIcon as le,XSquareIcon as oe,PipelineCollectorIcon as ne,DownloadIcon as ie,GatewayIcon as se,YamlIcon as re}from"../icons.js";import{Y as de}from"../chunks/index-b33f952d.js";import{useOdigos as ce}from"../contexts.js";import{V as ue}from"../chunks/index-64bb5a64.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const pe=({onDeny:t,onApprove:a})=>e.createElement(s,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",onDeny:t,denyLabel:"Keep editing",onApprove:a,approveLabel:"Discard changes"}),ge=({onDeny:t,onApprove:a,action:l="delete",target:o})=>{const n=l.charAt(0).toUpperCase()+l.substring(1),i=o?.endsWith("s")?"these":"this";return e.createElement(s,{title:`${n}${o?` ${o}`:""}?`,description:`Are you sure you want to ${l}${o?` ${i} ${o}`:""}?`,onDeny:t,denyLabel:"Go back",onApprove:a,approveLabel:n})},be=({minSupportedVersion:t,currentVersion:a})=>e.createElement(s,{relativeToParent:!0,visual:ue,title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${t} or later.\nCurrent version: ${a}.`}),me="75vw",ye=n.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
border-radius: 16px;
|
|
5
5
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
6
6
|
overflow: hidden;
|
|
7
|
-
`,
|
|
7
|
+
`,he=n.div`
|
|
8
8
|
display: flex;
|
|
9
9
|
gap: 12px;
|
|
10
10
|
padding: 16px;
|
|
11
11
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
12
12
|
position: sticky;
|
|
13
13
|
top: 0;
|
|
14
|
-
`,
|
|
14
|
+
`,fe=n.div`
|
|
15
15
|
display: flex;
|
|
16
16
|
gap: 12px;
|
|
17
17
|
padding: 16px;
|
|
18
|
-
`,
|
|
18
|
+
`,ve=n(r)`
|
|
19
19
|
width: ${({$width:e})=>e};
|
|
20
20
|
gap: 12px;
|
|
21
21
|
justify-content: space-between;
|
|
22
|
-
`,
|
|
22
|
+
`,we=n.div`
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
25
|
padding: 12px;
|
|
@@ -29,7 +29,7 @@ import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react"
|
|
|
29
29
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
30
30
|
overflow-y: auto;
|
|
31
31
|
overflow-x: hidden;
|
|
32
|
-
`,
|
|
32
|
+
`,ke=n.div`
|
|
33
33
|
display: flex;
|
|
34
34
|
align-items: center;
|
|
35
35
|
gap: 12px;
|
|
@@ -40,15 +40,13 @@ import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react"
|
|
|
40
40
|
&:hover {
|
|
41
41
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
42
42
|
}
|
|
43
|
-
`,
|
|
43
|
+
`,Ce=n.div`
|
|
44
44
|
display: flex;
|
|
45
45
|
align-items: center;
|
|
46
46
|
justify-content: flex-end;
|
|
47
47
|
gap: 16px;
|
|
48
48
|
padding: 0 24px;
|
|
49
|
-
`,
|
|
50
|
-
padding: 64px;
|
|
51
|
-
`,$e=({minSupportedVersion:t,currentVersion:a})=>{const l=n();return e.createElement(V,{isOpen:!0,relativeToParent:!0,onClose:()=>{}},e.createElement(xe,null,e.createElement(s,{$alignItems:"center",$gap:16},e.createElement(ce,null),e.createElement(g,{size:p.M,weight:500,color:l.v2.colors.white[500]},"Upgrade Required"),e.createElement(s,{$alignItems:"center",$gap:4},e.createElement(g,{size:p.XS,weight:400,color:l.v2.colors.silver[200]},`To use this feature, please upgrade to Odigos v${t} or later.`),e.createElement(g,{size:p.XS,weight:400,color:l.v2.colors.silver[200]},`Current version: ${a}.`)))))},Re=i.div`
|
|
49
|
+
`,xe=({onClose:l,connections:o,selectedConnectionIds:n,setSelectedConnectionIds:s,defaultFormData:r,onApply:R})=>{const A=i(),[L,P]=t(""),D=a(()=>o.filter(e=>!L||e.name.toLowerCase().includes(L.toLowerCase())),[o,L]),I=n.length>0,S=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[V,z]=t(!1),[M,O]=t(!1),[T,j]=t(void 0),{formData:N,handleFormChange:F,resetFormData:U}=d(r||{automaticRollout:!0}),E=()=>{U(),s([]),l()};return e.createElement(c,{isOpen:!0,hideOverlay:!0,width:me,header:{icon:G,title:"Cluster Configuration",onClose:l}},e.createElement(ye,null,e.createElement(he,null,e.createElement(u,{width:"40%",value:L,onChange:P}),!!r&&n.length>1&&e.createElement(p,{status:g.Warning,message:"The values do not reflect the current configuration of the selected clusters, applying will override the current configurations."})),e.createElement(fe,null,e.createElement(ve,{$width:"40%"},e.createElement(b,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(b,{$gap:8},e.createElement(m,{size:y.XS},"Clusters"),e.createElement(h,{label:o.length,status:f.Unknown})),e.createElement(b,{$gap:8},e.createElement(m,{size:y.XXXS,color:A.v2.colors.silver[200]},"Selected"),e.createElement(h,{label:`${n.length}/${o.length}`,status:f.Unknown}))),e.createElement(we,{$isFooterOpen:I,$borderRadius:"16px 0 0 16px"},D.map(t=>e.createElement(ke,{key:t.id,onClick:()=>S(t.id)},e.createElement(v,{value:n.includes(t.id),onChange:()=>S(t.id)}),e.createElement(m,{size:y.XS},t.name))))),e.createElement(ve,{$width:"60%"},e.createElement(b,{$padding:"2px 12px"},e.createElement(m,{size:y.XS},"Configurations")),e.createElement(we,{$isFooterOpen:I,$borderRadius:"0 16px 16px 0"},e.createElement(b,{$gap:12},e.createElement(w,{size:k.S,label:"Automatic Rollout "+(N.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:N.automaticRollout,onChange:e=>F("automaticRollout",e)})))))),I&&e.createElement(Ce,null,M?e.createElement(C,{label:"Applying configurations...",icon:K,withGradient:!0,typographyProps:{size:y.XXS}}):T?e.createElement(m,{size:y.XXS,color:A.v2.colors.red[500]},T):null,e.createElement("div",{style:{width:"150px"}},e.createElement(x,{variant:$.Secondary,label:"Cancel",fullWidth:!0,onClick:()=>z(!0),disabled:M})),e.createElement("div",{style:{width:"150px"}},e.createElement(x,{variant:$.Primary,label:"Apply",fullWidth:!0,onClick:async()=>{O(!0);const{error:e}=await R(n,N);O(!1),e?j(e):E()},disabled:M}))),V&&e.createElement(pe,{onDeny:()=>z(!1),onApprove:()=>{z(!1),E()}}))};var $e;!function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}($e||($e={}));const Re=[{key:$e.Name,label:"Name",sortable:!0},{key:$e.Type,label:"Type",sortable:!0,textAlign:"right"},{key:$e.Status,label:"Status",sortable:!0},{key:$e.OdigosVersion,label:"Odigos Version",sortable:!0},{key:$e.ConnectedSince,label:"Connected Since",sortable:!0},{key:$e.LastActivity,label:"Last Activity",sortable:!0}],Ae=({tableRowsMaxHeight:n,connections:i,getConnections:s,onClickConnection:r,deleteConnection:d,getConnectionRemoteConfig:c,applyConfigurations:u})=>{const{formatTimeAgo:p}=R(),[b,m]=t(!1),[y,v]=t(i||[]),[w,k]=t(""),C=l(async()=>{try{m(!0),v(await s()??[])}catch(e){}finally{m(!1)}},[]);o(()=>{y.length||C()},[y.length,C]);const[x,z]=t(null),[M,O]=t([]),[T,j]=t(!1),[N,F]=t(!1),[U,E]=t(void 0),H=a(()=>y.filter(e=>!w||e.name.toLowerCase().includes(w.toLowerCase())).map(t=>({onClick:()=>r(t),isSelected:M.includes(t.id),onSelect:()=>O(e=>[...e,t.id]),onDeselect:()=>O(e=>e.filter(e=>e!==t.id)),cells:[{key:$e.Id,rawValue:t.id},{key:$e.Name,rawValue:t.name},{key:$e.Type,rawValue:t.type},{key:$e.Status,rawValue:t.status,component:()=>(t=>{const a=t===g.Success?"Connection live":"Connection lost",l=t===g.Success?X:Z;return e.createElement(h,{status:t,label:a,leftIcon:l})})(t.status)},{key:$e.OdigosVersion,rawValue:t.odigosVersion},{key:$e.ConnectedSince,rawValue:t.connectedAt?p(t.connectedAt):"-"},{key:$e.LastActivity,rawValue:t.lastSeenAt?p(t.lastSeenAt):"-"}]})),[y,M,w]);return e.createElement(A,null,e.createElement(L,{backgroundWeight:"1000",icon:G,title:"Connections",badge:{label:y.length.toString(),status:f.Unknown},search:{placeholder:"Search by cluster name",value:w,onChange:e=>k(e)},actions:[{id:P(),type:D.Button,buttonProps:{variant:$.Secondary,size:I.S,leftIcon:B,onClick:()=>C(),disabled:b}},{id:P(),type:D.Button,buttonProps:{variant:$.Primary,size:I.S,label:"Configurations",rightIcon:J,onClick:()=>j(!0)}}]},e.createElement(S,{variant:V.Pretty,maxHeight:n,isLoading:b,withCheckboxes:!0,columns:Re,rows:H,rowActionsPushRightPosition:T?`calc(${me} - 24px)`:void 0,getRowActions:({cells:e})=>[{id:P(),label:"Edit Configuration",rightIcon:J,loading:N,onClick:async()=>{const t=e.find(e=>e.key===$e.Id)?.rawValue;if(t){O([t.toString()]),F(!0);const e=await c(t.toString());E({automaticRollout:!e.rollout?.automaticRolloutDisabled}),F(!1),j(!0)}}},{id:P(),label:"Delete Connection",rightIcon:Q,disabled:e.find(e=>e.key===$e.Status)?.rawValue===g.Success,onClick:()=>{const t=e.find(e=>e.key===$e.Id)?.rawValue;t&&z(t.toString())}}]}),T&&e.createElement(xe,{onClose:()=>{j(!1),E(void 0)},connections:y,selectedConnectionIds:M,setSelectedConnectionIds:O,defaultFormData:U,onApply:u}),x&&e.createElement(ge,{target:"connection",onDeny:()=>z(null),onApprove:async()=>{x&&(await d(x),C())}})))},Le=n.div`
|
|
52
50
|
display: flex;
|
|
53
51
|
align-items: center;
|
|
54
52
|
justify-content: space-between;
|
|
@@ -60,10 +58,10 @@ import e,{useState as t,useMemo as a,useCallback as l,useEffect as o}from"react"
|
|
|
60
58
|
&:hover {
|
|
61
59
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
62
60
|
}
|
|
63
|
-
`,Pe=
|
|
61
|
+
`,Pe=n.div`
|
|
64
62
|
animation-name: ${z.animations.fade.in};
|
|
65
|
-
`,
|
|
63
|
+
`,De=({pod:l,getExtendedPodInfo:n,onClose:i})=>{const{formatTimeAgo:s}=R(),[d,u]=t(null),[p,g]=t(!1);o(()=>{l?n(l.namespace,l.name).then(e=>u(e??null)):(u(null),g(!1))},[l]);const b=a(()=>[{id:P(),title:"Node",label:d?.node??"-",withCopy:!0},{id:P(),title:"Status",badge:{status:M(d?.status),label:d?.status??"-"}}],[d]),y=a(()=>d?.containers?.map(e=>({id:P(),items:[{id:P(),title:"Container",label:e.name??"-"},{id:P(),title:"Status",badge:{status:M(e.status),label:e.status??"-"},label:e.startedAt?`(since ${s(e.startedAt)})`:""},{id:P(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:P(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:P(),title:"Restarts",label:e.restarts.toString()},{id:P(),title:"State Reason",label:e.stateReason??"-"},{id:P(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:P(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[d]);return e.createElement(c,{isOpen:!!l,header:{icon:_,title:"Pod Information",onClose:i}},d?null:e.createElement(O,null,e.createElement(T,null)),d?e.createElement(e.Fragment,null,e.createElement(L,{icon:_,title:d.name,withCopyTitle:!0},e.createElement(r,{$gap:24},e.createElement(j,{cellsPerRow:2,items:b}),y.length>0&&e.createElement(r,{$gap:12},e.createElement(Le,{onClick:()=>g(e=>!e)},e.createElement(m,null,"Containers Overview"),e.createElement(N,{icon:p?ee:te})),p&&y.map(({id:t,items:a})=>e.createElement(Pe,{key:t},e.createElement(j,{cellsPerRow:2,items:a})))))),e.createElement(L,{icon:ae,title:"Kubectl Commands"},e.createElement(r,{$gap:12},e.createElement(F,{value:`kubectl get pod ${d.name} -n ${d.namespace} -o yaml`}),e.createElement(F,{value:`kubectl describe pod ${d.name} -n ${d.namespace}`}),e.createElement(F,{value:`kubectl logs ${d.name} -n ${d.namespace}`}))),e.createElement(de,{yaml:d.manifestYAML})):null)};var Ie;!function(e){e.PodName="podName",e.Ready="ready",e.Started="started",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(Ie||(Ie={}));const Se=[{key:Ie.PodName,label:"Pod Name",sortable:!0},{key:Ie.Ready,label:"Ready",sortable:!0,textAlign:"right"},{key:Ie.Started,label:"Started",sortable:!0,textAlign:"right"},{key:Ie.Status,label:"Status",sortable:!0},{key:Ie.Restarts,label:"Restarts",sortable:!0,textAlign:"right"},{key:Ie.NodeName,label:"Node Name",sortable:!0},{key:Ie.Age,label:"Age",sortable:!0,textAlign:"right"},{key:Ie.DockerImage,label:"Docker Image",sortable:!0,textAlign:"right"}],Ve=({isLoading:l,tableRowsMaxHeight:o,pods:n,getExtendedPodInfo:s})=>{const r=i(),{formatTimeAgo:d}=R(),[c,u]=t(null),p=a(()=>{const t=t=>t?e.createElement(le,{fill:U(r,g.Success,"500"),size:20}):e.createElement(oe,{fill:U(r,g.Error,"500"),size:20});return n.map(a=>({onClick:()=>u(a),cells:[{key:Ie.PodName,rawValue:a.name},{key:Ie.Ready,rawValue:a.ready,component:()=>t(a.ready)},{key:Ie.Started,rawValue:a.started,component:()=>t(a.started)},{key:Ie.Status,rawValue:a.status,component:()=>{return t=a.status,e.createElement(h,{status:M(t),label:t});var t}},{key:Ie.Restarts,rawValue:a.restartsCount.toString()},{key:Ie.NodeName,rawValue:a.nodeName},{key:Ie.Age,rawValue:d(a.creationTimestamp)},{key:Ie.DockerImage,rawValue:a.image}]}))},[n,r]);return e.createElement(L,{icon:_,title:"Pods"},e.createElement(S,{variant:V.Data,maxHeight:o,isLoading:l,columns:Se,rows:p}),e.createElement(De,{pod:c,getExtendedPodInfo:s,onClose:()=>u(null)}))};var ze;!function(e){e.Gateway="gateway",e.Node="node"}(ze||(ze={}));const Me=[{value:ze.Gateway,label:"Gateway"},{value:ze.Node,label:"Node Collector"}],Oe=n.div`
|
|
66
64
|
display: flex;
|
|
67
65
|
align-items: center;
|
|
68
66
|
justify-content: space-between;
|
|
69
|
-
`,
|
|
67
|
+
`,Te=({selectedTab:t,setSelectedTab:a,onClickDownloadDiagnose:l,onClickRefresh:o,loading:n,disabled:i})=>e.createElement(Oe,null,e.createElement(b,{$gap:12},e.createElement(b,{$gap:8},e.createElement(ne,{size:32}),e.createElement(m,{size:y.M,weight:500},"Pipeline Collectors")),e.createElement(E,{options:Me,selected:t,setSelected:a,disabled:i})),e.createElement(b,{$gap:8},l&&e.createElement(x,{label:"Download Diagnose",leftIcon:ie,size:I.S,variant:$.Text,onClick:l,disabled:i}),o&&e.createElement(x,{label:"Refresh",leftIcon:B,size:I.S,variant:$.Text,onClick:o,loading:n,disabled:i}))),je=({isOpen:t,onClose:a,title:l,yaml:o})=>e.createElement(c,{isOpen:t,header:{icon:se,title:l,onClose:a}},e.createElement(de,{yaml:o}));var Ne;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Ne||(Ne={}));const Fe=({icon:a,title:l,badge:o,statusCard:n,textCards:i,manifestYaml:s,configMapYaml:r})=>{const[d,c]=t(null);return e.createElement(L,{icon:a,title:l,badge:o,actions:[{id:P(),type:D.ButtonDropData,buttonProps:{variant:$.Secondary,size:I.S,label:"View YAML",onClick:e=>c(e)},dropDataItems:[{id:Ne.ManifestYaml,label:l,icon:re},{id:Ne.ConfigMapYaml,label:"ConfigMap",icon:re}]}]},e.createElement(b,{$gap:16},e.createElement(H,{...n}),i.map(t=>e.createElement(W,{key:t.title,...t}))),e.createElement(je,{isOpen:d===Ne.ManifestYaml,onClose:()=>c(null),title:l,yaml:s}),e.createElement(je,{isOpen:d===Ne.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:r}))},Ue=e=>{switch(e){case Y.Healthy:return"All desired replicas are updated, available, and ready";case Y.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Y.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Y.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Y.Down:return"No available replicas";case Y.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},Ee=({tableRowsMaxHeight:n,getGatewayInfo:i,getGatewayPods:s,getNodeCollectorInfo:r,getNodeCollectorPods:d,getExtendedPodInfo:c})=>{const{formatTimeAgo:u}=R(),{isVersionSupported:p,version:b}=ce(1.12),[m,y]=t(!1),[h,v]=t(ze.Gateway),[w,k]=t(null),[C,x]=t([]),[$,L]=t(null),[P,D]=t([]),I=l(async()=>{y(!0);try{switch(h){case ze.Gateway:k(await i()??null),x(await s()??[]);break;case ze.Node:L(await r()??null),D(await d()??[])}}catch(e){}y(!1)},[h]);o(()=>{I()},[I]);const S=a(()=>(e=>{switch(e){case ze.Gateway:return"Deployment";case ze.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(h),[h]),V=a(()=>((e,t,a,l)=>{const o={status:f.Disabled,label:"No rollouts yet"};let n=!1,i=null;switch(e){case ze.Gateway:n=t?.rolloutInProgress??!1,i=t?.lastRolloutAt??null;break;case ze.Node:n=a?.rolloutInProgress??!1,i=a?.lastRolloutAt??null;break;default:return o}return n?{status:g.Info,label:"Rollout in progress",rightIcon:B,useSecondaryTone:!0}:i?{status:f.Disabled,label:`Last Rollout: ${l(i)}`}:o})(h,w,$,u),[w,$,h,u]),z=a(()=>((e,t,a,l)=>{let o=l?g.Info:f.Unknown,n=l?"Loading":Y.Unknown,i=l?"Fetching data...":Ue(Y.Unknown);switch(e){case ze.Gateway:o=t?.status?M(t?.status):o,n=t?.status??n,i=t?.status?Ue(t.status):i;break;case ze.Node:o=a?.status?M(a?.status):o,n=a?.status??n,i=a?.status?Ue(a.status):i}return{status:o,title:n,description:i}})(h,w,$,m),[w,$,h,m]),O=a(()=>((e,t,a,l)=>{switch(e){case ze.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 ze.Node:return[{title:"Nodes",cells:[{label:"Desired",value:a?.nodes?.desired.toString()??"-",isLoading:l},{label:"Ready",value:a?.nodes?.ready.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:a?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:a?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:a?.imageVersion??"-",isLoading:l}]}];default:return[]}})(h,w,$,m),[w,$,h,m]),T=a(()=>(h===ze.Gateway?w?.manifestYAML:$?.manifestYAML)??"",[w,$,h]),j=a(()=>(h===ze.Gateway?w?.configMapYAML:$?.configMapYAML)??"",[w,$,h]),N=a(()=>h===ze.Gateway?C:P,[C,P,h]);return e.createElement(A,null,e.createElement(Te,{disabled:!p,loading:m,selectedTab:h,setSelectedTab:v,onClickDownloadDiagnose:void 0,onClickRefresh:I}),e.createElement(q,null,e.createElement(Fe,{icon:se,title:S,badge:V,statusCard:z,textCards:O,manifestYaml:T,configMapYaml:j}),e.createElement(Ve,{isLoading:m,tableRowsMaxHeight:n,pods:N,getExtendedPodInfo:c}),!p&&e.createElement(be,{minSupportedVersion:1.12,currentVersion:b||""})))};export{Ae as CentralConnections,Ee as PipelineCollectors};
|
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u,useTheme as p}from"styled-components";import{
|
|
1
|
+
import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperativeHandle as o,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u,useTheme as p}from"styled-components";import{H as m,J as h,K as g,M as y,Q as v,R as b,V as f,X as x,Y as $,Z as k,_ as C,$ as S,a0 as w,a1 as T,a2 as D,a3 as N,a4 as E,s as O,a5 as F,a6 as I,a7 as A,a8 as M,a9 as R,aa as L,ab as P,ac as K,ad as j,ae as V,af as q,ag as z,ah as H,ai as B,h as W,aj as _,ak as J,al as U,am as Y,an as G,ao as X,ap as Z,F as Q,aq as ee,ar as te,as as ie,at as ae,au as ne,av as oe,aw as le,ax as re,ay as se,az as ce,i as de,aA as ue,aB as pe,aC as me,aD as he,aE as ge,aF as ye,aG as ve,aH as be,aI as fe,aJ as xe,aK as $e,aL as ke,aM as Ce,aN as Se,aO as we,c as Te,N as De,aP as Ne,aQ as Ee,aR as Oe,aS as Fe,aT as Ie,aU as Ae,aV as Me,aW as Re,v as Le,aX as Pe,aY as Ke,aZ as je,a_ as Ve,a$ as qe,b0 as ze,b1 as He,b2 as Be,b3 as We,b4 as _e,b5 as Je,b6 as Ue,b7 as Ye,b8 as Ge,b9 as Xe,ba as Ze,bb as Qe,bc as et,bd as tt,be as it,bf as at,bg as nt,bh as ot,bi as lt,bj as rt,bk as st,bl as ct,bm as dt,bn as ut,bo as pt,bp as mt,bq as ht,br as gt,bs as yt,bt as vt,bu as bt,bv as ft,bw as xt,bx as $t,by as kt,bz as Ct,bA as St,bB as wt,bC as Tt,bD as Dt,bE as Nt,bF as Et,bG as Ot,bH as Ft,bI as It,bJ as At,bK as Mt,bL as Rt,bM as Lt,bN as Pt,bO as Kt,bP as jt,bQ as Vt,bR as qt,bS as zt,p as Ht,bT as Bt,bU as Wt,bV as _t,bW as Jt,bX as Ut,bY as Yt,bZ as Gt,b_ as Xt,b$ as Zt,c0 as Qt,c1 as ei,g as ti,c2 as ii,c3 as ai,c4 as ni,c5 as oi,c6 as li,c7 as ri,c8 as si,c9 as ci,ca as di,cb as ui,u as pi,d as mi,cc as hi,cd as gi,ce as yi,cf as vi,cg as bi,ch as fi,ci as xi}from"./chunks/ui-components-693d231b.js";import{VSquareIcon as $i,XSquareIcon as ki,EditIcon as Ci,TrashIcon as Si,OdigosLogoText as wi,PlusIcon as Ti,SearchIcon as Di,FilterIcon as Ni,DataStreamIcon as Ei,VIcon as Oi,OdigosLogo as Fi,ArrowIcon as Ii,RefreshLeftArrowIcon as Ai,NotificationIcon as Mi,UserIcon as Ri,ImageErrorIcon as Li,OverviewIcon as Pi,InstrumentationRuleIcon as Ki,ActionIcon as ji,SourceIcon as Vi,DestinationIcon as qi,SlackLogo as zi,RefreshIcon as Hi,KeyIcon as Bi,TerminalIcon as Wi,ExclamationTriangleIcon as _i,TraceViewIcon as Ji}from"./icons.js";import{MarkerType as Ui,useNodesState as Yi,useEdgesState as Gi,applyNodeChanges as Xi}from"@xyflow/react";import{Y as Zi}from"./chunks/index-b33f952d.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Qi=e=>{const{type:t,name:i,notes:a,signals:n,disabled:o,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:$,samplingPercentage:k,endpointsFilters:C,servicesNameFilters:S,attributeFilters:w}}=e,T=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!o)},{type:h.Monitors,title:m.SIGNALS_FOR_PROCESSING,value:n?.map(e=>e.toLowerCase()).join(", ")||""},{title:m.NAME,value:i||""},{title:m.NOTES,value:a||""},{type:h.Divider}];if(t===g.K8sAttributes&&(T.push({title:"Collect Container Attributes",value:String(l)}),T.push({title:"Collect ReplicaSet Attributes",value:String(r)}),T.push({title:"Collect Workload ID",value:String(s)}),T.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&T.push({type:h.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i},a)=>{let n="";n+=`Label Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${i||y.Pod}\n`,T.push({title:"Label"+(d.length>1?` #${a+1}`:""),value:n})}),u?.length&&T.push({type:h.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i},a)=>{let n="";n+=`Annotation Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${i||y.Pod}\n`,T.push({title:"Annotation"+(u.length>1?` #${a+1}`:""),value:n})})),t===g.AddClusterInfo){T.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},a)=>{e+=`${t}: ${i}`,a<p.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.DeleteAttributes){let e="";b?.forEach((t,i)=>{e+=t,i<b.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([i,a],n)=>{e+=`${i}: ${a}`,n<t.length-1&&(e+=", ")}),T.push({title:"Attributes",value:e})}if(t===g.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),T.push({title:"Categories",value:e})}return t===g.ErrorSampler&&T.push({title:"Sampling Ratio",value:String($)}),t===g.ProbabilisticSampler&&T.push({title:"Sampling Percentage",value:String(k)}),t===g.LatencySampler&&C?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${i}\n`,o+=`Fallback Sampling Ratio: ${a}`,T.push({title:"Endpoint"+(C.length>1?` #${n+1}`:""),value:o})}),t===g.ServiceNameSampler&&S?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},a)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${i}`,T.push({title:"Filter"+(S.length>1?` #${a+1}`:""),value:n})}),t===g.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a},n)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}\n`;const l=Object.keys(a)[0];o+=`Condition: ${l}\n`,o+=`Operation: ${a[l]?.operation}\n`,o+=`Expected Value: ${a[l]?.expectedValue}`,"jsonCondition"===l&&(o+=`\nJSON Path: ${a[l].jsonPath}`),T.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:o})}),T},ea=x.PiiCategories,ta=d.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -14,7 +14,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
14
14
|
padding: 4px;
|
|
15
15
|
`,fa=d(E)`
|
|
16
16
|
margin-bottom: 12px;
|
|
17
|
-
`,xa=({isUpdate:t,action:i,formData:a,formErrors:n,handleFormChange:o})=>{const l=O.useTheme();return e.createElement(ba,null,t&&e.createElement("div",null,e.createElement(fa,null,"Status"),e.createElement(F,{options:[{icon:$i,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+O.opacity.hex["050"]},{icon:ki,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+O.opacity.hex["050"]}],selected:a.disabled,setSelected:e=>o("disabled",e)})),!t&&e.createElement(I,{title:"",description:i.docsDescription,actionButton:e.createElement(A,{endpoint:i.docsEndpoint})}),e.createElement(M,{title:"Signals for Processing",required:!0,allowedSignals:i.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>o("signals",e),errorMessage:n.signals}),!t&&e.createElement($,{title:"Action name",placeholder:"Use a name that describes the action",value:a.name||"",onChange:({target:{value:e}})=>o("name",e),errorMessage:n.name}),e.createElement(va,{actionType:i.type,value:a.fields,setValue:(e,t)=>o(`fields.${e}`,t),formErrors:n}),e.createElement(R,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},$a=a(({children:i,width:a=640,title:r,titleTooltip:s,hideEditTitleFromEdit:c,icons:d,iconSrcs:u,isEdit:p=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:b,onCancel:f,tabs:x,headerActionButtons:$},k)=>{const C=O.useTheme(),{isThisPending:S}=L(),{addNotification:w}=P(),{drawerType:T,drawerEntityId:D,setDrawerType:N,setDrawerEntityId:F}=K();j({key:"Enter",active:p},()=>Q());const[I,A]=t(!1),[M,R]=t(!1),_=n(null),J=T===B.Source,U=()=>{A(!1),R(!1)},
|
|
17
|
+
`,xa=({isUpdate:t,action:i,formData:a,formErrors:n,handleFormChange:o})=>{const l=O.useTheme();return e.createElement(ba,null,t&&e.createElement("div",null,e.createElement(fa,null,"Status"),e.createElement(F,{options:[{icon:$i,label:m.ENABLED,value:!1,selectedBgColor:l.text.success+O.opacity.hex["050"]},{icon:ki,label:m.DISABLED,value:!0,selectedBgColor:l.text.error+O.opacity.hex["050"]}],selected:a.disabled,setSelected:e=>o("disabled",e)})),!t&&e.createElement(I,{title:"",description:i.docsDescription,actionButton:e.createElement(A,{endpoint:i.docsEndpoint})}),e.createElement(M,{title:"Signals for Processing",required:!0,allowedSignals:i.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>o("signals",e),errorMessage:n.signals}),!t&&e.createElement($,{title:"Action name",placeholder:"Use a name that describes the action",value:a.name||"",onChange:({target:{value:e}})=>o("name",e),errorMessage:n.name}),e.createElement(va,{actionType:i.type,value:a.fields,setValue:(e,t)=>o(`fields.${e}`,t),formErrors:n}),e.createElement(R,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>o("notes",e),errorMessage:n.notes}))},$a=a(({children:i,width:a=640,title:r,titleTooltip:s,hideEditTitleFromEdit:c,icons:d,iconSrcs:u,isEdit:p=!1,isFormDirty:m=!1,isLastItem:h=!1,onClose:g,onEdit:y,onSave:v,onDelete:b,onCancel:f,tabs:x,headerActionButtons:$},k)=>{const C=O.useTheme(),{isThisPending:S}=L(),{addNotification:w}=P(),{drawerType:T,drawerEntityId:D,setDrawerType:N,setDrawerEntityId:F}=K();j({key:"Enter",active:p},()=>Q());const[I,A]=t(!1),[M,R]=t(!1),_=n(null),J=T===B.Source,U=()=>{A(!1),R(!1)},Y=()=>{U(),y&&y(!1),N(null),F(null),g?.()};o(k,()=>({closeDrawer:Y}));const G=()=>{_.current?.clearTitle(),f&&f(),U()},X=()=>{const e=_.current?.isTitleDirty();m||e?R(!0):G()},Z=()=>{A(!0)},Q=()=>{v&&v(_.current?.getTitle()||"")},ee=l(()=>!!T&&S({entityType:T,entityId:D}),[T,D]),te=e=>{w({type:W.Warning,title:"Pending",message:`Cannot click ${e}, ${T} is pending`,hideFromHistory:!0})},ie=$||[];return y&&!p&&ie.push({"data-id":"drawer-edit",variant:"tertiary",onClick:ee?()=>te("edit"):()=>y(!0),children:e.createElement(e.Fragment,null,e.createElement(Ci,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Edit"))}),b&&!p&&ie.push({"data-id":"drawer-delete",variant:"tertiary",onClick:ee?()=>te(J?"uninstrument":"delete"):Z,children:e.createElement(e.Fragment,null,e.createElement(Si,null),e.createElement(E,{color:C.text.error,size:14,family:"secondary",decoration:"underline"},J?V.UNINSTRUMENT:V.DELETE))}),e.createElement(e.Fragment,null,e.createElement(q,{isOpen:!0,onClose:p?X:Y,closeOnEscape:!I&&!M,width:`${a+64}px`,header:{icons:d,iconSrcs:u,title:r,titleTooltip:s,replaceTitleWith:!c&&p?e.createElement(ka,{ref:_,title:r}):void 0,actionButtons:ie,tabs:x},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:Q,children:V.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:X,children:V.CANCEL}],rightButtons:b?[{"data-id":"drawer-delete",variant:"tertiary",onClick:Z,children:e.createElement(e.Fragment,null,e.createElement(Si,null),e.createElement(E,{size:14,color:C.text.error,family:"secondary",decoration:"underline"},V.DELETE))}]:[]}},i),e.createElement(z,{isOpen:I,noOverlay:!0,name:`${T}${r?` (${r})`:""}`,type:T,isLastItem:h,onApprove:()=>{b&&b(),U()},onDeny:U}),e.createElement(H,{isOpen:M,noOverlay:!0,name:"edit mode",onApprove:G,onDeny:U}))}),ka=a(({title:a},n)=>{const[l,r]=t(a);return i(()=>{r(a)},[a]),o(n,()=>({getTitle:()=>l||a,isTitleDirty:()=>l!==a,clearTitle:()=>r(a)})),e.createElement($,{"data-id":"title",value:l,onChange:e=>r(e.target.value)})});ka.displayName=ka.name,$a.displayName=$a.name;const Ca=d.div`
|
|
18
18
|
width: 100%;
|
|
19
19
|
height: 100%;
|
|
20
20
|
max-height: calc(100vh - 220px);
|
|
@@ -24,10 +24,10 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
gap: 12px;
|
|
27
|
-
`,wa=({updateAction:i,deleteAction:a})=>{const{actions:o}=_(),{drawerType:r,drawerEntityId:s}=K(),c=n(null),d=r===B.Action,[u,p]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:$}=J(),k=l(()=>{if(!d)return f();const e=o?.find(e=>e.id===s);return e?$(e):f(),e},[d,s,o]);if(!k)return null;const C=U.find(({type:e})=>e===k.type)||U.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||U.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return e.createElement($a,{ref:c,title:k.name||k.type,icons:[
|
|
27
|
+
`,wa=({updateAction:i,deleteAction:a})=>{const{actions:o}=_(),{drawerType:r,drawerEntityId:s}=K(),c=n(null),d=r===B.Action,[u,p]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:$}=J(),k=l(()=>{if(!d)return f();const e=o?.find(e=>e.id===s);return e?$(e):f(),e},[d,s,o]);if(!k)return null;const C=U.find(({type:e})=>e===k.type)||U.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===k.type)||U.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===k.type);return e.createElement($a,{ref:c,title:k.name||k.type,icons:[Y(k.type)],isEdit:u,isFormDirty:h,onEdit:e=>{p("boolean"!=typeof e||e)},onSave:e=>{if(x({withAlert:!0,alertTitle:Z.Update})){const t=e!==k.type?e:"";b("name",t),i(s,{...y,name:t}),p(!1),g(!1)}},onDelete:()=>{a(s,k.type),p(!1),g(!1),c.current?.closeDrawer()},onCancel:()=>{p(!1),g(!1),$(k)}},u&&C?e.createElement(Ca,null,e.createElement(xa,{isUpdate:!0,action:C,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement(Sa,null,e.createElement(G,{conditions:k.conditions||[]}),e.createElement(X,{title:m.ACTION_DETAILS,data:k?Qi(k):[]})))},Ta=d(Q)`
|
|
28
28
|
margin-top: 24px;
|
|
29
29
|
gap: 12px;
|
|
30
|
-
`,Da=({createAction:i})=>{const{currentModal:a,setCurrentModal:n}=ee(),o=a===B.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=J(),[u,p]=t(void 0),h=()=>{c(),p(void 0),n("")},g=()=>{if(!d({withAlert:!0,alertTitle:Z.Create}))return null;i(l),h()};return j({key:"Enter",active:o},()=>g()),e.createElement(te,{isOpen:o,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(ie,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(ae,null,e.createElement(I,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e.createElement(Ta,null,e.createElement(ne,{type:W.Warning,message:oe.DEFINED_FOR_ALL_STREAMS(m.ACTIONS)}),e.createElement(le,{options:U,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void p(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(re,{margin:"16px 0"}),e.createElement(xa,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Na=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:a,collectWorkloadId:n,collectClusterId:o,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:h,endpointsFilters:v,attributeFilters:b,servicesNameFilters:f}}=e;let x="";if(t===g.K8sAttributes&&(i&&(x+="Container Attributes, "),a&&(x+="ReplicaSet Attributes, "),n&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:i},a)=>{x+=`Label: ${e} ${t} ${i||y.Pod} `,a===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:i},a)=>{x+=`Annotation: ${e} ${t} ${i||y.Pod} `,a===r.length-1&&(x+=", ")})),t===g.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{x+=`${e}: ${t}`,i<s.length-1&&(x+=", ")})),t===g.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===g.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],a)=>{x+=`${t}: ${i}`,a<e.length-1&&(x+=", ")})}return t===g.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===g.ErrorSampler&&(x+=String(m)),t===g.ProbabilisticSampler&&(x+=String(h),x+="%"),t===g.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a},n)=>{x+=`Endpoint${v.length>1?` #${n+1}`:""}=${e}${t}\n`,x+=` Latency=${i}`,x+=` Sampling=${a}`,n<v.length-1&&(x+=", ")}),t===g.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),t===g.SpanAttributeSampler&&b?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),x},Ea=({conditions:t,id:i})=>{const{errors:a,warnings:n,disableds:o,hasLoadings:r}=l(()=>se(t),[t]),s=a.length>0?a:n.length>0?n:o.length>0?o:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Oa,{conditions:s,id:i}));const c=r?me.Loading:W.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(ce,{status:c,title:c,withBorder:!0,withIcon:!0}))},Oa=({conditions:t,id:i})=>{const a=O.useTheme();return e.createElement(de,null,ue(t).map(({status:t,type:n,reason:o,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=W.Info);const c=he(t,a);return e.createElement(pe,{key:`condition-${i}-${t}-${n}-${s}`,titleIcon:c,title:n,text:l||o||"",timestamp:r},e.createElement(ce,{status:t,title:o||n,withBorder:!0,withIcon:!0}))}))},Fa=({instrumentationRules:e,sources:t,actions:i,destinations:a,searchText:n,selectedCategory:o})=>{const l=n?e.filter(e=>e.type?.toLowerCase().includes(n)||e.ruleName?.toLowerCase().includes(n)):e,r=n?t.filter(e=>e.name?.toLowerCase().includes(n)||e.otelServiceName?.toLowerCase().includes(n)||e.namespace?.toLowerCase().includes(n)):t,s=n?i.filter(e=>e.type?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):i,c=n?a.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):a,d=[{category:B.Source,label:"Sources",count:r.length,entities:[]},{category:B.Action,label:"Actions",count:s.length,entities:[]},{category:B.Destination,label:"Destinations",count:c.length,entities:[]},{category:B.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(o)).map(e=>({...e,entities:e.category===B.InstrumentationRule?l:e.category===B.Source?r:e.category===B.Action?s:e.category===B.Destination?c:[]}));return{categories:d,searchResults:u}},Ia=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Aa=({maxHeight:t,maxWidth:i})=>{const a=O.useTheme(),n=ge(),{actions:o,actionsLoading:r}=_(),{setDrawerType:s,setDrawerEntityId:c}=K(),d=l(()=>Fa({instrumentationRules:[],sources:[],actions:ye(o,n),destinations:[],searchText:n.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[o,n]),u=l(()=>d.map(t=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=se(t.conditions||[]);return{status:i?W.Error:n?W.Warning:void 0,faded:o,onClick:()=>{s(B.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ve,{icon:
|
|
30
|
+
`,Da=({createAction:i})=>{const{currentModal:a,setCurrentModal:n}=ee(),o=a===B.Action,{formData:l,formErrors:r,handleFormChange:s,resetFormData:c,validateForm:d}=J(),[u,p]=t(void 0),h=()=>{c(),p(void 0),n("")},g=()=>{if(!d({withAlert:!0,alertTitle:Z.Create}))return null;i(l),h()};return j({key:"Enter",active:o},()=>g()),e.createElement(te,{isOpen:o,onClose:h,header:{title:"Add Action"},actionComponent:e.createElement(ie,{buttons:[{variant:"primary",label:"DONE",onClick:g,disabled:!u}]})},e.createElement(ae,null,e.createElement(I,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e.createElement(Ta,null,e.createElement(ne,{type:W.Warning,message:oe.DEFINED_FOR_ALL_STREAMS(m.ACTIONS)}),e.createElement(le,{options:U,selectedOption:u,onOptionSelect:e=>{return t=e,c(),s("type",t?.type||""),void p(t);var t},autoFocus:!u?.type})),u?.type?e.createElement("div",null,e.createElement(re,{margin:"16px 0"}),e.createElement(xa,{action:u,formData:l,formErrors:r,handleFormChange:s})):null))},Na=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:a,collectWorkloadId:n,collectClusterId:o,labelsAttributes:l,annotationsAttributes:r,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:m,samplingPercentage:h,endpointsFilters:v,attributeFilters:b,servicesNameFilters:f}}=e;let x="";if(t===g.K8sAttributes&&(i&&(x+="Container Attributes, "),a&&(x+="ReplicaSet Attributes, "),n&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),l?.forEach(({labelKey:e,attributeKey:t,from:i},a)=>{x+=`Label: ${e} ${t} ${i||y.Pod} `,a===l.length-1&&(x+=", ")}),r?.forEach(({annotationKey:e,attributeKey:t,from:i},a)=>{x+=`Annotation: ${e} ${t} ${i||y.Pod} `,a===r.length-1&&(x+=", ")})),t===g.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{x+=`${e}: ${t}`,i<s.length-1&&(x+=", ")})),t===g.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===g.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],a)=>{x+=`${t}: ${i}`,a<e.length-1&&(x+=", ")})}return t===g.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===g.ErrorSampler&&(x+=String(m)),t===g.ProbabilisticSampler&&(x+=String(h),x+="%"),t===g.LatencySampler&&v?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:a},n)=>{x+=`Endpoint${v.length>1?` #${n+1}`:""}=${e}${t}\n`,x+=` Latency=${i}`,x+=` Sampling=${a}`,n<v.length-1&&(x+=", ")}),t===g.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),t===g.SpanAttributeSampler&&b?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),x},Ea=({conditions:t,id:i})=>{const{errors:a,warnings:n,disableds:o,hasLoadings:r}=l(()=>se(t),[t]),s=a.length>0?a:n.length>0?n:o.length>0?o:[];if(s.length>0)return e.createElement("div",{style:{lineHeight:1}},e.createElement(Oa,{conditions:s,id:i}));const c=r?me.Loading:W.Success;return e.createElement("div",{style:{lineHeight:1}},e.createElement(ce,{status:c,title:c,withBorder:!0,withIcon:!0}))},Oa=({conditions:t,id:i})=>{const a=O.useTheme();return e.createElement(de,null,ue(t).map(({status:t,type:n,reason:o,message:l,lastTransitionTime:r},s)=>{"loading"!==t&&"disabled"!==t||(t=W.Info);const c=he(t,a);return e.createElement(pe,{key:`condition-${i}-${t}-${n}-${s}`,titleIcon:c,title:n,text:l||o||"",timestamp:r},e.createElement(ce,{status:t,title:o||n,withBorder:!0,withIcon:!0}))}))},Fa=({instrumentationRules:e,sources:t,actions:i,destinations:a,searchText:n,selectedCategory:o})=>{const l=n?e.filter(e=>e.type?.toLowerCase().includes(n)||e.ruleName?.toLowerCase().includes(n)):e,r=n?t.filter(e=>e.name?.toLowerCase().includes(n)||e.otelServiceName?.toLowerCase().includes(n)||e.namespace?.toLowerCase().includes(n)):t,s=n?i.filter(e=>e.type?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):i,c=n?a.filter(e=>e.destinationType.displayName?.toLowerCase().includes(n)||e.name?.toLowerCase().includes(n)):a,d=[{category:B.Source,label:"Sources",count:r.length,entities:[]},{category:B.Action,label:"Actions",count:s.length,entities:[]},{category:B.Destination,label:"Destinations",count:c.length,entities:[]},{category:B.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(o)).map(e=>({...e,entities:e.category===B.InstrumentationRule?l:e.category===B.Source?r:e.category===B.Action?s:e.category===B.Destination?c:[]}));return{categories:d,searchResults:u}},Ia=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],Aa=({maxHeight:t,maxWidth:i})=>{const a=O.useTheme(),n=ge(),{actions:o,actionsLoading:r}=_(),{setDrawerType:s,setDrawerEntityId:c}=K(),d=l(()=>Fa({instrumentationRules:[],sources:[],actions:ye(o,n),destinations:[],searchText:n.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[o,n]),u=l(()=>d.map(t=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=se(t.conditions||[]);return{status:i?W.Error:n?W.Warning:void 0,faded:o,onClick:()=>{s(B.Action),c(t.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ve,{icon:Y(t.type)})},{columnKey:"name",value:be(t,B.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:a.text.info},{columnKey:"notes",value:t.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Na(t),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:t.signals||[]})},{columnKey:"conditions",component:()=>e.createElement(Ea,{conditions:t.conditions||[],id:t.id})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(ce,{status:t.disabled?W.Error:W.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[d]),{badge:p,badgeTooltip:h}=l(()=>d.length!==o.length?{badge:`${d.length}/${o.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:o.length,badgeTooltip:void 0},[d,o]);return e.createElement(xe,{$maxWidth:i},e.createElement($e,null,e.createElement(ke,{icon:Ce(B.Action),title:m.ACTIONS,badge:p,badgeTooltip:h,loading:r})),e.createElement(Se,{$maxHeight:t},e.createElement(we,{columns:Ia,rows:u})),!d.length&&e.createElement(Te,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ma=d(Q)`
|
|
31
31
|
// width: 100vw;
|
|
32
32
|
// height: 100vh;
|
|
33
33
|
gap: 64px;
|
|
@@ -109,7 +109,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
109
109
|
border: 1px dashed ${({theme:e})=>e.colors.border};
|
|
110
110
|
border-radius: 24px;
|
|
111
111
|
position: relative;
|
|
112
|
-
`,
|
|
112
|
+
`,Ya=d.div`
|
|
113
113
|
position: absolute;
|
|
114
114
|
bottom: 0;
|
|
115
115
|
left: 0;
|
|
@@ -124,20 +124,20 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
124
124
|
justify-content: center;
|
|
125
125
|
|
|
126
126
|
pointer-events: none;
|
|
127
|
-
`,
|
|
127
|
+
`,Ga=({height:t,entityType:i,entities:a,metrics:n,isVm:o})=>{const r=l(()=>a.map(t=>{const a=Pe(t);if(!a)return null;const l=[B.Source,B.Destination].includes(i),r=[B.Destination,B.Action].includes(i),s=[B.Destination,B.Action,B.InstrumentationRule].includes(i),c=r?i==B.Destination?Ke(t.exportedSignals):t.signals:void 0,d=l?n?.[`${i.toLowerCase()}s`]?.find(e=>JSON.stringify(Pe(e))===JSON.stringify(a)):void 0,u=s?!t.disabled:void 0,p=be(t,i,{extended:i===B.Source,prioritizeDisplayName:i!==B.Source}),m=((e,t,i)=>{switch(e){case B.Source:return i?`${t.kind}`:`${t.namespace} • ${t.kind}`;case B.Destination:return t.destinationType.displayName;case B.Action:case B.InstrumentationRule:return t.type;default:return""}})(i,t,o),h=l?je(d?.throughput):void 0,{priorotizedStatus:g,hasDisableds:y}=se(t.conditions||[]),{icons:v,icon:b,iconSrc:f}=((e,t)=>{switch(e){case B.Source:return{icons:He(t.containers),icon:Ce(e)};case B.Destination:return ze(t.destinationType.type);case B.Action:return{icon:Y(t.type)};case B.InstrumentationRule:return{icon:qe(t.type)};default:return{icon:Ce(e)}}})(i,t);return e.createElement(Ja,{key:JSON.stringify(a),entityType:i,entityId:a,raw:t,title:p,subTitle:m,faded:y,status:g,label:h,icons:v,icon:b,iconSrc:f,monitors:c,isActive:u})}),[a,i,n,o]);return e.createElement(Ua,{$height:t},e.createElement(Ve,{containerHeight:t-24,elementHeight:80,elements:r}),e.createElement(Ya,{$hide:!0}))},Xa=d.div`
|
|
128
128
|
width: ${({$isVm:e})=>e?"45vw":"22vw"};
|
|
129
129
|
|
|
130
130
|
display: flex;
|
|
131
131
|
flex-direction: column;
|
|
132
132
|
gap: 12px;
|
|
133
|
-
`,Za=({entityType:t,entities:i,unfilteredCount:a,metrics:n,loading:o,maxHeight:l,isVm:r})=>{const s=i.length!==a,c=Math.min(l,80*i.length+12);return r&&[B.InstrumentationRule,B.Action].includes(t)?null:e.createElement(Xa,{$isVm:r},e.createElement(Wa,{entityType:t,badge:s?`${i.length}/${a}`:a,badgeTooltip:s?m.FILTERED_COUNT_TOOLTIP:void 0,isLoading:o}),i.length?e.createElement(
|
|
133
|
+
`,Za=({entityType:t,entities:i,unfilteredCount:a,metrics:n,loading:o,maxHeight:l,isVm:r})=>{const s=i.length!==a,c=Math.min(l,80*i.length+12);return r&&[B.InstrumentationRule,B.Action].includes(t)?null:e.createElement(Xa,{$isVm:r},e.createElement(Wa,{entityType:t,badge:s?`${i.length}/${a}`:a,badgeTooltip:s?m.FILTERED_COUNT_TOOLTIP:void 0,isLoading:o}),i.length?e.createElement(Ga,{height:c,entityType:t,entities:i,metrics:n,isVm:r}):o?e.createElement(Be,{size:3}):e.createElement(Va,{entityType:t,description:m.TO_COLLECT_OTEL_DATA}))},Qa=d.div`
|
|
134
134
|
width: 100%;
|
|
135
135
|
height: ${({$height:e})=>e};
|
|
136
136
|
|
|
137
137
|
display: flex;
|
|
138
138
|
justify-content: space-evenly;
|
|
139
139
|
gap: 24px;
|
|
140
|
-
`,en=({height:a,metrics:n})=>{const{isVm:o}=We(),l=ge(),{selectedStreamName:r}=_e(),{containerRef:s,containerHeight:c}=Je(),{sources:d,sourcesLoading:u,destinations:p,destinationsLoading:m,actions:h,actionsLoading:g,instrumentationRules:y,instrumentationRulesLoading:v}=_(),[b,f]=t([]),[x,$]=t([]),[k,C]=t([]),[S,w]=t([]);return i(()=>{f(Ue(
|
|
140
|
+
`,en=({height:a,metrics:n})=>{const{isVm:o}=We(),l=ge(),{selectedStreamName:r}=_e(),{containerRef:s,containerHeight:c}=Je(),{sources:d,sourcesLoading:u,destinations:p,destinationsLoading:m,actions:h,actionsLoading:g,instrumentationRules:y,instrumentationRulesLoading:v}=_(),[b,f]=t([]),[x,$]=t([]),[k,C]=t([]),[S,w]=t([]);return i(()=>{f(Ue(Ye(d,r),l))},[d,r,l]),i(()=>{$(Ge(Xe(p,r),l))},[p,r,l]),i(()=>{C(ye(h,l))},[h,l]),i(()=>{w(y)},[y]),e.createElement(Qa,{ref:s,$height:a},e.createElement(Za,{entityType:B.InstrumentationRule,entities:S,unfilteredCount:y.length,loading:v,maxHeight:c,isVm:o}),e.createElement(Za,{entityType:B.Source,entities:b,unfilteredCount:d.length,metrics:n,loading:u,maxHeight:c,isVm:o}),e.createElement(Za,{entityType:B.Action,entities:k,unfilteredCount:h.length,loading:g,maxHeight:c,isVm:o}),e.createElement(Za,{entityType:B.Destination,entities:x,unfilteredCount:p.length,metrics:n,loading:m,maxHeight:c,isVm:o}))},tn=d.div`
|
|
141
141
|
position: relative;
|
|
142
142
|
max-width: 200px;
|
|
143
143
|
`;d.div`
|
|
@@ -155,7 +155,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
155
155
|
display: flex;
|
|
156
156
|
align-items: center;
|
|
157
157
|
overflow-x: scroll;
|
|
158
|
-
`,nn=({onClose:a})=>{const n=O.useTheme(),{onClickNode:o}=Ze(),{searchText:s}=ge(),{selectedStreamName:c}=_e(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=_(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Qe();i(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:$,searchResults:k}=l(()=>Fa({instrumentationRules:m,sources:
|
|
158
|
+
`,nn=({onClose:a})=>{const n=O.useTheme(),{onClickNode:o}=Ze(),{searchText:s}=ge(),{selectedStreamName:c}=_e(),{sources:d,destinations:u,actions:p,instrumentationRules:m}=_(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=Qe();i(()=>{g||(b(0,50),y(!0))},[g]);const[f,x]=t("all"),{categories:$,searchResults:k}=l(()=>Fa({instrumentationRules:m,sources:Ye(d,c),actions:p,destinations:Xe(u,c),searchText:s,selectedCategory:f}),[m,d,p,u,c,s,f]);return k.length?e.createElement(et,{ref:h,isOpen:g,top:v.top,left:v.left,maxWidth:"420px",header:e.createElement(an,null,$.map(({category:t,label:i,count:a})=>!!a&&e.createElement(tt,{key:`category-select-${t}`,label:i,badgeLabel:a,isSelected:f===t,onClick:()=>x(t)})))},k.map(({category:t,label:i,entities:l},s)=>!!l.length&&e.createElement(r,{key:`category-list-${t}`},e.createElement(it,{style:{maxHeight:"all"!==f?"240px":"140px",padding:"12px 0"}},e.createElement(E,{size:12,family:"secondary",color:n.text.darker_grey,style:{marginLeft:"16px"}},i),l.map((i,n)=>e.createElement(tt,{key:`entity-${s}-${n}`,icon:Ce(t),label:be(i,t,{extended:!0}),onClick:()=>{const e=Pe(i);o(null,{data:{type:t,id:e}}),a()},style:{width:"100%",justifyContent:"flex-start"},color:"transparent"}))),e.createElement(re,{thickness:s===k.length-1?0:1,length:"90%",margin:"8px auto"})))):e.createElement(et,{ref:h,isOpen:g,top:v.top,left:v.left},e.createElement(De,null))},on=({preventPopup:i=!1})=>{const{searchText:a,setSearchText:o}=ge(),[l,r]=t(!1),s=!!a||l,c=()=>{o(""),r(!1)},d=n(null);return at(d,c),j({key:"Escape",active:s},c),e.createElement(tn,{ref:d},e.createElement($,{placeholder:"Search",icon:Di,value:a,onChange:e=>o(e.target.value.toLowerCase()),onFocus:()=>r(!0)}),s&&!i?e.createElement(nn,{onClose:c}):null)},ln=({sources:t,title:i="Condition",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({conditions:t})=>{t?.forEach(({type:t,reason:i})=>{e.find(e=>e.id===`${t}#${i}`)||e.push({id:`${t}#${i}`,value:`${nt(t)} - ${nt(i)}`})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(ot,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},rn=({sources:t,title:i="Error Message",value:a,onSelect:n,onDeselect:o,disabled:r,...s})=>{const c=l(()=>{const e=[];return t.forEach(({conditions:t})=>{ue(t||[]).forEach(({status:t,message:i,reason:a})=>{t!==W.Error||e.find(e=>e.id===i)||(i?e.find(e=>e.id===i)||e.push({id:i,value:i}):a&&(e.find(e=>e.id===a)||e.push({id:a,value:a})))})}),e},[t]);return e.createElement(ot,{disabled:r||!c?.length,title:i,placeholder:"All",options:c,value:a,onSelect:n,onDeselect:o,...s})},sn=({sources:t,title:i="Programming Language",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({containers:t})=>{t?.forEach(({language:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:lt[t]||t})})}),e.sort((e,t)=>e.id?.localeCompare(t.id||"")||0)},[t]);return e.createElement(ot,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},cn=({title:t="Monitors",value:i,onSelect:a,onDeselect:n,...o})=>{const r=l(()=>{const e=[];return rt.forEach(({id:t,value:i})=>{e.find(e=>e.id===t)||e.push({id:t,value:i})}),e},[]);return e.createElement(ot,{disabled:!r?.length,title:t,placeholder:"All",options:r,value:i,onSelect:a,onDeselect:n,...o})},dn=({namespaces:t,title:i="Namespace",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t?.forEach(({name:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(ot,{disabled:!s?.length,title:i,placeholder:"Select namespace",options:s,value:a,onSelect:n,onDeselect:o,...r})},un=({sources:t,title:i="Kind",value:a,onSelect:n,onDeselect:o,...r})=>{const s=l(()=>{const e=[];return t.forEach(({kind:t})=>{e.find(e=>e.id===t)||e.push({id:t,value:t})}),e},[t]);return e.createElement(ot,{disabled:!s?.length,title:i,placeholder:"All",options:s,value:a,onSelect:n,onDeselect:o,...r})},pn=d.div`
|
|
159
159
|
display: flex;
|
|
160
160
|
flex-direction: column;
|
|
161
161
|
gap: 12px;
|
|
@@ -167,7 +167,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
167
167
|
${({$color:e})=>`color: ${e};`}
|
|
168
168
|
`,gn=d.div`
|
|
169
169
|
margin-left: auto;
|
|
170
|
-
`,yn=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},vn=()=>{const a=O.useTheme(),{isVm:o}=We(),{namespaces:r,sources:s}=_(),{selectedStreamName:c}=_e(),{getItemSS:d,setItemSS:u,removeItemSS:p}=ct(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Qe(),{namespaces:b,kinds:f,monitors:x,languages:$,conditions:k,errors:C,onlyErrors:S,setAll:T,clearAll:D,getEmptyState:N}=ge(),E=l(()=>
|
|
170
|
+
`,yn=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},vn=()=>{const a=O.useTheme(),{isVm:o}=We(),{namespaces:r,sources:s}=_(),{selectedStreamName:c}=_e(),{getItemSS:d,setItemSS:u,removeItemSS:p}=ct(),{popupRef:m,popupOpen:h,setPopupOpen:g,popupPosition:y,handlePosition:v}=Qe(),{namespaces:b,kinds:f,monitors:x,languages:$,conditions:k,errors:C,onlyErrors:S,setAll:T,clearAll:D,getEmptyState:N}=ge(),E=l(()=>Ye(s,c),[s,c]),[F,I]=t({namespaces:b,kinds:f,monitors:x,languages:$,conditions:k,errors:C,onlyErrors:S}),[A,M]=t(yn(F));i(()=>{const e=d(st.OVERVIEW_FILTERS,N());T(e)},[]),i(()=>{if(!h){const e={namespaces:b,kinds:f,monitors:x,languages:$,conditions:k,errors:C,onlyErrors:S};I(e),M(yn(e))}},[h,b,f,x,$,k,C,S]);const R=()=>{g(!1)},L=n(null);return at(L,R),j({key:"Escape",active:h},R),e.createElement(tn,{ref:L},e.createElement(tt,{label:"Filters",icon:Ni,badgeLabel:A,badgeFilled:!!A,withBorder:!0,color:"transparent",onClick:()=>{v(0,50),g(!0)}}),e.createElement(et,{ref:m,isOpen:h,top:y.top,left:y.left,width:"420px",footer:e.createElement(de,null,e.createElement(hn,{variant:"primary",onClick:()=>{u(st.OVERVIEW_FILTERS,F),T(F),M(yn(F)),g(!1)}},"Apply"),e.createElement(hn,{variant:"secondary",onClick:R},"Cancel"),e.createElement(gn,null,e.createElement(hn,{variant:"tertiary",onClick:()=>{p(st.OVERVIEW_FILTERS),D(),I(N()),M(0),g(!1)},$color:a.text.error},"Reset")))},e.createElement(pn,null,!o&&e.createElement(dn,{namespaces:r,value:F.namespaces,onSelect:e=>I(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>I(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(un,{sources:E,value:F.kinds,onSelect:e=>I(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>I(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(sn,{sources:E,value:F.languages,onSelect:e=>I(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>I(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(cn,{value:F.monitors,onSelect:e=>I(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>I(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(ln,{sources:E,value:F.conditions,onSelect:e=>I(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>I(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),e.createElement(mn,null,e.createElement(w,{title:"Show only sources with errors",initialValue:F.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})),e.createElement(rn,{sources:E,value:F.errors,onSelect:e=>I(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>I(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!F.onlyErrors,showSearch:!0,required:!0,isMulti:!0}))))},bn=d.div`
|
|
171
171
|
display: flex;
|
|
172
172
|
flex-direction: column;
|
|
173
173
|
gap: 24px;
|
|
@@ -239,15 +239,15 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
239
239
|
display: flex;
|
|
240
240
|
flex-direction: column;
|
|
241
241
|
gap: 12px;
|
|
242
|
-
`,_n=({categories:i,updateDestination:a,deleteDestination:o,testConnection:r})=>{const{destinations:s}=_(),{selectedStreamName:c}=_e(),{drawerType:d,drawerEntityId:u}=K(),p=l(()=>Xe(s,c),[s,c]),h=n(null),g=d===B.Destination,[y,v]=t(!1),[b,f]=t(!1),{formData:x,formErrors:$,handleFormChange:k,resetFormData:C,validateForm:S,loadFormWithDrawerItem:w,yamlFields:T,setYamlFields:D,dynamicFields:N,setDynamicFields:E}=kt({}),O=l(()=>{if(!g)return C();const e=p?.find(e=>e.id===u);return e?(w(e),D(Ct(i,e))):C(),e},[g,u,p]);if(!O)return null;const F=i.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:I,iconSrc:A}=F?ze(F?.type):{icon:void 0,iconSrc:void 0};return e.createElement($a,{ref:h,title:O.name||O.destinationType.displayName,icons:I?[I]:void 0,iconSrcs:A?[A]:void 0,isEdit:y,isFormDirty:b,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(S({withAlert:!0,alertTitle:Z.Update})){const t=e!==O.destinationType.displayName?e:"";k("name",t),a(u,{...x,name:t}),v(!1),f(!1)}},onDelete:async()=>{o(u),v(!1),f(!1),h.current?.closeDrawer()},onCancel:()=>{v(!1),f(!1),w(O)},isLastItem:1===p.length},y?e.createElement(Bn,null,e.createElement(Hn,{isUpdate:!0,categoryItem:F,formData:x,formErrors:$,handleFormChange:(...e)=>{f(!0),k(...e)},dynamicFields:N,setDynamicFields:(...e)=>{f(!0),E(...e)},validateForm:S,testConnection:r})):e.createElement(Wn,null,O.conditions?.length?e.createElement(
|
|
242
|
+
`,_n=({categories:i,updateDestination:a,deleteDestination:o,testConnection:r})=>{const{destinations:s}=_(),{selectedStreamName:c}=_e(),{drawerType:d,drawerEntityId:u}=K(),p=l(()=>Xe(s,c),[s,c]),h=n(null),g=d===B.Destination,[y,v]=t(!1),[b,f]=t(!1),{formData:x,formErrors:$,handleFormChange:k,resetFormData:C,validateForm:S,loadFormWithDrawerItem:w,yamlFields:T,setYamlFields:D,dynamicFields:N,setDynamicFields:E}=kt({}),O=l(()=>{if(!g)return C();const e=p?.find(e=>e.id===u);return e?(w(e),D(Ct(i,e))):C(),e},[g,u,p]);if(!O)return null;const F=i.flatMap(e=>e.items).find(e=>e.type===O.destinationType.type),{icon:I,iconSrc:A}=F?ze(F?.type):{icon:void 0,iconSrc:void 0};return e.createElement($a,{ref:h,title:O.name||O.destinationType.displayName,icons:I?[I]:void 0,iconSrcs:A?[A]:void 0,isEdit:y,isFormDirty:b,onEdit:e=>{v("boolean"!=typeof e||e)},onSave:async e=>{if(S({withAlert:!0,alertTitle:Z.Update})){const t=e!==O.destinationType.displayName?e:"";k("name",t),a(u,{...x,name:t}),v(!1),f(!1)}},onDelete:async()=>{o(u),v(!1),f(!1),h.current?.closeDrawer()},onCancel:()=>{v(!1),f(!1),w(O)},isLastItem:1===p.length},y?e.createElement(Bn,null,e.createElement(Hn,{isUpdate:!0,categoryItem:F,formData:x,formErrors:$,handleFormChange:(...e)=>{f(!0),k(...e)},dynamicFields:N,setDynamicFields:(...e)=>{f(!0),E(...e)},validateForm:S,testConnection:r})):e.createElement(Wn,null,O.conditions?.length?e.createElement(G,{conditions:O.conditions}):null,e.createElement(X,{title:m.DESTINATION_DETAILS,data:O?Rn(O,T):[]})))},Jn=d.div`
|
|
243
243
|
display: flex;
|
|
244
244
|
flex-direction: column;
|
|
245
245
|
gap: 12px;
|
|
246
|
-
`,Un=({items:t,onSelectNew:i,onSelectConfigured:a,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:o}=ut();return t.map(t=>{const l=t.name===wt.EXISTS.TITLE;return e.createElement(Jn,{key:`category-${t.name}`},e.createElement(I,{size:"small",icon:t.icon,title:St(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=ze(r.type),p=r.selected||o.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>a(r.id):()=>i(r);return e.createElement(Re,{key:s,"data-id":s,title:r.displayName,hoverText:V.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>a(r.id)}})}))})},
|
|
246
|
+
`,Un=({items:t,onSelectNew:i,onSelectConfigured:a,isLoadingForDestinationIds:n})=>{const{configuredDestinationsUpdateOnly:o}=ut();return t.map(t=>{const l=t.name===wt.EXISTS.TITLE;return e.createElement(Jn,{key:`category-${t.name}`},e.createElement(I,{size:"small",icon:t.icon,title:St(t.name),description:t.description}),t.items.map(r=>{const s=`select-${t.name.replaceAll(" ","")}-destination-${r.type}`,c=Object.keys(r.supportedSignals).filter(e=>r.supportedSignals[e].supported),{icon:d,iconSrc:u}=ze(r.type),p=r.selected||o.some(e=>e.id===r.id),m=!!n.find(e=>e===r.id),h=l?()=>a(r.id):()=>i(r);return e.createElement(Re,{key:s,"data-id":s,title:r.displayName,hoverText:V.SELECT,onClick:h,iconProps:{icon:d,iconSrc:u},visualProps:{monitors:c,monitorsWithLabels:!0},checkboxProps:{withCheckbox:l,isChecked:p,isLoading:m,onCheckboxChange:()=>a(r.id)}})}))})},Yn=d.div`
|
|
247
247
|
display: flex;
|
|
248
248
|
flex-direction: column;
|
|
249
249
|
gap: 24px;
|
|
250
|
-
`,
|
|
250
|
+
`,Gn=d.div`
|
|
251
251
|
display: flex;
|
|
252
252
|
align-items: center;
|
|
253
253
|
gap: 12px;
|
|
@@ -265,9 +265,9 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
265
265
|
@media (height < 800px) {
|
|
266
266
|
max-height: calc(100vh - 400px);
|
|
267
267
|
}
|
|
268
|
-
`,Qn=d(
|
|
268
|
+
`,Qn=d(Yn)`
|
|
269
269
|
margin-top: 80px;
|
|
270
|
-
`,{MANAGED:eo,SELF_HOSTED:to,DETECTED:io,EXISTS:ao}=wt,no=[{value:"All types",id:"all"},{value:eo.TITLE,id:eo.TITLE},{value:to.TITLE,id:to.TITLE},{value:io.TITLE,id:io.TITLE},{value:ao.TITLE,id:ao.TITLE}],oo=no[0],lo=[$t.Logs,$t.Metrics,$t.Traces],ro=(e,t,i)=>e.map(e=>{const{type:a,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=i.has(e.id);return{id:e.id,type:a,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[$t.Logs]:{supported:e.exportedSignals.logs},[$t.Metrics]:{supported:e.exportedSignals.metrics},[$t.Traces]:{supported:e.exportedSignals.traces}}}}),so=({hidden:i,categories:a,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=_e(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=ut(),[m,h]=t(""),[g,y]=t(oo),[v,b]=t(lo),f=l(()=>{const e=Tt(a);return e.unshift({name:ao.TITLE,description:ao.DESCRIPTION,icon:Oi,items:ro(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:io.TITLE,description:io.DESCRIPTION,icon:Fi,items:n}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),a="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return i&&a&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,n,c,m,g,v,d,u,p]);return i?null:e.createElement(
|
|
270
|
+
`,{MANAGED:eo,SELF_HOSTED:to,DETECTED:io,EXISTS:ao}=wt,no=[{value:"All types",id:"all"},{value:eo.TITLE,id:eo.TITLE},{value:to.TITLE,id:to.TITLE},{value:io.TITLE,id:io.TITLE},{value:ao.TITLE,id:ao.TITLE}],oo=no[0],lo=[$t.Logs,$t.Metrics,$t.Traces],ro=(e,t,i)=>e.map(e=>{const{type:a,displayName:n}=e.destinationType,o=e.dataStreamNames?.includes(t),l=i.has(e.id);return{id:e.id,type:a,displayName:n,selected:o||l,fields:[],testConnectionSupported:!1,supportedSignals:{[$t.Logs]:{supported:e.exportedSignals.logs},[$t.Metrics]:{supported:e.exportedSignals.metrics},[$t.Traces]:{supported:e.exportedSignals.traces}}}}),so=({hidden:i,categories:a,potentialDestinations:n,onSelectNew:o,onSelectConfigured:r,isLoadingForDestinationIds:s})=>{const{destinations:c}=_(),{selectedStreamName:d}=_e(),{configuredDestinations:u,configuredDestinationsUpdateOnly:p}=ut(),[m,h]=t(""),[g,y]=t(oo),[v,b]=t(lo),f=l(()=>{const e=Tt(a);return e.unshift({name:ao.TITLE,description:ao.DESCRIPTION,icon:Oi,items:ro(c,d,new Set(u.concat(p).map(e=>e.id)))}),e.unshift({name:io.TITLE,description:io.DESCRIPTION,icon:Fi,items:n}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),a="all"===g.id||g.id===e.name,n=v.some(e=>t.supportedSignals[e.toLowerCase()]?.supported);return i&&a&&n});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,n,c,m,g,v,d,u,p]);return i?null:e.createElement(Yn,null,e.createElement(I,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e.createElement(Gn,null,e.createElement(Xn,null,e.createElement($,{placeholder:"Search...",icon:Di,value:m,onChange:({target:{value:e}})=>h(e)})),e.createElement(Xn,null,e.createElement(ot,{options:no,value:g,onSelect:y,onDeselect:()=>{}})),e.createElement(M,{title:"",selectedSignals:v,setSelectedSignals:b})),e.createElement(re,null),f.length?e.createElement(Zn,null,e.createElement(Un,{items:f,onSelectNew:e=>o(e,v),onSelectConfigured:r,isLoadingForDestinationIds:s})):e.createElement(Qn,null,e.createElement(De,{title:"No destinations found"})))},co=d.div`
|
|
271
271
|
display: flex;
|
|
272
272
|
`,uo=d.div`
|
|
273
273
|
border-right: 1px solid ${({theme:e})=>e.colors.border};
|
|
@@ -294,7 +294,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
294
294
|
padding: 32px;
|
|
295
295
|
border-radius: 16px;
|
|
296
296
|
border-style: dashed !important;
|
|
297
|
-
`,vo=({isSourcesListEmpty:t,goToSources:i,categories:a,potentialDestinations:n,testConnection:o,onClickSummary:l})=>{const r=O.useTheme(),{setCurrentModal:s}=ee(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=ut();return e.createElement(e.Fragment,null,e.createElement(ae,{$isNotModal:!0},e.createElement(Q,{$gap:12},e.createElement(Q,{$gap:24},l&&e.createElement(yt,{onClick:l}),e.createElement(I,{title:m.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:m.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ne,{type:W.Warning,message:m.NO_SOURCES_GO_BACK,action:{label:m.SELECT_SOURCES,onClick:i}}),e.createElement(yo,{variant:"secondary",onClick:()=>s(B.Destination)},e.createElement(Ti,null),e.createElement(E,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},m.ADD_DESTINATION))),e.createElement(ho,{categories:a,withDelete:!0}))),e.createElement(po,{isOnboarding:!0,categories:a,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:o}))},bo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"type",title:m.TYPE,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],fo=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=O.useTheme(),o=ge(),{selectedStreamName:r}=_e(),{setDrawerType:s,setDrawerEntityId:c}=K(),{destinations:d,destinationsLoading:u}=_(),p=l(()=>Xe(d,r),[d,r]),h=l(()=>Fa({instrumentationRules:[],sources:[],actions:[],destinations:
|
|
297
|
+
`,vo=({isSourcesListEmpty:t,goToSources:i,categories:a,potentialDestinations:n,testConnection:o,onClickSummary:l})=>{const r=O.useTheme(),{setCurrentModal:s}=ee(),{configuredDestinations:c,configuredDestinationsUpdateOnly:d}=ut();return e.createElement(e.Fragment,null,e.createElement(ae,{$isNotModal:!0},e.createElement(Q,{$gap:12},e.createElement(Q,{$gap:24},l&&e.createElement(yt,{onClick:l}),e.createElement(I,{title:m.ADD_DESTINATIONS,badgeLabel:c.length+d.length,description:m.ADD_DESTINATION_DESCRIPTION}),t&&e.createElement(ne,{type:W.Warning,message:m.NO_SOURCES_GO_BACK,action:{label:m.SELECT_SOURCES,onClick:i}}),e.createElement(yo,{variant:"secondary",onClick:()=>s(B.Destination)},e.createElement(Ti,null),e.createElement(E,{color:r.colors.secondary,size:14,decoration:"underline",family:"secondary"},m.ADD_DESTINATION))),e.createElement(ho,{categories:a,withDelete:!0}))),e.createElement(po,{isOnboarding:!0,categories:a,potentialDestinations:n,updateDestination:async()=>{},createDestination:async()=>{},deleteDestination:async()=>{},testConnection:o}))},bo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"type",title:m.TYPE,sortable:!0},{key:"signals",title:m.MONITORS},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],fo=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=O.useTheme(),o=ge(),{selectedStreamName:r}=_e(),{setDrawerType:s,setDrawerEntityId:c}=K(),{destinations:d,destinationsLoading:u}=_(),p=l(()=>Xe(d,r),[d,r]),h=l(()=>Fa({instrumentationRules:[],sources:[],actions:[],destinations:Ge(p,o),searchText:o.searchText,selectedCategory:B.Destination}).searchResults.find(({category:e})=>e===B.Destination)?.entities||[],[p,o]),g=l(()=>h.map(i=>{const{hasErrors:a,hasWarnings:o,hasDisableds:l}=se(i.conditions||[]),{icon:r,iconSrc:d}=ze(i.destinationType.type);return{status:a?W.Error:o?W.Warning:void 0,faded:l,onClick:()=>{s(B.Destination),c(i.id)},cells:[{columnKey:"icon",component:()=>e.createElement(ve,{icon:r,src:d})},{columnKey:"name",value:be(i,B.Destination,{prioritizeDisplayName:!0})},{columnKey:"type",value:i.destinationType.type,textColor:n.text.info},{columnKey:"throughput",value:je(Et(t,B.Destination,i.id).throughput),textColor:n.text.info},{columnKey:"signals",component:()=>e.createElement(fe,{withLabels:!0,monitors:Ke(i.exportedSignals)})},{columnKey:"conditions",component:()=>i.conditions?.length?e.createElement(Ea,{conditions:i.conditions,id:i.id}):null},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(ce,{status:i.disabled?W.Error:W.Success,title:i.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))}]}}),[h,t]),{badge:y,badgeTooltip:v}=l(()=>h.length!==p.length?{badge:`${h.length}/${p.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:p.length,badgeTooltip:void 0},[h,p]);return e.createElement(xe,{$maxWidth:a},e.createElement($e,null,e.createElement(ke,{icon:Ce(B.Destination),title:m.DESTINATIONS,badge:y,badgeTooltip:v,loading:u})),e.createElement(Se,{$maxHeight:i},e.createElement(we,{columns:bo,rows:g})),!h.length&&e.createElement(Te,{style:{marginTop:"2rem"}},e.createElement(De,null)))},xo=e=>{const{type:t,ruleName:i,notes:a,disabled:n,profileName:o,payloadCollection:l,codeAttributes:r,headersCollection:s,customInstrumentations:c}=e,d=[{title:m.TYPE,value:t},{type:h.ActiveStatus,title:m.STATUS,value:String(!n)},{title:m.NAME,value:i},{title:m.NOTES,value:a},{title:m.MANAGED_BY_PROFILE,value:o},{type:h.Divider}];if(l){const e=Object.entries(l).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(r){const e=Object.entries(r).filter(([e,t])=>t).map(([e,t])=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(s){const e=(s[Ot.HeaderKeys]||[]).filter(e=>e).join(", ");e&&d.push({title:"Collect",value:e})}if(c){const e=(c[It.Java]||[]).map(e=>new Ft(e.className,e.methodName)).map(e=>`• ${e.toString()}`).join("\r\n");e&&d.push({title:m.JAVA_CUSTOM_PROBES,value:e});const t=(c[It.Golang]||[]).map(e=>new At(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).map(e=>`• ${e.toString()}`).join("\r\n");t&&d.push({title:m.GOLANG_CUSTOM_PROBES,value:t})}return d},$o=d.div`
|
|
298
298
|
display: flex;
|
|
299
299
|
flex-direction: column;
|
|
300
300
|
gap: 12px;
|
|
@@ -331,7 +331,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
331
331
|
display: flex;
|
|
332
332
|
flex-direction: column;
|
|
333
333
|
gap: 12px;
|
|
334
|
-
`,Ro=({updateInstrumentationRule:i,deleteInstrumentationRule:a})=>{const{instrumentationRules:o}=_(),{addNotification:r}=P(),{drawerType:s,drawerEntityId:c}=K(),d=n(null),u=s===B.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:$}=jt(),k=l(()=>{if(!u)return f();const e=o?.find(e=>e.ruleId===c);return e?$(e):f(),e},[u,c,o]);if(!k)return null;const C=Vt.find(({type:e})=>e===k.type);return e.createElement($a,{ref:d,title:k.ruleName||k.type,icons:[qe(k.type)],isEdit:p,isFormDirty:h,onEdit:e=>{k.mutable||!e&&void 0!==e?m("boolean"!=typeof e||e):r({type:W.Warning,title:oe.FORBIDDEN,message:oe.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onSave:e=>{if(x()){const t=e!==k.type?e:"";b("ruleName",t),i(c,{...y,ruleName:t}),m(!1),g(!1)}},onDelete:()=>{k.mutable?(a(c),m(!1),g(!1),d.current?.closeDrawer()):r({type:W.Warning,title:oe.FORBIDDEN,message:oe.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onCancel:()=>{m(!1),g(!1),$(k)}},p&&C?e.createElement(Ao,null,e.createElement(Io,{isUpdate:!0,rule:C,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement(Mo,null,e.createElement(
|
|
334
|
+
`,Ro=({updateInstrumentationRule:i,deleteInstrumentationRule:a})=>{const{instrumentationRules:o}=_(),{addNotification:r}=P(),{drawerType:s,drawerEntityId:c}=K(),d=n(null),u=s===B.InstrumentationRule,[p,m]=t(!1),[h,g]=t(!1),{formData:y,formErrors:v,handleFormChange:b,resetFormData:f,validateForm:x,loadFormWithDrawerItem:$}=jt(),k=l(()=>{if(!u)return f();const e=o?.find(e=>e.ruleId===c);return e?$(e):f(),e},[u,c,o]);if(!k)return null;const C=Vt.find(({type:e})=>e===k.type);return e.createElement($a,{ref:d,title:k.ruleName||k.type,icons:[qe(k.type)],isEdit:p,isFormDirty:h,onEdit:e=>{k.mutable||!e&&void 0!==e?m("boolean"!=typeof e||e):r({type:W.Warning,title:oe.FORBIDDEN,message:oe.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onSave:e=>{if(x()){const t=e!==k.type?e:"";b("ruleName",t),i(c,{...y,ruleName:t}),m(!1),g(!1)}},onDelete:()=>{k.mutable?(a(c),m(!1),g(!1),d.current?.closeDrawer()):r({type:W.Warning,title:oe.FORBIDDEN,message:oe.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:c,hideFromHistory:!0})},onCancel:()=>{m(!1),g(!1),$(k)}},p&&C?e.createElement(Ao,null,e.createElement(Io,{isUpdate:!0,rule:C,formData:y,formErrors:v,handleFormChange:(...e)=>{g(!0),b(...e)}})):e.createElement(Mo,null,e.createElement(G,{conditions:k.conditions||[]}),e.createElement(X,{title:"Instrumentation Rule Details",data:k?xo(k):[]})))},Lo=d(Q)`
|
|
335
335
|
margin-top: 24px;
|
|
336
336
|
gap: 12px;
|
|
337
337
|
`,Po=Vt,Ko=({isEnterprise:i,createInstrumentationRule:a})=>{const{currentModal:n,setCurrentModal:o}=ee(),l=n===B.InstrumentationRule,{formData:r,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=jt(),[p,h]=t(void 0),g=()=>{d(),h(void 0),o("")},y=()=>{if(!u())return null;a(r),g()};return j({key:"Enter",active:l},()=>y()),e.createElement(te,{isOpen:l,onClose:g,header:{title:"Add Instrumentation Rule"},actionComponent:e.createElement(ie,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!i||!p,tooltip:i?"":oe.ENTERPRISE_ONLY("Instrumentation Rules")}]})},e.createElement(ae,null,e.createElement(I,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e.createElement(Lo,null,i?e.createElement(ne,{type:W.Warning,message:oe.DEFINED_FOR_ALL_STREAMS(m.INSTRUMENTATION_RULES)}):e.createElement(ne,{type:W.Default,message:oe.ENTERPRISE_ONLY(m.INSTRUMENTATION_RULES)}),e.createElement(le,{options:Po,selectedOption:p,onOptionSelect:e=>{return t=e,d(),void h(t);var t},autoFocus:!p?.type})),p?.type?e.createElement("div",null,e.createElement(re,{margin:"16px 0"}),e.createElement(Io,{rule:p,formData:r,formErrors:s,handleFormChange:c})):null))},jo=e=>{const{payloadCollection:t,codeAttributes:i,customInstrumentations:a}=e;let n="";return t&&(n+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&(n+=Object.entries(i).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),a&&Object.values(It).forEach(e=>{const t=(a[e]||[]).filter(e=>e).join(", ");t&&(n+=n?`, ${t}`:t)}),n},Vo=[{key:"icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"profile",title:m.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:m.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:m.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:m.NOTES,sortable:!0}],qo=({maxHeight:t,maxWidth:i})=>{const a=p(),n=ge(),{setDrawerType:o,setDrawerEntityId:r}=K(),{instrumentationRules:s,instrumentationRulesLoading:c}=_(),d=l(()=>Fa({instrumentationRules:s,sources:[],actions:[],destinations:[],searchText:n.searchText,selectedCategory:B.InstrumentationRule}).searchResults.find(({category:e})=>e===B.InstrumentationRule)?.entities||[],[s,n]),u=l(()=>d.map(t=>{const{hasErrors:i,hasWarnings:n,hasDisableds:l}=se(t.conditions||[]);return{status:i?W.Error:n?W.Warning:void 0,faded:l,onClick:()=>{o(B.InstrumentationRule),r(t.ruleId)},cells:[{columnKey:"icon",component:()=>e.createElement(ve,{icon:qe(t.type)})},{columnKey:"name",value:be(t,B.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:t.type,textColor:a.text.info},{columnKey:"profile",value:t.profileName,textColor:a.text.info},{columnKey:"notes",value:t.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:jo(t),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>e.createElement(Ea,{conditions:t.conditions||[],id:t.ruleId})},{columnKey:"active-status",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(ce,{status:t.disabled?W.Error:W.Success,title:t.disabled?m.DISABLED:m.ENABLED,withIcon:!0,withBorder:!0}))},{columnKey:"source-count",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(ce,{status:W.Info,title:"all sources",withBorder:!0}))}]}}),[d]),{badge:h,badgeTooltip:g}=l(()=>d.length!==s.length?{badge:`${d.length}/${s.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:s.length,badgeTooltip:void 0},[d,s]);return e.createElement(xe,{$maxWidth:i},e.createElement($e,null,e.createElement(ke,{icon:Ce(B.Action),title:m.INSTRUMENTATION_RULES,badge:h,badgeTooltip:g,loading:c})),e.createElement(Se,{$maxHeight:t},e.createElement(we,{columns:Vo,rows:u})),!d.length&&e.createElement(Te,{style:{marginTop:"2rem"}},e.createElement(De,null)))},zo=d.div`
|
|
@@ -372,7 +372,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
372
372
|
border-radius: 32px;
|
|
373
373
|
width: fit-content;
|
|
374
374
|
padding: 2px 8px;
|
|
375
|
-
`,
|
|
375
|
+
`,Yo=()=>{const t=O.useTheme(),{notifications:i,markAsSeen:a}=P(),n=i.filter(({hideFromHistory:e})=>!e),o=n.filter(({seen:e})=>!e),l=o.length,{popupRef:r,popupOpen:s,setPopupOpen:c,popupPosition:d,handlePosition:u}=Qe({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{l&&o.forEach(({id:e})=>a(e))}});return e.createElement(Bo,null,e.createElement(mt,{onClick:()=>{u(0,0),c(e=>!e)},tooltip:"Notifications",withPing:!!l,pingColor:t.colors.orange_og},e.createElement(Mi,{size:18})),e.createElement(et,{ref:r,isOpen:s,right:d.left,maxWidth:"400px",header:e.createElement(Wo,null,e.createElement(E,{size:20},"Notifications"),!!l&&e.createElement(Uo,{size:12,family:"secondary"},l," new"))},e.createElement(_o,null,n.length?n.map(t=>e.createElement(tl,{key:`notification-${t.id}`,...t,onClick:()=>c(!1)})):e.createElement(De,{title:"No notifications",subTitle:""})),e.createElement(Jo,null)))},Go=d.div`
|
|
376
376
|
display: flex;
|
|
377
377
|
align-items: flex-start;
|
|
378
378
|
gap: 12px;
|
|
@@ -402,11 +402,11 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
402
402
|
display: flex;
|
|
403
403
|
align-items: center;
|
|
404
404
|
gap: 6px;
|
|
405
|
-
`,tl=({id:t,seen:i,type:a,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=O.useTheme(),{formatTimeAgo:u}=Ht(),{onClickNotification:p}=Bt(),m=!!r&&!!s,h=n?.toLowerCase().includes(Z.Delete.toLowerCase())||!1,g=he(a,d);return e.createElement(
|
|
405
|
+
`,tl=({id:t,seen:i,type:a,title:n,message:o,time:l,crdType:r,target:s,onClick:c})=>{const d=O.useTheme(),{formatTimeAgo:u}=Ht(),{onClickNotification:p}=Bt(),m=!!r&&!!s,h=n?.toLowerCase().includes(Z.Delete.toLowerCase())||!1,g=he(a,d);return e.createElement(Go,{key:`notification-${t}`,className:m?"click-enabled":"",onClick:()=>{m&&(c(),p({id:t,crdType:r,target:s}))}},e.createElement(Xo,{$type:h?W.Error:a},h?e.createElement(Si,null):e.createElement(g,null)),e.createElement(Zo,null,e.createElement(Qo,null,e.createElement(E,{size:14},o)),e.createElement(el,null,e.createElement(E,{size:10,color:d.text.grey},u(l)),!i&&e.createElement(e.Fragment,null,e.createElement(E,{size:10},"·"),e.createElement(E,{size:10,color:d.colors.orange_soft},"new")))))},il=(e,t,i)=>{const a=e?.serviceName||t?.otelServiceName||t?.name,n=i?[Ri]:He(t?.containers||[]),{priorotizedStatus:o}=se(t?.conditions||[]);return{id:a,title:a,icons:n.length?n:[Li],status:o,serviceMapEntry:e}},al=e=>"user"===e?.otelServiceName&&!e?.namespace&&!e?.name&&!e?.kind,nl=d.div`
|
|
406
406
|
width: 100%;
|
|
407
407
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
408
408
|
position: relative;
|
|
409
|
-
`,ol={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},ll=({heightToRemove:t,serviceMap:a})=>{const n=O.useTheme(),{sources:o,sourcesLoading:l}=_(),{containerRef:r,containerHeight:s,containerWidth:c}=Je(),[d,u,p]=
|
|
409
|
+
`,ol={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},ll=({heightToRemove:t,serviceMap:a})=>{const n=O.useTheme(),{sources:o,sourcesLoading:l}=_(),{containerRef:r,containerHeight:s,containerWidth:c}=Je(),[d,u,p]=Yi([]),[h,g,y]=Gi([]);return i(()=>{if(s&&c){const t=(({sources:e,serviceMap:t,containerHeight:i,containerWidth:a})=>{const n=[],o=new Map,l=((e,t)=>{const i=new Map,a=new Map,n=new Map,o=new Set;e.forEach(e=>{o.add(e.serviceName),e.services.forEach(e=>{o.add(e.serviceName)})}),o.forEach(e=>{a.set(e,[]),n.set(e,0)}),e.forEach(e=>{e.services.forEach(t=>{a.get(e.serviceName)?.push(t.serviceName);const i=n.get(t.serviceName)||0;n.set(t.serviceName,i+1)})});const l=[],r=[];for(o.forEach(e=>{0===(n.get(e)||0)&&r.push(e)});r.length>0;){const e=[],t=r.length;for(let i=0;i<t;i++){const t=r.shift();e.push(t),a.get(t)?.forEach(e=>{const t=n.get(e)||0;n.set(e,t-1),t-1==0&&r.push(e)})}e.length>0&&l.push(e)}return o.forEach(e=>{l.flat().includes(e)||(0===l.length?l.push([e]):l[l.length-1].push(e))}),l.forEach((e,a)=>{const n=100+150*a,o=150*(e.length-1),l=(t-o)/2;e.forEach((e,t)=>{const a=l+150*t,o=n;i.set(e,{x:a,y:o})})}),i})(t,a);if(t.length&&e.length){t.forEach(t=>{const i=t.serviceName;if(n.find(e=>e.id===`${B.Source}-${i}-${Wt.MapItem}`))return;const a=e.find(e=>i===e.otelServiceName||i===e.name);o.set(i,t),t.services.forEach(e=>o.set(e.serviceName,{serviceName:e.serviceName,services:[]})),n.push({id:`${B.Source}-${i}-${Wt.MapItem}`,type:Wt.MapItem,position:l.get(i),data:il(t,a,al(a))})}),o.forEach((t,i)=>{if(n.find(e=>e.id===`${B.Source}-${i}-${Wt.MapItem}`))return;const a=e.find(e=>i===e.otelServiceName||i===e.name);n.push({id:`${B.Source}-${i}-${Wt.MapItem}`,type:Wt.MapItem,position:l.get(i),data:il(t,a,al(a))})});let i=50;e.forEach(e=>{const t=e.otelServiceName||e.name;n.find(e=>e.id===`${B.Source}-${t}-${Wt.MapItem}`)||(n.push({id:`${B.Source}-${t}-${Wt.MapItem}`,type:Wt.MapItem,position:{x:i,y:10},data:il(void 0,e,al(e))}),i+=110)})}else n.push({id:`${B.Source}-${Wt.NoData}`,type:Wt.NoData,position:{x:a/2-150,y:i/4},data:{subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return n})({serviceMap:a,sources:[ol].concat(o),sourcesLoading:l,containerHeight:s,containerWidth:c});d.length>1?(e=t,u(t=>{const i=e.map(e=>{const i=t.find(t=>t.id===e.id);return e.position=i?.position||e.position,{id:e.id,item:e,type:i?"replace":"add"}});return t.find(e=>e.id===`${B.Source}-${Wt.NoData}`)&&i.push({id:`${B.Source}-${Wt.NoData}`,type:"remove"}),Xi(i,t)})):u(t)}var e},[a,o,l,s,c]),i(()=>{g((({theme:e,nodes:t,serviceMap:i})=>{const a=[];return t.forEach(({id:t,data:{id:n,status:o}})=>{const{services:l}=i.find(e=>e.serviceName===n)||{services:[]};l.forEach(i=>{const n=t,l=`${B.Source}-${i.serviceName}-${Wt.MapItem}`,r=o===W.Error;a.push({id:`${n}-to-${l}`,source:n,target:l,markerEnd:{type:Ui.ArrowClosed},style:{stroke:r?e?.colors.dark_red:e?.colors.border}})})}),a})({theme:n,nodes:d,serviceMap:a}))},[n,d,a]),e.createElement(nl,{ref:r,$heightToRemove:t},e.createElement(_t,{nodes:d,edges:h,onNodesChange:p,onEdgesChange:y,zoomOnScroll:!0}))},rl=d.div`
|
|
410
410
|
display: flex;
|
|
411
411
|
flex-direction: column;
|
|
412
412
|
align-items: center;
|
|
@@ -466,7 +466,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
466
466
|
flex-direction: column;
|
|
467
467
|
gap: 24px;
|
|
468
468
|
padding: 4px;
|
|
469
|
-
`,wl=({formData:t,handleFormChange:i})=>e.createElement(Sl,null,e.createElement($,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:t.otelServiceName,onChange:({target:{value:e}})=>i("otelServiceName",e)})),Tl=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const i=
|
|
469
|
+
`,wl=({formData:t,handleFormChange:i})=>e.createElement(Sl,null,e.createElement($,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:t.otelServiceName,onChange:({target:{value:e}})=>i("otelServiceName",e)})),Tl=({workloadOdigosHealthStatus:t})=>{if(!t)return null;const i=Yt(t.status),a=nt(t.reasonEnum),n=t.message;return e.createElement(de,{$alignItems:"center",$justifyContent:"center"},e.createElement(ce,{status:i,title:a,subtitle:n,withBackground:i!==me.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"}))},Dl=({source:a,fetchSourceDescribe:n,restartPod:o})=>{const[l,r]=t(!1),[s,d]=t(null);return i(()=>{a&&n({variables:{namespace:a.namespace,name:a.name,kind:a.kind}}).then(({data:e})=>{e?.describeSource?d(e.describeSource):r(!0)})},[n,a]),s||l?e.createElement(Q,{$gap:12},l?e.createElement(Te,{$height:"70vh"},e.createElement(De,{subTitle:"Could not fetch describe for this source"})):s?.pods?.length?s.pods.map(({podName:t,nodeName:i,phase:n,agentInjected:l,runningLatestWorkloadRevision:r,containers:d,manifestYAML:u})=>{const p=n.status!==W.Success||Gt(d)?W.Error:W.Success,m=[];return m.push(e.createElement(Xt,{key:"copy-text",value:`kubectl get pod ${t.value} -n ${s?.namespace?.value||a.namespace}`.toLowerCase()})),m.push(e.createElement(re,{key:"divider-1",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-1",title:i.name,tooltip:i.explain||"",value:{status:i.status||void 0,text:i.value}})),m.push(e.createElement(re,{key:"divider-2",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-2",title:n.name,tooltip:n.explain||"",value:{status:n.status||void 0,text:n.value}})),m.push(e.createElement(re,{key:"divider-3",length:"100%",margin:"0"})),m.push(e.createElement(Zt,{key:"describe-row-3",title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}})),m.push(e.createElement(re,{key:"divider-4",length:"100%",margin:"0"})),r?.name&&(m.push(e.createElement(Zt,{key:"describe-row-4",title:r.name,tooltip:r.explain||void 0,value:{status:r.status||void 0,text:r.value}})),m.push(e.createElement(re,{key:"divider-5",length:"100%",margin:"0"}))),d.forEach(t=>{m.push(e.createElement(Qt,{key:`pod-container-${t.containerName.value}`,...t}))}),u&&(m.push(e.createElement(re,{key:"divider-6",length:"100%",margin:"0"})),m.push(e.createElement(Zi,{key:"yaml-section-card",yaml:u}))),e.createElement(X,{key:`pod-${t.value}`,title:`Pod: ${t.value}`,withExtend:!0,action:({hovered:i})=>e.createElement("div",{style:{position:"relative"}},e.createElement(ce,{key:"status",status:p,title:p,withIcon:!0,withBorder:!0}),i&&e.createElement(ei,{key:"hover-actions",isOpen:!0,positionRight:"calc(100% + 12px)",actions:[{id:ti(),label:"Restart",rightIcon:Hi,onClick:()=>o(s?.namespace?.value||a.namespace,t.value)}]}))},c.toArray(m))}):e.createElement(Te,{$height:"70vh"},e.createElement(De,{subTitle:"Check if you have any running pods and try again"}))):e.createElement(Te,{$height:"70vh"},e.createElement(Le,null))},Nl=d(de)`
|
|
470
470
|
width: 100%;
|
|
471
471
|
align-items: center;
|
|
472
472
|
justify-content: space-between;
|
|
@@ -480,16 +480,16 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
480
480
|
display: flex;
|
|
481
481
|
flex-direction: column;
|
|
482
482
|
gap: 12px;
|
|
483
|
-
`,Rl=({persistSources:a,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d,restartPod:u})=>{const{isVm:p}=We(),{sources:h}=_(),{selectedStreamName:g}=_e(),{drawerType:y,drawerEntityId:v}=K(),b=l(()=>
|
|
483
|
+
`,Rl=({persistSources:a,updateSource:o,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d,restartPod:u})=>{const{isVm:p}=We(),{sources:h}=_(),{selectedStreamName:g}=_e(),{drawerType:y,drawerEntityId:v}=K(),b=l(()=>Ye(h,g),[h,g]),f=n(null),x=y===B.Source,[$,k]=t(!1),[C,S]=t(!1),[w,T]=t(Ol.Overview),[D,N]=t(null);i(()=>{x&&v&&s(v).then(e=>N(e||null))},[x,v]);const{formData:O,handleFormChange:F,resetFormData:I,loadFormWithDrawerItem:A}=ni(),M=l(()=>{if(!x)return I();const e=(D&&JSON.stringify(zt(D))===JSON.stringify(zt(v))?D:null)||b?.find(e=>e.namespace===v.namespace&&e.name===v.name&&e.kind===v.kind);return e?A(e):I(),e},[x,v,b,D]),R=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===me.Loading,containers:M?.containers||[]}},[M]),L=l(()=>{const e=[{label:Ol.Overview,onClick:()=>T(Ol.Overview),selected:w===Ol.Overview}];return Fl.includes(M?.kind)&&e.push({label:Ol.Pods,onClick:()=>T(Ol.Pods),selected:w===Ol.Pods}),M?.containers?.some(({language:e})=>Il.includes(e))&&e.push({label:Ol.Libraries,onClick:()=>T(Ol.Libraries),selected:w===Ol.Libraries}),e},[w,M]);return M?e.createElement($a,{ref:f,onClose:()=>{T(Ol.Overview),N(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:He(M.containers),isEdit:$,isFormDirty:C,onEdit:w===Ol.Overview?e=>{k("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=O.otelServiceName!==M.name?O.otelServiceName:"";F("otelServiceName",e),await o(v,{...O,otelServiceName:e}),N(null),S(!1),k(!1)},onDelete:w===Ol.Overview?async()=>{const{namespace:e}=M;a({[e]:[{...M,selected:!1,currentStreamName:g}]},{}),N(null),S(!1),k(!1),f.current?.closeDrawer()}:void 0,onCancel:()=>{S(!1),k(!1),F("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===b.length,tabs:L,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([v]),children:e.createElement(e.Fragment,null,e.createElement(Ai,null),e.createElement(E,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},w===Ol.Overview?$?e.createElement(Al,null,e.createElement(wl,{formData:O,handleFormChange:(...e)=>{S(!0),F(...e),F("currentStreamName",g)}})):e.createElement(Ml,null,e.createElement(Tl,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(G,{conditions:M.conditions||[]}),e.createElement(X,{title:m.SOURCE_DETAILS,data:M?Cl(M,p):[]}),e.createElement(X,{title:p?m.DETECTED_PROCESSES:m.DETECTED_CONTAINERS,titleBadge:R.isLoading?me.Loading:R.containers.length,description:R.description||(p?m.DETECTED_PROCESSES_DESCRIPTION:m.DETECTED_CONTAINERS_DESCRIPTION)},R.containers.map(t=>e.createElement(oi,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await o(v,e)}))),e.createElement(Zi,{yaml:M.manifestYAML})):w===Ol.Pods?e.createElement(Dl,{source:M,fetchSourceDescribe:c,restartPod:u}):e.createElement(El,{source:M,fetchSourceLibraries:d})):null},Ll=d.div`
|
|
484
484
|
max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
|
|
485
485
|
width: 100%;
|
|
486
|
-
`,Pl=a(({isModal:t,fetchSingleNamespace:i,onClickSummary:a},n)=>{const l=O.useTheme(),{isVm:r}=We(),s=si({fetchSingleNamespace:i}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:p,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:x,setShowSelectedOnly:k,showRunningOnly:C,setShowRunningOnly:S}=s;o(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const T=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(ae,{$isNotModal:!t},e.createElement(Q,{$gap:12},e.createElement(Q,{$gap:24},a&&e.createElement(yt,{onClick:a}),e.createElement(I,{title:m.SELECT_SOURCES,badgeLabel:T,description:m.SELECT_SOURCES_DESCRIPTION}),e.createElement(de,{$justifyContent:"space-between"},e.createElement(Ll,{$fullWidth:r},e.createElement($,{placeholder:b===B.Source?m.SEARCH_SOURCES:m.SEARCH_NAMESPACES,icon:Di,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(F,{options:[{label:m.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:m.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(de,{$gap:36},e.createElement(w,{title:m.SELECT_ALL,initialValue:u,onChange:p,disabled:!!d}),e.createElement(w,{title:m.ONLY_SELECTED,initialValue:x,onChange:k}),e.createElement(w,{title:m.ONLY_RUNNING_INSTANCES,initialValue:C,onChange:S}))),e.createElement(re,null),e.createElement(yl,{isModal:t,...s})))});Pl.displayName=Pl.name;const Kl=({fetchSingleNamespace:t,persistSources:i})=>{const{currentModal:a,setCurrentModal:o}=ee(),l=a===B.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),r()}},c=n(null);return j({key:"Enter",active:l},s),l?e.createElement(te,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(ie,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(Pl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},jl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:m.NAMESPACE,sortable:!0}),t.push({key:"containers",title:m.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Vl=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=O.useTheme(),{isVm:o}=We(),r=ge(),{isThisPending:c}=L(),{selectedStreamName:d}=_e(),{sources:u,sourcesLoading:p}=_(),{setDrawerType:h,setDrawerEntityId:g}=K(),{selectedSources:y,setSelectedSources:v}=Ae(),{isAwaitingInstrumentation:f,sourcesToCreate:x,sourcesCreated:$,sourcesToDelete:k,sourcesDeleted:C}=Me(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,$):k?e(k,C):1},[x,$,k,C]),w=l(()=>
|
|
486
|
+
`,Pl=a(({isModal:t,fetchSingleNamespace:i,onClickSummary:a},n)=>{const l=O.useTheme(),{isVm:r}=We(),s=si({fetchSingleNamespace:i}),{selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:p,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:x,setShowSelectedOnly:k,showRunningOnly:C,setShowRunningOnly:S}=s;o(n,()=>({getFormValues:()=>({apps:h(),futureApps:g()})}));const T=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(ae,{$isNotModal:!t},e.createElement(Q,{$gap:12},e.createElement(Q,{$gap:24},a&&e.createElement(yt,{onClick:a}),e.createElement(I,{title:m.SELECT_SOURCES,badgeLabel:T,description:m.SELECT_SOURCES_DESCRIPTION}),e.createElement(de,{$justifyContent:"space-between"},e.createElement(Ll,{$fullWidth:r},e.createElement($,{placeholder:b===B.Source?m.SEARCH_SOURCES:m.SEARCH_NAMESPACES,icon:Di,value:y,onChange:e=>v(e.target.value.toLowerCase())})),!r&&e.createElement(F,{options:[{label:m.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:m.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(de,{$gap:36},e.createElement(w,{title:m.SELECT_ALL,initialValue:u,onChange:p,disabled:!!d}),e.createElement(w,{title:m.ONLY_SELECTED,initialValue:x,onChange:k}),e.createElement(w,{title:m.ONLY_RUNNING_INSTANCES,initialValue:C,onChange:S}))),e.createElement(re,null),e.createElement(yl,{isModal:t,...s})))});Pl.displayName=Pl.name;const Kl=({fetchSingleNamespace:t,persistSources:i})=>{const{currentModal:a,setCurrentModal:o}=ee(),l=a===B.Source,r=()=>{o("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),r()}},c=n(null);return j({key:"Enter",active:l},s),l?e.createElement(te,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(ie,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(Pl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},jl=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:m.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:m.NAMESPACE,sortable:!0}),t.push({key:"containers",title:m.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Vl=({metrics:t,maxHeight:i,maxWidth:a})=>{const n=O.useTheme(),{isVm:o}=We(),r=ge(),{isThisPending:c}=L(),{selectedStreamName:d}=_e(),{sources:u,sourcesLoading:p}=_(),{setDrawerType:h,setDrawerEntityId:g}=K(),{selectedSources:y,setSelectedSources:v}=Ae(),{isAwaitingInstrumentation:f,sourcesToCreate:x,sourcesCreated:$,sourcesToDelete:k,sourcesDeleted:C}=Me(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return x?e(x,$):k?e(k,C):1},[x,$,k,C]),w=l(()=>Ye(u,d),[u,d]),T=l(()=>Fa({instrumentationRules:[],sources:Ue(w,r),actions:[],destinations:[],searchText:r.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[w,r]),[D,N]=l(()=>{let e=0;return Object.values(y).forEach(t=>{e+=t.length}),[0!==e,e]},[y]),F=s(e=>{if(e){const e={};T.forEach(t=>{const i={namespace:t.namespace,name:t.name,kind:t.kind};c({entityType:B.Source,entityId:i})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),v(e)}else v({})},[T]),I=s(e=>{const{namespace:t,name:i,kind:a}=e,n={...y};n[t]||(n[t]=[]);const o=n[t].findIndex(e=>e.name===i&&e.kind===a);-1===o?n[t].push(e):n[t].splice(o,1),v(n)},[y]),A=l(()=>T.map(i=>{const a=zt(i),o=JSON.stringify(a),{hasErrors:l,hasWarnings:r,hasDisableds:s}=se(i.conditions||[]),d=c({entityType:B.Source,entityId:a}),u=!!y[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?W.Error:r?W.Warning:void 0,faded:s,onClick:()=>{h(B.Source),g(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(de,{$gap:16},e.createElement(b,{disabled:d,value:u,onChange:()=>I(i)}),e.createElement(ci,{icons:He(i.containers),id:o}))},{columnKey:"name",value:be(i,B.Source,{extended:!0})},{columnKey:"kind",value:i.kind,textColor:n.text.info},{columnKey:"namespace",value:i.namespace,textColor:n.text.info},{columnKey:"throughput",value:je(Et(t,B.Source,a).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ea,{conditions:i.conditions||[],id:o})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(ce,{status:W.Info,title:di(i.containers),withBorder:!0}))}]}}),[T,y,t,I]),{badge:M,badgeTooltip:R}=l(()=>T.length!==w.length?{badge:`${T.length}/${w.length}`,badgeTooltip:m.FILTERED_COUNT_TOOLTIP}:{badge:w.length,badgeTooltip:void 0},[T,w]);return e.createElement(xe,{$maxWidth:a},e.createElement($e,null,e.createElement(b,{partiallyChecked:D&&T?.length!==N,value:D&&T?.length===N,onChange:F,disabled:!T?.length}),e.createElement(ke,{icon:Ce(B.Source),title:m.SOURCES,badge:M,badgeTooltip:R,loading:p||f})),e.createElement(Se,{$maxHeight:i},e.createElement(we,{columns:jl(o),rows:A})),f&&!A.length?e.createElement(Te,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ne,{width:420}),e.createElement(de,{$gap:16},e.createElement(E,{color:n.text.info},x?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Ee,{label:`${S}%`}))):A.length?null:e.createElement(Te,{style:{marginTop:"2rem"}},e.createElement(De,null)))},ql=({expiresAt:t})=>{const i=O.useTheme(),{formatTimeAgo:a}=Ht(),n=a(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),l=ui(t,0)?i.text.error:ui(t,6048e5)?i.text.warning:i.text.success;return e.createElement(E,{size:14,color:l},n," (",o,")")},zl=d.div`
|
|
487
487
|
position: relative;
|
|
488
488
|
`,Hl=({token:i,saveToken:a})=>{const{CopyButton:n}=pi(),{formData:o,handleFormChange:l,resetFormData:r}=mi({token:i}),[s,c]=t(!1),d=()=>{c(!1),r()};return e.createElement(de,{$gap:0},e.createElement(n,{value:i,size:hi.L}),e.createElement(re,{orientation:"vertical",length:"12px"}),e.createElement(zl,null,e.createElement(mt,{size:32,onClick:()=>{c(!0)}},e.createElement(Ci,null)),s&&e.createElement(gi,{flipX:!0,clientX:36,isOpen:s,onClose:d,onSave:()=>{a(o.token).then(d)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement($,{placeholder:"API Token",type:"password",value:o.token,onChange:e=>l("token",e.target.value)}))))},Bl=({tokens:t,saveToken:i})=>e.createElement(X,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:h.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:a,expiresAt:n})=>({cells:[{columnKey:"icon",icon:Bi},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(ql,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Hl,{token:a,saveToken:i})}]}))}}]}),Wl=({fetchDescribeOdigos:a})=>{const[n,o]=t(null);if(i(()=>{a().then(({data:e})=>{o(e?.describeOdigos||null)})},[a]),!n)return e.createElement(Te,null,e.createElement(Le,null));const l=t=>t?.name?[e.createElement(re,{key:`divider-${t.name}`}),e.createElement(Zt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(ii(t.value)?ai(t.value)?W.Success:W.Error:W.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(X,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:n?.odigosVersion?.name,value:n?.odigosVersion?.value},{title:n?.kubernetesVersion?.name,value:n?.kubernetesVersion?.value},{title:n?.installationMethod?.name,value:n?.installationMethod?.value},{title:n?.tier?.name,value:n?.tier?.value},{title:"# of sources",value:n?.numberOfSources?.toString()},{title:"# of destinations",value:n?.numberOfDestinations?.toString()}]}),e.createElement(X,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(X,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},_l=d.div`
|
|
489
489
|
display: flex;
|
|
490
490
|
flex-direction: column;
|
|
491
491
|
gap: 12px;
|
|
492
|
-
`,Jl="System Overview",Ul=({tokens:i,saveToken:a,fetchDescribeOdigos:n})=>{const[o,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(mt,{key:Jl,onClick:r,tooltip:Jl},e.createElement(Wi,{size:18})),e.createElement(q,{width:"750px",isOpen:o,onClose:r,header:{icons:[Wi],title:Jl},footer:{isOpen:!1}},e.createElement(_l,null,!!i?.length&&e.createElement(Bl,{tokens:i,saveToken:a}),e.createElement(Wl,{fetchDescribeOdigos:n}))))},
|
|
492
|
+
`,Jl="System Overview",Ul=({tokens:i,saveToken:a,fetchDescribeOdigos:n})=>{const[o,l]=t(!1),r=()=>l(e=>!e);return e.createElement(e.Fragment,null,e.createElement(mt,{key:Jl,onClick:r,tooltip:Jl},e.createElement(Wi,{size:18})),e.createElement(q,{width:"750px",isOpen:o,onClose:r,header:{icons:[Wi],title:Jl},footer:{isOpen:!1}},e.createElement(_l,null,!!i?.length&&e.createElement(Bl,{tokens:i,saveToken:a}),e.createElement(Wl,{fetchDescribeOdigos:n}))))},Yl=d.div`
|
|
493
493
|
position: fixed;
|
|
494
494
|
bottom: 12px;
|
|
495
495
|
left: 12px;
|
|
@@ -498,7 +498,7 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
498
498
|
flex-direction: column-reverse;
|
|
499
499
|
gap: 6px;
|
|
500
500
|
max-width: 600px;
|
|
501
|
-
`,
|
|
501
|
+
`,Gl=()=>{const{notifications:t,markAsDismissed:i,markAsSeen:a}=P(),{onClickNotification:n}=Bt();return e.createElement(Yl,null,t.filter(({dismissed:e})=>!e).map(({id:t,type:o,title:l,message:r,crdType:s,target:c})=>e.createElement(ne,{key:`toast-${t}`,id:t,type:o,title:l,message:r,action:s&&c?{label:"go to details",onClick:()=>n({id:t,crdType:s,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{i(e),t&&a(e)})({id:t,asSeen:!0})})))},Xl=d.div`
|
|
502
502
|
position: relative;
|
|
503
503
|
display: flex;
|
|
504
504
|
align-items: center;
|
|
@@ -598,4 +598,4 @@ import e,{useState as t,useEffect as i,forwardRef as a,useRef as n,useImperative
|
|
|
598
598
|
padding-top: 12px;
|
|
599
599
|
padding-left: 12px;
|
|
600
600
|
white-space: nowrap;
|
|
601
|
-
`,kr=({heightToRemove:i,traces:a,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>Tt(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:tr(e)})),[a]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),p=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(vr,{$heightToRemove:i},n?e.createElement(Te,{$height:"50vh"},e.createElement(Le,{scale:1.5})):d.length?e.createElement(br,{$heightToRemove:i},e.createElement(fr,null,e.createElement(E,null,"Service & operation")),new Array(5).fill(null).map((t,a)=>e.createElement(xr,{key:`${a}-divider`,$heightToRemove:i,index:a},e.createElement($r,null,vi(u/5*a)))),d.map((t,i)=>{const{spans:a}=t,n=a.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=a.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(yr,{key:`recursive-spans-${t.traceID}`,spans:a,logs:[],depth:1,indexInMatrix:i,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:o,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(Te,{$height:"50vh"},e.createElement(De,{title:m.NO_TRACES_FOUND,subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(rr,{span:s,process:p,onClose:()=>c(null)}))};export{wa as ActionDrawer,xa as ActionForm,Da as ActionModal,Aa as ActionTable,Ka as AwaitPipeline,ln as ConditionDropdown,en as DataFlow,Fn as DataFlowActionsMenu,$n as DataStreamDrawer,fn as DataStreamForm,An as DataStreamModal,In as DataStreamSelectionForm,_n as DestinationDrawer,Hn as DestinationForm,po as DestinationModal,vo as DestinationSelectionForm,fo as DestinationTable,rn as ErrorDropdown,Ro as InstrumentationRuleDrawer,Io as InstrumentationRuleForm,Ko as InstrumentationRuleModal,qo as InstrumentationRuleTable,un as KindDropdown,sn as LanguageDropdown,cn as MonitorDropdown,Ho as MultiSourceControl,dn as NamespaceDropdown,xl as NavIconIds,
|
|
601
|
+
`,kr=({heightToRemove:i,traces:a,isLoading:n})=>{const[o,r]=t([]),[s,c]=t(null),d=l(()=>Tt(a).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:tr(e)})),[a]),u=l(()=>d.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[d]),p=l(()=>{const e=d.find(e=>e.spans.some(e=>e.spanID===s?.spanID)),t=e?.processes.find(e=>e.serviceName===s?.processID);return t},[d,s]);return e.createElement(e.Fragment,null,e.createElement(vr,{$heightToRemove:i},n?e.createElement(Te,{$height:"50vh"},e.createElement(Le,{scale:1.5})):d.length?e.createElement(br,{$heightToRemove:i},e.createElement(fr,null,e.createElement(E,null,"Service & operation")),new Array(5).fill(null).map((t,a)=>e.createElement(xr,{key:`${a}-divider`,$heightToRemove:i,index:a},e.createElement($r,null,vi(u/5*a)))),d.map((t,i)=>{const{spans:a}=t,n=a.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),l=a.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return e.createElement(yr,{key:`recursive-spans-${t.traceID}`,spans:a,logs:[],depth:1,indexInMatrix:i,maxDuration:u,minStartTime:n,maxEndTime:l,openSpanIdsState:{value:o,set:r},selectedSpanState:{value:s,set:c}})})):e.createElement(Te,{$height:"50vh"},e.createElement(De,{title:m.NO_TRACES_FOUND,subTitle:m.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}))),s&&e.createElement(rr,{span:s,process:p,onClose:()=>c(null)}))};export{wa as ActionDrawer,xa as ActionForm,Da as ActionModal,Aa as ActionTable,Ka as AwaitPipeline,ln as ConditionDropdown,en as DataFlow,Fn as DataFlowActionsMenu,$n as DataStreamDrawer,fn as DataStreamForm,An as DataStreamModal,In as DataStreamSelectionForm,_n as DestinationDrawer,Hn as DestinationForm,po as DestinationModal,vo as DestinationSelectionForm,fo as DestinationTable,rn as ErrorDropdown,Ro as InstrumentationRuleDrawer,Io as InstrumentationRuleForm,Ko as InstrumentationRuleModal,qo as InstrumentationRuleTable,un as KindDropdown,sn as LanguageDropdown,cn as MonitorDropdown,Ho as MultiSourceControl,dn as NamespaceDropdown,xl as NavIconIds,Yo as NotificationManager,$a as OverviewDrawer,ll as ServiceMap,fl as SetupSummary,$l as SideNav,kl as SlackInvite,Rl as SourceDrawer,wl as SourceForm,Kl as SourceModal,Pl as SourceSelectionForm,Vl as SourceTable,Ul as SystemOverview,Ea as TableCellConditions,Gl as ToastList,er as ToggleDarkMode,kr as TraceView};
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import r,{createContext as o,useMemo as t,useContext as
|
|
1
|
+
import r,{createContext as o,useMemo as t,useContext as e}from"react";import{cj as i}from"./chunks/ui-components-693d231b.js";import"./icons.js";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const s=o({tier:void 0,version:void 0,isVersionSupported:!1}),n=({children:o,tier:e,version:i})=>{const n=t(()=>({tier:e,version:i}),[e,i]);return r.createElement(s.Provider,{value:n},o)},p=r=>{const o=e(s),t=!r||o.version&&i(o.version)>=i(r);return{...o,isVersionSupported:t}};export{n as OdigosProvider,p as useOdigos};
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{bA as capitalizeFirstLetter,cD as cleanObjectEmptyStringsValues,bv as compareCondition,bC as deepClone,aF as filterActions,b8 as filterDestinations,b9 as filterDestinationsByStream,b6 as filterSources,b7 as filterSourcesByStream,cE as flattenObjectKeys,aZ as formatBytes,cf as formatDuration,g as generateId,am as getActionIcon,ay as getConditionsBooleans,b1 as getContainersIcons,ca as getContainersInstrumentedCount,b0 as getDestinationIcon,aM as getEntityIcon,aX as getEntityId,aH as getEntityLabel,cF as getIdFromSseTarget,a$ as getInstrumentationRuleIcon,cG as getMainContainerLanguage,bF as getMetricForEntity,cH as getMonitorIcon,cI as getPlatformIcon,cJ as getPlatformLabel,bO as getProgrammingLanguageIcon,ch as getRecursiveValues,cK as getSseTargetFromId,y as getStatusColor,t as getStatusFromPodStatus,aD as getStatusIcon,bY as getStatusTypeFromOdigosHealth,cL as getValueForRange,bS as getWorkloadId,bz as getYamlFieldsForDestination,bZ as hasUnhealthyInstances,_ as isEmpty,cM as isLegalK8sLabel,cb as isOverTime,c2 as isStringABoolean,cN as isTimeElapsed,cO as isValidVersion,aA as mapConditions,bu as mapDestinationFieldsForDisplay,aY as mapExportedSignals,cP as numbersOnly,c3 as parseBooleanFromString,cQ as parseJsonStringToPrettyString,cR as removeEmptyValuesFromObject,bw as safeJsonParse,cS as safeJsonStringify,aR as sleep,bg as splitCamelString,cT as stringifyNonStringValues,cj as trimVersion}from"./chunks/ui-components-693d231b.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{ak as useActionFormData,cX as useBodyScroll,ba as useClickNode,bT as useClickNotification,b3 as useConnection,b5 as useContainerSize,u as useCopy,bm as useDataStreamFormData,by as useDestinationFormData,d as useGenericForm,cY as useInfiniteScroll,bP as useInstrumentationRuleFormData,ad as useKeyDown,bf as useOnClickOutside,bb as usePopup,bl as useSessionStorage,c4 as useSourceFormData,c8 as useSourceSelectionFormData,p as useTimeAgo,bR as useTransition}from"./chunks/ui-components-693d231b.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type WarningModalProps } from '@/components/_v2';
|
|
3
|
+
export interface DeleteModalProps extends Pick<WarningModalProps, 'onDeny' | 'onApprove'> {
|
|
4
|
+
action?: string;
|
|
5
|
+
target?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const DeleteModal: FC<DeleteModalProps>;
|
package/lib/snippets.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{br as AddButton,b_ as CopyText,bW as EditButton,bV as Flow,cZ as MapItemNode,c_ as NoDataNode,bs as NoteBackToSummary,c0 as PodContainer,c5 as SourceContainer}from"./chunks/ui-components-693d231b.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{cW as useActiveNodeStore,ce as useDarkMode,b4 as useDataStreamStore,ac as useDrawerStore,aj as useEntityStore,aE as useFilterStore,aV as useInstrumentStore,aq as useModalStore,ab as useNotificationStore,aa as usePendingStore,aU as useSelectedStore,bn as useSetupStore}from"./chunks/ui-components-693d231b.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{s as default}from"./chunks/ui-components-693d231b.js";import"styled-components";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
|
@@ -157,6 +157,11 @@ export interface Connection {
|
|
|
157
157
|
connectedAt?: number | null;
|
|
158
158
|
lastSeenAt?: number | null;
|
|
159
159
|
}
|
|
160
|
+
export interface ConnectionRemoteConfig {
|
|
161
|
+
rollout?: {
|
|
162
|
+
automaticRolloutDisabled?: boolean;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
160
165
|
export declare enum Profile {
|
|
161
166
|
CodeAttributes = "code-attributes",
|
|
162
167
|
FullPayloadCollection = "full-payload-collection",
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{ck as ActionCategory,X as ActionKeyTypes,K as ActionType,cx as AddNodeTypes,cn as BooleanOperation,bK as CodeAttributesKeyTypes,ap as Crud,bI as CustomInstrumentationsKeyTypes,cy as DestinationTypes,cw as EdgeTypes,ai as EntityTypes,a3 as FieldTypes,bJ as GolangCustomProbe,bG as HeadersCollectionKeyTypes,Z as InputTypes,ct as InstallationMethod,bM as InstrumentationRuleType,cu as IntrumentationStatus,bH as JavaCustomProbe,co as JsonOperation,M as K8sAttributesFrom,c6 as K8sResourceKind,cp as ListDirection,bU as NodeTypes,cm as NumberOperation,cC as OdigosHealthStatus,bt as OtherEntityTypes,aC as OtherStatus,O as OtherStatusType,bL as PayloadCollectionKeyTypes,cs as PlatformType,cB as PodContainerLifecycleStatus,cA as PodContainerStatus,cz as PodPhase,cv as Profile,c7 as ProgrammingLanguages,bx as SignalType,cq as SortDirection,h as StatusType,cl as StringOperation,cr as Tier,G as WorkloadRolloutStatus}from"./chunks/ui-components-693d231b.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import o,{useMemo as s}from"react";import t from"styled-components";import{VIcon as a,CopyIcon as e,YamlIcon as i}from"../icons.js";import{u as n,g as r,S as l,B as c,a as m,b as p,C as u,c as d,N as f}from"./ui-components-82b524d5.js";const b=t.div`
|
|
2
|
-
padding: 0 12px;
|
|
3
|
-
`,y=({yaml:t})=>{const{clickCopy:y,isCopied:g}=n(),C=s(()=>[{id:r(),type:l.Button,buttonProps:{leftIcon:g?a:e,onClick:()=>y(t||""),disabled:g,size:c.S,variant:m.Secondary}}],[t,g]);return o.createElement(p,{icon:i,title:"YAML",actions:C},o.createElement(b,null,t?o.createElement(u,{code:t,language:"yaml",theme:"duotoneDark"}):o.createElement(d,null,o.createElement(f,{title:"No YAML found",subTitle:"The YAML for this resource is not available"}))))};export{y as Y};
|