@odigos/ui-kit 0.0.269 → 0.0.271
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 +160 -189
- package/lib/chunks/{helpers-w7krM8zT.js → helpers-pQ9OGZgF.js} +1 -1
- package/lib/chunks/index-BD_WHo50.js +257 -0
- package/lib/chunks/source-instrument-form-context-DB1VZT-P.js +5 -0
- package/lib/chunks/ui-components-BzgG1abD.js +1596 -0
- package/lib/components/no-data/index.d.ts +3 -1
- package/lib/components.js +1 -1
- package/lib/constants/strings/index.d.ts +3 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/edit-action-drawer/helpers.d.ts +2 -3
- package/lib/containers/_drawers/edit-rule-drawer/helpers.d.ts +6 -5
- package/lib/containers.js +259 -225
- package/lib/contexts.js +1 -1
- package/lib/functions/build-catalog-fields-data-card/index.d.ts +17 -0
- package/lib/functions/index.d.ts +1 -0
- package/lib/functions.js +1 -1
- package/lib/hooks/useInstrumentationRuleFormData.d.ts +2 -2
- package/lib/hooks.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +5 -1
- package/lib/types/instrumentation-rules/index.d.ts +15 -1
- package/lib/types/pipeline-collectors/index.d.ts +6 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +14 -11
- package/lib/chunks/index-C8U7vd0v.js +0 -257
- package/lib/chunks/source-instrument-form-context-DS-dr35D.js +0 -5
- package/lib/chunks/ui-components-dsTdscIC.js +0 -1596
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-DB1VZT-P.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-DB1VZT-P.js";export{O as OdigosProvider,c as checkVersionSupport,r as resolveMinSupportedVersion,u as useOdigos}from"./chunks/helpers-pQ9OGZgF.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-BzgG1abD.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};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type DataCardProps } from '../../components';
|
|
2
|
+
import { FieldTypes, type SignalType, type YamlFieldProperties } from '../../types';
|
|
3
|
+
export type BuildCatalogFieldsDataCardOptions = {
|
|
4
|
+
/** Signals used by `renderCondition` comparisons (actions). */
|
|
5
|
+
signals?: SignalType[];
|
|
6
|
+
/** Skip these component types (e.g. `sourceScopes`, rendered elsewhere). */
|
|
7
|
+
skipComponentTypes?: FieldTypes[];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Build view-mode `DataCard` items from a YAML catalog field list.
|
|
11
|
+
*
|
|
12
|
+
* Used by edit drawers (actions, instrumentation rules) for Configuration /
|
|
13
|
+
* Collect read views so new types and nested fields show up without per-type
|
|
14
|
+
* hard-coding. `values` is the bag keyed by YAML `name` (action.fields for
|
|
15
|
+
* actions; the rule root for instrumentation rules).
|
|
16
|
+
*/
|
|
17
|
+
export declare const buildCatalogFieldsDataCard: (values: Record<string, unknown>, yamlFields: YamlFieldProperties[], options?: BuildCatalogFieldsDataCardOptions) => NonNullable<DataCardProps["items"]>;
|
package/lib/functions/index.d.ts
CHANGED
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{bk as adaptInstrumentationRuleFromWire,bi as adaptInstrumentationRuleInputForWire,ce as buildBadgeForDesiredStatus,c5 as buildCatalogFieldsDataCard,fn as capitalizeFirstLetter,fo as cleanObjectEmptyStringsValues,a3 as compareCondition,fp as decimalsOnly,aY as deepClone,ev as entityIdKey,eA as filterActions,ez as filterDestinations,c9 as filterDestinationsByStream,ey as filterSources,em as filterSourcesByStream,fq as flattenObjectKeys,ct as formatBytes,fr as formatDuration,b4 as generateId,c7 as getActionIcon,et as getConditionsBooleans,cI as getContainersIcons,fs as getContainersInstrumentedCount,ft as getDeepValue,b$ as getDestinationIcon,fu as getDetectedLanguageIcons,cj as getEffectiveLanguage,cB as getEffectiveRuntimeVersion,ew as getEntityIcon,bh as getEntityId,es as getEntityIdKey,eu as getEntityLabel,fv as getHealthBadgeLabel,bf as getIdFromSseTarget,cb as getInstrumentationRuleIcon,fw as getMainContainerLanguage,fx as getMetricForEntity,fy as getMonitorIcon,fz as getNearestTypographySize,fA as getPlatformIcon,ei as getPlatformLabel,O as getProgrammingLanguageIcon,fB as getRecursiveValues,cs as getSourceKindLabel,cp as getSourceLanguageIcons,b8 as getSseTargetFromId,cv as getStatusColor,eC as getStatusFromPodStatus,cw as getStatusIcon,cu as getStatusTypeFromOdigosHealth,fC as getValueForRange,co as getVirtualServiceIcon,cn as getWorkloadId,ca as getYamlFieldsForDestination,fD as hasUnhealthyInstances,fE as instrumentationRuleSourceScopesFromWire,fF as instrumentationRuleSourceScopesToWire,bp as isEmpty,bq as isLegalK8sLabel,d1 as isOverTime,fG as isStringABoolean,fH as isTimeElapsed,cA as isValidVersion,fI as mapConditions,ch as mapDesiredStatusToConditionStatus,c8 as mapDestinationFieldsForDisplay,bu as mapExportedSignals,bs as mapSupportedSignals,fJ as numbersOnly,fK as parseBooleanFromString,fL as parseJsonStringToPrettyString,bF as prepareDestinationFormData,fM as removeEmptyValuesFromObject,v as safeJsonParse,fN as safeJsonStringify,fO as setDeepValue,fP as sleep,ag as splitCamelString,fQ as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-BzgG1abD.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,9 +1,9 @@
|
|
|
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" | "sourceScopes" | "ruleName" | "notes" | "workloads" | "instrumentationLibraries" | "codeAttributes" | "headersCollection" | "payloadCollection" | "customInstrumentations", string>>;
|
|
4
|
+
formErrors: Partial<Record<"disabled" | "conditions" | "sourceScopes" | "ruleName" | "notes" | "workloads" | "instrumentationLibraries" | "codeAttributes" | "headersCollection" | "payloadCollection" | "customInstrumentations" | "networkMetrics", string>>;
|
|
5
5
|
handleFormChange: (key?: string | undefined, val?: any, obj?: InstrumentationRuleFormData | undefined) => void;
|
|
6
6
|
resetFormData: (overrideForm?: InstrumentationRuleFormData | undefined) => void;
|
|
7
7
|
validateForm: () => boolean;
|
|
8
|
-
loadFormWithDrawerItem: ({ ruleName, notes, disabled, sourceScopes, payloadCollection, codeAttributes, headersCollection, customInstrumentations }: InstrumentationRule) => void;
|
|
8
|
+
loadFormWithDrawerItem: ({ ruleName, notes, disabled, sourceScopes, payloadCollection, codeAttributes, headersCollection, customInstrumentations, networkMetrics }: InstrumentationRule) => void;
|
|
9
9
|
};
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{g4 as IGNORE_OUTSIDE_CLICK_ATTR,g5 as useActionFormData,g6 as useBodyScroll,ex as useContainerSize,b3 as useCopy,g7 as useDataStreamFormData,g8 as useDestinationFormData,bl as useGenericForm,g9 as useInstrumentationRuleFormData,d0 as useKeyDown,cx as useOnClickOutside,ga as useOverflow,gb as usePopup,cd as useScrollIntoViewWhen,eX as useScrollTo,ep as useSessionStorage,gc as useSourceFormData,cc as useTimeAgo}from"./chunks/ui-components-BzgG1abD.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/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-BzgG1abD.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-BD_WHo50.js";export{C as ColoredSpan,a as ColoredSpanVariant}from"./chunks/helpers-pQ9OGZgF.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/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{d5 as DrawerType,be as ProgressKeys,eq as getDrawerTypeForAdd,cr as getDrawerTypeForEdit,g3 as useDarkMode,bb as useDataStreamStore,cm as useDrawerStore,el as useFilterStore,b6 as useNotificationStore,bc as useProgressStore,er as useSelectedStore,bd as useSetupStore}from"./chunks/ui-components-BzgG1abD.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{
|
|
1
|
+
export{gd as Provider,ge as animations,gf as opacity,gg as palettes}from"./chunks/ui-components-BzgG1abD.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";
|
|
@@ -9,7 +9,9 @@ export declare enum ActionType {
|
|
|
9
9
|
RenameAttributes = "RenameAttribute",
|
|
10
10
|
PiiMasking = "PiiMasking",
|
|
11
11
|
URLTemplatization = "URLTemplatization",
|
|
12
|
-
ExtractAttribute = "ExtractAttribute"
|
|
12
|
+
ExtractAttribute = "ExtractAttribute",
|
|
13
|
+
DbQueryTemplatization = "DbQueryTemplatization",
|
|
14
|
+
InferDbAttributes = "InferDbAttributes"
|
|
13
15
|
}
|
|
14
16
|
export declare enum ActionKeyTypes {
|
|
15
17
|
CollectContainerAttributes = "collectContainerAttributes",
|
|
@@ -25,6 +27,7 @@ export declare enum ActionKeyTypes {
|
|
|
25
27
|
PiiCategories = "piiCategories",
|
|
26
28
|
UrlTemplatizationRulesGroups = "urlTemplatizationRulesGroups",
|
|
27
29
|
ExtractAttribute = "extractAttribute",
|
|
30
|
+
TemplatizeLiterals = "templatizeLiterals",
|
|
28
31
|
Scopes = "scopes"
|
|
29
32
|
}
|
|
30
33
|
export interface ActionYamlProperties extends YamlFieldProperties {
|
|
@@ -93,6 +96,7 @@ export interface ActionFields {
|
|
|
93
96
|
[ActionKeyTypes.PiiCategories]?: string[] | null;
|
|
94
97
|
[ActionKeyTypes.UrlTemplatizationRulesGroups]?: UrlTemplatizationRulesGroup[] | null;
|
|
95
98
|
[ActionKeyTypes.ExtractAttribute]?: ExtractAttribute | null;
|
|
99
|
+
[ActionKeyTypes.TemplatizeLiterals]?: boolean | null;
|
|
96
100
|
[ActionKeyTypes.Scopes]?: SourcesScopes | null;
|
|
97
101
|
}
|
|
98
102
|
export declare enum K8sAttributesFrom {
|
|
@@ -39,6 +39,7 @@ export interface InstrumentationRule {
|
|
|
39
39
|
headersCollection?: HeadersCollection | null;
|
|
40
40
|
payloadCollection?: PayloadCollection | null;
|
|
41
41
|
customInstrumentations?: CustomInstrumentations | null;
|
|
42
|
+
networkMetrics?: boolean | null;
|
|
42
43
|
}
|
|
43
44
|
export type InstrumentationRuleFormData = Omit<InstrumentationRule, 'ruleId' | 'type' | 'mutable' | 'profileName'>;
|
|
44
45
|
export declare enum CodeAttributesKeyTypes {
|
|
@@ -65,7 +66,8 @@ export interface HeadersCollection {
|
|
|
65
66
|
}
|
|
66
67
|
export declare enum CustomInstrumentationsKeyTypes {
|
|
67
68
|
Java = "java",
|
|
68
|
-
Golang = "golang"
|
|
69
|
+
Golang = "golang",
|
|
70
|
+
Php = "php"
|
|
69
71
|
}
|
|
70
72
|
export interface IJavaCustomProbe {
|
|
71
73
|
className: string;
|
|
@@ -93,9 +95,21 @@ export declare class GolangCustomProbe implements IGolangCustomProbe {
|
|
|
93
95
|
Verify(): boolean;
|
|
94
96
|
toString(): string;
|
|
95
97
|
}
|
|
98
|
+
export interface IPhpCustomProbe {
|
|
99
|
+
className?: string | null;
|
|
100
|
+
functionName: string;
|
|
101
|
+
}
|
|
102
|
+
export declare class PhpCustomProbe implements IPhpCustomProbe {
|
|
103
|
+
className?: string | null;
|
|
104
|
+
functionName: string;
|
|
105
|
+
constructor(className: string | null | undefined, functionName: string);
|
|
106
|
+
Verify(): boolean;
|
|
107
|
+
toString(): string;
|
|
108
|
+
}
|
|
96
109
|
export interface CustomInstrumentations {
|
|
97
110
|
[CustomInstrumentationsKeyTypes.Java]?: JavaCustomProbe[] | null;
|
|
98
111
|
[CustomInstrumentationsKeyTypes.Golang]?: GolangCustomProbe[] | null;
|
|
112
|
+
[CustomInstrumentationsKeyTypes.Php]?: PhpCustomProbe[] | null;
|
|
99
113
|
}
|
|
100
114
|
interface HttpPayloadCollection {
|
|
101
115
|
mimeTypes?: string[] | null;
|
|
@@ -62,6 +62,9 @@ interface Nodes {
|
|
|
62
62
|
export interface GatewayInfo {
|
|
63
63
|
status: WorkloadRolloutStatus;
|
|
64
64
|
hpa?: HPA | null;
|
|
65
|
+
throughputTracesBytesPerSec?: number | null;
|
|
66
|
+
throughputMetricsBytesPerSec?: number | null;
|
|
67
|
+
throughputLogsBytesPerSec?: number | null;
|
|
65
68
|
resources?: Resources | null;
|
|
66
69
|
imageVersion?: string | null;
|
|
67
70
|
lastRolloutAt?: string | null;
|
|
@@ -72,6 +75,9 @@ export interface GatewayInfo {
|
|
|
72
75
|
export interface NodeCollectoInfo {
|
|
73
76
|
status: WorkloadRolloutStatus;
|
|
74
77
|
nodes?: Nodes | null;
|
|
78
|
+
throughputTracesBytesPerSec?: number | null;
|
|
79
|
+
throughputMetricsBytesPerSec?: number | null;
|
|
80
|
+
throughputLogsBytesPerSec?: number | null;
|
|
75
81
|
resources?: Resources | null;
|
|
76
82
|
imageVersion?: string | null;
|
|
77
83
|
lastRolloutAt?: string | null;
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{bn as ActionKeyTypes,bo as ActionType,eY as AgentInjectedReason,eZ as BooleanOperation,c3 as CloudConnectorFeatureKey,af as CodeAttributesKeyTypes,e_ as ConditionType,b9 as Crud,a9 as CustomInstrumentationsKeyTypes,e$ as DesiredConditionActionItemType,cf as DesiredStateProgress,f0 as DestinationTypes,ba as EntityTypes,bz as ExtractionDataFormat,n as FieldTypes,ab as GolangCustomProbe,ad as HeadersCollectionKeyTypes,y as InputTypes,f1 as InstallationMethod,f2 as InstallationStatus,a8 as InstrumentationRuleType,f3 as IntrumentationStatus,aa as JavaCustomProbe,f4 as JsonOperation,bx as K8sAttributesFrom,bw as K8sResourceKind,f5 as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,f6 as ListDirection,f7 as NumberOperation,f8 as OtelDistroName,f9 as OtherEntityTypes,ae as PayloadCollectionKeyTypes,ac as PhpCustomProbe,P as PlatformType,fa as PodContainerLifecycleStatus,fb as PodContainerStatus,fc as PodPhase,fd as Profile,M as ProgrammingLanguages,fe as SIGNAL_KEY_TO_TYPE,ff as SIGNAL_TYPE_TO_KEY,fg as SignalKey,bt as SignalType,fh as SortDirection,S as StatusType,fi as StringOperation,b as Tier,fj as WorkloadRolloutReason,eD as WorkloadRolloutStatus}from"./chunks/ui-components-BzgG1abD.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{
|
|
1
|
+
export{fk as VISUAL_ODIGOS_LOGO_HEIGHT,fl as VISUAL_ODIGOS_LOGO_WIDTH,V as VisualGreenRings,fm as VisualOdigosLogo,df as VisualPurpleRings}from"./chunks/ui-components-BzgG1abD.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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odigos/ui-kit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.271",
|
|
4
4
|
"author": "Odigos",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"@xyflow/react": "^12.11.2",
|
|
98
|
-
"elkjs": "^0.
|
|
98
|
+
"elkjs": "^0.12.0",
|
|
99
99
|
"javascript-time-ago": "^2.6.4",
|
|
100
100
|
"lottie-react": "^2.4.1",
|
|
101
101
|
"prism-react-renderer": "^2.4.1",
|
|
@@ -103,11 +103,11 @@
|
|
|
103
103
|
"react-dom": "19.2.7",
|
|
104
104
|
"react-error-boundary": "^6.1.2",
|
|
105
105
|
"styled-components": "6.3.12",
|
|
106
|
-
"virtua": "^0.
|
|
106
|
+
"virtua": "^0.50.0",
|
|
107
107
|
"zustand": "^5.0.14"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
|
-
"@apollo/client": "^4.2.
|
|
110
|
+
"@apollo/client": "^4.2.8",
|
|
111
111
|
"@babel/core": "^7.29.7",
|
|
112
112
|
"@babel/preset-env": "^7.29.7",
|
|
113
113
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -119,25 +119,28 @@
|
|
|
119
119
|
"@rollup/plugin-terser": "^1.0.0",
|
|
120
120
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
121
121
|
"@storybook/addon-webpack5-compiler-babel": "^4.0.1",
|
|
122
|
-
"@storybook/react-webpack5": "10.5.
|
|
122
|
+
"@storybook/react-webpack5": "10.5.4",
|
|
123
123
|
"@types/node": "^26.1.1",
|
|
124
124
|
"@types/react": "^19.2.17",
|
|
125
125
|
"@types/react-dom": "^19.2.3",
|
|
126
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
127
|
-
"@typescript-eslint/parser": "^8.
|
|
126
|
+
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
127
|
+
"@typescript-eslint/parser": "^8.65.0",
|
|
128
128
|
"babel-loader": "^10.1.1",
|
|
129
129
|
"babel-plugin-styled-components": "^2.3.0",
|
|
130
130
|
"eslint": "^9.39.4",
|
|
131
131
|
"eslint-plugin-react": "^7.37.5",
|
|
132
|
-
"eslint-plugin-storybook": "10.5.
|
|
132
|
+
"eslint-plugin-storybook": "10.5.4",
|
|
133
133
|
"graphql": "^17.0.2",
|
|
134
|
-
"postcss": "^8.5.
|
|
134
|
+
"postcss": "^8.5.23",
|
|
135
135
|
"rollup": "^4.62.2",
|
|
136
136
|
"rollup-plugin-filesize": "^10.0.0",
|
|
137
137
|
"rollup-plugin-postcss": "^4.0.2",
|
|
138
138
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
139
|
-
"rxjs": "^7.8.
|
|
140
|
-
"storybook": "10.5.
|
|
139
|
+
"rxjs": "^7.8.2",
|
|
140
|
+
"storybook": "10.5.4",
|
|
141
141
|
"typescript": "^5.9.3"
|
|
142
|
+
},
|
|
143
|
+
"resolutions": {
|
|
144
|
+
"postcss": "^8.5.12"
|
|
142
145
|
}
|
|
143
146
|
}
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a,Fragment as t}from"react/jsx-runtime";import{D as l,c as r,F as n,d as i,e as o,f as s,g as c,h as d,B as u,i as p,j as h,k as g,W as m,l as v,m as b,V as f,n as y,o as x,p as k,q as C,r as S,C as T,s as $,u as w,I as M,v as A,w as O,x as L,y as P,z as E,N as I,E as R,S as V,G as N,H as z,U as D,J as X,K as _,L as H,M as q,O as B,Q as j,X as K,Y as U,Z as G,_ as F,$ as W,a0 as J,a1 as Y,a2 as Z,a3 as Q,a4 as ee,T as ae,a5 as te,a6 as le,a7 as re,a8 as ne,a9 as ie,aa as oe,ab as se,ac as ce,ad as de,ae as ue,af as pe,b as he,ag as ge,ah as me,ai as ve,aj as be,ak as fe,al as ye,am as xe,an as ke,ao as Ce,ap as Se,aq as Te,ar as $e,as as we,at as Me,au as Ae,av as Oe,aw as Le,ax as Pe,ay as Ee,az as Ie,aA as Re,aB as Ve,aC as Ne,aD as ze,aE as De,aF as Xe,aG as _e,aH as He,aI as qe,aJ as Be,aK as je,aL as Ke,aM as Ue,aN as Ge,aO as Fe,aP as We,aQ as Je,aR as Ye,aS as Ze,aT as Qe,aU as ea,aV as aa,aW as ta,aX as la,aY as ra,aZ as na,a_ as ia,a$ as oa,b0 as sa,R as ca,b1 as da,b2 as ua,A as pa,b3 as ha,b4 as ga}from"./ui-components-dsTdscIC.js";import{VIcon as ma,TrashIcon as va,PlusIcon as ba,EditIcon as fa,OdigosLogoTextCentral as ya,OdigosLogoTextEnterprise as xa,OdigosLogoTextCommunity as ka,OdigosLogoTextColoredCentral as Ca,OdigosLogoTextColoredEnterprise as Sa,OdigosLogoTextColoredCommunity as Ta,ArrowLeftIcon as $a,ArrowRightIcon as wa,VSquareIcon as Ma,CopyIcon as Aa,YamlIcon as Oa}from"../icons.js";import La,{useMemo as Pa,useRef as Ea,useCallback as Ia,useState as Ra,useEffect as Va,Fragment as Na,forwardRef as za,useImperativeHandle as Da}from"react";import Xa,{css as _a,useTheme as Ha}from"styled-components";import{i as qa,m as Ba,u as ja,n as Ka,a as Ua,C as Ga,b as Fa,d as Wa,e as Ja,f as Ya,g as Za,h as Qa,j as et,k as at}from"./helpers-w7krM8zT.js";const tt=/^[a-zA-Z]$/,lt=new Set(["*","+","?"]),rt=new Set(["^","$"]),nt={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},it=Xa.div`
|
|
2
|
-
padding: 8px 16px;
|
|
3
|
-
border-radius: 6px;
|
|
4
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
5
|
-
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
6
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
7
|
-
font-size: 12px;
|
|
8
|
-
line-height: 20px;
|
|
9
|
-
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
10
|
-
word-break: break-all;
|
|
11
|
-
white-space: pre-wrap;
|
|
12
|
-
user-select: text;
|
|
13
|
-
|
|
14
|
-
/* Wraps the background tightly to each visual fragment when a colored
|
|
15
|
-
token gets split across two visual lines. Without this the highlight
|
|
16
|
-
stretches all the way to the right edge of the container. */
|
|
17
|
-
& > span {
|
|
18
|
-
box-decoration-break: clone;
|
|
19
|
-
-webkit-box-decoration-break: clone;
|
|
20
|
-
}
|
|
21
|
-
`,ot=Xa.span`
|
|
22
|
-
background: ${({$kind:e})=>nt[e]};
|
|
23
|
-
`,st=({pattern:a,"data-id":t})=>{const l=Pa(()=>(e=>{const a=[];let t=0,l=!1;const r=(e,t)=>{const l=a[a.length-1];l&&l.kind===t?l.text+=e:a.push({text:e,kind:t})};for(;t<e.length;){const a=e[t];if(l){if("]"===a){r("]","class-bracket"),l=!1,t++;continue}if("\\"===a&&t+1<e.length){r(e.slice(t,t+2),"class-content"),t+=2;continue}r(a,"class-content"),t++}else{if("("===a&&"?"===e[t+1]){let a=2;const l=e[t+2];if(":"===l||"="===l||"!"===l)a=3;else if("<"===l){const l=e[t+3];if("="===l||"!"===l)a=4;else{const l=e.indexOf(">",t+2);-1!==l&&(a=l-t+1)}}r(e.slice(t,t+a),"group"),t+=a;continue}if("("!==a&&")"!==a)if("["!==a)if(lt.has(a)||rt.has(a))r(a,"anchor-quantifier"),t++;else{if("{"===a){const a=e.indexOf("}",t);if(a>t&&/^\{\d+,?\d*\}$/.test(e.slice(t,a+1))){r(e.slice(t,a+1),"anchor-quantifier"),t=a+1;continue}}if("\\"===a&&t+1<e.length){const a=e[t+1];tt.test(a)?r(e.slice(t,t+2),"anchor-quantifier"):r(e.slice(t,t+2),"literal"),t+=2;continue}"|"!==a?(r(a,"literal"),t++):(r("|","alternation"),t++)}else"^"===e[t+1]?(r("[^","class-bracket"),t+=2):(r("[","class-bracket"),t++),l=!0;else r(a,"group"),t++}}return a})(a),[a]);return e(it,a?{"data-id":t,children:l.map((a,t)=>e(ot,{$kind:a.kind,children:a.text},t))}:{"data-id":t,children:" "})},ct="rgba(102, 191, 255, 0.5)",dt=_a`
|
|
24
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
25
|
-
font-size: 12px;
|
|
26
|
-
line-height: 20px;
|
|
27
|
-
letter-spacing: 0;
|
|
28
|
-
white-space: pre-wrap;
|
|
29
|
-
word-wrap: break-word;
|
|
30
|
-
overflow-wrap: break-word;
|
|
31
|
-
/* tab-size keeps tabs visually consistent across the two layers — some
|
|
32
|
-
browsers default to 8 on a textarea but 4 on a div. */
|
|
33
|
-
-moz-tab-size: 4;
|
|
34
|
-
tab-size: 4;
|
|
35
|
-
margin: 0;
|
|
36
|
-
`,ut=Xa.div`
|
|
37
|
-
position: relative;
|
|
38
|
-
width: 100%;
|
|
39
|
-
min-height: ${({$minHeight:e})=>e}px;
|
|
40
|
-
border-radius: 6px;
|
|
41
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
42
|
-
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
43
|
-
|
|
44
|
-
&:hover,
|
|
45
|
-
&:focus-within {
|
|
46
|
-
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
47
|
-
}
|
|
48
|
-
`,pt=Xa.div`
|
|
49
|
-
${dt}
|
|
50
|
-
position: absolute;
|
|
51
|
-
inset: 0;
|
|
52
|
-
padding: 12px;
|
|
53
|
-
pointer-events: none;
|
|
54
|
-
color: transparent;
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
|
|
57
|
-
/* Mandatory for backgrounds that wrap across visual lines. */
|
|
58
|
-
& > span {
|
|
59
|
-
box-decoration-break: clone;
|
|
60
|
-
-webkit-box-decoration-break: clone;
|
|
61
|
-
}
|
|
62
|
-
`,ht=Xa.textarea`
|
|
63
|
-
${dt}
|
|
64
|
-
position: relative;
|
|
65
|
-
z-index: 1;
|
|
66
|
-
display: block;
|
|
67
|
-
width: 100%;
|
|
68
|
-
min-height: ${({$minHeight:e})=>e}px;
|
|
69
|
-
padding: 12px;
|
|
70
|
-
border: 0;
|
|
71
|
-
background: transparent;
|
|
72
|
-
outline: none;
|
|
73
|
-
resize: vertical;
|
|
74
|
-
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
75
|
-
caret-color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
76
|
-
box-sizing: border-box;
|
|
77
|
-
|
|
78
|
-
&::placeholder {
|
|
79
|
-
color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
80
|
-
}
|
|
81
|
-
`,gt=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),mt=({regex:t,value:l,onChange:r,minHeight:n=240,...i})=>{const o=Ea(null),s=Ea(null),c=Pa(()=>((e,a)=>{if(!e||!a)return gt(a);let t;try{t=new RegExp(e)}catch{return gt(a)}const l=t.exec(a);if(!l)return gt(a);const r=l.index,n=l.index+l[0].length;if(l.length<2||null==l[1])return{before:a.slice(0,r),matchPre:"",capture:a.slice(r,n),matchPost:"",after:a.slice(n)};const i=l[0].indexOf(l[1]),o=i>=0?r+i:r,s=o+l[1].length;return{before:a.slice(0,r),matchPre:a.slice(r,o),capture:a.slice(o,s),matchPost:a.slice(s,n),after:a.slice(n)}})(t,l),[t,l]),d=Ia(()=>{o.current&&s.current&&(o.current.scrollTop=s.current.scrollTop,o.current.scrollLeft=s.current.scrollLeft)},[]);return a(ut,{$minHeight:n,children:[a(pt,{ref:o,"aria-hidden":!0,children:[c.before,e("span",{style:{background:ct},children:c.matchPre}),e("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:c.capture}),e("span",{style:{background:ct},children:c.matchPost}),c.after,l.endsWith("\n")?" ":""]}),e(ht,{ref:s,$minHeight:n,value:l,onChange:e=>r(e.target.value),onScroll:d,spellCheck:!1,...i})]})},vt=Xa.div`
|
|
82
|
-
flex: 1;
|
|
83
|
-
min-height: 0;
|
|
84
|
-
overflow-y: auto;
|
|
85
|
-
`,bt=Xa.div`
|
|
86
|
-
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
87
|
-
border-radius: 8px;
|
|
88
|
-
padding: 8px;
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
gap: 12px;
|
|
92
|
-
`,ft=Xa.div`
|
|
93
|
-
padding: 8px 16px;
|
|
94
|
-
border-radius: 8px;
|
|
95
|
-
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
96
|
-
font-family: ${({theme:e})=>e.font_family.code};
|
|
97
|
-
font-size: 12px;
|
|
98
|
-
line-height: 20px;
|
|
99
|
-
color: ${({theme:e,$tone:a})=>"error"===a?e.v2.colors.red[500]:"match"===a?e.v2.colors.white[500]:e.v2.colors.silver[200]};
|
|
100
|
-
word-break: break-all;
|
|
101
|
-
white-space: pre-wrap;
|
|
102
|
-
user-select: text;
|
|
103
|
-
`,yt=({isOpen:t,regex:m,onClose:v,initialTestString:b=""})=>{const[f,y]=Ra(b),x=Pa(()=>((e,a)=>{if(!e)return{ok:!0,isMatch:!1,message:r.RESULT_EMPTY_REGEX};if(!a)return{ok:!0,isMatch:!1,message:r.RESULT_EMPTY_INPUT};let t;try{t=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:r.RESULT_INVALID_REGEX_FALLBACK}}const l=t.exec(a);return l?{ok:!0,isMatch:!0,message:l.length>1?l[1]:l[0]}:{ok:!0,isMatch:!1,message:r.RESULT_NO_MATCH}})(m,f),[m,f]),k=x.ok?x.isMatch?"match":"neutral":"error";return e(l,{isOpen:t,header:{title:r.TITLE,onClose:()=>{y(""),v()}},children:e(vt,{children:a(bt,{children:[a(n,{$gap:6,children:[e(i,{label:r.REGEX_LABEL}),e(st,{pattern:m,"data-id":"regex-tester-regex"}),!m&&e(o,{size:c.XXS,color:s.Secondary,children:r.REGEX_EMPTY_HINT})]}),a(n,{$gap:6,children:[a(d,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[e(i,{label:r.TEST_STRING_LABEL}),e(u,{"data-id":"regex-tester-unescape",label:r.UNESCAPE_LABEL,tooltip:r.UNESCAPE_TOOLTIP,variant:h.Secondary,size:p.S,onClick:()=>y(e=>(e=>{let a="";for(let t=0;t<e.length;t++){if("\\"===e[t]&&t+1<e.length){const l=e[t+1],r="n"===l?"\n":"t"===l?"\t":"r"===l?"\r":'"'===l?'"':"'"===l?"'":"\\"===l?"\\":null;if(null!=r){a+=r,t++;continue}}a+=e[t]}return a})(e)),disabled:(C=f,!/\\["'\\nrt]/.test(C))})]}),e(mt,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:r.TEST_STRING_PLACEHOLDER,regex:m,value:f,onChange:y,minHeight:240}),e(g,{helpMessage:r.TEST_STRING_HELP})]}),a(n,{$gap:8,children:[e(i,{label:r.RESULT_LABEL}),e(ft,{$tone:k,"data-id":"regex-tester-result",children:x.message}),x.ok&&x.isMatch&&e(o,{size:c.XXS,color:s.Secondary,children:r.RESULT_CAPTURE_HINT})]})]})})});var C},xt=({isOpen:a,onClose:t,onDeny:l,onApprove:r})=>e(m,{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:h.Secondary,onClick:()=>{l?.(),t()}},approveButton:{label:"Discard changes",variant:h.Primary,onClick:()=>{r?.(),t()}}}),kt=({isOpen:a,onClose:t,onViewConnector:l})=>e(m,{isOpen:a,onClose:t,visual:()=>e(f,{scale:1.2,icon:ma}),title:b.CLOUD_CONNECTOR_CREATED_MODAL_TITLE,description:b.CLOUD_CONNECTOR_CREATED_MODAL_DESC,denyButton:{label:v.STAY_ON_CONNECTIONS,variant:h.Secondary,onClick:t},approveButton:{label:v.GO_TO_CONNECTOR_OVERVIEW,variant:h.Primary,onClick:l??t}}),Ct=({isOpen:a,onClose:t,onDeny:l,onApprove:r,action:n="delete",target:i,description:o,overrideApproveButtonLabel:s,overrideDenyButtonLabel:c})=>{const d=n.charAt(0).toUpperCase()+n.substring(1),u=i?.endsWith("s")?"these":"this";return e(m,{title:`${d}${i?` ${i}`:""}?`,description:o??`Are you sure you want to ${n}${i?` ${u} ${i}`:""}?`,isOpen:a,onClose:t,denyButton:{label:c??"Go back",variant:h.Secondary,onClick:()=>{l?.(),t()}},approveButton:{label:s??d,variant:h.Primary,onClick:()=>{r?.(),t()}}})},St=({componentType:a,inputType:t,name:l,label:r,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,value:d,setValue:u,errorMessage:p,warnMessage:h,helpMessage:g,dropdownOptions:m,dropdownNoSearch:v,dropdownNoCheckbox:b,timeUnits:f,timeDefaultUnit:E,toggleSize:I=C.L,keyLabel:R,valueLabel:V})=>{switch(a){case y.Input:return e(L,{name:l,type:t,label:r,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,value:d??"",onChange:e=>{const a=e.target.value;u(t===P.Number?""===a?null:Number(a):a)},errorMessage:p,warnMessage:h,helpMessage:g},l);case y.MultiInput:return e(O,{name:l,label:r,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,values:Array.isArray(d)?d:A(d,[]),setValues:e=>u(e),errorMessage:p,warnMessage:h,helpMessage:g,plain:!0},l);case y.KeyValuePair:return e(M,{name:l,label:r,tooltip:n,badge:i,required:s,disabled:c,limitFieldsPerRow:2,columns:[{keyName:"key",label:R||"Key",placeholder:R||"Key"},{keyName:"value",label:V||"Value",placeholder:V||"Value"}],values:Array.isArray(d)?d:A(d,[]),setValues:e=>u(e),errorMessage:p,warnMessage:h,helpMessage:g},l);case y.TextArea:return e(w,{name:l,label:r,tooltip:n,badge:i,required:s,disabled:c,placeholder:o,value:d??"",onChange:e=>u(e.target.value),errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Dropdown:return e($,{name:l,label:r,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,withSearch:!v,options:m?.map(e=>({id:e.id||"",label:e.label||"",withCheckbox:!b}))||[],values:d?[String(d)]:[],setValues:e=>u(e[0]),errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Checkbox:return e(T,{name:l,label:r,tooltip:n,badge:i,value:!0===d||"true"===d,onChange:e=>u(e),disabled:c,errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Time:return e(S,{name:l,label:r,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,value:d??"",setValue:e=>u(e),units:f,defaultUnit:E,errorMessage:p,warnMessage:h,helpMessage:g},l);case y.Toggle:return e(x,{name:l,size:I,labelAlign:k.Right,label:r,tooltip:n,badge:i,value:!0===d||"true"===d,onChange:e=>u(e),disabled:c,errorMessage:p,warnMessage:h,helpMessage:g},l);default:return null}},Tt=Xa.div`
|
|
104
|
-
display: flex;
|
|
105
|
-
flex-wrap: wrap;
|
|
106
|
-
gap: 8px;
|
|
107
|
-
`,$t=Xa.div`
|
|
108
|
-
display: flex;
|
|
109
|
-
align-items: center;
|
|
110
|
-
gap: 8px;
|
|
111
|
-
padding: 8px 12px;
|
|
112
|
-
border-radius: 8px;
|
|
113
|
-
cursor: pointer;
|
|
114
|
-
background: ${({theme:e,$selected:a})=>a?e.v2.colors.silver[700]:e.v2.colors.silver[800]};
|
|
115
|
-
border: 1px solid ${({theme:e,$selected:a})=>a?e.v2.colors.silver[500]:e.v2.colors.silver[750]};
|
|
116
|
-
|
|
117
|
-
&:hover {
|
|
118
|
-
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
119
|
-
}
|
|
120
|
-
`,wt=Xa.div`
|
|
121
|
-
display: flex;
|
|
122
|
-
width: 32px;
|
|
123
|
-
height: 32px;
|
|
124
|
-
justify-content: center;
|
|
125
|
-
align-items: center;
|
|
126
|
-
flex-shrink: 0;
|
|
127
|
-
`,Mt=Xa.div`
|
|
128
|
-
display: flex;
|
|
129
|
-
flex-direction: column;
|
|
130
|
-
gap: 12px;
|
|
131
|
-
`,At=Xa.div`
|
|
132
|
-
display: flex;
|
|
133
|
-
flex-wrap: wrap;
|
|
134
|
-
gap: 6px;
|
|
135
|
-
`,Ot=Xa.div`
|
|
136
|
-
display: flex;
|
|
137
|
-
align-items: center;
|
|
138
|
-
gap: 8px;
|
|
139
|
-
&::before,
|
|
140
|
-
&::after {
|
|
141
|
-
content: '';
|
|
142
|
-
flex: 1;
|
|
143
|
-
height: 1px;
|
|
144
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
145
|
-
}
|
|
146
|
-
`,Lt=Xa.div`
|
|
147
|
-
padding: 2px 10px;
|
|
148
|
-
border-radius: 999px;
|
|
149
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
150
|
-
border: 1px solid ${({theme:e})=>e.v2.colors.silver[600]};
|
|
151
|
-
`,Pt={[q.JavaScript]:"Node.js",[q.DotNet]:".NET",[q.Php]:"PHP",[q.Java]:"Java",[q.Go]:"Go",[q.Python]:"Python",[q.Ruby]:"Ruby",[q.Rust]:"Rust"},Et=[q.Python,q.Java,q.JavaScript,q.DotNet,q.Php,q.Ruby,q.Go],It=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function Rt(e){return Pt[e]||e.charAt(0).toUpperCase()+e.slice(1)}function Vt(e){return null!=e?`${e}. ${Z}`:Z}const Nt=({readOnly:a,...t})=>e(a?Xt:Ht,{...t}),zt=({title:t,count:l,children:r})=>a(n,{$gap:6,children:[a(d,{$gap:8,$alignItems:"center",children:[e(o,{size:c.XS,color:s.Primary,nowrap:!0,children:t}),l>1&&a(o,{size:c.XXS,color:s.Secondary,nowrap:!0,children:["(",J,")"]})]}),e(At,{children:r})]}),Dt=()=>{const a=Ha();return e(Ot,{children:e(Lt,{children:e(o,{size:c.XXS,color:a.v2.colors.white[500],nowrap:!0,children:Y})})})},Xt=({scopes:t,titleNumber:l})=>{const r=Vt(l);if(qa(t))return e(E,{bgTint:"900",richTitle:{title:r},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(I,{status:V.Default,message:R,fullWidth:!0})});const n=t.sources??[],i=t.namespaces??[],o=t.languages??[],s=[];return n.length&&s.push({kind:"sources",node:e(zt,{title:N,count:n.length,children:n.map((a,t)=>{const l=[a.namespace,a.kind,a.name].filter(Boolean),r=l.length?l.join(" / "):D;return e(z,{label:r},`src-${t}-${r}`)})})}),i.length&&s.push({kind:"namespaces",node:e(zt,{title:X,count:i.length,children:i.map((a,t)=>e(z,{label:a},`ns-${t}-${a}`))})}),o.length&&s.push({kind:"languages",node:e(zt,{title:_,count:o.length,children:o.map((a,t)=>{const l=B(a);return e(z,{label:Rt(a),leftIcon:l},`lang-${t}-${a}`)})})}),e(E,{bgTint:"900",richTitle:{title:r,subTitle:s.length>1?H:void 0},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(E,{bgTint:"800",children:e(Mt,{children:s.map((t,l)=>a(La.Fragment,{children:[l>0&&e(Dt,{}),t.node]},t.kind))})})})},_t=e=>e.sources.length>0?"source":e.namespaces.length>0?"namespace":e.languages.length>0?"language":"all",Ht=({scopes:t,onChange:l,sourceOptions:r=[],namespaceOptions:i=[],supportedLanguages:d,titleNumber:u,dataIdPrefix:p="source-scope",slim:h})=>{const g=t??Ba(),[m,v]=Ra(()=>_t(g)),{sources:b,namespaces:f,languages:y}=g,x=b.length>0||f.length>0||y.length>0;Va(()=>{x&&"all"===m&&v(_t(g))},[x,m]);const k=Pa(()=>It.map(e=>"language"===e.value&&0===d?.length?null:{...e,disabled:"all"===e.value&&x}).filter(Boolean),[x]),C=Pa(()=>b.map(e=>`${e.namespace}/${e.kind}/${e.name}`),[b]),S=Pa(()=>[...f],[f]),$=Pa(()=>new Set(y),[y]),w=Ia(e=>{v(e)},[]),M=Ia(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({...g,sources:a})},[g,l]),A=Ia(e=>{l({...g,namespaces:e})},[g,l]),O=Ia(e=>{const a=g.languages,t=a.includes(e)?a.filter(a=>a!==e):[...a,e];l({...g,languages:t})},[g,l]),L=!x&&"all"===m,P=(d||Et).map(e=>({id:e,label:Pt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:B(e)}));return a(j,{richTitle:h?{title:Vt(u),titleSize:c.XS,titleColor:s.Secondary,tooltip:K}:{title:Vt(u),subTitle:K,subTitleWrap:!0},backgroundColor:h?"transparent":void 0,padding:h?0:void 0,children:[e(I,L?{status:V.Default,message:R,fullWidth:!0,smallIcon:!0}:{status:V.Info,message:H,fullWidth:!0,smallIcon:!0}),e(n,{$alignItems:"flex-start",children:e(U,{options:k,selected:m,setSelected:w})}),"source"===m&&e(G,{multiple:!0,"data-id":`${p}-autocomplete-source`,options:r,value:C,onSelect:M,placeholder:F}),"namespace"===m&&e(G,{multiple:!0,"data-id":`${p}-autocomplete-namespace`,options:i,value:S,onSelect:A,placeholder:"Search namespace"}),"language"===m&&P.length>0&&e(Tt,{children:P.map(({id:t,label:l,Icon:r})=>{const n=$.has(t);return a($t,{$selected:n,onClick:()=>O(t),children:[e(T,{name:`${p}-lang-${t}`,size:W.S,value:n,onChange:()=>O(t)}),e(wt,{children:e(r,{size:20})}),e(o,{size:c.XS,nowrap:!0,children:l})]},t)})})]})},qt=e=>{if(null!=e){if(!Array.isArray(e)&&"object"==typeof e)return Object.entries(e).map(([e,a])=>({id:e,label:null==a?e:String(a)}));if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)}},Bt=e=>{if(!Array.isArray(e)||e.length<3)return;const[a,t,l]=e;return e=>{const r=null==e?.[a]?"":String(e[a]);switch(t){case"=":case"==":case"===":return r===l;case"!=":case"!==":return r!==l;default:return!0}}},jt=e=>{if(Array.isArray(e))return e.map(e=>{const a=e;return{keyName:String(a.keyName??a.name??""),label:a.label??a.displayName,tooltip:a.tooltip,placeholder:a.placeholder,helpMessage:a.helpMessage,componentType:a.componentType,options:qt(a.options??a.values),fullRow:a.fullRow,defaultValue:a.defaultValue,withRegexTester:a.withRegexTester,separator:a.separator,copyByColumn:a.copyByColumn,renderCondition:Bt(a.renderCondition)}})},Kt=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const a=e;return{id:String(a.id??a.keyName??a.name??""),label:a.label??a.displayName??String(a.id??""),tooltip:a.tooltip,fields:Array.isArray(a.fields)?a.fields.map(Ut):void 0}})},Ut=e=>{const a="string"==typeof e.componentProperties?A(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??a.inputType??a.type,title:e.displayName,tooltip:a.tooltip,placeholder:a.placeholder,helpMessage:a.helpMessage,required:a.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:qt(a.options??a.values),itemWrapperKey:a.itemWrapperKey,columns:jt(a.columns),limitFieldsPerRow:a.limitFieldsPerRow,variant:a.variant,wrapKey:a.wrapKey,checkboxOptions:Kt(a.options??a.values),checkedValue:a.checkedValue??"true",valueMode:a.valueMode??"object",fields:Array.isArray(a.fields)?a.fields.map(Ut):void 0,addLabel:a.addLabel,itemLabel:a.itemLabel,keyLabel:a.titleKey??a.keyLabel,valueLabel:a.titleValue??a.valueLabel,persistAs:a.persistAs}},Gt=e=>{const a=e.initialValue;if(void 0!==a&&""!==a)return e.componentType===y.CheckboxList?"array"===e.valueMode?A(a,[]):A(a,{}):e.componentType!==y.MultiInput&&e.componentType!==y.MultiTabledInput||!e.wrapKey?e.componentType===y.MultiInput||e.componentType===y.MultiTabledInput?A(a,[]):e.componentType===y.SourceScopes?"null"===a||"{}"===a?Ba():Ka(A(a,null)):a:{[e.wrapKey]:A(a,[])}},Ft=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Wt=e=>Array.isArray(e)?e:[],Jt=e=>{const a={};return e.forEach(e=>{a[String(e.key??"")]=String(e.value??"")}),a},Yt=e=>Ft(e)?Object.entries(e).map(([e,a])=>({key:e,value:String(a??"")})):[],Zt=({field:a,value:t,setValue:l,errorMessage:r,disabled:n})=>{const[i,o]=Ra(()=>Yt(t));return Va(()=>{const e=Ft(t)?t:{};((e,a)=>{const t=Object.keys(e),l=Object.keys(a);return t.length===l.length&&t.every(t=>Object.prototype.hasOwnProperty.call(a,t)&&a[t]===e[t])})(Jt(i),e)||o(Yt(t))},[t]),e(M,{name:a.name,label:a.title,tooltip:a.tooltip,helpMessage:a.helpMessage,required:a.required,disabled:n,limitFieldsPerRow:2,columns:[{keyName:"key",label:a.keyLabel||"Key",placeholder:a.keyLabel||"Key"},{keyName:"value",label:a.valueLabel||"Value",placeholder:a.valueLabel||"Value"}],values:i,setValues:e=>{o(e),l(Jt(e))},errorMessage:r})},Qt=({field:l,value:r,setValue:d,errorMessage:u,disabled:p,keyValuePersistAs:h,sourceOptions:m,namespaceOptions:v})=>{const{name:b,componentType:f,inputType:x,title:k,tooltip:C,placeholder:S,helpMessage:$,required:w,initialValue:A,options:L,itemWrapperKey:P,columns:E,limitFieldsPerRow:I,variant:R,wrapKey:V,checkboxOptions:N}=l,[z,D]=Ra({open:!1,value:""});if(f===y.SourceScopes)return e(Nt,{scopes:Ka(r),onChange:e=>d(e),sourceOptions:m,namespaceOptions:v,dataIdPrefix:`dynamic-field-${b}`,slim:!0});if(f===y.CheckboxList&&"array"===l.valueMode){const t=Wt(r),l=(e,a)=>d(a?[...t.filter(a=>a!==e),e]:t.filter(a=>a!==e));return a(n,{$gap:12,children:[k&&e(i,{label:k,tooltip:C,required:w}),e(n,{$gap:8,children:(N||[]).map(a=>{const r=e(T,{name:a.id,label:a.label,value:t.includes(a.id),disabled:p,onChange:e=>l(a.id,e)},a.id);return a.tooltip?e(ae,{text:a.tooltip,withIcon:!0,children:r},a.id):r})}),e(g,{errorMessage:u,helpMessage:$})]})}if(f===y.CheckboxList){const t=Ft(r)?r:{},i=(e=>"emptyObject"!==e.checkedValue||{})(l),m=e=>"emptyObject"===l.checkedValue?Ft(e):!!e;return a(n,{$gap:12,children:[k&&e(o,{size:c.XS,color:s.Secondary,nowrap:!0,children:k}),e(n,{$gap:12,children:(N||[]).map(l=>{const r=t[l.id],o=m(r),s=Ft(r)?r:{},c=e(T,{label:l.label,value:o,disabled:p,onChange:e=>d({...t,[l.id]:e?Ft(r)?r:i:null})}),u=l.tooltip?e(ae,{text:l.tooltip,withIcon:!0,children:c}):c,g=o&&l.fields?.length?e(n,{$gap:12,$padding:"0 0 0 24px",children:l.fields.map(a=>e(Qt,{field:a,value:s[a.name],setValue:e=>d({...t,[l.id]:{...s,[a.name]:e}}),disabled:p,keyValuePersistAs:h},`${b}-${l.id}-${a.name}`))}):null;return a(n,{$gap:12,children:[u,g]},l.id)})}),e(g,{errorMessage:u,helpMessage:$})]})}if(f===y.MultiTabledInput){const l=Wt(V?r?.[V]:r),n=e=>d(V?{...Ft(r)?r:{},[V]:e}:e),i=(E||[]).some(e=>e.withRegexTester);return a(t,{children:[e("cards"===R?te:M,{name:b,label:k,tooltip:C,helpMessage:$,required:w,disabled:p,columns:E||[],limitFieldsPerRow:I,values:l,setValues:n,errorMessage:u,onTestRegex:i?e=>D({open:!0,value:e}):void 0}),i&&e(yt,{isOpen:z.open,regex:z.value,onClose:()=>D({open:!1,value:""})})]})}if(f===y.MultiInput&&V){const a=Wt(r?.[V]);return e(O,{name:b,label:k,tooltip:C,helpMessage:$,required:w,disabled:p,placeholder:S,values:a,setValues:e=>d({...Ft(r)?r:{},[V]:e}),errorMessage:u})}if(f===y.MultiInput&&P){const a=Wt(r).map(e=>String(e?.[P]??""));return e(O,{name:b,label:k,tooltip:C,helpMessage:$,required:w,disabled:p,placeholder:S,values:a,setValues:e=>d(e.map(e=>({[P]:e}))),errorMessage:u})}return f===y.KeyValuePair?"map"===(l.persistAs??h)?e(Zt,{field:l,value:r,setValue:d,errorMessage:u,disabled:p}):e(St,{componentType:f,name:b,label:k,tooltip:C,helpMessage:$,disabled:p,required:w,errorMessage:u,keyLabel:l.keyLabel,valueLabel:l.valueLabel,value:r??[],setValue:d}):e(St,{componentType:f,inputType:x,name:b,label:k,tooltip:C,helpMessage:$,disabled:p,required:w,placeholder:S,errorMessage:u,dropdownOptions:L,value:(null==r?A:r)??"",setValue:d})},el=({field:l,value:r,setValue:o,disabled:s,keyValuePersistAs:c,sourceOptions:g,namespaceOptions:m})=>{const v=Ha(),b=Wt(r),f=b.length?b:[{}],y=l.fields||[],x=e=>o(e);return a(t,{children:[f.map((t,r)=>a(Na,{children:[e(ee,{}),a(n,{$gap:12,children:[a(d,{$justifyContent:"space-between",$alignItems:"center",children:[e(i,{label:`${l.itemLabel||l.title||"Item"} ${r+1}`}),e(u,{leftIcon:()=>e(va,{fill:v.v2.colors.red[500]}),variant:h.Secondary,size:p.S,onClick:()=>(e=>{const a=f.filter((a,t)=>t!==e);x(a)})(r),disabled:s||1===f.length})]}),y.map(a=>e(Qt,{field:a,value:t[a.name],setValue:e=>((e,a,t)=>x(f.map((l,r)=>r===e?{...l,[a]:t}:l)))(r,a.name,e),disabled:s,keyValuePersistAs:c,sourceOptions:g,namespaceOptions:m},`${l.name}-group-${r}-${a.name}`))]})]},`${l.name}-group-${r}`)),e(u,{variant:h.Secondary,label:l.addLabel||"Add",leftIcon:ba,onClick:()=>x([...f,{}]),disabled:s}),e(ee,{})]})},al=({field:t,value:l,setValue:r,errorMessage:o,disabled:s})=>a(n,{$gap:12,children:[t.title&&e(i,{label:t.title,tooltip:t.tooltip,required:t.required}),e(n,{$gap:8,children:(t.checkboxOptions||[]).map(a=>{const t=e(T,{name:a.id,label:a.label,value:!0===l?.[a.id],disabled:s,onChange:e=>r(a.id,e)},a.id);return a.tooltip?e(ae,{text:a.tooltip,withIcon:!0,children:t},a.id):t})}),e(g,{errorMessage:o,helpMessage:t.helpMessage})]}),tl=({signals:a,fields:l,value:r,setValue:n,formErrors:i,disabled:o,seedInitialValues:s,keyValuePersistAs:c="map",sourceOptions:d,namespaceOptions:u})=>{const{isVm:p}=ja(),h=(l||[]).filter(e=>!!e).map(e=>Ut(e));return Va(()=>{if(!s)return;const e=r||{},a={};h.forEach(t=>{if(t.componentType===y.SourceScopes&&p)return;const l=t.componentType===y.SourceScopes?Gt(t)??Ba():Gt(t);if(void 0===l)return;if(t.componentType===y.CheckboxList&&"flatFields"===t.valueMode&&Ft(l))return void Object.entries(l).forEach(([t,l])=>{void 0!==e[t]&&null!==e[t]||(a[t]=l)});const r=e[t.name];if(t.componentType===y.SourceScopes){if(void 0!==r)return}else if(null!=r)return;a[t.name]=Ft(l)&&Ft(a[t.name])?{...a[t.name],...l}:l}),Object.entries(a).forEach(([e,a])=>n(e,a))},[]),e(t,{children:h.map(t=>{const l=Object.entries(r||{}).map(([e,a])=>({name:e,key:e,value:a}));if(t.renderCondition&&!Q(t.renderCondition,a,l))return null;if(t.componentType===y.SourceScopes&&p)return null;const s=r?.[t.name];if(t.componentType===y.FieldGroup)return e(el,{field:t,value:s,setValue:e=>n(t.name,e),disabled:o,keyValuePersistAs:c,sourceOptions:d,namespaceOptions:u},t.name);if(t.componentType===y.CheckboxList&&"flatFields"===t.valueMode){const a=t.checkboxOptions?.map(e=>i[e.id]).find(Boolean);return e(al,{field:t,value:r||{},setValue:n,errorMessage:a,disabled:o},t.name)}return e(Qt,{field:t,value:s,setValue:e=>n(t.name,e),errorMessage:i[t.name],disabled:o,keyValuePersistAs:c,sourceOptions:d,namespaceOptions:u},t.name)})})},ll=tl,rl=Xa.div`
|
|
152
|
-
display: flex;
|
|
153
|
-
align-items: center;
|
|
154
|
-
gap: 24px;
|
|
155
|
-
padding: 8px 16px;
|
|
156
|
-
border-radius: 12px;
|
|
157
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
158
|
-
`,nl=Xa.div`
|
|
159
|
-
flex: 1;
|
|
160
|
-
min-width: 0;
|
|
161
|
-
white-space: pre;
|
|
162
|
-
overflow-x: auto;
|
|
163
|
-
`,il=({title:t,summary:l,onEdit:r,renderAction:n})=>{const i=Pa(()=>{const e=[];return t&&(e.push({text:t,variant:Ua.Default}),e.push({text:" - ",variant:Ua.Default})),e.push(...l),e},[t,l]);return a(rl,{children:[e(nl,{children:e(Ga,{parts:i})}),n&&n(),r&&e(u,{"data-id":"sampling-btn-edit-auto-rule",label:le,rightIcon:fa,variant:h.Text,size:p.S,onClick:r})]})},ol={[de.HttpRequest]:"HTTP request",[de.HttpResponse]:"HTTP response",[de.DbQuery]:"DB query",[de.Messaging]:"messaging"};function sl(e,a,t){return 1===e?a:t??`${a}s`}function cl(e,a){const t=[],l=e.slice(0,3),r=e.slice(3);return l.forEach((e,l)=>{l>0&&t.push({text:", ",variant:Ua.Default}),t.push({text:e,variant:a})}),r.length>0&&t.push({text:` + ${r.length} more`,variant:Ua.Default,tooltipItems:r}),t}const dl=({option:a,formState:t,renderAction:l})=>{const r=Pa(()=>{const e=function(e,a){switch(e){case ne.CodeAttributes:return(e=>{const a=Object.values(ue).filter(a=>!!e.codeAttributes?.[a]).map(e=>pe(e).toLowerCase());return a.length?[{text:"Collect",variant:Ua.Action},{text:" ",variant:Ua.Default},...cl(a,Ua.Endpoint)]:null})(a);case ne.PayloadCollection:return(e=>{const a=Object.values(de).filter(a=>null!=e.payloadCollection?.[a]).map(e=>ol[e]);return a.length?[{text:"Collect",variant:Ua.Action},{text:" ",variant:Ua.Default},...cl(a,Ua.Endpoint)]:null})(a);case ne.HeadersCollection:return(e=>{const a=(e.headersCollection?.[ce.HeaderKeys]??[]).map(e=>e.trim()).filter(e=>e.length>0);if(!a.length)return null;const t=sl(a.length,"HTTP header");return[{text:`Collect ${a.length} ${t}`,variant:Ua.Action},{text:"",variant:Ua.Default,tooltipItems:a}]})(a);case ne.CustomInstrumentation:return(e=>{const a=(e.customInstrumentations?.[ie.Java]??[]).map(e=>new oe(e.className,e.methodName)).filter(e=>e.Verify()),t=(e.customInstrumentations?.[ie.Golang]??[]).map(e=>new se(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 ${sl(a.length,"probe")}`),t.length&&l.push(`${t.length} Go ${sl(t.length,"probe")}`);const r=[...a.map(e=>`Java: ${e.toString()}`),...t.map(e=>`Go: ${e.toString()}`)];return[{text:`Apply ${l.join(" + ")}`,variant:Ua.Action},{text:"",variant:Ua.Default,tooltipItems:r}]})(a);default:return null}}(a?.type,t);return e?[...e,...Fa(t.sourceScopes)]:[]},[a?.type,t]),n=0===r.length;return e(il,{title:n?re:"Instrumentation Rule Preview",summary:r,renderAction:l})},ul=({size:a=200,central:t=!1,useInline:l=!1})=>{const{tier:r}=ja();if(l){if(t)return e(ya,{size:a});switch(r){case he.Community:return e(ka,{size:a});case he.Onprem:return e(xa,{size:a});default:return null}}if(t)return e(Ca,{size:a});switch(r){case he.Community:return e(Ta,{size:a});case he.Onprem:return e(Sa,{size:a});default:return null}},pl=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],hl=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],gl=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],ml=({description:t,options:l,selected:r,onSelect:o,customName:s,customLabel:c,customPlaceholder:u,customValue:p,onCustomChange:h,customInputType:g=P.Number,customMin:m,customMax:v})=>a(n,{$gap:6,children:[e(i,{label:t}),a(d,{$gap:8,$alignItems:"flex-end",children:[e(U,{options:l,selected:r,setSelected:o}),"custom"===r&&e(L,{name:s,label:c,placeholder:u,type:g,value:p,onChange:h,width:160,min:m,max:v})]})]}),vl=()=>{},bl=a=>a.readOnly?e(fl,{rule:a.rule}):e(yl,{ruleType:a.ruleType,formState:a.formState,onChange:a.onChange}),fl=({rule:t})=>{const l=null!=t.durationAtLeastMs;return t.error?e(j,{richTitle:{title:ge},children:e(x,{name:"sampling-view-toggle-keep-errors",onChange:vl,value:!0,size:C.S,label:me,labelAlign:k.Right})}):l?e(j,{richTitle:{title:ve},children:a("div",{children:[e(o,{size:c.XXXS,color:s.Secondary,children:be}),e(o,{size:c.XS,children:`${t.durationAtLeastMs}ms`})]})}):null},yl=({ruleType:a,formState:t,onChange:l})=>{const r=Ia(e=>l({durationPreset:e}),[l]),n=Ia(e=>l({customDurationMs:e.target.value}),[l]);return"Duration"===a?e(j,{richTitle:{title:ve,subTitle:fe},children:e(ml,{description:be,options:gl,selected:t.durationPreset,onSelect:r,customName:"sampling-input-custom-duration",customLabel:ye,customPlaceholder:"200ms",customValue:t.customDurationMs,onCustomChange:n})}):null},xl=Xa.div`
|
|
164
|
-
display: flex;
|
|
165
|
-
gap: 32px;
|
|
166
|
-
`,kl=Xa.div`
|
|
167
|
-
display: flex;
|
|
168
|
-
flex-direction: column;
|
|
169
|
-
gap: 4px;
|
|
170
|
-
`,Cl=Xa.div`
|
|
171
|
-
display: flex;
|
|
172
|
-
flex-wrap: wrap;
|
|
173
|
-
align-items: flex-end;
|
|
174
|
-
gap: 16px;
|
|
175
|
-
`,Sl=Xa.div`
|
|
176
|
-
display: flex;
|
|
177
|
-
align-items: flex-end;
|
|
178
|
-
gap: 16px;
|
|
179
|
-
padding: 12px 16px;
|
|
180
|
-
border-radius: 8px;
|
|
181
|
-
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
182
|
-
`,Tl=Xa.div`
|
|
183
|
-
display: flex;
|
|
184
|
-
align-items: flex-end;
|
|
185
|
-
gap: 10px;
|
|
186
|
-
flex: 1;
|
|
187
|
-
`,$l=Xa.div`
|
|
188
|
-
display: flex;
|
|
189
|
-
align-items: center;
|
|
190
|
-
height: 32px;
|
|
191
|
-
`,wl=Xa.div`
|
|
192
|
-
display: flex;
|
|
193
|
-
align-items: flex-end;
|
|
194
|
-
gap: 16px;
|
|
195
|
-
margin-bottom: 12px;
|
|
196
|
-
`,Ml="Any",Al="Kafka topic",Ol=()=>e("div",{style:{marginBottom:"8px"},children:e(o,{size:c.XS,weight:500,children:"And"})}),Ll=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Pl=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],El=[{id:"",label:Ml},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}],Il=a=>a.readOnly?e(Rl,{data:a.data}):e(Vl,{category:a.category,formState:a.formState,onChange:a.onChange}),Rl=({data:t})=>{const l=Pa(()=>(e=>{if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:Re,value:Ie},{id:"route",title:Me,value:a.httpServer.route||a.httpServer.routePrefix||Ve},{id:"method",title:Pe,value:a.httpServer.method||Ml}];if(a?.httpClient){const e=[{id:"type",title:Re,value:Ne}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:Me,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||Ve}),e.push({id:"method",title:Pe,value:a.httpClient.method||Ml}),e}return[{id:"type",title:Re,value:ze}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:Re,value:Ie},{id:"route",title:Me,value:a.httpServer.route||a.httpServer.routePrefix||Ve},{id:"method",title:Pe,value:a.httpServer.method||Ml}]:a?.kafkaConsumer?[{id:"type",title:Re,value:De},{id:"topic",title:Al,value:a.kafkaConsumer.kafkaTopic||Ve}]:a?.kafkaProducer?[{id:"type",title:Re,value:Xe},{id:"topic",title:Al,value:a.kafkaProducer.kafkaTopic||Ve}]:[{id:"type",title:Re,value:ze}]})(t),[t]);return e(j,{richTitle:{title:xe},children:e(xl,{children:l.map(({id:t,title:l,value:r})=>a(kl,{children:[e(o,{size:c.XXXS,color:s.Secondary,nowrap:!0,children:l}),e(o,{size:c.XS,nowrap:!0,children:r})]},t))})})},Vl=({category:t,formState:l,onChange:r})=>{const i=Pa(()=>"noisy"===t?Ll:Pl,[t]),o=Ia(e=>r({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[r]),s=Ia(e=>a=>{a&&r({routeType:e,route:""})},[r]),c=Ia(e=>r({route:e.target.value}),[r]),d=Ia(e=>r({serverAddress:e.target.value}),[r]),u=Ia(e=>r({method:e[0]||""}),[r]),g=Ia(e=>r({kafkaTopic:e.target.value}),[r]),m="httpServer"===l.operationType||"httpClient"===l.operationType,v="kafkaConsumer"===l.operationType||"kafkaProducer"===l.operationType,b="httpClient"===l.operationType?we:Me,f="httpClient"===l.operationType?Ae:Oe;return a(j,{richTitle:{title:`2. ${xe}`,subTitle:ke},children:[e(n,{$alignItems:"flex-start",children:e(U,{options:i,selected:l.operationType,setSelected:o})}),m&&a(Cl,{children:["httpClient"===l.operationType&&a(wl,{children:[e(L,{name:"sampling-input-server-address",label:Se,placeholder:Ce,value:l.serverAddress,onChange:d}),e(Ol,{})]}),a(Sl,{children:[a(Tl,{children:[e($l,{children:e(Te,{"data-id":"sampling-radio-route",value:"route"===l.routeType,onChange:s("route")})}),e(L,{name:"sampling-input-route",label:b,placeholder:$e,value:"route"===l.routeType?l.route:"",onChange:c,disabled:"route"!==l.routeType})]}),a(Tl,{children:[e($l,{children:e(Te,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===l.routeType,onChange:s("routePrefix")})}),e(L,{name:"sampling-input-route-prefix",label:f,placeholder:$e,value:"routePrefix"===l.routeType?l.route:"",onChange:c,disabled:"routePrefix"!==l.routeType})]})]}),a(wl,{children:[e(Ol,{}),e(Le,{label:Pe,items:El,selectedIds:[l.method||""],setSelectedIds:e=>u(e),buttonProps:{"data-id":"sampling-btn-method",label:El.find(e=>e.id===l.method)?.label||Ml,size:p.S,variant:h.Secondary}})]})]}),v&&e(L,{name:"sampling-input-kafka-topic",label:Ee,placeholder:"Type kafka topic",value:l.kafkaTopic,onChange:g,width:"320px"})]})},Nl=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],zl=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}],Dl=a=>a.readOnly?e(Xl,{data:a.data}):e(_l,{category:a.category,formState:a.formState,onChange:a.onChange}),Xl=({data:t})=>{const l=Pa(()=>(e=>{switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:He,method:je,description:qe,value:`${e.rule.percentageAtLeast}%`}:{title:He,method:Ue,description:null,value:null};case"noisy":return Wa(e.rule.percentageAtMost)?{title:He,method:Ke,description:null,value:null}:{title:He,method:je,description:Be,value:`${e.rule.percentageAtMost}%`};case"costReduction":return{title:He,method:je,description:Be,value:`${e.rule.percentageAtMost}%`}}})(t),[t]),r=[{id:"method",title:Pe,value:l.method},...null!=l.description?[{id:"value",title:l.description,value:l.value}]:[]];return e(j,{richTitle:{title:l.title},children:e(xl,{children:r.map(({id:t,title:l,value:r})=>a(kl,{children:[e(o,{size:c.XXXS,color:s.Secondary,nowrap:!0,children:l}),e(o,{size:c.XS,nowrap:!0,children:r})]},t))})})},_l=({category:t,formState:l,onChange:r})=>{const i="highlyRelevant"===t,o=i?zl:Nl,s=`${i?4:3}. ${He}`,c=_e[t],d=i?qe:Be,u="noisy"===t?hl:pl,p=Ia(e=>r({percentageMode:e}),[r]),h=Ia(e=>r({percentagePreset:e}),[r]),g=Ia(e=>r({customPercentage:e.target.value}),[r]);return a(j,{richTitle:{title:s,subTitle:c},children:["costReduction"!==t&&e(n,{$alignItems:"flex-start",children:e(U,{options:o,selected:l.percentageMode,setSelected:p})}),("costReduction"===t||"sample"===l.percentageMode)&&e(ml,{description:d,options:u,selected:l.percentagePreset,onSelect:h,customName:"sampling-input-custom-percentage",customPlaceholder:"5%",customValue:l.customPercentage,onCustomChange:g,customInputType:P.Decimal,customMin:0,customMax:100})]})},Hl=Xa.div`
|
|
197
|
-
display: flex;
|
|
198
|
-
align-items: flex-end;
|
|
199
|
-
gap: 16px;
|
|
200
|
-
`,ql=Xa.div`
|
|
201
|
-
width: 280px;
|
|
202
|
-
flex-shrink: 0;
|
|
203
|
-
`,Bl=Xa.div`
|
|
204
|
-
flex: 1;
|
|
205
|
-
min-width: 0;
|
|
206
|
-
`;function jl(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":ea[e.category]}const Kl=a=>a.readOnly?e(Ul,{data:a.data}):e(Gl,{formState:a.formState,onChange:a.onChange}),Ul=({data:t})=>{const l=Pa(()=>[{id:"name",title:Fe,value:t.rule.name||Ge},{id:"type",title:We,value:jl(t)}],[t]),r=t.rule.notes||Ve;return a(j,{children:[e(xl,{children:l.map(({id:t,title:l,value:r})=>a(kl,{children:[e(o,{size:c.XXXS,color:s.Secondary,nowrap:!0,children:l}),e(o,{size:c.XS,nowrap:!0,children:r})]},t))}),a(kl,{children:[e(o,{size:c.XXXS,color:s.Secondary,children:Je}),e(o,{size:c.XS,children:r})]})]})},Gl=({formState:t,onChange:l})=>{const r=Ia(e=>l({name:e.target.value}),[l]),n=Ia(e=>l({notes:e.target.value}),[l]);return e(j,{children:a(Hl,{children:[e(ql,{children:e(L,{name:"sampling-input-rule-name",label:Fe,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:Ye,value:t.name,onChange:r})}),e(Bl,{children:e(L,{name:"sampling-input-note",label:Je,tooltip:Qe,placeholder:Ze,value:t.notes,onChange:n})})]})})},Fl=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],Wl=({formState:a,onChange:t})=>{const l=Ia(e=>t({ruleType:e,keepErrors:"Error"===e}),[t]);return e(j,{richTitle:{title:`3. ${We}`,subTitle:aa},children:e(n,{$alignItems:"flex-start",children:e(U,{options:Fl,selected:a.ruleType,setSelected:l})})})},Jl=a=>{const t=Pa(()=>{if(a.readOnly)return a.summary;switch(a.category){case"noisy":return Za(at(a.formState));case"highlyRelevant":return Ya(et(a.formState));case"costReduction":return Ja(Qa(a.formState))}},[a]);if(a.readOnly)return e(il,{title:ta,summary:t,renderAction:a.renderAction});const l=1===t.length&&"default"===t[0].variant;return e(il,{title:l?re:ta,summary:l?[]:t,renderAction:a.renderAction})},Yl=(e,a)=>!a?.length||!!a?.find(a=>a===e),Zl=({title:t="Signals",required:l,errorMessage:r,allowedSignals:o,selectedSignals:s,setSelectedSignals:c,disabled:u})=>{const[p,h]=Ra(1===s.length),m=Ea(JSON.stringify(s));return Va(()=>{let e=la(s).filter(e=>Yl(e,o));e.length||(e=ra.filter(({id:e})=>Yl(e,o)).map(({id:e})=>e));const a=JSON.stringify(e);m.current!==a&&(m.current=a,c(e),h(1===e.length))},[o,s]),a(n,{$gap:12,children:[e(i,{label:t,required:l}),e(d,{$gap:12,children:ra.map(a=>{const t=Yl(a.id,o),l=((e,a)=>!!a?.find(a=>a===e))(a.id,s);return t?e(T,{label:a.value,disabled:u||!t||p&&l,value:l,onChange:e=>((e,a)=>{const t=e,l=a?[...s,t]:s.filter(e=>e!==t);c(l),h(1===l.length)})(a.id,e)},a.id):null})}),e(g,{errorMessage:r})]})},Ql=({minSupportedVersion:a,currentVersion:t})=>e(m,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>e(f,{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}.`}),er=Xa.div`
|
|
207
|
-
display: flex;
|
|
208
|
-
flex-direction: column;
|
|
209
|
-
justify-content: flex-end;
|
|
210
|
-
width: ${({$width:e})=>e};
|
|
211
|
-
gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
|
|
212
|
-
`,ar=Xa.div`
|
|
213
|
-
display: flex;
|
|
214
|
-
align-items: center;
|
|
215
|
-
min-height: 24px;
|
|
216
|
-
padding: 12px;
|
|
217
|
-
border-radius: 16px 16px 0 0;
|
|
218
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
219
|
-
`,tr=Xa.div`
|
|
220
|
-
display: flex;
|
|
221
|
-
flex-direction: column;
|
|
222
|
-
gap: ${({$gap:e})=>e}px;
|
|
223
|
-
padding: 12px 12px 0 12px;
|
|
224
|
-
width: 100%;
|
|
225
|
-
height: ${({$heightOffset:e,$columnHasHeader:a})=>`calc(100vh - 180px - ${e}px ${a?"- 48px":""})`};
|
|
226
|
-
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"};
|
|
227
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
228
|
-
overflow-y: auto;
|
|
229
|
-
overflow-x: hidden;
|
|
230
|
-
`,lr=({isLeft:l,isRight:r,heightOffset:n=0,width:i,header:o,list:s})=>a(er,{$width:i,$columnHasHeader:!!o,children:[o&&e(ar,{children:o}),e(tr,{$gap:8,$isLeft:l,$isRight:r,$heightOffset:n,$columnHasHeader:!!o,children:s.length?s.length>1?e(na,{gap:8,elements:s}):e(t,{children:s[0]}):e(ia,{$height:"100%",children:e(oa,{})})})]}),rr="75vw",nr=Xa.div`
|
|
231
|
-
display: flex;
|
|
232
|
-
flex-direction: column;
|
|
233
|
-
border-radius: 16px;
|
|
234
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
235
|
-
overflow: hidden;
|
|
236
|
-
`,ir=Xa.div`
|
|
237
|
-
display: flex;
|
|
238
|
-
gap: 12px;
|
|
239
|
-
padding: 16px 16px 0 16px;
|
|
240
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
241
|
-
position: sticky;
|
|
242
|
-
top: 0;
|
|
243
|
-
`,or=Xa.div`
|
|
244
|
-
padding: 12px 12px 0 12px;
|
|
245
|
-
`,sr=Xa.div`
|
|
246
|
-
display: flex;
|
|
247
|
-
gap: 12px;
|
|
248
|
-
padding: 16px;
|
|
249
|
-
`,cr=Xa.div`
|
|
250
|
-
padding: 5vh 10vw;
|
|
251
|
-
border-radius: 12px;
|
|
252
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
253
|
-
`,dr=za(({isOpen:t,withOverlay:r,disableAnimation:n,onClose:i,onBack:o,onNext:s,nextIsSkip:d,onSave:u,disableSave:p,connectionIds:g,header:v,subHeader:b,leftColumn:f,rightColumn:y,search:x,filters:k,errorMessage:C,isFormDirty:S,hideDirtyNote:T,isFetching:$,progress:w},M)=>{const[A,O]=Ra(!1),[L,P]=Ra(!1),[E,I]=Ra(void 0);Da(M,()=>({clearErrors:()=>I(void 0)}));const R=L,N=Ia(()=>{S&&!A?O(!0):(O(!1),i?.())},[S,A,i]),z=p||L||"boolean"==typeof S&&!S,D=Ia(async()=>{P(!0);const e=await u();P(!1),!1!==e&&(e?.error?I(e.error):(g?.setValue([]),i?.()))},[u,g,i]),X=!!x||!!g||!!k,_=!!b,H=(X?48:0)+(_?50:0),q=Pa(()=>$?{status:V.Info,message:"Fetching Data..."}:L&&!w?{status:V.Info,message:"Saving Changes..."}:E||C?{status:V.Error,message:E||C}:"boolean"==typeof S&&S&&!T?{status:V.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:void 0,[$,L,w,E,C,S,T]),B=Pa(()=>o?{label:"Back",leftIcon:$a,variant:h.Secondary,onClick:o}:{label:"Cancel",variant:h.Secondary,onClick:N,disabled:R},[o,N,R]),[j,K]=Ra(!1),U=Pa(()=>s?d?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:wa,variant:h.Secondary,onClick:()=>K(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:wa,variant:h.Primary,onClick:s}:{"data-id":"wide-drawer-save",label:"Save",variant:h.Primary,onClick:D,disabled:z},[s,d,D,z]);return a(l,{width:rr,isOpen:t,disableAnimation:n,hideOverlay:!L&&!r,header:{...v,onClose:i?N:void 0,onCloseDisabled:R},footer:{note:q,actions:[B,U]},children:[L?e(ia,{$height:"calc(100vh - 136px)",children:e(cr,{children:e(sa,{titleSize:c.S,subTitleSize:c.XXXS,withGradient:!0,withSpinner:!0,...w})})}):a(nr,{children:[X&&a(ir,{children:[g&&e(ca,{icon:Ma,title:"Selected Clusters",badge:{label:g.value.length}}),x&&e(da,{width:"100%",...x}),k]}),_&&e(or,{children:e(ca,{icon:b.icon,title:b.title,subTitle:b.description,badge:b.badge})}),a(sr,{children:[e(lr,{isLeft:!0,heightOffset:H,...f}),e(lr,{isRight:!0,heightOffset:H,...y})]})]}),e(xt,{isOpen:A,onClose:()=>O(!1),onApprove:N}),e(m,{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:j,onClose:()=>K(!1),denyButton:{label:"Go Back",variant:h.Secondary,onClick:()=>K(!1)},approveButton:{label:"Skip",variant:h.Primary,onClick:()=>{s?.(),K(!1)}}})]})});dr.displayName=dr.name;const ur=Xa.div`
|
|
254
|
-
padding: 0 24px;
|
|
255
|
-
border-radius: 12px;
|
|
256
|
-
background-color: ${({$codeBgColor:e})=>e||"transparent"};
|
|
257
|
-
`,pr=({title:a="YAML",yaml:t,defaultOpen:l,fullHeight:r,bgTint:n="1000",codeBgColor:i})=>{const{clickCopy:o,isCopied:s}=ua(),c=Pa(()=>t?[{id:ha(),type:pa.Button,buttonProps:{variant:h.Text,size:p.S,leftIcon:s?ma:Aa,onClick:()=>o(t||""),disabled:s}}]:[],[t,s]);return e(E,{bgTint:n,richTitle:{icon:Oa,title:a},actions:c,withCollapse:!0,collapseIsDefaultOpen:l,fullHeight:r,children:e(ur,{$codeBgColor:i,children:t?e(ga,{code:t,language:"yaml",theme:"duotoneDark"}):e(ia,{children:e(oa,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{il as A,xt as C,gl as D,dl as I,hl as N,ul as O,pl as P,Kl as R,Jl as S,Ql as U,rr as W,pr as Y,kt as a,Ct as b,bl as c,ll as d,St as e,tl as f,Il as g,Dl as h,ml as i,Wl as j,Zl as k,Nt as l,dr as m,yt as n};
|