@odigos/ui-kit 0.0.114 → 0.0.116
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 +19 -0
- package/lib/chunks/{ui-components-f1517f30.js → ui-components-1cfa212a.js} +216 -216
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers.js +4 -4
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/useBodyScroll.d.ts +6 -0
- package/lib/hooks/useSourceSelectionFormData.d.ts +2 -2
- 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/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,
|
|
1
|
+
export{V as AutocompleteInput,ag as Badge,aL as Button,t as CancelWarning,ad as CenterThis,C as Checkbox,cs as Code,G as ConditionDetails,H as DataCard,a as DataCardFieldTypes,b6 as DataCardFields,ct as DataFinger,b2 as DataTab,s as DeleteWarning,br as DescribeRow,W as Divider,m as DocsButton,r as Drawer,cv as DrawerFooter,cu as DrawerHeader,aI as Dropdown,cw as ErrorBoundary,aR as ExtendArrow,aY as FadeLoader,b as FieldError,F as FieldLabel,L as FlexColumn,Z as FlexRow,cx as Header,aQ as IconButton,bA as IconGroup,a9 as IconTitleBadge,a4 as IconWrapped,bn as IconsNav,cy 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,cF as Overlay,aC as Popup,bF as PopupForm,bO as ScrollX,l as SectionTitle,S as Segment,aD as SelectionButton,cz as SkeletonLoader,Y as Status,b5 as Stepper,cA as TabList,a7 as TableContainer,a8 as TableTitleWrap,ab as TableWrap,bd as Tag,k as Text,n as TextArea,f as Toggle,bM as ToggleCodeComponent,$ as Tooltip,af as TraceLoader,aE as VerticalScroll,cE as WarningModal,cB as getLinksFromText,cC as getStrongsFromText,cD as renderText}from"./chunks/ui-components-1cfa212a.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,b3 as DESTINATION_CATEGORIES,aJ as DISPLAY_LANGUAGES,D as DISPLAY_TITLES,U as FORM_ALERTS,bg as INSTRUMENTATION_RULE_OPTIONS,ce as LANGUAGE_OPTIONS,aK as MONITORS_OPTIONS,aM as STORAGE_KEYS,cf 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,b3 as DESTINATION_CATEGORIES,aJ as DISPLAY_LANGUAGES,D as DISPLAY_TITLES,U as FORM_ALERTS,bg as INSTRUMENTATION_RULE_OPTIONS,ce as LANGUAGE_OPTIONS,aK as MONITORS_OPTIONS,aM as STORAGE_KEYS,cf as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-1cfa212a.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 as f,c as b,I as x,d as C,i as $,e as k,f as S,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 P,q,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 fe,a7 as be,a8 as xe,a9 as Ce,aa as $e,ab as ke,ac as Se,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 Pe,aq as qe,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 ft,aZ as bt,a_ as xt,a$ as Ct,b0 as $t,b1 as kt,b2 as St,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 Pt,bg as qt,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,bN as fo,bO as bo}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 as f,c as b,I as x,d as C,i as $,e as k,f as S,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 P,q,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 fe,a7 as be,a8 as xe,a9 as Ce,aa as $e,ab as ke,ac as Se,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 Pe,aq as qe,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 ft,aZ as bt,a_ as xt,a$ as Ct,b0 as $t,b1 as kt,b2 as St,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 Pt,bg as qt,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,bN as fo,bO as bo}from"./chunks/ui-components-1cfa212a.js";import{CheckCircledIcon as xo,CrossCircledIcon as Co,EditIcon as $o,TrashIcon as ko,OdigosLogoText as So,SearchIcon as wo,FilterIcon as Do,DataStreamsIcon as No,CheckIcon as To,OdigosLogo as Io,ArrowIcon as Eo,PlusIcon as Oo,RefreshLeftArrowIcon as Mo,NotificationIcon as Ao,UserIcon as Fo,ImageErrorIcon as Ro,OverviewIcon as Lo,RulesIcon as Po,SourcesIcon as qo,ActionsIcon as Ko,DestinationsIcon as Ho,SlackLogo as zo,CopyIcon as Wo,KeyIcon as Bo,TerminalIcon as jo,GearIcon as Vo,WarningTriangleIcon as Uo,TraceViewIcon as _o,ErrorTriangleIcon as Go}from"./icons.js";import{useNodesState as Jo,useEdgesState as Yo,applyNodeChanges as Xo,MarkerType as Qo}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 Zo=e=>{const{type:t,name:o,notes:i,signals:n,disabled:a,fields:{collectContainerAttributes:l,collectReplicaSetAttributes:r,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:y,overwriteExistingValues:v,attributeNamesToDelete:f,renames:b,piiCategories:x,fallbackSamplingRatio:C,samplingPercentage:$,endpointsFilters:k,servicesNameFilters:S,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="";f?.forEach((t,o)=>{e+=t,o<f.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===h.RenameAttributes){let e="";const t=Object.entries(b||{});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&&k?.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"+(k.length>1?` #${n+1}`:""),value:a})}),t===h.ServiceNameSampler&&S?.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"+(S.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},ei=b.PiiCategories,ti=d.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
gap: 32px;
|
|
@@ -108,7 +108,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
108
108
|
width: 100%;
|
|
109
109
|
`,Fn=d.div`
|
|
110
110
|
width: 100%;
|
|
111
|
-
`,Rn=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:n})=>{const a=I.useTheme(),{dataStreams:r,selectedStreamName:s,setSelectedStreamName:c}=He(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:m,handlePosition:h}=Je(),[g,y]=t(""),[v,f]=t(""),[b,C]=t(""),$=l(()=>r.filter(({name:e})=>!b||e.toLowerCase().includes(b.toLowerCase())).map(({name:t})=>e.createElement(An,{key:`stream-${t}`},e.createElement(Fn,null,e.createElement(Xe,{label:t,isSelected:s===t,onClick:()=>{c(t),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ct&&e.createElement(dt,{onClick:()=>f(t),tooltip:K.DELETE},e.createElement(ko,null)),e.createElement(dt,{onClick:()=>y(t),tooltip:K.EDIT},e.createElement($o,null)))),[r,s,b]);return e.createElement(e.Fragment,null,e.createElement(In,null,e.createElement(En,{$gap:0},e.createElement(at,{variant:"tertiary",onClick:()=>{h(0,50),p(e=>!e)}},e.createElement(No,{fill:a.text.info}),e.createElement(On,null,"Data Stream: ",s),e.createElement(ut,{extend:u}),e.createElement(Te,{label:r.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(pt,{onClick:()=>
|
|
111
|
+
`,Rn=({onClickNewDataStream:o,updateDataStream:i,deleteDataStream:n})=>{const a=I.useTheme(),{dataStreams:r,selectedStreamName:s,setSelectedStreamName:c}=He(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:m,handlePosition:h}=Je(),[g,y]=t(""),[v,f]=t(""),[b,C]=t(""),$=l(()=>r.filter(({name:e})=>!b||e.toLowerCase().includes(b.toLowerCase())).map(({name:t})=>e.createElement(An,{key:`stream-${t}`},e.createElement(Fn,null,e.createElement(Xe,{label:t,isSelected:s===t,onClick:()=>{c(t),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})),t!==ct&&e.createElement(dt,{onClick:()=>f(t),tooltip:K.DELETE},e.createElement(ko,null)),e.createElement(dt,{onClick:()=>y(t),tooltip:K.EDIT},e.createElement($o,null)))),[r,s,b]);return e.createElement(e.Fragment,null,e.createElement(In,null,e.createElement(En,{$gap:0},e.createElement(at,{variant:"tertiary",onClick:()=>{h(0,50),p(e=>!e)}},e.createElement(No,{fill:a.text.info}),e.createElement(On,null,"Data Stream: ",s),e.createElement(ut,{extend:u}),e.createElement(Te,{label:r.length})),e.createElement(le,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),e.createElement(pt,{onClick:()=>o(),label:K.NEW})),e.createElement(Ye,{ref:d,isOpen:u,top:m.top,left:m.left,header:e.createElement(x,{placeholder:"Search...",icon:wo,value:b,onChange:e=>C(e.target.value)})},e.createElement(Mn,null,$))),e.createElement(z,{isOpen:""!==v,name:v,onApprove:()=>{n(v),f("")},onDeny:()=>{f("")}}),e.createElement(Tn,{isOpen:""!==g,onClose:()=>{y("")},dataStreamName:g,updateDataStream:i}))},Ln=d.div`
|
|
112
112
|
display: flex;
|
|
113
113
|
align-items: center;
|
|
114
114
|
margin: 20px 0;
|
|
@@ -361,7 +361,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
361
361
|
`,xl=d(T)`
|
|
362
362
|
width: 42px;
|
|
363
363
|
text-align: right;
|
|
364
|
-
`,Cl=({isModal:t=!1,withInstances:o=!0,
|
|
364
|
+
`,Cl=({isModal:t=!1,withInstances:o=!0,fetchingNamespace: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||i?e.createElement(ft,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(ml,{$isModal:t},g.map(([t,a])=>{const g=s?.[t]||[],f=d?.[t]?.selected||!1,b=g.filter(({selected:e})=>e),x=g.length>0,C=l===t,$=b.length>0&&b.length===a.length,k=b.length>0&&b.length!==a.length,w=a.length>0,D=1===a.length;return r||w?e.createElement(hl,{key:`namespace-${t}`,"data-id":`namespace-${t}`,$selected:$,$isOpen:C},e.createElement(gl,{$selected:$,$withClick:!!r,onClick:()=>r?.(t)},e.createElement(ce,{$gap:12},r&&e.createElement(v,{partiallyChecked:k,value:$,onChange:e=>r(t,e)}),e.createElement(y,null),e.createElement(T,null,t)),e.createElement(ce,{$gap:12},u&&e.createElement(S,{title:p.FUTURE_APPS_TITLE,tooltip:p.FUTURE_APPS_DESCRIPTION,initialValue:f,onChange:e=>u(e,t),flipHorizontally:!0}),i!==t||n?.includes(t)?e.createElement(xl,{size:10,color:m.text.grey},x?`${b.length}/${a.length}`:null):e.createElement(ft,{scale:.8}),r&&e.createElement(ut,{extend:C}))),(C||!r)&&(w?e.createElement(vl,{$addPadding:!c},e.createElement(fl,null,e.createElement(le,{orientation:"vertical",length:(D?24:34*a.length)+"px"})),a.map(i=>{const n=b.some(({name:e})=>e===i.name);return e.createElement($l,{key:`source-${i.name}`,withInstances:o,source:i,namespace:t,isSelected:n,onSelect:c})})):e.createElement(bl,{$addPadding:!c},h||i===t&&!n?.includes(t)?e.createElement(ft,null):e.createElement(De,{title:p.NO_SOURCES_NAMESPACE,subTitle:p.TRY_SEARCH_OR_OTHER_NAMESPACE})))):null}))},$l=({withInstances:t,source:o,namespace:i,isSelected:n,onSelect:a})=>e.createElement(yl,{"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}`)))),kl=d.div`
|
|
365
365
|
display: flex;
|
|
366
366
|
flex-direction: column;
|
|
367
367
|
align-items: center;
|
|
@@ -392,7 +392,7 @@ import e,{useState as t,useEffect as o,forwardRef as i,useRef as n,useImperative
|
|
|
392
392
|
`,Hl=({persistSources:i,updateSource:a,restartWorkloads:r,fetchSourceById:s,fetchSourceDescribe:c,fetchSourceLibraries:d})=>{const{sources:u}=V(),{selectedStreamName:m}=He(),{drawerType:h,drawerEntityId:g}=P(),y=l(()=>Be(u,m),[u,m]),v=n(null),f=h===B.Source,[b,x]=t(!1),[C,$]=t(!1),[k,S]=t(Rl.Overview),[w,D]=t(null);o(()=>{f&&g&&s(g).then(e=>D(e||null))},[f,g]);const{formData:N,handleFormChange:I,resetFormData:E,loadFormWithDrawerItem:O}=Zt(),M=l(()=>{if(!f)return E();const e=(w&&JSON.stringify(zt(w))===JSON.stringify(zt(g))?w:null)||y?.find(e=>e.namespace===g.namespace&&e.name===g.name&&e.kind===g.kind);return e?O(e):E(),e},[f,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:Rl.Overview,onClick:()=>S(Rl.Overview),selected:k===Rl.Overview}];return Ll.includes(M?.kind)&&e.push({label:Rl.Pods,onClick:()=>S(Rl.Pods),selected:k===Rl.Pods}),M?.containers?.some(({language:e})=>Pl.includes(e))&&e.push({label:Rl.Libraries,onClick:()=>S(Rl.Libraries),selected:k===Rl.Libraries}),e},[k,M]);return M?e.createElement(Ci,{ref:v,onClose:()=>{S(Rl.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:b,isFormDirty:C,onEdit:k===Rl.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:k===Rl.Overview?async()=>{const{namespace:e}=M;i({[e]:[{...M,selected:!1,currentStreamName:m}]},{}),D(null),$(!1),x(!1),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(Mo,null),e.createElement(T,{size:14,family:"secondary",decoration:"underline"},"Restart"))}]},k===Rl.Overview?b?e.createElement(ql,null,e.createElement(El,{formData:N,handleFormChange:(...e)=>{$(!0),I(...e),I("currentStreamName",m)}})):e.createElement(Kl,null,e.createElement(Ol,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),e.createElement(J,{conditions:M.conditions||[]}),e.createElement(Y,{title:p.SOURCE_DETAILS,data:M?Tl(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(eo,{key:`source-container-${t.containerName}`,...t,callbackRuntimeOverride:async e=>await a(g,e)})))):k===Rl.Pods?e.createElement(Ml,{source:M,fetchSourceDescribe:c}):e.createElement(Fl,{source:M,fetchSourceLibraries:d})):null},zl=d.div`
|
|
393
393
|
max-width: 420px;
|
|
394
394
|
width: 100%;
|
|
395
|
-
`,Wl=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),r=io({fetchSingleNamespace:o}),{availableSources:s,selectedSources:c,
|
|
395
|
+
`,Wl=i(({isModal:t,fetchSingleNamespace:o,onClickSummary:i},n)=>{const l=I.useTheme(),r=io({fetchSingleNamespace:o}),{availableSources:s,selectedSources:c,fetchingNamespace:d,selectedAllNamespaces:u,onSelectAllNamespaces:m,getApiSourcesPayload:h,getApiFutureAppsPayload:g,searchText:y,setSearchText:v,searchBy:f,setSearchBy:b,showSelectedOnly:C,setShowSelectedOnly:$,showRunningOnly:k,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(zl,null,e.createElement(x,{placeholder:f===B.Source?p.SEARCH_SOURCES:p.SEARCH_NAMESPACES,icon:wo,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:f,setSelected:b})),e.createElement(ce,{$gap:36},e.createElement(S,{title:p.SELECT_ALL,initialValue:u,onChange:m,disabled:!!d}),e.createElement(S,{title:p.ONLY_SELECTED,initialValue:C,onChange:$}),e.createElement(S,{title:p.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:w}))),e.createElement(le,null),e.createElement(Cl,{isModal:t,...r})))});Wl.displayName=Wl.name;const Bl=({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 q({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(Wl,{ref:c,isModal:!0,fetchSingleNamespace:t})):null},jl=[{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}],Vl=({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}=P(),{selectedSources:g,setSelectedSources:y}=Ht(),{isAwaitingInstrumentation:f,sourcesToCreate:b,sourcesCreated:x,sourcesToDelete:C,sourcesDeleted:$}=ze(),k=l(()=>{const e=(e,t)=>e>0&&Math.floor(100/e*t)||1;return b?e(b,x):C?e(C,$):1},[b,x,C,$]),S=l(()=>Be(d,c),[d,c]),w=l(()=>Oi({instrumentationRules:[],sources:je(S,a),actions:[],destinations:[],searchText:a.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[S,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=zt(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(no,{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(It(t,B.Source,i).throughput),textColor:n.text.info},{columnKey:"conditions",component:()=>e.createElement(Ii,{conditions:o.conditions||[],id:a})},{columnKey:"containers",component:()=>e.createElement("div",{style:{lineHeight:1}},e.createElement(se,{status:j.Info,title:ao(o.containers),withBorder:!0}))}]}}),[w,g,t,O]),{badge:A,badgeTooltip:F}=l(()=>w.length!==S.length?{badge:`${w.length}/${S.length}`,badgeTooltip:p.FILTERED_COUNT_TOOLTIP}:{badge:S.length,badgeTooltip:void 0},[w,S]);return e.createElement(be,{$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||f})),e.createElement(ke,{$maxHeight:o},e.createElement(Se,{columns:jl,rows:M})),f&&!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},b?"Instrumenting":"Uninstrumenting"," workloads..."),e.createElement(Te,{label:`${k}%`}))):M.length?null:e.createElement(we,{style:{marginTop:"2rem"}},e.createElement(De,null)))},Ul=({expiresAt:t})=>{const o=I.useTheme(),i=Wt().format(t),n=new Date(t).toDateString().split(" ").slice(1).join(" "),a=lo(t,0)?o.text.error:lo(t,6048e5)?o.text.warning:o.text.success;return e.createElement(T,{size:14,color:a},i," (",n,")")},_l=d.div`
|
|
396
396
|
position: relative;
|
|
397
397
|
`,Gl=({token:o,saveToken:i})=>{const n=I.useTheme(),{isCopied:a,clickCopy:l}=ro(),{formData:r,handleFormChange:s,resetFormData:c}=so({token:o}),[d,u]=t(!1),p=()=>{u(!1),c()},m=me(j.Success,n);return e.createElement(ce,{$gap:0},e.createElement(dt,{size:32,onClick:()=>l(o)},a?e.createElement(m,null):e.createElement(Wo,null)),e.createElement(le,{orientation:"vertical",length:"12px"}),e.createElement(_l,null,e.createElement(dt,{size:32,onClick:()=>{u(!0)}},e.createElement($o,null)),d&&e.createElement(co,{flipX:!0,clientX:36,isOpen:d,onClose:p,onSave:()=>{i(r.token).then(p)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one"},e.createElement(x,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>s("token",e.target.value)}))))},Jl=({tokens:t,saveToken:o})=>e.createElement(Y,{title:"Authorization Tokens",titleBadge:t.length,data:[{type:m.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:t.map(({name:t,token:i,expiresAt:n})=>({cells:[{columnKey:"icon",icon:Bo},{columnKey:"name",value:t},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>e.createElement(Ul,{expiresAt:n})},{columnKey:"actions",component:()=>e.createElement(Gl,{token:i,saveToken:o})}]}))}}]}),Yl=({fetchDescribeOdigos:i})=>{const[n,a]=t(null);if(o(()=>{i().then(({data:e})=>{a(e?.describeOdigos||null)})},[i]),!n)return e.createElement(we,null,e.createElement(ft,null));const l=t=>t?.name?[e.createElement(le,{key:`divider-${t.name}`}),e.createElement(Jt,{key:`describe-row-${t.name}`,title:t.name,subTitle:t.explain||void 0,value:{status:t.status||(Xt(t.value)?Qt(t.value)?j.Success:j.Error:j.Default),text:t.value}})]:[];return e.createElement(e.Fragment,null,e.createElement(Y,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:n?.odigosVersion?.name,value:n?.odigosVersion?.value},{title:n?.kubernetesVersion?.name,value:n?.kubernetesVersion?.value},{title:n?.installationMethod?.name,value:n?.installationMethod?.value},{title:n?.tier?.name,value:n?.tier?.value},{title:"# of sources",value:n?.numberOfSources?.toString()},{title:"# of destinations",value:n?.numberOfDestinations?.toString()}]}),e.createElement(Y,{title:"Cluster Collector",withExtend:!0},Object.values(n?.clusterCollector||{}).map(l)),e.createElement(Y,{title:"Node Collector",withExtend:!0},Object.values(n?.nodeCollector||{}).map(l)))},Xl=d.div`
|
|
398
398
|
display: flex;
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b1 as capitalizeFirstLetter,b_ as cleanObjectEmptyStringsValues,aW as compareCondition,b4 as deepClone,a3 as filterActions,ay as filterDestinations,ax as filterDestinationsByStream,aw as filterSources,av as filterSourcesByStream,b$ as flattenObjectKeys,aj as formatBytes,bL as formatDuration,z as getActionIcon,X as getConditionsBooleans,ao as getContainersIcons,bB as getContainersInstrumentedCount,ar as getDestinationIcon,aa as getEntityIcon,aF as getEntityId,a5 as getEntityLabel,c0 as getIdFromSseTarget,an as getInstrumentationRuleIcon,c1 as getMainContainerLanguage,b7 as getMetricForEntity,c2 as getMonitorIcon,c3 as getPlatformIcon,c4 as getPlatformLabel,be as getProgrammingLanguageIcon,bN as getRecursiveValues,c5 as getSseTargetFromId,a1 as getStatusIcon,bo as getStatusTypeFromOdigosHealth,ap as getValueForRange,bj as getWorkloadId,a$ as getYamlFieldsForDestination,bp as hasUnhealthyInstances,i as isEmpty,c6 as isLegalK8sLabel,bC as isOverTime,bt as isStringABoolean,c7 as isTimeElapsed,c8 as isValidVersion,_ as mapConditions,aV as mapDestinationFieldsForDisplay,aq as mapExportedSignals,c9 as numbersOnly,bu as parseBooleanFromString,ca as parseJsonStringToPrettyString,cb as removeEmptyValuesFromObject,aX as safeJsonParse,cc as safeJsonStringify,ah as sleep,aH as splitCamelString,cd as stringifyNonStringValues}from"./chunks/ui-components-
|
|
1
|
+
export{b1 as capitalizeFirstLetter,b_ as cleanObjectEmptyStringsValues,aW as compareCondition,b4 as deepClone,a3 as filterActions,ay as filterDestinations,ax as filterDestinationsByStream,aw as filterSources,av as filterSourcesByStream,b$ as flattenObjectKeys,aj as formatBytes,bL as formatDuration,z as getActionIcon,X as getConditionsBooleans,ao as getContainersIcons,bB as getContainersInstrumentedCount,ar as getDestinationIcon,aa as getEntityIcon,aF as getEntityId,a5 as getEntityLabel,c0 as getIdFromSseTarget,an as getInstrumentationRuleIcon,c1 as getMainContainerLanguage,b7 as getMetricForEntity,c2 as getMonitorIcon,c3 as getPlatformIcon,c4 as getPlatformLabel,be as getProgrammingLanguageIcon,bN as getRecursiveValues,c5 as getSseTargetFromId,a1 as getStatusIcon,bo as getStatusTypeFromOdigosHealth,ap as getValueForRange,bj as getWorkloadId,a$ as getYamlFieldsForDestination,bp as hasUnhealthyInstances,i as isEmpty,c6 as isLegalK8sLabel,bC as isOverTime,bt as isStringABoolean,c7 as isTimeElapsed,c8 as isValidVersion,_ as mapConditions,aV as mapDestinationFieldsForDisplay,aq as mapExportedSignals,c9 as numbersOnly,bu as parseBooleanFromString,ca as parseJsonStringToPrettyString,cb as removeEmptyValuesFromObject,aX as safeJsonParse,cc as safeJsonStringify,ah as sleep,aH as splitCamelString,cd as stringifyNonStringValues}from"./chunks/ui-components-1cfa212a.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/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ interface UseSourceFormDataParams {
|
|
|
6
6
|
fetchSingleNamespace: FetchSingleNamespace;
|
|
7
7
|
}
|
|
8
8
|
export interface UseSourceSelectionFormData {
|
|
9
|
-
|
|
10
|
-
fetchedNamespaces:
|
|
9
|
+
fetchingNamespace: NamespaceName;
|
|
10
|
+
fetchedNamespaces: NamespaceName[];
|
|
11
11
|
availableSources: AvailableSourcesByNamespace;
|
|
12
12
|
filteredNamespacesAndSources: AvailableSourcesByNamespace;
|
|
13
13
|
getApiSourcesPayload: () => SourceSelectionFormData;
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{x as useActionFormData,aA as useClickNode,bl as useClickNotification,au as useContainerSize,bD as useCopy,aO as useDataStreamFormData,a_ as useDestinationFormData,bE as useGenericForm,bf as useInstrumentationRuleFormData,q as useKeyDown,aG as useOnClickOutside,aB as usePopup,aN as useSessionStorage,bv as useSourceFormData,bz as useSourceSelectionFormData,bk as useTimeAgo,bh as useTransition}from"./chunks/ui-components-
|
|
1
|
+
export{x as useActionFormData,ch as useBodyScroll,aA as useClickNode,bl as useClickNotification,au as useContainerSize,bD as useCopy,aO as useDataStreamFormData,a_ as useDestinationFormData,bE as useGenericForm,bf as useInstrumentationRuleFormData,q as useKeyDown,aG as useOnClickOutside,aB as usePopup,aN as useSessionStorage,bv as useSourceFormData,bz as useSourceSelectionFormData,bk as useTimeAgo,bh as useTransition}from"./chunks/ui-components-1cfa212a.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";
|