@odigos/ui-kit 0.0.190 → 0.0.192
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 +15 -0
- package/lib/chunks/index-BgT3kLZa.js +3 -0
- package/lib/chunks/{ui-components-C1WJWY4E.js → ui-components-CCA7B7ry.js} +334 -334
- package/lib/components/_v2/drop-data/index.d.ts +5 -1
- package/lib/components/_v2/drop-down/index.d.ts +9 -0
- package/lib/components/_v2/index.d.ts +1 -0
- package/lib/components/_v2/input/index.d.ts +1 -1
- package/lib/components/_v2/input-table/index.d.ts +1 -1
- package/lib/components/_v2/input-table/types.d.ts +4 -2
- package/lib/components/_v2/toggle/index.d.ts +2 -1
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/multi-source-control/index.d.ts +1 -1
- package/lib/containers/source-drawer/describe/index.d.ts +1 -1
- package/lib/containers/v2.js +1 -1
- package/lib/containers.js +112 -112
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/index.d.ts +1 -0
- package/lib/snippets/_v2/signals-checkbox-list/index.d.ts +11 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +6 -6
- package/lib/chunks/index-Aa36Kwto.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FC, type CSSProperties } from 'react';
|
|
1
|
+
import { type FC, type CSSProperties, type ReactNode, type MouseEvent } from 'react';
|
|
2
2
|
import type { SVG } from '@/types';
|
|
3
3
|
import { type ButtonProps } from '../button';
|
|
4
4
|
import { type IconButtonProps } from '../icon-button';
|
|
@@ -29,5 +29,9 @@ export interface DropDataProps {
|
|
|
29
29
|
maxHeight?: CSSProperties['maxHeight'];
|
|
30
30
|
buttonProps?: Omit<ButtonProps, 'fullWidth'>;
|
|
31
31
|
iconButtonProps?: IconButtonProps;
|
|
32
|
+
children?: ReactNode | ((props: {
|
|
33
|
+
ChevronIcon: SVG;
|
|
34
|
+
handleClick: (e: MouseEvent<HTMLElement>) => void;
|
|
35
|
+
}) => ReactNode);
|
|
32
36
|
}
|
|
33
37
|
export declare const DropData: FC<DropDataProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type InputProps } from '../input';
|
|
3
|
+
import { type DropDataProps, type DropDataOption } from '../drop-data';
|
|
4
|
+
export interface DropDownProps extends Omit<InputProps, 'rightIcon' | 'value' | 'onChange' | 'onClick'>, Pick<DropDataProps, 'withMultiSelect' | 'withSearch'> {
|
|
5
|
+
options: Pick<DropDataOption, 'id' | 'label'>[];
|
|
6
|
+
values: string[];
|
|
7
|
+
setValues: (values: string[]) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const DropDown: FC<DropDownProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InputHTMLAttributes, type FC, type CSSProperties } from 'react';
|
|
2
2
|
import { type SVG } from '@/types';
|
|
3
|
-
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'title'> {
|
|
4
4
|
label?: string;
|
|
5
5
|
required?: boolean;
|
|
6
6
|
tooltip?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
2
|
import type { Column, Row } from './types';
|
|
3
|
+
export type { Column, Row } from './types';
|
|
3
4
|
export interface InputTableProps {
|
|
4
5
|
columns: Column[];
|
|
5
6
|
values: Row[];
|
|
@@ -13,4 +14,3 @@ export interface InputTableProps {
|
|
|
13
14
|
limitFieldsPerRow?: number;
|
|
14
15
|
}
|
|
15
16
|
export declare const InputTable: FC<InputTableProps>;
|
|
16
|
-
export type { Column, Row } from './types';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { InputTypes } from '@/types';
|
|
2
|
+
import type { DropDataOption } from '../drop-data';
|
|
2
3
|
export interface Row {
|
|
3
4
|
[key: string]: any;
|
|
4
5
|
}
|
|
@@ -7,7 +8,8 @@ export interface Column {
|
|
|
7
8
|
label: string;
|
|
8
9
|
tooltip?: string;
|
|
9
10
|
placeholder?: string;
|
|
11
|
+
inputType?: InputTypes;
|
|
10
12
|
componentType?: 'input' | 'dropdown' | 'multi-dropdown';
|
|
11
|
-
options?:
|
|
13
|
+
options?: DropDataOption[];
|
|
12
14
|
renderCondition?: (row: Row) => boolean;
|
|
13
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SetStateAction, type FC, Dispatch } from 'react';
|
|
1
|
+
import { type CSSProperties, type SetStateAction, type FC, type Dispatch } from 'react';
|
|
2
2
|
import { ListDirection, type SVG } from '@/types';
|
|
3
3
|
export declare enum ToggleVariant {
|
|
4
4
|
Default = "default",
|
|
@@ -17,6 +17,7 @@ export interface ToggleProps {
|
|
|
17
17
|
size?: ToggleSize;
|
|
18
18
|
label?: string;
|
|
19
19
|
labelAlign?: ToggleLabelAlign;
|
|
20
|
+
labelColor?: CSSProperties['color'];
|
|
20
21
|
tooltip?: string;
|
|
21
22
|
value: boolean;
|
|
22
23
|
onChange: (value: boolean) => void;
|
package/lib/components/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{l as Badge,B as Button,j as ButtonSize,dK as ButtonTab,dL as ButtonTabList,k as ButtonVariants,c as Checkbox,dM as CheckboxList,dN as CheckboxSize,ai as CliCommand,a7 as DataCard,r as Drawer,a3 as DropData,a5 as DropDataAlignX,a4 as DropDataAlignY,d as FieldMessage,g as FieldTitle,
|
|
1
|
+
export{l as Badge,B as Button,j as ButtonSize,dK as ButtonTab,dL as ButtonTabList,k as ButtonVariants,c as Checkbox,dM as CheckboxList,dN as CheckboxSize,ai as CliCommand,a7 as DataCard,r as Drawer,a3 as DropData,a5 as DropDataAlignX,a4 as DropDataAlignY,dO as DropDown,d as FieldMessage,g as FieldTitle,dP as Header,cm as HoverActions,_ as IconButton,cw as IconButtonSize,p as Input,I as InputList,h as InputTable,af as Island,L as Loader,dQ as Modal,dR as Navbar,u as Note,dS as Radio,dT as RadioGroup,dU as RadioSize,t as Search,a1 as SectionCard,dV as SectionCardSize,o as Segment,dW as SegmentSize,al as StatusCard,ad as Table,ae as TableVariant,dX as Tag,q as TextArea,am as TextCard,z as Toggle,dY as ToggleLabelAlign,dZ as ToggleList,A as ToggleSize,d_ as ToggleVariant,T as Typography,a as TypographySize,E as TypographyVariants,W as WarningModal}from"../chunks/ui-components-CCA7B7ry.js";import"../icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-C-kwkNJP.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a$ as AutocompleteInput,bj as Badge,bl as Button,aO as CancelWarning,s as CenterThis,au as Checkbox,
|
|
1
|
+
export{a$ as AutocompleteInput,bj as Badge,bl as Button,aO as CancelWarning,s as CenterThis,au as Checkbox,cD as Code,aS as ConditionDetails,aT as DataCard,ap as DataCardFieldTypes,c2 as DataCardFields,dv as DataFinger,bn as DataTab,aN as DeleteWarning,ck as DescribeRow,b0 as Divider,aH as DocsButton,aM as Drawer,dw as DrawerFooter,dx as DrawerHeader,bI as Dropdown,dy as ErrorBoundary,bP as ExtendArrow,ah as FadeLoader,av as FieldError,at as FieldLabel,F as FlexColumn,f as FlexRow,dz as Header,bO as IconButton,cu as IconGroup,be as IconTitleBadge,b9 as IconWrapped,cg as IconsNav,dA as ImageControlled,aw as Input,aC as InputList,az as InputTable,bh as InteractiveTable,aB as KeyValueInputsList,ce as LoadingText,aX as Modal,aY as ModalBody,aI as MonitorsCheckboxes,bb as MonitorsIcons,b1 as NavigationButtons,N as NoDataFound,aZ as NotificationNote,dB as Overlay,ac as PageContent,bD as Popup,cx as PopupForm,cC as ScrollX,bq as ScrollY,aG as SectionTitle,aE as Segment,bF as SelectionButton,bv as SkeletonLoader,b3 as Status,c1 as Stepper,dC as TabList,bc as TableContainer,bd as TableTitleWrap,bg as TableWrap,c4 as Tag,aK as Text,aJ as TextArea,aA as Toggle,cA as ToggleCodeComponent,b as Tooltip,bi as TraceLoader,ao as UpgradeRequiredWrapper,bE as VerticalScroll,c8 as WarningModal,dD as WhiteSpace,dE as getLinksFromText,dF as getStrongsFromText,dG as renderText}from"./chunks/ui-components-CCA7B7ry.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C-kwkNJP.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{aR as ACTION_OPTIONS,aa as BUTTON_TEXTS,Q as DEFAULT_DATA_STREAM_NAME,b$ as DESTINATION_CATEGORIES,m as DISPLAY_LANGUAGES,y as DISPLAY_TITLES,D as DOCS_BASE_URL,a_ as FORM_ALERTS,w as INSTRUMENTATION_RULE_OPTIONS,
|
|
1
|
+
export{aR as ACTION_OPTIONS,aa as BUTTON_TEXTS,Q as DEFAULT_DATA_STREAM_NAME,b$ as DESTINATION_CATEGORIES,m as DISPLAY_LANGUAGES,y as DISPLAY_TITLES,D as DOCS_BASE_URL,a_ as FORM_ALERTS,w as INSTRUMENTATION_RULE_OPTIONS,df as LANGUAGE_OPTIONS,bJ as MONITORS_OPTIONS,dg as OTEL_DISTRO_NAME_OPTIONS,bK as STORAGE_KEYS,dh as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-CCA7B7ry.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C-kwkNJP.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WorkloadId } from '@/types';
|
|
3
2
|
import { type SelectedState } from '@/store';
|
|
3
|
+
import { type WorkloadId } from '@/types';
|
|
4
4
|
interface MultiSourceControlProps {
|
|
5
5
|
totalSourceCount: number;
|
|
6
6
|
uninstrumentSources: (payload: SelectedState['selectedSources']) => void;
|
|
@@ -7,7 +7,7 @@ interface DescribeProps {
|
|
|
7
7
|
describeSource: DescribeSource;
|
|
8
8
|
};
|
|
9
9
|
}>;
|
|
10
|
-
|
|
10
|
+
onClickRestartPod?: (namespace: string, name: string) => void;
|
|
11
11
|
}
|
|
12
12
|
declare const Describe: FC<DescribeProps>;
|
|
13
13
|
export { Describe, type DescribeProps };
|
package/lib/containers/v2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as n}from"react/jsx-runtime";import{useMemo as l,useEffect as a,Children as o,forwardRef as i,useState as r,useImperativeHandle as s,useRef as c,useCallback as d}from"react";import u,{useTheme as h,css as p}from"styled-components";import{F as g,T as m,a as b,C as f,b as C,c as w,d as v,H as y,I as k,P as $,G as x,J as S,e as I,f as D,g as T,h as A,i as L,B as P,j as M,k as R,D as O,l as V,S as N,m as z,n as E,o as F,p as j,q as H,W,V as G,N as q,r as U,s as Y,L as B,R as K,t as X,u as Z,v as J,w as Q,x as _,y as ee,O as te,z as ne,A as le,E as ae,K as oe,M as ie,Q as re,U as se,X as ce,Y as de,Z as ue,_ as he,$ as pe,a0 as ge,a1 as me,a2 as be,a3 as fe,a4 as Ce,a5 as we,a6 as ve,a7 as ye,a8 as ke,a9 as $e,aa as xe,ab as Se,ac as Ie,ad as De,ae as Te,af as Ae,ag as Le,ah as Pe,ai as Me,aj as Re,ak as Oe,al as Ve,am as Ne,an as ze,ao as Ee}from"../chunks/ui-components-C1WJWY4E.js";import{GoLogo as Fe,JavaLogo as je,BookIcon as He,VSquareIcon as We,XSquareIcon as Ge,OdigosLogo as qe,ChevronRightIcon as Ue,InstrumentationRuleIcon as Ye,SourceIcon as Be,SettingsIcon as Ke,XIcon as Xe,VIcon as Ze,EditIcon as Je,ExclamationTriangleIcon as Qe,ExclamationCircleIcon as _e,KeyIcon as et,DiagnoseIcon as tt,DownloadIcon as nt,TerminalIcon as lt,DeleteIcon as at,DestinationIcon as ot,ActionIcon as it,RefreshIcon as rt,ConnectionsIcon as st,PodIcon as ct,ChevronUpIcon as dt,ChevronDownIcon as ut,ArrowDownSquareIcon as ht,ArrowUpSquareIcon as pt,PipelineCollectorIcon as gt,GatewayIcon as mt,YamlIcon as bt}from"../icons.js";import{Y as ft}from"../chunks/index-Aa36Kwto.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-C-kwkNJP.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Ct=[{id:f.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:f.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:f.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],wt=[{id:f.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:f.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:f.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],vt=["*"],yt=[{id:$.HttpRequest,label:"Collect HTTP Request",tooltip:""},{id:$.HttpResponse,label:"Collect HTTP Response",tooltip:""},{id:$.DbQuery,label:"Collect DB Query",tooltip:""},{id:$.Messaging,label:"Collect Messaging",tooltip:""}],kt={[I.Java]:[new S("","")],[I.Golang]:[new x("")]},$t={[L.CodeAttributes]:({value:o,setValue:i,formErrors:r})=>{const s=h(),c=r.codeAttributes,d=l(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);a(()=>{if(!d.length&&!c){const e={[f.FilePath]:!0,[f.Function]:!0,[f.LineNumber]:!0,[f.Column]:null,[f.Namespace]:null,[f.StackTrace]:null};i("codeAttributes",e)}},[]);const u=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),l=Object.values(f).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});i("codeAttributes",l)};return e(t,{children:[e(g,{$gap:12,children:[n(m,{size:b.XS,color:s.v2.colors.silver[200],nowrap:!0,children:"Recommended data to collect"}),n(g,{$gap:6,children:Ct.map(({id:e,label:t,tooltip:l})=>n(C,{text:l,withIcon:!0,children:n(w,{label:t,value:d.includes(e),onChange:t=>u(e,t)})},e))}),n(v,{errorMessage:c})]}),e(g,{$gap:12,children:[n(m,{size:b.XS,color:s.v2.colors.silver[200],nowrap:!0,children:"Verbose data to collect"}),n(g,{$gap:6,children:wt.map(({id:e,label:t,tooltip:l})=>n(C,{text:l,withIcon:!0,children:n(w,{label:t,value:d.includes(e),onChange:t=>u(e,t)})},e))}),n(v,{errorMessage:c})]})]})},[L.CustomInstrumentation]:({value:o,setValue:i,formErrors:r})=>{const s=r.customInstrumentations,c=l(()=>(o?.customInstrumentations?.[I.Golang]||[]).map(e=>new x(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),d=l(()=>(o?.customInstrumentations?.[I.Java]||[]).map(e=>new S(e.className,e.methodName)),[o]);return a(()=>{o?.customInstrumentations||s||i("customInstrumentations",{[I.Golang]:kt[I.Golang],[I.Java]:kt[I.Java]})},[]),e(t,{children:[e(g,{children:[e(D,{$gap:8,children:[n(Fe,{}),n(T,{label:"Golang Custom Probes"})]}),n(A,{columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[I.Golang]=e.map(e=>new x(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[I.Java]=d,i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(g,{children:[e(D,{$gap:8,children:[n(je,{}),n(T,{label:"Java Custom Probes"})]}),n(A,{columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[I.Golang]=c,t[I.Java]=e.map(e=>new S(e.className,e.methodName)),i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[L.HeadersCollection]:({value:e,setValue:t,formErrors:o})=>{const i=o.headersCollection,r=l(()=>e?.headersCollection?.[y.HeaderKeys]||[],[e]),s=e=>{const n={[y.HeaderKeys]:e};t("headersCollection",n)};return a(()=>{r.length||i||s(vt)},[]),n(k,{label:"Header Keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:i})},[L.PayloadCollection]:({value:t,setValue:o,formErrors:i})=>{const r=h(),s=i.payloadCollection,c=l(()=>Object.entries(t.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[t]);return a(()=>{if(!c.length&&!s){const e={[$.HttpRequest]:{},[$.HttpResponse]:{},[$.DbQuery]:{},[$.Messaging]:{}};o("payloadCollection",e)}},[]),e(g,{$gap:12,children:[n(m,{size:b.XS,color:r.v2.colors.silver[200],nowrap:!0,children:"Type of data to collect"}),n(g,{$gap:6,children:yt.map(({id:e,label:t,tooltip:l})=>n(C,{text:l,withIcon:!0,children:n(w,{label:t,value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),l={[$.HttpRequest]:n.includes($.HttpRequest)?{}:null,[$.HttpResponse]:n.includes($.HttpResponse)?{}:null,[$.DbQuery]:n.includes($.DbQuery)?{}:null,[$.Messaging]:n.includes($.Messaging)?{}:null};o("payloadCollection",l)})(e,t)})},e))}),n(v,{errorMessage:s})]})},[L.UnknownType]:null},xt=({ruleType:e,value:t,setValue:l,formErrors:a})=>{if(!e)return null;const o=$t[e];return o?n(o,{value:t,setValue:l,formErrors:a}):null},St=({option:t,formData:l,handleFormChange:a,formErrors:o})=>{const i=h();return e(g,{$gap:24,children:[e(D,{$gap:12,$alignItems:"flex-start",children:[n(m,{size:b.XXS,children:t.docsDescription}),n(P,{label:"Docs",leftIcon:He,variant:R.Secondary,size:M.S,onClick:()=>window.open(`${O}${t.docsEndpoint}`,"_blank","noopener noreferrer")})]}),e(D,{$gap:12,children:[n(m,{size:b.XS,color:i.v2.colors.silver[200],nowrap:!0,children:"Supported Languages:"}),t.supportedLanguages.map(e=>n(V,{label:z[e],leftIcon:E(e),status:N.Default,useSecondaryTone:!0},e))]}),n(F,{options:[{icon:We,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Ge,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],selected:l.disabled,setSelected:e=>a("disabled",e)}),n(j,{label:"Rule name",placeholder:"Use a name that describes the rule...",value:l.ruleName,onChange:({target:{value:e}})=>a("ruleName",e),errorMessage:o.ruleName}),n(xt,{ruleType:t.type,value:l,setValue:(e,t)=>a(e,t),formErrors:o}),n(H,{label:"Notes",placeholder:"Your personal notes...",value:l.notes,onChange:({target:{value:e}})=>a("notes",e),errorMessage:o.notes})]})},It=({isOpen:e,onClose:t,onDeny:l,onApprove:a})=>n(W,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:e,onClose:t,onDeny:l,denyLabel:"Keep editing",onApprove:a,approveLabel:"Discard changes"}),Dt=({isOpen:e,onClose:t,onDeny:l,onApprove:a,action:o="delete",target:i})=>{const r=o.charAt(0).toUpperCase()+o.substring(1),s=i?.endsWith("s")?"these":"this";return n(W,{title:`${r}${i?` ${i}`:""}?`,description:`Are you sure you want to ${o}${i?` ${s} ${i}`:""}?`,isOpen:e,onClose:t,onDeny:l,denyLabel:"Go back",onApprove:a,approveLabel:r})},Tt=({minSupportedVersion:e,currentVersion:t})=>n(W,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>n(G,{scale:2.4,icon:()=>n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:n("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: ${t}.`}),At=u.div`
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as n}from"react/jsx-runtime";import{useMemo as l,useEffect as a,Children as o,forwardRef as i,useState as r,useImperativeHandle as s,useRef as c,useCallback as d}from"react";import u,{useTheme as h,css as p}from"styled-components";import{F as g,T as m,a as b,C as f,b as C,c as w,d as v,H as y,I as k,P as $,G as x,J as S,e as I,f as D,g as T,h as A,i as L,B as P,j as M,k as R,D as O,l as V,S as N,m as z,n as E,o as F,p as j,q as H,W,V as G,N as q,r as U,s as Y,L as B,R as K,t as X,u as Z,v as J,w as Q,x as _,y as ee,O as te,z as ne,A as le,E as ae,K as oe,M as ie,Q as re,U as se,X as ce,Y as de,Z as ue,_ as he,$ as pe,a0 as ge,a1 as me,a2 as be,a3 as fe,a4 as Ce,a5 as we,a6 as ve,a7 as ye,a8 as ke,a9 as $e,aa as xe,ab as Se,ac as Ie,ad as De,ae as Te,af as Ae,ag as Le,ah as Pe,ai as Me,aj as Re,ak as Oe,al as Ve,am as Ne,an as ze,ao as Ee}from"../chunks/ui-components-CCA7B7ry.js";import{GoLogo as Fe,JavaLogo as je,BookIcon as He,VSquareIcon as We,XSquareIcon as Ge,OdigosLogo as qe,ChevronRightIcon as Ue,InstrumentationRuleIcon as Ye,SourceIcon as Be,SettingsIcon as Ke,XIcon as Xe,VIcon as Ze,EditIcon as Je,ExclamationTriangleIcon as Qe,ExclamationCircleIcon as _e,KeyIcon as et,DiagnoseIcon as tt,DownloadIcon as nt,TerminalIcon as lt,DeleteIcon as at,DestinationIcon as ot,ActionIcon as it,RefreshIcon as rt,ConnectionsIcon as st,PodIcon as ct,ChevronUpIcon as dt,ChevronDownIcon as ut,ArrowDownSquareIcon as ht,ArrowUpSquareIcon as pt,PipelineCollectorIcon as gt,GatewayIcon as mt,YamlIcon as bt}from"../icons.js";import{Y as ft}from"../chunks/index-BgT3kLZa.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-C-kwkNJP.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const Ct=[{id:f.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:f.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:f.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],wt=[{id:f.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:f.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:f.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],vt=["*"],yt=[{id:$.HttpRequest,label:"Collect HTTP Request",tooltip:""},{id:$.HttpResponse,label:"Collect HTTP Response",tooltip:""},{id:$.DbQuery,label:"Collect DB Query",tooltip:""},{id:$.Messaging,label:"Collect Messaging",tooltip:""}],kt={[I.Java]:[new S("","")],[I.Golang]:[new x("")]},$t={[L.CodeAttributes]:({value:o,setValue:i,formErrors:r})=>{const s=h(),c=r.codeAttributes,d=l(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);a(()=>{if(!d.length&&!c){const e={[f.FilePath]:!0,[f.Function]:!0,[f.LineNumber]:!0,[f.Column]:null,[f.Namespace]:null,[f.StackTrace]:null};i("codeAttributes",e)}},[]);const u=(e,t)=>{const n=t?[...d,e]:d.filter(t=>t!==e),l=Object.values(f).reduce((e,t)=>(e[t]=!!n.includes(t)||null,e),{});i("codeAttributes",l)};return e(t,{children:[e(g,{$gap:12,children:[n(m,{size:b.XS,color:s.v2.colors.silver[200],nowrap:!0,children:"Recommended data to collect"}),n(g,{$gap:6,children:Ct.map(({id:e,label:t,tooltip:l})=>n(C,{text:l,withIcon:!0,children:n(w,{label:t,value:d.includes(e),onChange:t=>u(e,t)})},e))}),n(v,{errorMessage:c})]}),e(g,{$gap:12,children:[n(m,{size:b.XS,color:s.v2.colors.silver[200],nowrap:!0,children:"Verbose data to collect"}),n(g,{$gap:6,children:wt.map(({id:e,label:t,tooltip:l})=>n(C,{text:l,withIcon:!0,children:n(w,{label:t,value:d.includes(e),onChange:t=>u(e,t)})},e))}),n(v,{errorMessage:c})]})]})},[L.CustomInstrumentation]:({value:o,setValue:i,formErrors:r})=>{const s=r.customInstrumentations,c=l(()=>(o?.customInstrumentations?.[I.Golang]||[]).map(e=>new x(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[o]),d=l(()=>(o?.customInstrumentations?.[I.Java]||[]).map(e=>new S(e.className,e.methodName)),[o]);return a(()=>{o?.customInstrumentations||s||i("customInstrumentations",{[I.Golang]:kt[I.Golang],[I.Java]:kt[I.Java]})},[]),e(t,{children:[e(g,{children:[e(D,{$gap:8,children:[n(Fe,{}),n(T,{label:"Golang Custom Probes"})]}),n(A,{columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[I.Golang]=e.map(e=>new x(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[I.Java]=d,i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(g,{children:[e(D,{$gap:8,children:[n(je,{}),n(T,{label:"Java Custom Probes"})]}),n(A,{columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[I.Golang]=c,t[I.Java]=e.map(e=>new S(e.className,e.methodName)),i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[L.HeadersCollection]:({value:e,setValue:t,formErrors:o})=>{const i=o.headersCollection,r=l(()=>e?.headersCollection?.[y.HeaderKeys]||[],[e]),s=e=>{const n={[y.HeaderKeys]:e};t("headersCollection",n)};return a(()=>{r.length||i||s(vt)},[]),n(k,{label:"Header Keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:i})},[L.PayloadCollection]:({value:t,setValue:o,formErrors:i})=>{const r=h(),s=i.payloadCollection,c=l(()=>Object.entries(t.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[t]);return a(()=>{if(!c.length&&!s){const e={[$.HttpRequest]:{},[$.HttpResponse]:{},[$.DbQuery]:{},[$.Messaging]:{}};o("payloadCollection",e)}},[]),e(g,{$gap:12,children:[n(m,{size:b.XS,color:r.v2.colors.silver[200],nowrap:!0,children:"Type of data to collect"}),n(g,{$gap:6,children:yt.map(({id:e,label:t,tooltip:l})=>n(C,{text:l,withIcon:!0,children:n(w,{label:t,value:c.includes(e),onChange:t=>((e,t)=>{const n=t?[...c,e]:c.filter(t=>t!==e),l={[$.HttpRequest]:n.includes($.HttpRequest)?{}:null,[$.HttpResponse]:n.includes($.HttpResponse)?{}:null,[$.DbQuery]:n.includes($.DbQuery)?{}:null,[$.Messaging]:n.includes($.Messaging)?{}:null};o("payloadCollection",l)})(e,t)})},e))}),n(v,{errorMessage:s})]})},[L.UnknownType]:null},xt=({ruleType:e,value:t,setValue:l,formErrors:a})=>{if(!e)return null;const o=$t[e];return o?n(o,{value:t,setValue:l,formErrors:a}):null},St=({option:t,formData:l,handleFormChange:a,formErrors:o})=>{const i=h();return e(g,{$gap:24,children:[e(D,{$gap:12,$alignItems:"flex-start",children:[n(m,{size:b.XXS,children:t.docsDescription}),n(P,{label:"Docs",leftIcon:He,variant:R.Secondary,size:M.S,onClick:()=>window.open(`${O}${t.docsEndpoint}`,"_blank","noopener noreferrer")})]}),e(D,{$gap:12,children:[n(m,{size:b.XS,color:i.v2.colors.silver[200],nowrap:!0,children:"Supported Languages:"}),t.supportedLanguages.map(e=>n(V,{label:z[e],leftIcon:E(e),status:N.Default,useSecondaryTone:!0},e))]}),n(F,{options:[{icon:We,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:Ge,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],selected:l.disabled,setSelected:e=>a("disabled",e)}),n(j,{label:"Rule name",placeholder:"Use a name that describes the rule...",value:l.ruleName,onChange:({target:{value:e}})=>a("ruleName",e),errorMessage:o.ruleName}),n(xt,{ruleType:t.type,value:l,setValue:(e,t)=>a(e,t),formErrors:o}),n(H,{label:"Notes",placeholder:"Your personal notes...",value:l.notes,onChange:({target:{value:e}})=>a("notes",e),errorMessage:o.notes})]})},It=({isOpen:e,onClose:t,onDeny:l,onApprove:a})=>n(W,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:e,onClose:t,onDeny:l,denyLabel:"Keep editing",onApprove:a,approveLabel:"Discard changes"}),Dt=({isOpen:e,onClose:t,onDeny:l,onApprove:a,action:o="delete",target:i})=>{const r=o.charAt(0).toUpperCase()+o.substring(1),s=i?.endsWith("s")?"these":"this";return n(W,{title:`${r}${i?` ${i}`:""}?`,description:`Are you sure you want to ${o}${i?` ${s} ${i}`:""}?`,isOpen:e,onClose:t,onDeny:l,denyLabel:"Go back",onApprove:a,approveLabel:r})},Tt=({minSupportedVersion:e,currentVersion:t})=>n(W,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>n(G,{scale:2.4,icon:()=>n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:n("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: ${t}.`}),At=u.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
justify-content: flex-end;
|