@odigos/ui-kit 0.0.239 → 0.0.241
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 +37 -0
- package/lib/chunks/helpers-L572q0MU.js +19 -0
- package/lib/chunks/index-DHcHiz_q.js +149 -0
- package/lib/chunks/source-instrument-form-context-vq8DFX7f.js +1 -0
- package/lib/chunks/ui-components-DeKNGyn7.js +1570 -0
- package/lib/chunks/{vendor-C150cdxb.js → vendor-Be0cOokr.js} +1 -1
- package/lib/components/_v2/button/index.d.ts +1 -1
- package/lib/components/_v2/cards/data-card/index.d.ts +1 -0
- package/lib/components/_v2/condition/index.d.ts +1 -0
- package/lib/components/_v2/drop-data/index.d.ts +2 -2
- package/lib/components/_v2/input-table/types.d.ts +2 -0
- package/lib/components/index.d.ts +0 -22
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/sources/index.d.ts +5 -5
- package/lib/constants/strings/index.d.ts +16 -3
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/add-source-drawer/strings.d.ts +54 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/common/pods-header.d.ts +1 -1
- package/lib/containers/_v2/_drawers/edit-source-drawer/helpers.d.ts +3 -3
- package/lib/containers/_v2/_drawers/edit-source-drawer/index.d.ts +3 -3
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/index.d.ts +2 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/popup-form.d.ts +4 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/runtime-override.d.ts +1 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/health-card.d.ts +2 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/index.d.ts +2 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/main-card.d.ts +2 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/index.d.ts +2 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/container-row.d.ts +1 -1
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/helpers.d.ts +4 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/pod-row.d.ts +1 -1
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/process-row.d.ts +1 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/row-header.d.ts +3 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/types.d.ts +1 -8
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/statuses-card.d.ts +2 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/peers/index.d.ts +2 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/containers-card/index.d.ts +2 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/containers-card/process-card.d.ts +3 -1
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/index.d.ts +2 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/pod-debug-commands.d.ts +7 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/index.d.ts +2 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/yaml-files/index.d.ts +6 -0
- package/lib/containers/_v2/overview/columns/column/index.d.ts +2 -2
- package/lib/containers/_v2/overview/columns/column/list-item.d.ts +2 -2
- package/lib/containers/_v2/overview/columns/column/source-visual-state.d.ts +3 -3
- package/lib/containers/_v2/overview/drawers/index.d.ts +1 -1
- package/lib/containers/_v2/overview/search/builder.d.ts +4 -4
- package/lib/containers/index.d.ts +0 -3
- package/lib/containers/service-map/helpers/build-map-nodes.d.ts +2 -2
- package/lib/containers/v2.js +172 -125
- package/lib/containers.js +19 -49
- package/lib/contexts/source-edit-form-context.d.ts +2 -2
- package/lib/contexts.js +1 -1
- package/lib/functions/build-badge-for-desired-status/index.d.ts +6 -0
- package/lib/functions/filter-sources/index.d.ts +2 -2
- package/lib/functions/filter-sources-by-stream/index.d.ts +2 -2
- package/lib/functions/get-conditions-booleans/index.d.ts +5 -3
- package/lib/functions/get-containers-counts/index.d.ts +2 -2
- package/lib/functions/get-containers-icons/index.d.ts +5 -5
- package/lib/functions/get-entity-id/index.d.ts +8 -4
- package/lib/functions/get-health-badge-label/index.d.ts +2 -0
- package/lib/functions/get-main-container-language/index.d.ts +2 -2
- package/lib/functions/get-workload-id/index.d.ts +2 -2
- package/lib/functions/index.d.ts +2 -1
- package/lib/functions/map-desired-status-to-condition-status/index.d.ts +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +0 -1
- package/lib/hooks/useActionFormData.d.ts +1 -1
- package/lib/hooks/useSourceFormData.d.ts +2 -2
- package/lib/hooks/useTimeAgo.d.ts +11 -0
- package/lib/hooks.js +1 -1
- package/lib/icons/common/inbound-icon/index.d.ts +2 -0
- package/lib/icons/common/index.d.ts +2 -0
- package/lib/icons/common/outbound-icon/index.d.ts +2 -0
- package/lib/icons/destinations/open-telemetry-logo/index.d.ts +1 -0
- package/lib/icons.js +1 -1
- package/lib/mock-data/index.d.ts +0 -1
- package/lib/mock-data/sources/index.d.ts +4 -7
- package/lib/mock-data/sources/yamls.d.ts +22 -0
- package/lib/snippets/_v2/delete-modal/index.d.ts +3 -0
- package/lib/snippets/_v2/dynamic-field/index.d.ts +2 -3
- package/lib/snippets/_v2/yaml-section-card/index.d.ts +2 -1
- package/lib/snippets/index.d.ts +0 -4
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +49 -1
- package/lib/store/useEntityStore.d.ts +2 -2
- package/lib/store/useFilterStore.d.ts +8 -14
- package/lib/store/useSelectedStore.d.ts +2 -2
- package/lib/store/useSetupStore.d.ts +10 -15
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/destinations/index.d.ts +3 -3
- package/lib/types/namespaces/index.d.ts +3 -3
- package/lib/types/sources/index.d.ts +3 -44
- package/lib/types/workload/index.d.ts +24 -51
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-B5PgIL40.js +0 -3
- package/lib/chunks/index-Dy4pkeq6.js +0 -145
- package/lib/chunks/index-uXyrp4Xe.js +0 -41
- package/lib/chunks/ui-components-BPdnIOmj.js +0 -2248
- package/lib/components/badge/index.d.ts +0 -11
- package/lib/components/button/index.d.ts +0 -6
- package/lib/components/cancel-warning/index.d.ts +0 -10
- package/lib/components/checkbox/index.d.ts +0 -15
- package/lib/components/condition-details/index.d.ts +0 -10
- package/lib/components/data-card/data-card-fields/index.d.ts +0 -23
- package/lib/components/data-card/index.d.ts +0 -17
- package/lib/components/data-tab/index.d.ts +0 -43
- package/lib/components/delete-warning/index.d.ts +0 -13
- package/lib/components/describe-row/index.d.ts +0 -13
- package/lib/components/drawer/drawer-footer/index.d.ts +0 -16
- package/lib/components/drawer/drawer-header/index.d.ts +0 -24
- package/lib/components/drawer/index.d.ts +0 -15
- package/lib/components/dropdown/index.d.ts +0 -25
- package/lib/components/extend-arrow/index.d.ts +0 -8
- package/lib/components/field-error/index.d.ts +0 -4
- package/lib/components/field-label/index.d.ts +0 -11
- package/lib/components/input/index.d.ts +0 -15
- package/lib/components/modal/index.d.ts +0 -14
- package/lib/components/monitors-icons/index.d.ts +0 -11
- package/lib/components/no-data-found/index.d.ts +0 -6
- package/lib/components/popup-form/index.d.ts +0 -18
- package/lib/components/status/index.d.ts +0 -17
- package/lib/components/tab-list/index.d.ts +0 -18
- package/lib/components/warning-modal/index.d.ts +0 -24
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/debug-commands.d.ts +0 -6
- package/lib/containers/overview-drawer/index.d.ts +0 -27
- package/lib/containers/source-drawer/build-card.d.ts +0 -3
- package/lib/containers/source-drawer/describe/index.d.ts +0 -13
- package/lib/containers/source-drawer/index.d.ts +0 -23
- package/lib/containers/source-drawer/libraries/index.d.ts +0 -12
- package/lib/containers/source-drawer/odigos-health/index.d.ts +0 -5
- package/lib/containers/source-drawer/peers/index.d.ts +0 -12
- package/lib/containers/source-form/index.d.ts +0 -8
- package/lib/functions/is-pod-injected-with-agent/index.d.ts +0 -3
- package/lib/hooks/useSourceSelectionFormData.d.ts +0 -32
- package/lib/mock-data/workload/index.d.ts +0 -2
- package/lib/snippets/add-button/index.d.ts +0 -9
- package/lib/snippets/copy-text/index.d.ts +0 -7
- package/lib/snippets/pod-container/index.d.ts +0 -5
- package/lib/snippets/source-container/index.d.ts +0 -6
- package/lib/snippets/source-container/override-runtime.d.ts +0 -10
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 r}from"react/jsx-runtime";import i,{useTheme as n}from"styled-components";import{d as o,u as a,I as s,a as c,N as d,e as l,F as p,f as g,g as h,C as u,S as m,h as y,i as f,j as v,k as x,D as b,E as w,l as N,m as S,n as k,o as T,p as $,q as K,r as C,s as M}from"./chunks/ui-components-DeKNGyn7.js";import{NotificationIcon as z,TrashIcon as E,UserIcon as I,ImageErrorIcon as R,ChevronDownIcon as G,ChevronRightIcon as _}from"./icons.js";import{useState as D,useRef as V,useCallback as A,useEffect as O}from"react";import{MarkerType as j,useNodesState as q,useEdgesState as B}from"@xyflow/react";import{E as F}from"./chunks/vendor-Be0cOokr.js";import{Flow as L}from"./snippets.js";import"zustand";import"javascript-time-ago";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const P=i.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
width: fit-content;
|
|
4
|
-
`,
|
|
4
|
+
`,W=i(y)`
|
|
5
5
|
gap: 12px;
|
|
6
6
|
padding: 0 12px;
|
|
7
|
-
`,
|
|
7
|
+
`,H=i(p)`
|
|
8
8
|
gap: 12px;
|
|
9
9
|
max-height: 400px;
|
|
10
10
|
overflow-y: auto;
|
|
11
|
-
`,
|
|
11
|
+
`,U=i.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 i}from"react/jsx-runtime";import n,{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
|
+
`,X=i(l)`
|
|
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
|
+
`,J=()=>{const r=n(),{notifications:i,markAsSeen:p}=o(),g=i.filter(({hideFromHistory:e})=>!e),h=g.filter(({seen:e})=>!e),u=h.length,{popupRef:m,popupOpen:y,setPopupOpen:f,popupPosition:v,handlePosition:x}=a({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{u&&h.forEach(({id:e})=>p(e))}});return e(P,{children:[t(s,{onClick:()=>{x(0,0),f(e=>!e)},tooltip:"Notifications",withPing:!!u,pingColor:r.colors.orange_og,children:t(z,{size:18})}),e(c,{ref:m,isOpen:y,right:v.left,maxWidth:"400px",header:e(W,{children:[t(l,{size:20,children:"Notifications"}),!!u&&e(X,{size:12,family:"secondary",children:[u," new"]})]}),children:[t(H,{children:g.length?g.map(e=>t(re,{...e,onClick:()=>f(!1)},`notification-${e.id}`)):t(d,{title:"No notifications",subTitle:""})}),t(U,{})]})]})},Q=i.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+f["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 i}from"react/jsx-runtime";import n,{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
|
+
`,Y=i.div`
|
|
41
|
+
background-color: ${({$type:e,theme:t})=>t.text[e]+f["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
|
+
`,Z=i.div`
|
|
49
49
|
width: 290px;
|
|
50
|
-
`,
|
|
50
|
+
`,ee=i.div`
|
|
51
51
|
margin-bottom: 6px;
|
|
52
|
-
`,
|
|
52
|
+
`,te=i.div`
|
|
53
53
|
display: flex;
|
|
54
54
|
align-items: center;
|
|
55
55
|
gap: 6px;
|
|
56
|
-
`,
|
|
56
|
+
`,re=({id:i,seen:o,type:a,title:s,message:c,time:d,crdType:p,target:y,onClick:f})=>{const x=n(),{formatTimeAgo:b}=g(),{onClickNotification:w}=h(),N=!!p&&!!y,S=s?.toLowerCase().includes(u.Delete.toLowerCase())||!1,k=v(a,x);return e(Q,{className:N?"click-enabled":"",onClick:()=>{N&&(f(),w({id:i,crdType:p,target:y}))},children:[t(Y,{$type:S?m.Error:a,children:t(S?E:k,{})}),e(Z,{children:[t(ee,{children:t(l,{size:14,children:c})}),e(te,{children:[t(l,{size:10,color:x.text.grey,children:b(d)}),!o&&e(r,{children:[t(l,{size:10,children:"·"}),t(l,{size:10,color:x.colors.orange_soft,children:"new"})]})]})]})]},`notification-${i}`)},ie=e=>`${w.Source}-${e}-${x.MapItem}`,ne=(e,t,r)=>{const i=e.isVirtual,n=r?[I]:i?[N(e)]:t?S(t):[R],{priorotizedStatus:o}=i?{priorotizedStatus:void 0}:k(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:n,isVirtual:i,status:o,aggService:e}},oe=e=>!(!e||"user"!==e.serviceName||e.id.namespace||e.id.name||e.id.kind),ae=({theme:e,nodes:t,aggregatedServiceMap:r})=>{const i=[],n=new Map(t.map(e=>[e.id,e]));for(const t of r){const r=ie(t.graphKey),o=n.get(r);if(!o)continue;const a=o.data?.status===m.Error;for(const o of t.connections){const s=ie(o.targetGraphKey);n.has(s)&&i.push({id:`${r}-to-${s}`,type:"smoothstep",source:r,target:s,data:{sourceGraphKey:t.graphKey,targetGraphKey:o.targetGraphKey},markerEnd:{type:j.ArrowClosed},style:{stroke:a?e?.colors.dark_red:e?.colors.border}})}}return i},se=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},ce=new F,de=`${w.Source}-user-${x.MapItem}`,le={"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"},pe=i.div`
|
|
57
57
|
padding: 8px 0;
|
|
58
|
-
`,
|
|
58
|
+
`,ge=i.div`
|
|
59
59
|
display: flex;
|
|
60
60
|
gap: 12px;
|
|
61
61
|
align-items: center;
|
|
62
62
|
padding: 4px 0 4px 16px;
|
|
63
|
-
`,
|
|
63
|
+
`,he=i.button`
|
|
64
64
|
display: flex;
|
|
65
65
|
align-items: center;
|
|
66
66
|
gap: 4px;
|
|
@@ -74,43 +74,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useThe
|
|
|
74
74
|
&:hover {
|
|
75
75
|
text-decoration: underline;
|
|
76
76
|
}
|
|
77
|
-
`,
|
|
77
|
+
`,ue=i.div`
|
|
78
78
|
padding: 4px 0 8px;
|
|
79
|
-
`,
|
|
79
|
+
`,me=({conn:r,onToggle:i,isExpanded:n})=>{const o=r.details.length>0;return t(pe,{children:e(y,{$justifyContent:"space-between",$alignItems:"center",children:[t(l,{size:14,weight:500,children:r.targetServiceName}),o&&e(he,{onClick:i,children:[t(n?G:_,{size:12}),n?"hide attributes":`${r.details.length} attribute${r.details.length>1?"s":""}`]})]})})},ye=({conn:e})=>{const i=n();return t(r,{children:e.details.map(e=>t(ge,{children:t(l,{size:12,color:i.text.secondary,style:{flex:1},children:e.value})},e.value))})},fe=({connections:i,isVirtual:o,attributes:a})=>{const[s,c]=D(new Set),d=n();if(o){const i=Object.entries(a||{});return e(r,{children:[t(l,{size:12,color:d.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}),i.length>0&&e(r,{children:[t(ue,{style:{paddingTop:16},children:t(l,{size:11,color:d.text.info,children:"Attributes"})}),i.map(([r,i])=>e(ge,{children:[t(l,{size:12,color:d.text.secondary,children:r}),t(l,{size:12,children:i})]},r))]})]})}return i.length?e(r,{children:[t(ue,{children:t(l,{size:11,color:d.text.info,children:"Connected services"})}),i.map(r=>e("div",{children:[t(me,{conn:r,isExpanded:s.has(r.targetGraphKey),onToggle:()=>{return e=r.targetGraphKey,void c(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r});var e}}),s.has(r.targetGraphKey)&&t(ye,{conn:r}),t($,{})]},r.targetGraphKey))]}):t(l,{size:12,color:d.text.info,children:"No outgoing connections"})},ve=({conn:i})=>{const o=n();return i?t(r,{children:i.details.length>0?e(r,{children:[t(ue,{children:t(l,{size:11,color:o.text.info,children:"Attribute breakdown"})}),i.details.map(e=>t(ge,{children:t(l,{size:12,style:{flex:1},children:e.value})},e.value))]}):t(l,{size:12,color:o.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):t(l,{size:12,color:o.text.info,children:"No data for this connection"})},xe=({drawerState:e,aggregatedData:r,onClose:i})=>{if(!e)return null;const n=new Map(r.map(e=>[e.graphKey,e]));let o="",a="",s=null;if("node"===e.type){const r=n.get(e.graphKey);o=r?.serviceName||e.graphKey,a=r?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",s=t(fe,{connections:r?.connections||[],isVirtual:r?.isVirtual,attributes:r?.attributes})}else{const r=n.get(e.sourceKey),i=r?.connections.find(t=>t.targetGraphKey===e.targetKey);o=`${r?.serviceName||e.sourceKey} → ${i?.targetServiceName||e.targetKey}`,a="Connection details",s=t(ve,{conn:i})}return t(T,{isOpen:!0,width:"420px",position:"right",header:{title:o,subTitle:a,onClose:i},children:s})},be=i.div`
|
|
80
80
|
width: 100%;
|
|
81
81
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
82
82
|
position: relative;
|
|
83
|
-
`,
|
|
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`
|
|
83
|
+
`,we={id:{namespace:"",name:"",kind:""},serviceName:"user",markedForInstrumentation:{markedForInstrumentation:!0}},Ne=`${w.Source}-`,Se=`-${x.MapItem}`,ke=.15,Te=({heightToRemove:r,serviceMap:i,onRefresh:o})=>{const a=n(),s=K(e=>e.sources),[c,d,l]=q([]),[p,g,h]=B([]),[u,m]=D(0),[y,f]=D(null),v=V([]);v.current=c;const N=V(a);N.current=a;const S=V([]),k=V([]),T=A(()=>m(e=>e+1),[]),{activeNodeId:$,setActiveNodeType:M,setActiveNodeId:z}=C();O(()=>{if(!$)return;const e=(t=$).startsWith(Ne)&&t.endsWith(Se)?t.slice(Ne.length,-Se.length):null;var t;e&&f({type:"node",graphKey:e})},[$]);const E=A((e,t)=>{const{sourceGraphKey:r,targetGraphKey:i}=t.data||{};r&&i&&(M(null),z(null),f({type:"edge",sourceKey:r,targetKey:i}))},[M,z]),I=A(()=>{f(null),M(null),z(null)},[M,z]),R=A((e,t)=>{const r=t.id;g(e=>e.map(e=>e.source===r||e.target===r?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:ke},labelStyle:{...e.labelStyle,opacity:ke},labelBgStyle:{...e.labelBgStyle,opacity:ke}}))},[g]),G=A(()=>{g(k.current)},[g]);return O(()=>{let e=!1;const t=(e=>{const t=new Map,r=new Set,i=(e,r,i=!1)=>{let n=t.get(e);return n||(n={serviceName:r,isVirtual:i,attributes:{},connectionMap:new Map},t.set(e,n)),n},n=(e,t)=>{if(t)for(const{key:r,value:i}of t)r in e||(e[r]=i)};for(const t of e){const{graphKey:e}=se(t.nodeId),o=i(e,t.serviceName);o.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:a}=se(e?.nodeId??"");e.isVirtual&&(r.add(t),n(i(t,e.serviceName,!0).attributes,e.nodeAttributes));let s=o.connectionMap.get(t);if(s||(s={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},o.connectionMap.set(t,s)),s.totalRequests+=e.requests,e.dateTime>s.lastDateTime&&(s.lastDateTime=e.dateTime),a){const t=s.details.find(e=>e.value===a);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):s.details.push({value:a,requests:e.requests,dateTime:e.dateTime})}}}const o=[...t.entries()];for(const[,{connectionMap:e}]of o)for(const[n,o]of e)t.has(n)||i(n,o.targetServiceName,r.has(n));const a=[];for(const[e,{serviceName:r,isVirtual:i,attributes:n,connectionMap:o}]of t){const t=[...o.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),a.push({graphKey:e,serviceName:r,isVirtual:i,connections:t,attributes:n})}return a.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),a})(i);S.current=t;const r=(({sources:e,aggregatedServiceMap:t})=>{const r=[],i={x:0,y:0};if(t.length&&e.length)for(const n of t){const t=ie(n.graphKey),o=e.find(e=>n.serviceName===e.serviceName||n.serviceName===e.id.name);r.push({id:t,type:x.MapItem,position:i,data:ne(n,o,oe(o)),measured:{width:80,height:80}})}else r.push({id:`${w.Source}-${x.NoData}`,type:x.NoData,position:i,data:{subTitle:b.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return r})({aggregatedServiceMap:t,sources:[we].concat(s)});if(1===r.length&&r[0].id===`${w.Source}-${x.NoData}`)return d(r),g([]),void(k.current=[]);const n=new Set(v.current.map(e=>e.id)),o=new Set(r.map(e=>e.id)),a=r.some(e=>!n.has(e.id)),c=v.current.some(e=>!o.has(e.id));if(!(a||c)){const e=new Map(v.current.map(e=>[e.id,e.position]));d(r.map(t=>({...t,position:e.get(t.id)??t.position})));const i=ae({theme:N.current,nodes:r,aggregatedServiceMap:t});return k.current=i,void g(i)}return(async(e,t,r={})=>{const i={id:"root",layoutOptions:{...le,...r},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===de?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},n=await ce.layout(i),o=new Map;return n.children?.forEach(e=>{o.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:o.get(e.id)??e.position})),edges:t}})(r,ae({theme:N.current,nodes:r,aggregatedServiceMap:t})).then(({nodes:t})=>{if(e)return;d(t);const r=ae({theme:N.current,nodes:t,aggregatedServiceMap:S.current});k.current=r,g(r),T()}),()=>{e=!0}},[i,s]),O(()=>{if(!v.current.length)return;const e=ae({theme:a,nodes:v.current,aggregatedServiceMap:S.current});k.current=e,g(e)},[a]),e(be,{$heightToRemove:r,children:[t(L,{nodes:c,edges:p,onNodesChange:l,onEdgesChange:h,onEdgeClick:E,onNodeMouseEnter:R,onNodeMouseLeave:G,onRefresh:o,fitViewTrigger:u,zoomOnScroll:!0}),t(xe,{drawerState:y,aggregatedData:S.current,onClose:I})]})},$e=i.div`
|
|
114
84
|
position: fixed;
|
|
115
85
|
bottom: 12px;
|
|
116
86
|
left: 12px;
|
|
@@ -119,4 +89,4 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import n,{useThe
|
|
|
119
89
|
flex-direction: column-reverse;
|
|
120
90
|
gap: 6px;
|
|
121
91
|
max-width: 600px;
|
|
122
|
-
`,
|
|
92
|
+
`,Ke=()=>{const{notifications:e,markAsDismissed:r,markAsSeen:i}=o(),{onClickNotification:n}=h();return t($e,{children:e.filter(({dismissed:e})=>!e).map(({id:e,type:o,title:a,message:s,crdType:c,target:d})=>t(M,{id:e,type:o,title:a,message:s,action:c&&d?{label:"go to details",onClick:()=>n({id:e,crdType:c,target:d},{dismissToast:!0})}:void 0,onClose:()=>(({id:e,asSeen:t})=>{r(e),i(e)})({id:e,asSeen:!0})},`toast-${e}`))})};export{J as NotificationManager,Te as ServiceMap,Ke as ToastList};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type FC, type ReactNode } from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type SourceFormData, type Workload } from '@/types';
|
|
3
3
|
import { type GenericFormResult } from '@/hooks/useGenericForm';
|
|
4
4
|
interface SourceEditFormContextValue {
|
|
5
|
-
loadSource: (source:
|
|
5
|
+
loadSource: (source: Workload) => void;
|
|
6
6
|
genericForm?: GenericFormResult<SourceFormData>;
|
|
7
7
|
validateFormData: () => {
|
|
8
8
|
errorMessage?: string;
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-vq8DFX7f.js";export{O as OdigosProvider,c as checkVersionSupport,u as useOdigos}from"./chunks/helpers-L572q0MU.js";import{jsx as r}from"react/jsx-runtime";import{useMemo as o,useContext as t,createContext as s}from"react";import"./chunks/ui-components-DeKNGyn7.js";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const m=s({formType:void 0}),n=({children:e,formType:t})=>{const s=o(()=>({formType:t}),[t]);return r(m.Provider,{value:s,children:e})},p=()=>t(m);export{n as StorybookProvider,p as useStorybook};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BadgeProps } from '@/components/_v2/badge';
|
|
2
|
+
import { DesiredConditionStatus, type SVG } from '@/types';
|
|
3
|
+
export type BadgeForDesiredStatus = BadgeProps & {
|
|
4
|
+
key: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const buildBadgeForDesiredStatus: (desiredCondition?: DesiredConditionStatus | null, leftIcon?: SVG, labelType?: "reason" | "health", labelForced?: string) => BadgeForDesiredStatus | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FiltersState } from '@/store';
|
|
2
|
-
import { type
|
|
3
|
-
export declare const filterSources: (sources:
|
|
2
|
+
import { type Workload } from '@/types';
|
|
3
|
+
export declare const filterSources: (sources: Workload[], filters: FiltersState) => Workload[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const filterSourcesByStream: (sources:
|
|
1
|
+
import type { Workload } from '@/types';
|
|
2
|
+
export declare const filterSourcesByStream: (sources: Workload[], streamName: string) => Workload[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StatusType, type Condition } from '@/types';
|
|
2
|
-
|
|
1
|
+
import { StatusType, type Condition, K8sWorkloadConditions } from '@/types';
|
|
2
|
+
interface ConditionsBooleans {
|
|
3
3
|
errors: Condition[];
|
|
4
4
|
hasErrors: boolean;
|
|
5
5
|
warnings: Condition[];
|
|
@@ -9,4 +9,6 @@ export declare const getConditionsBooleans: (conditions: Condition[]) => {
|
|
|
9
9
|
loadings: Condition[];
|
|
10
10
|
hasLoadings: boolean;
|
|
11
11
|
priorotizedStatus: StatusType | undefined;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
|
+
export declare const getConditionsBooleans: (conditions?: Condition[] | K8sWorkloadConditions | null) => ConditionsBooleans;
|
|
14
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getContainersInstrumentedCount: (containers:
|
|
1
|
+
import type { Workload } from '@/types';
|
|
2
|
+
export declare const getContainersInstrumentedCount: (containers: Workload["containers"]) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ProgrammingLanguages, type
|
|
2
|
-
export declare const getEffectiveLanguage: (container?: NonNullable<
|
|
3
|
-
export declare const getEffectiveRuntimeVersion: (container?: NonNullable<
|
|
4
|
-
export declare const getContainersIcons: (containers:
|
|
1
|
+
import { ProgrammingLanguages, type Workload, type SVG } from '@/types';
|
|
2
|
+
export declare const getEffectiveLanguage: (container?: NonNullable<Workload["containers"]>[number]) => ProgrammingLanguages;
|
|
3
|
+
export declare const getEffectiveRuntimeVersion: (container?: NonNullable<Workload["containers"]>[number]) => string | null;
|
|
4
|
+
export declare const getContainersIcons: (containers: Workload["containers"]) => SVG[];
|
|
5
5
|
export declare const getDetectedLanguageIcons: (languages: ProgrammingLanguages[] | null | undefined) => SVG[];
|
|
6
|
-
export declare const getSourceLanguageIcons: (source: Pick<
|
|
6
|
+
export declare const getSourceLanguageIcons: (source: Pick<Workload, "runtimeInfo" | "containers">) => SVG[];
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { Action, Destination, InstrumentationRule, Metric, Namespace, Workload, WorkloadId } from '@/types';
|
|
2
|
+
type Entity = Namespace | Workload | Destination | Action | InstrumentationRule | (Metric & WorkloadId) | (Metric & {
|
|
3
|
+
id: string;
|
|
4
|
+
});
|
|
5
|
+
export declare const getEntityId: (item: Entity) => string | WorkloadId | undefined;
|
|
6
|
+
export declare const entityIdKey: (id?: string | WorkloadId) => string;
|
|
7
|
+
export declare const getEntityIdKey: (item: Entity) => string;
|
|
8
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ProgrammingLanguages, type
|
|
2
|
-
export declare const getMainContainerLanguage: (source:
|
|
1
|
+
import { ProgrammingLanguages, type Workload } from '@/types';
|
|
2
|
+
export declare const getMainContainerLanguage: (source: Workload) => ProgrammingLanguages;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { WorkloadId } from '@/types';
|
|
2
|
-
export declare const getWorkloadId: (
|
|
1
|
+
import type { Workload, WorkloadId } from '@/types';
|
|
2
|
+
export declare const getWorkloadId: (w?: WorkloadId | Workload) => WorkloadId;
|
package/lib/functions/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './build-badge-for-desired-status';
|
|
1
2
|
export * from './capitalize-first-letter';
|
|
2
3
|
export * from './clean-object-empty-strings-values';
|
|
3
4
|
export * from './compare-condition';
|
|
@@ -20,6 +21,7 @@ export * from './get-destination-icon';
|
|
|
20
21
|
export * from './get-entity-icon';
|
|
21
22
|
export * from './get-entity-id';
|
|
22
23
|
export * from './get-entity-label';
|
|
24
|
+
export * from './get-health-badge-label';
|
|
23
25
|
export * from './get-id-from-sse-target';
|
|
24
26
|
export * from './get-instrumentation-rule-icon';
|
|
25
27
|
export * from './get-main-container-language';
|
|
@@ -42,7 +44,6 @@ export * from './has-unhealthy-instances';
|
|
|
42
44
|
export * from './is-emtpy';
|
|
43
45
|
export * from './is-legal-k8s-label';
|
|
44
46
|
export * from './is-over-time';
|
|
45
|
-
export * from './is-pod-injected-with-agent';
|
|
46
47
|
export * from './is-string-a-boolean';
|
|
47
48
|
export * from './is-time-elapsed';
|
|
48
49
|
export * from './is-valid-version';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DesiredStateProgress, OtherStatus, StatusType } from '@/types';
|
|
2
|
-
export declare const mapDesiredStatusToConditionStatus: (status
|
|
2
|
+
export declare const mapDesiredStatusToConditionStatus: (status?: DesiredStateProgress | null) => StatusType | OtherStatus | null;
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{a_ as buildBadgeForDesiredStatus,f5 as capitalizeFirstLetter,f6 as cleanObjectEmptyStringsValues,af as compareCondition,f7 as decimalsOnly,w as deepClone,dh as entityIdKey,dl as filterActions,dk as filterDestinations,aV as filterDestinationsByStream,dj as filterSources,d5 as filterSourcesByStream,f8 as flattenObjectKeys,bd as formatBytes,f9 as formatDuration,bN as generateId,aT as getActionIcon,n as getConditionsBooleans,bq as getContainersIcons,fa as getContainersInstrumentedCount,fb as getDeepValue,aG as getDestinationIcon,fc as getDetectedLanguageIcons,b3 as getEffectiveLanguage,bl as getEffectiveRuntimeVersion,db as getEntityIcon,aO as getEntityId,df as getEntityIdKey,da as getEntityLabel,bf as getHealthBadgeLabel,fd as getIdFromSseTarget,aZ as getInstrumentationRuleIcon,fe as getMainContainerLanguage,ff as getMetricForEntity,fg as getMonitorIcon,fh as getPlatformIcon,fi as getPlatformLabel,ao as getProgrammingLanguageIcon,fj as getRecursiveValues,m as getSourceLanguageIcons,fk as getSseTargetFromId,fl as getStatusColor,dr as getStatusFromPodStatus,j as getStatusIcon,bg as getStatusTypeFromOdigosHealth,fm as getValueForRange,l as getVirtualServiceIcon,bb as getWorkloadId,aW as getYamlFieldsForDestination,fn as hasUnhealthyInstances,G as isEmpty,J as isLegalK8sLabel,bJ as isOverTime,fo as isStringABoolean,fp as isTimeElapsed,bk as isValidVersion,fq as mapConditions,b0 as mapDesiredStatusToConditionStatus,aU as mapDestinationFieldsForDisplay,Q as mapExportedSignals,L as mapSupportedSignals,fr as numbersOnly,fs as parseBooleanFromString,ft as parseJsonStringToPrettyString,ah as prepareDestinationFormData,fu as removeEmptyValuesFromObject,O as safeJsonParse,fv as safeJsonStringify,fw as setDeepValue,fx as sleep,aX as splitCamelString,fy as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-DeKNGyn7.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Action, type ActionFormData } from '@/types';
|
|
2
2
|
export declare const useActionFormData: () => {
|
|
3
3
|
formData: ActionFormData;
|
|
4
|
-
formErrors: Partial<Record<"
|
|
4
|
+
formErrors: Partial<Record<"type" | "disabled" | "name" | "notes" | "signals" | "fields", string>>;
|
|
5
5
|
handleFormChange: (key?: string | undefined, val?: any, obj?: ActionFormData | undefined) => void;
|
|
6
6
|
resetFormData: (overrideForm?: ActionFormData | undefined) => void;
|
|
7
7
|
validateForm: (params?: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Workload, type SourceFormData } from '@/types';
|
|
2
2
|
export declare const useSourceFormData: () => {
|
|
3
3
|
formData: SourceFormData;
|
|
4
4
|
formErrors: Partial<Record<keyof SourceFormData, string>>;
|
|
5
5
|
handleFormChange: (key?: string | undefined, val?: any, obj?: SourceFormData | undefined) => void;
|
|
6
6
|
resetFormData: (overrideForm?: SourceFormData | undefined) => void;
|
|
7
7
|
validateForm: () => boolean;
|
|
8
|
-
loadFormWithDrawerItem: ({
|
|
8
|
+
loadFormWithDrawerItem: ({ serviceName, id }: Workload) => void;
|
|
9
9
|
};
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export type FormatTimeAgo = (wen: Date | number | string) => string;
|
|
2
|
+
export type DurationStyle = 'long' | 'short';
|
|
3
|
+
export interface FormatDurationAgoOptions {
|
|
4
|
+
/** Max number of units to include in the output. Defaults to 2. */
|
|
5
|
+
units?: number;
|
|
6
|
+
/** "long" => "4 hours 12 minutes", "short" => "4h12m". Defaults to "long". */
|
|
7
|
+
style?: DurationStyle;
|
|
8
|
+
/** Append " ago" suffix (long style only). Defaults to true. */
|
|
9
|
+
suffix?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export type FormatDurationAgo = (wen: Date | number | string, opts?: FormatDurationAgoOptions) => string;
|
|
2
12
|
export declare const useTimeAgo: () => {
|
|
3
13
|
formatTimeAgo: FormatTimeAgo;
|
|
14
|
+
formatDurationAgo: FormatDurationAgo;
|
|
4
15
|
};
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{fK as IGNORE_OUTSIDE_CLICK_ATTR,fL as useActionFormData,fM as useBodyScroll,d9 as useClickNode,g as useClickNotification,di as useContainerSize,be as useCopy,fN as useDataStreamFormData,fO as useDestinationFormData,v as useGenericForm,fP as useInstrumentationRuleFormData,bI as useKeyDown,bh as useOnClickOutside,u as usePopup,dO as useScrollTo,d8 as useSessionStorage,fQ as useSourceFormData,f as useTimeAgo}from"./chunks/ui-components-DeKNGyn7.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
|
@@ -24,6 +24,7 @@ export * from './question-circle-icon';
|
|
|
24
24
|
export * from './home-icon';
|
|
25
25
|
export * from './i-square-icon';
|
|
26
26
|
export * from './image-error-icon';
|
|
27
|
+
export * from './inbound-icon';
|
|
27
28
|
export * from './key-icon';
|
|
28
29
|
export * from './list-icon';
|
|
29
30
|
export * from './minus-circled-icon';
|
|
@@ -31,6 +32,7 @@ export * from './minus-icon';
|
|
|
31
32
|
export * from './no-data-icon';
|
|
32
33
|
export * from './notebook-icon';
|
|
33
34
|
export * from './notification-icon';
|
|
35
|
+
export * from './outbound-icon';
|
|
34
36
|
export * from './plus-circled-icon';
|
|
35
37
|
export * from './plus-icon';
|
|
36
38
|
export * from './question-circle-icon';
|