@odigos/ui-kit 0.0.196 → 0.0.198
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/{index-CjudHPMe.js → index-DXnojvL1.js} +1 -1
- package/lib/chunks/{ui-components-OrgB9V7b.js → ui-components-DSKV7uC0.js} +110 -109
- package/lib/components/_v2/table/styled.d.ts +1 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/destinations/index.d.ts +5 -0
- package/lib/constants/strings/index.d.ts +2 -0
- package/lib/constants.js +1 -1
- package/lib/containers/source-drawer/index.d.ts +1 -0
- package/lib/containers/v2.js +4 -4
- package/lib/containers.js +26 -26
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/destinations/index.d.ts +1 -1
- package/lib/types/sources/index.d.ts +1 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
package/lib/components/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Z as Badge,B as Button,s as ButtonSize,dQ as ButtonTab,dR as ButtonTabList,q as ButtonVariants,C as Checkbox,dS as CheckboxList,dT as CheckboxSize,aG as CliCommand,av as DataCard,D as Drawer,ar as DropData,at as DropDataAlignX,as as DropDataAlignY,x as DropDown,b as FieldMessage,a as FieldTitle,dU as Header,cu as HoverActions,a6 as IconButton,a7 as IconButtonSize,I as Input,f as InputList,d as InputTable,aD as Island,L as Loader,dV as Modal,dW as Navbar,N as NoData,o as Note,dX as Radio,dY as RadioGroup,dZ as RadioSize,n as Search,ap as SectionCard,d_ as SectionCardSize,u as Segment,ab as SegmentSize,aJ as StatusCard,aB as Table,aC as TableVariant,d$ as Tag,v as TextArea,aK as TextCard,T as Toggle,e as ToggleLabelAlign,e0 as ToggleList,af as ToggleSize,e1 as ToggleVariant,r as Typography,m as TypographySize,ag as TypographyVariants,W as WarningModal}from"../chunks/ui-components-
|
|
1
|
+
export{Z as Badge,B as Button,s as ButtonSize,dQ as ButtonTab,dR as ButtonTabList,q as ButtonVariants,C as Checkbox,dS as CheckboxList,dT as CheckboxSize,aG as CliCommand,av as DataCard,D as Drawer,ar as DropData,at as DropDataAlignX,as as DropDataAlignY,x as DropDown,b as FieldMessage,a as FieldTitle,dU as Header,cu as HoverActions,a6 as IconButton,a7 as IconButtonSize,I as Input,f as InputList,d as InputTable,aD as Island,L as Loader,dV as Modal,dW as Navbar,N as NoData,o as Note,dX as Radio,dY as RadioGroup,dZ as RadioSize,n as Search,ap as SectionCard,d_ as SectionCardSize,u as Segment,ab as SegmentSize,aJ as StatusCard,aB as Table,aC as TableVariant,d$ as Tag,v as TextArea,aK as TextCard,T as Toggle,e as ToggleLabelAlign,e0 as ToggleList,af as ToggleSize,e1 as ToggleVariant,r as Typography,m as TypographySize,ag as TypographyVariants,W as WarningModal}from"../chunks/ui-components-DSKV7uC0.js";import"../icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
package/lib/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{bf as AutocompleteInput,bA as Badge,bC as Button,b3 as CancelWarning,l as CenterThis,aP as Checkbox,cK as Code,b7 as ConditionDetails,b8 as DataCard,aN as DataCardFieldTypes,ca as DataCardFields,dB as DataFinger,bE as DataTab,b2 as DeleteWarning,cs as DescribeRow,bg as Divider,aY as DocsButton,b1 as Drawer,dC as DrawerFooter,dD as DrawerHeader,bW as Dropdown,dE as ErrorBoundary,c0 as ExtendArrow,aF as FadeLoader,aQ as FieldError,aO as FieldLabel,F as FlexColumn,k as FlexRow,dF as Header,b$ as IconButton,cC as IconGroup,bu as IconTitleBadge,bp as IconWrapped,co as IconsNav,dG as ImageControlled,aR as Input,aV as InputList,aS as InputTable,bx as InteractiveTable,aU as KeyValueInputsList,cm as LoadingText,bc as Modal,bd as ModalBody,aZ as MonitorsCheckboxes,br as MonitorsIcons,bh as NavigationButtons,by as NoDataFound,be as NotificationNote,dH as Overlay,aA as PageContent,bR as Popup,cE as PopupForm,cJ as ScrollX,S as ScrollY,aX as SectionTitle,aW as Segment,bT as SelectionButton,bJ as SkeletonLoader,bj as Status,c9 as Stepper,dI as TabList,bs as TableContainer,bt as TableTitleWrap,bw as TableWrap,cc as Tag,a$ as Text,a_ as TextArea,aT as Toggle,cH as ToggleCodeComponent,J as Tooltip,bz as TraceLoader,aM as UpgradeRequiredWrapper,bS as VerticalScroll,cg as WarningModal,dJ as WhiteSpace,dK as getLinksFromText,dL as getStrongsFromText,dM as renderText}from"./chunks/ui-components-
|
|
1
|
+
export{bf as AutocompleteInput,bA as Badge,bC as Button,b3 as CancelWarning,l as CenterThis,aP as Checkbox,cK as Code,b7 as ConditionDetails,b8 as DataCard,aN as DataCardFieldTypes,ca as DataCardFields,dB as DataFinger,bE as DataTab,b2 as DeleteWarning,cs as DescribeRow,bg as Divider,aY as DocsButton,b1 as Drawer,dC as DrawerFooter,dD as DrawerHeader,bW as Dropdown,dE as ErrorBoundary,c0 as ExtendArrow,aF as FadeLoader,aQ as FieldError,aO as FieldLabel,F as FlexColumn,k as FlexRow,dF as Header,b$ as IconButton,cC as IconGroup,bu as IconTitleBadge,bp as IconWrapped,co as IconsNav,dG as ImageControlled,aR as Input,aV as InputList,aS as InputTable,bx as InteractiveTable,aU as KeyValueInputsList,cm as LoadingText,bc as Modal,bd as ModalBody,aZ as MonitorsCheckboxes,br as MonitorsIcons,bh as NavigationButtons,by as NoDataFound,be as NotificationNote,dH as Overlay,aA as PageContent,bR as Popup,cE as PopupForm,cJ as ScrollX,S as ScrollY,aX as SectionTitle,aW as Segment,bT as SelectionButton,bJ as SkeletonLoader,bj as Status,c9 as Stepper,dI as TabList,bs as TableContainer,bt as TableTitleWrap,bw as TableWrap,cc as Tag,a$ as Text,a_ as TextArea,aT as Toggle,cH as ToggleCodeComponent,J as Tooltip,bz as TraceLoader,aM as UpgradeRequiredWrapper,bS as VerticalScroll,cg as WarningModal,dJ as WhiteSpace,dK as getLinksFromText,dL as getStrongsFromText,dM as renderText}from"./chunks/ui-components-DSKV7uC0.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
export declare enum DestinationCategoryTypes {
|
|
2
|
+
ALL = "all",
|
|
2
3
|
EXISTS = "exists",
|
|
3
4
|
DETECTED = "detected",
|
|
4
5
|
SELF_HOSTED = "self-hosted",
|
|
5
6
|
MANAGED = "managed"
|
|
6
7
|
}
|
|
7
8
|
export declare const DESTINATION_CATEGORIES: {
|
|
9
|
+
all: {
|
|
10
|
+
TITLE: string;
|
|
11
|
+
DESCRIPTION: string;
|
|
12
|
+
};
|
|
8
13
|
exists: {
|
|
9
14
|
TITLE: string;
|
|
10
15
|
DESCRIPTION: string;
|
|
@@ -113,6 +113,8 @@ export declare const DISPLAY_TITLES: {
|
|
|
113
113
|
ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC: string;
|
|
114
114
|
JAVA_CUSTOM_PROBES: string;
|
|
115
115
|
GOLANG_CUSTOM_PROBES: string;
|
|
116
|
+
ROLLBACK_OCCURRED_MESSAGE: string;
|
|
117
|
+
ROLLBACK_RECOVER: string;
|
|
116
118
|
FETCHING_NAMESPACES: string;
|
|
117
119
|
FETCHING_NAMESPACES_SUBTITLE: string;
|
|
118
120
|
ADD_SOURCES_DESCRIPTION: string;
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a1 as ACTION_ATTRIBUTE_OPTIONS,b6 as ACTION_OPTIONS,a2 as ACTION_SAMPLER_OPTIONS,az as BUTTON_TEXTS,ai as DEFAULT_DATA_STREAM_NAME,a9 as DESTINATION_CATEGORIES,_ as DISPLAY_LANGUAGES,a4 as DISPLAY_TITLES,t as DOCS_BASE_URL,a8 as DestinationCategoryTypes,a5 as FORM_ALERTS,ad as INSTRUMENTATION_RULE_OPTIONS,dm as LANGUAGE_OPTIONS,M as MONITORS_OPTIONS,dn as OTEL_DISTRO_NAME_OPTIONS,bX as STORAGE_KEYS,dp as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-
|
|
1
|
+
export{a1 as ACTION_ATTRIBUTE_OPTIONS,b6 as ACTION_OPTIONS,a2 as ACTION_SAMPLER_OPTIONS,az as BUTTON_TEXTS,ai as DEFAULT_DATA_STREAM_NAME,a9 as DESTINATION_CATEGORIES,_ as DISPLAY_LANGUAGES,a4 as DISPLAY_TITLES,t as DOCS_BASE_URL,a8 as DestinationCategoryTypes,a5 as FORM_ALERTS,ad as INSTRUMENTATION_RULE_OPTIONS,dm as LANGUAGE_OPTIONS,M as MONITORS_OPTIONS,dn as OTEL_DISTRO_NAME_OPTIONS,bX as STORAGE_KEYS,dp as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-DSKV7uC0.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
|
|
@@ -7,6 +7,7 @@ interface SourceDrawerProps {
|
|
|
7
7
|
updateSource: (sourceId: WorkloadId, payload: SourceFormData) => Promise<void>;
|
|
8
8
|
restartWorkloads: (sourceIds: WorkloadId[]) => Promise<void>;
|
|
9
9
|
restartPod: (namespace: string, name: string) => Promise<void>;
|
|
10
|
+
recoverFromRollback: (sourceId: WorkloadId) => Promise<void>;
|
|
10
11
|
fetchSourceById: (id: WorkloadId, bypassPaginationLoader?: boolean) => Promise<Source | undefined>;
|
|
11
12
|
fetchSourceDescribe: DescribeProps['fetchSourceDescribe'];
|
|
12
13
|
fetchSourceLibraries: LibrariesProps['fetchSourceLibraries'];
|
package/lib/containers/v2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useEffect as a,useState as n,useRef as o,forwardRef as i,useImperativeHandle as r,useMemo as s,Children as c,useCallback as d}from"react";import u,{useTheme as h}from"styled-components";import{A as p,F as m,a as g,C as b,b as f,I as C,c as y,i as v,d as w,K as k,T as S,e as $,f as x,g as I,h as T,W as A,j as N,M as D,k as O,V,S as F,l as M,N as R,D as P,L,m as E,R as z,n as j,o as q,p as H,B as _,q as B,r as K,s as W,t as G,u as J,v as U,w as Y,x as X,y as Z,z as Q,E as ee,G as te,H as le,J as ae,O as ne,P as oe,Q as ie,U as re,X as se,Y as ce,Z as de,_ as ue,$ as he,a0 as pe,a1 as me,a2 as ge,a3 as be,a4 as fe,a5 as Ce,a6 as ye,a7 as ve,a8 as we,a9 as ke,aa as Se,ab as $e,ac as xe,ad as Ie,ae as Te,af as Ae,ag as Ne,ah as De,ai as Oe,aj as Ve,ak as Fe,al as Me,am as Re,an as Pe,ao as Le,ap as Ee,aq as ze,ar as je,as as qe,at as He,au as _e,av as Be,aw as Ke,ax as We,ay as Ge,az as Je,aA as Ue,aB as Ye,aC as Xe,aD as Ze,aE as Qe,aF as et,aG as tt,aH as lt,aI as at,aJ as nt,aK as ot,aL as it,aM as rt}from"../chunks/ui-components-OrgB9V7b.js";import{VSquareIcon as st,OdigosLogo as ct,BookIcon as dt,XSquareIcon as ut,GoLogo as ht,JavaLogo as pt,ChevronRightIcon as mt,ActionIcon as gt,DestinationIcon as bt,ChevronUpIcon as ft,ChevronDownIcon as Ct,InstrumentationRuleIcon as yt,SourceIcon as vt,SettingsIcon as wt,XIcon as kt,VIcon as St,EditIcon as $t,ExclamationTriangleIcon as xt,ExclamationCircleIcon as It,KeyIcon as Tt,DiagnoseIcon as At,DownloadIcon as Nt,TerminalIcon as Dt,DeleteIcon as Ot,RefreshIcon as Vt,ConnectionsIcon as Ft,PodIcon as Mt,ArrowDownSquareIcon as Rt,ArrowUpSquareIcon as Pt,PipelineCollectorIcon as Lt,GatewayIcon as Et,YamlIcon as zt}from"../icons.js";import{Y as jt}from"../chunks/index-CjudHPMe.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const qt=[{id:"CREDIT_CARD",label:"Credit card"}],Ht=[{id:p.CollectContainerAttributes,label:"Collect container attributes"},{id:p.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:p.CollectWorkloadId,label:"Collect workload ID"},{id:p.CollectClusterId,label:"Collect cluster ID"}],_t=[{id:k.Pod,label:k.Pod},{id:k.Namespace,label:k.Namespace},{id:k.Node,label:k.Node}],Bt=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:_t}],Kt=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:_t}],Wt=[{label:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered."},{label:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product."},{label:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",inputType:y.Number},{label:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",inputType:y.Number}],Gt=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:y.Number},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:y.Number}],Jt=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:y.Number},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:I.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:I.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],Ut={[T.K8sAttributes]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[p.CollectContainerAttributes]||n[p.CollectReplicaSetAttributes]||n[p.CollectWorkloadId]||n[p.CollectClusterId]||n[p.LabelsAttributes]?.length||n[p.AnnotationsAttributes]?.length||(o(p.CollectContainerAttributes,!0),o(p.CollectReplicaSetAttributes,!0),o(p.CollectWorkloadId,!0),o(p.CollectClusterId,!0),o(p.LabelsAttributes,[]),o(p.AnnotationsAttributes,[]))},[]),e(l,{children:[t(m,{$gap:6,children:Ht.map(({id:l,label:a})=>e(m,{children:[t(b,{label:a,value:n[l]||!1,onChange:e=>o(l,e)}),t(f,{errorMessage:i[l]})]},l))}),t(w,{label:"Label attributes",limitFieldsPerRow:2,columns:Bt,values:n[p.LabelsAttributes]||[],setValues:e=>o(p.LabelsAttributes,e),errorMessage:i[p.LabelsAttributes]}),t(w,{label:"Annotation attributes",limitFieldsPerRow:2,columns:Kt,values:n[p.AnnotationsAttributes]||[],setValues:e=>o(p.AnnotationsAttributes,e),errorMessage:i[p.AnnotationsAttributes]})]})),[T.AddClusterInfo]:({value:a,setValue:n,formErrors:o})=>{const i=h();return e(l,{children:[t(S,{label:"Overwrite existing values",labelAlign:$.Left,labelColor:i.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:a[p.OverwriteExistingValues]||!1,onChange:e=>n(p.OverwriteExistingValues,e)}),t(w,{label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:a[p.ClusterAttributes]||[],setValues:e=>n(p.ClusterAttributes,e),errorMessage:o[p.ClusterAttributes]})]})},[T.DeleteAttributes]:({value:e,setValue:l,formErrors:a})=>t(x,{label:"Attributes to delete",values:e[p.AttributeNamesToDelete]||[],setValues:e=>l(p.AttributeNamesToDelete,e),errorMessage:a[p.AttributeNamesToDelete]}),[T.RenameAttributes]:({value:e,setValue:l,formErrors:a})=>t(w,{label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[p.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),l(p.Renames,t)},errorMessage:a[p.Renames]}),[T.PiiMasking]:({value:l,setValue:n,formErrors:o})=>(a(()=>{l[p.PiiCategories]?.length||n(p.PiiCategories,qt.map(({id:e})=>e))},[]),e(m,{$gap:12,children:[t(g,{label:"Attributes to mask"}),t(m,{$gap:6,children:qt.map(({id:e,label:a})=>t(b,{label:a,value:l[p.PiiCategories]?.includes(e)||!1,onChange:t=>{const a=l[p.PiiCategories]||[],o=t?[...a,e]:a.filter(t=>t!==e);n(p.PiiCategories,o)}},e))}),t(f,{errorMessage:o[p.PiiCategories]})]})),[T.ErrorSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[p.FallbackSamplingRatio],o=v(e[p.FallbackSamplingRatio])?"":String(e[p.FallbackSamplingRatio]);return t(C,{label:"Fallback sampling ratio",type:y.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,l(p.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[T.ProbabilisticSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[p.SamplingPercentage],o=v(e[p.SamplingPercentage])?"":String(e[p.SamplingPercentage]);return t(C,{label:"Sampling percentage",type:y.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,l(p.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[T.LatencySampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[p.EndpointsFilters],o=e[p.EndpointsFilters]||[];return t(w,{limitFieldsPerRow:2,columns:Wt,values:o,setValues:e=>{l(p.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:l,fallbackSamplingRatio:a})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(l),fallbackSamplingRatio:Number(a)})))},errorMessage:n})},[T.ServiceNameSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[p.ServicesNameFilters],o=e[p.ServicesNameFilters]||[];return t(w,{limitFieldsPerRow:2,columns:Gt,values:o,setValues:e=>{l(p.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:l})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(l)})))},errorMessage:n})},[T.SpanAttributeSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[p.AttributeFilters],o=(e[p.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:a})=>{const n=Object.entries(a).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:n,operation:a[n]?.operation,expectedValue:a[n]?.expectedValue,jsonPath:a[n]?.jsonPath}});return t(w,{limitFieldsPerRow:2,columns:Jt,values:o,setValues:e=>{l(p.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:a,operation:n,expectedValue:o,jsonPath:i})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(l),condition:{[a]:{operation:n,expectedValue:o}}};return i&&(r.condition[a].jsonPath=i),r}))},errorMessage:n})}},Yt=({actionType:e,value:l,setValue:a,formErrors:n})=>{if(!e)return null;const o=Ut[e];return o?t(o,{value:l,setValue:a,formErrors:n}):null},Xt=({isOpen:e,onClose:l,onDeny:a,onApprove:n})=>t(A,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:e,onClose:l,onDeny:a,denyLabel:"Keep editing",onApprove:n,approveLabel:"Discard changes"}),Zt=({isOpen:e,onClose:l,onDeny:a,onApprove:n,action:o="delete",target:i})=>{const r=o.charAt(0).toUpperCase()+o.substring(1),s=i?.endsWith("s")?"these":"this";return t(A,{title:`${r}${i?` ${i}`:""}?`,description:`Are you sure you want to ${o}${i?` ${s} ${i}`:""}?`,isOpen:e,onClose:l,onDeny:a,denyLabel:"Go back",onApprove:n,approveLabel:r})},Qt=(e,t)=>!t?.length||!!t?.find(t=>t===e),el=({title:l="Signals",required:i,errorMessage:r,allowedSignals:s,selectedSignals:c,setSelectedSignals:d})=>{const[u,h]=n(1===c.length),p=o(JSON.stringify(c));return a(()=>{const e=N(c);e.length||D.forEach(({id:t})=>{Qt(t,s)&&e.push(t)});const t=JSON.stringify(e);p.current!==t&&(p.current=t,d(e),h(1===e.length))},[s,c]),e(m,{$gap:12,children:[t(g,{label:l,required:i}),t(O,{$gap:12,children:D.map(e=>{const l=Qt(e.id,s),a=((e,t)=>!!t?.find(t=>t===e))(e.id,c);return l?t(b,{label:e.value,disabled:!l||u&&a,value:a,onChange:t=>((e,t)=>{const l=e,a=t?[...c,l]:c.filter(e=>e!==l);d(a),h(1===a.length)})(e.id,t)},e.id):null})}),t(f,{errorMessage:r})]})},tl=({minSupportedVersion:e,currentVersion:l})=>t(A,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>t(V,{scale:2.4,icon:()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:t("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${e} or later.\nCurrent version: ${l}.`}),ll=u.div`
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useEffect as a,useState as n,useRef as o,forwardRef as i,useImperativeHandle as r,useMemo as s,Children as c,useCallback as d}from"react";import u,{useTheme as h}from"styled-components";import{A as p,F as m,a as g,C as b,b as f,I as C,c as y,i as v,d as w,K as k,T as S,e as $,f as x,g as I,h as T,W as A,j as N,M as D,k as O,V,S as F,l as M,N as R,D as P,L,m as E,R as z,n as j,o as q,p as H,B as _,q as B,r as K,s as W,t as G,u as J,v as U,w as Y,x as X,y as Z,z as Q,E as ee,G as te,H as le,J as ae,O as ne,P as oe,Q as ie,U as re,X as se,Y as ce,Z as de,_ as ue,$ as he,a0 as pe,a1 as me,a2 as ge,a3 as be,a4 as fe,a5 as Ce,a6 as ye,a7 as ve,a8 as we,a9 as ke,aa as Se,ab as $e,ac as xe,ad as Ie,ae as Te,af as Ae,ag as Ne,ah as De,ai as Oe,aj as Ve,ak as Fe,al as Me,am as Re,an as Pe,ao as Le,ap as Ee,aq as ze,ar as je,as as qe,at as He,au as _e,av as Be,aw as Ke,ax as We,ay as Ge,az as Je,aA as Ue,aB as Ye,aC as Xe,aD as Ze,aE as Qe,aF as et,aG as tt,aH as lt,aI as at,aJ as nt,aK as ot,aL as it,aM as rt}from"../chunks/ui-components-DSKV7uC0.js";import{VSquareIcon as st,OdigosLogo as ct,BookIcon as dt,XSquareIcon as ut,GoLogo as ht,JavaLogo as pt,ChevronRightIcon as mt,ActionIcon as gt,DestinationIcon as bt,ChevronUpIcon as ft,ChevronDownIcon as Ct,InstrumentationRuleIcon as yt,SourceIcon as vt,SettingsIcon as wt,XIcon as kt,VIcon as St,EditIcon as $t,ExclamationTriangleIcon as xt,ExclamationCircleIcon as It,KeyIcon as Tt,DiagnoseIcon as At,DownloadIcon as Nt,TerminalIcon as Dt,DeleteIcon as Ot,RefreshIcon as Vt,ConnectionsIcon as Ft,PodIcon as Mt,ArrowDownSquareIcon as Rt,ArrowUpSquareIcon as Pt,PipelineCollectorIcon as Lt,GatewayIcon as Et,YamlIcon as zt}from"../icons.js";import{Y as jt}from"../chunks/index-DXnojvL1.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const qt=[{id:"CREDIT_CARD",label:"Credit card"}],Ht=[{id:p.CollectContainerAttributes,label:"Collect container attributes"},{id:p.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:p.CollectWorkloadId,label:"Collect workload ID"},{id:p.CollectClusterId,label:"Collect cluster ID"}],_t=[{id:k.Pod,label:k.Pod},{id:k.Namespace,label:k.Namespace},{id:k.Node,label:k.Node}],Bt=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:_t}],Kt=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:_t}],Wt=[{label:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered."},{label:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product."},{label:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",inputType:y.Number},{label:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",inputType:y.Number}],Gt=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:y.Number},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:y.Number}],Jt=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:y.Number},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:I.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:I.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],Ut={[T.K8sAttributes]:({value:n,setValue:o,formErrors:i})=>(a(()=>{n[p.CollectContainerAttributes]||n[p.CollectReplicaSetAttributes]||n[p.CollectWorkloadId]||n[p.CollectClusterId]||n[p.LabelsAttributes]?.length||n[p.AnnotationsAttributes]?.length||(o(p.CollectContainerAttributes,!0),o(p.CollectReplicaSetAttributes,!0),o(p.CollectWorkloadId,!0),o(p.CollectClusterId,!0),o(p.LabelsAttributes,[]),o(p.AnnotationsAttributes,[]))},[]),e(l,{children:[t(m,{$gap:6,children:Ht.map(({id:l,label:a})=>e(m,{children:[t(b,{label:a,value:n[l]||!1,onChange:e=>o(l,e)}),t(f,{errorMessage:i[l]})]},l))}),t(w,{label:"Label attributes",limitFieldsPerRow:2,columns:Bt,values:n[p.LabelsAttributes]||[],setValues:e=>o(p.LabelsAttributes,e),errorMessage:i[p.LabelsAttributes]}),t(w,{label:"Annotation attributes",limitFieldsPerRow:2,columns:Kt,values:n[p.AnnotationsAttributes]||[],setValues:e=>o(p.AnnotationsAttributes,e),errorMessage:i[p.AnnotationsAttributes]})]})),[T.AddClusterInfo]:({value:a,setValue:n,formErrors:o})=>{const i=h();return e(l,{children:[t(S,{label:"Overwrite existing values",labelAlign:$.Left,labelColor:i.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:a[p.OverwriteExistingValues]||!1,onChange:e=>n(p.OverwriteExistingValues,e)}),t(w,{label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:a[p.ClusterAttributes]||[],setValues:e=>n(p.ClusterAttributes,e),errorMessage:o[p.ClusterAttributes]})]})},[T.DeleteAttributes]:({value:e,setValue:l,formErrors:a})=>t(x,{label:"Attributes to delete",values:e[p.AttributeNamesToDelete]||[],setValues:e=>l(p.AttributeNamesToDelete,e),errorMessage:a[p.AttributeNamesToDelete]}),[T.RenameAttributes]:({value:e,setValue:l,formErrors:a})=>t(w,{label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[p.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),l(p.Renames,t)},errorMessage:a[p.Renames]}),[T.PiiMasking]:({value:l,setValue:n,formErrors:o})=>(a(()=>{l[p.PiiCategories]?.length||n(p.PiiCategories,qt.map(({id:e})=>e))},[]),e(m,{$gap:12,children:[t(g,{label:"Attributes to mask"}),t(m,{$gap:6,children:qt.map(({id:e,label:a})=>t(b,{label:a,value:l[p.PiiCategories]?.includes(e)||!1,onChange:t=>{const a=l[p.PiiCategories]||[],o=t?[...a,e]:a.filter(t=>t!==e);n(p.PiiCategories,o)}},e))}),t(f,{errorMessage:o[p.PiiCategories]})]})),[T.ErrorSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[p.FallbackSamplingRatio],o=v(e[p.FallbackSamplingRatio])?"":String(e[p.FallbackSamplingRatio]);return t(C,{label:"Fallback sampling ratio",type:y.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,l(p.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[T.ProbabilisticSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[p.SamplingPercentage],o=v(e[p.SamplingPercentage])?"":String(e[p.SamplingPercentage]);return t(C,{label:"Sampling percentage",type:y.Number,min:0,max:100,value:o,placeholder:"0-100",onChange:e=>{return t=e.target.value,l(p.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:n})},[T.LatencySampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[p.EndpointsFilters],o=e[p.EndpointsFilters]||[];return t(w,{limitFieldsPerRow:2,columns:Wt,values:o,setValues:e=>{l(p.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:l,fallbackSamplingRatio:a})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(l),fallbackSamplingRatio:Number(a)})))},errorMessage:n})},[T.ServiceNameSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[p.ServicesNameFilters],o=e[p.ServicesNameFilters]||[];return t(w,{limitFieldsPerRow:2,columns:Gt,values:o,setValues:e=>{l(p.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:l})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(l)})))},errorMessage:n})},[T.SpanAttributeSampler]:({value:e,setValue:l,formErrors:a})=>{const n=a[p.AttributeFilters],o=(e[p.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:a})=>{const n=Object.entries(a).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:n,operation:a[n]?.operation,expectedValue:a[n]?.expectedValue,jsonPath:a[n]?.jsonPath}});return t(w,{limitFieldsPerRow:2,columns:Jt,values:o,setValues:e=>{l(p.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:l,condition:a,operation:n,expectedValue:o,jsonPath:i})=>{const r={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(l),condition:{[a]:{operation:n,expectedValue:o}}};return i&&(r.condition[a].jsonPath=i),r}))},errorMessage:n})}},Yt=({actionType:e,value:l,setValue:a,formErrors:n})=>{if(!e)return null;const o=Ut[e];return o?t(o,{value:l,setValue:a,formErrors:n}):null},Xt=({isOpen:e,onClose:l,onDeny:a,onApprove:n})=>t(A,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:e,onClose:l,onDeny:a,denyLabel:"Keep editing",onApprove:n,approveLabel:"Discard changes"}),Zt=({isOpen:e,onClose:l,onDeny:a,onApprove:n,action:o="delete",target:i})=>{const r=o.charAt(0).toUpperCase()+o.substring(1),s=i?.endsWith("s")?"these":"this";return t(A,{title:`${r}${i?` ${i}`:""}?`,description:`Are you sure you want to ${o}${i?` ${s} ${i}`:""}?`,isOpen:e,onClose:l,onDeny:a,denyLabel:"Go back",onApprove:n,approveLabel:r})},Qt=(e,t)=>!t?.length||!!t?.find(t=>t===e),el=({title:l="Signals",required:i,errorMessage:r,allowedSignals:s,selectedSignals:c,setSelectedSignals:d})=>{const[u,h]=n(1===c.length),p=o(JSON.stringify(c));return a(()=>{const e=N(c);e.length||D.forEach(({id:t})=>{Qt(t,s)&&e.push(t)});const t=JSON.stringify(e);p.current!==t&&(p.current=t,d(e),h(1===e.length))},[s,c]),e(m,{$gap:12,children:[t(g,{label:l,required:i}),t(O,{$gap:12,children:D.map(e=>{const l=Qt(e.id,s),a=((e,t)=>!!t?.find(t=>t===e))(e.id,c);return l?t(b,{label:e.value,disabled:!l||u&&a,value:a,onChange:t=>((e,t)=>{const l=e,a=t?[...c,l]:c.filter(e=>e!==l);d(a),h(1===a.length)})(e.id,t)},e.id):null})}),t(f,{errorMessage:r})]})},tl=({minSupportedVersion:e,currentVersion:l})=>t(A,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>t(V,{scale:2.4,icon:()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:t("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${e} or later.\nCurrent version: ${l}.`}),ll=u.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
justify-content: flex-end;
|
|
@@ -79,7 +79,7 @@ import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useEffect
|
|
|
79
79
|
align-items: center;
|
|
80
80
|
gap: 8px;
|
|
81
81
|
padding: 8px;
|
|
82
|
-
`,Dl=({onClose:l,selectedConnectionIds:a,setSelectedConnectionIds:i,createAction:r})=>{const c=h(),[d,u]=n(""),[p,m]=n(null),g=s(()=>(d?me.filter(e=>e?.label?.toLowerCase().includes(d.toLowerCase())):me).filter(e=>!!e),[d]),b=s(()=>(d?ge.filter(e=>e?.label?.toLowerCase().includes(d.toLowerCase())):ge).filter(e=>!!e),[d]),f=be(xl),C=o(null),y=s(()=>{const l=(l,a)=>e(Nl,{children:[t(K,{size:E.XS,color:c.v2.colors.silver[200],children:l}),t(de,{label:a.toString()})]},l),a=e=>{const l=p?.type===e.type;return t(Al,{title:e.label,description:e.description,withCarret:!0,isSelected:l,onClick:()=>{f.resetFormData(),
|
|
82
|
+
`,Dl=({onClose:l,selectedConnectionIds:a,setSelectedConnectionIds:i,createAction:r})=>{const c=h(),[d,u]=n(""),[p,m]=n(null),g=s(()=>(d?me.filter(e=>e?.label?.toLowerCase().includes(d.toLowerCase())):me).filter(e=>!!e),[d]),b=s(()=>(d?ge.filter(e=>e?.label?.toLowerCase().includes(d.toLowerCase())):ge).filter(e=>!!e),[d]),f=be(xl),C=o(null),y=s(()=>{const l=(l,a)=>e(Nl,{children:[t(K,{size:E.XS,color:c.v2.colors.silver[200],children:l}),t(de,{label:a.toString()})]},l),a=e=>{const l=p?.type===e.type;return t(Al,{title:e.label,description:e.description,withCarret:!0,isSelected:l,onClick:()=>{C.current?.clearErrors(),f.resetFormData(),f.handleFormChange("type",e.type),m(e)}},e.type)};return[l("Attributes",g.length),...g.map(a),l("Samplers",b.length),...b.map(a)]},[c,p?.type,g.length,b.length,f]),v=s(()=>p?[t(ml,{option:p,...f},p?.type)]:[t(M,{$height:"100%",children:t(R,{icon:gt,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p,f]);return t(pl,{ref:C,isOpen:!0,onClose:l,onSave:async()=>{const{isOk:e,preparedFormData:t}=((e,t)=>{if(!e)return{isOk:!1,preparedFormData:N(xl)};const l=(a=t.formData,N(a));var a;const n={};return t.handleErrorChange(void 0,void 0,n),{isOk:0===Object.keys(n).length,preparedFormData:l}})(p,f);return e?await r(t):Promise.resolve({error:"Invalid form values"})},disableSave:!p||!f.isFormDirty,isFormDirty:f.isFormDirty,hideDirtyNote:!0,progress:{title:fe.CREATING_ACTION,subTitle:fe.CREATING_ACTION_SUBTITLE},header:{icon:gt,title:fe.ADD_ACTION,subTitle:fe.ADD_ACTION_DESCRIPTION},connectionIds:{value:a,setValue:i},search:{value:d,onChange:u},leftColumn:{width:"40%",list:y},rightColumn:{width:"60%",list:v}})},Ol=({selectedArea:e,genericForm:l})=>({width:"60%",list:e?[t(bl,{option:e.option,dynamicFields:e.dynamicFields,...l},e?.option.type)]:[t(M,{$height:"100%",children:t(R,{icon:bt,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]});var Vl;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(Vl||(Vl={}));const Fl=e=>({type:"",disabled:!1,name:"",currentStreamName:e,exportedSignals:{logs:!1,metrics:!1,traces:!1},fields:[]}),Ml=u.div`
|
|
83
83
|
display: flex;
|
|
84
84
|
flex-direction: column;
|
|
85
85
|
padding: 8px;
|
|
@@ -91,7 +91,7 @@ import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useEffect
|
|
|
91
91
|
justify-content: space-between;
|
|
92
92
|
gap: 12px;
|
|
93
93
|
padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
|
|
94
|
-
`,Pl=({title:l,tooltip:a,list:o,noBgColor:i})=>{const[r,s]=n(!0);return e(Ml,{$noBgColor:i,children:[e(Rl,{$isOpen:r,children:[e(O,{$gap:10,children:[t(K,{size:E.XS,children:l}),a&&t(ae,{text:a,withIcon:!0}),t(de,{label:o.length})]}),t(ye,{icon:r?ft:Ct,size:ve.M,onClick:()=>s(e=>!e)})]}),r?t(m,{children:o.length?c.toArray(o):t(M,{$padding:"12px 0",children:t(R,{})})}):null]})},Ll=(e,t,l)=>t||l.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!l.signalType||Q(e.supportedSignals).includes(l.signalType))):e,El=({listType:e,dest:l,isSelected:a,onSelect:n})=>t(Al,{icon:Se(l.type).icon,title:l.displayName,withCarret:!0,isSelected:a,onClick:()=>{n()}},`${e}-${l.type}`),zl=({listType:e,destinations:l,selectedArea:a,onSelect:n})=>t(Pl,{title:ke[e].TITLE,tooltip:ke[e].DESCRIPTION,list:l.map(l=>t(El,{listType:e,dest:l,isSelected:a?.option.type===l.type&&a?.listType===e,onSelect:()=>{return n({listType:e,option:l,dynamicFields:(t=l.fields,t.filter(e=>!!e).map(e=>{const{name:t,componentType:l,componentProperties:a,displayName:n,initialValue:o,renderCondition:i}=e,r=l===I.Dropdown,s=Z(a,{});return{componentType:l,renderCondition:i,name:t,title:n,value:o,placeholder:s.placeholder||(r?"Select an option":void 0),options:r&&Array.isArray(s.values)?s.values.map(e=>({id:e,value:e})):void 0,...s}}))});var t}},`${e}-${l.type}`))},e),jl=({isFetching:e,destinationsByCategory:l,searchText:a,filters:n,selectedArea:o,onSelect:i})=>{const r=s(()=>{const e=[];for(const r of Object.values(we)){if(n.categoryType&&n.categoryType!==r)continue;const s=Ll(l[r],a,n);s.length&&e.push(t(zl,{listType:r,destinations:s,selectedArea:o,onSelect:i},r))}return e},[l,a,n,o,i]);return{width:"40%",list:r.length?r:e?[t(M,{$height:"100%",children:t(L,{title:"Fetching destinations",subTitle:"Please wait while we fetch the destinations",withSpinner:!0})},"loading")]:[]}},ql=({destinationsByCategory:a,filters:n,setFilters:o})=>{const i=s(()=>Object.values(we).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>a[e.id]?.length),[a]),r=s(()=>{const e=Object.values(ee).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(l,{children:[t(X,{placeholder:"Select category",options:i,values:n.categoryType?[n.categoryType]:[],setValues:e=>o({...n,categoryType:n.categoryType===e[0]?null:e[0]})}),t(J,{size:$e.S,options:r,selected:n.signalType,setSelected:e=>o({...n,signalType:e})})]})},Hl=({onClose:e,selectedConnectionIds:l,setSelectedConnectionIds:i,getDestinationCategories:r,getPotentialDestinations:s,createDestination:c})=>{const[u,h]=n(""),[p,m]=n({categoryType:null,signalType:null}),[g,b]=n(null),[f,C]=n(!0),[y,w]=n({[we.EXISTS]:[],[we.DETECTED]:[],[we.SELF_HOSTED]:[],[we.MANAGED]:[]}),k=d(async()=>{try{C(!0);const[e,t]=await Promise.all([r(),s()]),{detectedDestinations:l,selfHostedDestinations:a,managedDestinations:n}=((e,t)=>{const l=[],a=[],n=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Vl.SELF_HOSTED?a.push(...e.items):e.name===Vl.MANAGED&&n.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const a of e?.destinationCategories?.categories||[]){const e=N(a),n=e.items.findIndex(e=>e.type===t.type);if(-1!==n){const a=Z(t.fields,[]);a.length&&(e.items[n].fields=e.items[n].fields.map(e=>{const t=a.find(t=>t.name===e.name)?.initialValue;return{...e,initialValue:t}}),l.push(e.items[n]))}}}),{detectedDestinations:l,selfHostedDestinations:a,managedDestinations:n}})(e,t);w(e=>({...e,[we.DETECTED]:l,[we.SELF_HOSTED]:a,[we.MANAGED]:n}))}catch(e){}finally{C(!1)}},[]);a(()=>{k()},[]);const{selectedStreamName:S}=xe(),$=be(Fl(S)),x=o(null);return t(pl,{ref:x,isOpen:!0,onClose:e,onSave:async()=>{const{isOk:e,preparedFormData:t}=((e,t)=>{if(!e)return{isOk:!1,preparedFormData:N(Fl(t.formData.currentStreamName))};const l=N(t.formData),a={};return e.dynamicFields.forEach(({name:e,required:t})=>{if(t){const t=l.fields.find(t=>t.key===e)?.value;v(t)&&(a[e]=Ce.FIELD_IS_REQUIRED)}}),te(l.exportedSignals).length||(a.exportedSignals=Ce.FIELD_IS_REQUIRED),t.handleErrorChange(void 0,void 0,a),{isOk:0===Object.keys(a).length,preparedFormData:l}})(g,$);return e?await c(t):Promise.resolve({error:"Invalid form values"})},disableSave:!g,isFetching:f,isFormDirty:$.isFormDirty,hideDirtyNote:!0,progress:{title:fe.CREATING_DESTINATION,subTitle:fe.CREATING_DESTINATION_SUBTITLE},header:{icon:bt,title:fe.ADD_DESTINATIONS,subTitle:fe.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:{value:l,setValue:i},search:{value:u,onChange:h},filters:t(ql,{destinationsByCategory:y,filters:p,setFilters:m}),leftColumn:jl({isFetching:f,destinationsByCategory:y,searchText:u,filters:p,selectedArea:g,onSelect:e=>{$.resetFormData(),x.current?.clearErrors(),b(e)}}),rightColumn:Ol({selectedArea:g,genericForm:$})})},_l={disabled:!1,ruleName:"",notes:"",workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:null},Bl=({onClose:e,selectedConnectionIds:l,setSelectedConnectionIds:a,createInstrumentationRule:i})=>{const[r,c]=n(""),[d,u]=n(null),h=s(()=>r?Ie.filter(e=>e.label.toLowerCase().includes(r.toLowerCase())):Ie,[r]),p=be(_l),m=o(null),g=s(()=>h.map(e=>{const l=d?.type===e.type;return t(Al,{title:e.label,description:e.description,withCarret:!0,isSelected:l,onClick:()=>{p.resetFormData(),m.current?.clearErrors(),u(e)}},e.type)}),[d,h.length,p]),b=s(()=>d?[t($l,{option:d,...p},d?.type)]:[t(M,{$height:"100%",children:t(R,{icon:yt,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[d,p]);return t(pl,{ref:m,isOpen:!0,onClose:e,onSave:async()=>{const{isOk:e,preparedFormData:t}=((e,t)=>{if(!e)return{isOk:!1,preparedFormData:N(_l)};const l=(e=>{const t=N(e);return t.headersCollection?.[ne.HeaderKeys]?.length&&(t.headersCollection[ne.HeaderKeys]=t.headersCollection[ne.HeaderKeys].map(e=>e.trim()).filter(e=>e)),t.customInstrumentations?.[se.Golang]?.length&&(t.customInstrumentations[se.Golang]=t.customInstrumentations[se.Golang].map(e=>new ie(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).filter(e=>e.Verify())),t.customInstrumentations?.[se.Java]?.length&&(t.customInstrumentations[se.Java]=t.customInstrumentations[se.Java].map(e=>new re(e.className,e.methodName)).filter(e=>e.Verify())),t})(t.formData),a={};switch(e.type){case ce.CodeAttributes:Object.values(l.codeAttributes||{}).some(e=>null!=e)||(a.codeAttributes="Code attributes are required");break;case ce.PayloadCollection:Object.values(l.payloadCollection||{}).some(e=>null!=e)||(a.payloadCollection="Payload collection are required");break;case ce.HeadersCollection:l.headersCollection?.[ne.HeaderKeys]?.length||(a.headersCollection="Header keys are required");break;case ce.CustomInstrumentation:l.customInstrumentations?.[se.Golang]?.length||l.customInstrumentations?.[se.Java]?.length||(a.customInstrumentations="Custom instrumentation are required")}return t.handleErrorChange(void 0,void 0,a),{isOk:0===Object.keys(a).length,preparedFormData:l}})(d,p);return e?await i(t):Promise.resolve({error:"Invalid form values"})},disableSave:!d||!p.isFormDirty,isFormDirty:p.isFormDirty,hideDirtyNote:!0,progress:{title:fe.CREATING_INSTRUMENTATION_RULE,subTitle:fe.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:yt,title:fe.ADD_INSTRUMENTATION_RULE,subTitle:fe.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:{value:l,setValue:a},search:{value:r,onChange:c},leftColumn:{width:"40%",list:g},rightColumn:{width:"60%",list:b}})},Kl=e=>{const t=e.workloads.filter(({selected:e})=>e).length,l=e.workloads.length;return{selectedCount:t,isAllSourced:t>0&&t===l,isSomeSourced:t>0&&t<l,isFutureApps:e.selected||!1}},Wl=(e,t,l)=>{if(t&&!e.name.toLowerCase().includes(t.toLowerCase()))return!1;if(l.showOnlySelected){const{isAllSourced:t,isSomeSourced:l,isFutureApps:a}=Kl(e);return t||l||a}return!0},Gl=(e,t,l)=>!(t&&!e.name.toLowerCase().includes(t.toLowerCase()))&&(!l.showOnlySelected||e.selected),Jl=u.div``,Ul=u.div`
|
|
94
|
+
`,Pl=({title:l,tooltip:a,list:o,noBgColor:i})=>{const[r,s]=n(!0);return e(Ml,{$noBgColor:i,children:[e(Rl,{$isOpen:r,children:[e(O,{$gap:10,children:[t(K,{size:E.XS,children:l}),a&&t(ae,{text:a,withIcon:!0}),t(de,{label:o.length})]}),t(ye,{icon:r?ft:Ct,size:ve.M,onClick:()=>s(e=>!e)})]}),r?t(m,{children:o.length?c.toArray(o):t(M,{$padding:"12px 0",children:t(R,{})})}):null]})},Ll=(e,t,l)=>t||l.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!l.signalType||Q(e.supportedSignals).includes(l.signalType))):e,El=({listType:e,dest:l,isSelected:a,onSelect:n})=>t(Al,{icon:Se(l.type).icon,title:l.displayName,withCarret:!0,isSelected:a,onClick:()=>{n()}},`${e}-${l.type}`),zl=({listType:e,destinations:l,selectedArea:a,onSelect:n})=>t(Pl,{title:ke[e].TITLE,tooltip:ke[e].DESCRIPTION,list:l.map(l=>t(El,{listType:e,dest:l,isSelected:a?.option.type===l.type&&a?.listType===e,onSelect:()=>{return n({listType:e,option:l,dynamicFields:(t=l.fields,t.filter(e=>!!e).map(e=>{const{name:t,componentType:l,componentProperties:a,displayName:n,initialValue:o,renderCondition:i}=e,r=l===I.Dropdown,s=Z(a,{});return{componentType:l,renderCondition:i,name:t,title:n,value:o,placeholder:s.placeholder||(r?"Select an option":void 0),options:r&&Array.isArray(s.values)?s.values.map(e=>({id:e,value:e})):void 0,...s}}))});var t}},`${e}-${l.type}`))},e),jl=({isFetching:e,destinationsByCategory:l,searchText:a,filters:n,selectedArea:o,onSelect:i})=>{const r=s(()=>{const e=[];for(const r of Object.values(we)){if(n.categoryType&&n.categoryType!==r)continue;const s=Ll(l[r],a,n);s.length&&e.push(t(zl,{listType:r,destinations:s,selectedArea:o,onSelect:i},r))}return e},[l,a,n,o,i]);return{width:"40%",list:r.length?r:e?[t(M,{$height:"100%",children:t(L,{title:"Fetching destinations",subTitle:"Please wait while we fetch the destinations",withSpinner:!0})},"loading")]:[]}},ql=({destinationsByCategory:a,filters:n,setFilters:o})=>{const i=s(()=>Object.values(we).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>a[e.id]?.length),[a]),r=s(()=>{const e=Object.values(ee).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(l,{children:[t(X,{placeholder:"Select category",options:i,values:n.categoryType?[n.categoryType]:[],setValues:e=>o({...n,categoryType:n.categoryType===e[0]?null:e[0]})}),t(J,{size:$e.S,options:r,selected:n.signalType,setSelected:e=>o({...n,signalType:e})})]})},Hl=({onClose:e,selectedConnectionIds:l,setSelectedConnectionIds:i,getDestinationCategories:r,getPotentialDestinations:s,createDestination:c})=>{const[u,h]=n(""),[p,m]=n({categoryType:null,signalType:null}),[g,b]=n(null),[f,C]=n(!0),[y,w]=n({[we.ALL]:[],[we.EXISTS]:[],[we.DETECTED]:[],[we.SELF_HOSTED]:[],[we.MANAGED]:[]}),k=d(async()=>{try{C(!0);const[e,t]=await Promise.all([r(),s()]),{detectedDestinations:l,selfHostedDestinations:a,managedDestinations:n}=((e,t)=>{const l=[],a=[],n=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Vl.SELF_HOSTED?a.push(...e.items):e.name===Vl.MANAGED&&n.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const a of e?.destinationCategories?.categories||[]){const e=N(a),n=e.items.findIndex(e=>e.type===t.type);if(-1!==n){const a=Z(t.fields,[]);a.length&&(e.items[n].fields=e.items[n].fields.map(e=>{const t=a.find(t=>t.name===e.name)?.initialValue;return{...e,initialValue:t}}),l.push(e.items[n]))}}}),{detectedDestinations:l,selfHostedDestinations:a,managedDestinations:n}})(e,t);w(e=>({...e,[we.DETECTED]:l,[we.SELF_HOSTED]:a,[we.MANAGED]:n}))}catch(e){}finally{C(!1)}},[]);a(()=>{k()},[]);const{selectedStreamName:S}=xe(),$=be(Fl(S)),x=o(null);return t(pl,{ref:x,isOpen:!0,onClose:e,onSave:async()=>{const{isOk:e,preparedFormData:t}=((e,t)=>{if(!e)return{isOk:!1,preparedFormData:N(Fl(t.formData.currentStreamName))};const l=N(t.formData),a={};return e.dynamicFields.forEach(({name:e,required:t})=>{if(t){const t=l.fields.find(t=>t.key===e)?.value;v(t)&&(a[e]=Ce.FIELD_IS_REQUIRED)}}),te(l.exportedSignals).length||(a.exportedSignals=Ce.FIELD_IS_REQUIRED),t.handleErrorChange(void 0,void 0,a),{isOk:0===Object.keys(a).length,preparedFormData:l}})(g,$);return e?await c(t):Promise.resolve({error:"Invalid form values"})},disableSave:!g,isFetching:f,isFormDirty:$.isFormDirty,hideDirtyNote:!0,progress:{title:fe.CREATING_DESTINATION,subTitle:fe.CREATING_DESTINATION_SUBTITLE},header:{icon:bt,title:fe.ADD_DESTINATIONS,subTitle:fe.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:{value:l,setValue:i},search:{value:u,onChange:h},filters:t(ql,{destinationsByCategory:y,filters:p,setFilters:m}),leftColumn:jl({isFetching:f,destinationsByCategory:y,searchText:u,filters:p,selectedArea:g,onSelect:e=>{$.resetFormData(),x.current?.clearErrors(),b(e)}}),rightColumn:Ol({selectedArea:g,genericForm:$})})},_l={disabled:!1,ruleName:"",notes:"",workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:null},Bl=({onClose:e,selectedConnectionIds:l,setSelectedConnectionIds:a,createInstrumentationRule:i})=>{const[r,c]=n(""),[d,u]=n(null),h=s(()=>r?Ie.filter(e=>e.label.toLowerCase().includes(r.toLowerCase())):Ie,[r]),p=be(_l),m=o(null),g=s(()=>h.map(e=>{const l=d?.type===e.type;return t(Al,{title:e.label,description:e.description,withCarret:!0,isSelected:l,onClick:()=>{p.resetFormData(),m.current?.clearErrors(),u(e)}},e.type)}),[d,h.length,p]),b=s(()=>d?[t($l,{option:d,...p},d?.type)]:[t(M,{$height:"100%",children:t(R,{icon:yt,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[d,p]);return t(pl,{ref:m,isOpen:!0,onClose:e,onSave:async()=>{const{isOk:e,preparedFormData:t}=((e,t)=>{if(!e)return{isOk:!1,preparedFormData:N(_l)};const l=(e=>{const t=N(e);return t.headersCollection?.[ne.HeaderKeys]?.length&&(t.headersCollection[ne.HeaderKeys]=t.headersCollection[ne.HeaderKeys].map(e=>e.trim()).filter(e=>e)),t.customInstrumentations?.[se.Golang]?.length&&(t.customInstrumentations[se.Golang]=t.customInstrumentations[se.Golang].map(e=>new ie(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).filter(e=>e.Verify())),t.customInstrumentations?.[se.Java]?.length&&(t.customInstrumentations[se.Java]=t.customInstrumentations[se.Java].map(e=>new re(e.className,e.methodName)).filter(e=>e.Verify())),t})(t.formData),a={};switch(e.type){case ce.CodeAttributes:Object.values(l.codeAttributes||{}).some(e=>null!=e)||(a.codeAttributes="Code attributes are required");break;case ce.PayloadCollection:Object.values(l.payloadCollection||{}).some(e=>null!=e)||(a.payloadCollection="Payload collection are required");break;case ce.HeadersCollection:l.headersCollection?.[ne.HeaderKeys]?.length||(a.headersCollection="Header keys are required");break;case ce.CustomInstrumentation:l.customInstrumentations?.[se.Golang]?.length||l.customInstrumentations?.[se.Java]?.length||(a.customInstrumentations="Custom instrumentation are required")}return t.handleErrorChange(void 0,void 0,a),{isOk:0===Object.keys(a).length,preparedFormData:l}})(d,p);return e?await i(t):Promise.resolve({error:"Invalid form values"})},disableSave:!d||!p.isFormDirty,isFormDirty:p.isFormDirty,hideDirtyNote:!0,progress:{title:fe.CREATING_INSTRUMENTATION_RULE,subTitle:fe.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:yt,title:fe.ADD_INSTRUMENTATION_RULE,subTitle:fe.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:{value:l,setValue:a},search:{value:r,onChange:c},leftColumn:{width:"40%",list:g},rightColumn:{width:"60%",list:b}})},Kl=e=>{const t=e.workloads.filter(({selected:e})=>e).length,l=e.workloads.length;return{selectedCount:t,isAllSourced:t>0&&t===l,isSomeSourced:t>0&&t<l,isFutureApps:e.selected||!1}},Wl=(e,t,l)=>{if(t&&!e.name.toLowerCase().includes(t.toLowerCase()))return!1;if(l.showOnlySelected){const{isAllSourced:t,isSomeSourced:l,isFutureApps:a}=Kl(e);return t||l||a}return!0},Gl=(e,t,l)=>!(t&&!e.name.toLowerCase().includes(t.toLowerCase()))&&(!l.showOnlySelected||e.selected),Jl=u.div``,Ul=u.div`
|
|
95
95
|
visibility: hidden;
|
|
96
96
|
|
|
97
97
|
transition: visibility 0s;
|
|
@@ -126,7 +126,7 @@ import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useEffect
|
|
|
126
126
|
padding: 12px 24px;
|
|
127
127
|
border-radius: 8px;
|
|
128
128
|
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
129
|
-
`,ua=({downloadDiagnose:l})=>{const a=h(),{namespaces:o}=ze(),[i,r]=n(null),{formData:s,handleFormChange:c,resetFormData:d}=be({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ee,{richTitle:{icon:At,title:"Diagnose"},children:i?t(da,{children:t(L,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",startedAt:i,withGradient:!0,withVisual:!0,visualIcon:Nt})}):e(m,{$gap:24,children:[t(K,{size:E.XXS,color:a.v2.colors.silver[200],children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(m,{$gap:16,children:[e(O,{$gap:8,children:[t(b,{label:"Profiles",value:s.includeProfiles,onChange:e=>c("includeProfiles",e)}),t(K,{size:E.XXXS,color:a.v2.colors.silver[200],children:"Include pprof profiles"})]}),e(O,{$gap:8,children:[t(b,{label:"Metrics",value:s.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(K,{size:E.XXXS,color:a.v2.colors.silver[200],children:"Include Prometheus metrics"})]}),e(O,{$gap:8,children:[t(b,{label:"Source Workloads",value:s.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(K,{size:E.XXXS,color:a.v2.colors.silver[200],children:"Include workload and pod manifests for instrumented sources"})]})]}),t(je,{alignX:He.Left,alignY:qe.Bottom,items:o.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:s.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(s.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:B.Secondary,disabled:s.includeSourceWorkloads,leftIcon:s.sourceWorkloadNamespaces.length?()=>t(de,{label:s.sourceWorkloadNamespaces.length,status:H.Default}):void 0}}),t(O,{$justifyContent:"flex-end",children:t(_,{label:"Download Diagnose",rightIcon:Nt,variant:B.Primary,onClick:async()=>{r(Date.now()),await l(s),r(null),d()},disabled:null!==i})})]})})},ha=({fetchDescribeOdigos:e})=>{const{platformType:l,version:o,tier:i}=_e(),[r,s]=n(null);return a(()=>{e().then(({data:e})=>s(e?.describeOdigos||null))},[]),t(Ee,{richTitle:{icon:Dt,title:"General Information"},children:t(Be,{cellsPerRow:2,items:[{id:Ke(),title:"Odigos Version",label:o},{id:Ke(),title:`${l.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:Ke(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:Ke(),title:"Tier",label:i}]})})},pa=({isOpen:l,onClose:a,token:n,updateToken:o,fetchDescribeOdigos:i,downloadDiagnose:r})=>e(P,{isOpen:l,header:{icon:Dt,title:"System Overview",onClose:a},children:[i&&t(ha,{fetchDescribeOdigos:i}),o&&n&&t(ca,{token:n,updateToken:o}),r&&t(ua,{downloadDiagnose:r})]});var ma,ga;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(ma||(ma={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(ga||(ga={}));const ba=[{key:ga.Name,label:"Name"},{key:ga.Type,label:"Type",textAlign:"right"},{key:ga.Status,label:"Status"},{key:ga.OdigosVersion,label:"Odigos Version"},{key:ga.ConnectedSince,label:"Connected Since"},{key:ga.LastActivity,label:"Last Activity"}],fa=(e,t)=>{const l=e.find(e=>e.key===ga.Id)?.rawValue;return t(l?.toString()||"")},Ca=({tableRowsMaxHeight:l,connections:o,getConnections:i,onClickConnection:r,deleteConnection:c,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:m,snapshotMinSupportedVersion:g=0,getAllClusterSnapshots:b,persistSources:f,getDestinationCategories:C,getPotentialDestinations:y,createDestination:v,createAction:w,createInstrumentationRule:k})=>{const S=h(),{formatTimeAgo:$}=Pe(),[x,I]=n(!1),[T,A]=n(o||[]),N=d(async()=>{try{I(!0),A(await i()??[])}catch(e){}finally{I(!1)}},[]);a(()=>{T.length||N()},[]);const[D,O]=n(""),[V,F]=n(null),[M,R]=n([]),P=s(()=>V===ma.BulkConfig?u:V===ma.BulkSource?g:0,[V,u,g]),{supportedConnections:L,supportedConnectionIds:E}=s(()=>{const e=((e,t)=>e.filter(e=>{const l=e.status===H.Success,a=We(e.odigosVersion,t);return l&&a}))(T,P);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[T.length,P]);a(()=>{if(!V||V===ma.Delete)return;const e=M.filter(e=>!E.includes(e));e.length&&R(t=>t.filter(t=>!e.includes(t)))},[V,M.length,E.length]);const z=s(()=>T.filter(e=>!D||e.name.toLowerCase().includes(D.toLowerCase())).map(e=>({cells:[{key:ga.Id,rawValue:e.id},{key:ga.Name,rawValue:e.name},{key:ga.Type,rawValue:e.type},{key:ga.Status,rawValue:e.status,component:()=>(e=>{const l=e===H.Success?"Connection live":"Connection lost",a=e===H.Success?St:kt;return t(de,{status:e,label:l,leftIcon:a})})(e.status)},{key:ga.OdigosVersion,rawValue:e.odigosVersion},{key:ga.ConnectedSince,rawValue:e.connectedAt?$(e.connectedAt):"-"},{key:ga.LastActivity,rawValue:e.lastSeenAt?$(e.lastSeenAt):"-"}],onClick:e.status!==H.Success||V?void 0:()=>r(e),isSelected:M.includes(e.id),onSelect:()=>R(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>R(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==H.Success||V===ma.BulkConfig&&!We(e.odigosVersion,u)||V===ma.BulkSource&&!We(e.odigosVersion,g)})),[T,M,D,V,u,g]),j=s(()=>{const e=(e,t)=>{R([e]),F(t)};return(e=>{const{connections:t,configMinSupportedVersion:l,snapshotMinSupportedVersion:a,onDelete:n,onAddSource:o,onAddDestination:i,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===ga.Status)?.rawValue===H.Success)(e))return[{id:Ke(),label:"Delete Connection",rightIcon:Ot,onClick:()=>fa(e,n)}];const d=fa(e,e=>{const a=t.find(t=>t.id===e);return!!a&&We(a.odigosVersion,l)}),u=fa(e,e=>{const l=t.find(t=>t.id===e);return!!l&&We(l.odigosVersion,a)}),h=[];return o&&h.push({id:Ke(),tooltip:u?fe.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${a} or later.`,rightIcon:vt,disabled:!u,onClick:()=>fa(e,o)}),i&&h.push({id:Ke(),tooltip:fe.ADD_DESTINATION,rightIcon:bt,onClick:()=>fa(e,i)}),r&&h.push({id:Ke(),tooltip:fe.ADD_ACTION,rightIcon:gt,onClick:()=>fa(e,r)}),s&&h.push({id:Ke(),tooltip:fe.ADD_INSTRUMENTATION_RULE,rightIcon:yt,onClick:()=>fa(e,s)}),c&&h.push({id:Ke(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${l} or later.`,rightIcon:wt,disabled:!d,onClick:()=>fa(e,c)}),h}})({connections:T,configMinSupportedVersion:u,snapshotMinSupportedVersion:g,onDelete:t=>e(t,ma.Delete),onAddSource:b&&f?t=>e(t,ma.BulkSource):void 0,onAddDestination:C&&y&&v?t=>e(t,ma.BulkDestination):void 0,onAddAction:w?t=>e(t,ma.BulkAction):void 0,onAddInstrumentationRule:k?t=>e(t,ma.BulkInstrumentationRule):void 0,onEditConfiguration:p&&m?t=>e(t,ma.BulkConfig):void 0})},[T,u,p,m,g,b,f,C,y,v,w,k]),q=s(()=>(e=>{const{onCancel:t,onAddSource:l,onAddDestination:a,onAddAction:n,onAddInstrumentationRule:o,onManageConfigurations:i}=e,r=[];l&&r.push({id:Ke(),type:Ge.Button,buttonProps:{variant:B.Primary,size:W.S,label:"Add Sources",rightIcon:vt,onClick:l}});const s=[a?{id:ma.BulkDestination,label:fe.ADD_DESTINATION,icon:bt}:null,n?{id:ma.BulkAction,label:fe.ADD_ACTION,icon:gt}:null,o?{id:ma.BulkInstrumentationRule,label:fe.ADD_INSTRUMENTATION_RULE,icon:yt}:null,i?{id:ma.BulkConfig,label:"Manage Configurations",icon:wt}:null];return s.some(Boolean)&&r.push({id:Ke(),type:Ge.ButtonDropData,buttonProps:{variant:B.Secondary,size:W.S,label:"Bulk Actions",onClick:e=>{e===ma.BulkSource?l?.():e===ma.BulkDestination?a?.():e===ma.BulkAction?n?.():e===ma.BulkInstrumentationRule?o?.():e===ma.BulkConfig&&i?.()}},dropDataProps:{alignX:He.Left,items:s}}),r.push({id:Ke(),type:Ge.Button,buttonProps:{variant:B.Text,size:W.S,label:Je.CANCEL,onClick:t}}),r})({onCancel:()=>R([]),onAddSource:b&&f?()=>F(ma.BulkSource):void 0,onAddDestination:C&&y&&v?()=>F(ma.BulkDestination):void 0,onAddAction:w?()=>F(ma.BulkAction):void 0,onAddInstrumentationRule:k?()=>F(ma.BulkInstrumentationRule):void 0,onManageConfigurations:p&&m?()=>F(ma.BulkConfig):void 0}),[p,m,b,f,C,y,v,w,k]);return t(Ue,{children:e(Ee,{richTitle:{icon:Ft,title:fe.CONNECTIONS,badge:{label:T.length.toString(),status:Te.Unknown}},search:{placeholder:"Search by cluster name",value:D,onChange:e=>O(e),width:"300px"},actions:[{id:Ke(),type:Ge.Button,buttonProps:{variant:B.Secondary,size:W.S,leftIcon:Vt,onClick:N,disabled:x}}],children:[t(Ye,{variant:Xe.Pretty,maxHeight:l,headerBackgroundColor:S.v2.colors.silver[1e3],isLoading:x,withCheckboxes:!0,columns:ba,rows:z,rowActionsPushRightPosition:V?`calc(${il} - 24px)`:void 0,getRowActions:j}),V===ma.BulkConfig&&p&&m&&t(na,{onClose:()=>F(null),connections:L,selectedConnectionIds:M,setSelectedConnectionIds:R,getEffectiveConfig:p,onApply:m}),V===ma.BulkSource&&b&&f&&t(aa,{onClose:()=>F(null),selectedConnectionIds:M,setSelectedConnectionIds:R,getAllClusterSnapshots:b,persistSources:async e=>await(f?.(e))}),V===ma.BulkDestination&&C&&y&&v&&t(Hl,{onClose:()=>F(null),selectedConnectionIds:M,setSelectedConnectionIds:R,getDestinationCategories:C,getPotentialDestinations:y,createDestination:v}),V===ma.BulkAction&&w&&t(Dl,{onClose:()=>F(null),selectedConnectionIds:M,setSelectedConnectionIds:R,createAction:e=>w(e,M)}),V===ma.BulkInstrumentationRule&&k&&t(Bl,{onClose:()=>F(null),selectedConnectionIds:M,setSelectedConnectionIds:R,createInstrumentationRule:e=>k(e,M)}),t(Zt,{target:"connection",isOpen:V===ma.Delete,onClose:()=>{R([]),F(null)},onApprove:async()=>{const e=M[0];e&&(await c(e),await N())}}),t(Ze,{isOpen:!!M.length&&!V,richTitle:{icon:st,title:"Selected Clusters",badge:{label:M.length}},actions:q})]})})},ya=u.div`
|
|
129
|
+
`,ua=({downloadDiagnose:l})=>{const a=h(),{namespaces:o}=ze(),[i,r]=n(null),{formData:s,handleFormChange:c,resetFormData:d}=be({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ee,{richTitle:{icon:At,title:"Diagnose"},children:i?t(da,{children:t(L,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",startedAt:i,withGradient:!0,withVisual:!0,visualIcon:Nt})}):e(m,{$gap:24,children:[t(K,{size:E.XXS,color:a.v2.colors.silver[200],children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(m,{$gap:16,children:[e(O,{$gap:8,children:[t(b,{label:"Profiles",value:s.includeProfiles,onChange:e=>c("includeProfiles",e)}),t(K,{size:E.XXXS,color:a.v2.colors.silver[200],children:"Include pprof profiles"})]}),e(O,{$gap:8,children:[t(b,{label:"Metrics",value:s.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(K,{size:E.XXXS,color:a.v2.colors.silver[200],children:"Include Prometheus metrics"})]}),e(O,{$gap:8,children:[t(b,{label:"Source Workloads",value:s.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(K,{size:E.XXXS,color:a.v2.colors.silver[200],children:"Include workload and pod manifests for instrumented sources"})]})]}),t(je,{alignX:He.Left,alignY:qe.Bottom,items:o.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:s.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(s.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:B.Secondary,disabled:s.includeSourceWorkloads,leftIcon:s.sourceWorkloadNamespaces.length?()=>t(de,{label:s.sourceWorkloadNamespaces.length,status:H.Default}):void 0}}),t(O,{$justifyContent:"flex-end",children:t(_,{label:"Download Diagnose",rightIcon:Nt,variant:B.Primary,onClick:async()=>{r(Date.now()),await l(s),r(null),d()},disabled:null!==i})})]})})},ha=({fetchDescribeOdigos:e})=>{const{platformType:l,version:o,tier:i}=_e(),[r,s]=n(null);return a(()=>{e().then(({data:e})=>s(e?.describeOdigos||null))},[]),t(Ee,{richTitle:{icon:Dt,title:"General Information"},children:t(Be,{cellsPerRow:2,items:[{id:Ke(),title:"Odigos Version",label:o},{id:Ke(),title:`${l.toUpperCase()} Version`,label:r?.kubernetesVersion?.value||"-"},{id:Ke(),title:"Installation Method",label:r?.installationMethod?.value||"-"},{id:Ke(),title:"Tier",label:i}]})})},pa=({isOpen:l,onClose:a,token:n,updateToken:o,fetchDescribeOdigos:i,downloadDiagnose:r})=>e(P,{isOpen:l,header:{icon:Dt,title:"System Overview",onClose:a},children:[i&&t(ha,{fetchDescribeOdigos:i}),o&&n&&t(ca,{token:n,updateToken:o}),r&&t(ua,{downloadDiagnose:r})]});var ma,ga;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(ma||(ma={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(ga||(ga={}));const ba=[{key:ga.Name,label:"Name"},{key:ga.Type,label:"Type",textAlign:"right"},{key:ga.Status,label:"Status"},{key:ga.OdigosVersion,label:"Odigos Version"},{key:ga.ConnectedSince,label:"Connected Since"},{key:ga.LastActivity,label:"Last Activity"}],fa=(e,t)=>{const l=e.find(e=>e.key===ga.Id)?.rawValue;return t(l?.toString()||"")},Ca=({tableRowsMaxHeight:l,connections:o,getConnections:i,onClickConnection:r,deleteConnection:c,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:m,snapshotMinSupportedVersion:g=0,getAllClusterSnapshots:b,persistSources:f,getDestinationCategories:C,getPotentialDestinations:y,createDestination:v,createAction:w,createInstrumentationRule:k})=>{const S=h(),{formatTimeAgo:$}=Pe(),[x,I]=n(!1),[T,A]=n(o||[]),N=d(async()=>{try{I(!0),A(await i()??[])}catch(e){}finally{I(!1)}},[]);a(()=>{T.length||N()},[]);const[D,O]=n(""),[V,F]=n(null),[M,R]=n([]),P=s(()=>V===ma.BulkConfig?u:V===ma.BulkSource?g:0,[V,u,g]),{supportedConnections:L,supportedConnectionIds:E}=s(()=>{const e=((e,t)=>e.filter(e=>{const l=e.status===H.Success,a=We(e.odigosVersion,t);return l&&a}))(T,P);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[T.length,P]);a(()=>{if(!V||V===ma.Delete)return;const e=M.filter(e=>!E.includes(e));e.length&&R(t=>t.filter(t=>!e.includes(t)))},[V,M.length,E.length]);const z=s(()=>T.filter(e=>!D||e.name.toLowerCase().includes(D.toLowerCase())).map(e=>({cells:[{key:ga.Id,rawValue:e.id},{key:ga.Name,rawValue:e.name},{key:ga.Type,rawValue:e.type},{key:ga.Status,rawValue:e.status,component:()=>(e=>{const l=e===H.Success?"Connection live":"Connection lost",a=e===H.Success?St:kt;return t(de,{status:e,label:l,leftIcon:a})})(e.status)},{key:ga.OdigosVersion,rawValue:e.odigosVersion},{key:ga.ConnectedSince,rawValue:e.connectedAt?$(e.connectedAt):"-"},{key:ga.LastActivity,rawValue:e.lastSeenAt?$(e.lastSeenAt):"-"}],onClick:e.status!==H.Success||V?void 0:()=>r(e),isSelected:M.includes(e.id),onSelect:()=>R(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>R(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==H.Success||V===ma.BulkConfig&&!We(e.odigosVersion,u)||V===ma.BulkSource&&!We(e.odigosVersion,g)})),[T,M,D,V,u,g]),j=s(()=>{const e=(e,t)=>{R([e]),F(t)};return(e=>{const{connections:t,configMinSupportedVersion:l,snapshotMinSupportedVersion:a,onDelete:n,onAddSource:o,onAddDestination:i,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===ga.Status)?.rawValue===H.Success)(e))return[{id:Ke(),label:"Delete Connection",rightIcon:Ot,onClick:()=>fa(e,n)}];const d=fa(e,e=>{const a=t.find(t=>t.id===e);return!!a&&We(a.odigosVersion,l)}),u=fa(e,e=>{const l=t.find(t=>t.id===e);return!!l&&We(l.odigosVersion,a)}),h=[];return o&&h.push({id:Ke(),tooltip:u?fe.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${a} or later.`,rightIcon:vt,disabled:!u,onClick:()=>fa(e,o)}),i&&h.push({id:Ke(),tooltip:fe.ADD_DESTINATION,rightIcon:bt,onClick:()=>fa(e,i)}),r&&h.push({id:Ke(),tooltip:fe.ADD_ACTION,rightIcon:gt,onClick:()=>fa(e,r)}),s&&h.push({id:Ke(),tooltip:fe.ADD_INSTRUMENTATION_RULE,rightIcon:yt,onClick:()=>fa(e,s)}),c&&h.push({id:Ke(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${l} or later.`,rightIcon:wt,disabled:!d,onClick:()=>fa(e,c)}),h}})({connections:T,configMinSupportedVersion:u,snapshotMinSupportedVersion:g,onDelete:t=>e(t,ma.Delete),onAddSource:b&&f?t=>e(t,ma.BulkSource):void 0,onAddDestination:C&&y&&v?t=>e(t,ma.BulkDestination):void 0,onAddAction:w?t=>e(t,ma.BulkAction):void 0,onAddInstrumentationRule:k?t=>e(t,ma.BulkInstrumentationRule):void 0,onEditConfiguration:p&&m?t=>e(t,ma.BulkConfig):void 0})},[T,u,p,m,g,b,f,C,y,v,w,k]),q=s(()=>(e=>{const{onCancel:t,onAddSource:l,onAddDestination:a,onAddAction:n,onAddInstrumentationRule:o,onManageConfigurations:i}=e,r=[];l&&r.push({id:Ke(),type:Ge.Button,buttonProps:{variant:B.Primary,size:W.S,label:"Add Sources",rightIcon:vt,onClick:l}});const s=[a?{id:ma.BulkDestination,label:fe.ADD_DESTINATION,icon:bt}:null,n?{id:ma.BulkAction,label:fe.ADD_ACTION,icon:gt}:null,o?{id:ma.BulkInstrumentationRule,label:fe.ADD_INSTRUMENTATION_RULE,icon:yt}:null,i?{id:ma.BulkConfig,label:"Manage Configurations",icon:wt}:null];return s.some(Boolean)&&r.push({id:Ke(),type:Ge.ButtonDropData,buttonProps:{variant:B.Secondary,size:W.S,label:"Bulk Actions",onClick:e=>{e===ma.BulkSource?l?.():e===ma.BulkDestination?a?.():e===ma.BulkAction?n?.():e===ma.BulkInstrumentationRule?o?.():e===ma.BulkConfig&&i?.()}},dropDataProps:{alignX:He.Left,items:s}}),r.push({id:Ke(),type:Ge.Button,buttonProps:{variant:B.Text,size:W.S,label:Je.CANCEL,onClick:t}}),r})({onCancel:()=>R([]),onAddSource:b&&f?()=>F(ma.BulkSource):void 0,onAddDestination:C&&y&&v?()=>F(ma.BulkDestination):void 0,onAddAction:w?()=>F(ma.BulkAction):void 0,onAddInstrumentationRule:k?()=>F(ma.BulkInstrumentationRule):void 0,onManageConfigurations:p&&m?()=>F(ma.BulkConfig):void 0}),[p,m,b,f,C,y,v,w,k]);return t(Ue,{children:e(Ee,{richTitle:{icon:Ft,title:fe.CONNECTIONS,badge:{label:T.length.toString(),status:Te.Unknown}},search:{placeholder:"Search by cluster name",value:D,onChange:e=>O(e),width:"300px"},actions:[{id:Ke(),type:Ge.Button,buttonProps:{variant:B.Secondary,size:W.S,leftIcon:Vt,onClick:N,disabled:x}}],children:[t(Ye,{variant:Xe.Pretty,maxHeight:l,headerBackgroundColor:S.v2.colors.silver[1e3],isLoading:x,withCheckboxes:!0,columns:ba,rows:z,rowActionsPushRightPosition:V?`calc(${il} - 24px)`:void 0,getRowActions:j}),V===ma.BulkConfig&&p&&m&&t(na,{onClose:()=>F(null),connections:L,selectedConnectionIds:M,setSelectedConnectionIds:R,getEffectiveConfig:p,onApply:m}),V===ma.BulkSource&&b&&f&&t(aa,{onClose:()=>F(null),selectedConnectionIds:M,setSelectedConnectionIds:R,getAllClusterSnapshots:b,persistSources:async e=>await(f?.(e))}),V===ma.BulkDestination&&C&&y&&v&&t(Hl,{onClose:()=>F(null),selectedConnectionIds:M,setSelectedConnectionIds:R,getDestinationCategories:C,getPotentialDestinations:y,createDestination:e=>v(e,M)}),V===ma.BulkAction&&w&&t(Dl,{onClose:()=>F(null),selectedConnectionIds:M,setSelectedConnectionIds:R,createAction:e=>w(e,M)}),V===ma.BulkInstrumentationRule&&k&&t(Bl,{onClose:()=>F(null),selectedConnectionIds:M,setSelectedConnectionIds:R,createInstrumentationRule:e=>k(e,M)}),t(Zt,{target:"connection",isOpen:V===ma.Delete,onClose:()=>{R([]),F(null)},onApprove:async()=>{const e=M[0];e&&(await c(e),await N())}}),t(Ze,{isOpen:!!M.length&&!V,richTitle:{icon:st,title:"Selected Clusters",badge:{label:M.length}},actions:q})]})})},ya=u.div`
|
|
130
130
|
display: flex;
|
|
131
131
|
align-items: center;
|
|
132
132
|
justify-content: space-between;
|