@odigos/ui-kit 0.0.237 → 0.0.239
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/lib/chunks/{index-DB_UqHYt.js → index-B5PgIL40.js} +1 -1
- package/lib/chunks/index-Dy4pkeq6.js +145 -0
- package/lib/chunks/index-uXyrp4Xe.js +41 -0
- package/lib/chunks/ui-components-BPdnIOmj.js +2248 -0
- package/lib/components/_v2/cards/data-card/index.d.ts +6 -1
- package/lib/components/_v2/drawer/header/index.d.ts +2 -0
- package/lib/components/_v2/drawer/index.d.ts +1 -1
- package/lib/components/_v2/drop-data/index.d.ts +1 -2
- package/lib/components/_v2/icon-group/index.d.ts +10 -0
- package/lib/components/_v2/index.d.ts +1 -0
- package/lib/components/_v2/tag/index.d.ts +10 -0
- package/lib/components/_v2/typography/index.d.ts +2 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/sampling/index.d.ts +5 -6
- package/lib/constants/sources/index.d.ts +5 -0
- package/lib/constants/strings/index.d.ts +89 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/edit-source-drawer/common/index.d.ts +1 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/common/pods-header.d.ts +8 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/helpers.d.ts +12 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/index.d.ts +19 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/distro-override.d.ts +11 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/index.d.ts +7 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/popup-form.d.ts +15 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/runtime-override.d.ts +10 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/health-card.d.ts +6 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/index.d.ts +10 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/main-card.d.ts +6 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/index.d.ts +6 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/container-row.d.ts +9 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/helpers.d.ts +16 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/index.d.ts +12 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/pod-row.d.ts +8 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/process-row.d.ts +10 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/row-header.d.ts +13 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/types.d.ts +18 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/statuses-card.d.ts +8 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/peers/index.d.ts +11 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/containers-card/index.d.ts +7 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/containers-card/process-card.d.ts +3 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/debug-commands.d.ts +6 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/index.d.ts +7 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/pod-card.d.ts +8 -0
- package/lib/containers/_v2/_drawers/index.d.ts +1 -0
- package/lib/containers/_v2/_forms/edit-source-form/index.d.ts +2 -0
- package/lib/containers/_v2/_forms/index.d.ts +1 -0
- package/lib/containers/_v2/_modals/index.d.ts +1 -0
- package/lib/containers/_v2/_modals/onboarding-done/background.d.ts +5 -0
- package/lib/containers/_v2/_modals/onboarding-done/index.d.ts +3 -0
- package/lib/containers/_v2/overview/drawers/index.d.ts +1 -3
- package/lib/containers/_v2/sampling-rules/converters.d.ts +2 -0
- package/lib/containers/source-drawer/index.d.ts +1 -1
- package/lib/containers/v2.js +226 -121
- package/lib/containers.js +49 -19
- package/lib/contexts/action-form-context.d.ts +0 -1
- package/lib/contexts/destination-form-context.d.ts +0 -1
- package/lib/contexts/index.d.ts +1 -0
- package/lib/contexts/rule-form-context.d.ts +0 -1
- package/lib/contexts/source-edit-form-context.d.ts +17 -0
- package/lib/contexts.js +1 -1
- package/lib/functions/decimals-only/index.d.ts +1 -0
- package/lib/functions/get-containers-icons/index.d.ts +3 -1
- package/lib/functions/get-virtual-service-icon/index.d.ts +1 -1
- package/lib/functions/get-workload-id/index.d.ts +2 -2
- package/lib/functions/index.d.ts +3 -0
- package/lib/functions/is-pod-injected-with-agent/index.d.ts +3 -0
- package/lib/functions/map-desired-status-to-condition-status/index.d.ts +2 -0
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons/brand/index.d.ts +3 -0
- package/lib/icons/brand/odigos-logo-text-colored-central/index.d.ts +2 -0
- package/lib/icons/brand/odigos-logo-text-colored-community/index.d.ts +2 -0
- package/lib/icons/brand/odigos-logo-text-colored-enterprise/index.d.ts +2 -0
- package/lib/icons.js +1 -1
- package/lib/mock-data/profiling/index.d.ts +1 -1
- package/lib/mock-data/service-map/index.d.ts +1 -1
- package/lib/mock-data/sources/index.d.ts +1 -1
- package/lib/snippets/_v2/odigos-logo-text-by-tier/index.d.ts +2 -0
- package/lib/snippets/_v2/rich-title/index.d.ts +5 -0
- package/lib/snippets/_v2/sampling-rule-form-sections/percentage.d.ts +1 -1
- package/lib/snippets/_v2/sampling-rule-form-sections/preset-with-custom-input.d.ts +5 -2
- package/lib/snippets/_v2/wide-drawer/index.d.ts +7 -1
- package/lib/snippets/source-container/index.d.ts +1 -2
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +30 -1
- package/lib/types/service-map/index.d.ts +2 -2
- package/lib/types/sources/index.d.ts +7 -3
- package/lib/types/workload/index.d.ts +178 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-92vqd713.js +0 -145
- package/lib/chunks/index-zOzusnDO.js +0 -77
- package/lib/chunks/ui-components-CjDRcQJq.js +0 -2235
- /package/lib/containers/{source-drawer → _v2/_drawers/edit-source-drawer}/profiling/flame-graph-canvas.d.ts +0 -0
- /package/lib/containers/{source-drawer → _v2/_drawers/edit-source-drawer}/profiling/flamebearer.d.ts +0 -0
- /package/lib/containers/{source-drawer → _v2/_drawers/edit-source-drawer}/profiling/index.d.ts +0 -0
- /package/lib/containers/{source-drawer → _v2/_drawers/edit-source-drawer}/profiling/symbol-table.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.239](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.238...ui-kit-v0.0.239) (2026-05-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **onboarding:** add onboarding completion modal ([#919](https://github.com/odigos-io/ui-kit/issues/919)) ([91400d2](https://github.com/odigos-io/ui-kit/commit/91400d22c8be07ae49b7506a5c1079baf03c7f15))
|
|
9
|
+
* **PLAT-718:** source drawer redesign ([#889](https://github.com/odigos-io/ui-kit/issues/889)) ([fac1c06](https://github.com/odigos-io/ui-kit/commit/fac1c0645574312f46b81f84948674800c4778d2))
|
|
10
|
+
* update product logos ([#917](https://github.com/odigos-io/ui-kit/issues/917)) ([b698829](https://github.com/odigos-io/ui-kit/commit/b698829fba1438e908a933c39eee5b7571aaed91))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **drawers:** drop redundant footer validation note and clear field errors on change ([#918](https://github.com/odigos-io/ui-kit/issues/918)) ([c50fed5](https://github.com/odigos-io/ui-kit/commit/c50fed516fa780f3354057aadcb8ca199c05d377))
|
|
16
|
+
|
|
17
|
+
## [0.0.238](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.237...ui-kit-v0.0.238) (2026-05-20)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* prevent sampling onboarding modal flicker ([#911](https://github.com/odigos-io/ui-kit/issues/911)) ([446636a](https://github.com/odigos-io/ui-kit/commit/446636aebccd54d22cd75d95c23a1588afc19366))
|
|
23
|
+
* **sampling:** default source scope tab + validate custom percentage (PLAT-1091) ([#912](https://github.com/odigos-io/ui-kit/issues/912)) ([9e32917](https://github.com/odigos-io/ui-kit/commit/9e32917bc95c1fff404996c094ee73d6c88ee1b8))
|
|
24
|
+
|
|
3
25
|
## [0.0.237](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.236...ui-kit-v0.0.237) (2026-05-19)
|
|
4
26
|
|
|
5
27
|
|
|
@@ -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-BPdnIOmj.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{a$ as e,a,aE as t,T as l,d as r,eN as i,aw as s,bh as n,aI as o,aB as d,bm as c,aD as u,ay as p,az as h,ak as g,br as m,F as v,q as f,av as b,S as y,l as x,bb as S,eO as C,eP as k,c as w,eQ as T,f as $,eR as P,h as M,i as A,eS as O,eT as L,eU as z,eV as D,eW as I,eX as X,eY as R,d9 as N,eZ as E,e_ as H,e$ as B,f0 as V,f1 as q,cl as j,B as U,f2 as G,f3 as J,f4 as W,f5 as K,f6 as F,f7 as Z,f8 as Y,f9 as Q,fa as _,fb as ee,fc as ae,bc as te,fd as le,fe as re,ff as ie,fg as se,fh as ne,fi as oe,c9 as de,fj as ce,fk as ue,fl as pe,fm as he,fn as ge,fo as me,fp as ve,fq as fe,fr as be,cr as ye,e as xe,fs as Se,ft as Ce,fu as ke,fv as we,fw as Te,fx as $e,fy as Pe,fz as Me,fA as Ae,fB as Oe,fC as Le,aL as ze,fD as De,E as Ie,fE as Xe,fF as Re,fG as Ne,fH as Ee,fI as He,dW as Be,aZ as Ve,P as qe,ag as je,dR as Ue,ax as Ge,fJ as Je,bT as We,b as Ke,N as Fe,$ as Ze,L as Ye,e8 as Qe,o as _e}from"./ui-components-BPdnIOmj.js";import{jsx as ea,jsxs as aa,Fragment as ta}from"react/jsx-runtime";import{OdigosLogoTextCentral as la,OdigosLogoTextEnterprise as ra,OdigosLogoTextCommunity as ia,OdigosLogoTextColoredCentral as sa,OdigosLogoTextColoredEnterprise as na,OdigosLogoTextColoredCommunity as oa,EditIcon as da,ArrowLeftIcon as ca,ArrowRightIcon as ua,VSquareIcon as pa}from"../icons.js";import{useCallback as ha,useMemo as ga,useState as ma,useRef as va,useEffect as fa,forwardRef as ba,useImperativeHandle as ya}from"react";import xa from"styled-components";import"./index-B5PgIL40.js";const Sa=({isOpen:t,onClose:l,onDeny:r,onApprove:i})=>ea(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:()=>{i?.(),l()}}}),Ca=({isOpen:t,onClose:l,onDeny:r,onApprove:i,action:s="delete",target:n})=>{const o=s.charAt(0).toUpperCase()+s.substring(1),d=n?.endsWith("s")?"these":"this";return ea(e,{title:`${o}${n?` ${n}`:""}?`,description:`Are you sure you want to ${s}${n?` ${d} ${n}`:""}?`,isOpen:t,onClose:l,denyButton:{label:"Go back",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:o,variant:a.Primary,onClick:()=>{i?.(),l()}}})},ka=({componentType:e,inputType:a,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S,setValue:C,errorMessage:k,warnMessage:w,helpMessage:T,dropdownOptions:$,dropdownNoSearch:P,dropdownNoCheckbox:M,timeUnits:A,timeDefaultUnit:O})=>{switch(e){case t.Input:return ea(p,{name:g,type:a,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",onChange:e=>{const t=e.target.value;C(a===h.Number?""===t?null:Number(t):t)},errorMessage:k,warnMessage:w,helpMessage:T},g);case t.MultiInput:return ea(u,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,values:Array.isArray(S)?S:c(S,[]),setValues:e=>C(e),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.KeyValuePair:return ea(d,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(S)?S:c(S,[]),setValues:e=>C(e),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.TextArea:return ea(o,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,placeholder:b,value:S??"",onChange:e=>C(e.target.value),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Dropdown:return ea(n,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,withSearch:!P,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!M}))||[],values:S?[String(S)]:[],setValues:e=>C(e[0]),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Checkbox:return ea(s,{name:g,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>C(e),disabled:x,errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Time:return ea(i,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",setValue:e=>C(e),units:A,defaultUnit:O,errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Toggle:return ea(l,{name:g,labelAlign:r.Right,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>C(e),disabled:x,errorMessage:k,warnMessage:w,helpMessage:T},g);default:return null}},wa=({size:e=200,central:a=!1,useInline:t=!1})=>{const{tier:l}=g();if(t){if(a)return ea(la,{size:e});switch(l){case m.Community:return ea(ia,{size:e});case m.Onprem:return ea(ra,{size:e});default:return null}}if(a)return ea(sa,{size:e});switch(l){case m.Community:return ea(oa,{size:e});case m.Onprem:return ea(na,{size:e});default:return null}},Ta=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],$a=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],Pa=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],Ma=({description:e,options:a,selected:t,onSelect:l,customName:r,customLabel:i,customPlaceholder:s,customValue:n,onCustomChange:o,customInputType:d=h.Number,customMin:c,customMax:u})=>aa(v,{$gap:16,$alignItems:"flex-end",children:[aa(f,{$gap:6,children:[ea(b,{label:e}),ea(y,{size:x.S,options:a,selected:t,setSelected:l})]}),"custom"===t&&ea(p,{name:r,label:i,placeholder:s,type:d,value:n,onChange:o,width:160,min:c,max:u})]}),Aa=()=>{},Oa=e=>e.readOnly?ea(La,{rule:e.rule}):ea(za,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),La=({rule:e})=>{const a=null!=e.durationAtLeastMs;return e.error?ea(S,{richTitle:{title:C},children:ea(l,{name:"sampling-view-toggle-keep-errors",onChange:Aa,value:!0,size:w.S,label:k,labelAlign:r.Right})}):a?ea(S,{richTitle:{title:T},children:aa("div",{children:[ea($,{size:A.XXXS,color:M.Secondary,children:P}),ea($,{size:A.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},za=({ruleType:e,formState:a,onChange:t})=>{const i=ha(e=>t({durationPreset:e}),[t]),s=ha(e=>t({customDurationMs:e.target.value}),[t]);return"Error"===e?ea(S,{richTitle:{title:C,subTitle:O},children:ea(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:Aa,size:w.S,label:k,labelAlign:r.Right})}):"Duration"===e?ea(S,{richTitle:{title:T,subTitle:L},children:ea(Ma,{description:P,options:Pa,selected:a.durationPreset,onSelect:i,customName:"sampling-input-custom-duration",customLabel:z,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:s})}):null},Da=xa.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 32px;
|
|
4
|
+
`,Ia=xa.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: 4px;
|
|
8
|
+
`,Xa=xa.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
align-items: flex-end;
|
|
12
|
+
gap: 16px;
|
|
13
|
+
`,Ra=xa.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=xa.div`
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: flex-end;
|
|
23
|
+
gap: 10px;
|
|
24
|
+
flex: 1;
|
|
25
|
+
`,Ea=xa.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
height: 32px;
|
|
29
|
+
`,Ha=xa.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: flex-end;
|
|
32
|
+
gap: 16px;
|
|
33
|
+
margin-bottom: 12px;
|
|
34
|
+
`,Ba="Any",Va="Kafka topic",qa=()=>ea("div",{style:{marginBottom:"8px"},children:ea($,{size:A.XS,weight:500,children:"And"})}),ja=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Ua=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Ga=[{id:"",label:Ba},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const Ja=e=>e.readOnly?ea(Wa,{data:e.data}):ea(Ka,{category:e.category,formState:e.formState,onChange:e.onChange}),Wa=({data:e})=>{const a=ga(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:K,value:W},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:G,value:a.httpServer.method||Ba}];if(a?.httpClient){const e=[{id:"type",title:K,value:Z}];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:G,value:a.httpClient.method||Ba}),e}return[{id:"type",title:K,value:Y}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:K,value:W},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:G,value:a.httpServer.method||Ba}]:a?.kafkaConsumer?[{id:"type",title:K,value:Q},{id:"topic",title:Va,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:K,value:_},{id:"topic",title:Va,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:K,value:Y}]}(e),[e]);return ea(S,{richTitle:{title:D},children:ea(Da,{children:a.map(({id:e,title:a,value:t})=>aa(Ia,{children:[ea($,{size:A.XXXS,color:M.Secondary,nowrap:!0,children:a}),ea($,{size:A.XS,nowrap:!0,children:t})]},e))})})},Ka=({category:e,formState:t,onChange:l})=>{const r=ga(()=>"noisy"===e?ja:Ua,[e]),i=ha(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=ha(e=>a=>{a&&l({routeType:e,route:""})},[l]),n=ha(e=>l({route:e.target.value}),[l]),o=ha(e=>l({serverAddress:e.target.value}),[l]),d=ha(e=>l({method:e[0]||""}),[l]),c=ha(e=>l({kafkaTopic:e.target.value}),[l]),u="httpServer"===t.operationType||"httpClient"===t.operationType,h="kafkaConsumer"===t.operationType||"kafkaProducer"===t.operationType,g="httpClient"===t.operationType?H:B,m="httpClient"===t.operationType?V:q;return aa(S,{richTitle:{title:`2. ${D}`,subTitle:I},children:[ea(f,{$alignItems:"flex-start",children:ea(y,{size:x.S,options:r,selected:t.operationType,setSelected:i})}),u&&aa(Xa,{children:["httpClient"===t.operationType&&aa(Ha,{children:[ea(p,{name:"sampling-input-server-address",label:R,placeholder:X,value:t.serverAddress,onChange:o}),ea(qa,{})]}),aa(Ra,{children:[aa(Na,{children:[ea(Ea,{children:ea(N,{"data-id":"sampling-radio-route",value:"route"===t.routeType,onChange:s("route")})}),ea(p,{name:"sampling-input-route",label:g,placeholder:E,value:"route"===t.routeType?t.route:"",onChange:n,disabled:"route"!==t.routeType})]}),aa(Na,{children:[ea(Ea,{children:ea(N,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===t.routeType,onChange:s("routePrefix")})}),ea(p,{name:"sampling-input-route-prefix",label:m,placeholder:E,value:"routePrefix"===t.routeType?t.route:"",onChange:n,disabled:"routePrefix"!==t.routeType})]})]}),aa(Ha,{children:[ea(qa,{}),ea(j,{label:G,items:Ga,selectedIds:[t.method||""],setSelectedIds:e=>d(e),buttonProps:{"data-id":"sampling-btn-method",label:Ga.find(e=>e.id===t.method)?.label||Ba,size:U.S,variant:a.Secondary}})]})]}),h&&ea(p,{name:"sampling-input-kafka-topic",label:J,placeholder:"Type kafka topic",value:t.kafkaTopic,onChange:c,width:"320px"})]})},Fa=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Za=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Ya=e=>e.readOnly?ea(Qa,{data:e.data}):ea(_a,{category:e.category,formState:e.formState,onChange:e.onChange}),Qa=({data:e})=>{const a=ga(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:ae,method:ie,description:le,value:`${e.rule.percentageAtLeast}%`}:{title:ae,method:oe,description:null,value:null};case"noisy":return se(e.rule.percentageAtMost)?{title:ae,method:ne,description:null,value:null}:{title:ae,method:ie,description:re,value:`${e.rule.percentageAtMost}%`};case"costReduction":return{title:ae,method:ie,description:re,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:G,value:a.method},...null!=a.description?[{id:"value",title:a.description,value:a.value}]:[]];return ea(S,{richTitle:{title:a.title},children:ea(Da,{children:t.map(({id:e,title:a,value:t})=>aa(Ia,{children:[ea($,{size:A.XXXS,color:M.Secondary,nowrap:!0,children:a}),ea($,{size:A.XS,nowrap:!0,children:t})]},e))})})},_a=({category:e,formState:a,onChange:t})=>{const l="highlyRelevant"===e,r=l?Za:Fa,i=`${l?4:3}. ${ae}`,s=ee[e],n=l?le:re,o="noisy"===e?$a:Ta,d=ha(e=>t({percentageMode:e}),[t]),c=ha(e=>t({percentagePreset:e}),[t]),u=ha(e=>t({customPercentage:e.target.value}),[t]);return aa(S,{richTitle:{title:i,subTitle:s},children:["costReduction"!==e&&ea(f,{$alignItems:"flex-start",children:ea(y,{size:x.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&ea(Ma,{description:n,options:o,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:te,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:u,customInputType:h.Decimal,customMin:0,customMax:100})]})},et=xa.div`
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: flex-end;
|
|
37
|
+
gap: 16px;
|
|
38
|
+
`,at=xa.div`
|
|
39
|
+
width: 280px;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
`,tt=xa.div`
|
|
42
|
+
flex: 1;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
`;function lt(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":ve[e.category]}const rt=e=>e.readOnly?ea(it,{data:e.data}):ea(st,{formState:e.formState,onChange:e.onChange}),it=({data:e})=>{const a=ga(()=>[{id:"name",title:ce,value:e.rule.name||de},{id:"type",title:ue,value:lt(e)}],[e]),t=e.rule.notes||F;return aa(S,{children:[ea(Da,{children:a.map(({id:e,title:a,value:t})=>aa(Ia,{children:[ea($,{size:A.XXXS,color:M.Secondary,nowrap:!0,children:a}),ea($,{size:A.XS,nowrap:!0,children:t})]},e))}),aa(Ia,{children:[ea($,{size:A.XXXS,color:M.Secondary,children:pe}),ea($,{size:A.XS,children:t})]})]})},st=({formState:e,onChange:a})=>{const t=ha(e=>a({name:e.target.value}),[a]),l=ha(e=>a({notes:e.target.value}),[a]);return ea(S,{children:aa(et,{children:[ea(at,{children:ea(p,{name:"sampling-input-rule-name",label:ce,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:he,value:e.name,onChange:t})}),ea(tt,{children:ea(p,{name:"sampling-input-note",label:pe,tooltip:me,placeholder:ge,value:e.notes,onChange:l})})]})})},nt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],ot=({formState:e,onChange:a})=>{const t=ha(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return ea(S,{richTitle:{title:`3. ${ue}`,subTitle:fe},children:ea(f,{$alignItems:"flex-start",children:ea(y,{size:x.S,options:nt,selected:e.ruleType,setSelected:t})})})},dt=xa.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
|
+
`,ct=xa.div`
|
|
52
|
+
flex: 1;
|
|
53
|
+
min-width: 0;
|
|
54
|
+
white-space: pre;
|
|
55
|
+
overflow-x: auto;
|
|
56
|
+
`,ut=({title:e,summary:t,onEdit:l,renderAction:r})=>{const i=ga(()=>{const a=[];return e&&(a.push({text:e,variant:be.Default}),a.push({text:" - ",variant:be.Default})),a.push(...t),a},[e,t]);return aa(dt,{children:[ea(ct,{children:ea(ye,{parts:i})}),r&&r(),l&&ea(xe,{"data-id":"sampling-btn-edit-auto-rule",label:Se,rightIcon:da,variant:a.Text,size:U.S,onClick:l})]})},pt=e=>{const a=ga(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return we(Ae(e.formState));case"highlyRelevant":return ke(Me(e.formState));case"costReduction":return Ce(Pe(e.formState))}},[e]);if(e.readOnly)return ea(ut,{title:Te,summary:a,renderAction:e.renderAction});const t=1===a.length&&"default"===a[0].variant;return ea(ut,{title:t?$e:Te,summary:t?[]:a,renderAction:e.renderAction})},ht=xa.div`
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
gap: 8px;
|
|
60
|
+
`,gt=xa.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
|
+
`,mt=xa.div`
|
|
74
|
+
display: flex;
|
|
75
|
+
width: 32px;
|
|
76
|
+
height: 32px;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-items: center;
|
|
79
|
+
flex-shrink: 0;
|
|
80
|
+
`,vt=xa.div`
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
gap: 4px;
|
|
84
|
+
`,ft=xa.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
|
+
`,bt=xa.div`
|
|
92
|
+
display: flex;
|
|
93
|
+
width: 24px;
|
|
94
|
+
height: 24px;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
align-items: center;
|
|
97
|
+
flex-shrink: 0;
|
|
98
|
+
`,yt={[qe.JavaScript]:"Node.js",[qe.DotNet]:".NET",[qe.Php]:"PHP",[qe.Java]:"Java",[qe.Go]:"Go",[qe.Python]:"Python",[qe.Ruby]:"Ruby",[qe.Rust]:"Rust"},xt=[qe.Python,qe.Java,qe.JavaScript,qe.DotNet,qe.Php,qe.Ruby,qe.Go].map(e=>({id:e,label:yt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:Ve(e)})),St=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function Ct(e){const a=yt[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const kt=e=>e.readOnly?ea(wt,{scopes:e.scopes}):ea(Tt,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),wt=({scopes:e})=>{if(Oe(e))return ea(S,{richTitle:{title:Le},children:ea(ze,{status:Ie.Default,message:De,fullWidth:!0})});const a=e.sources??[],t=e.namespaces??[],l=e.languages??[];return ea(S,{richTitle:{title:Le},children:aa(vt,{children:[a.map((e,a)=>{const t=[e.namespace,e.kind,e.name].filter(Boolean),l=t.length?t.join(" / "):Xe;return ea(ft,{children:ea($,{size:A.XS,color:M.Primary,children:l})},`src-${a}`)}),t.map((e,a)=>ea(ft,{children:ea($,{size:A.XS,color:M.Primary,children:e})},`ns-${a}`)),l.map((e,a)=>{const t=Ve(e);return aa(ft,{children:[t&&ea(bt,{children:ea(t,{size:18})}),ea($,{size:A.XS,color:M.Primary,children:Ct(e)})]},`lang-${a}`)})]})})},Tt=({formState:e,onChange:a,sourceOptions:t=[],namespaceOptions:l=[]})=>{const[r,i]=ma(()=>{return(a=e.sourceScopes).sources.length>0?"source":a.namespaces.length>0?"namespace":a.languages.length>0?"language":"all";var a}),{sources:n,namespaces:o,languages:d}=e.sourceScopes,c=n.length>0||o.length>0||d.length>0,u=ga(()=>St.map(e=>({...e,disabled:"all"===e.value&&c})),[c]),p=ga(()=>n.map(e=>{return a=e.namespace,t=e.kind,l=e.name,`${a}/${t}/${l}`;var a,t,l}),[n]),h=ga(()=>[...o],[o]),g=ga(()=>new Set(d),[d]),m=ha(e=>{i(e)},[]),v=ha(t=>{const l=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=>({namespace:e.namespace,kind:e.kind,name:e.name}));a({sourceScopes:{...e.sourceScopes,sources:l}})},[e.sourceScopes,a]),b=ha(t=>{a({sourceScopes:{...e.sourceScopes,namespaces:t}})},[e.sourceScopes,a]),C=ha(t=>{const l=e.sourceScopes.languages,r=l.includes(t)?l.filter(e=>e!==t):[...l,t];a({sourceScopes:{...e.sourceScopes,languages:r}})},[e.sourceScopes,a]);return aa(S,{richTitle:{title:`1. ${Le}`,subTitle:Re},children:[ea(ze,!c&&"all"===r?{status:Ie.Default,message:De,fullWidth:!0,smallIcon:!0}:{status:Ie.Info,message:Ne,fullWidth:!0,smallIcon:!0}),ea(f,{$alignItems:"flex-start",children:ea(y,{size:x.S,options:u,selected:r,setSelected:m})}),"source"===r&&ea(Ee,{multiple:!0,"data-id":"sampling-autocomplete-source",options:t,value:p,onSelect:v,placeholder:He}),"namespace"===r&&ea(Ee,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:l,value:h,onSelect:b,placeholder:"Search namespace"}),"language"===r&&ea(ht,{children:xt.map(({id:e,label:a,Icon:t})=>{const l=g.has(e);return aa(gt,{$selected:l,onClick:()=>C(e),children:[ea(s,{name:`sampling-scope-lang-${e}`,size:Be.S,value:l,onChange:()=>C(e)}),ea(mt,{children:ea(t,{size:20})}),ea($,{size:A.XS,nowrap:!0,children:a})]},e)})})]})},$t=(e,a)=>!a?.length||!!a?.find(a=>a===e),Pt=({title:e="Signals",required:a,errorMessage:t,allowedSignals:l,selectedSignals:r,setSelectedSignals:i,disabled:n})=>{const[o,d]=ma(1===r.length),c=va(JSON.stringify(r));fa(()=>{let e=je(r).filter(e=>$t(e,l));e.length||(e=Ue.filter(({id:e})=>$t(e,l)).map(({id:e})=>e));const a=JSON.stringify(e);c.current!==a&&(c.current=a,i(e),d(1===e.length))},[l,r]);return aa(f,{$gap:12,children:[ea(b,{label:e,required:a}),ea(v,{$gap:12,children:Ue.map(e=>{const a=$t(e.id,l),t=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?ea(s,{label:e.value,disabled:n||!a||o&&t,value:t,onChange:a=>((e,a)=>{const t=e,l=a?[...r,t]:r.filter(e=>e!==t);i(l),d(1===l.length)})(e.id,a)},e.id):null})}),ea(Ge,{errorMessage:t})]})},Mt=({minSupportedVersion:a,currentVersion:t})=>ea(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>ea(Je,{scale:2.4,icon:()=>ea("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:ea("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}.`}),At=xa.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
|
+
`,Ot=xa.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
|
+
`,Lt=xa.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
|
+
`,zt=({isLeft:e,isRight:a,heightOffset:t=0,width:l,header:r,list:i})=>aa(At,{$width:l,$columnHasHeader:!!r,children:[r&&ea(Ot,{children:r}),ea(Lt,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:t,$columnHasHeader:!!r,children:i.length?i.length>1?ea(We,{gap:8,elements:i}):ea(ta,{children:i[0]}):ea(Ke,{$height:"100%",children:ea(Fe,{})})})]}),Dt="75vw",It=xa.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
|
+
`,Xt=xa.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
|
+
`,Rt=xa.div`
|
|
136
|
+
padding: 12px 12px 0 12px;
|
|
137
|
+
`,Nt=xa.div`
|
|
138
|
+
display: flex;
|
|
139
|
+
gap: 12px;
|
|
140
|
+
padding: 16px;
|
|
141
|
+
`,Et=xa.div`
|
|
142
|
+
padding: 5vh 10vw;
|
|
143
|
+
border-radius: 12px;
|
|
144
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
145
|
+
`,Ht=ba(({isOpen:t,withOverlay:l,disableAnimation:r,onClose:i,onBack:s,onNext:n,nextIsSkip:o,onSave:d,disableSave:c,connectionIds:u,header:p,subHeader:h,leftColumn:g,rightColumn:m,search:v,filters:f,errorMessage:b,isFormDirty:y,hideDirtyNote:x,isFetching:S,progress:C},k)=>{const[w,T]=ma(!1),[$,P]=ma(!1),[M,O]=ma(void 0);ya(k,()=>({clearErrors:()=>O(void 0)}));const L=$,z=ha(()=>{y&&!w?T(!0):(T(!1),i?.())},[y,w,i]),D=c||$||"boolean"==typeof y&&!y,I=ha(async()=>{P(!0);const e=await d();P(!1),!1!==e&&(e?.error?O(e.error):(u?.setValue([]),i?.()))},[d,u,i]),X=!!v||!!u||!!f,R=!!h,N=(X?48:0)+(R?50:0),E=ga(()=>S?{status:Ie.Info,message:"Fetching Data..."}:$&&!C?{status:Ie.Info,message:"Saving Changes..."}:M||b?{status:Ie.Error,message:M||b}:"boolean"==typeof y&&y&&!x?{status:Ie.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||x?void 0:{status:Ie.Success,message:"The values reflect the current configuration of the selected cluster."},[S,$,C,M,b,y,x]),H=ga(()=>s?{label:"Back",leftIcon:ca,variant:a.Secondary,onClick:s}:{label:"Cancel",variant:a.Secondary,onClick:z,disabled:L},[s,z,L]),[B,V]=ma(!1),q=ga(()=>n?o?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:ua,variant:a.Secondary,onClick:()=>V(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:ua,variant:a.Primary,onClick:n}:{"data-id":"wide-drawer-save",label:"Save",variant:a.Primary,onClick:I,disabled:D},[n,o,I,D]);return aa(Ze,{width:Dt,isOpen:t,disableAnimation:r,hideOverlay:!$&&!l,header:{...p,onClose:i?z:void 0,onCloseDisabled:L},footer:{note:E,actions:[H,q]},children:[$?ea(Ke,{$height:"calc(100vh - 136px)",children:ea(Et,{children:ea(Ye,{titleSize:A.S,subTitleSize:A.XXXS,withGradient:!0,withSpinner:!0,...C})})}):aa(It,{children:[X&&aa(Xt,{children:[u&&ea(Qe,{icon:pa,title:"Selected Clusters",badge:{label:u.value.length}}),v&&ea(_e,{width:"100%",...v}),f]}),R&&ea(Rt,{children:ea(Qe,{icon:h.icon,title:h.title,subTitle:h.description,badge:h.badge})}),aa(Nt,{children:[ea(zt,{isLeft:!0,heightOffset:N,...g}),ea(zt,{isRight:!0,heightOffset:N,...m})]})]}),ea(Sa,{isOpen:w,onClose:()=>T(!1),onApprove:z}),ea(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:()=>{n?.(),V(!1)}}})]})});Ht.displayName=Ht.name;export{ut as A,Sa as C,ka as D,$a as N,Ja as O,Ma as P,rt as R,Pt as S,Mt as U,Ht as W,Ta as a,pt as b,kt as c,ot as d,Oa as e,Ya as f,Ca as g,wa as h,Dt as i,Pa as j};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as l,useState as n,useEffect as i,useLayoutEffect as o,useMemo as r,useCallback as s,Fragment as a}from"react";import c,{useTheme as f}from"styled-components";import{F as u,T as h,c as d,d as m,e as p,B as g,a as v,f as x,h as b,i as y,j as w,S,k,l as $,P as z,m as T,n as F,b as C,L as I,o as M,N as R,p as X,q as B}from"./ui-components-BPdnIOmj.js";import{SearchIcon as P,MinusIcon as W,PlusIcon as L,XIcon as O,ExpandIcon as A,CopyIcon as V,DotIcon as j,DownloadIcon as N,RefreshIcon as H}from"../icons.js";function U(e,t){const l=e.names[t];if(null==l)return"";if("string"==typeof l)return l;if("object"==typeof l&&"name"in l){const e=l.name;if("string"==typeof e)return e}return"number"==typeof l||"boolean"==typeof l?String(l):""}function J(e){const t=Math.abs(e);return t>=1e9?`${D(e/1e9)}s`:t>=1e6?`${D(e/1e6)}ms`:t>=1e3?`${D(e/1e3)}μs`:String(Math.round(e))}function D(e){return e.toFixed(2).replace(/\.?0+$/,"")}function K(e){const t=[];for(let l=0;l<e.levels.length;l++){const n=e.levels[l];let i=0;for(let e=0;e+3<n.length;e+=4){const o=n[e],r=n[e+1],s=n[e+2],a=n[e+3],c=i+o;t.push({level:l,offset:c,size:r,self:s,nameIndex:a}),i=c+r}}return t}function Y(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Z(e,t){const l=t.trim().toLowerCase();return!l||e.toLowerCase().includes(l)}function E(e,t,l,n,i,o={}){if(0===e.levels.length||t<2||l<2)return null;const{zoomRoot:r=null,shouldKeepName:s,collapseRecursive:a=!1}=o,c=K(e);let f=r?function(e,t){const l=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=l;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const l=n.get(e);if(l?.length)for(const e of l)for(const l of t)if(e.offset>=l.offset&&e.offset+e.size<=l.offset+l.size){i.push(e);break}}return i}(c,r):c;if(0===f.length)return null;if(s&&(f=f.filter(t=>s(U(e,t.nameIndex))),0===f.length))return null;if(a&&(f=function(e,t){if(0===t.length)return t;const l=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of l){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const i=new Set;for(const t of l){const l=n.get(t.level+1);if(!l)continue;const o=l.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==o.length)continue;const r=o[0];r.size===t.size&&U(e,r.nameIndex)===U(e,t.nameIndex)&&i.add(Y(r))}if(0===i.size)return l;const o=[];for(const e of l){if(i.has(Y(e)))continue;let t=0;for(let l=0;l<e.level;l++){const o=n.get(l);if(!o)continue;const r=o.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);r&&i.has(Y(r))&&t++}o.push({...e,level:e.level-t})}return o}(e,f),0===f.length))return null;const u=r?.level??0,h=r?.offset??0,d=r?.size??e.numTicks;if(d<=0)return null;const m=f.reduce((e,t)=>Math.max(e,t.level-u),0)+1,p=n??Number.POSITIVE_INFINITY,g=Math.max(1,Math.min(l/m,p)),v=i.trim(),x=g>8?1:0;return f.map(l=>{const n=l.level-u,i=(l.offset-h)/d*t,o=Math.max(l.size/d*t,1),r=n*g,s=Math.max(g-x,1),a=U(e,l.nameIndex);return{...l,x:i,y:r,w:o,h:s,name:a,matchesSearch:Z(a,v)}})}function _(e,t){let l=0;for(let t=0;t<e.length;t++)l=31*l+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return i[l%i.length]}var q,Q;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(q||(q={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Q||(Q={}));function G(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ee(e,t,l){for(const n of l)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function te(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 le=({flamebearer:a,maxRowPx:c,searchQuery:z="",shouldKeepName:T,minHostHeight:F=200,onFullscreenChange:C,profilingSlots:I})=>{const M=f(),R=l(null),X=l(null),B=l({x:0,y:0}),V=l(a.numTicks),[j,N]=n({w:0,h:0}),[H,D]=n(""),[Z,le]=n(null),[ne,ie]=n([]),[oe,re]=n(!1),[se,ae]=n(q.Fit),[ce,fe]=n(Q.Fit),[ue,he]=n(!1),de=Math.max(1,Math.min(Math.floor(j.w*se),8192)),me=Math.max(1,Math.min(Math.floor(j.h*ce),8192)),pe=ne.length>0?ne[ne.length-1]:null,ge=pe?.size??a.numTicks;i(()=>{V.current!==a.numTicks&&(V.current=a.numTicks,ie([]))},[a.numTicks]),o(()=>{const e=R.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();N({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),i(()=>{if(!oe)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[oe]),i(()=>(C?.(oe),()=>{oe&&C?.(!1)}),[oe,C]);const ve=r(()=>E(a,de,me,c,z,{zoomRoot:pe,shouldKeepName:T,collapseRecursive:ue}),[a,c,z,me,de,pe,T,ue]),xe=r(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(ve?.length?z.trim()?ve.filter(e=>e.matchesSearch):ve:[]),[ve,z]),be=s(e=>{if(de<2||me<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const l=ee((e.clientX-t.left)/t.width*de,(e.clientY-t.top)/t.height*me,xe);if(l){const e=Y(l);le(e);const t=ge>0?(100*l.size/ge).toFixed(1):"0",n=a.numTicks>0?(100*l.size/a.numTicks).toFixed(1):"0";D(`${l.name}\ntotal ${J(l.size)} (${t}% of view, ${n}% of profile) · self ${J(l.self)}`)}else le(null),D("")},[xe,a.numTicks,me,de,ge]),ye=s(e=>{be(e)},[be]),we=s(()=>{le(null),D("")},[]),Se=s(e=>{B.current={x:e.clientX,y:e.clientY}},[]),ke=s(e=>{const{x:t,y:l}=B.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-l)>3)return;if(de<2||me<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=ee((e.clientX-n.left)/n.width*de,(e.clientY-n.top)/n.height*me,xe);if(!i)return;const o=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(i);ie(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}(o,t)?e.slice(0,-1):[...e,o]})},[xe,me,de]);o(()=>{const e=X.current;if(!e||de<2||me<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,l=Math.max(de,me),n=Math.min(t,16384/l);e.width=Math.floor(de*n),e.height=Math.floor(me*n),e.style.width=`${de}px`,e.style.height=`${me}px`;const i=e.getContext("2d");i&&(i.setTransform(n,0,0,n,0,0),i.clearRect(0,0,de,me),ve?.length?function(e,t,l,n,i,o,r,s){const a=o.v2.colors.silver[900];e.fillStyle=a,e.fillRect(0,0,t,l);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:l,y:n,w:i,h:r,name:a,size:f,matchesSearch:u}=t;if(c&&!u)continue;const{fill:h,text:d}=_(a,o);e.fillStyle=h,e.fillRect(l,n,i,r),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(l+.5,n+.5),e.lineTo(l+i-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(l+.5,n+.5,Math.max(i-1,0),Math.max(r-1,0));const m=G(f,s),p=`${a} (${J(f)}, ${m}%)`,g=o.v2.text.size.xs,v=8,x=5,b=26,y=Math.min(g,Math.floor(r-2));if(i>=b&&y>=v){e.font=`${y}px ${o.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>i-2*x;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*x&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,l+x,n+r/2),e.fillStyle=d,e.fillText(t,l+x,n+r/2))}}if(r)for(const t of n){if(Y(t)!==r)continue;if(c&&!t.matchesSearch)continue;const{x:l,y:n,w:i,h:o}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(l+1,n+1,Math.max(i-2,0),Math.max(o-2,0));break}}(i,de,me,ve,z,M,Z,a.numTicks):(i.fillStyle=M.v2.colors.silver[900],i.fillRect(0,0,de,me)))},[ve,a.numTicks,Z,z,me,de,M]);const $e=s(()=>re(e=>!e),[]),ze=a.numTicks>0?Math.max(0,Math.min(100,Math.round(ge/a.numTicks*100))):100,Te=r(()=>function(e,t){const l=K(e),n=t?.offset??0,i=n+(t?.size??e.numTicks),o=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of l)e.level<o||e.offset<n||e.offset+e.size>i||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(a,pe),[a,pe]),Fe=null!==Te,Ce=ne.length>0,Ie=pe?U(a,pe.nameIndex):"",Me=s(()=>ie([]),[]),Re=s(()=>ie(e=>e.slice(0,-1)),[]),Xe=s(()=>{Te&&ie(e=>[...e,Te])},[Te]);return e("div",{style:oe?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:M.v2.colors.silver[900]}:{flex:1,minHeight:F,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(u,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(h,{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:m.Left,size:d.S,value:ue,onChange:he}),e(u,{$gap:8,children:[e(u,{children:[t(p,{variant:v.Secondary,size:g.S,label:"Reset zoom",leftIcon:P,onClick:Me,disabled:!ne.length}),t(p,{variant:v.Secondary,size:g.S,iconSize:20,leftIcon:W,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!Ce,onClick:Re}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(x,{size:y.XXS,color:b.Secondary,nowrap:!0,align:"center",children:`${ze}%`})}),t(p,{variant:v.Secondary,size:g.S,iconSize:20,leftIcon:L,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!Fe,onClick:Xe})]}),e(u,{children:[t(w,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(S,{size:$.S,variant:k.Filled,options:[{value:q.Fit,label:"W: Fit"},{value:q.X10,label:"10x"}],selected:se,setSelected:ae})}),t(w,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(S,{size:$.S,variant:k.Filled,options:[{value:Q.Fit,label:"H: Fit"},{value:Q.X10,label:"10x"}],selected:ce,setSelected:fe})})]}),t(p,{variant:v.Secondary,size:g.S,iconSize:24,leftIcon:oe?O:A,tooltip:oe?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:$e})]})]}),t(w,{fullWidth:!0,keepAlive:!0,text:H,children:t("div",{ref:R,style:{flex:1,minWidth:0,width:"100%",height:oe?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:se>1?"auto":"hidden",overflowY:ce>1?"auto":"hidden"},children:t("div",{style:{width:de||"100%",height:me||"100%",position:"relative"},children:t("canvas",{ref:X,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:Z?"pointer":"default"},onPointerDown:Se,onPointerMove:ye,onPointerLeave:we,onClick:ke})})})}),e(u,{$justifyContent:"space-between",children:[t(x,pe?{size:y.XXXS,color:M.v2.colors.silver[300],children:`Zoomed: ${Ie} • ${J(ge)} samples in view`}:{size:y.XXXS,color:M.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),I&&t(x,{size:y.XXXS,color:M.v2.colors.silver[300],children:`${I.activeKeys.length} / ${I.maxSlots} profiling slots · ${te(I.totalBytesUsed)} / ${te(I.maxTotalBytesBudget)} budget · TTL ${I.slotTtlSeconds}s`})]})]})};var ne,ie;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(ne||(ne={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(ie||(ie={}));const oe=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function re(e,t){const l=function(e){return e.split(" ")[0]??""}(e);if(t.includes(ie.FilterOutVoid)&&"void"===l)return!1;if(t.includes(ie.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==l&&oe.test(l)))return!1}return!0}const se={options:[{id:ie.FilterOutVoid,label:"Filter out void symbols"},{id:ie.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>re(e.cells.find(e=>e.key===ne.Symbol)?.rawValue?.toString()??"",t)},ae=({rows:e,languages:l,filters:n,onFiltersChange:i})=>{const o=r(()=>[{key:ne.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:l?.includes(z.Java)?se:void 0,noFilter:!l?.includes(z.Java)},{key:ne.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:ne.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[l]),s=r(()=>e.map(e=>({cells:[{key:ne.Symbol,rawValue:e.name},{key:ne.Self,rawValue:J(e.self)},{key:ne.Total,rawValue:J(e.total)}]})),[e]);return t(T,{variant:F.Data,maxHeight:"calc(100vh - 306px)",columns:o,rows:s,filters:n,onFiltersChange:i,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:V,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var ce;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(ce||(ce={}));const fe=c(B)`
|
|
2
|
+
width: 100%;
|
|
3
|
+
flex: 1;
|
|
4
|
+
border-radius: 16px;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
7
|
+
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
8
|
+
`,ue=c.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 10px;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
padding: 12px 12px 8px;
|
|
14
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
15
|
+
border-radius: 16px 16px 0 0;
|
|
16
|
+
`,he=c(u)`
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 4px;
|
|
20
|
+
`,de=c.div`
|
|
21
|
+
flex: 1;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: stretch;
|
|
24
|
+
gap: ${({$gap:e})=>e}px;
|
|
25
|
+
padding: 16px;
|
|
26
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
27
|
+
border-radius: 0 0 16px 16px;
|
|
28
|
+
`,me=c(B)`
|
|
29
|
+
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
30
|
+
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
31
|
+
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
32
|
+
gap: 10px;
|
|
33
|
+
`,pe=c(B)`
|
|
34
|
+
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
35
|
+
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
36
|
+
gap: 10px;
|
|
37
|
+
`,ge=c(u)`
|
|
38
|
+
width: 100%;
|
|
39
|
+
min-height: 32px;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
`,ve=({source:o,fetchProfilingSlots:c,enableProfiling:T,fetchSourceProfiling:F,onFlameFullscreenChange:B})=>{const P=f(),W=r(()=>({namespace:o.namespace,kind:o.kind,name:o.name}),[o.namespace,o.kind,o.name]),[L,O]=n(!0),[A,V]=n(null),[D,K]=n(null),[Y,Z]=n(0),[E,_]=n(ce.Both),[q,Q]=n(""),[G,ee]=n({}),te=l(null),ie=s(async()=>{try{const e=[c()];L&&e.push(F(W));const[t,l]=await Promise.all(e);t&&V(t),l?.profileJson&&K(l.profileJson)}finally{Z(e=>e+1)}},[c,F,W]);i(()=>{let e=!1;return(async()=>{await T(W),e||(await ie(),e||(te.current=setInterval(ie,3e3)))})(),()=>{e=!0,te.current&&clearInterval(te.current)}},[T,ie,W]);const oe=r(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),l=t.flamebearer;return!l?.names?.length||!Array.isArray(l.levels)||"number"!=typeof l.numTicks||l.numTicks<=0?null:{flamebearer:l,units:t.metadata?.units}}catch{return null}}(D),[D]),se=r(()=>oe?function(e){const t=new Map;for(let l=0;l<e.levels.length;l++){const n=e.levels[l];for(let l=0;l+3<n.length;l+=4){const i=n[l+1],o=n[l+2],r=U(e,n[l+3]);if(!r)continue;const s=t.get(r);(!s||i>s.total)&&t.set(r,{self:o,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(oe.flamebearer):[],[oe]),ve=r(()=>{const e=q.trim().toLowerCase();return e?se.filter(t=>t.name.toLowerCase().includes(e)):se},[se,q]),xe=E===ce.Table||E===ce.Both,be=E===ce.Flame||E===ce.Both,ye=xe&&be,we=o.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),Se=r(()=>function(e,t){if(!t?.includes(z.Java))return;const l=e?.[ne.Symbol]?.filter(Boolean)??[];return 0!==l.length?e=>re(e,l):void 0}(G,we),[G,we]);return!D&&Y<2?t(C,{$height:"70vh",children:t(I,{withSpinner:!0})}):e(fe,{$gap:0,$width:"100%",children:[e(ue,{children:[t(w,{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:t(he,{children:t(x,{size:y.S,weight:500,color:b.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(u,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(M,{value:q,onChange:Q,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:P.v2.colors.silver[900],emphasizeBackgroundColor:P.v2.colors.silver[800]})}),t(S,{size:$.S,variant:k.Filled,options:[{value:ce.Table,label:"Top table"},{value:ce.Flame,label:"Flame graph"},{value:ce.Both,label:"Both"}],selected:E,setSelected:_}),t(p,L?{variant:v.Secondary,size:g.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=>t(j,{...e,size:8,fill:P.v2.colors.green[500]})}:{variant:v.Secondary,size:g.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(j,{...e,size:8,fill:P.v2.colors.red[500]})})]})]}),t(de,{$gap:xe&&be?16:0,children:oe?e(a,{children:[xe&&e(me,{$splitWithFlame:ye,children:[t(ge,{$justifyContent:"flex-end",children:t(p,{variant:v.Secondary,size:g.S,label:"Download snapshot",rightIcon:N,onClick:()=>{if(!D)return;const e=new Blob([D],{type:"application/json"}),t=URL.createObjectURL(e),l=document.createElement("a");l.href=t,l.download=`cpu-profile-${o.namespace}-${o.kind}-${o.name}.json`,l.click(),URL.revokeObjectURL(t)},disabled:!D})}),t(ae,{rows:ve,languages:we,filters:G,onFiltersChange:ee})]}),be&&e(pe,{$splitWithTable:ye,children:[e(ge,{$justifyContent:"space-between",children:[t(X,{label:oe?`Total in view ${J(oe.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:P.v2.colors.silver[750],textColor:P.v2.colors.silver[200],textSize:y.XXS}),e(u,{$gap:12,children:[!L&&t(p,{variant:v.Secondary,size:g.S,label:"Refresh",leftIcon:H,onClick:ie}),t(h,{label:"Auto refresh",labelAlign:m.Left,size:d.S,value:L,onChange:O})]})]}),t(le,{flamebearer:oe.flamebearer,maxRowPx:24,searchQuery:q,shouldKeepName:Se,minHostHeight:280,onFullscreenChange:B,profilingSlots:A},E)]})]}):t(C,{children:t(R,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})};export{ve as P};
|