@odigos/ui-kit 0.0.101 → 0.0.102
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 +9 -0
- package/lib/chunks/{ui-components-365e1848.js → ui-components-8a8d1358.js} +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers.js +5 -4
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons.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/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.102](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.101...ui-kit-v0.0.102) (2025-09-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* prioritize error over active in base node ([#379](https://github.com/odigos-io/ui-kit/issues/379)) ([702fe45](https://github.com/odigos-io/ui-kit/commit/702fe4535ed00b863ff7f3570340c80876b4191a))
|
|
9
|
+
* source select count overlap ([#380](https://github.com/odigos-io/ui-kit/issues/380)) ([4de3248](https://github.com/odigos-io/ui-kit/commit/4de32484e69e0449b634d9b51d38e188e263ff99))
|
|
10
|
+
* **source-drawer:** remove fetchedSource dependency from useEffect to prevent unnecessary re-fetching ([#377](https://github.com/odigos-io/ui-kit/issues/377)) ([dbd32e6](https://github.com/odigos-io/ui-kit/commit/dbd32e63cd8c672aff080c3b0943628806eb4752))
|
|
11
|
+
|
|
3
12
|
## [0.0.101](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.100...ui-kit-v0.0.101) (2025-09-03)
|
|
4
13
|
|
|
5
14
|
|
|
@@ -619,7 +619,7 @@ import{SamplerIcon as e,PiiMaskingIcon as t,ImageErrorIcon as n,K8sLogo as o,Add
|
|
|
619
619
|
text-align: center;
|
|
620
620
|
`,Wr=ft(({id:e,data:t})=>{const{nodeWidth:n,title:o,subTitle:i}=t,{isThisPending:a}=Go(),r=e.split("-")[0],s=a({entityType:r});return dt.createElement(Mr,{$nodeWidth:n,className:"nowheel nodrag"},s?dt.createElement(ct,null,dt.createElement(Br,null,dt.createElement(Wa,null),dt.createElement(jr,{family:"secondary"},"adding ",r,"s")),dt.createElement(Ur,null,"Just a few more seconds...")):dt.createElement(ct,null,dt.createElement(Br,null,dt.createElement(Je,null),dt.createElement(jr,{family:"secondary",decoration:"underline"},o)),dt.createElement(Ur,null,i)),dt.createElement(At,{type:"target",position:Dt.Left,style:{visibility:"hidden"}}),dt.createElement(At,{type:"source",position:Dt.Right,style:{visibility:"hidden"}}))});Wr.displayName=Wr.name;const Vr=vt.div`
|
|
621
621
|
width: ${({$nodeWidth:e})=>`${e}px`};
|
|
622
|
-
`,Hr=ft(({id:e,data:t})=>{const n=si.useTheme(),{nodeWidth:o,id:i,type:a,status:r,faded:s,title:l,subTitle:d,icon:c,icons:p,iconSrc:u,iconSrcs:m,monitors:h,isActive:g,raw:x}=t,f=a===en.Source,$="boolean"==typeof g,{isThisPending:y}=Go(),b=y({entityType:a,entityId:i}),{selectedSources:w,setSelectedSources:k}=Jo(),v={...w},{namespace:E,name:S,kind:C}=x;f&&!v[E]&&(v[E]=[]);const T=f?v[E].findIndex(e=>e.name===S&&e.kind===C):-1;return dt.createElement(Vr,{"data-id":e,$nodeWidth:o,className:"nowheel nodrag"},dt.createElement(Dr,{title:l,subTitle:d,onClick:()=>{},renderActions:()=>{const e
|
|
622
|
+
`,Hr=ft(({id:e,data:t})=>{const n=si.useTheme(),{nodeWidth:o,id:i,type:a,status:r,faded:s,title:l,subTitle:d,icon:c,icons:p,iconSrc:u,iconSrcs:m,monitors:h,isActive:g,raw:x}=t,f=a===en.Source,$="boolean"==typeof g,{isThisPending:y}=Go(),b=y({entityType:a,entityId:i}),{selectedSources:w,setSelectedSources:k}=Jo(),v={...w},{namespace:E,name:S,kind:C}=x;f&&!v[E]&&(v[E]=[]);const T=f?v[E].findIndex(e=>e.name===S&&e.kind===C):-1;return dt.createElement(Vr,{"data-id":e,$nodeWidth:o,className:"nowheel nodrag"},dt.createElement(Dr,{title:l,subTitle:d,onClick:()=>{},renderActions:()=>{const e=r?io(r,n):$?io(g?an.Success:an.Info,n):void 0,t=$?`${a} is ${g?"enabled":"disabled"}`:void 0,o=f&&(!x.conditions?.length||x.conditions?.some(({status:e})=>"loading"===e));return b?dt.createElement(Wa,null):e?dt.createElement(Ea,{text:t},dt.createElement(e,{size:20})):o?dt.createElement(Wa,null):null},iconProps:{icon:c,icons:p,iconSrc:u,iconSrcs:m},visualProps:{status:r,faded:s||$&&!g,monitors:h},checkboxProps:{withCheckbox:f,isChecked:-1!==T,onCheckboxChange:()=>{-1===T?v[E].push(x):v[E].splice(T,1),k(v)},isCheckboxDisabled:b}}),dt.createElement(At,{type:"target",position:Dt.Left,style:{visibility:"hidden"}}),dt.createElement(At,{type:"source",position:Dt.Right,style:{visibility:"hidden"}}))});Hr.displayName=Hr.name;const qr=vt.div`
|
|
623
623
|
width: ${({$nodeWidth:e})=>`${e}px`};
|
|
624
624
|
height: ${({$nodeHeight:e})=>`${e}px`};
|
|
625
625
|
opacity: 0;
|
package/lib/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{V as AutocompleteInput,ag as Badge,aL as Button,t as CancelWarning,ad as CenterThis,C as Checkbox,cp as Code,G as ConditionDetails,H as DataCard,a as DataCardFieldTypes,b5 as DataCardFields,cq as DataFinger,b1 as DataTab,s as DeleteWarning,bp as DescribeRow,W as Divider,m as DocsButton,r as Drawer,cs as DrawerFooter,cr as DrawerHeader,aI as Dropdown,ct as ErrorBoundary,aR as ExtendArrow,aX as FadeLoader,b as FieldError,F as FieldLabel,L as FlexColumn,Z as FlexRow,cu as Header,aQ as IconButton,by as IconGroup,a9 as IconTitleBadge,a4 as IconWrapped,bm as IconsNav,cv as ImageControlled,I as Input,h as InputList,e as InputTable,ac as InteractiveTable,g as KeyValueInputsList,O as Modal,Q as ModalBody,M as MonitorsCheckboxes,a6 as MonitorsIcons,P as NavigationButtons,ae as NoDataFound,R as NotificationNote,cC as Overlay,aC as Popup,bD as PopupForm,bM as ScrollX,l as SectionTitle,S as Segment,aD as SelectionButton,cw as SkeletonLoader,Y as Status,b4 as Stepper,cx as TabList,a7 as TableContainer,a8 as TableTitleWrap,ab as TableWrap,bc as Tag,k as Text,n as TextArea,f as Toggle,bK as ToggleCodeComponent,$ as Tooltip,af as TraceLoader,aE as VerticalScroll,cB as WarningModal,cy as getLinksFromText,cz as getStrongsFromText,cA as renderText}from"./chunks/ui-components-
|
|
1
|
+
export{V as AutocompleteInput,ag as Badge,aL as Button,t as CancelWarning,ad as CenterThis,C as Checkbox,cp as Code,G as ConditionDetails,H as DataCard,a as DataCardFieldTypes,b5 as DataCardFields,cq as DataFinger,b1 as DataTab,s as DeleteWarning,bp as DescribeRow,W as Divider,m as DocsButton,r as Drawer,cs as DrawerFooter,cr as DrawerHeader,aI as Dropdown,ct as ErrorBoundary,aR as ExtendArrow,aX as FadeLoader,b as FieldError,F as FieldLabel,L as FlexColumn,Z as FlexRow,cu as Header,aQ as IconButton,by as IconGroup,a9 as IconTitleBadge,a4 as IconWrapped,bm as IconsNav,cv as ImageControlled,I as Input,h as InputList,e as InputTable,ac as InteractiveTable,g as KeyValueInputsList,O as Modal,Q as ModalBody,M as MonitorsCheckboxes,a6 as MonitorsIcons,P as NavigationButtons,ae as NoDataFound,R as NotificationNote,cC as Overlay,aC as Popup,bD as PopupForm,bM as ScrollX,l as SectionTitle,S as Segment,aD as SelectionButton,cw as SkeletonLoader,Y as Status,b4 as Stepper,cx as TabList,a7 as TableContainer,a8 as TableTitleWrap,ab as TableWrap,bc as Tag,k as Text,n as TextArea,f as Toggle,bK as ToggleCodeComponent,$ as Tooltip,af as TraceLoader,aE as VerticalScroll,cB as WarningModal,cy as getLinksFromText,cz as getStrongsFromText,cA as renderText}from"./chunks/ui-components-8a8d1358.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{y as ACTION_OPTIONS,B as BUTTON_TEXTS,aP as DEFAULT_DATA_STREAM_NAME,b2 as DESTINATION_CATEGORIES,aJ as DISPLAY_LANGUAGES,D as DISPLAY_TITLES,U as FORM_ALERTS,bf as INSTRUMENTATION_RULE_OPTIONS,cc as LANGUAGE_OPTIONS,aK as MONITORS_OPTIONS,aM as STORAGE_KEYS,cd as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-
|
|
1
|
+
export{y as ACTION_OPTIONS,B as BUTTON_TEXTS,aP as DEFAULT_DATA_STREAM_NAME,b2 as DESTINATION_CATEGORIES,aJ as DISPLAY_LANGUAGES,D as DISPLAY_TITLES,U as FORM_ALERTS,bf as INSTRUMENTATION_RULE_OPTIONS,cc as LANGUAGE_OPTIONS,aK as MONITORS_OPTIONS,aM as STORAGE_KEYS,cd as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-8a8d1358.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/containers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperativeHandle as a,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b,c as f,I as x,d as C,i as $,e as S,f as k,g as w,h as D,j as N,k as T,T as I,S as E,l as O,m as M,M as A,n as F,u as R,o as L,p as q,q as P,B as K,r as H,s as z,t as W,E as B,v as j,w as V,x as U,y as _,z as G,G as J,H as Y,J as X,L as Q,N as Z,O as ee,P as te,Q as oe,R as ie,U as ne,V as ae,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as be,a7 as fe,a8 as xe,a9 as Ce,aa as $e,ab as Se,ac as ke,ad as we,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Me,al as Ae,am as Fe,an as Re,ao as Le,ap as qe,aq as Pe,ar as Ke,as as He,at as ze,au as We,av as Be,aw as je,ax as Ve,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Xe,aE as Qe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as nt,aL as at,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as bt,aZ as ft,a_ as xt,a$ as Ct,b0 as $t,b1 as St,b2 as kt,b3 as wt,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as Mt,bb as At,bc as Ft,bd as Rt,be as Lt,bf as qt,bg as Pt,bh as Kt,bi as Ht,bj as zt,bk as Wt,bl as Bt,bm as jt,bn as Vt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Xt,bu as Qt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as no,bB as ao,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo}from"./chunks/ui-components-
|
|
1
|
+
import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperativeHandle as a,useMemo as l,Fragment as r,useCallback as s,Children as c}from"react";import d,{css as u}from"styled-components";import{D as p,a as m,A as h,K as g,F as y,C as v,b,c as f,I as x,d as C,i as $,e as S,f as k,g as w,h as D,j as N,k as T,T as I,S as E,l as O,m as M,M as A,n as F,u as R,o as L,p as q,q as P,B as K,r as H,s as z,t as W,E as B,v as j,w as V,x as U,y as _,z as G,G as J,H as Y,J as X,L as Q,N as Z,O as ee,P as te,Q as oe,R as ie,U as ne,V as ae,W as le,X as re,Y as se,Z as ce,_ as de,$ as ue,a0 as pe,a1 as me,a2 as he,a3 as ge,a4 as ye,a5 as ve,a6 as be,a7 as fe,a8 as xe,a9 as Ce,aa as $e,ab as Se,ac as ke,ad as we,ae as De,af as Ne,ag as Te,ah as Ie,ai as Ee,aj as Oe,ak as Me,al as Ae,am as Fe,an as Re,ao as Le,ap as qe,aq as Pe,ar as Ke,as as He,at as ze,au as We,av as Be,aw as je,ax as Ve,ay as Ue,az as _e,aA as Ge,aB as Je,aC as Ye,aD as Xe,aE as Qe,aF as Ze,aG as et,aH as tt,aI as ot,aJ as it,aK as nt,aL as at,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,aS as pt,aT as mt,aU as ht,aV as gt,aW as yt,aX as vt,aY as bt,aZ as ft,a_ as xt,a$ as Ct,b0 as $t,b1 as St,b2 as kt,b3 as wt,b4 as Dt,b5 as Nt,b6 as Tt,b7 as It,b8 as Et,b9 as Ot,ba as Mt,bb as At,bc as Ft,bd as Rt,be as Lt,bf as qt,bg as Pt,bh as Kt,bi as Ht,bj as zt,bk as Wt,bl as Bt,bm as jt,bn as Vt,bo as Ut,bp as _t,bq as Gt,br as Jt,bs as Yt,bt as Xt,bu as Qt,bv as Zt,bw as eo,bx as to,by as oo,bz as io,bA as no,bB as ao,bC as lo,bD as ro,bE as so,bF as co,bG as uo,bH as po,bI as mo,bJ as ho,bK as go,bL as yo,bM as vo}from"./chunks/ui-components-8a8d1358.js";import{CheckCircledIcon as bo,CrossCircledIcon as fo,EditIcon as xo,TrashIcon as Co,OdigosLogoText as $o,SearchIcon as So,FilterIcon as ko,DataStreamsIcon as wo,CheckIcon as Do,OdigosLogo as No,ArrowIcon as To,PlusIcon as Io,RefreshLeftArrowIcon as Eo,NotificationIcon as Oo,UserIcon as Mo,ImageErrorIcon as Ao,OverviewIcon as Fo,RulesIcon as Ro,SourcesIcon as Lo,ActionsIcon as qo,DestinationsIcon as Po,SlackLogo as Ko,CopyIcon as Ho,KeyIcon as zo,TerminalIcon as Wo,GearIcon as Bo,WarningTriangleIcon as jo,TraceViewIcon as Vo,ErrorTriangleIcon as Uo}from"./icons.js";import{useNodesState as _o,useEdgesState as Go,applyNodeChanges as Jo,MarkerType as Yo}from"@xyflow/react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Xo=e=>{const{type:t,spec:{actionName:o,notes:i,signals:n,disabled:a,collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:b,renames:f,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:$,endpointsFilters:S,servicesNameFilters:k,attributeFilters:w}}=e,D=[{title:p.TYPE,value:t},{type:m.ActiveStatus,title:p.STATUS,value:String(!a)},{type:m.Monitors,title:p.SIGNALS_FOR_PROCESSING,value:n.map(e=>e.toLowerCase()).join(", ")},{title:p.NAME,value:o},{title:p.NOTES,value:i},{type:m.Divider}];if(t===h.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(l)}),D.push({title:"Collect ReplicaSet Attributes",value:String(r)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:m.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Label Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${i+1}`:""),value:n})}),u?.length&&D.push({type:m.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:o},i)=>{let n="";n+=`Annotation Key: ${e}\n`,n+=`Attribute Key: ${t}\n`,n+=`From: ${o||g.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${i+1}`:""),value:n})})),t===h.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(v||!1)});let e="";y?.forEach(({attributeName:t,attributeStringValue:o},i)=>{e+=`${t}: ${o}`,i<y.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.DeleteAttributes){let e="";b?.forEach((t,o)=>{e+=t,o<b.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([o,i],n)=>{e+=`${o}: ${i}`,n<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.PiiMasking){let e="";x?.forEach((t,o)=>{e+=t,o<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===h.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(C)}),t===h.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===h.LatencySampler&&S?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`HTTP Route: ${t}\n`,a+=`Min. Latency: ${o}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Endpoint"+(S.length>1?` #${n+1}`:""),value:a})}),t===h.ServiceNameSampler&&k?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o},i)=>{let n="";n+=`Service Name: ${e}\n`,n+=`Sampling Ratio: ${t}\n`,n+=`Fallback Sampling Ratio: ${o}`,D.push({title:"Filter"+(k.length>1?` #${i+1}`:""),value:n})}),t===h.SpanAttributeSampler&&w?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Attribute Key: ${t}\n`,a+=`Fallback Sampling Ratio: ${o}\n`;const l=Object.keys(i)[0];a+=`Condition: ${l}\n`,a+=`Operation: ${i[l]?.operation}\n`,a+=`Expected Value: ${i[l]?.expectedValue}`,"jsonCondition"===l&&(a+=`\nJSON Path: ${i[l].jsonPath}`),D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:a})}),D},Qo=f.PiiCategories,Zo=d.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -355,8 +355,9 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
355
355
|
`,hl=d(we)`
|
|
356
356
|
padding-bottom: ${({$addPadding:e})=>e?"16px":"0"};
|
|
357
357
|
`,gl=d(T)`
|
|
358
|
-
width:
|
|
359
|
-
|
|
358
|
+
width: 42px;
|
|
359
|
+
text-align: right;
|
|
360
|
+
`,yl=({isModal:t=!1,withInstances:o=!0,isFetchingEachNamespace:i,fetchedNamespaces:n,filteredNamespacesAndSources:a,selectedNamespace:l,onSelectNamespace:r,selectedSources:s,onSelectSource:c,selectedFutureApps:d,onSelectFutureApps:u})=>{const m=I.useTheme(),{namespacesLoading:h}=V(),g=Object.entries(a||{});if(!g?.length)return e.createElement(we,null,h?e.createElement(vt,null):e.createElement(De,{title:p.NO_SOURCES,subTitle:r?p.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES:p.PLEASE_ADD_SOURCE}));const y=$e(B.Namespace);return e.createElement(sl,{$isModal:t},i&&e.createElement(vt,{scale:1.2}),g.map(([t,a])=>{const g=s?.[t]||[],b=d?.[t]?.selected||!1,f=g.filter(({selected:e})=>e),x=g.length>0,C=l===t,$=f.length>0&&f.length===a.length,S=f.length>0&&f.length!==a.length,w=a.length>0,D=1===a.length;return r||w?e.createElement(cl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:C},e.createElement(dl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:S,value:$,onChange:e=>r(t,e)}),e.createElement(y,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:12},u&&e.createElement(k,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:b,onChange:e=>u(e,t),flipHorizontally:!0}),i&&!n?.includes(t)?e.createElement(vt,{scale:.8}):e.createElement(gl,{size:10,color:m.text.grey},x?`${f.length}/${a.length}`:null),r&&e.createElement(ut,{extend:C}))),(C||!r)&&(w?e.createElement(pl,{$addPadding:!c},e.createElement(ml,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*a.length)+"px"})),a.map(i=>{const n=f.some(({name:e})=>e===i.name);return e.createElement(vl,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(hl,{$addPadding:!c},h||i&&!n?.includes(t)?e.createElement(vt,null):e.createElement(De,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null}))},vl=({withInstances:t,source:o,namespace:i,isSelected:n,onSelect:a})=>e.createElement(ul,{"data-id":`source-${o.name}`,$selected:n,$withClick:!!a,onClick:()=>a?.(o)},e.createElement(ce,{$gap:12},a&&e.createElement(v,{value:n,onChange:()=>a(o,i)}),e.createElement(ce,{$gap:4},e.createElement(T,null,o.name),e.createElement(T,{opacity:.8,size:10},t?` • ${o.numberOfInstances||0} running instance${1!==o.numberOfInstances?"s":""}`:"",` • ${o.kind}`)))),bl=d.div`
|
|
360
361
|
display: flex;
|
|
361
362
|
flex-direction: column;
|
|
362
363
|
align-items: center;
|
|
@@ -384,7 +385,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
384
385
|
display: flex;
|
|
385
386
|
flex-direction: column;
|
|
386
387
|
gap: 12px;
|
|
387
|
-
`,Fl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{sources:u}=V(),{selectedStreamName:m}=He(),{drawerType:h,drawerEntityId:g}=q(),y=l(()=>Be(u,m),[u,m]),v=n(null),b=h===B.Source,[f,x]=t(!1),[C,$]=t(!1),[S,k]=t(Il.Overview),[w,D]=t(null);o(()=>{b&&g&&s(g).then(e=>D(e||null))},[b,g
|
|
388
|
+
`,Fl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{sources:u}=V(),{selectedStreamName:m}=He(),{drawerType:h,drawerEntityId:g}=q(),y=l(()=>Be(u,m),[u,m]),v=n(null),b=h===B.Source,[f,x]=t(!1),[C,$]=t(!1),[S,k]=t(Il.Overview),[w,D]=t(null);o(()=>{b&&g&&s(g).then(e=>D(e||null))},[b,g]);const{formData:N,handleFormChange:I,resetFormData:E,loadFormWithDrawerItem:O}=Xt(),M=l(()=>{if(!b)return null;const e=(w&&JSON.stringify(Ht(w))===JSON.stringify(Ht(g))?w:null)||y?.find(e=>e.namespace===g.namespace&&e.name===g.name&&e.kind===g.kind);return e&&O(e),e},[b,g,y,w]),A=l(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===pe.Loading,containers:M?.containers||[]}},[M]),F=l(()=>{const e=[{label:Il.Overview,onClick:()=>k(Il.Overview),selected:S===Il.Overview}];return El.includes(M?.kind)&&e.push({label:Il.Pods,onClick:()=>k(Il.Pods),selected:S===Il.Pods}),M?.containers?.some(({language:e})=>Ol.includes(e))&&e.push({label:Il.Libraries,onClick:()=>k(Il.Libraries),selected:S===Il.Libraries}),e},[S,M]);return M?e.createElement(fi,{ref:v,onClose:()=>{k(Il.Overview),D(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:Le(M.containers),isEdit:f,isFormDirty:C,onEdit:S===Il.Overview?e=>{x("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=N.otelServiceName!==M.name?N.otelServiceName:"";I("otelServiceName",e),await a(g,{...N,otelServiceName:e}),D(null),$(!1),x(!1)},onDelete:S===Il.Overview?async()=>{const{namespace:e}=M;i({[e]:[{...M,selected:!1,currentStreamName:m}]},{}),D(null),$(!1),x(!1),E(),v.current?.closeDrawer()}:void 0,onCancel:()=>{$(!1),x(!1),I("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===y.length,tabs:F,headerActionButtons:[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>r([g]),children:e.createElement(e.Fragment,null,e.createElement(Eo,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},S===Il.Overview?f?e.createElement(Ml,null,e.createElement(wl,{formData:N,handleFormChange:(...e)=>{$(!0),I(...e),I("currentStreamName",m)}})):e.createElement(Al,null,e.createElement(J,{conditions:M.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:M?Sl(M):[]}),e.createElement(Y,{title:p.DETECTED_CONTAINERS,titleBadge:A.isLoading?pe.Loading:A.containers.length,description:A.description||p.DETECTED_CONTAINERS_DESCRIPTION},A.containers.map(t=>e.createElement(Qt,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await a(g,e)})))):S===Il.Pods?e.createElement(Dl,{source:M,fetchSourceDescribe:c}):e.createElement(Tl,{source:M,fetchSourceLibraries:d})):null},Rl=d.div`
|
|
388
389
|
max-width: 420px;
|
|
389
390
|
width: 100%;
|
|
390
391
|
`,Ll=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),r=to({fetchSingleNamespace:o}),{availableSources:s,selectedSources:c,isFetchingEachNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:b,setSearchBy:f,showSelectedOnly:C,setShowSelectedOnly:$,showRunningOnly:S,setShowRunningOnly:w}=r;a(n,()=>({getFormValues:()=>({initial:s,apps:h(),futureApps:g()})}));const D=Object.values(c).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return e.createElement(oe,{$isNotModal:!t},e.createElement(Q,{$gap:12},e.createElement(Q,{$gap:24},i&&e.createElement(mt,{onClick:i}),e.createElement(O,{title:p.SELECT_SOURCES,badgeLabel:D,description:p.SELECT_SOURCES_DESCRIPTION}),e.createElement(ce,{$justifyContent:"space-between"},e.createElement(Rl,null,e.createElement(x,{placeholder:b===B.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:So,value:y,onChange:e=>v(e.target.value.toLowerCase())})),e.createElement(E,{options:[{label:p.SOURCE,value:B.Source,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary},{label:p.NAMESPACE,value:B.Namespace,selectedBgColor:l.text.secondary,selectedTextColor:l.text.primary}],selected:b,setSelected:f})),e.createElement(ce,{$gap:36},e.createElement(k,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:d}),e.createElement(k,{title:p.ONLY_SELECTED,initialValue:C,onChange:$}),e.createElement(k,{title:p.ONLY_RUNNING_INSTANCES,initialValue:S,onChange:w}))),e.createElement(le,null),e.createElement(yl,{isModal:t,...r})))});Ll.displayName=Ll.name;const ql=({fetchSingleNamespace:t,persistSources:o})=>{const{currentModal:i,setCurrentModal:a}=Z(),l=i===B.Source,r=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();o(e,t),r()}},c=n(null);return P({key:"Enter",active:l},s),l?e.createElement(ee,{isOpen:l,onClose:r,header:{title:"Add Source"},actionComponent:e.createElement(te,{buttons:[{label:"DONE",variant:"primary",onClick:s}]})},e.createElement(Ll,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},Pl=[{key:"checkbox-and-icon",title:""},{key:"name",title:p.NAME,sortable:!0},{key:"type",title:"Kubernetes Type",sortable:!0},{key:"namespace",title:p.NAMESPACE,sortable:!0},{key:"containers",title:p.DETECTED_CONTAINERS},{key:"conditions",title:"Conditions"},{key:"throughput",title:"Throughput",sortable:!0}],Kl=({metrics:t,maxHeight:o,maxWidth:i})=>{const n=I.useTheme(),a=he(),{isThisPending:r}=R(),{selectedStreamName:c}=He(),{sources:d,sourcesLoading:u}=V(),{setDrawerType:m,setDrawerEntityId:h}=q(),{selectedSources:g,setSelectedSources:y}=Kt(),{isAwaitingInstrumentation:b,sourcesToCreate:f,sourcesCreated:x,sourcesToDelete:C,sourcesDeleted:$}=ze(),S=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return f?e(f,x):C?e(C,$):1},[f,x,C,$]),k=l(()=>Be(d,c),[d,c]),w=l(()=>Ii({instrumentationRules:[],sources:je(k,a),actions:[],destinations:[],searchText:a.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[k,a]),[D,N]=l(()=>{let e=0;return Object.values(g).forEach(t=>{e+=t.length}),[0!==e,e]},[g]),E=s(e=>{if(e){const e={};w.forEach(t=>{const o={namespace:t.namespace,name:t.name,kind:t.kind};r({entityType:B.Source,entityId:o})||(e[t.namespace]?e[t.namespace].push(t):e[t.namespace]=[t])}),y(e)}else y({})},[w]),O=s(e=>{const{namespace:t,name:o,kind:i}=e,n={...g};n[t]||(n[t]=[]);const a=n[t].findIndex(e=>e.name===o&&e.kind===i);-1===a?n[t].push(e):n[t].splice(a,1),y(n)},[g]),M=l(()=>w.map(o=>{const i=Ht(o),a=JSON.stringify(i),{hasErrors:l,hasWarnings:s,hasDisableds:c}=re(o.conditions||[]),d=r({entityType:B.Source,entityId:i}),u=!!g[i.namespace]?.find(e=>e.namespace===i.namespace&&e.name===i.name&&e.kind===i.kind);return{status:l?j.Error:s?j.Warning:void 0,faded:c,onClick:()=>{m(B.Source),h(i)},cells:[{columnKey:"checkbox-and-icon",component:()=>e.createElement(ce,{$gap:16},e.createElement(v,{disabled:d,value:u,onChange:()=>O(o)}),e.createElement(oo,{icons:Le(o.containers),id:a}))},{columnKey:"name",value:ve(o,B.Source,{extended:!0})},{columnKey:"type",value:o.kind,textColor:n.text.info},{columnKey:"namespace",value:o.namespace,textColor:n.text.info},{columnKey:"throughput",value:Oe(Tt(t,B.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ni,{conditions:o.conditions||[],id:a})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:j.Info,title:io(o.containers),withBorder:!0}))}]}}),[w,g,t,O]),{badge:A,badgeTooltip:F}=l(()=>w.length!==k.length?{badge:`${w.length}/${k.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:k.length,badgeTooltip:void 0},[w,k]);return e.createElement(fe,{$maxWidth:i},e.createElement(xe,null,e.createElement(v,{partiallyChecked:D&&w?.length!==N,value:D&&w?.length===N,onChange:E,disabled:!w?.length}),e.createElement(Ce,{icon:$e(B.Source),title:p.SOURCES,badge:A,badgeTooltip:F,loading:u||b})),e.createElement(Se,{$maxHeight:o},e.createElement(ke,{columns:Pl,rows:M})),b&&!M.length?e.createElement(we,{style:{marginTop:"2rem",gap:"24px"}},e.createElement(Ne,{width:420}),e.createElement(ce,{$gap:16},e.createElement(T,{color:n.text.info},f?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Te,{label:`${S}%`}))):M.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Hl=({expiresAt:t})=>{const o=I.useTheme(),i=zt().format(t),n=new Date(t).toDateString().split(" ").slice(1).join(" "),a=no(t,0)?o.text.error:no(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:a},i," (",n,")")},zl=d.div`
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b0 as capitalizeFirstLetter,bY as cleanObjectEmptyStringsValues,aV as compareCondition,b3 as deepClone,a3 as filterActions,ay as filterDestinations,ax as filterDestinationsByStream,aw as filterSources,av as filterSourcesByStream,bZ as flattenObjectKeys,aj as formatBytes,bJ as formatDuration,z as getActionIcon,X as getConditionsBooleans,ao as getContainersIcons,bz as getContainersInstrumentedCount,ar as getDestinationIcon,aa as getEntityIcon,aF as getEntityId,a5 as getEntityLabel,b_ as getIdFromSseTarget,an as getInstrumentationRuleIcon,b$ as getMainContainerLanguage,b6 as getMetricForEntity,c0 as getMonitorIcon,c1 as getPlatformIcon,c2 as getPlatformLabel,bd as getProgrammingLanguageIcon,bL as getRecursiveValues,c3 as getSseTargetFromId,a1 as getStatusIcon,ap as getValueForRange,bi as getWorkloadId,a_ as getYamlFieldsForDestination,bn as hasUnhealthyInstances,i as isEmpty,c4 as isLegalK8sLabel,bA as isOverTime,br as isStringABoolean,c5 as isTimeElapsed,c6 as isValidVersion,_ as mapConditions,aU as mapDestinationFieldsForDisplay,aq as mapExportedSignals,c7 as numbersOnly,bs as parseBooleanFromString,c8 as parseJsonStringToPrettyString,c9 as removeEmptyValuesFromObject,aW as safeJsonParse,ca as safeJsonStringify,ah as sleep,aH as splitCamelString,cb as stringifyNonStringValues}from"./chunks/ui-components-
|
|
1
|
+
export{b0 as capitalizeFirstLetter,bY as cleanObjectEmptyStringsValues,aV as compareCondition,b3 as deepClone,a3 as filterActions,ay as filterDestinations,ax as filterDestinationsByStream,aw as filterSources,av as filterSourcesByStream,bZ as flattenObjectKeys,aj as formatBytes,bJ as formatDuration,z as getActionIcon,X as getConditionsBooleans,ao as getContainersIcons,bz as getContainersInstrumentedCount,ar as getDestinationIcon,aa as getEntityIcon,aF as getEntityId,a5 as getEntityLabel,b_ as getIdFromSseTarget,an as getInstrumentationRuleIcon,b$ as getMainContainerLanguage,b6 as getMetricForEntity,c0 as getMonitorIcon,c1 as getPlatformIcon,c2 as getPlatformLabel,bd as getProgrammingLanguageIcon,bL as getRecursiveValues,c3 as getSseTargetFromId,a1 as getStatusIcon,ap as getValueForRange,bi as getWorkloadId,a_ as getYamlFieldsForDestination,bn as hasUnhealthyInstances,i as isEmpty,c4 as isLegalK8sLabel,bA as isOverTime,br as isStringABoolean,c5 as isTimeElapsed,c6 as isValidVersion,_ as mapConditions,aU as mapDestinationFieldsForDisplay,aq as mapExportedSignals,c7 as numbersOnly,bs as parseBooleanFromString,c8 as parseJsonStringToPrettyString,c9 as removeEmptyValuesFromObject,aW as safeJsonParse,ca as safeJsonStringify,ah as sleep,aH as splitCamelString,cb as stringifyNonStringValues}from"./chunks/ui-components-8a8d1358.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{x as useActionFormData,aA as useClickNode,bk as useClickNotification,au as useContainerSize,bB as useCopy,aO as useDataStreamFormData,aZ as useDestinationFormData,bC as useGenericForm,be as useInstrumentationRuleFormData,q as useKeyDown,aG as useOnClickOutside,aB as usePopup,aN as useSessionStorage,bt as useSourceFormData,bx as useSourceSelectionFormData,bj as useTimeAgo,bg as useTransition}from"./chunks/ui-components-
|
|
1
|
+
export{x as useActionFormData,aA as useClickNode,bk as useClickNotification,au as useContainerSize,bB as useCopy,aO as useDataStreamFormData,aZ as useDestinationFormData,bC as useGenericForm,be as useInstrumentationRuleFormData,q as useKeyDown,aG as useOnClickOutside,aB as usePopup,aN as useSessionStorage,bt as useSourceFormData,bx as useSourceSelectionFormData,bj as useTimeAgo,bg as useTransition}from"./chunks/ui-components-8a8d1358.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-1dea551d.js";import"styled-components";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|