@odigos/ui-kit 0.0.237 → 0.0.239
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 +22 -0
- package/lib/chunks/{index-DB_UqHYt.js → index-B5PgIL40.js} +1 -1
- package/lib/chunks/index-Dy4pkeq6.js +145 -0
- package/lib/chunks/index-uXyrp4Xe.js +41 -0
- package/lib/chunks/ui-components-BPdnIOmj.js +2248 -0
- package/lib/components/_v2/cards/data-card/index.d.ts +6 -1
- package/lib/components/_v2/drawer/header/index.d.ts +2 -0
- package/lib/components/_v2/drawer/index.d.ts +1 -1
- package/lib/components/_v2/drop-data/index.d.ts +1 -2
- package/lib/components/_v2/icon-group/index.d.ts +10 -0
- package/lib/components/_v2/index.d.ts +1 -0
- package/lib/components/_v2/tag/index.d.ts +10 -0
- package/lib/components/_v2/typography/index.d.ts +2 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/sampling/index.d.ts +5 -6
- package/lib/constants/sources/index.d.ts +5 -0
- package/lib/constants/strings/index.d.ts +89 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/edit-source-drawer/common/index.d.ts +1 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/common/pods-header.d.ts +8 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/helpers.d.ts +12 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/index.d.ts +19 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/distro-override.d.ts +11 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/index.d.ts +7 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/popup-form.d.ts +15 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/runtime-override.d.ts +10 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/health-card.d.ts +6 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/index.d.ts +10 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/main-card.d.ts +6 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/index.d.ts +6 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/container-row.d.ts +9 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/helpers.d.ts +16 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/index.d.ts +12 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/pod-row.d.ts +8 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/process-row.d.ts +10 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/row-header.d.ts +13 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/types.d.ts +18 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/statuses-card.d.ts +8 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/peers/index.d.ts +11 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/containers-card/index.d.ts +7 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/containers-card/process-card.d.ts +3 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/debug-commands.d.ts +6 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/index.d.ts +7 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/pod-card.d.ts +8 -0
- package/lib/containers/_v2/_drawers/index.d.ts +1 -0
- package/lib/containers/_v2/_forms/edit-source-form/index.d.ts +2 -0
- package/lib/containers/_v2/_forms/index.d.ts +1 -0
- package/lib/containers/_v2/_modals/index.d.ts +1 -0
- package/lib/containers/_v2/_modals/onboarding-done/background.d.ts +5 -0
- package/lib/containers/_v2/_modals/onboarding-done/index.d.ts +3 -0
- package/lib/containers/_v2/overview/drawers/index.d.ts +1 -3
- package/lib/containers/_v2/sampling-rules/converters.d.ts +2 -0
- package/lib/containers/source-drawer/index.d.ts +1 -1
- package/lib/containers/v2.js +226 -121
- package/lib/containers.js +49 -19
- package/lib/contexts/action-form-context.d.ts +0 -1
- package/lib/contexts/destination-form-context.d.ts +0 -1
- package/lib/contexts/index.d.ts +1 -0
- package/lib/contexts/rule-form-context.d.ts +0 -1
- package/lib/contexts/source-edit-form-context.d.ts +17 -0
- package/lib/contexts.js +1 -1
- package/lib/functions/decimals-only/index.d.ts +1 -0
- package/lib/functions/get-containers-icons/index.d.ts +3 -1
- package/lib/functions/get-virtual-service-icon/index.d.ts +1 -1
- package/lib/functions/get-workload-id/index.d.ts +2 -2
- package/lib/functions/index.d.ts +3 -0
- package/lib/functions/is-pod-injected-with-agent/index.d.ts +3 -0
- package/lib/functions/map-desired-status-to-condition-status/index.d.ts +2 -0
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons/brand/index.d.ts +3 -0
- package/lib/icons/brand/odigos-logo-text-colored-central/index.d.ts +2 -0
- package/lib/icons/brand/odigos-logo-text-colored-community/index.d.ts +2 -0
- package/lib/icons/brand/odigos-logo-text-colored-enterprise/index.d.ts +2 -0
- package/lib/icons.js +1 -1
- package/lib/mock-data/profiling/index.d.ts +1 -1
- package/lib/mock-data/service-map/index.d.ts +1 -1
- package/lib/mock-data/sources/index.d.ts +1 -1
- package/lib/snippets/_v2/odigos-logo-text-by-tier/index.d.ts +2 -0
- package/lib/snippets/_v2/rich-title/index.d.ts +5 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/percentage.d.ts +1 -1
- package/lib/snippets/_v2/sampling-rule-form-sections/preset-with-custom-input.d.ts +5 -2
- package/lib/snippets/_v2/wide-drawer/index.d.ts +7 -1
- package/lib/snippets/source-container/index.d.ts +1 -2
- package/lib/snippets/v2.js +1 -1
- 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 +30 -1
- package/lib/types/service-map/index.d.ts +2 -2
- package/lib/types/sources/index.d.ts +7 -3
- package/lib/types/workload/index.d.ts +178 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-92vqd713.js +0 -145
- package/lib/chunks/index-zOzusnDO.js +0 -77
- package/lib/chunks/ui-components-CjDRcQJq.js +0 -2235
- /package/lib/containers/{source-drawer → _v2/_drawers/edit-source-drawer}/profiling/flame-graph-canvas.d.ts +0 -0
- /package/lib/containers/{source-drawer → _v2/_drawers/edit-source-drawer}/profiling/flamebearer.d.ts +0 -0
- /package/lib/containers/{source-drawer → _v2/_drawers/edit-source-drawer}/profiling/index.d.ts +0 -0
- /package/lib/containers/{source-drawer → _v2/_drawers/edit-source-drawer}/profiling/symbol-table.d.ts +0 -0
package/lib/containers.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useTheme as r}from"styled-components";import{r as a,s as o,I as s,t as l,v as c,w as d,q as u,x as p,y as h,z as m,E as g,F as v,G as y,H as f,J as S,K as b,M as x,O as w,Q as k,R as N,U as C,V as $,W as E,X as T,Y as D,Z as O,_ as P,$ as I,a0 as R,a1 as L,a2 as A,a3 as M,a4 as K,a5 as z,a6 as _,a7 as F,a8 as B,b as G,a9 as V,aa as W,ab as j,ac as Y,ad as q,ae as H,af as U,g as J,ag as X,ah as Q,ai as Z,aj as ee,ak as te,al as ie,am as ne,an as re,ao as ae,ap as oe,P as se,aq as le,ar as ce,as as de,at as ue}from"./chunks/ui-components-BPdnIOmj.js";import{NotificationIcon as pe,TrashIcon as he,EditIcon as me,UserIcon as ge,ImageErrorIcon as ve,ChevronDownIcon as ye,ChevronRightIcon as fe,RefreshIcon as Se,RefreshLeftArrowIcon as be}from"./icons.js";import{forwardRef as xe,useState as we,useRef as ke,useImperativeHandle as Ne,useEffect as Ce,useCallback as $e,Children as Ee,Fragment as Te,useMemo as De}from"react";import{MarkerType as Oe,useNodesState as Pe,useEdgesState as Ie}from"@xyflow/react";import{E as Re}from"./chunks/vendor-C150cdxb.js";import{Y as Le}from"./chunks/index-B5PgIL40.js";import{P as Ae}from"./chunks/index-uXyrp4Xe.js";import"zustand";import"javascript-time-ago";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Me=n.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
width: fit-content;
|
|
4
|
-
`,
|
|
4
|
+
`,Ke=n(v)`
|
|
5
5
|
gap: 12px;
|
|
6
6
|
padding: 0 12px;
|
|
7
|
-
`,
|
|
7
|
+
`,ze=n(u)`
|
|
8
8
|
gap: 12px;
|
|
9
9
|
max-height: 400px;
|
|
10
10
|
overflow-y: auto;
|
|
11
|
-
`,
|
|
11
|
+
`,_e=n.div`
|
|
12
12
|
position: absolute;
|
|
13
13
|
bottom: 0;
|
|
14
14
|
left: 0;
|
|
@@ -17,19 +17,19 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import i,{useThe
|
|
|
17
17
|
border-radius: 0 0 24px 24px;
|
|
18
18
|
background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
|
|
19
19
|
pointer-events: none;
|
|
20
|
-
`,
|
|
20
|
+
`,Fe=n(d)`
|
|
21
21
|
background-color: ${({theme:e})=>e.colors.orange_soft};
|
|
22
22
|
color: ${({theme:e})=>e.text.primary};
|
|
23
23
|
border-radius: 32px;
|
|
24
24
|
width: fit-content;
|
|
25
25
|
padding: 2px 8px;
|
|
26
|
-
`,
|
|
26
|
+
`,Be=()=>{const i=r(),{notifications:n,markAsSeen:u}=a(),p=n.filter(({hideFromHistory:e})=>!e),h=p.filter(({seen:e})=>!e),m=h.length,{popupRef:g,popupOpen:v,setPopupOpen:y,popupPosition:f,handlePosition:S}=o({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{m&&h.forEach(({id:e})=>u(e))}});return e(Me,{children:[t(s,{onClick:()=>{S(0,0),y(e=>!e)},tooltip:"Notifications",withPing:!!m,pingColor:i.colors.orange_og,children:t(pe,{size:18})}),e(l,{ref:g,isOpen:v,right:f.left,maxWidth:"400px",header:e(Ke,{children:[t(d,{size:20,children:"Notifications"}),!!m&&e(Fe,{size:12,family:"secondary",children:[m," new"]})]}),children:[t(ze,{children:p.length?p.map(e=>t(qe,{...e,onClick:()=>y(!1)},`notification-${e.id}`)):t(c,{title:"No notifications",subTitle:""})}),t(_e,{})]})]})},Ge=n.div`
|
|
27
27
|
display: flex;
|
|
28
28
|
align-items: flex-start;
|
|
29
29
|
gap: 12px;
|
|
30
30
|
padding: 16px;
|
|
31
31
|
border-radius: 16px;
|
|
32
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+
|
|
32
|
+
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+y["080"]};
|
|
33
33
|
cursor: not-allowed;
|
|
34
34
|
&.click-enabled {
|
|
35
35
|
cursor: pointer;
|
|
@@ -37,30 +37,30 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import i,{useThe
|
|
|
37
37
|
background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
`,
|
|
41
|
-
background-color: ${({$type:e,theme:t})=>t.text[e]+
|
|
40
|
+
`,Ve=n.div`
|
|
41
|
+
background-color: ${({$type:e,theme:t})=>t.text[e]+y["015"]};
|
|
42
42
|
border-radius: 8px;
|
|
43
43
|
width: 36px;
|
|
44
44
|
height: 36px;
|
|
45
45
|
display: flex;
|
|
46
46
|
align-items: center;
|
|
47
47
|
justify-content: center;
|
|
48
|
-
`,
|
|
48
|
+
`,We=n.div`
|
|
49
49
|
width: 290px;
|
|
50
|
-
`,
|
|
50
|
+
`,je=n.div`
|
|
51
51
|
margin-bottom: 6px;
|
|
52
|
-
`,
|
|
52
|
+
`,Ye=n.div`
|
|
53
53
|
display: flex;
|
|
54
54
|
align-items: center;
|
|
55
55
|
gap: 6px;
|
|
56
|
-
`,
|
|
56
|
+
`,qe=({id:n,seen:a,type:o,title:s,message:l,time:c,crdType:u,target:v,onClick:y})=>{const S=r(),{formatTimeAgo:b}=p(),{onClickNotification:x}=h(),w=!!u&&!!v,k=s?.toLowerCase().includes(m.Delete.toLowerCase())||!1,N=f(o,S);return e(Ge,{className:w?"click-enabled":"",onClick:()=>{w&&(y(),x({id:n,crdType:u,target:v}))},children:[t(Ve,{$type:k?g.Error:o,children:t(k?he:N,{})}),e(We,{children:[t(je,{children:t(d,{size:14,children:l})}),e(Ye,{children:[t(d,{size:10,color:S.text.grey,children:b(c)}),!a&&e(i,{children:[t(d,{size:10,children:"·"}),t(d,{size:10,color:S.colors.orange_soft,children:"new"})]})]})]})]},`notification-${n}`)},He=xe(({children:n,width:a=640,title:o,titleTooltip:s,hideEditTitleFromEdit:l,icons:c,iconSrcs:u,isEdit:p=!1,isFormDirty:h=!1,isLastItem:m=!1,onClose:g,onEdit:v,onSave:y,onDelete:f,onCancel:$,tabs:E,headerActionButtons:T},D)=>{const O=r(),{drawerType:P,setDrawerType:I,setDrawerEntityId:R}=S();b({key:"Enter",active:p},()=>j());const[L,A]=we(!1),[M,K]=we(!1),z=ke(null),_=P===C.Source,F=()=>{A(!1),K(!1)},B=()=>{F(),v&&v(!1),I(null),R(null),g?.()};Ne(D,()=>({closeDrawer:B}));const G=()=>{z.current?.clearTitle(),$&&$(),F()},V=()=>{const e=z.current?.isTitleDirty();h||e?K(!0):G()},W=()=>{A(!0)},j=()=>{y&&y(z.current?.getTitle()||"")},Y=T||[];return v&&!p&&Y.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>v(!0),children:e(i,{children:[t(me,{}),t(d,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),f&&!p&&Y.push({"data-id":"drawer-delete",variant:"tertiary",onClick:W,children:e(i,{children:[t(he,{}),t(d,{color:O.text.error,size:14,family:"secondary",decoration:"underline",children:_?x.UNINSTRUMENT:x.DELETE})]})}),e(i,{children:[t(w,{isOpen:!0,onClose:p?V:B,closeOnEscape:!L&&!M,width:"number"==typeof a?`${a+64}px`:a,header:{icons:c,iconSrcs:u,title:o,titleTooltip:s,replaceTitleWith:!l&&p?t(Ue,{ref:z,title:o}):void 0,actionButtons:Y,tabs:E},footer:{isOpen:p,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:j,children:x.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:V,children:x.CANCEL}],rightButtons:f?[{"data-id":"drawer-delete",variant:"tertiary",onClick:W,children:e(i,{children:[t(he,{}),t(d,{size:14,color:O.text.error,family:"secondary",decoration:"underline",children:x.DELETE})]})}]:[]},children:n}),t(k,{isOpen:L,noOverlay:!0,name:`${P}${o?` (${o})`:""}`,type:P,isLastItem:m,onApprove:()=>{f&&f(),F()},onDeny:F}),t(N,{isOpen:M,noOverlay:!0,name:"edit mode",onApprove:G,onDeny:F})]})}),Ue=xe(({title:e},i)=>{const[n,r]=we(e);return Ce(()=>{r(e)},[e]),Ne(i,()=>({getTitle:()=>n||e,isTitleDirty:()=>n!==e,clearTitle:()=>r(e)})),t($,{"data-id":"title",value:n,onChange:e=>r(e.target.value)})});Ue.displayName=Ue.name,He.displayName=He.name;const Je=e=>`${C.Source}-${e}-${E.MapItem}`,Xe=(e,t,i)=>{const n=e.isVirtual,r=i?[ge]:n?[D(e)]:t?O(t):[ve],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:P(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:r,isVirtual:n,status:a,aggService:e}},Qe=e=>!(!e||"user"!==e.otelServiceName||e.namespace||e.name||e.kind),Ze=({theme:e,nodes:t,aggregatedServiceMap:i})=>{const n=[],r=new Map(t.map(e=>[e.id,e]));for(const t of i){const i=Je(t.graphKey),a=r.get(i);if(!a)continue;const o=a.data?.status===g.Error;for(const a of t.connections){const s=Je(a.targetGraphKey);r.has(s)&&n.push({id:`${i}-to-${s}`,type:"smoothstep",source:i,target:s,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Oe.ArrowClosed},style:{stroke:o?e?.colors.dark_red:e?.colors.border}})}}return n},et=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},tt=new Re,it=`${C.Source}-user-${E.MapItem}`,nt={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},rt=n.div`
|
|
57
57
|
padding: 8px 0;
|
|
58
|
-
`,
|
|
58
|
+
`,at=n.div`
|
|
59
59
|
display: flex;
|
|
60
60
|
gap: 12px;
|
|
61
61
|
align-items: center;
|
|
62
62
|
padding: 4px 0 4px 16px;
|
|
63
|
-
`,
|
|
63
|
+
`,ot=n.button`
|
|
64
64
|
display: flex;
|
|
65
65
|
align-items: center;
|
|
66
66
|
gap: 4px;
|
|
@@ -74,13 +74,43 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import i,{useThe
|
|
|
74
74
|
&:hover {
|
|
75
75
|
text-decoration: underline;
|
|
76
76
|
}
|
|
77
|
-
`,
|
|
77
|
+
`,st=n.div`
|
|
78
78
|
padding: 4px 0 8px;
|
|
79
|
-
`,
|
|
79
|
+
`,lt=({conn:i,onToggle:n,isExpanded:r})=>{const a=i.details.length>0;return t(rt,{children:e(v,{$justifyContent:"space-between",$alignItems:"center",children:[t(d,{size:14,weight:500,children:i.targetServiceName}),a&&e(ot,{onClick:n,children:[t(r?ye:fe,{size:12}),r?"hide attributes":`${i.details.length} attribute${i.details.length>1?"s":""}`]})]})})},ct=({conn:e})=>{const n=r();return t(i,{children:e.details.map(e=>t(at,{children:t(d,{size:12,color:n.text.secondary,style:{flex:1},children:e.value})},e.value))})},dt=({connections:n,isVirtual:a,attributes:o})=>{const[s,l]=we(new Set),c=r();if(a){const n=Object.entries(o||{});return e(i,{children:[t(d,{size:12,color:c.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}),n.length>0&&e(i,{children:[t(st,{style:{paddingTop:16},children:t(d,{size:11,color:c.text.info,children:"Attributes"})}),n.map(([i,n])=>e(at,{children:[t(d,{size:12,color:c.text.secondary,children:i}),t(d,{size:12,children:n})]},i))]})]})}return n.length?e(i,{children:[t(st,{children:t(d,{size:11,color:c.text.info,children:"Connected services"})}),n.map(i=>e("div",{children:[t(lt,{conn:i,isExpanded:s.has(i.targetGraphKey),onToggle:()=>{return e=i.targetGraphKey,void l(t=>{const i=new Set(t);return i.has(e)?i.delete(e):i.add(e),i});var e}}),s.has(i.targetGraphKey)&&t(ct,{conn:i}),t(R,{})]},i.targetGraphKey))]}):t(d,{size:12,color:c.text.info,children:"No outgoing connections"})},ut=({conn:n})=>{const a=r();return n?t(i,{children:n.details.length>0?e(i,{children:[t(st,{children:t(d,{size:11,color:a.text.info,children:"Attribute breakdown"})}),n.details.map(e=>t(at,{children:t(d,{size:12,style:{flex:1},children:e.value})},e.value))]}):t(d,{size:12,color:a.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):t(d,{size:12,color:a.text.info,children:"No data for this connection"})},pt=({drawerState:e,aggregatedData:i,onClose:n})=>{if(!e)return null;const r=new Map(i.map(e=>[e.graphKey,e]));let a="",o="",s=null;if("node"===e.type){const i=r.get(e.graphKey);a=i?.serviceName||e.graphKey,o=i?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",s=t(dt,{connections:i?.connections||[],isVirtual:i?.isVirtual,attributes:i?.attributes})}else{const i=r.get(e.sourceKey),n=i?.connections.find(t=>t.targetGraphKey===e.targetKey);a=`${i?.serviceName||e.sourceKey} → ${n?.targetServiceName||e.targetKey}`,o="Connection details",s=t(ut,{conn:n})}return t(I,{isOpen:!0,width:"420px",position:"right",header:{title:a,subTitle:o,onClose:n},children:s})},ht=n.div`
|
|
80
80
|
width: 100%;
|
|
81
81
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
82
82
|
position: relative;
|
|
83
|
-
`,
|
|
83
|
+
`,mt={namespace:"",name:"",kind:"",otelServiceName:"user",selected:!0,numberOfInstances:0,dataStreamNames:[],containers:[],conditions:[]},gt=`${C.Source}-`,vt=`-${E.MapItem}`,yt=.15,ft=({heightToRemove:i,serviceMap:n,onRefresh:a})=>{const o=r(),s=L(e=>e.sources),[l,c,d]=Pe([]),[u,p,h]=Ie([]),[m,g]=we(0),[v,y]=we(null),f=ke([]);f.current=l;const S=ke(o);S.current=o;const b=ke([]),x=ke([]),w=$e(()=>g(e=>e+1),[]),{activeNodeId:k,setActiveNodeType:N,setActiveNodeId:$}=A();Ce(()=>{if(!k)return;const e=(t=k).startsWith(gt)&&t.endsWith(vt)?t.slice(gt.length,-vt.length):null;var t;e&&y({type:"node",graphKey:e})},[k]);const D=$e((e,t)=>{const{sourceGraphKey:i,targetGraphKey:n}=t.data||{};i&&n&&(N(null),$(null),y({type:"edge",sourceKey:i,targetKey:n}))},[N,$]),O=$e(()=>{y(null),N(null),$(null)},[N,$]),P=$e((e,t)=>{const i=t.id;p(e=>e.map(e=>e.source===i||e.target===i?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:yt},labelStyle:{...e.labelStyle,opacity:yt},labelBgStyle:{...e.labelBgStyle,opacity:yt}}))},[p]),I=$e(()=>{p(x.current)},[p]);return Ce(()=>{let e=!1;const t=(e=>{const t=new Map,i=new Set,n=(e,i,n=!1)=>{let r=t.get(e);return r||(r={serviceName:i,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,r)),r},r=(e,t)=>{if(t)for(const{key:i,value:n}of t)i in e||(e[i]=n)};for(const t of e){const{graphKey:e}=et(t.nodeId),a=n(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:o}=et(e?.nodeId??"");e.isVirtual&&(i.add(t),r(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let s=a.connectionMap.get(t);if(s||(s={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,s)),s.totalRequests+=e.requests,e.dateTime>s.lastDateTime&&(s.lastDateTime=e.dateTime),o){const t=s.details.find(e=>e.value===o);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):s.details.push({value:o,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[r,a]of e)t.has(r)||n(r,a.targetServiceName,i.has(r));const o=[];for(const[e,{serviceName:i,isVirtual:n,attributes:r,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),o.push({graphKey:e,serviceName:i,isVirtual:n,connections:t,attributes:r})}return o.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),o})(n);b.current=t;const i=(({sources:e,aggregatedServiceMap:t})=>{const i=[],n={x:0,y:0};if(t.length&&e.length)for(const r of t){const t=Je(r.graphKey),a=e.find(e=>r.serviceName===e.otelServiceName||r.serviceName===e.name);i.push({id:t,type:E.MapItem,position:n,data:Xe(r,a,Qe(a)),measured:{width:80,height:80}})}else i.push({id:`${C.Source}-${E.NoData}`,type:E.NoData,position:n,data:{subTitle:T.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return i})({aggregatedServiceMap:t,sources:[mt].concat(s)});if(1===i.length&&i[0].id===`${C.Source}-${E.NoData}`)return c(i),p([]),void(x.current=[]);const r=new Set(f.current.map(e=>e.id)),a=new Set(i.map(e=>e.id)),o=i.some(e=>!r.has(e.id)),l=f.current.some(e=>!a.has(e.id));if(!(o||l)){const e=new Map(f.current.map(e=>[e.id,e.position]));c(i.map(t=>({...t,position:e.get(t.id)??t.position})));const n=Ze({theme:S.current,nodes:i,aggregatedServiceMap:t});return x.current=n,void p(n)}return(async(e,t,i={})=>{const n={id:"root",layoutOptions:{...nt,...i},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===it?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},r=await tt.layout(n),a=new Map;return r.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(i,Ze({theme:S.current,nodes:i,aggregatedServiceMap:t})).then(({nodes:t})=>{if(e)return;c(t);const i=Ze({theme:S.current,nodes:t,aggregatedServiceMap:b.current});x.current=i,p(i),w()}),()=>{e=!0}},[n,s]),Ce(()=>{if(!f.current.length)return;const e=Ze({theme:o,nodes:f.current,aggregatedServiceMap:b.current});x.current=e,p(e)},[o]),e(ht,{$heightToRemove:i,children:[t(M,{nodes:l,edges:u,onNodesChange:d,onEdgesChange:h,onEdgeClick:D,onNodeMouseEnter:P,onNodeMouseLeave:I,onRefresh:a,fitViewTrigger:m,zoomOnScroll:!0}),t(pt,{drawerState:v,aggregatedData:b.current,onClose:O})]})},St=(e,t)=>{const{name:i,kind:n,namespace:r}=e,a=[{title:T.KIND,value:n},{title:T.NAME,value:i,tooltip:"Resource name"}];return t||(a.unshift({title:T.NAMESPACE,value:r}),a.push({type:K.Divider}),a.push({type:K.CopyText,value:`kubectl get ${n} ${i} -n ${r}`.toLowerCase()})),a},bt=n.div`
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
gap: 24px;
|
|
87
|
+
padding: 4px;
|
|
88
|
+
`,xt=({formData:e,handleFormChange:i})=>t(bt,{children:t($,{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:e.otelServiceName,onChange:({target:{value:e}})=>i("otelServiceName",e)})}),wt=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=B(e?.status),n=z(e?.reasonEnum),r=e?.message;return t(v,{$alignItems:"center",$justifyContent:"center",children:t(_,{status:i,title:n,subtitle:r,withBackground:i!==F.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},kt=({source:i,fetchSourceDescribe:n,onClickRestartPod:r})=>{const[a,o]=we(!1),[s,l]=we(null);return Ce(()=>{i&&n({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?l(e.describeSource):o(!0)})},[i.namespace,i.name,i.kind]),s||a?t(u,{$gap:12,children:a?t(G,{$height:"70vh",children:t(c,{subTitle:"Could not fetch describe for this source"})}):s?.pods?.length?s.pods.map(({podName:n,nodeName:a,phase:o,agentInjected:l,runningLatestWorkloadRevision:c,containers:d,manifestYAML:u})=>{const p=o.status!==g.Success||W(d)?g.Error:g.Success,h=[];return h.push(t(j,{value:`kubectl get pod ${n.value} -n ${s?.namespace?.value||i.namespace}`.toLowerCase()},"copy-text")),h.push(t(R,{length:"100%",margin:"0"},"divider-1")),h.push(t(Y,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-1")),h.push(t(R,{length:"100%",margin:"0"},"divider-2")),h.push(t(Y,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-2")),h.push(t(R,{length:"100%",margin:"0"},"divider-3")),h.push(t(Y,{title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}},"describe-row-3")),h.push(t(R,{length:"100%",margin:"0"},"divider-4")),c?.name&&(h.push(t(Y,{title:c.name,tooltip:c.explain||void 0,value:{status:c.status||void 0,text:c.value}},"describe-row-4")),h.push(t(R,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{h.push(t(q,{...e},`pod-container-${e.containerName.value}`))}),u&&(h.push(t(R,{length:"100%",margin:"0"},"divider-6")),h.push(t(Le,{yaml:u},"yaml-section-card"))),t(H,{title:`Pod: ${n.value}`,withExtend:!0,action:({hovered:a})=>e("div",{style:{position:"relative"},children:[t(_,{status:p,title:p,withIcon:!0,withBorder:!0},"status"),a&&t(U,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:J(),label:"Restart",rightIcon:Se,onClick:()=>r(s?.namespace?.value||i.namespace,n.value)}]:[]},"hover-actions")]}),children:Ee.toArray(h)},`pod-${n.value}`)}):t(G,{$height:"70vh",children:t(c,{subTitle:"Check if you have any running pods and try again"})})}):t(G,{$height:"70vh",children:t(V,{})})},Nt=n(v)`
|
|
89
|
+
width: 100%;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: space-between;
|
|
92
|
+
`,Ct=({source:i,fetchSourceLibraries:n})=>{const a=r(),[o,s]=we(!1),[l,p]=we(null);return Ce(()=>{i&&n({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?p(X(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[i.namespace,i.name,i.kind]),l||o?t(u,{$gap:12,children:o?t(G,{$height:"70vh",children:t(c,{subTitle:"Could not fetch libraries for this source"})}):l?.length?t(H,{title:"Instrumented Libraries",children:l.map(({name:i,healthy:n,message:r,nonIdentifyingAttributes:o},s)=>e(Te,{children:[e(u,{$gap:4,$width:"100%",children:[e(Nt,{$width:"100%",children:[t(d,{size:12,color:a.text.grey,children:i}),e(v,{$gap:4,children:[o.map(({key:e,value:n})=>Z(n)&&ee(n)&&"is_standard_lib"===e?t(_,{status:g.Default,title:"STANDARD",withBorder:!0},`${i}-${e}`):null),"boolean"==typeof n&&t(_,{status:n?g.Success:g.Error,title:n?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),r&&t(d,{size:10,color:a.text.error,align:"right",children:r})]}),s!==l.length-1&&t(R,{length:"100%",margin:"0"})]},`library-${i}`))}):e(G,{$height:"70vh",$gap:12,children:[t(c,{title:"No libraries found",subTitle:""}),t(Q,{type:g.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(G,{$height:"70vh",children:t(V,{})})},$t="70vh",Et=(e,t)=>e.serviceName.localeCompare(t.serviceName),Tt=n(d)`
|
|
93
|
+
cursor: ${({$clickable:e})=>e?"pointer":"default"};
|
|
94
|
+
text-decoration: ${({$clickable:e})=>e?"underline":"none"};
|
|
95
|
+
&:hover {
|
|
96
|
+
opacity: ${({$clickable:e})=>e?.7:1};
|
|
97
|
+
}
|
|
98
|
+
`,Dt=n(v)`
|
|
99
|
+
justify-content: flex-end;
|
|
100
|
+
align-items: center;
|
|
101
|
+
gap: 6px;
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
`,Ot=({items:n,emptyMessage:a,keyPrefix:o,findSource:s,onNavigate:l})=>{const c=r();return n.length?t(i,{children:n.map(({serviceName:i},r)=>{const a=!!s(i);return e(Te,{children:[t(Tt,{size:13,color:a?c.text.secondary:c.text.grey,$clickable:a,onClick:()=>l(i),children:i}),r!==n.length-1&&t(R,{length:"100%",margin:"0"})]},`${o}-${i}`)})}):t(d,{size:13,color:c.text.grey,children:a})},Pt=({source:i,fetchPeerSources:n})=>{const a=r(),{setDrawerType:o,setDrawerEntityId:s}=S(),l=L(e=>e.sources),[p,h]=we(!1),[m,g]=we(!1),[v,y]=we(null),f=i.otelServiceName||i.name,b=$e(()=>{f&&(g(!0),h(!1),n(f).then(({data:e})=>{e?.peerSources?y(e.peerSources):h(!0)}).finally(()=>g(!1)))},[f]);Ce(()=>{b()},[b]);const x=$e(e=>l.find(t=>t.otelServiceName===e||t.name===e),[l]),w=$e(e=>{const t=x(e);t&&(o(C.Source),s({namespace:t.namespace,name:t.name,kind:t.kind}))},[x,o,s]);if(!v&&!p&&m)return t(G,{$height:$t,children:t(V,{})});if(p)return t(G,{$height:$t,children:t(c,{subTitle:"Could not fetch peer sources"})});const k=v?.inbound?[...v.inbound].sort(Et):[],N=v?.outbound?[...v.outbound].sort(Et):[];return e(u,{$gap:12,children:[t(H,{title:"Inbound",titleBadge:k.length,description:`Services that send requests to ${f}`,children:t(Ot,{items:k,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:x,onNavigate:w})}),t(H,{title:"Outbound",titleBadge:N.length,description:`Services that ${f} sends requests to`,children:t(Ot,{items:N,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:x,onNavigate:w})}),e(Dt,{onClick:b,children:[t(Se,{size:14}),t(d,{size:12,color:a.text.grey,decoration:"underline",children:"Refresh"})]})]})};var It;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries",e.PeerSources="Peer Sources",e.Profiling="Profiling"}(It||(It={}));const Rt=[oe.Deployment,oe.StatefulSet,oe.DaemonSet,oe.DeploymentConfig,oe.Rollout,oe.StaticPod],Lt=[oe.Deployment,oe.StatefulSet,oe.DaemonSet,oe.DeploymentConfig,oe.Rollout,oe.Pod],At=[se.Python,se.Go],Mt=n.div`
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
max-height: calc(100vh - 220px);
|
|
107
|
+
overflow: overlay;
|
|
108
|
+
overflow-y: auto;
|
|
109
|
+
`,Kt=n.div`
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
gap: 12px;
|
|
113
|
+
`;var zt;!function(e){e.Workload="Workload",e.Pod="Pod"}(zt||(zt={}));const _t=({persistSources:n,updateSource:r,restartWorkloads:a,fetchSourceById:o,fetchSourceDescribe:s,fetchSourceLibraries:l,fetchPeerSources:c,restartPod:u,recoverFromRollback:p,profilingEnabled:h,fetchProfilingSlots:m,enableProfiling:v,fetchSourceProfiling:y})=>{const{isVm:f}=te(),b=L(e=>e.sources),{selectedStreamName:x}=ie(),{drawerType:w,drawerEntityId:k}=S(),N=De(()=>ne(b,x),[b,x]),$=ke(null),E=w===C.Source,[D,O]=we(!1),[P,I]=we(!1),[R,A]=we(It.Overview),[M,K]=we(null),[z,_]=we(!1);Ce(()=>{E&&k&&o(k).then(e=>K(e||null))},[E,k]);const{formData:B,handleFormChange:G,resetFormData:V,loadFormWithDrawerItem:W}=re(),j=De(()=>{if(k)return M&&JSON.stringify(ae(M))===JSON.stringify(ae(k))?M:N?.find(e=>JSON.stringify(ae(e))===JSON.stringify(ae(k)))},[k,N,M]);Ce(()=>{E&&j?W(j):V()},[E,j]);const Y=De(()=>{const e=j?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===F.Loading,containers:j?.containers||[]}},[j]),q=De(()=>!!j?.rollbackOccurred,[j?.rollbackOccurred]),U=De(()=>{const e=[{label:It.Overview,onClick:()=>A(It.Overview),selected:R===It.Overview}];return f||(Rt.includes(j?.kind)&&e.push({label:It.Pods,onClick:()=>A(It.Pods),selected:R===It.Pods}),j?.containers?.some(e=>At.includes(e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language))&&e.push({label:It.Libraries,onClick:()=>A(It.Libraries),selected:R===It.Libraries}),e.push({label:It.PeerSources,onClick:()=>A(It.PeerSources),selected:R===It.PeerSources}),h&&m&&v&&y&&e.push({label:It.Profiling,onClick:()=>A(It.Profiling),selected:R===It.Profiling})),e},[R,j,f,h,m,v,y]),J=Lt.includes(j?.kind),[X,Z]=we({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});if(!j)return null;return e(He,{ref:$,width:z?"95vw":R===It.Profiling?"80vw":void 0,onClose:()=>{A(It.Overview),K(null),_(!1)},title:j.otelServiceName||j.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:ue(j.containers),isEdit:D,isFormDirty:P,onEdit:R===It.Overview?e=>{O("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=B.otelServiceName!==j.name?B.otelServiceName:"";G("otelServiceName",e),await r(k,{...B,otelServiceName:e}),K(null),I(!1),O(!1)},onDelete:R===It.Overview?async()=>{const{namespace:e,name:t,kind:i}=j;n({[e]:[{namespace:e,name:t,kind:i||void 0,selected:!1,currentStreamName:x}]}),K(null),I(!1),O(!1),$.current?.closeDrawer()}:void 0,onCancel:()=>{I(!1),O(!1),G("otelServiceName",j.otelServiceName||j.name||"")},isLastItem:1===N.length,tabs:U,headerActionButtons:f?[]:J?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>Z({openFor:zt.Workload,workloadId:k}),children:e(i,{children:[t(be,{}),t(d,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[R===It.Overview?D?t(Mt,{children:t(xt,{formData:B,handleFormChange:(...e)=>{I(!0),G(...e),G("currentStreamName",x)}})}):e(Kt,{children:[t(wt,{workloadOdigosHealthStatus:j.workloadOdigosHealthStatus}),q&&t(Q,{type:g.Warning,message:T.ROLLBACK_OCCURRED_MESSAGE,action:{label:T.ROLLBACK_RECOVER,onClick:async()=>{await p(k);const e=await o(k);e&&K(e)}}}),t(le,{conditions:j.conditions||[]}),t(H,{title:T.SOURCE_DETAILS,data:j?St(j,f):[]}),t(H,{title:f?T.DETECTED_PROCESSES:T.DETECTED_CONTAINERS,titleBadge:Y.isLoading?F.Loading:Y.containers.length,description:Y.description||(f?T.DETECTED_PROCESSES_DESCRIPTION:T.DETECTED_CONTAINERS_DESCRIPTION),children:Y.containers.map(e=>t(ce,{...e,callbackRuntimeOverride:e=>r(k,e)},`source-container-${e.containerName}`))}),j.manifestYAML&&t(Le,{title:`${j.kind} YAML`,yaml:j.manifestYAML,defaultOpen:!j.instrumentationConfigYAML}),j.instrumentationConfigYAML&&t(Le,{title:"Instrumentation Config YAML",yaml:j.instrumentationConfigYAML,defaultOpen:!j.manifestYAML})]}):R===It.Pods?t(kt,{source:j,fetchSourceDescribe:s,onClickRestartPod:J?(e,t)=>Z({openFor:zt.Pod,podNamespace:e,podName:t}):void 0}):R===It.Libraries?t(Ct,{source:j,fetchSourceLibraries:l}):R===It.PeerSources?t(Pt,{source:j,fetchPeerSources:c}):R===It.Profiling&&h&&m&&v&&y?t(Ae,{source:j,fetchProfilingSlots:m,enableProfiling:v,fetchSourceProfiling:y,onFlameFullscreenChange:_}):null,t(de,{isOpen:!!X.openFor,title:`Rollout Restart ${X.openFor}`,description:`Are you sure you want to rollout restart this ${X.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:g.Warning,onClick:()=>{X.openFor===zt.Workload&&X.workloadId?a([X.workloadId]):X.openFor===zt.Pod&&X.podNamespace&&X.podName&&u(X.podNamespace,X.podName),Z({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{Z({openFor:null})}}})]})},Ft=n.div`
|
|
84
114
|
position: fixed;
|
|
85
115
|
bottom: 12px;
|
|
86
116
|
left: 12px;
|
|
@@ -89,4 +119,4 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import i,{useThe
|
|
|
89
119
|
flex-direction: column-reverse;
|
|
90
120
|
gap: 6px;
|
|
91
121
|
max-width: 600px;
|
|
92
|
-
`,
|
|
122
|
+
`,Bt=()=>{const{notifications:e,markAsDismissed:i,markAsSeen:n}=a(),{onClickNotification:r}=h();return t(Ft,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:a,title:o,message:s,crdType:l,target:c})=>t(Q,{id:e,type:a,title:o,message:s,action:l&&c?{label:"go to details",onClick:()=>r({id:e,crdType:l,target:c},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{i(e),n(e)})({id:e,asSeen:!0})},`toast-${e}`))})};export{Be as NotificationManager,He as OverviewDrawer,ft as ServiceMap,_t as SourceDrawer,xt as SourceForm,Bt as ToastList};
|
|
@@ -18,7 +18,6 @@ interface DestinationFormContextType {
|
|
|
18
18
|
onChangeActiveForm: (payload: Omit<ActiveForm, 'dynamicFields'> | null) => void;
|
|
19
19
|
loadDestination: (destination: Destination, categories: DestinationCategories) => void;
|
|
20
20
|
genericForm?: GenericFormResult<DestinationFormData>;
|
|
21
|
-
formErrorMessage?: string;
|
|
22
21
|
validateFormData: () => {
|
|
23
22
|
errorMessage?: string;
|
|
24
23
|
preparedFormData: DestinationFormData;
|
package/lib/contexts/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export * from './destination-form-context';
|
|
|
4
4
|
export * from './odigos-context';
|
|
5
5
|
export * from './rule-form-context';
|
|
6
6
|
export * from './sampling-rules-form-context';
|
|
7
|
+
export * from './source-edit-form-context';
|
|
7
8
|
export * from './source-instrument-form-context';
|
|
8
9
|
export * from './storybook-context';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type FC, type ReactNode } from 'react';
|
|
2
|
+
import { type Source, type SourceFormData } from '@/types';
|
|
3
|
+
import { type GenericFormResult } from '@/hooks/useGenericForm';
|
|
4
|
+
interface SourceEditFormContextValue {
|
|
5
|
+
loadSource: (source: Source) => void;
|
|
6
|
+
genericForm?: GenericFormResult<SourceFormData>;
|
|
7
|
+
validateFormData: () => {
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
preparedFormData: SourceFormData;
|
|
10
|
+
};
|
|
11
|
+
errorMessage?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const SourceEditFormContextProvider: FC<{
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const useSourceEditFormContext: () => SourceEditFormContextValue;
|
|
17
|
+
export {};
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{dL as ActionFormContextProvider,e6 as DataStreamFormContextProvider,dK as DestinationFormContextProvider,gY as OdigosProvider,dM as RuleFormContextProvider,b2 as SamplingRuleFormType,c6 as SamplingRulesFormProvider,e4 as SourceEditFormContextProvider,dJ as SourceInstrumentFormContextProvider,gZ as StorybookProvider,dH as checkVersionSupport,aG as useActionFormContext,a_ as useDataStreamFormContext,aK as useDestinationFormContext,ak as useOdigos,aX as useRuleFormContext,b1 as useSamplingRulesFormContext,b0 as useSourceEditFormContext,bw as useSourceInstrumentFormContext,g_ as useStorybook}from"./chunks/ui-components-BPdnIOmj.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"virtua";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const decimalsOnly: (value: string) => string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ProgrammingLanguages, type Source, type SVG } from '@/types';
|
|
2
|
+
export declare const getEffectiveLanguage: (container?: NonNullable<Source["containers"]>[number]) => ProgrammingLanguages;
|
|
3
|
+
export declare const getEffectiveRuntimeVersion: (container?: NonNullable<Source["containers"]>[number]) => string | null;
|
|
2
4
|
export declare const getContainersIcons: (containers: Source["containers"]) => SVG[];
|
|
3
5
|
export declare const getDetectedLanguageIcons: (languages: ProgrammingLanguages[] | null | undefined) => SVG[];
|
|
4
6
|
export declare const getSourceLanguageIcons: (source: Pick<Source, "detectedLanguages" | "containers">) => SVG[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { AggregatedService, SVG } from '@/types';
|
|
2
|
-
export declare const getVirtualServiceIcon: (aggService: AggregatedService) => SVG;
|
|
2
|
+
export declare const getVirtualServiceIcon: (aggService: Pick<AggregatedService, "serviceName" | "attributes">) => SVG;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getWorkloadId: (
|
|
1
|
+
import type { WorkloadId } from '@/types';
|
|
2
|
+
export declare const getWorkloadId: (id?: WorkloadId) => WorkloadId;
|
package/lib/functions/index.d.ts
CHANGED
|
@@ -42,12 +42,15 @@ export * from './has-unhealthy-instances';
|
|
|
42
42
|
export * from './is-emtpy';
|
|
43
43
|
export * from './is-legal-k8s-label';
|
|
44
44
|
export * from './is-over-time';
|
|
45
|
+
export * from './is-pod-injected-with-agent';
|
|
45
46
|
export * from './is-string-a-boolean';
|
|
46
47
|
export * from './is-time-elapsed';
|
|
47
48
|
export * from './is-valid-version';
|
|
48
49
|
export * from './map-conditions';
|
|
50
|
+
export * from './map-desired-status-to-condition-status';
|
|
49
51
|
export * from './map-destination-fields-for-display';
|
|
50
52
|
export * from './map-signals';
|
|
53
|
+
export * from './decimals-only';
|
|
51
54
|
export * from './numbers-only';
|
|
52
55
|
export * from './parse-boolean-from-string';
|
|
53
56
|
export * from './parse-json-string-to-pretty-string';
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{g8 as EBPF_DOES_NOT_NEED_AGENT_INJECT,g9 as capitalizeFirstLetter,ga as cleanObjectEmptyStringsValues,aJ as compareCondition,gb as decimalsOnly,ag as deepClone,d$ as entityIdKey,e3 as filterActions,e2 as filterDestinations,bG as filterDestinationsByStream,e1 as filterSources,am as filterSourcesByStream,gc as flattenObjectKeys,bV as formatBytes,gd as formatDuration,g as generateId,bD as getActionIcon,_ as getConditionsBooleans,at as getContainersIcons,ge as getContainersInstrumentedCount,gf as getDeepValue,bl as getDestinationIcon,gg as getDetectedLanguageIcons,bR as getEffectiveLanguage,c1 as getEffectiveRuntimeVersion,dV as getEntityIcon,bA as getEntityId,dZ as getEntityIdKey,dU as getEntityLabel,gh as getIdFromSseTarget,bK as getInstrumentationRuleIcon,gi as getMainContainerLanguage,gj as getMetricForEntity,gk as getMonitorIcon,gl as getPlatformIcon,gm as getPlatformLabel,aZ as getProgrammingLanguageIcon,gn as getRecursiveValues,Z as getSourceLanguageIcons,go as getSseTargetFromId,gp as getStatusColor,ea as getStatusFromPodStatus,H as getStatusIcon,a8 as getStatusTypeFromOdigosHealth,gq as getValueForRange,Y as getVirtualServiceIcon,ao as getWorkloadId,bH as getYamlFieldsForDestination,aa as hasUnhealthyInstances,aA as isEmpty,gr as isLegalK8sLabel,ck as isOverTime,bL as isPodInjectedWithAgent,ai as isStringABoolean,gs as isTimeElapsed,c0 as isValidVersion,gt as mapConditions,bM as mapDesiredStatusToConditionStatus,bF as mapDestinationFieldsForDisplay,aN as mapExportedSignals,aO as mapSupportedSignals,gu as numbersOnly,aj as parseBooleanFromString,gv as parseJsonStringToPrettyString,aP as prepareDestinationFormData,gw as removeEmptyValuesFromObject,bm as safeJsonParse,gx as safeJsonStringify,gy as setDeepValue,gz as sleep,a5 as splitCamelString,gA as stringifyNonStringValues,gB as trimVersion}from"./chunks/ui-components-BPdnIOmj.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"virtua";
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{gR as IGNORE_OUTSIDE_CLICK_ATTR,gS as useActionFormData,gT as useBodyScroll,dT as useClickNode,y as useClickNotification,e0 as useContainerSize,u as useCopy,gU as useDataStreamFormData,gV as useDestinationFormData,bE as useGenericForm,gW as useInstrumentationRuleFormData,K as useKeyDown,bZ as useOnClickOutside,s as usePopup,eM as useScrollTo,dS as useSessionStorage,an as useSourceFormData,gX as useSourceSelectionFormData,x as useTimeAgo}from"./chunks/ui-components-BPdnIOmj.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"virtua";
|
|
@@ -3,3 +3,6 @@ export * from './odigos-logo-text';
|
|
|
3
3
|
export * from './odigos-logo-text-central';
|
|
4
4
|
export * from './odigos-logo-text-community';
|
|
5
5
|
export * from './odigos-logo-text-enterprise';
|
|
6
|
+
export * from './odigos-logo-text-colored-central';
|
|
7
|
+
export * from './odigos-logo-text-colored-community';
|
|
8
|
+
export * from './odigos-logo-text-colored-enterprise';
|