@odigos/ui-kit 0.0.242 → 0.0.244
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 +21 -0
- package/lib/chunks/{helpers-flEStb5l.js → helpers-aJJ1GhqS.js} +1 -1
- package/lib/chunks/index-BnOPIhIp.js +149 -0
- package/lib/chunks/source-instrument-form-context-5GXsAhJd.js +1 -0
- package/lib/chunks/ui-components-Dnqp-MQm.js +1592 -0
- package/lib/components/_v2/note/index.d.ts +6 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/actions/index.d.ts +0 -2
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/_drawers/edit-source-drawer/index.d.ts +2 -1
- package/lib/containers/_v2/_drawers/edit-source-drawer/jump-to-target-context.d.ts +57 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/container-row.d.ts +0 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/index.d.ts +0 -6
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/pod-row.d.ts +0 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/process-row.d.ts +0 -2
- package/lib/containers/_v2/_drawers/edit-source-drawer/overview/pods-card/pods-list/types.d.ts +1 -6
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/containers-card/index.d.ts +3 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/containers-card/process-card.d.ts +1 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/pods/pod-card.d.ts +4 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/tabs.d.ts +7 -0
- package/lib/containers/_v2/_drawers/edit-source-drawer/yaml-files/index.d.ts +2 -1
- package/lib/containers/_v2/overview/drawers/index.d.ts +2 -1
- package/lib/containers/index.d.ts +0 -1
- package/lib/containers/v2.js +118 -123
- package/lib/containers.js +7 -62
- package/lib/contexts.js +1 -1
- package/lib/functions/get-action-icon/index.d.ts +2 -2
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/useScrollIntoViewWhen.d.ts +15 -0
- package/lib/hooks.js +1 -1
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +6 -6
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +0 -19
- package/lib/types/enum/index.d.ts +2 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/k8s-manifest/index.d.ts +2 -0
- package/lib/types/workload/index.d.ts +0 -2
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-9imbvR3P.js +0 -149
- package/lib/chunks/source-instrument-form-context-4oj79EpI.js +0 -1
- package/lib/chunks/ui-components-DofONrt0.js +0 -1570
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/error-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/latency-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/probabilistic-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/service-name-sampler/index.d.ts +0 -5
- package/lib/containers/_v2/_forms/add-action-form/custom-fields/span-attribute-sampler/index.d.ts +0 -5
- package/lib/containers/notification-manager/index.d.ts +0 -4
package/lib/containers.js
CHANGED
|
@@ -1,66 +1,11 @@
|
|
|
1
|
-
import{
|
|
2
|
-
position: relative;
|
|
3
|
-
width: fit-content;
|
|
4
|
-
`,W=i(y)`
|
|
5
|
-
gap: 12px;
|
|
6
|
-
padding: 0 12px;
|
|
7
|
-
`,H=i(p)`
|
|
8
|
-
gap: 12px;
|
|
9
|
-
max-height: 400px;
|
|
10
|
-
overflow-y: auto;
|
|
11
|
-
`,U=i.div`
|
|
12
|
-
position: absolute;
|
|
13
|
-
bottom: 0;
|
|
14
|
-
left: 0;
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 45px;
|
|
17
|
-
border-radius: 0 0 24px 24px;
|
|
18
|
-
background: ${({theme:e})=>`linear-gradient(to top, ${e.colors.dropdown_bg}, transparent)`};
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
`,X=i(l)`
|
|
21
|
-
background-color: ${({theme:e})=>e.colors.orange_soft};
|
|
22
|
-
color: ${({theme:e})=>e.text.primary};
|
|
23
|
-
border-radius: 32px;
|
|
24
|
-
width: fit-content;
|
|
25
|
-
padding: 2px 8px;
|
|
26
|
-
`,J=()=>{const r=n(),{notifications:i,markAsSeen:p}=o(),g=i.filter(({hideFromHistory:e})=>!e),h=g.filter(({seen:e})=>!e),u=h.length,{popupRef:m,popupOpen:y,setPopupOpen:f,popupPosition:v,handlePosition:x}=a({defaultClientHeight:420,defaultClientwidth:400,onClickOutside:()=>{u&&h.forEach(({id:e})=>p(e))}});return e(P,{children:[t(s,{onClick:()=>{x(0,0),f(e=>!e)},tooltip:"Notifications",withPing:!!u,pingColor:r.colors.orange_og,children:t(z,{size:18})}),e(c,{ref:m,isOpen:y,right:v.left,maxWidth:"400px",header:e(W,{children:[t(l,{size:20,children:"Notifications"}),!!u&&e(X,{size:12,family:"secondary",children:[u," new"]})]}),children:[t(H,{children:g.length?g.map(e=>t(re,{...e,onClick:()=>f(!1)},`notification-${e.id}`)):t(d,{title:"No notifications",subTitle:""})}),t(U,{})]})]})},Q=i.div`
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: flex-start;
|
|
29
|
-
gap: 12px;
|
|
30
|
-
padding: 16px;
|
|
31
|
-
border-radius: 16px;
|
|
32
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2+f["080"]};
|
|
33
|
-
cursor: not-allowed;
|
|
34
|
-
&.click-enabled {
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
&:hover {
|
|
37
|
-
background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
`,Y=i.div`
|
|
41
|
-
background-color: ${({$type:e,theme:t})=>t.text[e]+f["015"]};
|
|
42
|
-
border-radius: 8px;
|
|
43
|
-
width: 36px;
|
|
44
|
-
height: 36px;
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
`,Z=i.div`
|
|
49
|
-
width: 290px;
|
|
50
|
-
`,ee=i.div`
|
|
51
|
-
margin-bottom: 6px;
|
|
52
|
-
`,te=i.div`
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
gap: 6px;
|
|
56
|
-
`,re=({id:i,seen:o,type:a,title:s,message:c,time:d,crdType:p,target:y,onClick:f})=>{const x=n(),{formatTimeAgo:b}=g(),{onClickNotification:w}=h(),N=!!p&&!!y,S=s?.toLowerCase().includes(u.Delete.toLowerCase())||!1,k=v(a,x);return e(Q,{className:N?"click-enabled":"",onClick:()=>{N&&(f(),w({id:i,crdType:p,target:y}))},children:[t(Y,{$type:S?m.Error:a,children:t(S?E:k,{})}),e(Z,{children:[t(ee,{children:t(l,{size:14,children:c})}),e(te,{children:[t(l,{size:10,color:x.text.grey,children:b(d)}),!o&&e(r,{children:[t(l,{size:10,children:"·"}),t(l,{size:10,color:x.colors.orange_soft,children:"new"})]})]})]})]},`notification-${i}`)},ie=e=>`${w.Source}-${e}-${x.MapItem}`,ne=(e,t,r)=>{const i=e.isVirtual,n=r?[I]:i?[N(e)]:t?S(t):[R],{priorotizedStatus:o}=i?{priorotizedStatus:void 0}:k(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:n,isVirtual:i,status:o,aggService:e}},oe=e=>!(!e||"user"!==e.serviceName||e.id.namespace||e.id.name||e.id.kind),ae=({theme:e,nodes:t,aggregatedServiceMap:r})=>{const i=[],n=new Map(t.map(e=>[e.id,e]));for(const t of r){const r=ie(t.graphKey),o=n.get(r);if(!o)continue;const a=o.data?.status===m.Error;for(const o of t.connections){const s=ie(o.targetGraphKey);n.has(s)&&i.push({id:`${r}-to-${s}`,type:"smoothstep",source:r,target:s,data:{sourceGraphKey:t.graphKey,targetGraphKey:o.targetGraphKey},markerEnd:{type:j.ArrowClosed},style:{stroke:a?e?.colors.dark_red:e?.colors.border}})}}return i},se=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},ce=new F,de=`${w.Source}-user-${x.MapItem}`,le={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},pe=i.div`
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as n,useRef as i,useCallback as a,useEffect as o}from"react";import{MarkerType as s,useNodesState as c,useEdgesState as d}from"@xyflow/react";import{N as l,D as p,E as u,g,d as h,e as m,S as y,f,h as v,i as x,F as S,j as N,k as b,l as K,m as T,n as w}from"./chunks/ui-components-Dnqp-MQm.js";import{UserIcon as k,ImageErrorIcon as M,ChevronDownIcon as $,ChevronRightIcon as C}from"./icons.js";import I,{useTheme as z}from"styled-components";import{E}from"./chunks/vendor-Be0cOokr.js";import{Flow as G}from"./snippets.js";import"zustand";import"javascript-time-ago";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const R=e=>`${u.Source}-${e}-${l.MapItem}`,V=(e,t,r)=>{const n=e.isVirtual,i=r?[k]:n?[g(e)]:t?h(t):[M],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:m(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:i,isVirtual:n,status:a,aggService:e}},D=e=>!(!e||"user"!==e.serviceName||e.id.namespace||e.id.name||e.id.kind),A=({theme:e,nodes:t,aggregatedServiceMap:r})=>{const n=[],i=new Map(t.map(e=>[e.id,e]));for(const t of r){const r=R(t.graphKey),a=i.get(r);if(!a)continue;const o=a.data?.status===y.Error;for(const a of t.connections){const c=R(a.targetGraphKey);i.has(c)&&n.push({id:`${r}-to-${c}`,type:"smoothstep",source:r,target:c,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:s.ArrowClosed},style:{stroke:o?e?.colors.dark_red:e?.colors.border}})}}return n},j=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},O=new E,_=`${u.Source}-user-${l.MapItem}`,q={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},B=I.div`
|
|
57
2
|
padding: 8px 0;
|
|
58
|
-
`,
|
|
3
|
+
`,F=I.div`
|
|
59
4
|
display: flex;
|
|
60
5
|
gap: 12px;
|
|
61
6
|
align-items: center;
|
|
62
7
|
padding: 4px 0 4px 16px;
|
|
63
|
-
`,
|
|
8
|
+
`,L=I.button`
|
|
64
9
|
display: flex;
|
|
65
10
|
align-items: center;
|
|
66
11
|
gap: 4px;
|
|
@@ -74,13 +19,13 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import i,{useThe
|
|
|
74
19
|
&:hover {
|
|
75
20
|
text-decoration: underline;
|
|
76
21
|
}
|
|
77
|
-
`,
|
|
22
|
+
`,W=I.div`
|
|
78
23
|
padding: 4px 0 8px;
|
|
79
|
-
`,
|
|
24
|
+
`,P=({conn:r,onToggle:n,isExpanded:i})=>{const a=r.details.length>0;return e(B,{children:t(S,{$justifyContent:"space-between",$alignItems:"center",children:[e(v,{size:14,weight:500,children:r.targetServiceName}),a&&t(L,{onClick:n,children:[e(i?$:C,{size:12}),i?"hide attributes":`${r.details.length} attribute${r.details.length>1?"s":""}`]})]})})},U=({conn:t})=>{const n=z();return e(r,{children:t.details.map(t=>e(F,{children:e(v,{size:12,color:n.text.secondary,style:{flex:1},children:t.value})},t.value))})},H=({connections:i,isVirtual:a,attributes:o})=>{const[s,c]=n(new Set),d=z();if(a){const n=Object.entries(o||{});return t(r,{children:[e(v,{size:12,color:d.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}),n.length>0&&t(r,{children:[e(W,{style:{paddingTop:16},children:e(v,{size:11,color:d.text.info,children:"Attributes"})}),n.map(([r,n])=>t(F,{children:[e(v,{size:12,color:d.text.secondary,children:r}),e(v,{size:12,children:n})]},r))]})]})}return i.length?t(r,{children:[e(W,{children:e(v,{size:11,color:d.text.info,children:"Connected services"})}),i.map(r=>t("div",{children:[e(P,{conn:r,isExpanded:s.has(r.targetGraphKey),onToggle:()=>{return e=r.targetGraphKey,void c(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r});var e}}),s.has(r.targetGraphKey)&&e(U,{conn:r}),e(x,{})]},r.targetGraphKey))]}):e(v,{size:12,color:d.text.info,children:"No outgoing connections"})},X=({conn:n})=>{const i=z();return n?e(r,{children:n.details.length>0?t(r,{children:[e(W,{children:e(v,{size:11,color:i.text.info,children:"Attribute breakdown"})}),n.details.map(t=>e(F,{children:e(v,{size:12,style:{flex:1},children:t.value})},t.value))]}):e(v,{size:12,color:i.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):e(v,{size:12,color:i.text.info,children:"No data for this connection"})},J=({drawerState:t,aggregatedData:r,onClose:n})=>{if(!t)return null;const i=new Map(r.map(e=>[e.graphKey,e]));let a="",o="",s=null;if("node"===t.type){const r=i.get(t.graphKey);a=r?.serviceName||t.graphKey,o=r?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",s=e(H,{connections:r?.connections||[],isVirtual:r?.isVirtual,attributes:r?.attributes})}else{const r=i.get(t.sourceKey),n=r?.connections.find(e=>e.targetGraphKey===t.targetKey);a=`${r?.serviceName||t.sourceKey} → ${n?.targetServiceName||t.targetKey}`,o="Connection details",s=e(X,{conn:n})}return e(f,{isOpen:!0,width:"420px",position:"right",header:{title:a,subTitle:o,onClose:n},children:s})},Q=I.div`
|
|
80
25
|
width: 100%;
|
|
81
26
|
height: ${({$heightToRemove:e})=>`calc(100vh - ${e}px)`};
|
|
82
27
|
position: relative;
|
|
83
|
-
`,
|
|
28
|
+
`,Y={id:{namespace:"",name:"",kind:""},serviceName:"user",markedForInstrumentation:{markedForInstrumentation:!0}},Z=`${u.Source}-`,ee=`-${l.MapItem}`,te=.15,re=({heightToRemove:r,serviceMap:s,onRefresh:g})=>{const h=z(),m=N(e=>e.sources),[y,f,v]=c([]),[x,S,K]=d([]),[T,w]=n(0),[k,M]=n(null),$=i([]);$.current=y;const C=i(h);C.current=h;const I=i([]),E=i([]),B=a(()=>w(e=>e+1),[]),{activeNodeId:F,setActiveNodeType:L,setActiveNodeId:W}=b();o(()=>{if(!F)return;const e=(t=F).startsWith(Z)&&t.endsWith(ee)?t.slice(Z.length,-ee.length):null;var t;e&&M({type:"node",graphKey:e})},[F]);const P=a((e,t)=>{const{sourceGraphKey:r,targetGraphKey:n}=t.data||{};r&&n&&(L(null),W(null),M({type:"edge",sourceKey:r,targetKey:n}))},[L,W]),U=a(()=>{M(null),L(null),W(null)},[L,W]),H=a((e,t)=>{const r=t.id;S(e=>e.map(e=>e.source===r||e.target===r?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:te},labelStyle:{...e.labelStyle,opacity:te},labelBgStyle:{...e.labelBgStyle,opacity:te}}))},[S]),X=a(()=>{S(E.current)},[S]);return o(()=>{let e=!1;const t=(e=>{const t=new Map,r=new Set,n=(e,r,n=!1)=>{let i=t.get(e);return i||(i={serviceName:r,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:r,value:n}of t)r in e||(e[r]=n)};for(const t of e){const{graphKey:e}=j(t.nodeId),a=n(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:o}=j(e?.nodeId??"");e.isVirtual&&(r.add(t),i(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let s=a.connectionMap.get(t);if(s||(s={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,s)),s.totalRequests+=e.requests,e.dateTime>s.lastDateTime&&(s.lastDateTime=e.dateTime),o){const t=s.details.find(e=>e.value===o);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):s.details.push({value:o,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||n(i,a.targetServiceName,r.has(i));const o=[];for(const[e,{serviceName:r,isVirtual:n,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),o.push({graphKey:e,serviceName:r,isVirtual:n,connections:t,attributes:i})}return o.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),o})(s);I.current=t;const r=(({sources:e,aggregatedServiceMap:t})=>{const r=[],n={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=R(i.graphKey),a=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name);r.push({id:t,type:l.MapItem,position:n,data:V(i,a,D(a)),measured:{width:80,height:80}})}else r.push({id:`${u.Source}-${l.NoData}`,type:l.NoData,position:n,data:{subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return r})({aggregatedServiceMap:t,sources:[Y].concat(m)});if(1===r.length&&r[0].id===`${u.Source}-${l.NoData}`)return f(r),S([]),void(E.current=[]);const n=new Set($.current.map(e=>e.id)),i=new Set(r.map(e=>e.id)),a=r.some(e=>!n.has(e.id)),o=$.current.some(e=>!i.has(e.id));if(!(a||o)){const e=new Map($.current.map(e=>[e.id,e.position]));f(r.map(t=>({...t,position:e.get(t.id)??t.position})));const n=A({theme:C.current,nodes:r,aggregatedServiceMap:t});return E.current=n,void S(n)}return(async(e,t,r={})=>{const n={id:"root",layoutOptions:{...q,...r},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===_?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await O.layout(n),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(r,A({theme:C.current,nodes:r,aggregatedServiceMap:t})).then(({nodes:t})=>{if(e)return;f(t);const r=A({theme:C.current,nodes:t,aggregatedServiceMap:I.current});E.current=r,S(r),B()}),()=>{e=!0}},[s,m]),o(()=>{if(!$.current.length)return;const e=A({theme:h,nodes:$.current,aggregatedServiceMap:I.current});E.current=e,S(e)},[h]),t(Q,{$heightToRemove:r,children:[e(G,{nodes:y,edges:x,onNodesChange:v,onEdgesChange:K,onEdgeClick:P,onNodeMouseEnter:H,onNodeMouseLeave:X,onRefresh:g,fitViewTrigger:T,zoomOnScroll:!0}),e(J,{drawerState:k,aggregatedData:I.current,onClose:U})]})},ne=I.div`
|
|
84
29
|
position: fixed;
|
|
85
30
|
bottom: 12px;
|
|
86
31
|
left: 12px;
|
|
@@ -89,4 +34,4 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import i,{useThe
|
|
|
89
34
|
flex-direction: column-reverse;
|
|
90
35
|
gap: 6px;
|
|
91
36
|
max-width: 600px;
|
|
92
|
-
`,
|
|
37
|
+
`,ie=()=>{const{notifications:t,markAsDismissed:r,markAsSeen:n}=K(),{onClickNotification:i}=T(),a=t.filter(({dismissed:e})=>!e);return e(ne,{children:a.map(({id:t,type:o,title:s,message:c,crdType:d,target:l},p)=>{const u=c||s;if(!u)return null;const g=a.length-p;return e(w,{status:o,message:u,action:d&&l?{label:"go to details",onClick:()=>i({id:t,crdType:d,target:l},{dismissToast:!0})}:void 0,onClose:({asSeen:e})=>(({id:e,asSeen:t})=>{r(e),t&&n(e)})({id:t,asSeen:e}),zIndex:g},`toast-${t}`)})})};export{re as ServiceMap,ie as ToastList};
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-
|
|
1
|
+
export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-5GXsAhJd.js";export{O as OdigosProvider,c as checkVersionSupport,u as useOdigos}from"./chunks/helpers-aJJ1GhqS.js";import{jsx as r}from"react/jsx-runtime";import{useMemo as o,useContext as t,createContext as s}from"react";import"./chunks/ui-components-Dnqp-MQm.js";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const m=s({formType:void 0}),n=({children:e,formType:t})=>{const s=o(()=>({formType:t}),[t]);return r(m.Provider,{value:s,children:e})},p=()=>t(m);export{n as StorybookProvider,p as useStorybook};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getActionIcon: (type: ActionType
|
|
1
|
+
import { ActionType, type SVG } from '@/types';
|
|
2
|
+
export declare const getActionIcon: (type: ActionType) => SVG;
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{aV as buildBadgeForDesiredStatus,f2 as capitalizeFirstLetter,f3 as cleanObjectEmptyStringsValues,a8 as compareCondition,f4 as decimalsOnly,p as deepClone,dd as entityIdKey,dh as filterActions,dg as filterDestinations,aO as filterDestinationsByStream,df as filterSources,d1 as filterSourcesByStream,f5 as flattenObjectKeys,b8 as formatBytes,f6 as formatDuration,bJ as generateId,aM as getActionIcon,e as getConditionsBooleans,bm as getContainersIcons,f7 as getContainersInstrumentedCount,f8 as getDeepValue,az as getDestinationIcon,f9 as getDetectedLanguageIcons,a_ as getEffectiveLanguage,bg as getEffectiveRuntimeVersion,d7 as getEntityIcon,aH as getEntityId,dc as getEntityIdKey,d6 as getEntityLabel,ba as getHealthBadgeLabel,fa as getIdFromSseTarget,aS as getInstrumentationRuleIcon,fb as getMainContainerLanguage,fc as getMetricForEntity,fd as getMonitorIcon,fe as getPlatformIcon,ff as getPlatformLabel,ag as getProgrammingLanguageIcon,fg as getRecursiveValues,d as getSourceLanguageIcons,fh as getSseTargetFromId,fi as getStatusColor,dm as getStatusFromPodStatus,db as getStatusIcon,bb as getStatusTypeFromOdigosHealth,fj as getValueForRange,g as getVirtualServiceIcon,b6 as getWorkloadId,aP as getYamlFieldsForDestination,fk as hasUnhealthyInstances,s as isEmpty,x as isLegalK8sLabel,bF as isOverTime,fl as isStringABoolean,fm as isTimeElapsed,bf as isValidVersion,fn as mapConditions,aY as mapDesiredStatusToConditionStatus,aN as mapDestinationFieldsForDisplay,G as mapExportedSignals,z as mapSupportedSignals,fo as numbersOnly,fp as parseBooleanFromString,fq as parseJsonStringToPrettyString,a9 as prepareDestinationFormData,fr as removeEmptyValuesFromObject,C as safeJsonParse,fs as safeJsonStringify,ft as setDeepValue,fu as sleep,aQ as splitCamelString,fv as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-Dnqp-MQm.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './useGenericForm';
|
|
|
10
10
|
export * from './useInstrumentationRuleFormData';
|
|
11
11
|
export * from './useKeyDown';
|
|
12
12
|
export * from './useOnClickOutside';
|
|
13
|
+
export * from './useScrollIntoViewWhen';
|
|
13
14
|
export * from './useScrollTo';
|
|
14
15
|
export * from './usePopup';
|
|
15
16
|
export * from './useSessionStorage';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface UseScrollIntoViewWhenOptions extends ScrollIntoViewOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Delay (ms) between `active` flipping to `true` and the scroll firing. Useful when parent
|
|
4
|
+
* layout needs to settle (e.g. ancestor collapsibles expanding) before the scroll target's
|
|
5
|
+
* final position is correct. Defaults to 50ms.
|
|
6
|
+
*/
|
|
7
|
+
delayMs?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Returns a ref. Whenever `active` is `true`, scrolls the attached element into view after
|
|
11
|
+
* `delayMs` (so any in-flight layout changes can finish first). Cleans up the pending scroll
|
|
12
|
+
* if `active` flips back or the component unmounts before it fires.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useScrollIntoViewWhen: <T extends HTMLElement = HTMLDivElement>(active: boolean, { behavior, block, inline, delayMs }?: UseScrollIntoViewWhenOptions) => import("react").RefObject<T | null>;
|
|
15
|
+
export {};
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{fG as IGNORE_OUTSIDE_CLICK_ATTR,fH as useActionFormData,fI as useBodyScroll,d5 as useClickNode,m as useClickNotification,de as useContainerSize,b9 as useCopy,fJ as useDataStreamFormData,fK as useDestinationFormData,o as useGenericForm,fL as useInstrumentationRuleFormData,bE as useKeyDown,bc as useOnClickOutside,u as usePopup,aU as useScrollIntoViewWhen,dK as useScrollTo,d4 as useSessionStorage,fM as useSourceFormData,aT as useTimeAgo}from"./chunks/ui-components-Dnqp-MQm.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/snippets/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{b2 as ActionType,dl as Actions,dk as RichTitle}from"../chunks/ui-components-Dnqp-MQm.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,a as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,b as SamplingPreviewSection,S as SignalsCheckboxList,c as SourceScopeSection,U as UpgradeModal,i as WIDE_DRAWER_WIDTH,W as WideDrawer,Y as YamlSectionCard}from"../chunks/index-BnOPIhIp.js";export{C as ColoredSpan,x as ColoredSpanVariant}from"../chunks/helpers-aJJ1GhqS.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/snippets.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{memo as r,useRef as i,useEffect as n}from"react";import"./chunks/vendor-Be0cOokr.js";import d,{useTheme as s}from"styled-components";import{a4 as a,R as l,eB as c,h as p,S as m,db as u,d5 as h,k as g,N as b}from"./chunks/ui-components-Dnqp-MQm.js";import{Handle as x,Position as f,ReactFlowProvider as v,ReactFlow as y,Controls as w,ControlButton as N,useReactFlow as k}from"@xyflow/react";import{RefreshIcon as $}from"./icons.js";import"javascript-time-ago";import"zustand";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const C=d(l)`
|
|
2
2
|
max-width: 300px;
|
|
3
3
|
padding: 12px;
|
|
4
4
|
border-radius: 12px;
|
|
5
5
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
6
6
|
justify-content: center;
|
|
7
|
-
`,E=
|
|
7
|
+
`,E=r(({id:o,data:t})=>{const{title:r,subTitle:i}=t;return e(C,{"data-id":o,children:e(a,{title:r,subTitle:i})})});E.displayName=E.name;const V=d.div`
|
|
8
8
|
padding: 6px;
|
|
9
9
|
border-radius: 12px;
|
|
10
10
|
background-color: ${({theme:e})=>e.colors.dropdown_bg};
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
${({$isVirtual:e,theme:o})=>e&&`\n border: 1px dashed ${o.colors.border};\n opacity: 0.8;\n `}
|
|
13
|
-
`,V=d.div`
|
|
14
|
-
position: relative;
|
|
15
13
|
`,_=d.div`
|
|
14
|
+
position: relative;
|
|
15
|
+
`,j=d.div`
|
|
16
16
|
position: absolute;
|
|
17
17
|
top: 100%;
|
|
18
18
|
margin-top: 4px;
|
|
@@ -24,7 +24,7 @@ import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{memo as t
|
|
|
24
24
|
gap: 2px;
|
|
25
25
|
width: 140px;
|
|
26
26
|
text-align: center;
|
|
27
|
-
`,z=
|
|
27
|
+
`,z=r(({id:r,data:i})=>{const{id:n,status:d,title:a,icons:l,isVirtual:h}=i,g=s(),b=h||d!==m.Error?null:u(d,g);return o(t,{children:[e(x,{type:"source",position:f.Right,style:{visibility:"hidden"}}),e(x,{type:"target",position:f.Left,style:{visibility:"hidden"}}),o(_,{"data-id":r,children:[e(V,{$isVirtual:h,children:e(c,{id:n,icons:l,status:h?void 0:d})}),o(j,{children:[b&&e(b,{}),e(p,{size:12,style:{textAlign:"center",wordBreak:"break-word",lineHeight:"1.3"},children:a})]})]})]})});z.displayName=z.name;const M={duration:300,padding:.1,includeHiddenNodes:!0},T=d.div`
|
|
28
28
|
height: 100%;
|
|
29
29
|
.react-flow__attribution {
|
|
30
30
|
visibility: hidden;
|
|
@@ -46,4 +46,4 @@ import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{memo as t
|
|
|
46
46
|
transform: scale(1.4);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
`,
|
|
49
|
+
`,B={[b.MapItem]:z,[b.NoData]:E},I=({trigger:e})=>{const{fitView:o}=k(),t=i(!0);return n(()=>{t.current?t.current=!1:e>0&&requestAnimationFrame(()=>o(M))},[e,o]),null},L=({nodes:t,edges:r,onNodesChange:i,onEdgesChange:n,fitViewTrigger:d=0,zoomOnScroll:s=!1,onEdgeClick:a,onNodeMouseEnter:l,onNodeMouseLeave:c,onRefresh:p})=>{const{onClickNode:m}=h(),{setActiveNodeType:u,setActiveNodeId:b}=g();return o(y,{zoomOnScroll:s,nodes:t,nodeTypes:B,edges:r,onNodeClick:m,onEdgeClick:a,onNodeMouseEnter:l,onNodeMouseLeave:c,onNodesChange:i,onEdgesChange:n,onBlur:()=>{u(null),b(null)},children:[e(I,{trigger:d}),e(A,{children:e(w,{position:"bottom-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:M,children:p&&e(N,{onClick:p,children:e($,{size:20})})})})]})},O=o=>e(T,{children:e(v,{children:e(L,{...o})})});export{O as Flow,z as MapItemNode,E as NoDataNode};
|
package/lib/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{aE as ProgressKeys,k as useActiveNodeStore,fF as useDarkMode,w as useDataStreamStore,b5 as useDrawerStore,j as useEntityStore,d0 as useFilterStore,bK as useModalStore,l as useNotificationStore,aD as useProgressStore,d9 as useSelectedStore,di as useSetupStore}from"./chunks/ui-components-Dnqp-MQm.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{fN as Provider,fO as animations,fP as opacity,fQ as palettes}from"./chunks/ui-components-Dnqp-MQm.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import { SignalType } from '../signals';
|
|
2
2
|
import type { Condition, SVG } from '../common';
|
|
3
|
-
export declare enum ActionCategory {
|
|
4
|
-
Attributes = "attributes",
|
|
5
|
-
Samplers = "samplers"
|
|
6
|
-
}
|
|
7
3
|
export declare enum ActionType {
|
|
8
4
|
K8sAttributes = "K8sAttributesResolver",
|
|
9
5
|
AddClusterInfo = "AddClusterInfo",
|
|
10
6
|
DeleteAttributes = "DeleteAttribute",
|
|
11
7
|
RenameAttributes = "RenameAttribute",
|
|
12
8
|
PiiMasking = "PiiMasking",
|
|
13
|
-
ErrorSampler = "ErrorSampler",
|
|
14
|
-
ProbabilisticSampler = "ProbabilisticSampler",
|
|
15
|
-
LatencySampler = "LatencySampler",
|
|
16
|
-
ServiceNameSampler = "ServiceNameSampler",
|
|
17
|
-
SpanAttributeSampler = "SpanAttributeSampler",
|
|
18
9
|
URLTemplatization = "URLTemplatization"
|
|
19
10
|
}
|
|
20
11
|
export declare enum ActionKeyTypes {
|
|
@@ -29,11 +20,6 @@ export declare enum ActionKeyTypes {
|
|
|
29
20
|
AttributeNamesToDelete = "attributeNamesToDelete",
|
|
30
21
|
Renames = "renames",
|
|
31
22
|
PiiCategories = "piiCategories",
|
|
32
|
-
FallbackSamplingRatio = "fallbackSamplingRatio",
|
|
33
|
-
SamplingPercentage = "samplingPercentage",
|
|
34
|
-
EndpointsFilters = "endpointsFilters",
|
|
35
|
-
ServicesNameFilters = "servicesNameFilters",
|
|
36
|
-
AttributeFilters = "attributeFilters",
|
|
37
23
|
UrlTemplatizationRulesGroups = "urlTemplatizationRulesGroups"
|
|
38
24
|
}
|
|
39
25
|
export interface ActionOption {
|
|
@@ -77,11 +63,6 @@ export interface ActionFields {
|
|
|
77
63
|
[oldKey: string]: string;
|
|
78
64
|
} | null;
|
|
79
65
|
[ActionKeyTypes.PiiCategories]?: string[] | null;
|
|
80
|
-
[ActionKeyTypes.FallbackSamplingRatio]?: number | null;
|
|
81
|
-
[ActionKeyTypes.SamplingPercentage]?: number | null;
|
|
82
|
-
[ActionKeyTypes.EndpointsFilters]?: EndpointsFilters[] | null;
|
|
83
|
-
[ActionKeyTypes.ServicesNameFilters]?: ServicesNameFilters[] | null;
|
|
84
|
-
[ActionKeyTypes.AttributeFilters]?: AttributeFilters[] | null;
|
|
85
66
|
[ActionKeyTypes.UrlTemplatizationRulesGroups]?: UrlTemplatizationRulesGroup[] | null;
|
|
86
67
|
}
|
|
87
68
|
export declare enum K8sAttributesFrom {
|
|
@@ -7,7 +7,8 @@ export declare enum K8sResourceKind {
|
|
|
7
7
|
StaticPod = "StaticPod",
|
|
8
8
|
Rollout = "Rollout",
|
|
9
9
|
ConfigMap = "ConfigMap",
|
|
10
|
-
DeploymentConfig = "DeploymentConfig"
|
|
10
|
+
DeploymentConfig = "DeploymentConfig",
|
|
11
|
+
InstrumentationConfig = "InstrumentationConfig"
|
|
11
12
|
}
|
|
12
13
|
export declare enum OtelDistroName {
|
|
13
14
|
GolangCommunity = "golang-community",
|
package/lib/types/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './diagnose';
|
|
|
9
9
|
export * from './enum';
|
|
10
10
|
export * from './instrumentation-instances';
|
|
11
11
|
export * from './instrumentation-rules';
|
|
12
|
+
export * from './k8s-manifest';
|
|
12
13
|
export * from './metrics';
|
|
13
14
|
export * from './namespaces';
|
|
14
15
|
export * from './pipeline-collectors';
|
|
@@ -172,8 +172,6 @@ export interface Workload {
|
|
|
172
172
|
dataStreamNames?: string[] | null;
|
|
173
173
|
numberOfInstances?: number | null;
|
|
174
174
|
autoRollback?: K8sWorkloadAutoRollback | null;
|
|
175
|
-
manifestYAML?: string | null;
|
|
176
|
-
instrumentationConfigYAML?: string | null;
|
|
177
175
|
}
|
|
178
176
|
export type GetWorkloads = (filter: WorkloadFilter) => Promise<{
|
|
179
177
|
workloads: Workload[];
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{q as ActionKeyTypes,r as ActionType,eC as AddNodeTypes,eD as AgentInjectedReason,eE as BooleanOperation,ab as CodeAttributesKeyTypes,eF as ConditionType,eG as Crud,K as CustomInstrumentationsKeyTypes,aW as DesiredStateProgress,eH as DestinationTypes,eI as EdgeTypes,E as EntityTypes,H as FieldTypes,L as GolangCustomProbe,J as HeadersCollectionKeyTypes,dM as InputTypes,eJ as InstallationMethod,O as InstrumentationRuleType,eK as IntrumentationStatus,M as JavaCustomProbe,eL as JsonOperation,Y as K8sAttributesFrom,Q as K8sResourceKind,eM as K8sWorkloadContainerAgentConfigTracesHeadSamplingCheckConditionOperator,eN as ListDirection,N as NodeTypes,eO as NumberOperation,eP as OtelDistroName,eQ as OtherEntityTypes,a$ as OtherStatus,aA as OtherStatusType,ad as PayloadCollectionKeyTypes,P as PlatformType,eR as PodContainerLifecycleStatus,eS as PodContainerStatus,eT as PodPhase,eU as Profile,bj as ProgrammingLanguages,eV as SIGNAL_KEY_TO_TYPE,eW as SIGNAL_TYPE_TO_KEY,eX as SignalKey,B as SignalType,eY as SortDirection,S as StatusType,eZ as StringOperation,T as Tier,e_ as WorkloadRolloutReason,dn as WorkloadRolloutStatus}from"./chunks/ui-components-Dnqp-MQm.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/lib/visuals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{e$ as VISUAL_ODIGOS_LOGO_HEIGHT,f0 as VISUAL_ODIGOS_LOGO_WIDTH,ez as VisualGreenRings,f1 as VisualOdigosLogo,bV as VisualPurpleRings}from"./chunks/ui-components-Dnqp-MQm.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
|
package/package.json
CHANGED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import{ap as e,ab as a,R as t,a6 as l,a7 as r,dP as i,a0 as n,aB as s,ae as o,a4 as d,O as c,a8 as u,a2 as p,a3 as h,T as g,h as m,F as v,$ as b,ad as f,ay as y,dQ as x,dR as S,aI as C,dS as k,b as T,dT as w,ai as $,c as P,dU as A,dV as M,dW as O,dX as L,dY as z,dZ as D,d_ as I,cx as R,d$ as X,e0 as N,e1 as B,e2 as E,e3 as H,bK as V,aa as j,e4 as q,e5 as U,e6 as G,e7 as K,e8 as J,e9 as W,ea as F,eb as Y,ec as Z,ed as Q,ee as _,az as ee,ef as ae,eg as te,eh as le,ei as re,ej as ie,bx as ne,ek as se,el as oe,em as de,en as ce,eo as ue,ep as pe,eq as he,er as ge,a9 as me,es as ve,et as be,eu as fe,ev as ye,ag as xe,ew as Se,S as Ce,ex as ke,ey as Te,ez as we,eA as $e,eB as Pe,dc as Ae,ao as Me,bn as Oe,w as Le,d7 as ze,a1 as De,eC as Ie,b9 as Re,aA as Xe,N as Ne,o as Be,aE as Ee,dp as He,b8 as Ve,be as je,b7 as qe,bN as Ue,aR as Ge,eD as Ke}from"./ui-components-DofONrt0.js";import{jsx as Je,jsxs as We,Fragment as Fe}from"react/jsx-runtime";import{u as Ye,w as Ze,x as Qe,C as _e,y as ea,z as aa,A as ta,B as la,D as ra,E as ia,F as na}from"./helpers-flEStb5l.js";import{OdigosLogoTextCentral as sa,OdigosLogoTextEnterprise as oa,OdigosLogoTextCommunity as da,OdigosLogoTextColoredCentral as ca,OdigosLogoTextColoredEnterprise as ua,OdigosLogoTextColoredCommunity as pa,EditIcon as ha,ArrowLeftIcon as ga,ArrowRightIcon as ma,VSquareIcon as va,VIcon as ba,CopyIcon as fa,YamlIcon as ya}from"../icons.js";import{useCallback as xa,useMemo as Sa,useState as Ca,useRef as ka,useEffect as Ta,forwardRef as wa,useImperativeHandle as $a}from"react";import Pa from"styled-components";const Aa=({isOpen:t,onClose:l,onDeny:r,onApprove:i})=>Je(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()}}}),Ma=({isOpen:t,onClose:l,onDeny:r,onApprove:i,action:n="delete",target:s,description:o,overrideApproveButtonLabel:d,overrideDenyButtonLabel:c})=>{const u=n.charAt(0).toUpperCase()+n.substring(1),p=s?.endsWith("s")?"these":"this";return Je(e,{title:`${u}${s?` ${s}`:""}?`,description:o??`Are you sure you want to ${n}${s?` ${p} ${s}`:""}?`,isOpen:t,onClose:l,denyButton:{label:c??"Go back",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:d??u,variant:a.Primary,onClick:()=>{i?.(),l()}}})},Oa=({componentType:e,inputType:a,name:g,label:m,tooltip:v,badge:b,placeholder:f,required:y,disabled:x,value:S,setValue:C,errorMessage:k,warnMessage:T,helpMessage:w,dropdownOptions:$,dropdownNoSearch:P,dropdownNoCheckbox:A,timeUnits:M,timeDefaultUnit:O})=>{switch(e){case t.Input:return Je(p,{name:g,type:a,label:m,tooltip:v,badge:b,placeholder:f,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:T,helpMessage:w},g);case t.MultiInput:return Je(u,{name:g,label:m,tooltip:v,badge:b,placeholder:f,required:y,disabled:x,values:Array.isArray(S)?S:c(S,[]),setValues:e=>C(e),errorMessage:k,warnMessage:T,helpMessage:w},g);case t.KeyValuePair:return Je(d,{name:g,label:m,tooltip:v,badge:b,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:T,helpMessage:w},g);case t.TextArea:return Je(o,{name:g,label:m,tooltip:v,badge:b,required:y,disabled:x,placeholder:f,value:S??"",onChange:e=>C(e.target.value),errorMessage:k,warnMessage:T,helpMessage:w},g);case t.Dropdown:return Je(s,{name:g,label:m,tooltip:v,badge:b,placeholder:f,required:y,disabled:x,withSearch:!P,options:$?.map(e=>({id:e.id||"",label:e.label||"",withCheckbox:!A}))||[],values:S?[String(S)]:[],setValues:e=>C(e[0]),errorMessage:k,warnMessage:T,helpMessage:w},g);case t.Checkbox:return Je(n,{name:g,label:m,tooltip:v,badge:b,value:!0===S||"true"===S,onChange:e=>C(e),disabled:x,errorMessage:k,warnMessage:T,helpMessage:w},g);case t.Time:return Je(i,{name:g,label:m,tooltip:v,badge:b,placeholder:f,required:y,disabled:x,value:S??"",setValue:e=>C(e),units:M,defaultUnit:O,errorMessage:k,warnMessage:T,helpMessage:w},g);case t.Toggle:return Je(l,{name:g,labelAlign:r.Right,label:m,tooltip:v,badge:b,value:!0===S||"true"===S,onChange:e=>C(e),disabled:x,errorMessage:k,warnMessage:T,helpMessage:w},g);default:return null}},La=({size:e=200,central:a=!1,useInline:t=!1})=>{const{tier:l}=Ye();if(t){if(a)return Je(sa,{size:e});switch(l){case g.Community:return Je(da,{size:e});case g.Onprem:return Je(oa,{size:e});default:return null}}if(a)return Je(ca,{size:e});switch(l){case g.Community:return Je(pa,{size:e});case g.Onprem:return Je(ua,{size:e});default:return null}},za=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],Da=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],Ia=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],Ra=({description:e,options:a,selected:t,onSelect:l,customName:r,customLabel:i,customPlaceholder:n,customValue:s,onCustomChange:o,customInputType:d=h.Number,customMin:c,customMax:u})=>We(m,{$gap:16,$alignItems:"flex-end",children:[We(v,{$gap:6,children:[Je(b,{label:e}),Je(f,{options:a,selected:t,setSelected:l})]}),"custom"===t&&Je(p,{name:r,label:i,placeholder:n,type:d,value:s,onChange:o,width:160,min:c,max:u})]}),Xa=()=>{},Na=e=>e.readOnly?Je(Ba,{rule:e.rule}):Je(Ea,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),Ba=({rule:e})=>{const a=null!=e.durationAtLeastMs;return e.error?Je(y,{richTitle:{title:x},children:Je(l,{name:"sampling-view-toggle-keep-errors",onChange:Xa,value:!0,size:C.S,label:S,labelAlign:r.Right})}):a?Je(y,{richTitle:{title:k},children:We("div",{children:[Je(T,{size:P.XXXS,color:$.Secondary,children:w}),Je(T,{size:P.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},Ea=({ruleType:e,formState:a,onChange:t})=>{const i=xa(e=>t({durationPreset:e}),[t]),n=xa(e=>t({customDurationMs:e.target.value}),[t]);return"Error"===e?Je(y,{richTitle:{title:x,subTitle:A},children:Je(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:Xa,size:C.S,label:S,labelAlign:r.Right})}):"Duration"===e?Je(y,{richTitle:{title:k,subTitle:M},children:Je(Ra,{description:w,options:Ia,selected:a.durationPreset,onSelect:i,customName:"sampling-input-custom-duration",customLabel:O,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:n})}):null},Ha=Pa.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
gap: 32px;
|
|
4
|
-
`,Va=Pa.div`
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
gap: 4px;
|
|
8
|
-
`,ja=Pa.div`
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-wrap: wrap;
|
|
11
|
-
align-items: flex-end;
|
|
12
|
-
gap: 16px;
|
|
13
|
-
`,qa=Pa.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
|
-
`,Ua=Pa.div`
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: flex-end;
|
|
23
|
-
gap: 10px;
|
|
24
|
-
flex: 1;
|
|
25
|
-
`,Ga=Pa.div`
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
height: 32px;
|
|
29
|
-
`,Ka=Pa.div`
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: flex-end;
|
|
32
|
-
gap: 16px;
|
|
33
|
-
margin-bottom: 12px;
|
|
34
|
-
`,Ja="Any",Wa="Kafka topic",Fa=()=>Je("div",{style:{marginBottom:"8px"},children:Je(T,{size:P.XS,weight:500,children:"And"})}),Ya=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Za=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Qa=[{id:"",label:Ja},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const _a=e=>e.readOnly?Je(et,{data:e.data}):Je(at,{category:e.category,formState:e.formState,onChange:e.onChange}),et=({data:e})=>{const a=Sa(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:K,value:G},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||J},{id:"method",title:q,value:a.httpServer.method||Ja}];if(a?.httpClient){const e=[{id:"type",title:K,value:W}];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||J}),e.push({id:"method",title:q,value:a.httpClient.method||Ja}),e}return[{id:"type",title:K,value:F}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:K,value:G},{id:"route",title:B,value:a.httpServer.route||a.httpServer.routePrefix||J},{id:"method",title:q,value:a.httpServer.method||Ja}]:a?.kafkaConsumer?[{id:"type",title:K,value:Y},{id:"topic",title:Wa,value:a.kafkaConsumer.kafkaTopic||J}]:a?.kafkaProducer?[{id:"type",title:K,value:Z},{id:"topic",title:Wa,value:a.kafkaProducer.kafkaTopic||J}]:[{id:"type",title:K,value:F}]}(e),[e]);return Je(y,{richTitle:{title:L},children:Je(Ha,{children:a.map(({id:e,title:a,value:t})=>We(Va,{children:[Je(T,{size:P.XXXS,color:$.Secondary,nowrap:!0,children:a}),Je(T,{size:P.XS,nowrap:!0,children:t})]},e))})})},at=({category:e,formState:t,onChange:l})=>{const r=Sa(()=>"noisy"===e?Ya:Za,[e]),i=xa(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),n=xa(e=>a=>{a&&l({routeType:e,route:""})},[l]),s=xa(e=>l({route:e.target.value}),[l]),o=xa(e=>l({serverAddress:e.target.value}),[l]),d=xa(e=>l({method:e[0]||""}),[l]),c=xa(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?N:B,m="httpClient"===t.operationType?E:H;return We(y,{richTitle:{title:`2. ${L}`,subTitle:z},children:[Je(v,{$alignItems:"flex-start",children:Je(f,{options:r,selected:t.operationType,setSelected:i})}),u&&We(ja,{children:["httpClient"===t.operationType&&We(Ka,{children:[Je(p,{name:"sampling-input-server-address",label:I,placeholder:D,value:t.serverAddress,onChange:o}),Je(Fa,{})]}),We(qa,{children:[We(Ua,{children:[Je(Ga,{children:Je(R,{"data-id":"sampling-radio-route",value:"route"===t.routeType,onChange:n("route")})}),Je(p,{name:"sampling-input-route",label:g,placeholder:X,value:"route"===t.routeType?t.route:"",onChange:s,disabled:"route"!==t.routeType})]}),We(Ua,{children:[Je(Ga,{children:Je(R,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===t.routeType,onChange:n("routePrefix")})}),Je(p,{name:"sampling-input-route-prefix",label:m,placeholder:X,value:"routePrefix"===t.routeType?t.route:"",onChange:s,disabled:"routePrefix"!==t.routeType})]})]}),We(Ka,{children:[Je(Fa,{}),Je(V,{label:q,items:Qa,selectedIds:[t.method||""],setSelectedIds:e=>d(e),buttonProps:{"data-id":"sampling-btn-method",label:Qa.find(e=>e.id===t.method)?.label||Ja,size:j.S,variant:a.Secondary}})]})]}),h&&Je(p,{name:"sampling-input-kafka-topic",label:U,placeholder:"Type kafka topic",value:t.kafkaTopic,onChange:c,width:"320px"})]})},tt=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],lt=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const rt=e=>e.readOnly?Je(it,{data:e.data}):Je(nt,{category:e.category,formState:e.formState,onChange:e.onChange}),it=({data:e})=>{const a=Sa(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:_,method:le,description:ae,value:`${e.rule.percentageAtLeast}%`}:{title:_,method:ie,description:null,value:null};case"noisy":return Ze(e.rule.percentageAtMost)?{title:_,method:re,description:null,value:null}:{title:_,method:le,description:te,value:`${e.rule.percentageAtMost}%`};case"costReduction":return{title:_,method:le,description:te,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:q,value:a.method},...null!=a.description?[{id:"value",title:a.description,value:a.value}]:[]];return Je(y,{richTitle:{title:a.title},children:Je(Ha,{children:t.map(({id:e,title:a,value:t})=>We(Va,{children:[Je(T,{size:P.XXXS,color:$.Secondary,nowrap:!0,children:a}),Je(T,{size:P.XS,nowrap:!0,children:t})]},e))})})},nt=({category:e,formState:a,onChange:t})=>{const l="highlyRelevant"===e,r=l?lt:tt,i=`${l?4:3}. ${_}`,n=Q[e],s=l?ae:te,o="noisy"===e?Da:za,d=xa(e=>t({percentageMode:e}),[t]),c=xa(e=>t({percentagePreset:e}),[t]),u=xa(e=>t({customPercentage:e.target.value}),[t]);return We(y,{richTitle:{title:i,subTitle:n},children:["costReduction"!==e&&Je(v,{$alignItems:"flex-start",children:Je(f,{options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&Je(Ra,{description:s,options:o,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:ee,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:u,customInputType:h.Decimal,customMin:0,customMax:100})]})},st=Pa.div`
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: flex-end;
|
|
37
|
-
gap: 16px;
|
|
38
|
-
`,ot=Pa.div`
|
|
39
|
-
width: 280px;
|
|
40
|
-
flex-shrink: 0;
|
|
41
|
-
`,dt=Pa.div`
|
|
42
|
-
flex: 1;
|
|
43
|
-
min-width: 0;
|
|
44
|
-
`;function ct(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":he[e.category]}const ut=e=>e.readOnly?Je(pt,{data:e.data}):Je(ht,{formState:e.formState,onChange:e.onChange}),pt=({data:e})=>{const a=Sa(()=>[{id:"name",title:se,value:e.rule.name||ne},{id:"type",title:oe,value:ct(e)}],[e]),t=e.rule.notes||J;return We(y,{children:[Je(Ha,{children:a.map(({id:e,title:a,value:t})=>We(Va,{children:[Je(T,{size:P.XXXS,color:$.Secondary,nowrap:!0,children:a}),Je(T,{size:P.XS,nowrap:!0,children:t})]},e))}),We(Va,{children:[Je(T,{size:P.XXXS,color:$.Secondary,children:de}),Je(T,{size:P.XS,children:t})]})]})},ht=({formState:e,onChange:a})=>{const t=xa(e=>a({name:e.target.value}),[a]),l=xa(e=>a({notes:e.target.value}),[a]);return Je(y,{children:We(st,{children:[Je(ot,{children:Je(p,{name:"sampling-input-rule-name",label:se,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:ce,value:e.name,onChange:t})}),Je(dt,{children:Je(p,{name:"sampling-input-note",label:de,tooltip:pe,placeholder:ue,value:e.notes,onChange:l})})]})})},gt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],mt=({formState:e,onChange:a})=>{const t=xa(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return Je(y,{richTitle:{title:`3. ${oe}`,subTitle:ge},children:Je(v,{$alignItems:"flex-start",children:Je(f,{options:gt,selected:e.ruleType,setSelected:t})})})},vt=Pa.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
|
-
`,bt=Pa.div`
|
|
52
|
-
flex: 1;
|
|
53
|
-
min-width: 0;
|
|
54
|
-
white-space: pre;
|
|
55
|
-
overflow-x: auto;
|
|
56
|
-
`,ft=({title:e,summary:t,onEdit:l,renderAction:r})=>{const i=Sa(()=>{const a=[];return e&&(a.push({text:e,variant:Qe.Default}),a.push({text:" - ",variant:Qe.Default})),a.push(...t),a},[e,t]);return We(vt,{children:[Je(bt,{children:Je(_e,{parts:i})}),r&&r(),l&&Je(me,{"data-id":"sampling-btn-edit-auto-rule",label:ve,rightIcon:ha,variant:a.Text,size:j.S,onClick:l})]})},yt=e=>{const a=Sa(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return ta(ia(e.formState));case"highlyRelevant":return aa(ra(e.formState));case"costReduction":return ea(la(e.formState))}},[e]);if(e.readOnly)return Je(ft,{title:be,summary:a,renderAction:e.renderAction});const t=1===a.length&&"default"===a[0].variant;return Je(ft,{title:t?fe:be,summary:t?[]:a,renderAction:e.renderAction})},xt=Pa.div`
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-wrap: wrap;
|
|
59
|
-
gap: 8px;
|
|
60
|
-
`,St=Pa.div`
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
gap: 8px;
|
|
64
|
-
padding: 8px 12px;
|
|
65
|
-
border-radius: 8px;
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
background: ${({theme:e,$selected:a})=>a?e.v2.colors.silver[700]:e.v2.colors.silver[900]};
|
|
68
|
-
border: 1px solid ${({theme:e,$selected:a})=>a?e.v2.colors.silver[500]:e.v2.colors.silver[800]};
|
|
69
|
-
|
|
70
|
-
&:hover {
|
|
71
|
-
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
72
|
-
}
|
|
73
|
-
`,Ct=Pa.div`
|
|
74
|
-
display: flex;
|
|
75
|
-
width: 32px;
|
|
76
|
-
height: 32px;
|
|
77
|
-
justify-content: center;
|
|
78
|
-
align-items: center;
|
|
79
|
-
flex-shrink: 0;
|
|
80
|
-
`,kt=Pa.div`
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: column;
|
|
83
|
-
gap: 4px;
|
|
84
|
-
`,Tt=Pa.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
|
-
`,wt=Pa.div`
|
|
92
|
-
display: flex;
|
|
93
|
-
width: 24px;
|
|
94
|
-
height: 24px;
|
|
95
|
-
justify-content: center;
|
|
96
|
-
align-items: center;
|
|
97
|
-
flex-shrink: 0;
|
|
98
|
-
`,$t={[Oe.JavaScript]:"Node.js",[Oe.DotNet]:".NET",[Oe.Php]:"PHP",[Oe.Java]:"Java",[Oe.Go]:"Go",[Oe.Python]:"Python",[Oe.Ruby]:"Ruby",[Oe.Rust]:"Rust"},Pt=[Oe.Python,Oe.Java,Oe.JavaScript,Oe.DotNet,Oe.Php,Oe.Ruby,Oe.Go].map(e=>({id:e,label:$t[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:Me(e)})),At=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function Mt(e){const a=$t[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const Ot=e=>e.readOnly?Je(Lt,{scopes:e.scopes}):Je(zt,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),Lt=({scopes:e})=>{if(na(e))return Je(y,{richTitle:{title:ye},children:Je(xe,{status:Ce.Default,message:Se,fullWidth:!0})});const a=e.sources??[],t=e.namespaces??[],l=e.languages??[];return Je(y,{richTitle:{title:ye},children:We(kt,{children:[a.map((e,a)=>{const t=[e.namespace,e.kind,e.name].filter(Boolean),l=t.length?t.join(" / "):ke;return Je(Tt,{children:Je(T,{size:P.XS,color:$.Primary,children:l})},`src-${a}`)}),t.map((e,a)=>Je(Tt,{children:Je(T,{size:P.XS,color:$.Primary,children:e})},`ns-${a}`)),l.map((e,a)=>{const t=Me(e);return We(Tt,{children:[t&&Je(wt,{children:Je(t,{size:18})}),Je(T,{size:P.XS,color:$.Primary,children:Mt(e)})]},`lang-${a}`)})]})})},zt=({formState:e,onChange:a,sourceOptions:t=[],namespaceOptions:l=[]})=>{const[r,i]=Ca(()=>{return(a=e.sourceScopes).sources.length>0?"source":a.namespaces.length>0?"namespace":a.languages.length>0?"language":"all";var a}),{sources:s,namespaces:o,languages:d}=e.sourceScopes,c=s.length>0||o.length>0||d.length>0,u=Sa(()=>At.map(e=>({...e,disabled:"all"===e.value&&c})),[c]),p=Sa(()=>s.map(e=>{return a=e.namespace,t=e.kind,l=e.name,`${a}/${t}/${l}`;var a,t,l}),[s]),h=Sa(()=>[...o],[o]),g=Sa(()=>new Set(d),[d]),m=xa(e=>{i(e)},[]),b=xa(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]),x=xa(t=>{a({sourceScopes:{...e.sourceScopes,namespaces:t}})},[e.sourceScopes,a]),S=xa(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 We(y,{richTitle:{title:`1. ${ye}`,subTitle:Te},children:[Je(xe,!c&&"all"===r?{status:Ce.Default,message:Se,fullWidth:!0,smallIcon:!0}:{status:Ce.Info,message:we,fullWidth:!0,smallIcon:!0}),Je(v,{$alignItems:"flex-start",children:Je(f,{options:u,selected:r,setSelected:m})}),"source"===r&&Je($e,{multiple:!0,"data-id":"sampling-autocomplete-source",options:t,value:p,onSelect:b,placeholder:Pe}),"namespace"===r&&Je($e,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:l,value:h,onSelect:x,placeholder:"Search namespace"}),"language"===r&&Je(xt,{children:Pt.map(({id:e,label:a,Icon:t})=>{const l=g.has(e);return We(St,{$selected:l,onClick:()=>S(e),children:[Je(n,{name:`sampling-scope-lang-${e}`,size:Ae.S,value:l,onChange:()=>S(e)}),Je(Ct,{children:Je(t,{size:20})}),Je(T,{size:P.XS,nowrap:!0,children:a})]},e)})})]})},Dt=(e,a)=>!a?.length||!!a?.find(a=>a===e),It=({title:e="Signals",required:a,errorMessage:t,allowedSignals:l,selectedSignals:r,setSelectedSignals:i,disabled:s})=>{const[o,d]=Ca(1===r.length),c=ka(JSON.stringify(r));Ta(()=>{let e=Le(r).filter(e=>Dt(e,l));e.length||(e=ze.filter(({id:e})=>Dt(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 We(v,{$gap:12,children:[Je(b,{label:e,required:a}),Je(m,{$gap:12,children:ze.map(e=>{const a=Dt(e.id,l),t=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?Je(n,{label:e.value,disabled:s||!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})}),Je(De,{errorMessage:t})]})},Rt=({minSupportedVersion:a,currentVersion:t})=>Je(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>Je(Ie,{scale:2.4,icon:()=>Je("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:Je("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}.`}),Xt=Pa.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
|
-
`,Nt=Pa.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
|
-
`,Bt=Pa.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
|
-
`,Et=({isLeft:e,isRight:a,heightOffset:t=0,width:l,header:r,list:i})=>We(Xt,{$width:l,$columnHasHeader:!!r,children:[r&&Je(Nt,{children:r}),Je(Bt,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:t,$columnHasHeader:!!r,children:i.length?i.length>1?Je(Re,{gap:8,elements:i}):Je(Fe,{children:i[0]}):Je(Xe,{$height:"100%",children:Je(Ne,{})})})]}),Ht="75vw",Vt=Pa.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
|
-
`,jt=Pa.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
|
-
`,qt=Pa.div`
|
|
136
|
-
padding: 12px 12px 0 12px;
|
|
137
|
-
`,Ut=Pa.div`
|
|
138
|
-
display: flex;
|
|
139
|
-
gap: 12px;
|
|
140
|
-
padding: 16px;
|
|
141
|
-
`,Gt=Pa.div`
|
|
142
|
-
padding: 5vh 10vw;
|
|
143
|
-
border-radius: 12px;
|
|
144
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
145
|
-
`,Kt=wa(({isOpen:t,withOverlay:l,disableAnimation:r,onClose:i,onBack:n,onNext:s,nextIsSkip:o,onSave:d,disableSave:c,connectionIds:u,header:p,subHeader:h,leftColumn:g,rightColumn:m,search:v,filters:b,errorMessage:f,isFormDirty:y,hideDirtyNote:x,isFetching:S,progress:C},k)=>{const[T,w]=Ca(!1),[$,A]=Ca(!1),[M,O]=Ca(void 0);$a(k,()=>({clearErrors:()=>O(void 0)}));const L=$,z=xa(()=>{y&&!T?w(!0):(w(!1),i?.())},[y,T,i]),D=c||$||"boolean"==typeof y&&!y,I=xa(async()=>{A(!0);const e=await d();A(!1),!1!==e&&(e?.error?O(e.error):(u?.setValue([]),i?.()))},[d,u,i]),R=!!v||!!u||!!b,X=!!h,N=(R?48:0)+(X?50:0),B=Sa(()=>S?{status:Ce.Info,message:"Fetching Data..."}:$&&!C?{status:Ce.Info,message:"Saving Changes..."}:M||f?{status:Ce.Error,message:M||f}:"boolean"==typeof y&&y&&!x?{status:Ce.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:Ce.Success,message:"The values reflect the current configuration of the selected cluster."},[S,$,C,M,f,y,x]),E=Sa(()=>n?{label:"Back",leftIcon:ga,variant:a.Secondary,onClick:n}:{label:"Cancel",variant:a.Secondary,onClick:z,disabled:L},[n,z,L]),[H,V]=Ca(!1),j=Sa(()=>s?o?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:ma,variant:a.Secondary,onClick:()=>V(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:ma,variant:a.Primary,onClick:s}:{"data-id":"wide-drawer-save",label:"Save",variant:a.Primary,onClick:I,disabled:D},[s,o,I,D]);return We(Be,{width:Ht,isOpen:t,disableAnimation:r,hideOverlay:!$&&!l,header:{...p,onClose:i?z:void 0,onCloseDisabled:L},footer:{note:B,actions:[E,j]},children:[$?Je(Xe,{$height:"calc(100vh - 136px)",children:Je(Gt,{children:Je(Ee,{titleSize:P.S,subTitleSize:P.XXXS,withGradient:!0,withSpinner:!0,...C})})}):We(Vt,{children:[R&&We(jt,{children:[u&&Je(He,{icon:va,title:"Selected Clusters",badge:{label:u.value.length}}),v&&Je(Ve,{width:"100%",...v}),b]}),X&&Je(qt,{children:Je(He,{icon:h.icon,title:h.title,subTitle:h.description,badge:h.badge})}),We(Ut,{children:[Je(Et,{isLeft:!0,heightOffset:N,...g}),Je(Et,{isRight:!0,heightOffset:N,...m})]})]}),Je(Aa,{isOpen:T,onClose:()=>w(!1),onApprove:z}),Je(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:H,onClose:()=>V(!1),denyButton:{label:"Go Back",variant:a.Secondary,onClick:()=>V(!1)},approveButton:{label:"Skip",variant:a.Primary,onClick:()=>{s?.(),V(!1)}}})]})});Kt.displayName=Kt.name;const Jt=Pa.div`
|
|
146
|
-
padding: 0 24px;
|
|
147
|
-
border-radius: 12px;
|
|
148
|
-
background-color: ${({$codeBgColor:e})=>e||"transparent"};
|
|
149
|
-
`,Wt=({title:e="YAML",yaml:t,defaultOpen:l,fullHeight:r,bgTint:i="1000",codeBgColor:n})=>{const{clickCopy:s,isCopied:o}=je(),d=Sa(()=>t?[{id:Ue(),type:qe.Button,buttonProps:{variant:a.Text,size:j.S,leftIcon:o?ba:fa,onClick:()=>s(t||""),disabled:o}}]:[],[t,o]);return Je(Ge,{bgTint:i,richTitle:{icon:ya,title:e},actions:d,withCollapse:!0,collapseIsDefaultOpen:l,fullHeight:r,children:Je(Jt,{$codeBgColor:n,children:t?Je(Ke,{code:t,language:"yaml",theme:"duotoneDark"}):Je(Xe,{children:Je(Ne,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{ft as A,Aa as C,Oa as D,Da as N,_a as O,Ra as P,ut as R,It as S,Rt as U,Kt as W,Wt as Y,za as a,yt as b,Ot as c,mt as d,Na as e,rt as f,Ma as g,La as h,Ht as i,Ia as j};
|