@odigos/ui-kit 0.0.268 → 0.0.269
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 +8 -0
- package/lib/chunks/helpers-w7krM8zT.js +9 -0
- package/lib/chunks/index-C8U7vd0v.js +257 -0
- package/lib/chunks/source-instrument-form-context-DS-dr35D.js +5 -0
- package/lib/chunks/{ui-components--pbkVlso.js → ui-components-dsTdscIC.js} +4 -4
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/edit-action-drawer/helpers.d.ts +3 -3
- package/lib/containers/_forms/add-action-form/custom-fields/index.d.ts +3 -0
- package/lib/containers.js +221 -323
- package/lib/contexts/action-form-context.d.ts +8 -2
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/useActionFormData.d.ts +1 -1
- package/lib/hooks/useInstrumentationRuleFormData.d.ts +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/dynamic-field/fields.d.ts +65 -0
- package/lib/snippets/dynamic-field/index.d.ts +2 -27
- package/lib/snippets/dynamic-field/leaf.d.ts +35 -0
- package/lib/snippets.js +1 -1
- package/lib/store/useFilterStore.d.ts +4 -0
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +6 -7
- package/lib/types/common/index.d.ts +25 -1
- package/lib/types/destinations/index.d.ts +2 -6
- package/lib/types/instrumentation-rules/index.d.ts +2 -6
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-C4ggK_Tz.js +0 -155
- package/lib/chunks/odigos-context-pyaT77YA.js +0 -9
- package/lib/chunks/source-instrument-form-context-Bryjhxz4.js +0 -5
- package/lib/containers/_forms/add-action-form/dynamic-fields/index.d.ts +0 -21
- package/lib/containers/_forms/add-destination-form/dynamic-fields/index.d.ts +0 -9
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type FC, type ReactNode } from 'react';
|
|
2
|
+
import type { AutocompleteOption } from '../components';
|
|
2
3
|
import { type GenericFormResult } from '../hooks/useGenericForm';
|
|
3
4
|
import { type Action, type ActionFormData, type ActionOption } from '../types';
|
|
4
5
|
interface ActionFormContextValue {
|
|
@@ -10,9 +11,14 @@ interface ActionFormContextValue {
|
|
|
10
11
|
errorMessage?: string;
|
|
11
12
|
preparedFormData: ActionFormData;
|
|
12
13
|
};
|
|
14
|
+
sourceOptions: AutocompleteOption[];
|
|
15
|
+
namespaceOptions: AutocompleteOption[];
|
|
13
16
|
}
|
|
14
|
-
export
|
|
17
|
+
export interface ActionFormContextProviderProps {
|
|
15
18
|
children: ReactNode;
|
|
16
|
-
|
|
19
|
+
sourceOptions?: AutocompleteOption[];
|
|
20
|
+
namespaceOptions?: AutocompleteOption[];
|
|
21
|
+
}
|
|
22
|
+
export declare const ActionFormContextProvider: FC<ActionFormContextProviderProps>;
|
|
17
23
|
export declare const useActionFormContext: () => ActionFormContextValue;
|
|
18
24
|
export {};
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a,r as x,a as y}from"./chunks/source-instrument-form-context-
|
|
1
|
+
import{u as a,r as x,a as y}from"./chunks/source-instrument-form-context-DS-dr35D.js";export{A as ActionFormContextProvider,C as CloudConnectorFormContextProvider,D as DataStreamFormContextProvider,b as DestinationFormContextProvider,O as OdigosApiConnectionsScope,c as OdigosApiProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,d as SamplingRulesFormProvider,e as SourceEditFormContextProvider,f as SourceInstrumentFormContextProvider,p as prepareNamespacePayloads,g as prepareSourcePayloads,h as useActionFormContext,i as useApiLazyQuery,j as useApiMutation,k as useApiQuery,l as useCloudConnectorFormContext,m as useDataStreamFormContext,n as useDestinationFormContext,o as useOdigosApi,q as useRuleFormContext,s as useSamplingRulesFormContext,t as useSourceEditFormContext,v as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-DS-dr35D.js";export{O as OdigosProvider,c as checkVersionSupport,r as resolveMinSupportedVersion,u as useOdigos}from"./chunks/helpers-w7krM8zT.js";import{jsx as F}from"react/jsx-runtime";import{useMemo as P,useContext as T,createContext as E}from"react";import{P as I,t as _}from"./chunks/ui-components-dsTdscIC.js";import{useApolloClient as M}from"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";const V=()=>{const o=M(),{operations:r,context:e}=a();return{multiFetch:async(t,s,n)=>{const i=r[t];return i?y(o,i,s,n,e):{results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:s.length,error:`Operation ${String(t)} not configured`}},bulkPersistSources:async(t,s)=>{const n=[];for(const i of t){const t={...e,proxyID:i},{error:a}=await x(o,r.PERSIST_SOURCES,s,t);a&&n.push(`${i}: ${a}`)}return n.length?{error:n.join(", ")}:void 0},applyConfigurations:async(t,s)=>{if(!r.UPDATE_REMOTE_CONFIG)return{error:"UPDATE_REMOTE_CONFIG not configured"};const{error:n}=await x(o,r.UPDATE_REMOTE_CONFIG,{formData:s,connectionIds:t},e);return n?{error:n}:void 0}}},N=(o,r)=>o.platformType===I.K8s?r.K8s:o.platformType===I.Vm?r.Vm:void 0,U=o=>r=>{const e=o[r.platformType];if(!e)return;const t=Object.keys(e);if(0===t.length)return;const s=_(r.schemaVersion??r.version),n=[...t].sort((o,r)=>_(r)-_(o)).find(o=>s>=_(o));return n?e[n]:void 0},w=(o,r)=>{const e={};for(const t of Object.keys(o))e[t]=r(o[t]);return e},z=E({formType:void 0}),G=({children:o,formType:r})=>{const e=P(()=>({formType:r}),[r]);return F(z.Provider,{value:e,children:o})},$=()=>T(z);export{G as StorybookProvider,N as pickByPlatform,V as useApiForConnections,$ as useStorybook,U as versionedDocument,w as vmDialectMap};
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{bj as adaptInstrumentationRuleFromWire,bh as adaptInstrumentationRuleInputForWire,cc as buildBadgeForDesiredStatus,fl as capitalizeFirstLetter,fm as cleanObjectEmptyStringsValues,a3 as compareCondition,fn as decimalsOnly,aX as deepClone,et as entityIdKey,ey as filterActions,ex as filterDestinations,c7 as filterDestinationsByStream,ew as filterSources,ek as filterSourcesByStream,fo as flattenObjectKeys,cr as formatBytes,fp as formatDuration,b3 as generateId,c5 as getActionIcon,er as getConditionsBooleans,cG as getContainersIcons,fq as getContainersInstrumentedCount,fr as getDeepValue,b_ as getDestinationIcon,fs as getDetectedLanguageIcons,ch as getEffectiveLanguage,cz as getEffectiveRuntimeVersion,eu as getEntityIcon,bg as getEntityId,eq as getEntityIdKey,es as getEntityLabel,ft as getHealthBadgeLabel,be as getIdFromSseTarget,c9 as getInstrumentationRuleIcon,fu as getMainContainerLanguage,fv as getMetricForEntity,fw as getMonitorIcon,fx as getNearestTypographySize,fy as getPlatformIcon,eg as getPlatformLabel,O as getProgrammingLanguageIcon,fz as getRecursiveValues,cq as getSourceKindLabel,cn as getSourceLanguageIcons,b7 as getSseTargetFromId,ct as getStatusColor,eA as getStatusFromPodStatus,cu as getStatusIcon,cs as getStatusTypeFromOdigosHealth,fA as getValueForRange,cm as getVirtualServiceIcon,cl as getWorkloadId,c8 as getYamlFieldsForDestination,fB as hasUnhealthyInstances,fC as instrumentationRuleSourceScopesFromWire,fD as instrumentationRuleSourceScopesToWire,bo as isEmpty,bp as isLegalK8sLabel,c$ as isOverTime,fE as isStringABoolean,fF as isTimeElapsed,cy as isValidVersion,fG as mapConditions,cf as mapDesiredStatusToConditionStatus,c6 as mapDestinationFieldsForDisplay,bt as mapExportedSignals,br as mapSupportedSignals,fH as numbersOnly,fI as parseBooleanFromString,fJ as parseJsonStringToPrettyString,bE as prepareDestinationFormData,fK as removeEmptyValuesFromObject,v as safeJsonParse,fL as safeJsonStringify,fM as setDeepValue,fN as sleep,af as splitCamelString,fO as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-dsTdscIC.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Action, type ActionFormData } from '../types';
|
|
2
2
|
export declare const useActionFormData: () => {
|
|
3
3
|
formData: ActionFormData;
|
|
4
|
-
formErrors: Partial<Record<"disabled" | "type" | "name" | "notes" | "
|
|
4
|
+
formErrors: Partial<Record<"disabled" | "type" | "name" | "notes" | "fields" | "signals", string>>;
|
|
5
5
|
handleFormChange: (key?: string | undefined, val?: any, obj?: ActionFormData | undefined) => void;
|
|
6
6
|
resetFormData: (overrideForm?: ActionFormData | undefined) => void;
|
|
7
7
|
validateForm: (params?: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type InstrumentationRule, type InstrumentationRuleFormData } from '../types';
|
|
2
2
|
export declare const useInstrumentationRuleFormData: () => {
|
|
3
3
|
formData: InstrumentationRuleFormData;
|
|
4
|
-
formErrors: Partial<Record<"disabled" | "conditions" | "
|
|
4
|
+
formErrors: Partial<Record<"disabled" | "conditions" | "sourceScopes" | "ruleName" | "notes" | "workloads" | "instrumentationLibraries" | "codeAttributes" | "headersCollection" | "payloadCollection" | "customInstrumentations", string>>;
|
|
5
5
|
handleFormChange: (key?: string | undefined, val?: any, obj?: InstrumentationRuleFormData | undefined) => void;
|
|
6
6
|
resetFormData: (overrideForm?: InstrumentationRuleFormData | undefined) => void;
|
|
7
7
|
validateForm: () => boolean;
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g2 as IGNORE_OUTSIDE_CLICK_ATTR,g3 as useActionFormData,g4 as useBodyScroll,ev as useContainerSize,
|
|
1
|
+
export{g2 as IGNORE_OUTSIDE_CLICK_ATTR,g3 as useActionFormData,g4 as useBodyScroll,ev as useContainerSize,b2 as useCopy,g5 as useDataStreamFormData,g6 as useDestinationFormData,bk as useGenericForm,g7 as useInstrumentationRuleFormData,c_ as useKeyDown,cv as useOnClickOutside,g8 as useOverflow,g9 as usePopup,cb as useScrollIntoViewWhen,eV as useScrollTo,en as useSessionStorage,ga as useSourceFormData,ca as useTimeAgo}from"./chunks/ui-components-dsTdscIC.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, { type FC } from 'react';
|
|
2
|
+
import { type SignalType, type YamlFieldProperties } from '../../types';
|
|
3
|
+
import { type AutocompleteOption } from '../../components';
|
|
4
|
+
/**
|
|
5
|
+
* How `keyValuePairs` fields persist their value.
|
|
6
|
+
*
|
|
7
|
+
* - `'array'` — `[{ key, value }]` rows. Used by destination catalogs (OTLP
|
|
8
|
+
* headers, CloudWatch tags, …) whose backends expect a JSON array.
|
|
9
|
+
* - `'map'` — `{ [key]: value }` object. Used by action catalogs
|
|
10
|
+
* (RenameAttribute `renames`) and any catalog that describes a true map.
|
|
11
|
+
*
|
|
12
|
+
* Defaults to `'map'` so action/rule catalogs keep their persisted shapes; the
|
|
13
|
+
* destination form passes `'array'` explicitly. Individual fields can still
|
|
14
|
+
* override via `componentProps.persistAs`.
|
|
15
|
+
*/
|
|
16
|
+
export type KeyValuePersistAs = 'array' | 'map';
|
|
17
|
+
export interface DynamicFieldsProps {
|
|
18
|
+
signals: SignalType[];
|
|
19
|
+
/**
|
|
20
|
+
* YAML-defined field catalog entries. Shared across destinations
|
|
21
|
+
* (`DestinationYamlProperties`), actions (`ActionYamlProperties`), and
|
|
22
|
+
* instrumentation rules (`InstrumentationRuleYamlProperties`) — and the
|
|
23
|
+
* alternative catalogs exposed by VM Agent / Agents API, which mirror the
|
|
24
|
+
* same shape.
|
|
25
|
+
*/
|
|
26
|
+
fields: YamlFieldProperties[];
|
|
27
|
+
/** Current field values keyed by field `name`. */
|
|
28
|
+
value: Record<string, unknown>;
|
|
29
|
+
setValue: (key: string, value: unknown) => void;
|
|
30
|
+
formErrors: Record<string, string>;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* When true, fields with an `initialValue` seed their default into the form on
|
|
34
|
+
* mount (object defaults from fields sharing a `name` are merged). Off by
|
|
35
|
+
* default; enabled for actions and instrumentation rules, which need sensible
|
|
36
|
+
* pre-filled defaults.
|
|
37
|
+
*/
|
|
38
|
+
seedInitialValues?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Default persistence shape for `keyValuePairs` fields. See `KeyValuePersistAs`.
|
|
41
|
+
* @default 'map'
|
|
42
|
+
*/
|
|
43
|
+
keyValuePersistAs?: KeyValuePersistAs;
|
|
44
|
+
/**
|
|
45
|
+
* Workload/namespace options for `componentType: sourceScopes` fields.
|
|
46
|
+
* Optional — omitted catalogs (or storybook) render an empty picker list.
|
|
47
|
+
*/
|
|
48
|
+
sourceOptions?: AutocompleteOption[];
|
|
49
|
+
namespaceOptions?: AutocompleteOption[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Renders form fields dynamically from a YAML-defined catalog. One shared
|
|
53
|
+
* renderer for destinations, actions, and instrumentation rules (OSS catalogs
|
|
54
|
+
* under `destinations/`, `actions/`, `instrumentationrules/`, plus the
|
|
55
|
+
* alternative catalogs served by VM Agent / Agents API).
|
|
56
|
+
*
|
|
57
|
+
* Supports flat fields (input, checkbox, multiInput, keyValuePairs, dropdown, …)
|
|
58
|
+
* as well as nested/tabular config via `multiTabledInput` (configurable columns)
|
|
59
|
+
* and `fieldGroup` (repeatable nested groups). Prefer this over bespoke
|
|
60
|
+
* `custom-fields/` forms whenever the backend catalog supplies fields.
|
|
61
|
+
*/
|
|
62
|
+
export declare const DynamicFields: FC<DynamicFieldsProps>;
|
|
63
|
+
/** @deprecated Use `DynamicFields` — kept as an alias for older call sites. */
|
|
64
|
+
export declare const DynamicActionFields: React.FC<DynamicFieldsProps>;
|
|
65
|
+
export type DynamicActionFieldsProps = DynamicFieldsProps;
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { BadgeProps } from '../../components/badge';
|
|
4
|
-
import type { DropDataOption } from '../../components/drop-data';
|
|
5
|
-
import { type TimeUnit } from '../../components/time-input';
|
|
6
|
-
import type { FieldMessageProps } from '../../components/field-message';
|
|
7
|
-
import { ToggleSize } from '../../components/toggle';
|
|
8
|
-
export interface DynamicFieldProps extends FieldMessageProps {
|
|
9
|
-
componentType: FieldTypes;
|
|
10
|
-
inputType?: InputTypes;
|
|
11
|
-
name: string;
|
|
12
|
-
label?: string;
|
|
13
|
-
tooltip?: string;
|
|
14
|
-
badge?: BadgeProps;
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
required?: boolean;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
value: any;
|
|
19
|
-
setValue: (value: any) => void;
|
|
20
|
-
dropdownOptions?: DropDataOption[];
|
|
21
|
-
dropdownNoSearch?: boolean;
|
|
22
|
-
dropdownNoCheckbox?: boolean;
|
|
23
|
-
timeUnits?: TimeUnit[];
|
|
24
|
-
timeDefaultUnit?: string;
|
|
25
|
-
toggleSize?: ToggleSize;
|
|
26
|
-
}
|
|
27
|
-
export declare const DynamicField: FC<DynamicFieldProps>;
|
|
1
|
+
export * from './leaf';
|
|
2
|
+
export * from './fields';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { FieldTypes, InputTypes } from '../../types';
|
|
3
|
+
import type { BadgeProps } from '../../components/badge';
|
|
4
|
+
import type { DropDataOption } from '../../components/drop-data';
|
|
5
|
+
import { type TimeUnit } from '../../components/time-input';
|
|
6
|
+
import type { FieldMessageProps } from '../../components/field-message';
|
|
7
|
+
import { ToggleSize } from '../../components/toggle';
|
|
8
|
+
export interface DynamicFieldProps extends FieldMessageProps {
|
|
9
|
+
componentType: FieldTypes;
|
|
10
|
+
inputType?: InputTypes;
|
|
11
|
+
name: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
tooltip?: string;
|
|
14
|
+
badge?: BadgeProps;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
value: any;
|
|
19
|
+
setValue: (value: any) => void;
|
|
20
|
+
dropdownOptions?: DropDataOption[];
|
|
21
|
+
dropdownNoSearch?: boolean;
|
|
22
|
+
dropdownNoCheckbox?: boolean;
|
|
23
|
+
timeUnits?: TimeUnit[];
|
|
24
|
+
timeDefaultUnit?: string;
|
|
25
|
+
toggleSize?: ToggleSize;
|
|
26
|
+
/** Override key/value column headers for `keyValuePairs` fields. */
|
|
27
|
+
keyLabel?: string;
|
|
28
|
+
valueLabel?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Renders a single leaf form control from a `componentType`. Used directly by
|
|
32
|
+
* settings and as the fallback renderer inside the catalog-driven `DynamicFields`
|
|
33
|
+
* for simple field kinds shared across destinations, actions, and rules.
|
|
34
|
+
*/
|
|
35
|
+
export declare const DynamicField: FC<DynamicFieldProps>;
|
package/lib/snippets.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components
|
|
1
|
+
export{A as ActionType,a as Actions,R as RichTitle}from"./chunks/ui-components-dsTdscIC.js";export{C as CancelModal,a as ConnectorCreatedModal,D as DURATION_OPTIONS,b as DeleteModal,c as DurationErrorsSection,d as DynamicActionFields,e as DynamicField,f as DynamicFields,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,O as OdigosLogoTextByTier,g as OperationSection,P as PERCENTAGE_OPTIONS,h as PercentageSection,i as PresetWithCustomInput,R as RuleInfoSection,j as RuleTypeSection,S as SamplingPreviewSection,k as SignalsCheckboxList,l as SourceScopeSection,U as UpgradeModal,W as WIDE_DRAWER_WIDTH,m as WideDrawer,Y as YamlSectionCard}from"./chunks/index-C8U7vd0v.js";export{C as ColoredSpan,a as ColoredSpanVariant}from"./chunks/helpers-w7krM8zT.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
|
@@ -4,6 +4,7 @@ export interface FiltersState {
|
|
|
4
4
|
statuses?: DropDataOption[];
|
|
5
5
|
platformTypes?: DropDataOption[];
|
|
6
6
|
namespaces?: DropDataOption[];
|
|
7
|
+
regions?: DropDataOption[];
|
|
7
8
|
kinds?: DropDataOption[];
|
|
8
9
|
monitors?: DropDataOption[];
|
|
9
10
|
languages?: DropDataOption[];
|
|
@@ -19,6 +20,8 @@ interface StoreState {
|
|
|
19
20
|
setPlatformTypes: (platformTypes: FiltersState['platformTypes']) => void;
|
|
20
21
|
namespaces: FiltersState['namespaces'];
|
|
21
22
|
setNamespaces: (namespaces: FiltersState['namespaces']) => void;
|
|
23
|
+
regions: FiltersState['regions'];
|
|
24
|
+
setRegions: (regions: FiltersState['regions']) => void;
|
|
22
25
|
kinds: FiltersState['kinds'];
|
|
23
26
|
setKinds: (kinds: FiltersState['kinds']) => void;
|
|
24
27
|
monitors: FiltersState['monitors'];
|
|
@@ -31,6 +34,7 @@ interface StoreState {
|
|
|
31
34
|
setOnlyErrors: (onlyErrors: FiltersState['onlyErrors']) => void;
|
|
32
35
|
setAll: (params: Partial<FiltersState>) => void;
|
|
33
36
|
clearAll: () => void;
|
|
37
|
+
clearFilters: () => void;
|
|
34
38
|
getEmptyState: () => FiltersState;
|
|
35
39
|
}
|
|
36
40
|
export declare const useFilterStore: import("zustand").UseBoundStore<import("zustand").StoreApi<StoreState>>;
|
package/lib/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{d3 as DrawerType,
|
|
1
|
+
export{d3 as DrawerType,bd as ProgressKeys,eo as getDrawerTypeForAdd,cp as getDrawerTypeForEdit,g1 as useDarkMode,ba as useDataStreamStore,ck as useDrawerStore,ej as useFilterStore,b5 as useNotificationStore,bb as useProgressStore,ep as useSelectedStore,bc as useSetupStore}from"./chunks/ui-components-dsTdscIC.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{gb as Provider,gc as animations,gd as opacity,ge as palettes}from"./chunks/ui-components
|
|
1
|
+
export{gb as Provider,gc as animations,gd as opacity,ge as palettes}from"./chunks/ui-components-dsTdscIC.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SignalType } from '../signals';
|
|
2
2
|
import { type DropDataOption } from '../../components';
|
|
3
|
-
import
|
|
3
|
+
import type { SourcesScopes } from '../sampling';
|
|
4
|
+
import { type Condition, FieldTypes, InputTypes, type PlatformType, type SVG, type YamlFieldProperties } from '../common';
|
|
4
5
|
export declare enum ActionType {
|
|
5
6
|
K8sAttributes = "K8sAttributesResolver",
|
|
6
7
|
AddClusterInfo = "AddClusterInfo",
|
|
@@ -23,14 +24,11 @@ export declare enum ActionKeyTypes {
|
|
|
23
24
|
Renames = "renames",
|
|
24
25
|
PiiCategories = "piiCategories",
|
|
25
26
|
UrlTemplatizationRulesGroups = "urlTemplatizationRulesGroups",
|
|
26
|
-
ExtractAttribute = "extractAttribute"
|
|
27
|
+
ExtractAttribute = "extractAttribute",
|
|
28
|
+
Scopes = "scopes"
|
|
27
29
|
}
|
|
28
|
-
export interface ActionYamlProperties {
|
|
30
|
+
export interface ActionYamlProperties extends YamlFieldProperties {
|
|
29
31
|
name: string;
|
|
30
|
-
componentType: FieldTypes;
|
|
31
|
-
componentProperties?: string;
|
|
32
|
-
displayName?: string;
|
|
33
|
-
initialValue?: string;
|
|
34
32
|
renderCondition?: string[];
|
|
35
33
|
}
|
|
36
34
|
export interface ActionDynamicField {
|
|
@@ -95,6 +93,7 @@ export interface ActionFields {
|
|
|
95
93
|
[ActionKeyTypes.PiiCategories]?: string[] | null;
|
|
96
94
|
[ActionKeyTypes.UrlTemplatizationRulesGroups]?: UrlTemplatizationRulesGroup[] | null;
|
|
97
95
|
[ActionKeyTypes.ExtractAttribute]?: ExtractAttribute | null;
|
|
96
|
+
[ActionKeyTypes.Scopes]?: SourcesScopes | null;
|
|
98
97
|
}
|
|
99
98
|
export declare enum K8sAttributesFrom {
|
|
100
99
|
Pod = "pod",
|
|
@@ -139,7 +139,31 @@ export declare enum FieldTypes {
|
|
|
139
139
|
CheckboxList = "checkboxList",
|
|
140
140
|
Toggle = "toggle",// not used by dests, but is in form components
|
|
141
141
|
Time = "time",
|
|
142
|
-
FieldGroup = "fieldGroup"
|
|
142
|
+
FieldGroup = "fieldGroup",
|
|
143
|
+
SourceScopes = "sourceScopes"
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Shared shape of a single YAML-catalog form field. Mirrors the Go `Field`
|
|
147
|
+
* structs in the OSS catalogs (`destinations/`, `actions/`,
|
|
148
|
+
* `instrumentationrules/`) and the equivalent catalogs served by VM Agent /
|
|
149
|
+
* Agents API. Entity-specific types (`DestinationYamlProperties`,
|
|
150
|
+
* `ActionYamlProperties`, `InstrumentationRuleYamlProperties`) extend this with
|
|
151
|
+
* any extra metadata their catalog needs; the shared `DynamicFields` snippet
|
|
152
|
+
* only depends on these common properties.
|
|
153
|
+
*/
|
|
154
|
+
export interface YamlFieldProperties {
|
|
155
|
+
name: string;
|
|
156
|
+
componentType: FieldTypes;
|
|
157
|
+
/** JSON string of componentProps, as serialized by the Go catalog service. */
|
|
158
|
+
componentProperties?: string;
|
|
159
|
+
displayName?: string;
|
|
160
|
+
initialValue?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Declarative show/hide condition. Destination catalogs use a typed
|
|
163
|
+
* `YamlCompareArr`; action/rule catalogs currently ship a plain `string[]`
|
|
164
|
+
* with the same shape — both are accepted by `compareCondition`.
|
|
165
|
+
*/
|
|
166
|
+
renderCondition?: any;
|
|
143
167
|
}
|
|
144
168
|
export declare enum InputTypes {
|
|
145
169
|
Text = "text",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DropDataOption } from '../../components';
|
|
2
|
-
import { type Condition,
|
|
2
|
+
import { type Condition, type SVG, InputTypes, type YamlFieldProperties } from '../common';
|
|
3
3
|
export declare enum DestinationTypes {
|
|
4
4
|
Alauda = "alauda",
|
|
5
5
|
AlibabaCloud = "alibabacloud",
|
|
@@ -106,13 +106,9 @@ export interface Destination {
|
|
|
106
106
|
export type ComparisonStrings = '===' | '==' | '!==' | '!=' | '>' | '<' | '>=' | '<=';
|
|
107
107
|
export type ComparisonArrays = 'INCLUDES' | 'EXCLUDES';
|
|
108
108
|
export type YamlCompareArr = [string | 'SIGNALS', ComparisonStrings | ComparisonArrays, string] | ['true' | 'false'];
|
|
109
|
-
export interface DestinationYamlProperties {
|
|
109
|
+
export interface DestinationYamlProperties extends YamlFieldProperties {
|
|
110
110
|
name: string;
|
|
111
|
-
componentType: FieldTypes;
|
|
112
|
-
componentProperties?: string;
|
|
113
|
-
displayName?: string;
|
|
114
111
|
secret?: boolean;
|
|
115
|
-
initialValue?: string;
|
|
116
112
|
renderCondition?: YamlCompareArr;
|
|
117
113
|
hideFromReadData?: YamlCompareArr;
|
|
118
114
|
customReadDataLabels?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WorkloadId } from '../workload';
|
|
2
2
|
import type { SourcesScopes } from '../sampling';
|
|
3
|
-
import type { Condition,
|
|
3
|
+
import type { Condition, ProgrammingLanguages, SVG, YamlFieldProperties } from '../common';
|
|
4
4
|
export declare enum InstrumentationRuleType {
|
|
5
5
|
CodeAttributes = "CodeAttributes",
|
|
6
6
|
HeadersCollection = "HeadersCollection",
|
|
@@ -122,12 +122,8 @@ export interface PayloadCollection {
|
|
|
122
122
|
[PayloadCollectionKeyTypes.DbQuery]?: DbQueryPayloadCollection | null;
|
|
123
123
|
[PayloadCollectionKeyTypes.Messaging]?: MessagingPayloadCollection | null;
|
|
124
124
|
}
|
|
125
|
-
export interface InstrumentationRuleYamlProperties {
|
|
125
|
+
export interface InstrumentationRuleYamlProperties extends YamlFieldProperties {
|
|
126
126
|
name: string;
|
|
127
|
-
componentType: FieldTypes;
|
|
128
|
-
componentProperties?: string;
|
|
129
|
-
displayName?: string;
|
|
130
|
-
initialValue?: string;
|
|
131
127
|
renderCondition?: string[];
|
|
132
128
|
}
|
|
133
129
|
export type SupportedInstrumentationLanguage = ProgrammingLanguages | '*';
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{bm as ActionKeyTypes,bn as ActionType,eW as AgentInjectedReason,eX as BooleanOperation,c2 as CloudConnectorFeatureKey,ae as CodeAttributesKeyTypes,eY as ConditionType,b8 as Crud,a9 as CustomInstrumentationsKeyTypes,eZ as DesiredConditionActionItemType,cd as DesiredStateProgress,e_ as DestinationTypes,b9 as EntityTypes,by as ExtractionDataFormat,n as FieldTypes,ab as GolangCustomProbe,ac as HeadersCollectionKeyTypes,y as InputTypes,e$ as InstallationMethod,f0 as InstallationStatus,a8 as InstrumentationRuleType,f1 as IntrumentationStatus,aa as JavaCustomProbe,f2 as JsonOperation,bw as K8sAttributesFrom,bv as K8sResourceKind,f3 as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,f4 as ListDirection,f5 as NumberOperation,f6 as OtelDistroName,f7 as OtherEntityTypes,ad as PayloadCollectionKeyTypes,P as PlatformType,f8 as PodContainerLifecycleStatus,f9 as PodContainerStatus,fa as PodPhase,fb as Profile,M as ProgrammingLanguages,fc as SIGNAL_KEY_TO_TYPE,fd as SIGNAL_TYPE_TO_KEY,fe as SignalKey,bs as SignalType,ff as SortDirection,S as StatusType,fg as StringOperation,b as Tier,fh as WorkloadRolloutReason,eB as WorkloadRolloutStatus}from"./chunks/ui-components-dsTdscIC.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/visuals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{fi as VISUAL_ODIGOS_LOGO_HEIGHT,fj as VISUAL_ODIGOS_LOGO_WIDTH,V as VisualGreenRings,fk as VisualOdigosLogo,dd as VisualPurpleRings}from"./chunks/ui-components
|
|
1
|
+
export{fi as VISUAL_ODIGOS_LOGO_HEIGHT,fj as VISUAL_ODIGOS_LOGO_WIDTH,V as VisualGreenRings,fk as VisualOdigosLogo,dd as VisualPurpleRings}from"./chunks/ui-components-dsTdscIC.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/package.json
CHANGED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a,Fragment as t}from"react/jsx-runtime";import{W as l,B as r,c as n,D as i,V as s,F as o,d,e as c,f as u,g as p,C as h,h as g,i as m,I as v,s as f,j as b,k as y,l as x,m as C,n as S,o as T,L as $,p as k,q as w,J as A,G as O,H as P,r as M,u as L,v as D,b as I,w as N,x as R,y as z,S as E,z as X,E as H,K as B,M as V,N as j,O as q,Q as G,U as _,X as U,Y as J,Z as K,_ as W,$ as Y,a0 as F,a1 as Z,a2 as Q,a3 as ee,a4 as ae,a5 as te,a6 as le,a7 as re,a8 as ne,a9 as ie,aa as se,ab as oe,ac as de,ad as ce,ae as ue,af as pe,ag as he,ah as ge,ai as me,aj as ve,ak as fe,al as be,am as ye,an as xe,ao as Ce,ap as Se,aq as Te,ar as $e,as as ke,at as we,au as Ae,av as Oe,aw as Pe,ax as Me,ay as Le,az as De,aA as Ie,aB as Ne,aC as Re,aD as ze,aE as Ee,aF as Xe,aG as He,aH as Be,aI as Ve,aJ as je,aK as qe,aL as Ge,aM as _e,aN as Ue,aO as Je,aP as Ke,aQ as We,aR as Ye,aS as Fe,aT as Ze,aU as Qe,aV as ea,aW as aa,aX as ta,aY as la,R as ra,aZ as na,a_ as ia,A as sa,a$ as oa,b0 as da}from"./ui-components--pbkVlso.js";import{VIcon as ca,EditIcon as ua,OdigosLogoTextCentral as pa,OdigosLogoTextEnterprise as ha,OdigosLogoTextCommunity as ga,OdigosLogoTextColoredCentral as ma,OdigosLogoTextColoredEnterprise as va,OdigosLogoTextColoredCommunity as fa,ArrowLeftIcon as ba,ArrowRightIcon as ya,VSquareIcon as xa,CopyIcon as Ca,YamlIcon as Sa}from"../icons.js";import Ta,{useMemo as $a,useCallback as ka,useState as wa,useEffect as Aa,useRef as Oa,forwardRef as Pa,useImperativeHandle as Ma}from"react";import{a as La,C as Da,b as Ia,u as Na,i as Ra,d as za,e as Ea,f as Xa,g as Ha,h as Ba,j as Va,k as ja,m as qa}from"./odigos-context-pyaT77YA.js";import Ga,{useTheme as _a}from"styled-components";const Ua=({isOpen:a,onClose:t,onDeny:n,onApprove:i})=>e(l,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:a,onClose:t,denyButton:{label:"Keep editing",variant:r.Secondary,onClick:()=>{n?.(),t()}},approveButton:{label:"Discard changes",variant:r.Primary,onClick:()=>{i?.(),t()}}}),Ja=({isOpen:a,onClose:t,onViewConnector:o})=>e(l,{isOpen:a,onClose:t,visual:()=>e(s,{scale:1.2,icon:ca}),title:i.CLOUD_CONNECTOR_CREATED_MODAL_TITLE,description:i.CLOUD_CONNECTOR_CREATED_MODAL_DESC,denyButton:{label:n.STAY_ON_CONNECTIONS,variant:r.Secondary,onClick:t},approveButton:{label:n.GO_TO_CONNECTOR_OVERVIEW,variant:r.Primary,onClick:o??t}}),Ka=({isOpen:a,onClose:t,onDeny:n,onApprove:i,action:s="delete",target:o,description:d,overrideApproveButtonLabel:c,overrideDenyButtonLabel:u})=>{const p=s.charAt(0).toUpperCase()+s.substring(1),h=o?.endsWith("s")?"these":"this";return e(l,{title:`${p}${o?` ${o}`:""}?`,description:d??`Are you sure you want to ${s}${o?` ${h} ${o}`:""}?`,isOpen:a,onClose:t,denyButton:{label:u??"Go back",variant:r.Secondary,onClick:()=>{n?.(),t()}},approveButton:{label:c??p,variant:r.Primary,onClick:()=>{i?.(),t()}}})},Wa=({componentType:a,inputType:t,name:l,label:r,tooltip:n,badge:i,placeholder:s,required:C,disabled:S,value:T,setValue:$,errorMessage:k,warnMessage:w,helpMessage:A,dropdownOptions:O,dropdownNoSearch:P,dropdownNoCheckbox:M,timeUnits:L,timeDefaultUnit:D,toggleSize:I=u.L})=>{switch(a){case o.Input:return e(y,{name:l,type:t,label:r,tooltip:n,badge:i,placeholder:s,required:C,disabled:S,value:T??"",onChange:e=>{const a=e.target.value;$(t===x.Number?""===a?null:Number(a):a)},errorMessage:k,warnMessage:w,helpMessage:A},l);case o.MultiInput:return e(b,{name:l,label:r,tooltip:n,badge:i,placeholder:s,required:C,disabled:S,values:Array.isArray(T)?T:f(T,[]),setValues:e=>$(e),errorMessage:k,warnMessage:w,helpMessage:A,plain:!0},l);case o.KeyValuePair:return e(v,{name:l,label:r,tooltip:n,badge:i,required:C,disabled:S,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key",placeholder:"Key"},{keyName:"value",label:"Value",placeholder:"Value"}],values:Array.isArray(T)?T:f(T,[]),setValues:e=>$(e),errorMessage:k,warnMessage:w,helpMessage:A},l);case o.TextArea:return e(m,{name:l,label:r,tooltip:n,badge:i,required:C,disabled:S,placeholder:s,value:T??"",onChange:e=>$(e.target.value),errorMessage:k,warnMessage:w,helpMessage:A},l);case o.Dropdown:return e(g,{name:l,label:r,tooltip:n,badge:i,placeholder:s,required:C,disabled:S,withSearch:!P,options:O?.map(e=>({id:e.id||"",label:e.label||"",withCheckbox:!M}))||[],values:T?[String(T)]:[],setValues:e=>$(e[0]),errorMessage:k,warnMessage:w,helpMessage:A},l);case o.Checkbox:return e(h,{name:l,label:r,tooltip:n,badge:i,value:!0===T||"true"===T,onChange:e=>$(e),disabled:S,errorMessage:k,warnMessage:w,helpMessage:A},l);case o.Time:return e(p,{name:l,label:r,tooltip:n,badge:i,placeholder:s,required:C,disabled:S,value:T??"",setValue:e=>$(e),units:L,defaultUnit:D,errorMessage:k,warnMessage:w,helpMessage:A},l);case o.Toggle:return e(d,{name:l,size:I,labelAlign:c.Right,label:r,tooltip:n,badge:i,value:!0===T||"true"===T,onChange:e=>$(e),disabled:S,errorMessage:k,warnMessage:w,helpMessage:A},l);default:return null}},Ya=Ga.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
gap: 24px;
|
|
5
|
-
padding: 8px 16px;
|
|
6
|
-
border-radius: 12px;
|
|
7
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
8
|
-
`,Fa=Ga.div`
|
|
9
|
-
flex: 1;
|
|
10
|
-
min-width: 0;
|
|
11
|
-
white-space: pre;
|
|
12
|
-
overflow-x: auto;
|
|
13
|
-
`,Za=({title:t,summary:l,onEdit:n,renderAction:i})=>{const s=$a(()=>{const e=[];return t&&(e.push({text:t,variant:La.Default}),e.push({text:" - ",variant:La.Default})),e.push(...l),e},[t,l]);return a(Ya,{children:[e(Fa,{children:e(Da,{parts:s})}),i&&i(),n&&e(C,{"data-id":"sampling-btn-edit-auto-rule",label:T,rightIcon:ua,variant:r.Text,size:S.S,onClick:n})]})},Qa={[M.HttpRequest]:"HTTP request",[M.HttpResponse]:"HTTP response",[M.DbQuery]:"DB query",[M.Messaging]:"messaging"};function et(e,a,t){return 1===e?a:t??`${a}s`}function at(e,a){const t=[],l=e.slice(0,3),r=e.slice(3);return l.forEach((e,l)=>{l>0&&t.push({text:", ",variant:La.Default}),t.push({text:e,variant:a})}),r.length>0&&t.push({text:` + ${r.length} more`,variant:La.Default,tooltipItems:r}),t}const tt=({option:a,formState:t,renderAction:l})=>{const r=$a(()=>{const e=function(e,a){switch(e){case k.CodeAttributes:return(e=>{const a=Object.values(L).filter(a=>!!e.codeAttributes?.[a]).map(e=>D(e).toLowerCase());return a.length?[{text:"Collect",variant:La.Action},{text:" ",variant:La.Default},...at(a,La.Endpoint)]:null})(a);case k.PayloadCollection:return(e=>{const a=Object.values(M).filter(a=>null!=e.payloadCollection?.[a]).map(e=>Qa[e]);return a.length?[{text:"Collect",variant:La.Action},{text:" ",variant:La.Default},...at(a,La.Endpoint)]:null})(a);case k.HeadersCollection:return(e=>{const a=(e.headersCollection?.[P.HeaderKeys]??[]).map(e=>e.trim()).filter(e=>e.length>0);if(!a.length)return null;const t=et(a.length,"HTTP header");return[{text:`Collect ${a.length} ${t}`,variant:La.Action},{text:"",variant:La.Default,tooltipItems:a}]})(a);case k.CustomInstrumentation:return(e=>{const a=(e.customInstrumentations?.[w.Java]??[]).map(e=>new A(e.className,e.methodName)).filter(e=>e.Verify()),t=(e.customInstrumentations?.[w.Golang]??[]).map(e=>new O(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).filter(e=>e.Verify());if(!(a.length+t.length))return null;const l=[];a.length&&l.push(`${a.length} Java ${et(a.length,"probe")}`),t.length&&l.push(`${t.length} Go ${et(t.length,"probe")}`);const r=[...a.map(e=>`Java: ${e.toString()}`),...t.map(e=>`Go: ${e.toString()}`)];return[{text:`Apply ${l.join(" + ")}`,variant:La.Action},{text:"",variant:La.Default,tooltipItems:r}]})(a);default:return null}}(a?.type,t);return e?[...e,...Ia(t.sourceScopes)]:[]},[a?.type,t]),n=0===r.length;return e(Za,{title:n?$:"Instrumentation Rule Preview",summary:r,renderAction:l})},lt=({size:a=200,central:t=!1,useInline:l=!1})=>{const{tier:r}=Na();if(l){if(t)return e(pa,{size:a});switch(r){case I.Community:return e(ga,{size:a});case I.Onprem:return e(ha,{size:a});default:return null}}if(t)return e(ma,{size:a});switch(r){case I.Community:return e(fa,{size:a});case I.Onprem:return e(va,{size:a});default:return null}},rt=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],nt=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],it=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],st=({description:t,options:l,selected:r,onSelect:n,customName:i,customLabel:s,customPlaceholder:o,customValue:d,onCustomChange:c,customInputType:u=x.Number,customMin:p,customMax:h})=>a(N,{$gap:6,children:[e(R,{label:t}),a(z,{$gap:8,$alignItems:"flex-end",children:[e(E,{options:l,selected:r,setSelected:n}),"custom"===r&&e(y,{name:i,label:s,placeholder:o,type:u,value:d,onChange:c,width:160,min:p,max:h})]})]}),ot=()=>{},dt=a=>a.readOnly?e(ct,{rule:a.rule}):e(ut,{ruleType:a.ruleType,formState:a.formState,onChange:a.onChange}),ct=({rule:t})=>{const l=null!=t.durationAtLeastMs;return t.error?e(X,{richTitle:{title:H},children:e(d,{name:"sampling-view-toggle-keep-errors",onChange:ot,value:!0,size:u.S,label:B,labelAlign:c.Right})}):l?e(X,{richTitle:{title:V},children:a("div",{children:[e(j,{size:_.XXXS,color:G.Secondary,children:q}),e(j,{size:_.XS,children:`${t.durationAtLeastMs}ms`})]})}):null},ut=({ruleType:a,formState:t,onChange:l})=>{const r=ka(e=>l({durationPreset:e}),[l]),n=ka(e=>l({customDurationMs:e.target.value}),[l]);return"Duration"===a?e(X,{richTitle:{title:V,subTitle:U},children:e(st,{description:q,options:it,selected:t.durationPreset,onSelect:r,customName:"sampling-input-custom-duration",customLabel:J,customPlaceholder:"200ms",customValue:t.customDurationMs,onCustomChange:n})}):null},pt=Ga.div`
|
|
14
|
-
display: flex;
|
|
15
|
-
gap: 32px;
|
|
16
|
-
`,ht=Ga.div`
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
gap: 4px;
|
|
20
|
-
`,gt=Ga.div`
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-wrap: wrap;
|
|
23
|
-
align-items: flex-end;
|
|
24
|
-
gap: 16px;
|
|
25
|
-
`,mt=Ga.div`
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: flex-end;
|
|
28
|
-
gap: 16px;
|
|
29
|
-
padding: 12px 16px;
|
|
30
|
-
border-radius: 8px;
|
|
31
|
-
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
32
|
-
`,vt=Ga.div`
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: flex-end;
|
|
35
|
-
gap: 10px;
|
|
36
|
-
flex: 1;
|
|
37
|
-
`,ft=Ga.div`
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
height: 32px;
|
|
41
|
-
`,bt=Ga.div`
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: flex-end;
|
|
44
|
-
gap: 16px;
|
|
45
|
-
margin-bottom: 12px;
|
|
46
|
-
`,yt="Any",xt="Kafka topic",Ct=()=>e("div",{style:{marginBottom:"8px"},children:e(j,{size:_.XS,weight:500,children:"And"})}),St=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Tt=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],$t=[{id:"",label:yt},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}],kt=a=>a.readOnly?e(wt,{data:a.data}):e(At,{category:a.category,formState:a.formState,onChange:a.onChange}),wt=({data:t})=>{const l=$a(()=>(e=>{if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:oe,value:se},{id:"route",title:ae,value:a.httpServer.route||a.httpServer.routePrefix||de},{id:"method",title:ne,value:a.httpServer.method||yt}];if(a?.httpClient){const e=[{id:"type",title:oe,value:ce}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:ae,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||de}),e.push({id:"method",title:ne,value:a.httpClient.method||yt}),e}return[{id:"type",title:oe,value:ue}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:oe,value:se},{id:"route",title:ae,value:a.httpServer.route||a.httpServer.routePrefix||de},{id:"method",title:ne,value:a.httpServer.method||yt}]:a?.kafkaConsumer?[{id:"type",title:oe,value:pe},{id:"topic",title:xt,value:a.kafkaConsumer.kafkaTopic||de}]:a?.kafkaProducer?[{id:"type",title:oe,value:he},{id:"topic",title:xt,value:a.kafkaProducer.kafkaTopic||de}]:[{id:"type",title:oe,value:ue}]})(t),[t]);return e(X,{richTitle:{title:K},children:e(pt,{children:l.map(({id:t,title:l,value:r})=>a(ht,{children:[e(j,{size:_.XXXS,color:G.Secondary,nowrap:!0,children:l}),e(j,{size:_.XS,nowrap:!0,children:r})]},t))})})},At=({category:t,formState:l,onChange:n})=>{const i=$a(()=>"noisy"===t?St:Tt,[t]),s=ka(e=>n({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[n]),o=ka(e=>a=>{a&&n({routeType:e,route:""})},[n]),d=ka(e=>n({route:e.target.value}),[n]),c=ka(e=>n({serverAddress:e.target.value}),[n]),u=ka(e=>n({method:e[0]||""}),[n]),p=ka(e=>n({kafkaTopic:e.target.value}),[n]),h="httpServer"===l.operationType||"httpClient"===l.operationType,g="kafkaConsumer"===l.operationType||"kafkaProducer"===l.operationType,m="httpClient"===l.operationType?ee:ae,v="httpClient"===l.operationType?te:le;return a(X,{richTitle:{title:`2. ${K}`,subTitle:W},children:[e(N,{$alignItems:"flex-start",children:e(E,{options:i,selected:l.operationType,setSelected:s})}),h&&a(gt,{children:["httpClient"===l.operationType&&a(bt,{children:[e(y,{name:"sampling-input-server-address",label:F,placeholder:Y,value:l.serverAddress,onChange:c}),e(Ct,{})]}),a(mt,{children:[a(vt,{children:[e(ft,{children:e(Z,{"data-id":"sampling-radio-route",value:"route"===l.routeType,onChange:o("route")})}),e(y,{name:"sampling-input-route",label:m,placeholder:Q,value:"route"===l.routeType?l.route:"",onChange:d,disabled:"route"!==l.routeType})]}),a(vt,{children:[e(ft,{children:e(Z,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===l.routeType,onChange:o("routePrefix")})}),e(y,{name:"sampling-input-route-prefix",label:v,placeholder:Q,value:"routePrefix"===l.routeType?l.route:"",onChange:d,disabled:"routePrefix"!==l.routeType})]})]}),a(bt,{children:[e(Ct,{}),e(re,{label:ne,items:$t,selectedIds:[l.method||""],setSelectedIds:e=>u(e),buttonProps:{"data-id":"sampling-btn-method",label:$t.find(e=>e.id===l.method)?.label||yt,size:S.S,variant:r.Secondary}})]})]}),g&&e(y,{name:"sampling-input-kafka-topic",label:ie,placeholder:"Type kafka topic",value:l.kafkaTopic,onChange:p,width:"320px"})]})},Ot=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Pt=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}],Mt=a=>a.readOnly?e(Lt,{data:a.data}):e(Dt,{category:a.category,formState:a.formState,onChange:a.onChange}),Lt=({data:t})=>{const l=$a(()=>(e=>{switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:me,method:be,description:ve,value:`${e.rule.percentageAtLeast}%`}:{title:me,method:xe,description:null,value:null};case"noisy":return Ra(e.rule.percentageAtMost)?{title:me,method:ye,description:null,value:null}:{title:me,method:be,description:fe,value:`${e.rule.percentageAtMost}%`};case"costReduction":return{title:me,method:be,description:fe,value:`${e.rule.percentageAtMost}%`}}})(t),[t]),r=[{id:"method",title:ne,value:l.method},...null!=l.description?[{id:"value",title:l.description,value:l.value}]:[]];return e(X,{richTitle:{title:l.title},children:e(pt,{children:r.map(({id:t,title:l,value:r})=>a(ht,{children:[e(j,{size:_.XXXS,color:G.Secondary,nowrap:!0,children:l}),e(j,{size:_.XS,nowrap:!0,children:r})]},t))})})},Dt=({category:t,formState:l,onChange:r})=>{const n="highlyRelevant"===t,i=n?Pt:Ot,s=`${n?4:3}. ${me}`,o=ge[t],d=n?ve:fe,c="noisy"===t?nt:rt,u=ka(e=>r({percentageMode:e}),[r]),p=ka(e=>r({percentagePreset:e}),[r]),h=ka(e=>r({customPercentage:e.target.value}),[r]);return a(X,{richTitle:{title:s,subTitle:o},children:["costReduction"!==t&&e(N,{$alignItems:"flex-start",children:e(E,{options:i,selected:l.percentageMode,setSelected:u})}),("costReduction"===t||"sample"===l.percentageMode)&&e(st,{description:d,options:c,selected:l.percentagePreset,onSelect:p,customName:"sampling-input-custom-percentage",customPlaceholder:"5%",customValue:l.customPercentage,onCustomChange:h,customInputType:x.Decimal,customMin:0,customMax:100})]})},It=Ga.div`
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: flex-end;
|
|
49
|
-
gap: 16px;
|
|
50
|
-
`,Nt=Ga.div`
|
|
51
|
-
width: 280px;
|
|
52
|
-
flex-shrink: 0;
|
|
53
|
-
`,Rt=Ga.div`
|
|
54
|
-
flex: 1;
|
|
55
|
-
min-width: 0;
|
|
56
|
-
`;function zt(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":Oe[e.category]}const Et=a=>a.readOnly?e(Xt,{data:a.data}):e(Ht,{formState:a.formState,onChange:a.onChange}),Xt=({data:t})=>{const l=$a(()=>[{id:"name",title:Se,value:t.rule.name||Ce},{id:"type",title:Te,value:zt(t)}],[t]),r=t.rule.notes||de;return a(X,{children:[e(pt,{children:l.map(({id:t,title:l,value:r})=>a(ht,{children:[e(j,{size:_.XXXS,color:G.Secondary,nowrap:!0,children:l}),e(j,{size:_.XS,nowrap:!0,children:r})]},t))}),a(ht,{children:[e(j,{size:_.XXXS,color:G.Secondary,children:$e}),e(j,{size:_.XS,children:r})]})]})},Ht=({formState:t,onChange:l})=>{const r=ka(e=>l({name:e.target.value}),[l]),n=ka(e=>l({notes:e.target.value}),[l]);return e(X,{children:a(It,{children:[e(Nt,{children:e(y,{name:"sampling-input-rule-name",label:Se,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:ke,value:t.name,onChange:r})}),e(Rt,{children:e(y,{name:"sampling-input-note",label:$e,tooltip:Ae,placeholder:we,value:t.notes,onChange:n})})]})})},Bt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],Vt=({formState:a,onChange:t})=>{const l=ka(e=>t({ruleType:e,keepErrors:"Error"===e}),[t]);return e(X,{richTitle:{title:`3. ${Te}`,subTitle:Pe},children:e(N,{$alignItems:"flex-start",children:e(E,{options:Bt,selected:a.ruleType,setSelected:l})})})},jt=a=>{const t=$a(()=>{if(a.readOnly)return a.summary;switch(a.category){case"noisy":return Xa(Va(a.formState));case"highlyRelevant":return Ea(Ba(a.formState));case"costReduction":return za(Ha(a.formState))}},[a]);if(a.readOnly)return e(Za,{title:Me,summary:t,renderAction:a.renderAction});const l=1===t.length&&"default"===t[0].variant;return e(Za,{title:l?$:Me,summary:l?[]:t,renderAction:a.renderAction})},qt=Ga.div`
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-wrap: wrap;
|
|
59
|
-
gap: 8px;
|
|
60
|
-
`,Gt=Ga.div`
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
gap: 8px;
|
|
64
|
-
padding: 8px 12px;
|
|
65
|
-
border-radius: 8px;
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
background: ${({theme:e,$selected:a})=>a?e.v2.colors.silver[700]:e.v2.colors.silver[800]};
|
|
68
|
-
border: 1px solid ${({theme:e,$selected:a})=>a?e.v2.colors.silver[500]:e.v2.colors.silver[750]};
|
|
69
|
-
|
|
70
|
-
&:hover {
|
|
71
|
-
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
72
|
-
}
|
|
73
|
-
`,_t=Ga.div`
|
|
74
|
-
display: flex;
|
|
75
|
-
width: 32px;
|
|
76
|
-
height: 32px;
|
|
77
|
-
justify-content: center;
|
|
78
|
-
align-items: center;
|
|
79
|
-
flex-shrink: 0;
|
|
80
|
-
`,Ut=Ga.div`
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: column;
|
|
83
|
-
gap: 12px;
|
|
84
|
-
`,Jt=Ga.div`
|
|
85
|
-
display: flex;
|
|
86
|
-
flex-wrap: wrap;
|
|
87
|
-
gap: 6px;
|
|
88
|
-
`,Kt=Ga.div`
|
|
89
|
-
display: flex;
|
|
90
|
-
align-items: center;
|
|
91
|
-
gap: 8px;
|
|
92
|
-
&::before,
|
|
93
|
-
&::after {
|
|
94
|
-
content: '';
|
|
95
|
-
flex: 1;
|
|
96
|
-
height: 1px;
|
|
97
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
98
|
-
}
|
|
99
|
-
`,Wt=Ga.div`
|
|
100
|
-
padding: 2px 10px;
|
|
101
|
-
border-radius: 999px;
|
|
102
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
103
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[600]};
|
|
104
|
-
`,Yt={[Ve.JavaScript]:"Node.js",[Ve.DotNet]:".NET",[Ve.Php]:"PHP",[Ve.Java]:"Java",[Ve.Go]:"Go",[Ve.Python]:"Python",[Ve.Ruby]:"Ruby",[Ve.Rust]:"Rust"},Ft=[Ve.Python,Ve.Java,Ve.JavaScript,Ve.DotNet,Ve.Php,Ve.Ruby,Ve.Go],Zt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function Qt(e){return Yt[e]||e.charAt(0).toUpperCase()+e.slice(1)}function el(e){return null!=e?`${e}. ${We}`:We}const al=({readOnly:a,...t})=>e(a?rl:il,{...t}),tl=({title:t,count:l,children:r})=>a(N,{$gap:6,children:[a(z,{$gap:8,$alignItems:"center",children:[e(j,{size:_.XS,color:G.Primary,nowrap:!0,children:t}),l>1&&a(j,{size:_.XXS,color:G.Secondary,nowrap:!0,children:["(",Je,")"]})]}),e(Jt,{children:r})]}),ll=()=>{const a=_a();return e(Kt,{children:e(Wt,{children:e(j,{size:_.XXS,color:a.v2.colors.white[500],nowrap:!0,children:Ke})})})},rl=({scopes:t,titleNumber:l})=>{const r=el(l);if(ja(t))return e(Le,{bgTint:"900",richTitle:{title:r},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(De,{status:Ne.Default,message:Ie,fullWidth:!0})});const n=t.sources??[],i=t.namespaces??[],s=t.languages??[],o=[];return n.length&&o.push({kind:"sources",node:e(tl,{title:Re,count:n.length,children:n.map((a,t)=>{const l=[a.namespace,a.kind,a.name].filter(Boolean),r=l.length?l.join(" / "):Ee;return e(ze,{label:r},`src-${t}-${r}`)})})}),i.length&&o.push({kind:"namespaces",node:e(tl,{title:Xe,count:i.length,children:i.map((a,t)=>e(ze,{label:a},`ns-${t}-${a}`))})}),s.length&&o.push({kind:"languages",node:e(tl,{title:He,count:s.length,children:s.map((a,t)=>{const l=je(a);return e(ze,{label:Qt(a),leftIcon:l},`lang-${t}-${a}`)})})}),e(Le,{bgTint:"900",richTitle:{title:r,subTitle:o.length>1?Be:void 0},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(Le,{bgTint:"800",children:e(Ut,{children:o.map((t,l)=>a(Ta.Fragment,{children:[l>0&&e(ll,{}),t.node]},t.kind))})})})},nl=e=>e.sources.length>0?"source":e.namespaces.length>0?"namespace":e.languages.length>0?"language":"all",il=({scopes:t,onChange:l,sourceOptions:r=[],namespaceOptions:n=[],supportedLanguages:i,titleNumber:s,dataIdPrefix:o="source-scope",slim:d})=>{const c=t??qa(),[u,p]=wa(()=>nl(c)),{sources:g,namespaces:m,languages:v}=c,f=g.length>0||m.length>0||v.length>0;Aa(()=>{f&&"all"===u&&p(nl(c))},[f,u]);const b=$a(()=>Zt.map(e=>"language"===e.value&&0===i?.length?null:{...e,disabled:"all"===e.value&&f}).filter(Boolean),[f]),y=$a(()=>g.map(e=>`${e.namespace}/${e.kind}/${e.name}`),[g]),x=$a(()=>[...m],[m]),C=$a(()=>new Set(v),[v]),S=ka(e=>{p(e)},[]),T=ka(e=>{const a=e.map(e=>(e=>{const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}})(e)).filter(e=>null!=e).map(e=>({namespace:e.namespace,kind:e.kind,name:e.name}));l({...c,sources:a})},[c,l]),$=ka(e=>{l({...c,namespaces:e})},[c,l]),k=ka(e=>{const a=c.languages,t=a.includes(e)?a.filter(a=>a!==e):[...a,e];l({...c,languages:t})},[c,l]),w=!f&&"all"===u,A=(i||Ft).map(e=>({id:e,label:Yt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:je(e)}));return a(X,{richTitle:d?{title:el(s),titleSize:_.XS,titleColor:G.Secondary,tooltip:qe}:{title:el(s),subTitle:qe,subTitleWrap:!0},backgroundColor:d?"transparent":void 0,padding:d?0:void 0,children:[e(De,w?{status:Ne.Default,message:Ie,fullWidth:!0,smallIcon:!0}:{status:Ne.Info,message:Be,fullWidth:!0,smallIcon:!0}),e(N,{$alignItems:"flex-start",children:e(E,{options:b,selected:u,setSelected:S})}),"source"===u&&e(Ge,{multiple:!0,"data-id":`${o}-autocomplete-source`,options:r,value:y,onSelect:T,placeholder:_e}),"namespace"===u&&e(Ge,{multiple:!0,"data-id":`${o}-autocomplete-namespace`,options:n,value:x,onSelect:$,placeholder:"Search namespace"}),"language"===u&&A.length>0&&e(qt,{children:A.map(({id:t,label:l,Icon:r})=>{const n=C.has(t);return a(Gt,{$selected:n,onClick:()=>k(t),children:[e(h,{name:`${o}-lang-${t}`,size:Ue.S,value:n,onChange:()=>k(t)}),e(_t,{children:e(r,{size:20})}),e(j,{size:_.XS,nowrap:!0,children:l})]},t)})})]})},sl=(e,a)=>!a?.length||!!a?.find(a=>a===e),ol=({title:t="Signals",required:l,errorMessage:r,allowedSignals:n,selectedSignals:i,setSelectedSignals:s,disabled:o})=>{const[d,c]=wa(1===i.length),u=Oa(JSON.stringify(i));return Aa(()=>{let e=Ye(i).filter(e=>sl(e,n));e.length||(e=Fe.filter(({id:e})=>sl(e,n)).map(({id:e})=>e));const a=JSON.stringify(e);u.current!==a&&(u.current=a,s(e),c(1===e.length))},[n,i]),a(N,{$gap:12,children:[e(R,{label:t,required:l}),e(z,{$gap:12,children:Fe.map(a=>{const t=sl(a.id,n),l=((e,a)=>!!a?.find(a=>a===e))(a.id,i);return t?e(h,{label:a.value,disabled:o||!t||d&&l,value:l,onChange:e=>((e,a)=>{const t=e,l=a?[...i,t]:i.filter(e=>e!==t);s(l),c(1===l.length)})(a.id,e)},a.id):null})}),e(Ze,{errorMessage:r})]})},dl=({minSupportedVersion:a,currentVersion:t})=>e(l,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>e(s,{scale:2.4,icon:()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:e("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${t}.`}),cl=Ga.div`
|
|
105
|
-
display: flex;
|
|
106
|
-
flex-direction: column;
|
|
107
|
-
justify-content: flex-end;
|
|
108
|
-
width: ${({$width:e})=>e};
|
|
109
|
-
gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
|
|
110
|
-
`,ul=Ga.div`
|
|
111
|
-
display: flex;
|
|
112
|
-
align-items: center;
|
|
113
|
-
min-height: 24px;
|
|
114
|
-
padding: 12px;
|
|
115
|
-
border-radius: 16px 16px 0 0;
|
|
116
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
117
|
-
`,pl=Ga.div`
|
|
118
|
-
display: flex;
|
|
119
|
-
flex-direction: column;
|
|
120
|
-
gap: ${({$gap:e})=>e}px;
|
|
121
|
-
padding: 12px 12px 0 12px;
|
|
122
|
-
width: 100%;
|
|
123
|
-
height: ${({$heightOffset:e,$columnHasHeader:a})=>`calc(100vh - 180px - ${e}px ${a?"- 48px":""})`};
|
|
124
|
-
border-radius: ${({$columnHasHeader:e,$isLeft:a,$isRight:t})=>e?a?"0 0 0 16px":t?"0 16px 0 0":"0":a?"16px 0 0 16px":t?"0 16px 16px 0":"16px"};
|
|
125
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
126
|
-
overflow-y: auto;
|
|
127
|
-
overflow-x: hidden;
|
|
128
|
-
`,hl=({isLeft:l,isRight:r,heightOffset:n=0,width:i,header:s,list:o})=>a(cl,{$width:i,$columnHasHeader:!!s,children:[s&&e(ul,{children:s}),e(pl,{$gap:8,$isLeft:l,$isRight:r,$heightOffset:n,$columnHasHeader:!!s,children:o.length?o.length>1?e(Qe,{gap:8,elements:o}):e(t,{children:o[0]}):e(ea,{$height:"100%",children:e(aa,{})})})]}),gl="75vw",ml=Ga.div`
|
|
129
|
-
display: flex;
|
|
130
|
-
flex-direction: column;
|
|
131
|
-
border-radius: 16px;
|
|
132
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
133
|
-
overflow: hidden;
|
|
134
|
-
`,vl=Ga.div`
|
|
135
|
-
display: flex;
|
|
136
|
-
gap: 12px;
|
|
137
|
-
padding: 16px 16px 0 16px;
|
|
138
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
139
|
-
position: sticky;
|
|
140
|
-
top: 0;
|
|
141
|
-
`,fl=Ga.div`
|
|
142
|
-
padding: 12px 12px 0 12px;
|
|
143
|
-
`,bl=Ga.div`
|
|
144
|
-
display: flex;
|
|
145
|
-
gap: 12px;
|
|
146
|
-
padding: 16px;
|
|
147
|
-
`,yl=Ga.div`
|
|
148
|
-
padding: 5vh 10vw;
|
|
149
|
-
border-radius: 12px;
|
|
150
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
151
|
-
`,xl=Pa(({isOpen:t,withOverlay:n,disableAnimation:i,onClose:s,onBack:o,onNext:d,nextIsSkip:c,onSave:u,disableSave:p,connectionIds:h,header:g,subHeader:m,leftColumn:v,rightColumn:f,search:b,filters:y,errorMessage:x,isFormDirty:C,hideDirtyNote:S,isFetching:T,progress:$},k)=>{const[w,A]=wa(!1),[O,P]=wa(!1),[M,L]=wa(void 0);Ma(k,()=>({clearErrors:()=>L(void 0)}));const D=O,I=ka(()=>{C&&!w?A(!0):(A(!1),s?.())},[C,w,s]),N=p||O||"boolean"==typeof C&&!C,R=ka(async()=>{P(!0);const e=await u();P(!1),!1!==e&&(e?.error?L(e.error):(h?.setValue([]),s?.()))},[u,h,s]),z=!!b||!!h||!!y,E=!!m,X=(z?48:0)+(E?50:0),H=$a(()=>T?{status:Ne.Info,message:"Fetching Data..."}:O&&!$?{status:Ne.Info,message:"Saving Changes..."}:M||x?{status:Ne.Error,message:M||x}:"boolean"==typeof C&&C&&!S?{status:Ne.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:void 0,[T,O,$,M,x,C,S]),B=$a(()=>o?{label:"Back",leftIcon:ba,variant:r.Secondary,onClick:o}:{label:"Cancel",variant:r.Secondary,onClick:I,disabled:D},[o,I,D]),[V,j]=wa(!1),q=$a(()=>d?c?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:ya,variant:r.Secondary,onClick:()=>j(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:ya,variant:r.Primary,onClick:d}:{"data-id":"wide-drawer-save",label:"Save",variant:r.Primary,onClick:R,disabled:N},[d,c,R,N]);return a(ta,{width:gl,isOpen:t,disableAnimation:i,hideOverlay:!O&&!n,header:{...g,onClose:s?I:void 0,onCloseDisabled:D},footer:{note:H,actions:[B,q]},children:[O?e(ea,{$height:"calc(100vh - 136px)",children:e(yl,{children:e(la,{titleSize:_.S,subTitleSize:_.XXXS,withGradient:!0,withSpinner:!0,...$})})}):a(ml,{children:[z&&a(vl,{children:[h&&e(ra,{icon:xa,title:"Selected Clusters",badge:{label:h.value.length}}),b&&e(na,{width:"100%",...b}),y]}),E&&e(fl,{children:e(ra,{icon:m.icon,title:m.title,subTitle:m.description,badge:m.badge})}),a(bl,{children:[e(hl,{isLeft:!0,heightOffset:X,...v}),e(hl,{isRight:!0,heightOffset:X,...f})]})]}),e(Ua,{isOpen:w,onClose:()=>A(!1),onApprove:I}),e(l,{title:"Skip setup?",description:"Without completing setup, Odigos won't be able to collect and send your telemetry data. This may interrupt your data flow and limit the platform's ability to provide value.",isOpen:V,onClose:()=>j(!1),denyButton:{label:"Go Back",variant:r.Secondary,onClick:()=>j(!1)},approveButton:{label:"Skip",variant:r.Primary,onClick:()=>{d?.(),j(!1)}}})]})});xl.displayName=xl.name;const Cl=Ga.div`
|
|
152
|
-
padding: 0 24px;
|
|
153
|
-
border-radius: 12px;
|
|
154
|
-
background-color: ${({$codeBgColor:e})=>e||"transparent"};
|
|
155
|
-
`,Sl=({title:a="YAML",yaml:t,defaultOpen:l,fullHeight:n,bgTint:i="1000",codeBgColor:s})=>{const{clickCopy:o,isCopied:d}=ia(),c=$a(()=>t?[{id:oa(),type:sa.Button,buttonProps:{variant:r.Text,size:S.S,leftIcon:d?ca:Ca,onClick:()=>o(t||""),disabled:d}}]:[],[t,d]);return e(Le,{bgTint:i,richTitle:{icon:Sa,title:a},actions:c,withCollapse:!0,collapseIsDefaultOpen:l,fullHeight:n,children:e(Cl,{$codeBgColor:s,children:t?e(da,{code:t,language:"yaml",theme:"duotoneDark"}):e(ea,{children:e(aa,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{Za as A,Ua as C,it as D,tt as I,nt as N,lt as O,rt as P,Et as R,jt as S,dl as U,gl as W,Sl as Y,Ja as a,Ka as b,dt as c,Wa as d,kt as e,Mt as f,st as g,Vt as h,ol as i,al as j,xl as k};
|