@odigos/ui-kit 0.0.230 → 0.0.232
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 +36 -0
- package/lib/chunks/index-Bbukn13F.js +77 -0
- package/lib/chunks/{index-DJZLguZq.js → index-Cw4LkdaE.js} +1 -1
- package/lib/chunks/index-D7sjsMOG.js +145 -0
- package/lib/chunks/ui-components-of0mjGMv.js +2671 -0
- package/lib/components/_v2/cards/section-card/index.d.ts +11 -0
- package/lib/components/_v2/drop-down/index.d.ts +1 -1
- package/lib/components/_v2/search/index.d.ts +2 -0
- package/lib/components/_v2/segment/index.d.ts +1 -0
- package/lib/components/_v2/table/index.d.ts +8 -1
- package/lib/components/_v2/typography/index.d.ts +20 -1
- package/lib/components/_v2/warning-modal/index.d.ts +5 -5
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/sampling/index.d.ts +7 -0
- package/lib/constants/strings/index.d.ts +6 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/add-destination-drawer/form-column/index.d.ts +1 -1
- package/lib/containers/_v2/_drawers/add-destination-drawer/lists-column/index.d.ts +1 -1
- package/lib/containers/_v2/_drawers/add-source-drawer/namespaces-column/index.d.ts +1 -1
- package/lib/containers/_v2/_drawers/add-source-drawer/workloads-column/index.d.ts +1 -1
- package/lib/containers/_v2/_forms/data-stream-form/index.d.ts +6 -0
- package/lib/containers/_v2/_forms/data-stream-form/merge-warning.d.ts +11 -0
- package/lib/containers/_v2/_forms/index.d.ts +1 -0
- package/lib/containers/_v2/_modals/add-data-stream-modal/index.d.ts +8 -0
- package/lib/containers/_v2/_modals/edit-data-stream-modal/index.d.ts +8 -0
- package/lib/containers/_v2/_modals/index.d.ts +2 -0
- package/lib/containers/_v2/index.d.ts +2 -0
- package/lib/containers/_v2/overview/columns/column/empty-add.d.ts +7 -0
- package/lib/containers/_v2/overview/columns/column/head.d.ts +14 -0
- package/lib/containers/_v2/overview/columns/column/index.d.ts +12 -0
- package/lib/containers/_v2/overview/columns/column/list-item.d.ts +17 -0
- package/lib/containers/_v2/overview/columns/column/namespace-divider.d.ts +7 -0
- package/lib/containers/_v2/overview/columns/column/source-visual-state.d.ts +9 -0
- package/lib/containers/_v2/overview/columns/index.d.ts +11 -0
- package/lib/containers/_v2/overview/data-stream-select/index.d.ts +12 -0
- package/lib/containers/_v2/overview/drawers/index.d.ts +31 -0
- package/lib/containers/_v2/overview/filters/index.d.ts +2 -0
- package/lib/containers/_v2/overview/index.d.ts +14 -0
- package/lib/containers/_v2/overview/multi-source-control/index.d.ts +7 -0
- package/lib/containers/_v2/overview/search/builder.d.ts +25 -0
- package/lib/containers/_v2/overview/search/index.d.ts +7 -0
- package/lib/containers/source-drawer/index.d.ts +2 -2
- package/lib/containers/source-drawer/profiling/flame-graph-canvas.d.ts +12 -0
- package/lib/containers/source-drawer/profiling/flamebearer.d.ts +21 -2
- package/lib/containers/source-drawer/profiling/index.d.ts +1 -9
- package/lib/containers/source-drawer/profiling/symbol-table.d.ts +13 -0
- package/lib/containers/v2.js +348 -43
- package/lib/containers.js +122 -200
- package/lib/contexts/data-stream-form-context.d.ts +60 -0
- package/lib/contexts/index.d.ts +1 -0
- package/lib/contexts/sampling-rules-form-context.d.ts +3 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/useOnClickOutside.d.ts +1 -0
- package/lib/hooks.js +1 -1
- package/lib/icons/common/index.d.ts +1 -0
- package/lib/icons/common/star-icon/index.d.ts +2 -0
- package/lib/icons.js +1 -1
- package/lib/mock-data/index.d.ts +1 -0
- package/lib/mock-data/sources/index.d.ts +1 -0
- package/lib/snippets/_v2/cancel-modal/index.d.ts +4 -1
- package/lib/snippets/_v2/delete-modal/index.d.ts +3 -1
- package/lib/snippets/_v2/rich-title/index.d.ts +1 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/index.d.ts +1 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/rule-type.d.ts +8 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/sampling-preview.d.ts +3 -1
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme/palettes/index.d.ts +10 -0
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +2 -0
- package/lib/types/config/index.d.ts +2 -0
- package/lib/types/destinations/index.d.ts +1 -0
- package/lib/types/instrumentation-rules/index.d.ts +2 -0
- package/lib/types/sources/index.d.ts +44 -0
- package/lib/types.js +1 -1
- package/lib/visuals/index.d.ts +1 -0
- package/lib/visuals/visual-purple-rings/index.d.ts +7 -0
- package/lib/visuals.js +1 -1
- package/package.json +11 -11
- package/lib/chunks/index-CGrd7Nq0.js +0 -149
- package/lib/chunks/ui-components-B4xHrszQ.js +0 -2659
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.232](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.231...ui-kit-v0.0.232) (2026-05-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add purple rings visual ([#863](https://github.com/odigos-io/ui-kit/issues/863)) ([4ca4465](https://github.com/odigos-io/ui-kit/commit/4ca4465d59c6e45fb703e5f3d0e3dc0cb9e172a5))
|
|
9
|
+
* add search and filters to overview v2 ([#861](https://github.com/odigos-io/ui-kit/issues/861)) ([e0ef3fb](https://github.com/odigos-io/ui-kit/commit/e0ef3fb7d595d326a72355c575e9191172f80022))
|
|
10
|
+
* add star icon ([#862](https://github.com/odigos-io/ui-kit/issues/862)) ([25f6e0e](https://github.com/odigos-io/ui-kit/commit/25f6e0e90ddb04ff91965de025b0b402317d5e7b))
|
|
11
|
+
* design v2 overview page ([#608](https://github.com/odigos-io/ui-kit/issues/608)) ([93792d2](https://github.com/odigos-io/ui-kit/commit/93792d2e1daafa170092c7ce9483fb0ca9477db5))
|
|
12
|
+
* enhance telemetry descriptions in overview v2 ([#870](https://github.com/odigos-io/ui-kit/issues/870)) ([9a5c972](https://github.com/odigos-io/ui-kit/commit/9a5c97278c8197a29c1cafb148f97b2dc3c87a09))
|
|
13
|
+
* refactor column head component to improve refresh button layout ([#871](https://github.com/odigos-io/ui-kit/issues/871)) ([bef59c4](https://github.com/odigos-io/ui-kit/commit/bef59c45a7b7b81186cb1df2f541eb70564664bb))
|
|
14
|
+
* **segment:** support optional selectedBorderColor per option ([#864](https://github.com/odigos-io/ui-kit/issues/864)) ([bc8a1fb](https://github.com/odigos-io/ui-kit/commit/bc8a1fb4c5ce1a7a2c355a28d986d1ea1b0db27f))
|
|
15
|
+
* **settings:** add conditional rendering support for fields ([#866](https://github.com/odigos-io/ui-kit/issues/866)) ([b0a3fd8](https://github.com/odigos-io/ui-kit/commit/b0a3fd889ed00e6c61df66eb2d88a680e70bdd5b))
|
|
16
|
+
* update typography color handling across components ([#873](https://github.com/odigos-io/ui-kit/issues/873)) ([8d6e86d](https://github.com/odigos-io/ui-kit/commit/8d6e86dc549e438d97b7b8bcdd224d6b983c725c))
|
|
17
|
+
* update z-index values for v2 components to use theme-based values ([#872](https://github.com/odigos-io/ui-kit/issues/872)) ([c490000](https://github.com/odigos-io/ui-kit/commit/c49000048d54e618d72e323e17bca5dd285331c8))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* standardize SVG icon dimensions across multiple logos ([#877](https://github.com/odigos-io/ui-kit/issues/877)) ([7f11f51](https://github.com/odigos-io/ui-kit/commit/7f11f5141f377ee56f30ae03b5f767abeb73e33d))
|
|
23
|
+
|
|
24
|
+
## [0.0.231](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.230...ui-kit-v0.0.231) (2026-05-06)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* **autocomplete, drop-data:** enhance empty state messaging and button visibility ([#855](https://github.com/odigos-io/ui-kit/issues/855)) ([37bea76](https://github.com/odigos-io/ui-kit/commit/37bea760b05fcbe50541ee8721a8b27d06b9252b))
|
|
30
|
+
* improve button ux for add-destination ([#852](https://github.com/odigos-io/ui-kit/issues/852)) ([c37e407](https://github.com/odigos-io/ui-kit/commit/c37e40746d34644bb32797d07b1ed8ae4db0aa65))
|
|
31
|
+
* **profiling:** enhance table and flame graph integration ([#858](https://github.com/odigos-io/ui-kit/issues/858)) ([d68d63e](https://github.com/odigos-io/ui-kit/commit/d68d63ea1e0f77a954d69238951edc58396aef1a))
|
|
32
|
+
* refactor/rename column functions to use hooks in add-destination and add-source drawers ([#854](https://github.com/odigos-io/ui-kit/issues/854)) ([08cfbf0](https://github.com/odigos-io/ui-kit/commit/08cfbf085fdee5051bcd5e454f4af33628b32ebf))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
* exclude StaticPod sources from rollout restart action ([#857](https://github.com/odigos-io/ui-kit/issues/857)) ([825a36d](https://github.com/odigos-io/ui-kit/commit/825a36dfe4b3bbde9f1257e6fdd2adb66b29d7c3))
|
|
38
|
+
|
|
3
39
|
## [0.0.230](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.229...ui-kit-v0.0.230) (2026-05-04)
|
|
4
40
|
|
|
5
41
|
### Bug Fixes
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as n}from"react/jsx-runtime";import{forwardRef as i,useState as o,useRef as l,useImperativeHandle as r,useEffect as a,useLayoutEffect as s,useMemo as c,useCallback as d,Fragment as u,Children as h}from"react";import f,{useTheme as m}from"styled-components";import{c as p,d as g,T as v,e as y,f as b,h as x,i as w,E as S,I as k,F as $,j as C,k as T,l as z,m as I,B as N,a as F,n as P,o as E,p as O,q as R,S as L,r as D,s as M,P as A,t as B,v as W,b as X,L as V,w as Y,N as j,x as H,y as _,z as U,G as J,H as K,J as Z,O as G,K as q,M as Q,Q as ee,R as te,U as ne,V as ie,W as oe,X as le,Y as re,Z as ae,_ as se,g as ce,$ as de,a0 as ue,a1 as he,a2 as fe,a3 as me,a4 as pe,a5 as ge,a6 as ve,a7 as ye,a8 as be,a9 as xe,aa as we,ab as Se,ac as ke,ad as $e}from"./ui-components-of0mjGMv.js";import{EditIcon as Ce,TrashIcon as Te,SearchIcon as ze,MinusIcon as Ie,PlusIcon as Ne,XIcon as Fe,ExpandIcon as Pe,CopyIcon as Ee,DotIcon as Oe,DownloadIcon as Re,RefreshIcon as Le,RefreshLeftArrowIcon as De}from"../icons.js";import{Y as Me}from"./index-Cw4LkdaE.js";const Ae=i(({children:i,width:a=640,title:s,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:h,isEdit:f=!1,isFormDirty:k=!1,isLastItem:$=!1,onClose:C,onEdit:T,onSave:z,onDelete:I,onCancel:N,tabs:F,headerActionButtons:P},E)=>{const O=m(),{drawerType:R,setDrawerType:L,setDrawerEntityId:D}=p();g({key:"Enter",active:f},()=>J());const[M,A]=o(!1),[B,W]=o(!1),X=l(null),V=R===S.Source,Y=()=>{A(!1),W(!1)},j=()=>{Y(),T&&T(!1),L(null),D(null),C?.()};r(E,()=>({closeDrawer:j}));const H=()=>{X.current?.clearTitle(),N&&N(),Y()},_=()=>{const e=X.current?.isTitleDirty();k||e?W(!0):H()},U=()=>{A(!0)},J=()=>{z&&z(X.current?.getTitle()||"")},K=P||[];return T&&!f&&K.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>T(!0),children:e(t,{children:[n(Ce,{}),n(v,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),I&&!f&&K.push({"data-id":"drawer-delete",variant:"tertiary",onClick:U,children:e(t,{children:[n(Te,{}),n(v,{color:O.text.error,size:14,family:"secondary",decoration:"underline",children:V?y.UNINSTRUMENT:y.DELETE})]})}),e(t,{children:[n(b,{isOpen:!0,onClose:f?_:j,closeOnEscape:!M&&!B,width:"number"==typeof a?`${a+64}px`:a,header:{icons:u,iconSrcs:h,title:s,titleTooltip:c,replaceTitleWith:!d&&f?n(Be,{ref:X,title:s}):void 0,actionButtons:K,tabs:F},footer:{isOpen:f,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:J,children:y.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:_,children:y.CANCEL}],rightButtons:I?[{"data-id":"drawer-delete",variant:"tertiary",onClick:U,children:e(t,{children:[n(Te,{}),n(v,{size:14,color:O.text.error,family:"secondary",decoration:"underline",children:y.DELETE})]})}]:[]},children:i}),n(x,{isOpen:M,noOverlay:!0,name:`${R}${s?` (${s})`:""}`,type:R,isLastItem:$,onApprove:()=>{I&&I(),Y()},onDeny:Y}),n(w,{isOpen:B,noOverlay:!0,name:"edit mode",onApprove:H,onDeny:Y})]})}),Be=i(({title:e},t)=>{const[i,l]=o(e);return a(()=>{l(e)},[e]),r(t,()=>({getTitle:()=>i||e,isTitleDirty:()=>i!==e,clearTitle:()=>l(e)})),n(k,{"data-id":"title",value:i,onChange:e=>l(e.target.value)})});function We(e,t){const n=e.names[t];if(null==n)return"";if("string"==typeof n)return n;if("object"==typeof n&&"name"in n){const e=n.name;if("string"==typeof e)return e}return"number"==typeof n||"boolean"==typeof n?String(n):""}function Xe(e){const t=Math.abs(e);return t>=1e9?`${Ve(e/1e9)}s`:t>=1e6?`${Ve(e/1e6)}ms`:t>=1e3?`${Ve(e/1e3)}μs`:String(Math.round(e))}function Ve(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Ye(e){const t=[];for(let n=0;n<e.levels.length;n++){const i=e.levels[n];let o=0;for(let e=0;e+3<i.length;e+=4){const l=i[e],r=i[e+1],a=i[e+2],s=i[e+3],c=o+l;t.push({level:n,offset:c,size:r,self:a,nameIndex:s}),o=c+r}}return t}function je(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function He(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function _e(e,t,n,i,o,l={}){if(0===e.levels.length||t<2||n<2)return null;const{zoomRoot:r=null,shouldKeepName:a,collapseRecursive:s=!1}=l,c=Ye(e);let d=r?function(e,t){const n=e.reduce((e,t)=>Math.max(e,t.level),t.level),i=new Map;for(const t of e){const e=i.get(t.level);e?e.push(t):i.set(t.level,[t])}const o=[t];for(let e=t.level+1;e<=n;e++){const t=o.filter(t=>t.level===e-1);if(0===t.length)break;const n=i.get(e);if(n?.length)for(const e of n)for(const n of t)if(e.offset>=n.offset&&e.offset+e.size<=n.offset+n.size){o.push(e);break}}return o}(c,r):c;if(0===d.length)return null;if(a&&(d=d.filter(t=>a(We(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const n=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),i=new Map;for(const e of n){const t=i.get(e.level);t?t.push(e):i.set(e.level,[e])}const o=new Set;for(const t of n){const n=i.get(t.level+1);if(!n)continue;const l=n.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==l.length)continue;const r=l[0];r.size===t.size&&We(e,r.nameIndex)===We(e,t.nameIndex)&&o.add(je(r))}if(0===o.size)return n;const l=[];for(const e of n){if(o.has(je(e)))continue;let t=0;for(let n=0;n<e.level;n++){const l=i.get(n);if(!l)continue;const r=l.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);r&&o.has(je(r))&&t++}l.push({...e,level:e.level-t})}return l}(e,d),0===d.length))return null;const u=r?.level??0,h=r?.offset??0,f=r?.size??e.numTicks;if(f<=0)return null;const m=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,p=i??Number.POSITIVE_INFINITY,g=Math.max(1,Math.min(n/m,p)),v=o.trim(),y=g>8?1:0;return d.map(n=>{const i=n.level-u,o=(n.offset-h)/f*t,l=Math.max(n.size/f*t,1),r=i*g,a=Math.max(g-y,1),s=We(e,n.nameIndex);return{...n,x:o,y:r,w:l,h:a,name:s,matchesSearch:He(s,v)}})}function Ue(e,t){let n=0;for(let t=0;t<e.length;t++)n=31*n+e.charCodeAt(t)>>>0;const i=t.v2.colors.black[500],o=[{fill:t.v2.colors.purple[300],text:i},{fill:t.v2.colors.green[300],text:i},{fill:t.v2.colors.red[300],text:i},{fill:t.v2.colors.blue[300],text:i},{fill:t.v2.colors.yellow[300],text:i}];return o[n%o.length]}Be.displayName=Be.name,Ae.displayName=Ae.name;var Je,Ke;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Je||(Je={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Ke||(Ke={}));function Ze(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ge(e,t,n){for(const i of n)if(e>=i.x&&e<i.x+i.w&&t>=i.y&&t<i.y+i.h)return i;return null}function qe(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Qe=({flamebearer:t,maxRowPx:i,searchQuery:r="",shouldKeepName:u,minHostHeight:h=200,onFullscreenChange:f,profilingSlots:p})=>{const g=m(),v=l(null),y=l(null),b=l({x:0,y:0}),x=l(t.numTicks),[w,S]=o({w:0,h:0}),[k,A]=o(""),[B,W]=o(null),[X,V]=o([]),[Y,j]=o(!1),[H,_]=o(Je.Fit),[U,J]=o(Ke.Fit),[K,Z]=o(!1),G=Math.max(1,Math.min(Math.floor(w.w*H),8192)),q=Math.max(1,Math.min(Math.floor(w.h*U),8192)),Q=X.length>0?X[X.length-1]:null,ee=Q?.size??t.numTicks;a(()=>{x.current!==t.numTicks&&(x.current=t.numTicks,V([]))},[t.numTicks]),s(()=>{const e=v.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();S({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),a(()=>{if(!Y)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[Y]),a(()=>(f?.(Y),()=>{Y&&f?.(!1)}),[Y,f]);const te=c(()=>_e(t,G,q,i,r,{zoomRoot:Q,shouldKeepName:u,collapseRecursive:K}),[t,i,r,q,G,Q,u,K]),ne=c(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(te?.length?r.trim()?te.filter(e=>e.matchesSearch):te:[]),[te,r]),ie=d(e=>{if(G<2||q<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=Ge((e.clientX-n.left)/n.width*G,(e.clientY-n.top)/n.height*q,ne);if(i){const e=je(i);W(e);const n=ee>0?(100*i.size/ee).toFixed(1):"0",o=t.numTicks>0?(100*i.size/t.numTicks).toFixed(1):"0";A(`${i.name}\ntotal ${Xe(i.size)} (${n}% of view, ${o}% of profile) · self ${Xe(i.self)}`)}else W(null),A("")},[ne,t.numTicks,q,G,ee]),oe=d(e=>{ie(e)},[ie]),le=d(()=>{W(null),A("")},[]),re=d(e=>{b.current={x:e.clientX,y:e.clientY}},[]),ae=d(e=>{const{x:t,y:n}=b.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(G<2||q<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=Ge((e.clientX-i.left)/i.width*G,(e.clientY-i.top)/i.height*q,ne);if(!o)return;const l=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(o);V(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(l,t)?e.slice(0,-1):[...e,l]})},[ne,q,G]);s(()=>{const e=y.current;if(!e||G<2||q<2)return;const n="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(G,q),o=Math.min(n,16384/i);e.width=Math.floor(G*o),e.height=Math.floor(q*o),e.style.width=`${G}px`,e.style.height=`${q}px`;const l=e.getContext("2d");l&&(l.setTransform(o,0,0,o,0,0),l.clearRect(0,0,G,q),te?.length?function(e,t,n,i,o,l,r,a){const s=l.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,n);const c=o.trim().length>0;e.textRendering="optimizeLegibility";for(const t of i){const{x:n,y:i,w:o,h:r,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:h,text:f}=Ue(s,l);e.fillStyle=h,e.fillRect(n,i,o,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(n+.5,i+.5),e.lineTo(n+o-.5,i+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(n+.5,i+.5,Math.max(o-1,0),Math.max(r-1,0));const m=Ze(d,a),p=`${s} (${Xe(d)}, ${m}%)`,g=l.v2.text.size.xs,v=8,y=5,b=26,x=Math.min(g,Math.floor(r-2));if(o>=b&&x>=v){e.font=`${x}px ${l.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=p;for(;t.length>2&&e.measureText(t).width>o-2*y;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=o-2*y&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,n+y,i+r/2),e.fillStyle=f,e.fillText(t,n+y,i+r/2))}}if(r)for(const t of i){if(je(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:n,y:i,w:o,h:l}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(n+1,i+1,Math.max(o-2,0),Math.max(l-2,0));break}}(l,G,q,te,r,g,B,t.numTicks):(l.fillStyle=g.v2.colors.silver[900],l.fillRect(0,0,G,q)))},[te,t.numTicks,B,r,q,G,g]);const se=d(()=>j(e=>!e),[]),ce=t.numTicks>0?Math.max(0,Math.min(100,Math.round(ee/t.numTicks*100))):100,de=c(()=>function(e,t){const n=Ye(e),i=t?.offset??0,o=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let a=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>o||e.size>=r||(!a||e.size>a.size||e.size===a.size&&e.level<a.level)&&(a=e);return a}(t,Q),[t,Q]),ue=null!==de,he=X.length>0,fe=Q?We(t,Q.nameIndex):"",me=d(()=>V([]),[]),pe=d(()=>V(e=>e.slice(0,-1)),[]),ge=d(()=>{de&&V(e=>[...e,de])},[de]);return e("div",{style:Y?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:g.v2.colors.silver[900]}:{flex:1,minHeight:h,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e($,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[n(C,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:z.Left,size:T.S,value:K,onChange:Z}),e($,{$gap:8,children:[e($,{children:[n(I,{variant:F.Secondary,size:N.S,label:"Reset zoom",leftIcon:ze,onClick:me,disabled:!X.length}),n(I,{variant:F.Secondary,size:N.S,iconSize:20,leftIcon:Ie,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!he,onClick:pe}),n("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:n(P,{size:O.XXS,color:E.Secondary,nowrap:!0,align:"center",children:`${ce}%`})}),n(I,{variant:F.Secondary,size:N.S,iconSize:20,leftIcon:Ne,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ue,onClick:ge})]}),e($,{children:[n(R,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:n(L,{size:M.S,variant:D.Filled,options:[{value:Je.Fit,label:"W: Fit"},{value:Je.X10,label:"10x"}],selected:H,setSelected:_})}),n(R,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:n(L,{size:M.S,variant:D.Filled,options:[{value:Ke.Fit,label:"H: Fit"},{value:Ke.X10,label:"10x"}],selected:U,setSelected:J})})]}),n(I,{variant:F.Secondary,size:N.S,iconSize:24,leftIcon:Y?Fe:Pe,tooltip:Y?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:se})]})]}),n(R,{fullWidth:!0,keepAlive:!0,text:k,children:n("div",{ref:v,style:{flex:1,minWidth:0,width:"100%",height:Y?"calc(100vh - 80px)":"calc(100vh - 370px)",position:"relative",overflowX:H>1?"auto":"hidden",overflowY:U>1?"auto":"hidden"},children:n("div",{style:{width:G||"100%",height:q||"100%",position:"relative"},children:n("canvas",{ref:y,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:B?"pointer":"default"},onPointerDown:re,onPointerMove:oe,onPointerLeave:le,onClick:ae})})})}),e($,{$justifyContent:"space-between",children:[n(P,Q?{size:O.XXXS,color:g.v2.colors.silver[300],children:`Zoomed: ${fe} • ${Xe(ee)} samples in view`}:{size:O.XXXS,color:g.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),p&&n(P,{size:O.XXXS,color:g.v2.colors.silver[300],children:`${p.activeKeys.length} / ${p.maxSlots} profiling slots · ${qe(p.totalBytesUsed)} / ${qe(p.maxTotalBytesBudget)} budget · TTL ${p.slotTtlSeconds}s`})]})]})};var et,tt;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(et||(et={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(tt||(tt={}));const nt=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function it(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(tt.FilterOutVoid)&&"void"===n)return!1;if(t.includes(tt.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&nt.test(n)))return!1}return!0}const ot={options:[{id:tt.FilterOutVoid,label:"Filter out void symbols"},{id:tt.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>it(e.cells.find(e=>e.key===et.Symbol)?.rawValue?.toString()??"",t)},lt=({rows:e,languages:t,filters:i,onFiltersChange:o})=>{const l=c(()=>[{key:et.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:t?.includes(A.Java)?ot:void 0,noFilter:!t?.includes(A.Java)},{key:et.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:et.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[t]),r=c(()=>e.map(e=>({cells:[{key:et.Symbol,rawValue:e.name},{key:et.Self,rawValue:Xe(e.self)},{key:et.Total,rawValue:Xe(e.total)}]})),[e]);return n(B,{variant:W.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:i,onFiltersChange:o,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Ee,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var rt;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(rt||(rt={}));const at=f(_)`
|
|
2
|
+
width: 100%;
|
|
3
|
+
min-height: 0;
|
|
4
|
+
flex: 1;
|
|
5
|
+
border-radius: 16px;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
8
|
+
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
9
|
+
`,st=f.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: 10px;
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
padding: 12px 12px 8px;
|
|
15
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
16
|
+
border-radius: 16px 16px 0 0;
|
|
17
|
+
`,ct=f($)`
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: 4px;
|
|
21
|
+
`,dt=f.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
flex: 1;
|
|
24
|
+
align-items: stretch;
|
|
25
|
+
gap: ${({$gap:e})=>e}px;
|
|
26
|
+
padding: 16px;
|
|
27
|
+
min-height: 0;
|
|
28
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
29
|
+
border-radius: 0 0 16px 16px;
|
|
30
|
+
`,ut=f(_)`
|
|
31
|
+
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
32
|
+
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
33
|
+
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
34
|
+
min-width: 0;
|
|
35
|
+
min-height: 0;
|
|
36
|
+
gap: 10px;
|
|
37
|
+
`,ht=f(_)`
|
|
38
|
+
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
39
|
+
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
40
|
+
min-width: 0;
|
|
41
|
+
min-height: 0;
|
|
42
|
+
gap: 10px;
|
|
43
|
+
`,ft=f($)`
|
|
44
|
+
width: 100%;
|
|
45
|
+
min-height: 32px;
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
`,mt=({source:t,fetchProfilingSlots:i,enableProfiling:r,fetchSourceProfiling:s,onFlameFullscreenChange:h})=>{const f=m(),p=c(()=>({namespace:t.namespace,kind:t.kind,name:t.name}),[t.namespace,t.kind,t.name]),[g,v]=o(!0),[y,b]=o(null),[x,w]=o(null),[S,k]=o(0),[B,W]=o(rt.Both),[_,U]=o(""),[J,K]=o({}),Z=l(null),G=d(async()=>{try{const e=[i()];g&&e.push(s(p));const[t,n]=await Promise.all(e);t&&b(t),n?.profileJson&&w(n.profileJson)}finally{k(e=>e+1)}},[i,s,p]);a(()=>{let e=!1;return(async()=>{await r(p),e||(await G(),e||(Z.current=setInterval(G,3e3)))})(),()=>{e=!0,Z.current&&clearInterval(Z.current)}},[r,G,p]);const q=c(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),n=t.flamebearer;return!n?.names?.length||!Array.isArray(n.levels)||"number"!=typeof n.numTicks||n.numTicks<=0?null:{flamebearer:n,units:t.metadata?.units}}catch{return null}}(x),[x]),Q=c(()=>q?function(e){const t=new Map;for(let n=0;n<e.levels.length;n++){const i=e.levels[n];for(let n=0;n+3<i.length;n+=4){const o=i[n+1],l=i[n+2],r=We(e,i[n+3]);if(!r)continue;const a=t.get(r);(!a||o>a.total)&&t.set(r,{self:l,total:o})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(q.flamebearer):[],[q]),ee=c(()=>{const e=_.trim().toLowerCase();return e?Q.filter(t=>t.name.toLowerCase().includes(e)):Q},[Q,_]),te=B===rt.Table||B===rt.Both,ne=B===rt.Flame||B===rt.Both,ie=te&&ne,oe=t.detectedLanguages||t.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),le=c(()=>function(e,t){if(!t?.includes(A.Java))return;const n=e?.[et.Symbol]?.filter(Boolean)??[];return 0!==n.length?e=>it(e,n):void 0}(J,oe),[J,oe]);return S<2?n(X,{$height:"70vh",children:n(V,{withSpinner:!0})}):e(at,{$gap:0,$width:"100%",children:[e(st,{children:[n(R,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:n(ct,{children:n(P,{size:O.S,weight:500,color:E.Primary,nowrap:!0,children:"CPU Profiling"})})}),e($,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[n("div",{style:{flex:"1 1 220px",minWidth:180},children:n(Y,{value:_,onChange:U,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:f.v2.colors.silver[900],emphasizeBackgroundColor:f.v2.colors.silver[800]})}),n(L,{size:M.S,variant:D.Filled,options:[{value:rt.Table,label:"Top table"},{value:rt.Flame,label:"Flame graph"},{value:rt.Both,label:"Both"}],selected:B,setSelected:W}),n(I,g?{variant:F.Secondary,size:N.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>n(Oe,{...e,size:8,fill:f.v2.colors.green[500]})}:{variant:F.Secondary,size:N.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>n(Oe,{...e,size:8,fill:f.v2.colors.red[500]})})]})]}),n(dt,{$gap:te&&ne?16:0,children:q?e(u,{children:[te&&e(ut,{$splitWithFlame:ie,children:[n(ft,{$justifyContent:"flex-end",children:n(I,{variant:F.Secondary,size:N.S,label:"Download snapshot",rightIcon:Re,onClick:()=>{if(!x)return;const e=new Blob([x],{type:"application/json"}),n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=`cpu-profile-${t.namespace}-${t.kind}-${t.name}.json`,i.click(),URL.revokeObjectURL(n)},disabled:!x})}),n(lt,{rows:ee,languages:oe,filters:J,onFiltersChange:K})]}),ne&&e(ht,{$splitWithTable:ie,children:[e(ft,{$justifyContent:"space-between",children:[n(H,{label:q?`Total in view ${Xe(q.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:f.v2.colors.silver[750],textColor:f.v2.colors.silver[200],textSize:O.XXS}),e($,{$gap:12,children:[!g&&n(I,{variant:F.Secondary,size:N.S,label:"Refresh",leftIcon:Le,onClick:G}),n(C,{label:"Auto refresh",labelAlign:z.Left,size:T.S,value:g,onChange:v})]})]}),n(Qe,{flamebearer:q.flamebearer,maxRowPx:24,searchQuery:_,shouldKeepName:le,minHostHeight:280,onFullscreenChange:h,profilingSlots:y},B)]})]}):n(X,{children:n(j,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},pt=(e,t)=>{const{name:n,kind:i,namespace:o}=e,l=[{title:U.KIND,value:i},{title:U.NAME,value:n,tooltip:"Resource name"}];return t||(l.unshift({title:U.NAMESPACE,value:o}),l.push({type:J.Divider}),l.push({type:J.CopyText,value:`kubectl get ${i} ${n} -n ${o}`.toLowerCase()})),l},gt=f.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: 24px;
|
|
51
|
+
padding: 4px;
|
|
52
|
+
`,vt=({formData:e,handleFormChange:t})=>n(gt,{children:n(k,{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}})=>t("otelServiceName",e)})}),yt=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const t=q(e?.status),i=K(e?.reasonEnum),o=e?.message;return n($,{$alignItems:"center",$justifyContent:"center",children:n(Z,{status:t,title:i,subtitle:o,withBackground:t!==G.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},bt=({source:t,fetchSourceDescribe:i,onClickRestartPod:l})=>{const[r,s]=o(!1),[c,d]=o(null);return a(()=>{t&&i({namespace:t.namespace,name:t.name,kind:t.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[t.namespace,t.name,t.kind]),c||r?n(_,{$gap:12,children:r?n(X,{$height:"70vh",children:n(ee,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:i,nodeName:o,phase:r,agentInjected:a,runningLatestWorkloadRevision:s,containers:d,manifestYAML:u})=>{const f=r.status!==te.Success||ne(d)?te.Error:te.Success,m=[];return m.push(n(ie,{value:`kubectl get pod ${i.value} -n ${c?.namespace?.value||t.namespace}`.toLowerCase()},"copy-text")),m.push(n(oe,{length:"100%",margin:"0"},"divider-1")),m.push(n(le,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-1")),m.push(n(oe,{length:"100%",margin:"0"},"divider-2")),m.push(n(le,{title:r.name,tooltip:r.explain||"",value:{status:r.status||void 0,text:r.value}},"describe-row-2")),m.push(n(oe,{length:"100%",margin:"0"},"divider-3")),m.push(n(le,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-3")),m.push(n(oe,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(n(le,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(n(oe,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(n(re,{...e},`pod-container-${e.containerName.value}`))}),u&&(m.push(n(oe,{length:"100%",margin:"0"},"divider-6")),m.push(n(Me,{yaml:u},"yaml-section-card"))),n(ae,{title:`Pod: ${i.value}`,withExtend:!0,action:({hovered:o})=>e("div",{style:{position:"relative"},children:[n(Z,{status:f,title:f,withIcon:!0,withBorder:!0},"status"),o&&n(se,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:l?[{id:ce(),label:"Restart",rightIcon:Le,onClick:()=>l(c?.namespace?.value||t.namespace,i.value)}]:[]},"hover-actions")]}),children:h.toArray(m)},`pod-${i.value}`)}):n(X,{$height:"70vh",children:n(ee,{subTitle:"Check if you have any running pods and try again"})})}):n(X,{$height:"70vh",children:n(Q,{})})},xt=f($)`
|
|
53
|
+
width: 100%;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
`,wt=({source:t,fetchSourceLibraries:i})=>{const l=m(),[r,s]=o(!1),[c,d]=o(null);return a(()=>{t&&i({namespace:t.namespace,name:t.name,kind:t.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?d(de(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[t.namespace,t.name,t.kind]),c||r?n(_,{$gap:12,children:r?n(X,{$height:"70vh",children:n(ee,{subTitle:"Could not fetch libraries for this source"})}):c?.length?n(ae,{title:"Instrumented Libraries",children:c.map(({name:t,healthy:i,message:o,nonIdentifyingAttributes:r},a)=>e(u,{children:[e(_,{$gap:4,$width:"100%",children:[e(xt,{$width:"100%",children:[n(v,{size:12,color:l.text.grey,children:t}),e($,{$gap:4,children:[r.map(({key:e,value:i})=>he(i)&&fe(i)&&"is_standard_lib"===e?n(Z,{status:te.Default,title:"STANDARD",withBorder:!0},`${t}-${e}`):null),"boolean"==typeof i&&n(Z,{status:i?te.Success:te.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),o&&n(v,{size:10,color:l.text.error,align:"right",children:o})]}),a!==c.length-1&&n(oe,{length:"100%",margin:"0"})]},`library-${t}`))}):e(X,{$height:"70vh",$gap:12,children:[n(ee,{title:"No libraries found",subTitle:""}),n(ue,{type:te.Warning,message:"This feature is in early development, and has very limited support"})]})}):n(X,{$height:"70vh",children:n(Q,{})})},St="70vh",kt=(e,t)=>e.serviceName.localeCompare(t.serviceName),$t=f(v)`
|
|
57
|
+
cursor: ${({$clickable:e})=>e?"pointer":"default"};
|
|
58
|
+
text-decoration: ${({$clickable:e})=>e?"underline":"none"};
|
|
59
|
+
&:hover {
|
|
60
|
+
opacity: ${({$clickable:e})=>e?.7:1};
|
|
61
|
+
}
|
|
62
|
+
`,Ct=f($)`
|
|
63
|
+
justify-content: flex-end;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: 6px;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
`,Tt=({items:i,emptyMessage:o,keyPrefix:l,findSource:r,onNavigate:a})=>{const s=m();return i.length?n(t,{children:i.map(({serviceName:t},o)=>{const c=!!r(t);return e(u,{children:[n($t,{size:13,color:c?s.text.secondary:s.text.grey,$clickable:c,onClick:()=>a(t),children:t}),o!==i.length-1&&n(oe,{length:"100%",margin:"0"})]},`${l}-${t}`)})}):n(v,{size:13,color:s.text.grey,children:o})},zt=({source:t,fetchPeerSources:i})=>{const l=m(),{setDrawerType:r,setDrawerEntityId:s}=p(),c=me(e=>e.sources),[u,h]=o(!1),[f,g]=o(!1),[y,b]=o(null),x=t.otelServiceName||t.name,w=d(()=>{x&&(g(!0),h(!1),i(x).then(({data:e})=>{e?.peerSources?b(e.peerSources):h(!0)}).finally(()=>g(!1)))},[x]);a(()=>{w()},[w]);const k=d(e=>c.find(t=>t.otelServiceName===e||t.name===e),[c]),$=d(e=>{const t=k(e);t&&(r(S.Source),s({namespace:t.namespace,name:t.name,kind:t.kind}))},[k,r,s]);if(!y&&!u&&f)return n(X,{$height:St,children:n(Q,{})});if(u)return n(X,{$height:St,children:n(ee,{subTitle:"Could not fetch peer sources"})});const C=y?.inbound?[...y.inbound].sort(kt):[],T=y?.outbound?[...y.outbound].sort(kt):[];return e(_,{$gap:12,children:[n(ae,{title:"Inbound",titleBadge:C.length,description:`Services that send requests to ${x}`,children:n(Tt,{items:C,emptyMessage:"No inbound connections",keyPrefix:"inbound",findSource:k,onNavigate:$})}),n(ae,{title:"Outbound",titleBadge:T.length,description:`Services that ${x} sends requests to`,children:n(Tt,{items:T,emptyMessage:"No outbound connections",keyPrefix:"outbound",findSource:k,onNavigate:$})}),e(Ct,{onClick:w,children:[n(Le,{size:14}),n(v,{size:12,color:l.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 Nt=[xe.Deployment,xe.StatefulSet,xe.DaemonSet,xe.DeploymentConfig,xe.Rollout,xe.StaticPod],Ft=[xe.Deployment,xe.StatefulSet,xe.DaemonSet,xe.DeploymentConfig,xe.Rollout,xe.Pod],Pt=[A.Python,A.Go,A.Java],Et=f.div`
|
|
68
|
+
width: 100%;
|
|
69
|
+
height: 100%;
|
|
70
|
+
max-height: calc(100vh - 220px);
|
|
71
|
+
overflow: overlay;
|
|
72
|
+
overflow-y: auto;
|
|
73
|
+
`,Ot=f.div`
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
gap: 12px;
|
|
77
|
+
`;var Rt;!function(e){e.Workload="Workload",e.Pod="Pod"}(Rt||(Rt={}));const Lt=({persistSources:i,updateSource:r,restartWorkloads:s,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:h,fetchPeerSources:f,restartPod:m,recoverFromRollback:g,profilingEnabled:y,fetchProfilingSlots:b,enableProfiling:x,fetchSourceProfiling:w})=>{const{isVm:k}=pe(),$=me(e=>e.sources),{selectedStreamName:C}=ge(),{drawerType:T,drawerEntityId:z}=p(),I=c(()=>ve($,C),[$,C]),N=l(null),F=T===S.Source,[P,E]=o(!1),[O,R]=o(!1),[L,D]=o(It.Overview),[M,A]=o(null),[B,W]=o(!1);a(()=>{F&&z&&d(z).then(e=>A(e||null))},[F,z]);const{formData:X,handleFormChange:V,resetFormData:Y,loadFormWithDrawerItem:j}=ye(),H=c(()=>{if(z)return M&&JSON.stringify(be(M))===JSON.stringify(be(z))?M:I?.find(e=>JSON.stringify(be(e))===JSON.stringify(be(z)))},[z,I,M]);a(()=>{F&&H?j(H):Y()},[F,H]);const _=c(()=>{const e=H?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===G.Loading,containers:H?.containers||[]}},[H]),J=c(()=>!!H?.rollbackOccurred,[H?.rollbackOccurred]),K=c(()=>{const e=[{label:It.Overview,onClick:()=>D(It.Overview),selected:L===It.Overview}];return k||(Nt.includes(H?.kind)&&e.push({label:It.Pods,onClick:()=>D(It.Pods),selected:L===It.Pods}),H?.containers?.some(e=>Pt.includes(e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language))&&e.push({label:It.Libraries,onClick:()=>D(It.Libraries),selected:L===It.Libraries}),e.push({label:It.PeerSources,onClick:()=>D(It.PeerSources),selected:L===It.PeerSources}),y&&b&&x&&w&&e.push({label:It.Profiling,onClick:()=>D(It.Profiling),selected:L===It.Profiling})),e},[L,H,k,y,b,x,w]),Z=Ft.includes(H?.kind),[q,Q]=o({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});if(!H)return null;return e(Ae,{ref:N,width:B?"95vw":L===It.Profiling?"80vw":void 0,onClose:()=>{D(It.Overview),A(null),W(!1)},title:H.otelServiceName||H.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:$e(H.containers),isEdit:P,isFormDirty:O,onEdit:L===It.Overview?e=>{E("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=X.otelServiceName!==H.name?X.otelServiceName:"";V("otelServiceName",e),await r(z,{...X,otelServiceName:e}),A(null),R(!1),E(!1)},onDelete:L===It.Overview?async()=>{const{namespace:e,name:t,kind:n}=H;i({[e]:[{namespace:e,name:t,kind:n||void 0,selected:!1,currentStreamName:C}]}),A(null),R(!1),E(!1),N.current?.closeDrawer()}:void 0,onCancel:()=>{R(!1),E(!1),V("otelServiceName",H.otelServiceName||H.name||"")},isLastItem:1===I.length,tabs:K,headerActionButtons:k?[]:Z?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>Q({openFor:Rt.Workload,workloadId:z}),children:e(t,{children:[n(De,{}),n(v,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[L===It.Overview?P?n(Et,{children:n(vt,{formData:X,handleFormChange:(...e)=>{R(!0),V(...e),V("currentStreamName",C)}})}):e(Ot,{children:[n(yt,{workloadOdigosHealthStatus:H.workloadOdigosHealthStatus}),J&&n(ue,{type:te.Warning,message:U.ROLLBACK_OCCURRED_MESSAGE,action:{label:U.ROLLBACK_RECOVER,onClick:async()=>{await g(z);const e=await d(z);e&&A(e)}}}),n(we,{conditions:H.conditions||[]}),n(ae,{title:U.SOURCE_DETAILS,data:H?pt(H,k):[]}),n(ae,{title:k?U.DETECTED_PROCESSES:U.DETECTED_CONTAINERS,titleBadge:_.isLoading?G.Loading:_.containers.length,description:_.description||(k?U.DETECTED_PROCESSES_DESCRIPTION:U.DETECTED_CONTAINERS_DESCRIPTION),children:_.containers.map(e=>n(Se,{...e,callbackRuntimeOverride:e=>r(z,e)},`source-container-${e.containerName}`))}),H.manifestYAML&&n(Me,{title:`${H.kind} YAML`,yaml:H.manifestYAML,defaultOpen:!H.instrumentationConfigYAML}),H.instrumentationConfigYAML&&n(Me,{title:"Instrumentation Config YAML",yaml:H.instrumentationConfigYAML,defaultOpen:!H.manifestYAML})]}):L===It.Pods?n(bt,{source:H,fetchSourceDescribe:u,onClickRestartPod:Z?(e,t)=>Q({openFor:Rt.Pod,podNamespace:e,podName:t}):void 0}):L===It.Libraries?n(wt,{source:H,fetchSourceLibraries:h}):L===It.PeerSources?n(zt,{source:H,fetchPeerSources:f}):L===It.Profiling&&y&&b&&x&&w?n(mt,{source:H,fetchProfilingSlots:b,enableProfiling:x,fetchSourceProfiling:w,onFlameFullscreenChange:W}):null,n(ke,{isOpen:!!q.openFor,title:`Rollout Restart ${q.openFor}`,description:`Are you sure you want to rollout restart this ${q.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:te.Warning,onClick:()=>{q.openFor===Rt.Workload&&q.workloadId?s([q.workloadId]):q.openFor===Rt.Pod&&q.podNamespace&&q.podName&&m(q.podNamespace,q.podName),Q({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{Q({openFor:null})}}})]})};export{Ae as O,Lt as S,vt as a};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import i from"styled-components";import{u as o,B as s,a,A as n,g as l,D as r,C as c,b as p,N as m}from"./ui-components-
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import i from"styled-components";import{u as o,B as s,a,A as n,g as l,D as r,C as c,b as p,N as m}from"./ui-components-of0mjGMv.js";import{VIcon as d,CopyIcon as u,YamlIcon as f}from"../icons.js";const h=i.div`
|
|
2
2
|
padding: 0 12px;
|
|
3
3
|
`,g=({title:i="YAML",yaml:g,defaultOpen:b,fullHeight:T,bgTint:y="1000"})=>{const{clickCopy:C,isCopied:x}=o(),A=e(()=>g?[{id:l(),type:n.Button,buttonProps:{variant:a.Text,size:s.S,leftIcon:x?d:u,onClick:()=>C(g||""),disabled:x}}]:[],[g,x]);return t(r,{bgTint:y,richTitle:{icon:f,title:i},actions:A,withCollapse:!0,collapseIsDefaultOpen:b,fullHeight:T,children:t(h,{children:g?t(c,{code:g,language:"yaml",theme:"duotoneDark"}):t(p,{children:t(m,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{g as Y};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import{aL as e,a,ao as t,j as l,l as r,ee as o,ag as s,b0 as i,as as n,al as d,b5 as c,an as p,ai as u,aj as h,a4 as g,ba as m,F as v,y as f,af as b,S as y,s as S,aW as x,ef as k,eg as C,k as w,eh as T,n as $,ei as P,o as L,p as A,ej as M,ek as O,el as N,em as z,en as X,eo as D,ep as R,eq as I,er as E,es as H,et as B,eu as V,ev as j,bQ as K,B as U,ew as q,ex as G,ey as J,ez as W,eA as F,eB as Q,eC as Z,eD as Y,eE as _,eF as ee,aQ as ae,eG as te,eH as le,aX as re,eI as oe,eJ as se,eK as ie,eL as ne,eM as de,bD as ce,eN as pe,eO as ue,eP as he,eQ as ge,eR as me,eS as ve,eT as fe,eU as be,eV as ye,cA as Se,m as xe,eW as ke,eX as Ce,eY as we,eZ as Te,e_ as $e,e$ as Pe,f0 as Le,f1 as Ae,f2 as Me,f3 as Oe,av as Ne,f4 as ze,R as Xe,f5 as De,f6 as Re,f7 as Ie,f8 as Ee,c8 as He,P as Be,aJ as Ve,$ as je,c2 as Ke,ah as Ue,f9 as qe,ce as Ge,b as Je,N as We,bk as Fe,L as Qe,cr as Ze,w as Ye}from"./ui-components-of0mjGMv.js";import{jsx as _e,jsxs as ea,Fragment as aa}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as ta,OdigosLogoTextCommunity as la,EditIcon as ra,ArrowLeftIcon as oa,ArrowRightIcon as sa,VSquareIcon as ia}from"../icons.js";import{useCallback as na,useMemo as da,useState as ca,useRef as pa,useEffect as ua,forwardRef as ha,useImperativeHandle as ga}from"react";import ma from"styled-components";import"./index-Cw4LkdaE.js";const va=({isOpen:t,onClose:l,onDeny:r,onApprove:o})=>_e(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:t,onClose:l,denyButton:{label:"Keep editing",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:"Discard changes",variant:a.Primary,onClick:()=>{o?.(),l()}}}),fa=({isOpen:t,onClose:l,onDeny:r,onApprove:o,action:s="delete",target:i})=>{const n=s.charAt(0).toUpperCase()+s.substring(1),d=i?.endsWith("s")?"these":"this";return _e(e,{title:`${n}${i?` ${i}`:""}?`,description:`Are you sure you want to ${s}${i?` ${d} ${i}`:""}?`,isOpen:t,onClose:l,denyButton:{label:"Go back",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:n,variant:a.Primary,onClick:()=>{o?.(),l()}}})},ba=({componentType:e,inputType:a,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x,setValue:k,errorMessage:C,warnMessage:w,helpMessage:T,dropdownOptions:$,dropdownNoSearch:P,dropdownNoCheckbox:L,timeUnits:A,timeDefaultUnit:M})=>{switch(e){case t.Input:return _e(u,{name:g,type:a,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x??"",onChange:e=>{const t=e.target.value;k(a===h.Number?""===t?null:Number(t):t)},errorMessage:C,warnMessage:w,helpMessage:T},g);case t.MultiInput:return _e(p,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,values:Array.isArray(x)?x:c(x,[]),setValues:e=>k(e),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.KeyValuePair:return _e(d,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:S,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(x)?x:c(x,[]),setValues:e=>k(e),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.TextArea:return _e(n,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:S,placeholder:b,value:x??"",onChange:e=>k(e.target.value),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Dropdown:return _e(i,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,withSearch:!P,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!L}))||[],values:x?[String(x)]:[],setValues:e=>k(e[0]),errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Checkbox:return _e(s,{name:g,label:m,tooltip:v,badge:f,value:!0===x||"true"===x,onChange:e=>k(e),disabled:S,errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Time:return _e(o,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:S,value:x??"",setValue:e=>k(e),units:A,defaultUnit:M,errorMessage:C,warnMessage:w,helpMessage:T},g);case t.Toggle:return _e(l,{name:g,labelAlign:r.Right,label:m,tooltip:v,badge:f,value:!0===x||"true"===x,onChange:e=>k(e),disabled:S,errorMessage:C,warnMessage:w,helpMessage:T},g);default:return null}},ya=({size:e=200})=>{const{tier:a}=g();return a===m.Onprem?_e(ta,{size:e}):_e(la,{size:e})},Sa=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],xa=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],ka=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],Ca=({description:e,options:a,selected:t,onSelect:l,customName:r,customLabel:o,customPlaceholder:s,customValue:i,onCustomChange:n})=>ea(v,{$gap:16,$alignItems:"flex-end",children:[ea(f,{$gap:6,children:[_e(b,{label:e}),_e(y,{size:S.S,options:a,selected:t,setSelected:l})]}),"custom"===t&&_e(u,{name:r,label:o,placeholder:s,type:h.Number,value:i,onChange:n,width:160})]}),wa=()=>{},Ta=e=>e.readOnly?_e($a,{rule:e.rule}):_e(Pa,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),$a=({rule:e})=>{const a=null!=e.durationAtLeastMs;return e.error?_e(x,{richTitle:{title:k},children:_e(l,{name:"sampling-view-toggle-keep-errors",onChange:wa,value:!0,size:w.S,label:C,labelAlign:r.Right})}):a?_e(x,{richTitle:{title:T},children:ea("div",{children:[_e($,{size:A.XXXS,color:L.Secondary,children:P}),_e($,{size:A.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},Pa=({ruleType:e,formState:a,onChange:t})=>{const o=na(e=>t({durationPreset:e}),[t]),s=na(e=>t({customDurationMs:e.target.value}),[t]);return"Error"===e?_e(x,{richTitle:{title:k,subTitle:M},children:_e(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:wa,size:w.S,label:C,labelAlign:r.Right})}):"Duration"===e?_e(x,{richTitle:{title:T,subTitle:O},children:_e(Ca,{description:P,options:ka,selected:a.durationPreset,onSelect:o,customName:"sampling-input-custom-duration",customLabel:N,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:s})}):null},La=ma.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 32px;
|
|
4
|
+
`,Aa=ma.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: 4px;
|
|
8
|
+
`,Ma=ma.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
align-items: flex-end;
|
|
12
|
+
gap: 16px;
|
|
13
|
+
`,Oa=ma.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: flex-end;
|
|
16
|
+
gap: 16px;
|
|
17
|
+
padding: 12px 16px;
|
|
18
|
+
border-radius: 8px;
|
|
19
|
+
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
20
|
+
`,Na=ma.div`
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: flex-end;
|
|
23
|
+
gap: 10px;
|
|
24
|
+
flex: 1;
|
|
25
|
+
`,za=ma.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
height: 32px;
|
|
29
|
+
`,Xa=ma.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: flex-end;
|
|
32
|
+
gap: 16px;
|
|
33
|
+
margin-bottom: 12px;
|
|
34
|
+
`,Da="Any",Ra="Kafka topic",Ia=()=>_e("div",{style:{marginBottom:"8px"},children:_e($,{size:A.XS,weight:500,children:"And"})}),Ea=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Ha=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Ba=[{id:"",label:Da},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const Va=e=>e.readOnly?_e(ja,{data:e.data}):_e(Ka,{category:e.category,formState:e.formState,onChange:e.onChange}),ja=({data:e})=>{const a=da(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:W,value:J},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Da}];if(a?.httpClient){const e=[{id:"type",title:W,value:Q}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:B,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||F}),e.push({id:"method",title:q,value:a.httpClient.method||Da}),e}return[{id:"type",title:W,value:Z}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:W,value:J},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Da}]:a?.kafkaConsumer?[{id:"type",title:W,value:Y},{id:"topic",title:Ra,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:W,value:_},{id:"topic",title:Ra,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:W,value:Z}]}(e),[e]);return _e(x,{richTitle:{title:z},children:_e(La,{children:a.map(({id:e,title:a,value:t})=>ea(Aa,{children:[_e($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),_e($,{size:A.XS,nowrap:!0,children:t})]},e))})})},Ka=({category:e,formState:t,onChange:l})=>{const r=da(()=>"noisy"===e?Ea:Ha,[e]),o=na(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=na(e=>a=>{a&&l({routeType:e,route:""})},[l]),i=na(e=>l({route:e.target.value}),[l]),n=na(e=>l({serverAddress:e.target.value}),[l]),d=na(e=>l({method:e[0]||""}),[l]),c=na(e=>l({kafkaTopic:e.target.value}),[l]),p="httpServer"===t.operationType||"httpClient"===t.operationType,h="kafkaConsumer"===t.operationType||"kafkaProducer"===t.operationType,g="httpClient"===t.operationType?H:B,m="httpClient"===t.operationType?V:j;return ea(x,{richTitle:{title:`2. ${z}`,subTitle:X},children:[_e(f,{$alignItems:"flex-start",children:_e(y,{size:S.S,options:r,selected:t.operationType,setSelected:o})}),p&&ea(Ma,{children:["httpClient"===t.operationType&&ea(Xa,{children:[_e(u,{name:"sampling-input-server-address",label:R,placeholder:D,value:t.serverAddress,onChange:n}),_e(Ia,{})]}),ea(Oa,{children:[ea(Na,{children:[_e(za,{children:_e(I,{"data-id":"sampling-radio-route",value:"route"===t.routeType,onChange:s("route")})}),_e(u,{name:"sampling-input-route",label:g,placeholder:E,value:"route"===t.routeType?t.route:"",onChange:i,disabled:"route"!==t.routeType})]}),ea(Na,{children:[_e(za,{children:_e(I,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===t.routeType,onChange:s("routePrefix")})}),_e(u,{name:"sampling-input-route-prefix",label:m,placeholder:E,value:"routePrefix"===t.routeType?t.route:"",onChange:i,disabled:"routePrefix"!==t.routeType})]})]}),ea(Xa,{children:[_e(Ia,{}),_e(K,{label:q,items:Ba,selectedIds:[t.method||""],setSelectedIds:e=>d(e),buttonProps:{"data-id":"sampling-btn-method",label:Ba.find(e=>e.id===t.method)?.label||Da,size:U.S,variant:a.Secondary}})]})]}),h&&_e(u,{name:"sampling-input-kafka-topic",label:G,placeholder:"Type kafka topic",value:t.kafkaTopic,onChange:c,width:"320px"})]})},Ua=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],qa=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Ga=e=>e.readOnly?_e(Ja,{data:e.data}):_e(Wa,{category:e.category,formState:e.formState,onChange:e.onChange}),Ja=({data:e})=>{const a=da(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:te,method:ie,description:oe,value:`${e.rule.percentageAtLeast}%`}:{title:te,method:de,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:le,method:ie,description:se,value:`${e.rule.percentageAtMost}%`}:{title:le,method:ne,description:null,value:null};case"costReduction":return{title:le,method:ie,description:se,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:q,value:a.method},...null!=a.description?[{id:"value",title:a.description,value:a.value}]:[]];return _e(x,{richTitle:{title:a.title},children:_e(La,{children:t.map(({id:e,title:a,value:t})=>ea(Aa,{children:[_e($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),_e($,{size:A.XS,nowrap:!0,children:t})]},e))})})},Wa=({category:e,formState:a,onChange:t})=>{const l="highlyRelevant"===e,r=l?qa:Ua,o=`${l?4:3}. ${l?te:le}`,s=l?ee:ae,i=l?oe:se,n="noisy"===e?xa:Sa,d=na(e=>t({percentageMode:e}),[t]),c=na(e=>t({percentagePreset:e}),[t]),p=na(e=>t({customPercentage:e.target.value}),[t]);return ea(x,{richTitle:{title:o,subTitle:s},children:["costReduction"!==e&&_e(f,{$alignItems:"flex-start",children:_e(y,{size:S.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&_e(Ca,{description:i,options:n,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:re,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:p})]})},Fa=ma.div`
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: flex-end;
|
|
37
|
+
gap: 16px;
|
|
38
|
+
`,Qa=ma.div`
|
|
39
|
+
width: 280px;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
`,Za=ma.div`
|
|
42
|
+
flex: 1;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
`;function Ya(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":fe[e.category]}const _a=e=>e.readOnly?_e(et,{data:e.data}):_e(at,{formState:e.formState,onChange:e.onChange}),et=({data:e})=>{const a=da(()=>[{id:"name",title:pe,value:e.rule.name||ce},{id:"type",title:ue,value:Ya(e)}],[e]),t=e.rule.notes||F;return ea(x,{children:[_e(La,{children:a.map(({id:e,title:a,value:t})=>ea(Aa,{children:[_e($,{size:A.XXXS,color:L.Secondary,nowrap:!0,children:a}),_e($,{size:A.XS,nowrap:!0,children:t})]},e))}),ea(Aa,{children:[_e($,{size:A.XXXS,color:L.Secondary,children:he}),_e($,{size:A.XS,children:t})]})]})},at=({formState:e,onChange:a})=>{const t=na(e=>a({name:e.target.value}),[a]),l=na(e=>a({notes:e.target.value}),[a]);return _e(x,{children:ea(Fa,{children:[_e(Qa,{children:_e(u,{name:"sampling-input-rule-name",label:pe,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:ge,value:e.name,onChange:t})}),_e(Za,{children:_e(u,{name:"sampling-input-note",label:he,tooltip:ve,placeholder:me,value:e.notes,onChange:l})})]})})},tt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],lt=({formState:e,onChange:a})=>{const t=na(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return _e(x,{richTitle:{title:`3. ${ue}`,subTitle:be},children:_e(f,{$alignItems:"flex-start",children:_e(y,{size:S.S,options:tt,selected:e.ruleType,setSelected:t})})})},rt=ma.div`
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: 24px;
|
|
48
|
+
padding: 8px 16px;
|
|
49
|
+
border-radius: 12px;
|
|
50
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
51
|
+
`,ot=ma.div`
|
|
52
|
+
flex: 1;
|
|
53
|
+
min-width: 0;
|
|
54
|
+
white-space: pre;
|
|
55
|
+
overflow-x: auto;
|
|
56
|
+
`,st=({title:e,summary:t,onEdit:l,renderAction:r})=>{const o=da(()=>{const a=[];return e&&(a.push({text:e,variant:ye.Default}),a.push({text:" - ",variant:ye.Default})),a.push(...t),a},[e,t]);return ea(rt,{children:[_e(ot,{children:_e(Se,{parts:o})}),r&&r(),l&&_e(xe,{"data-id":"sampling-btn-edit-auto-rule",label:ke,rightIcon:ra,variant:a.Text,size:U.S,onClick:l})]})},it=e=>{const a=da(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return Pe(Le(e.formState));case"highlyRelevant":return Te($e(e.formState));case"costReduction":return Ce(we(e.formState))}},[e]);if(e.readOnly)return _e(st,{title:Ae,summary:a,renderAction:e.renderAction});const t=1===a.length&&"default"===a[0].variant;return _e(st,{title:t?Me:Ae,summary:t?[]:a,renderAction:e.renderAction})},nt=ma.div`
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
gap: 8px;
|
|
60
|
+
`,dt=ma.div`
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 8px;
|
|
64
|
+
padding: 8px 12px;
|
|
65
|
+
border-radius: 8px;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
background: ${({theme:e,$selected:a})=>a?e.v2.colors.silver[700]:e.v2.colors.silver[900]};
|
|
68
|
+
border: 1px solid ${({theme:e,$selected:a})=>a?e.v2.colors.silver[500]:e.v2.colors.silver[800]};
|
|
69
|
+
|
|
70
|
+
&:hover {
|
|
71
|
+
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
72
|
+
}
|
|
73
|
+
`,ct=ma.div`
|
|
74
|
+
display: flex;
|
|
75
|
+
width: 32px;
|
|
76
|
+
height: 32px;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-items: center;
|
|
79
|
+
flex-shrink: 0;
|
|
80
|
+
`,pt=ma.div`
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
gap: 4px;
|
|
84
|
+
`,ut=ma.div`
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: 8px;
|
|
88
|
+
padding: 8px;
|
|
89
|
+
border-radius: 8px;
|
|
90
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
91
|
+
`,ht=ma.div`
|
|
92
|
+
display: flex;
|
|
93
|
+
width: 24px;
|
|
94
|
+
height: 24px;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
align-items: center;
|
|
97
|
+
flex-shrink: 0;
|
|
98
|
+
`,gt={[Be.JavaScript]:"Node.js",[Be.DotNet]:".NET",[Be.Php]:"PHP",[Be.Java]:"Java",[Be.Go]:"Go",[Be.Python]:"Python",[Be.Ruby]:"Ruby",[Be.Rust]:"Rust"},mt=[Be.Python,Be.Java,Be.JavaScript,Be.DotNet,Be.Php,Be.Ruby,Be.Go].map(e=>({id:e,label:gt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:Ve(e)})),vt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function ft(e){const a=gt[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const bt=e=>e.readOnly?_e(yt,{scopes:e.scopes}):_e(St,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),yt=({scopes:e})=>_e(x,{richTitle:{title:Oe},children:e.length?_e(pt,{children:e.map((e,a)=>((e,a)=>{if(e.workloadLanguage){const t=Ve(e.workloadLanguage);return ea(ut,{children:[t&&_e(ht,{children:_e(t,{size:18})}),_e($,{size:A.XS,color:L.Primary,children:ft(e.workloadLanguage)})]},a)}const t=[e.workloadNamespace,e.workloadKind,e.workloadName].filter(Boolean),l=t.length?t.join(" / "):"Unknown scope";return _e(ut,{children:_e($,{size:A.XS,color:L.Primary,children:l})},a)})(e,a))}):_e(Ne,{status:Xe.Default,message:ze,fullWidth:!0})}),St=({formState:e,onChange:a,sourceOptions:t=[],namespaceOptions:l=[]})=>{const[r,o]=ca("all"),i=e.sourceScopes.length>0,n=da(()=>vt.map(e=>({...e,disabled:"all"===e.value&&i})),[i]),d=da(()=>e.sourceScopes.filter(e=>"source"===e.scopeType).map(e=>{return a=e.workloadNamespace,t=e.workloadKind,l=e.workloadName,`${a}/${t}/${l}`;var a,t,l}),[e.sourceScopes]),c=da(()=>e.sourceScopes.filter(e=>"namespace"===e.scopeType).map(e=>e.workloadNamespace),[e.sourceScopes]),p=da(()=>new Set(e.sourceScopes.filter(e=>"language"===e.scopeType).map(e=>e.workloadLanguage)),[e.sourceScopes]),u=na(e=>{o(e)},[]),h=na(t=>{const l=e.sourceScopes.filter(e=>"source"!==e.scopeType),r=t.map(e=>function(e){const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}}(e)).filter(e=>null!==e).map(e=>({scopeType:"source",workloadName:e.name,workloadKind:e.kind,workloadNamespace:e.namespace,workloadLanguage:""}));a({sourceScopes:[...l,...r]})},[e.sourceScopes,a]),g=na(t=>{const l=e.sourceScopes.filter(e=>"namespace"!==e.scopeType),r=t.map(e=>({scopeType:"namespace",workloadName:"",workloadKind:"",workloadNamespace:e,workloadLanguage:""}));a({sourceScopes:[...l,...r]})},[e.sourceScopes,a]),m=na(t=>{if(e.sourceScopes.some(e=>"language"===e.scopeType&&e.workloadLanguage===t))a({sourceScopes:e.sourceScopes.filter(e=>!("language"===e.scopeType&&e.workloadLanguage===t))});else{const l={scopeType:"language",workloadName:"",workloadKind:"",workloadNamespace:"",workloadLanguage:t};a({sourceScopes:[...e.sourceScopes,l]})}},[e.sourceScopes,a]);return ea(x,{richTitle:{title:`1. ${Oe}`,subTitle:De},children:[_e(Ne,!i&&"all"===r?{status:Xe.Default,message:ze,fullWidth:!0,smallIcon:!0}:{status:Xe.Info,message:Re,fullWidth:!0,smallIcon:!0}),_e(f,{$alignItems:"flex-start",children:_e(y,{size:S.S,options:n,selected:r,setSelected:u})}),"source"===r&&_e(Ie,{multiple:!0,"data-id":"sampling-autocomplete-source",options:t,value:d,onSelect:h,placeholder:Ee}),"namespace"===r&&_e(Ie,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:l,value:c,onSelect:g,placeholder:"Search namespace"}),"language"===r&&_e(nt,{children:mt.map(({id:e,label:a,Icon:t})=>{const l=p.has(e);return ea(dt,{$selected:l,onClick:()=>m(e),children:[_e(s,{name:`sampling-scope-lang-${e}`,size:He.S,value:l,onChange:()=>m(e)}),_e(ct,{children:_e(t,{size:20})}),_e($,{size:A.XS,nowrap:!0,children:a})]},e)})})]})},xt=(e,a)=>!a?.length||!!a?.find(a=>a===e),kt=({title:e="Signals",required:a,errorMessage:t,allowedSignals:l,selectedSignals:r,setSelectedSignals:o,disabled:i})=>{const[n,d]=ca(1===r.length),c=pa(JSON.stringify(r));ua(()=>{const e=je(r);e.length||Ke.forEach(({id:a})=>{xt(a,l)&&e.push(a)});const a=JSON.stringify(e);c.current!==a&&(c.current=a,o(e),d(1===e.length))},[l,r]);return ea(f,{$gap:12,children:[_e(b,{label:e,required:a}),_e(v,{$gap:12,children:Ke.map(e=>{const a=xt(e.id,l),t=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?_e(s,{label:e.value,disabled:i||!a||n&&t,value:t,onChange:a=>((e,a)=>{const t=e,l=a?[...r,t]:r.filter(e=>e!==t);o(l),d(1===l.length)})(e.id,a)},e.id):null})}),_e(Ue,{errorMessage:t})]})},Ct=({minSupportedVersion:a,currentVersion:t})=>_e(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>_e(qe,{scale:2.4,icon:()=>_e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:_e("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${t}.`}),wt=ma.div`
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
justify-content: flex-end;
|
|
102
|
+
width: ${({$width:e})=>e};
|
|
103
|
+
gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
|
|
104
|
+
`,Tt=ma.div`
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
min-height: 24px;
|
|
108
|
+
padding: 12px;
|
|
109
|
+
border-radius: 16px 16px 0 0;
|
|
110
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
111
|
+
`,$t=ma.div`
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
gap: ${({$gap:e})=>e}px;
|
|
115
|
+
padding: 12px 12px 0 12px;
|
|
116
|
+
width: calc(100% - 24px);
|
|
117
|
+
height: ${({$heightOffset:e,$columnHasHeader:a})=>`calc(100vh - 180px - ${e}px ${a?"- 48px":""})`};
|
|
118
|
+
border-radius: ${({$columnHasHeader:e,$isLeft:a,$isRight:t})=>e?a?"0 0 0 16px":t?"0 16px 0 0":"0":a?"16px 0 0 16px":t?"0 16px 16px 0":"16px"};
|
|
119
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
120
|
+
overflow-y: auto;
|
|
121
|
+
overflow-x: hidden;
|
|
122
|
+
`,Pt=({isLeft:e,isRight:a,heightOffset:t=0,width:l,header:r,list:o})=>ea(wt,{$width:l,$columnHasHeader:!!r,children:[r&&_e(Tt,{children:r}),_e($t,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:t,$columnHasHeader:!!r,children:o.length?o.length>1?_e(Ge,{gap:8,elements:o}):_e(aa,{children:o[0]}):_e(Je,{$height:"100%",children:_e(We,{})})})]}),Lt="75vw",At=ma.div`
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
border-radius: 16px;
|
|
126
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
`,Mt=ma.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
gap: 12px;
|
|
131
|
+
padding: 16px 16px 0 16px;
|
|
132
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
133
|
+
position: sticky;
|
|
134
|
+
top: 0;
|
|
135
|
+
`,Ot=ma.div`
|
|
136
|
+
padding: 12px 12px 0 12px;
|
|
137
|
+
`,Nt=ma.div`
|
|
138
|
+
display: flex;
|
|
139
|
+
gap: 12px;
|
|
140
|
+
padding: 16px;
|
|
141
|
+
`,zt=ma.div`
|
|
142
|
+
padding: 5vh 10vw;
|
|
143
|
+
border-radius: 12px;
|
|
144
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
145
|
+
`,Xt=ha(({isOpen:t,withOverlay:l,disableAnimation:r,onClose:o,onBack:s,onNext:i,nextIsSkip:n,onSave:d,disableSave:c,connectionIds:p,header:u,subHeader:h,leftColumn:g,rightColumn:m,search:v,filters:f,errorMessage:b,isFormDirty:y,hideDirtyNote:S,isFetching:x,progress:k},C)=>{const[w,T]=ca(!1),[$,P]=ca(!1),[L,M]=ca(void 0);ga(C,()=>({clearErrors:()=>M(void 0)}));const O=$,N=na(()=>{y&&!w?T(!0):(T(!1),o?.())},[y,w,o]),z=c||$||"boolean"==typeof y&&!y,X=na(async()=>{P(!0);const e=await d();P(!1),e?.error?M(e.error):(p?.setValue([]),o?.())},[d,p,o]),D=!!v||!!p||!!f,R=!!h,I=(D?48:0)+(R?50:0),E=da(()=>x?{status:Xe.Info,message:"Fetching Data..."}:$&&!k?{status:Xe.Info,message:"Saving Changes..."}:L||b?{status:Xe.Error,message:L||b}:"boolean"==typeof y&&y&&!S?{status:Xe.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof y||y||S?void 0:{status:Xe.Success,message:"The values reflect the current configuration of the selected cluster."},[x,$,k,L,b,y,S]),H=da(()=>s?{label:"Back",leftIcon:oa,variant:a.Secondary,onClick:s}:{label:"Cancel",variant:a.Secondary,onClick:N,disabled:O},[s,N,O]),[B,V]=ca(!1),j=da(()=>i?n?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:sa,variant:a.Secondary,onClick:()=>V(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:sa,variant:a.Primary,onClick:i}:{"data-id":"wide-drawer-save",label:"Save",variant:a.Primary,onClick:X,disabled:z},[i,n,X,z]);return ea(Fe,{width:Lt,isOpen:t,disableAnimation:r,hideOverlay:!$&&!l,header:{...u,onClose:o?N:void 0,onCloseDisabled:O},footer:{note:E,actions:[H,j]},children:[$?_e(Je,{$height:"calc(100vh - 136px)",children:_e(zt,{children:_e(Qe,{titleSize:A.S,subTitleSize:A.XXXS,withGradient:!0,withSpinner:!0,...k})})}):ea(At,{children:[D&&ea(Mt,{children:[p&&_e(Ze,{icon:ia,title:"Selected Clusters",badge:{label:p.value.length}}),v&&_e(Ye,{width:"100%",...v}),f]}),R&&_e(Ot,{children:_e(Ze,{icon:h.icon,title:h.title,subTitle:h.description,badge:h.badge})}),ea(Nt,{children:[_e(Pt,{isLeft:!0,heightOffset:I,...g}),_e(Pt,{isRight:!0,heightOffset:I,...m})]})]}),_e(va,{isOpen:w,onClose:()=>T(!1),onApprove:N}),_e(e,{title:"Skip setup?",description:"Without completing setup, Odigos won't be able to collect and send your telemetry data. This may interrupt your data flow and limit the platform's ability to provide value.",isOpen:B,onClose:()=>V(!1),denyButton:{label:"Go Back",variant:a.Secondary,onClick:()=>V(!1)},approveButton:{label:"Skip",variant:a.Primary,onClick:()=>{i?.(),V(!1)}}})]})});Xt.displayName=Xt.name;export{st as A,va as C,ba as D,xa as N,Va as O,Ca as P,_a as R,kt as S,Ct as U,Xt as W,Sa as a,it as b,bt as c,lt as d,Ta as e,Ga as f,fa as g,Lt as h,ya as i,ka as j};
|