@odigos/ui-kit 0.0.235 → 0.0.236
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 +13 -0
- package/lib/chunks/{index-D6lL097V.js → index-Cm0_bD--.js} +8 -8
- package/lib/chunks/index-CmhFl_vY.js +77 -0
- package/lib/chunks/{index-BmuiyBxZ.js → index-zIhroDGj.js} +1 -1
- package/lib/chunks/{ui-components-B4It5sfa.js → ui-components-DHsbbgZi.js} +446 -434
- package/lib/components/_v2/badge/index.d.ts +2 -2
- package/lib/components/_v2/cards/data-card/index.d.ts +7 -1
- package/lib/components/_v2/cli-command/index.d.ts +3 -0
- package/lib/components/_v2/condition/index.d.ts +13 -2
- package/lib/components/_v2/segment/index.d.ts +2 -1
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/overview/search/index.d.ts +0 -1
- package/lib/containers/source-drawer/index.d.ts +1 -1
- package/lib/containers/v2.js +53 -55
- package/lib/containers.js +19 -19
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- 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.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-pkD-mO1h.js +0 -77
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.236](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.235...ui-kit-v0.0.236) (2026-05-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **Filters:** use detectedLanguages instead of containers for language options ([#899](https://github.com/odigos-io/ui-kit/issues/899)) ([80735cc](https://github.com/odigos-io/ui-kit/commit/80735cc89daa7120215ac8dfa4507bb254e1d8c2))
|
|
9
|
+
* hide Conditions panel on VM destinations ([#907](https://github.com/odigos-io/ui-kit/issues/907)) ([0ba78c7](https://github.com/odigos-io/ui-kit/commit/0ba78c70233fc9828e942fe8c757aa194df4fcf9))
|
|
10
|
+
* hide data stream selector on VM ([#904](https://github.com/odigos-io/ui-kit/issues/904)) ([ff8356f](https://github.com/odigos-io/ui-kit/commit/ff8356f8c001aa323702bf2344f004d97ed22d4c))
|
|
11
|
+
* hide Enabled/Disabled toggle on VM destinations ([#906](https://github.com/odigos-io/ui-kit/issues/906)) ([05af0bc](https://github.com/odigos-io/ui-kit/commit/05af0bc10afa9f23f49dddea7545fff2d3f4d4ed))
|
|
12
|
+
* hide Test Connection button on VM destinations ([#903](https://github.com/odigos-io/ui-kit/issues/903)) ([1bfd694](https://github.com/odigos-io/ui-kit/commit/1bfd694abe61078a43130c3f00efaf98c7f6a88a))
|
|
13
|
+
* minor design feedbacks ([#900](https://github.com/odigos-io/ui-kit/issues/900)) ([d27d2a5](https://github.com/odigos-io/ui-kit/commit/d27d2a5e1d99e810644ad6d2818f803d78f1f56b))
|
|
14
|
+
* remove Java from "libraries" supported languages ([#901](https://github.com/odigos-io/ui-kit/issues/901)) ([52c9d38](https://github.com/odigos-io/ui-kit/commit/52c9d3812b46514b10f6949fc23a104079e0b81f))
|
|
15
|
+
|
|
3
16
|
## [0.0.235](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.234...ui-kit-v0.0.235) (2026-05-13)
|
|
4
17
|
|
|
5
18
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cA as e,a,as as t,
|
|
1
|
+
import{cA as e,a,as as t,J as l,L as r,fs as i,cn as s,cP as n,cu as o,cq as d,bC as c,cr as u,cp as p,ak as h,a4 as g,b_ as m,F as v,n as f,cm as b,W as y,Y as x,cL as S,ft as C,fu as k,K as w,fv as T,Q as $,fw as P,R as A,U as M,fx as L,fy as O,fz as z,fA as X,fB as R,fC as D,fD as I,e5 as N,fE as E,fF as H,fG as B,fH as V,fI as U,di as j,B as q,fJ as G,fK as J,fL as K,fM as W,fN as F,fO as Z,fP as Y,fQ as Q,fR as _,fS as ee,cF as ae,fT as te,fU as le,cM as re,fV as ie,fW as se,fX as ne,fY as oe,fZ as de,d7 as ce,f_ as ue,f$ as pe,g0 as he,g1 as ge,g2 as me,g3 as ve,g4 as fe,g5 as be,g6 as ye,dm as xe,M as Se,g7 as Ce,g8 as ke,g9 as we,ga as Te,gb as $e,gc as Pe,gd as Ae,ge as Me,gf as Le,gg as Oe,gh as ze,cw as Xe,gi as Re,p as De,gj as Ie,gk as Ne,gl as Ee,gm as He,gn as Be,eL as Ve,bW as Ue,Z as je,x as qe,br as Ge,co as Je,go as Ke,b6 as We,b as Fe,N as Ze,c4 as Ye,a0 as Qe,eO as _e,a1 as ea}from"./ui-components-DHsbbgZi.js";import{jsx as aa,jsxs as ta,Fragment as la}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as ra,OdigosLogoTextCommunity as ia,EditIcon as sa,ArrowLeftIcon as na,ArrowRightIcon as oa,VSquareIcon as da}from"../icons.js";import{useCallback as ca,useMemo as ua,useState as pa,useRef as ha,useEffect as ga,forwardRef as ma,useImperativeHandle as va}from"react";import fa from"styled-components";import"./index-zIhroDGj.js";const ba=({isOpen:t,onClose:l,onDeny:r,onApprove:i})=>aa(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()}}}),ya=({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 aa(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()}}})},xa=({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:A,timeUnits:M,timeDefaultUnit:L})=>{switch(e){case t.Input:return aa(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 aa(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 aa(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 aa(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 aa(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:!A}))||[],values:S?[String(S)]:[],setValues:e=>C(e[0]),errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Checkbox:return aa(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 aa(i,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",setValue:e=>C(e),units:M,defaultUnit:L,errorMessage:k,warnMessage:w,helpMessage:T},g);case t.Toggle:return aa(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}},Sa=({size:e=200})=>{const{tier:a}=g();return a===m.Onprem?aa(ra,{size:e}):aa(ia,{size:e})},Ca=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],ka=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],wa=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],Ta=({description:e,options:a,selected:t,onSelect:l,customName:r,customLabel:i,customPlaceholder:s,customValue:n,onCustomChange:o})=>ta(v,{$gap:16,$alignItems:"flex-end",children:[ta(f,{$gap:6,children:[aa(b,{label:e}),aa(y,{size:x.S,options:a,selected:t,setSelected:l})]}),"custom"===t&&aa(p,{name:r,label:i,placeholder:s,type:h.Number,value:n,onChange:o,width:160})]}),$a=()=>{},Pa=e=>e.readOnly?aa(Aa,{rule:e.rule}):aa(Ma,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),Aa=({rule:e})=>{const a=null!=e.durationAtLeastMs;return e.error?aa(S,{richTitle:{title:C},children:aa(l,{name:"sampling-view-toggle-keep-errors",onChange:$a,value:!0,size:w.S,label:k,labelAlign:r.Right})}):a?aa(S,{richTitle:{title:T},children:ta("div",{children:[aa($,{size:M.XXXS,color:A.Secondary,children:P}),aa($,{size:M.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},Ma=({ruleType:e,formState:a,onChange:t})=>{const i=ca(e=>t({durationPreset:e}),[t]),s=ca(e=>t({customDurationMs:e.target.value}),[t]);return"Error"===e?aa(S,{richTitle:{title:C,subTitle:L},children:aa(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:$a,size:w.S,label:k,labelAlign:r.Right})}):"Duration"===e?aa(S,{richTitle:{title:T,subTitle:O},children:aa(Ta,{description:P,options:wa,selected:a.durationPreset,onSelect:i,customName:"sampling-input-custom-duration",customLabel:z,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:s})}):null},La=fa.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
gap: 32px;
|
|
4
4
|
`,Oa=fa.div`
|
|
@@ -31,17 +31,17 @@ import{cA as e,a,as as t,j as l,l as r,fs as i,cn as s,cP as n,cu as o,cq as d,b
|
|
|
31
31
|
align-items: flex-end;
|
|
32
32
|
gap: 16px;
|
|
33
33
|
margin-bottom: 12px;
|
|
34
|
-
`,Na="Any",Ea="Kafka topic",Ha=()=>aa("div",{style:{marginBottom:"8px"},children:aa($,{size:M.XS,weight:500,children:"And"})}),Ba=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Va=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],
|
|
34
|
+
`,Na="Any",Ea="Kafka topic",Ha=()=>aa("div",{style:{marginBottom:"8px"},children:aa($,{size:M.XS,weight:500,children:"And"})}),Ba=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Va=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Ua=[{id:"",label:Na},{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?aa(qa,{data:e.data}):aa(Ga,{category:e.category,formState:e.formState,onChange:e.onChange}),qa=({data:e})=>{const a=ua(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:W,value:K},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:G,value:a.httpServer.method||Na}];if(a?.httpClient){const e=[{id:"type",title:W,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||Na}),e}return[{id:"type",title:W,value:Y}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:W,value:K},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:G,value:a.httpServer.method||Na}]:a?.kafkaConsumer?[{id:"type",title:W,value:Q},{id:"topic",title:Ea,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:W,value:_},{id:"topic",title:Ea,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:W,value:Y}]}(e),[e]);return aa(S,{richTitle:{title:X},children:aa(La,{children:a.map(({id:e,title:a,value:t})=>ta(Oa,{children:[aa($,{size:M.XXXS,color:A.Secondary,nowrap:!0,children:a}),aa($,{size:M.XS,nowrap:!0,children:t})]},e))})})},Ga=({category:e,formState:t,onChange:l})=>{const r=ua(()=>"noisy"===e?Ba:Va,[e]),i=ca(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=ca(e=>a=>{a&&l({routeType:e,route:""})},[l]),n=ca(e=>l({route:e.target.value}),[l]),o=ca(e=>l({serverAddress:e.target.value}),[l]),d=ca(e=>l({method:e[0]||""}),[l]),c=ca(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:U;return ta(S,{richTitle:{title:`2. ${X}`,subTitle:R},children:[aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:r,selected:t.operationType,setSelected:i})}),u&&ta(za,{children:["httpClient"===t.operationType&&ta(Ia,{children:[aa(p,{name:"sampling-input-server-address",label:I,placeholder:D,value:t.serverAddress,onChange:o}),aa(Ha,{})]}),ta(Xa,{children:[ta(Ra,{children:[aa(Da,{children:aa(N,{"data-id":"sampling-radio-route",value:"route"===t.routeType,onChange:s("route")})}),aa(p,{name:"sampling-input-route",label:g,placeholder:E,value:"route"===t.routeType?t.route:"",onChange:n,disabled:"route"!==t.routeType})]}),ta(Ra,{children:[aa(Da,{children:aa(N,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===t.routeType,onChange:s("routePrefix")})}),aa(p,{name:"sampling-input-route-prefix",label:m,placeholder:E,value:"routePrefix"===t.routeType?t.route:"",onChange:n,disabled:"routePrefix"!==t.routeType})]})]}),ta(Ia,{children:[aa(Ha,{}),aa(j,{label:G,items:Ua,selectedIds:[t.method||""],setSelectedIds:e=>d(e),buttonProps:{"data-id":"sampling-btn-method",label:Ua.find(e=>e.id===t.method)?.label||Na,size:q.S,variant:a.Secondary}})]})]}),h&&aa(p,{name:"sampling-input-kafka-topic",label:J,placeholder:"Type kafka topic",value:t.kafkaTopic,onChange:c,width:"320px"})]})},Ja=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ka=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Wa=e=>e.readOnly?aa(Fa,{data:e.data}):aa(Za,{category:e.category,formState:e.formState,onChange:e.onChange}),Fa=({data:e})=>{const a=ua(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:te,method:ne,description:ie,value:`${e.rule.percentageAtLeast}%`}:{title:te,method:de,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:le,method:ne,description:se,value:`${e.rule.percentageAtMost}%`}:{title:le,method:oe,description:null,value:null};case"costReduction":return{title:le,method:ne,description:se,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 aa(S,{richTitle:{title:a.title},children:aa(La,{children:t.map(({id:e,title:a,value:t})=>ta(Oa,{children:[aa($,{size:M.XXXS,color:A.Secondary,nowrap:!0,children:a}),aa($,{size:M.XS,nowrap:!0,children:t})]},e))})})},Za=({category:e,formState:a,onChange:t})=>{const l="highlyRelevant"===e,r=l?Ka:Ja,i=`${l?4:3}. ${l?te:le}`,s=l?ee:ae,n=l?ie:se,o="noisy"===e?ka:Ca,d=ca(e=>t({percentageMode:e}),[t]),c=ca(e=>t({percentagePreset:e}),[t]),u=ca(e=>t({customPercentage:e.target.value}),[t]);return ta(S,{richTitle:{title:i,subTitle:s},children:["costReduction"!==e&&aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&aa(Ta,{description:n,options:o,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:re,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:u})]})},Ya=fa.div`
|
|
35
35
|
display: flex;
|
|
36
36
|
align-items: flex-end;
|
|
37
37
|
gap: 16px;
|
|
38
|
-
`,
|
|
38
|
+
`,Qa=fa.div`
|
|
39
39
|
width: 280px;
|
|
40
40
|
flex-shrink: 0;
|
|
41
|
-
`,
|
|
41
|
+
`,_a=fa.div`
|
|
42
42
|
flex: 1;
|
|
43
43
|
min-width: 0;
|
|
44
|
-
`;function et(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":fe[e.category]}const at=e=>e.readOnly?aa(tt,{data:e.data}):aa(lt,{formState:e.formState,onChange:e.onChange}),tt=({data:e})=>{const a=ua(()=>[{id:"name",title:ue,value:e.rule.name||ce},{id:"type",title:pe,value:et(e)}],[e]),t=e.rule.notes||F;return ta(S,{children:[aa(La,{children:a.map(({id:e,title:a,value:t})=>ta(Oa,{children:[aa($,{size:M.XXXS,color:A.Secondary,nowrap:!0,children:a}),aa($,{size:M.XS,nowrap:!0,children:t})]},e))}),ta(Oa,{children:[aa($,{size:M.XXXS,color:A.Secondary,children:he}),aa($,{size:M.XS,children:t})]})]})},lt=({formState:e,onChange:a})=>{const t=ca(e=>a({name:e.target.value}),[a]),l=ca(e=>a({notes:e.target.value}),[a]);return aa(S,{children:ta(Ya,{children:[aa(
|
|
44
|
+
`;function et(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":fe[e.category]}const at=e=>e.readOnly?aa(tt,{data:e.data}):aa(lt,{formState:e.formState,onChange:e.onChange}),tt=({data:e})=>{const a=ua(()=>[{id:"name",title:ue,value:e.rule.name||ce},{id:"type",title:pe,value:et(e)}],[e]),t=e.rule.notes||F;return ta(S,{children:[aa(La,{children:a.map(({id:e,title:a,value:t})=>ta(Oa,{children:[aa($,{size:M.XXXS,color:A.Secondary,nowrap:!0,children:a}),aa($,{size:M.XS,nowrap:!0,children:t})]},e))}),ta(Oa,{children:[aa($,{size:M.XXXS,color:A.Secondary,children:he}),aa($,{size:M.XS,children:t})]})]})},lt=({formState:e,onChange:a})=>{const t=ca(e=>a({name:e.target.value}),[a]),l=ca(e=>a({notes:e.target.value}),[a]);return aa(S,{children:ta(Ya,{children:[aa(Qa,{children:aa(p,{name:"sampling-input-rule-name",label:ue,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:ge,value:e.name,onChange:t})}),aa(_a,{children:aa(p,{name:"sampling-input-note",label:he,tooltip:ve,placeholder:me,value:e.notes,onChange:l})})]})})},rt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],it=({formState:e,onChange:a})=>{const t=ca(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return aa(S,{richTitle:{title:`3. ${pe}`,subTitle:be},children:aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:rt,selected:e.ruleType,setSelected:t})})})},st=fa.div`
|
|
45
45
|
display: flex;
|
|
46
46
|
align-items: center;
|
|
47
47
|
gap: 24px;
|
|
@@ -53,7 +53,7 @@ import{cA as e,a,as as t,j as l,l as r,fs as i,cn as s,cP as n,cu as o,cq as d,b
|
|
|
53
53
|
min-width: 0;
|
|
54
54
|
white-space: pre;
|
|
55
55
|
overflow-x: auto;
|
|
56
|
-
`,ot=({title:e,summary:t,onEdit:l,renderAction:r})=>{const i=ua(()=>{const a=[];return e&&(a.push({text:e,variant:ye.Default}),a.push({text:" - ",variant:ye.Default})),a.push(...t),a},[e,t]);return ta(st,{children:[aa(nt,{children:aa(xe,{parts:i})}),r&&r(),l&&aa(Se,{"data-id":"sampling-btn-edit-auto-rule",label:Ce,rightIcon:sa,variant:a.Text,size:
|
|
56
|
+
`,ot=({title:e,summary:t,onEdit:l,renderAction:r})=>{const i=ua(()=>{const a=[];return e&&(a.push({text:e,variant:ye.Default}),a.push({text:" - ",variant:ye.Default})),a.push(...t),a},[e,t]);return ta(st,{children:[aa(nt,{children:aa(xe,{parts:i})}),r&&r(),l&&aa(Se,{"data-id":"sampling-btn-edit-auto-rule",label:Ce,rightIcon:sa,variant:a.Text,size:q.S,onClick:l})]})},dt=e=>{const a=ua(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return Te(Le(e.formState));case"highlyRelevant":return we(Me(e.formState));case"costReduction":return ke(Ae(e.formState))}},[e]);if(e.readOnly)return aa(ot,{title:$e,summary:a,renderAction:e.renderAction});const t=1===a.length&&"default"===a[0].variant;return aa(ot,{title:t?Pe:$e,summary:t?[]:a,renderAction:e.renderAction})},ct=fa.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-wrap: wrap;
|
|
59
59
|
gap: 8px;
|
|
@@ -95,7 +95,7 @@ import{cA as e,a,as as t,j as l,l as r,fs as i,cn as s,cP as n,cu as o,cq as d,b
|
|
|
95
95
|
justify-content: center;
|
|
96
96
|
align-items: center;
|
|
97
97
|
flex-shrink: 0;
|
|
98
|
-
`,vt={[
|
|
98
|
+
`,vt={[je.JavaScript]:"Node.js",[je.DotNet]:".NET",[je.Php]:"PHP",[je.Java]:"Java",[je.Go]:"Go",[je.Python]:"Python",[je.Ruby]:"Ruby",[je.Rust]:"Rust"},ft=[je.Python,je.Java,je.JavaScript,je.DotNet,je.Php,je.Ruby,je.Go].map(e=>({id:e,label:vt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:Ue(e)})),bt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function yt(e){const a=vt[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const xt=e=>e.readOnly?aa(St,{scopes:e.scopes}):aa(Ct,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),St=({scopes:e})=>{if(Oe(e))return aa(S,{richTitle:{title:ze},children:aa(Xe,{status:De.Default,message:Re,fullWidth:!0})});const a=e.sources??[],t=e.namespaces??[],l=e.languages??[];return aa(S,{richTitle:{title:ze},children:ta(ht,{children:[a.map((e,a)=>{const t=[e.namespace,e.kind,e.name].filter(Boolean),l=t.length?t.join(" / "):Ie;return aa(gt,{children:aa($,{size:M.XS,color:A.Primary,children:l})},`src-${a}`)}),t.map((e,a)=>aa(gt,{children:aa($,{size:M.XS,color:A.Primary,children:e})},`ns-${a}`)),l.map((e,a)=>{const t=Ue(e);return ta(gt,{children:[t&&aa(mt,{children:aa(t,{size:18})}),aa($,{size:M.XS,color:A.Primary,children:yt(e)})]},`lang-${a}`)})]})})},Ct=({formState:e,onChange:a,sourceOptions:t=[],namespaceOptions:l=[]})=>{const[r,i]=pa("all"),{sources:n,namespaces:o,languages:d}=e.sourceScopes,c=n.length>0||o.length>0||d.length>0,u=ua(()=>bt.map(e=>({...e,disabled:"all"===e.value&&c})),[c]),p=ua(()=>n.map(e=>{return a=e.namespace,t=e.kind,l=e.name,`${a}/${t}/${l}`;var a,t,l}),[n]),h=ua(()=>[...o],[o]),g=ua(()=>new Set(d),[d]),m=ca(e=>{i(e)},[]),v=ca(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=ca(t=>{a({sourceScopes:{...e.sourceScopes,namespaces:t}})},[e.sourceScopes,a]),C=ca(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 ta(S,{richTitle:{title:`1. ${ze}`,subTitle:Ne},children:[aa(Xe,!c&&"all"===r?{status:De.Default,message:Re,fullWidth:!0,smallIcon:!0}:{status:De.Info,message:Ee,fullWidth:!0,smallIcon:!0}),aa(f,{$alignItems:"flex-start",children:aa(y,{size:x.S,options:u,selected:r,setSelected:m})}),"source"===r&&aa(He,{multiple:!0,"data-id":"sampling-autocomplete-source",options:t,value:p,onSelect:v,placeholder:Be}),"namespace"===r&&aa(He,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:l,value:h,onSelect:b,placeholder:"Search namespace"}),"language"===r&&aa(ct,{children:ft.map(({id:e,label:a,Icon:t})=>{const l=g.has(e);return ta(ut,{$selected:l,onClick:()=>C(e),children:[aa(s,{name:`sampling-scope-lang-${e}`,size:Ve.S,value:l,onChange:()=>C(e)}),aa(pt,{children:aa(t,{size:20})}),aa($,{size:M.XS,nowrap:!0,children:a})]},e)})})]})},kt=(e,a)=>!a?.length||!!a?.find(a=>a===e),wt=({title:e="Signals",required:a,errorMessage:t,allowedSignals:l,selectedSignals:r,setSelectedSignals:i,disabled:n})=>{const[o,d]=pa(1===r.length),c=ha(JSON.stringify(r));ga(()=>{let e=qe(r).filter(e=>kt(e,l));e.length||(e=Ge.filter(({id:e})=>kt(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 ta(f,{$gap:12,children:[aa(b,{label:e,required:a}),aa(v,{$gap:12,children:Ge.map(e=>{const a=kt(e.id,l),t=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?aa(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})}),aa(Je,{errorMessage:t})]})},Tt=({minSupportedVersion:a,currentVersion:t})=>aa(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>aa(Ke,{scale:2.4,icon:()=>aa("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:aa("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}.`}),$t=fa.div`
|
|
99
99
|
display: flex;
|
|
100
100
|
flex-direction: column;
|
|
101
101
|
justify-content: flex-end;
|
|
@@ -142,4 +142,4 @@ import{cA as e,a,as as t,j as l,l as r,fs as i,cn as s,cP as n,cu as o,cq as d,b
|
|
|
142
142
|
padding: 5vh 10vw;
|
|
143
143
|
border-radius: 12px;
|
|
144
144
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
145
|
-
`,It=ma(({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]=pa(!1),[$,P]=pa(!1),[A,L]=pa(void 0);va(k,()=>({clearErrors:()=>L(void 0)}));const O=$,z=ca(()=>{y&&!w?T(!0):(T(!1),i?.())},[y,w,i]),X=c||$||"boolean"==typeof y&&!y,R=ca(async()=>{P(!0);const e=await d();P(!1),e?.error?L(e.error):(u?.setValue([]),i?.())},[d,u,i]),D=!!v||!!u||!!f,I=!!h,N=(D?48:0)+(I?50:0),E=ua(()=>S?{status:De.Info,message:"Fetching Data..."}:$&&!C?{status:De.Info,message:"Saving Changes..."}:A||b?{status:De.Error,message:A||b}:"boolean"==typeof y&&y&&!x?{status:De.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:De.Success,message:"The values reflect the current configuration of the selected cluster."},[S,$,C,A,b,y,x]),H=ua(()=>s?{label:"Back",leftIcon:na,variant:a.Secondary,onClick:s}:{label:"Cancel",variant:a.Secondary,onClick:z,disabled:O},[s,z,O]),[B,V]=pa(!1),
|
|
145
|
+
`,It=ma(({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]=pa(!1),[$,P]=pa(!1),[A,L]=pa(void 0);va(k,()=>({clearErrors:()=>L(void 0)}));const O=$,z=ca(()=>{y&&!w?T(!0):(T(!1),i?.())},[y,w,i]),X=c||$||"boolean"==typeof y&&!y,R=ca(async()=>{P(!0);const e=await d();P(!1),e?.error?L(e.error):(u?.setValue([]),i?.())},[d,u,i]),D=!!v||!!u||!!f,I=!!h,N=(D?48:0)+(I?50:0),E=ua(()=>S?{status:De.Info,message:"Fetching Data..."}:$&&!C?{status:De.Info,message:"Saving Changes..."}:A||b?{status:De.Error,message:A||b}:"boolean"==typeof y&&y&&!x?{status:De.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:De.Success,message:"The values reflect the current configuration of the selected cluster."},[S,$,C,A,b,y,x]),H=ua(()=>s?{label:"Back",leftIcon:na,variant:a.Secondary,onClick:s}:{label:"Cancel",variant:a.Secondary,onClick:z,disabled:O},[s,z,O]),[B,V]=pa(!1),U=ua(()=>n?o?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:oa,variant:a.Secondary,onClick:()=>V(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:oa,variant:a.Primary,onClick:n}:{"data-id":"wide-drawer-save",label:"Save",variant:a.Primary,onClick:R,disabled:X},[n,o,R,X]);return ta(Ye,{width:Lt,isOpen:t,disableAnimation:r,hideOverlay:!$&&!l,header:{...p,onClose:i?z:void 0,onCloseDisabled:O},footer:{note:E,actions:[H,U]},children:[$?aa(Fe,{$height:"calc(100vh - 136px)",children:aa(Dt,{children:aa(Qe,{titleSize:M.S,subTitleSize:M.XXXS,withGradient:!0,withSpinner:!0,...C})})}):ta(Ot,{children:[D&&ta(zt,{children:[u&&aa(_e,{icon:da,title:"Selected Clusters",badge:{label:u.value.length}}),v&&aa(ea,{width:"100%",...v}),f]}),I&&aa(Xt,{children:aa(_e,{icon:h.icon,title:h.title,subTitle:h.description,badge:h.badge})}),ta(Rt,{children:[aa(Mt,{isLeft:!0,heightOffset:N,...g}),aa(Mt,{isRight:!0,heightOffset:N,...m})]})]}),aa(ba,{isOpen:w,onClose:()=>T(!1),onApprove:z}),aa(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)}}})]})});It.displayName=It.name;export{ot as A,ba as C,xa as D,ka as N,ja as O,Ta as P,at as R,wt as S,Tt as U,It as W,Ca as a,dt as b,xt as c,it as d,Pa as e,Wa as f,ya as g,Lt as h,Sa as i,wa as j};
|
|
@@ -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,Children as s,Fragment as c,useLayoutEffect as d,useMemo as u,useCallback 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,j as $,k as C,s as T,F as z,S as I,O as N,l as F,b as P,m as E,n as O,o as R,p as L,q as D,r as M,t as A,v as B,P as W,w as X,H as V,g as Y,x as j,y as H,z as _,G as U,J,K,L as Z,M as G,B as q,a 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,$ as ce,a0 as de,a1 as ue,N 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-DHsbbgZi.js";import{Y as Ce}from"./index-zIhroDGj.js";import{EditIcon as Te,TrashIcon as ze,RefreshIcon as Ie,SearchIcon as Ne,MinusIcon as Fe,PlusIcon as Pe,XIcon as Ee,ExpandIcon as Oe,CopyIcon as Re,DotIcon as Le,DownloadIcon as De,RefreshLeftArrowIcon as Me}from"../icons.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(Te,{}),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(ze,{}),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(ze,{}),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)})});Be.displayName=Be.name,Ae.displayName=Ae.name;const We=(e,t)=>{const{name:n,kind:i,namespace:o}=e,l=[{title:$.KIND,value:i},{title:$.NAME,value:n,tooltip:"Resource name"}];return t||(l.unshift({title:$.NAMESPACE,value:o}),l.push({type:C.Divider}),l.push({type:C.CopyText,value:`kubectl get ${i} ${n} -n ${o}`.toLowerCase()})),l},Xe=f.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 24px;
|
|
5
|
+
padding: 4px;
|
|
6
|
+
`,Ve=({formData:e,handleFormChange:t})=>n(Xe,{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)})}),Ye=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const t=F(e?.status),i=T(e?.reasonEnum),o=e?.message;return n(z,{$alignItems:"center",$justifyContent:"center",children:n(I,{status:t,title:i,subtitle:o,withBackground:t!==N.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},je=({source:t,fetchSourceDescribe:i,onClickRestartPod:l})=>{const[r,c]=o(!1),[d,u]=o(null);return a(()=>{t&&i({namespace:t.namespace,name:t.name,kind:t.kind}).then(({data:e})=>{e?.describeSource?u(e.describeSource):c(!0)})},[t.namespace,t.name,t.kind]),d||r?n(O,{$gap:12,children:r?n(P,{$height:"70vh",children:n(R,{subTitle:"Could not fetch describe for this source"})}):d?.pods?.length?d.pods.map(({podName:i,nodeName:o,phase:r,agentInjected:a,runningLatestWorkloadRevision:c,containers:u,manifestYAML:h})=>{const f=r.status!==L.Success||D(u)?L.Error:L.Success,m=[];return m.push(n(M,{value:`kubectl get pod ${i.value} -n ${d?.namespace?.value||t.namespace}`.toLowerCase()},"copy-text")),m.push(n(A,{length:"100%",margin:"0"},"divider-1")),m.push(n(B,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-1")),m.push(n(A,{length:"100%",margin:"0"},"divider-2")),m.push(n(B,{title:r.name,tooltip:r.explain||"",value:{status:r.status||void 0,text:r.value}},"describe-row-2")),m.push(n(A,{length:"100%",margin:"0"},"divider-3")),m.push(n(B,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-3")),m.push(n(A,{length:"100%",margin:"0"},"divider-4")),c?.name&&(m.push(n(B,{title:c.name,tooltip:c.explain||void 0,value:{status:c.status||void 0,text:c.value}},"describe-row-4")),m.push(n(A,{length:"100%",margin:"0"},"divider-5"))),u.forEach(e=>{m.push(n(W,{...e},`pod-container-${e.containerName.value}`))}),h&&(m.push(n(A,{length:"100%",margin:"0"},"divider-6")),m.push(n(Ce,{yaml:h},"yaml-section-card"))),n(X,{title:`Pod: ${i.value}`,withExtend:!0,action:({hovered:o})=>e("div",{style:{position:"relative"},children:[n(I,{status:f,title:f,withIcon:!0,withBorder:!0},"status"),o&&n(V,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:l?[{id:Y(),label:"Restart",rightIcon:Ie,onClick:()=>l(d?.namespace?.value||t.namespace,i.value)}]:[]},"hover-actions")]}),children:s.toArray(m)},`pod-${i.value}`)}):n(P,{$height:"70vh",children:n(R,{subTitle:"Check if you have any running pods and try again"})})}):n(P,{$height:"70vh",children:n(E,{})})},He=f(z)`
|
|
7
|
+
width: 100%;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
`,_e=({source:t,fetchSourceLibraries:i})=>{const l=m(),[r,s]=o(!1),[d,u]=o(null);return a(()=>{t&&i({namespace:t.namespace,name:t.name,kind:t.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(j(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[t.namespace,t.name,t.kind]),d||r?n(O,{$gap:12,children:r?n(P,{$height:"70vh",children:n(R,{subTitle:"Could not fetch libraries for this source"})}):d?.length?n(X,{title:"Instrumented Libraries",children:d.map(({name:t,healthy:i,message:o,nonIdentifyingAttributes:r},a)=>e(c,{children:[e(O,{$gap:4,$width:"100%",children:[e(He,{$width:"100%",children:[n(v,{size:12,color:l.text.grey,children:t}),e(z,{$gap:4,children:[r.map(({key:e,value:i})=>_(i)&&U(i)&&"is_standard_lib"===e?n(I,{status:L.Default,title:"STANDARD",withBorder:!0},`${t}-${e}`):null),"boolean"==typeof i&&n(I,{status:i?L.Success:L.Error,title:i?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),o&&n(v,{size:10,color:l.text.error,align:"right",children:o})]}),a!==d.length-1&&n(A,{length:"100%",margin:"0"})]},`library-${t}`))}):e(P,{$height:"70vh",$gap:12,children:[n(R,{title:"No libraries found",subTitle:""}),n(H,{type:L.Warning,message:"This feature is in early development, and has very limited support"})]})}):n(P,{$height:"70vh",children:n(E,{})})};function Ue(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 Je(e){const t=Math.abs(e);return t>=1e9?`${Ke(e/1e9)}s`:t>=1e6?`${Ke(e/1e6)}ms`:t>=1e3?`${Ke(e/1e3)}μs`:String(Math.round(e))}function Ke(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Ze(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 Ge(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function qe(e,t){const n=t.trim().toLowerCase();return!n||e.toLowerCase().includes(n)}function Qe(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=Ze(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(Ue(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&&Ue(e,r.nameIndex)===Ue(e,t.nameIndex)&&o.add(Ge(r))}if(0===o.size)return n;const l=[];for(const e of n){if(o.has(Ge(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(Ge(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=Ue(e,n.nameIndex);return{...n,x:o,y:r,w:l,h:a,name:s,matchesSearch:qe(s,v)}})}function et(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]}var tt,nt;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(tt||(tt={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(nt||(nt={}));function it(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ot(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 lt(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 rt=({flamebearer:t,maxRowPx:i,searchQuery:r="",shouldKeepName:s,minHostHeight:c=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,$]=o(""),[C,T]=o(null),[I,N]=o([]),[F,P]=o(!1),[E,O]=o(tt.Fit),[R,L]=o(nt.Fit),[D,M]=o(!1),A=Math.max(1,Math.min(Math.floor(w.w*E),8192)),B=Math.max(1,Math.min(Math.floor(w.h*R),8192)),W=I.length>0?I[I.length-1]:null,X=W?.size??t.numTicks;a(()=>{x.current!==t.numTicks&&(x.current=t.numTicks,N([]))},[t.numTicks]),d(()=>{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(!F)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[F]),a(()=>(f?.(F),()=>{F&&f?.(!1)}),[F,f]);const V=u(()=>Qe(t,A,B,i,r,{zoomRoot:W,shouldKeepName:s,collapseRecursive:D}),[t,i,r,B,A,W,s,D]),Y=u(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(V?.length?r.trim()?V.filter(e=>e.matchesSearch):V:[]),[V,r]),j=h(e=>{if(A<2||B<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=ot((e.clientX-n.left)/n.width*A,(e.clientY-n.top)/n.height*B,Y);if(i){const e=Ge(i);T(e);const n=X>0?(100*i.size/X).toFixed(1):"0",o=t.numTicks>0?(100*i.size/t.numTicks).toFixed(1):"0";$(`${i.name}\ntotal ${Je(i.size)} (${n}% of view, ${o}% of profile) · self ${Je(i.self)}`)}else T(null),$("")},[Y,t.numTicks,B,A,X]),H=h(e=>{j(e)},[j]),_=h(()=>{T(null),$("")},[]),U=h(e=>{b.current={x:e.clientX,y:e.clientY}},[]),ae=h(e=>{const{x:t,y:n}=b.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-n)>3)return;if(A<2||B<2)return;const i=e.currentTarget.getBoundingClientRect();if(i.width<1||i.height<1)return;const o=ot((e.clientX-i.left)/i.width*A,(e.clientY-i.top)/i.height*B,Y);if(!o)return;const l=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(o);N(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]})},[Y,B,A]);d(()=>{const e=y.current;if(!e||A<2||B<2)return;const n="undefined"!=typeof window&&window.devicePixelRatio||1,i=Math.max(A,B),o=Math.min(n,16384/i);e.width=Math.floor(A*o),e.height=Math.floor(B*o),e.style.width=`${A}px`,e.style.height=`${B}px`;const l=e.getContext("2d");l&&(l.setTransform(o,0,0,o,0,0),l.clearRect(0,0,A,B),V?.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}=et(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=it(d,a),p=`${s} (${Je(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(Ge(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,A,B,V,r,g,C,t.numTicks):(l.fillStyle=g.v2.colors.silver[900],l.fillRect(0,0,A,B)))},[V,t.numTicks,C,r,B,A,g]);const se=h(()=>P(e=>!e),[]),ce=t.numTicks>0?Math.max(0,Math.min(100,Math.round(X/t.numTicks*100))):100,de=u(()=>function(e,t){const n=Ze(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,W),[t,W]),ue=null!==de,he=I.length>0,fe=W?Ue(t,W.nameIndex):"",me=h(()=>N([]),[]),pe=h(()=>N(e=>e.slice(0,-1)),[]),ge=h(()=>{de&&N(e=>[...e,de])},[de]);return e("div",{style:F?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:g.v2.colors.silver[900]}:{flex:1,minHeight:c,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(z,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[n(J,{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:K.S,value:D,onChange:M}),e(z,{$gap:8,children:[e(z,{children:[n(G,{variant:Q.Secondary,size:q.S,label:"Reset zoom",leftIcon:Ne,onClick:me,disabled:!I.length}),n(G,{variant:Q.Secondary,size:q.S,iconSize:20,leftIcon:Fe,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!he,onClick:pe}),n("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:n(ee,{size:ne.XXS,color:te.Secondary,nowrap:!0,align:"center",children:`${ce}%`})}),n(G,{variant:Q.Secondary,size:q.S,iconSize:20,leftIcon:Pe,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!ue,onClick:ge})]}),e(z,{children:[n(ie,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:n(oe,{size:re.S,variant:le.Filled,options:[{value:tt.Fit,label:"W: Fit"},{value:tt.X10,label:"10x"}],selected:E,setSelected:O})}),n(ie,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:n(oe,{size:re.S,variant:le.Filled,options:[{value:nt.Fit,label:"H: Fit"},{value:nt.X10,label:"10x"}],selected:R,setSelected:L})})]}),n(G,{variant:Q.Secondary,size:q.S,iconSize:24,leftIcon:F?Ee:Oe,tooltip:F?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:se})]})]}),n(ie,{fullWidth:!0,keepAlive:!0,text:k,children:n("div",{ref:v,style:{flex:1,minWidth:0,width:"100%",height:F?"calc(100vh - 80px)":"calc(100vh - 370px)",position:"relative",overflowX:E>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:n("div",{style:{width:A||"100%",height:B||"100%",position:"relative"},children:n("canvas",{ref:y,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:C?"pointer":"default"},onPointerDown:U,onPointerMove:H,onPointerLeave:_,onClick:ae})})})}),e(z,{$justifyContent:"space-between",children:[n(ee,W?{size:ne.XXXS,color:g.v2.colors.silver[300],children:`Zoomed: ${fe} • ${Je(X)} samples in view`}:{size:ne.XXXS,color:g.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),p&&n(ee,{size:ne.XXXS,color:g.v2.colors.silver[300],children:`${p.activeKeys.length} / ${p.maxSlots} profiling slots · ${lt(p.totalBytesUsed)} / ${lt(p.maxTotalBytesBudget)} budget · TTL ${p.slotTtlSeconds}s`})]})]})};var at,st;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(at||(at={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(st||(st={}));const ct=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function dt(e,t){const n=function(e){return e.split(" ")[0]??""}(e);if(t.includes(st.FilterOutVoid)&&"void"===n)return!1;if(t.includes(st.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==n&&ct.test(n)))return!1}return!0}const ut={options:[{id:st.FilterOutVoid,label:"Filter out void symbols"},{id:st.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>dt(e.cells.find(e=>e.key===at.Symbol)?.rawValue?.toString()??"",t)},ht=({rows:e,languages:t,filters:i,onFiltersChange:o})=>{const l=u(()=>[{key:at.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:t?.includes(ae.Java)?ut:void 0,noFilter:!t?.includes(ae.Java)},{key:at.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:at.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[t]),r=u(()=>e.map(e=>({cells:[{key:at.Symbol,rawValue:e.name},{key:at.Self,rawValue:Je(e.self)},{key:at.Total,rawValue:Je(e.total)}]})),[e]);return n(se,{variant:ce.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:Re,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var ft;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(ft||(ft={}));const mt=f(O)`
|
|
11
|
+
width: 100%;
|
|
12
|
+
min-height: 0;
|
|
13
|
+
flex: 1;
|
|
14
|
+
border-radius: 16px;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
17
|
+
box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
|
|
18
|
+
`,pt=f.div`
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 10px;
|
|
22
|
+
flex-wrap: wrap;
|
|
23
|
+
padding: 12px 12px 8px;
|
|
24
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
25
|
+
border-radius: 16px 16px 0 0;
|
|
26
|
+
`,gt=f(z)`
|
|
27
|
+
flex-shrink: 0;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: 4px;
|
|
30
|
+
`,vt=f.div`
|
|
31
|
+
display: flex;
|
|
32
|
+
flex: 1;
|
|
33
|
+
align-items: stretch;
|
|
34
|
+
gap: ${({$gap:e})=>e}px;
|
|
35
|
+
padding: 16px;
|
|
36
|
+
min-height: 0;
|
|
37
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
38
|
+
border-radius: 0 0 16px 16px;
|
|
39
|
+
`,yt=f(O)`
|
|
40
|
+
flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
|
|
41
|
+
width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
|
|
42
|
+
max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
|
|
43
|
+
min-width: 0;
|
|
44
|
+
min-height: 0;
|
|
45
|
+
gap: 10px;
|
|
46
|
+
`,bt=f(O)`
|
|
47
|
+
flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
|
|
48
|
+
width: ${({$splitWithTable:e})=>e?"auto":"100%"};
|
|
49
|
+
min-width: 0;
|
|
50
|
+
min-height: 0;
|
|
51
|
+
gap: 10px;
|
|
52
|
+
`,xt=f(z)`
|
|
53
|
+
width: 100%;
|
|
54
|
+
min-height: 32px;
|
|
55
|
+
flex-shrink: 0;
|
|
56
|
+
`,wt=({source:t,fetchProfilingSlots:i,enableProfiling:r,fetchSourceProfiling:s,onFlameFullscreenChange:d})=>{const f=m(),p=u(()=>({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),[$,C]=o(ft.Both),[T,I]=o(""),[N,F]=o({}),E=l(null),O=h(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 O(),e||(E.current=setInterval(O,3e3)))})(),()=>{e=!0,E.current&&clearInterval(E.current)}},[r,O,p]);const R=u(()=>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]),L=u(()=>R?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=Ue(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)}(R.flamebearer):[],[R]),D=u(()=>{const e=T.trim().toLowerCase();return e?L.filter(t=>t.name.toLowerCase().includes(e)):L},[L,T]),M=$===ft.Table||$===ft.Both,A=$===ft.Flame||$===ft.Both,B=M&&A,W=t.detectedLanguages||t.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),X=u(()=>function(e,t){if(!t?.includes(ae.Java))return;const n=e?.[at.Symbol]?.filter(Boolean)??[];return 0!==n.length?e=>dt(e,n):void 0}(N,W),[N,W]);return S<2?n(P,{$height:"70vh",children:n(de,{withSpinner:!0})}):e(mt,{$gap:0,$width:"100%",children:[e(pt,{children:[n(ie,{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(gt,{children:n(ee,{size:ne.S,weight:500,color:te.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(z,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[n("div",{style:{flex:"1 1 220px",minWidth:180},children:n(ue,{value:T,onChange:I,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:f.v2.colors.silver[900],emphasizeBackgroundColor:f.v2.colors.silver[800]})}),n(oe,{size:re.S,variant:le.Filled,options:[{value:ft.Table,label:"Top table"},{value:ft.Flame,label:"Flame graph"},{value:ft.Both,label:"Both"}],selected:$,setSelected:C}),n(G,g?{variant:Q.Secondary,size:q.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(Le,{...e,size:8,fill:f.v2.colors.green[500]})}:{variant:Q.Secondary,size:q.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>n(Le,{...e,size:8,fill:f.v2.colors.red[500]})})]})]}),n(vt,{$gap:M&&A?16:0,children:R?e(c,{children:[M&&e(yt,{$splitWithFlame:B,children:[n(xt,{$justifyContent:"flex-end",children:n(G,{variant:Q.Secondary,size:q.S,label:"Download snapshot",rightIcon:De,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(ht,{rows:D,languages:W,filters:N,onFiltersChange:F})]}),A&&e(bt,{$splitWithTable:B,children:[e(xt,{$justifyContent:"space-between",children:[n(fe,{label:R?`Total in view ${Je(R.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:f.v2.colors.silver[750],textColor:f.v2.colors.silver[200],textSize:ne.XXS}),e(z,{$gap:12,children:[!g&&n(G,{variant:Q.Secondary,size:q.S,label:"Refresh",leftIcon:Ie,onClick:O}),n(J,{label:"Auto refresh",labelAlign:Z.Left,size:K.S,value:g,onChange:v})]})]}),n(rt,{flamebearer:R.flamebearer,maxRowPx:24,searchQuery:T,shouldKeepName:X,minHostHeight:280,onFullscreenChange:d,profilingSlots:y},$)]})]}):n(P,{children:n(he,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},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(z)`
|
|
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 d=!!r(t);return e(c,{children:[n($t,{size:13,color:d?s.text.secondary:s.text.grey,$clickable:d,onClick:()=>a(t),children:t}),o!==i.length-1&&n(A,{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),[d,u]=o(!1),[f,g]=o(!1),[y,b]=o(null),x=t.otelServiceName||t.name,w=h(()=>{x&&(g(!0),u(!1),i(x).then(({data:e})=>{e?.peerSources?b(e.peerSources):u(!0)}).finally(()=>g(!1)))},[x]);a(()=>{w()},[w]);const k=h(e=>c.find(t=>t.otelServiceName===e||t.name===e),[c]),$=h(e=>{const t=k(e);t&&(r(S.Source),s({namespace:t.namespace,name:t.name,kind:t.kind}))},[k,r,s]);if(!y&&!d&&f)return n(P,{$height:St,children:n(E,{})});if(d)return n(P,{$height:St,children:n(R,{subTitle:"Could not fetch peer sources"})});const C=y?.inbound?[...y.inbound].sort(kt):[],T=y?.outbound?[...y.outbound].sort(kt):[];return e(O,{$gap:12,children:[n(X,{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(X,{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(Ie,{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=[ae.Python,ae.Go],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:c,fetchSourceDescribe:d,fetchSourceLibraries:h,fetchPeerSources:f,restartPod:m,recoverFromRollback:g,profilingEnabled:y,fetchProfilingSlots:b,enableProfiling:x,fetchSourceProfiling:w})=>{const{isVm:k}=pe(),C=me(e=>e.sources),{selectedStreamName:T}=ge(),{drawerType:z,drawerEntityId:I}=p(),F=u(()=>ve(C,T),[C,T]),P=l(null),E=z===S.Source,[O,R]=o(!1),[D,M]=o(!1),[A,B]=o(It.Overview),[W,V]=o(null),[Y,j]=o(!1);a(()=>{E&&I&&c(I).then(e=>V(e||null))},[E,I]);const{formData:_,handleFormChange:U,resetFormData:J,loadFormWithDrawerItem:K}=ye(),Z=u(()=>{if(I)return W&&JSON.stringify(be(W))===JSON.stringify(be(I))?W:F?.find(e=>JSON.stringify(be(e))===JSON.stringify(be(I)))},[I,F,W]);a(()=>{E&&Z?K(Z):J()},[E,Z]);const G=u(()=>{const e=Z?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===N.Loading,containers:Z?.containers||[]}},[Z]),q=u(()=>!!Z?.rollbackOccurred,[Z?.rollbackOccurred]),Q=u(()=>{const e=[{label:It.Overview,onClick:()=>B(It.Overview),selected:A===It.Overview}];return k||(Nt.includes(Z?.kind)&&e.push({label:It.Pods,onClick:()=>B(It.Pods),selected:A===It.Pods}),Z?.containers?.some(e=>Pt.includes(e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language))&&e.push({label:It.Libraries,onClick:()=>B(It.Libraries),selected:A===It.Libraries}),e.push({label:It.PeerSources,onClick:()=>B(It.PeerSources),selected:A===It.PeerSources}),y&&b&&x&&w&&e.push({label:It.Profiling,onClick:()=>B(It.Profiling),selected:A===It.Profiling})),e},[A,Z,k,y,b,x,w]),ee=Ft.includes(Z?.kind),[te,ne]=o({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});if(!Z)return null;return e(Ae,{ref:P,width:Y?"95vw":A===It.Profiling?"80vw":void 0,onClose:()=>{B(It.Overview),V(null),j(!1)},title:Z.otelServiceName||Z.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:$e(Z.containers),isEdit:O,isFormDirty:D,onEdit:A===It.Overview?e=>{R("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=_.otelServiceName!==Z.name?_.otelServiceName:"";U("otelServiceName",e),await r(I,{..._,otelServiceName:e}),V(null),M(!1),R(!1)},onDelete:A===It.Overview?async()=>{const{namespace:e,name:t,kind:n}=Z;i({[e]:[{namespace:e,name:t,kind:n||void 0,selected:!1,currentStreamName:T}]}),V(null),M(!1),R(!1),P.current?.closeDrawer()}:void 0,onCancel:()=>{M(!1),R(!1),U("otelServiceName",Z.otelServiceName||Z.name||"")},isLastItem:1===F.length,tabs:Q,headerActionButtons:k?[]:ee?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>ne({openFor:Rt.Workload,workloadId:I}),children:e(t,{children:[n(Me,{}),n(v,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[A===It.Overview?O?n(Et,{children:n(Ve,{formData:_,handleFormChange:(...e)=>{M(!0),U(...e),U("currentStreamName",T)}})}):e(Ot,{children:[n(Ye,{workloadOdigosHealthStatus:Z.workloadOdigosHealthStatus}),q&&n(H,{type:L.Warning,message:$.ROLLBACK_OCCURRED_MESSAGE,action:{label:$.ROLLBACK_RECOVER,onClick:async()=>{await g(I);const e=await c(I);e&&V(e)}}}),n(we,{conditions:Z.conditions||[]}),n(X,{title:$.SOURCE_DETAILS,data:Z?We(Z,k):[]}),n(X,{title:k?$.DETECTED_PROCESSES:$.DETECTED_CONTAINERS,titleBadge:G.isLoading?N.Loading:G.containers.length,description:G.description||(k?$.DETECTED_PROCESSES_DESCRIPTION:$.DETECTED_CONTAINERS_DESCRIPTION),children:G.containers.map(e=>n(Se,{...e,callbackRuntimeOverride:e=>r(I,e)},`source-container-${e.containerName}`))}),Z.manifestYAML&&n(Ce,{title:`${Z.kind} YAML`,yaml:Z.manifestYAML,defaultOpen:!Z.instrumentationConfigYAML}),Z.instrumentationConfigYAML&&n(Ce,{title:"Instrumentation Config YAML",yaml:Z.instrumentationConfigYAML,defaultOpen:!Z.manifestYAML})]}):A===It.Pods?n(je,{source:Z,fetchSourceDescribe:d,onClickRestartPod:ee?(e,t)=>ne({openFor:Rt.Pod,podNamespace:e,podName:t}):void 0}):A===It.Libraries?n(_e,{source:Z,fetchSourceLibraries:h}):A===It.PeerSources?n(zt,{source:Z,fetchPeerSources:f}):A===It.Profiling&&y&&b&&x&&w?n(wt,{source:Z,fetchProfilingSlots:b,enableProfiling:x,fetchSourceProfiling:w,onFlameFullscreenChange:j}):null,n(ke,{isOpen:!!te.openFor,title:`Rollout Restart ${te.openFor}`,description:`Are you sure you want to rollout restart this ${te.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:L.Warning,onClick:()=>{te.openFor===Rt.Workload&&te.workloadId?s([te.workloadId]):te.openFor===Rt.Pod&&te.podNamespace&&te.podName&&m(te.podNamespace,te.podName),ne({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{ne({openFor:null})}}})]})};export{Ae as O,Lt as S,Ve 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-DHsbbgZi.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};
|