@odigos/ui-kit 0.0.264 → 0.0.266
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 +29 -0
- package/lib/chunks/index-DUhfkGj1.js +155 -0
- package/lib/chunks/{odigos-context-_YAZF63s.js → odigos-context-DzuZq_D5.js} +2 -2
- package/lib/chunks/source-instrument-form-context-DnvGijkN.js +5 -0
- package/lib/chunks/ui-components-Dq_j4_BI.js +1591 -0
- package/lib/components/condition/index.d.ts +10 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/radio-card/index.d.ts +16 -0
- package/lib/components/skeleton-loader/index.d.ts +2 -1
- package/lib/components.js +1 -1
- package/lib/constants/strings/index.d.ts +78 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/add-source-drawer/strings.d.ts +8 -6
- package/lib/containers/_drawers/create-cloud-connector-drawer/index.d.ts +15 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/custom-resource-table.d.ts +9 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/helpers.d.ts +5 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/index.d.ts +2 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/permission-list.d.ts +12 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/permissions.d.ts +25 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/policy-preview.d.ts +5 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/provider-list.d.ts +8 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/setup-credentials/create-role-section.d.ts +6 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/setup-credentials/enter-arn-section.d.ts +5 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/setup-credentials/index.d.ts +5 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/setup-credentials/methods.d.ts +30 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/setup-credentials/section.d.ts +9 -0
- package/lib/containers/_drawers/create-cloud-connector-drawer/steps/validate-connection/index.d.ts +8 -0
- package/lib/containers/_drawers/edit-source-drawer/helpers.d.ts +9 -5
- package/lib/containers/_drawers/edit-source-drawer/libraries/index.d.ts +6 -0
- package/lib/containers/_drawers/edit-source-drawer/overview/runtime-card.d.ts +14 -0
- package/lib/containers/_drawers/edit-source-drawer/overview/vm-processes.d.ts +10 -0
- package/lib/containers/_drawers/edit-source-drawer/pods/containers-card/process-card.d.ts +7 -1
- package/lib/containers/_drawers/edit-source-drawer/profiling/flamebearer.d.ts +18 -0
- package/lib/containers/_drawers/edit-source-drawer/tabs.d.ts +1 -0
- package/lib/containers/_drawers/index.d.ts +1 -0
- package/lib/containers/central-connections/helpers.d.ts +11 -1
- package/lib/containers/central-connections/index.d.ts +6 -1
- package/lib/containers.js +610 -170
- package/lib/contexts/cloud-connector-form-context.d.ts +35 -0
- package/lib/contexts/index.d.ts +1 -0
- package/lib/contexts/odigos-api/capabilities.d.ts +5 -1
- package/lib/contexts/odigos-api/hooks/use-sources-api.d.ts +1 -0
- package/lib/contexts/odigos-api/types.d.ts +1 -0
- package/lib/contexts/odigos-context.d.ts +2 -0
- package/lib/contexts.js +1 -1
- package/lib/functions/get-source-kind-label/index.d.ts +8 -0
- package/lib/functions/index.d.ts +1 -0
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons/compute-platform/cloud-connector-icon/index.d.ts +2 -0
- package/lib/icons/compute-platform/cloud-connector-policy-icon/index.d.ts +2 -0
- package/lib/icons/compute-platform/index.d.ts +2 -0
- package/lib/icons.js +1 -1
- package/lib/snippets/connector-created-modal/index.d.ts +7 -0
- package/lib/snippets/index.d.ts +1 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme/palettes/index.d.ts +1 -0
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +1 -4
- package/lib/types/cloud-connectors/index.d.ts +88 -0
- package/lib/types/common/index.d.ts +2 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/snapshot/index.d.ts +1 -0
- package/lib/types/sources/index.d.ts +1 -0
- package/lib/types/workload/index.d.ts +68 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-B-zICLj7.js +0 -155
- package/lib/chunks/source-instrument-form-context-CZQIaTUV.js +0 -5
- package/lib/chunks/ui-components-CAPnizLR.js +0 -1543
package/lib/snippets/index.d.ts
CHANGED
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-Dq_j4_BI.js";export{C as CancelModal,a as ConnectorCreatedModal,D as DURATION_OPTIONS,b as DeleteModal,c as DurationErrorsSection,d as DynamicField,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,O as OdigosLogoTextByTier,e as OperationSection,P as PERCENTAGE_OPTIONS,f as PercentageSection,g as PresetWithCustomInput,R as RuleInfoSection,h as RuleTypeSection,S as SamplingPreviewSection,i as SignalsCheckboxList,j as SourceScopeSection,U as UpgradeModal,W as WIDE_DRAWER_WIDTH,k as WideDrawer,Y as YamlSectionCard}from"./chunks/index-DUhfkGj1.js";export{C as ColoredSpan,a as ColoredSpanVariant}from"./chunks/odigos-context-DzuZq_D5.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{c$ as DrawerType,b9 as ProgressKeys,ej as getDrawerTypeForAdd,cm as getDrawerTypeForEdit,fX as useDarkMode,b6 as useDataStreamStore,ch as useDrawerStore,ef as useFilterStore,b1 as useNotificationStore,b7 as useProgressStore,ek as useSelectedStore,b8 as useSetupStore}from"./chunks/ui-components-Dq_j4_BI.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{g5 as Provider,g6 as animations,g7 as opacity,g8 as palettes}from"./chunks/ui-components-Dq_j4_BI.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";
|
|
@@ -64,10 +64,7 @@ export interface ActionOption {
|
|
|
64
64
|
allowedSignals?: SignalType[];
|
|
65
65
|
docsUrl?: string;
|
|
66
66
|
fields?: ActionYamlProperties[];
|
|
67
|
-
minVersion?:
|
|
68
|
-
[PlatformType.K8s]?: number;
|
|
69
|
-
[PlatformType.Vm]?: number;
|
|
70
|
-
};
|
|
67
|
+
minVersion?: Partial<Record<PlatformType, number>>;
|
|
71
68
|
supportedPlatforms?: PlatformType[];
|
|
72
69
|
items?: ActionOption[];
|
|
73
70
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export declare enum CloudConnectorFeatureKey {
|
|
2
|
+
Discovery = "discovery",
|
|
3
|
+
Instrumentation = "instrumentation",
|
|
4
|
+
ComputePlatforms = "computePlatforms",
|
|
5
|
+
Gateway = "gateway"
|
|
6
|
+
}
|
|
7
|
+
export interface CloudConnectorField {
|
|
8
|
+
name: string;
|
|
9
|
+
displayName: string;
|
|
10
|
+
componentType: string;
|
|
11
|
+
componentProps?: Record<string, unknown> | null;
|
|
12
|
+
required: boolean;
|
|
13
|
+
secret: boolean;
|
|
14
|
+
tooltip: string;
|
|
15
|
+
initialValue: string;
|
|
16
|
+
envVar: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CloudConnectorAuthMethod {
|
|
19
|
+
id: string;
|
|
20
|
+
displayName: string;
|
|
21
|
+
description: string;
|
|
22
|
+
baseMethods: string[];
|
|
23
|
+
fields: CloudConnectorField[];
|
|
24
|
+
}
|
|
25
|
+
export interface CloudConnectorAuth {
|
|
26
|
+
permissions: string[];
|
|
27
|
+
methods: CloudConnectorAuthMethod[];
|
|
28
|
+
}
|
|
29
|
+
export interface CloudConnectorType {
|
|
30
|
+
name: string;
|
|
31
|
+
displayName: string;
|
|
32
|
+
description: string;
|
|
33
|
+
permissions: string[];
|
|
34
|
+
method: string;
|
|
35
|
+
implemented: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface CloudConnectorFeature {
|
|
38
|
+
key: string;
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
displayName: string;
|
|
41
|
+
description: string;
|
|
42
|
+
permissions: string[];
|
|
43
|
+
types: CloudConnectorType[];
|
|
44
|
+
}
|
|
45
|
+
export interface CloudConnectorProvider {
|
|
46
|
+
provider: string;
|
|
47
|
+
displayName: string;
|
|
48
|
+
connectorFields: CloudConnectorField[];
|
|
49
|
+
auth: CloudConnectorAuth;
|
|
50
|
+
features: CloudConnectorFeature[];
|
|
51
|
+
}
|
|
52
|
+
export interface CloudConnectorTestCapability {
|
|
53
|
+
type: string;
|
|
54
|
+
discovery: boolean;
|
|
55
|
+
instrumentation: boolean;
|
|
56
|
+
computePlatforms: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface CloudConnectorTestInput {
|
|
59
|
+
provider: string;
|
|
60
|
+
credentials: Record<string, string>;
|
|
61
|
+
expectedAccountId: string;
|
|
62
|
+
capabilities: CloudConnectorTestCapability[];
|
|
63
|
+
}
|
|
64
|
+
export interface CloudConnectorTestCheck {
|
|
65
|
+
name: string;
|
|
66
|
+
displayName: string;
|
|
67
|
+
passed: boolean;
|
|
68
|
+
message: string;
|
|
69
|
+
remediation: string;
|
|
70
|
+
}
|
|
71
|
+
export interface CloudConnectorTestResult {
|
|
72
|
+
success: boolean;
|
|
73
|
+
accountId: string;
|
|
74
|
+
identity: string;
|
|
75
|
+
checks: CloudConnectorTestCheck[];
|
|
76
|
+
}
|
|
77
|
+
export interface CloudConnectorCreateInput {
|
|
78
|
+
provider: string;
|
|
79
|
+
displayName: string;
|
|
80
|
+
credentials: Record<string, string>;
|
|
81
|
+
expectedAccountId: string;
|
|
82
|
+
capabilities: CloudConnectorTestCapability[];
|
|
83
|
+
}
|
|
84
|
+
export interface CloudConnectorCreateResult {
|
|
85
|
+
created: boolean;
|
|
86
|
+
connectorId: string;
|
|
87
|
+
test: CloudConnectorTestResult;
|
|
88
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5,12 +5,21 @@ export interface WorkloadId {
|
|
|
5
5
|
namespace: string;
|
|
6
6
|
name: string;
|
|
7
7
|
kind: K8sResourceKind | '';
|
|
8
|
+
region?: string | null;
|
|
8
9
|
}
|
|
9
10
|
export interface DesiredConditionStatus {
|
|
10
11
|
name?: string;
|
|
11
12
|
status?: DesiredStateProgress;
|
|
12
13
|
reasonEnum?: string | null;
|
|
13
14
|
message: string;
|
|
15
|
+
actionItems?: DesiredConditionActionItem[] | null;
|
|
16
|
+
}
|
|
17
|
+
export declare enum DesiredConditionActionItemType {
|
|
18
|
+
RolloutWorkload = "RolloutWorkload"
|
|
19
|
+
}
|
|
20
|
+
export interface DesiredConditionActionItem {
|
|
21
|
+
type: DesiredConditionActionItemType | string;
|
|
22
|
+
userFacingText: string;
|
|
14
23
|
}
|
|
15
24
|
export interface NamespaceWorkload {
|
|
16
25
|
id: WorkloadId;
|
|
@@ -59,6 +68,7 @@ export interface K8sWorkloadAgentEnabled {
|
|
|
59
68
|
}
|
|
60
69
|
export interface K8sWorkloadRollout {
|
|
61
70
|
rolloutStatus?: DesiredConditionStatus | null;
|
|
71
|
+
podsManifestInjectionStatus?: DesiredConditionStatus | null;
|
|
62
72
|
}
|
|
63
73
|
export interface K8sWorkloadContainerOverrides {
|
|
64
74
|
containerName: string;
|
|
@@ -135,6 +145,7 @@ export interface K8sWorkloadContainer {
|
|
|
135
145
|
overrides?: K8sWorkloadContainerOverrides | null;
|
|
136
146
|
agentConfig?: K8sWorkloadContainerAgentConfig | null;
|
|
137
147
|
collectorConfig?: K8sWorkloadContainerCollectorConfig | null;
|
|
148
|
+
instrumentations?: K8sWorkloadPodContainerProcessInstrumentation[] | null;
|
|
138
149
|
}
|
|
139
150
|
export interface K8sWorkloadPodContainerProcess {
|
|
140
151
|
healthy?: boolean | null;
|
|
@@ -181,6 +192,7 @@ export interface K8sWorkloadConditions {
|
|
|
181
192
|
runtimeDetection?: DesiredConditionStatus | null;
|
|
182
193
|
agentInjectionEnabled?: DesiredConditionStatus | null;
|
|
183
194
|
rollout?: DesiredConditionStatus | null;
|
|
195
|
+
podsManifestInjection?: DesiredConditionStatus | null;
|
|
184
196
|
agentInjected?: DesiredConditionStatus | null;
|
|
185
197
|
processesAgentHealth?: DesiredConditionStatus | null;
|
|
186
198
|
expectingTelemetry?: DesiredConditionStatus | null;
|
|
@@ -199,5 +211,61 @@ export interface Workload {
|
|
|
199
211
|
telemetryMetrics?: K8sWorkloadTelemetryMetrics[] | null;
|
|
200
212
|
dataStreamNames?: string[] | null;
|
|
201
213
|
numberOfInstances?: number | null;
|
|
214
|
+
rollout?: K8sWorkloadRollout | null;
|
|
202
215
|
autoRollback?: K8sWorkloadAutoRollback | null;
|
|
216
|
+
instrumentationReport?: InstrumentationReport | null;
|
|
217
|
+
sourceConfig?: SourceConfig | null;
|
|
218
|
+
}
|
|
219
|
+
/** agents-api Source.config overrides (connectors / VM). */
|
|
220
|
+
export interface SourceConfig {
|
|
221
|
+
runtimeOverride?: SourceRuntimeOverride | null;
|
|
222
|
+
distroOverride?: SourceDistroOverride | null;
|
|
223
|
+
}
|
|
224
|
+
export interface SourceRuntimeOverride {
|
|
225
|
+
language?: string | null;
|
|
226
|
+
version?: string | null;
|
|
227
|
+
}
|
|
228
|
+
export interface SourceDistroOverride {
|
|
229
|
+
otelDistroName?: string | null;
|
|
230
|
+
}
|
|
231
|
+
/** Live instrumentation status from agents-api WorkloadReport (connectors / VM). */
|
|
232
|
+
export interface InstrumentationReport {
|
|
233
|
+
/** WorkloadReport.current.state (Instrumented, Instrumenting, Error, …). */
|
|
234
|
+
state: string;
|
|
235
|
+
/** WorkloadReport.current.instrumented */
|
|
236
|
+
instrumented?: boolean | null;
|
|
237
|
+
/** WorkloadReport.desired.sdkType when advertised (e.g. "opentelemetry"). */
|
|
238
|
+
sdkType?: string | null;
|
|
239
|
+
progressStage?: string | null;
|
|
240
|
+
progressMessage?: string | null;
|
|
241
|
+
waitingFor?: string | null;
|
|
242
|
+
runtimeLanguage?: string | null;
|
|
243
|
+
runtimeVersion?: string | null;
|
|
244
|
+
updatedAt?: string | null;
|
|
245
|
+
issues?: InstrumentationReportIssue[] | null;
|
|
246
|
+
/**
|
|
247
|
+
* Per-PID rows from WorkloadReport.instances + processMetadata (VM).
|
|
248
|
+
* Not used by cloud connectors today — RuntimeCard only renders them when isVm.
|
|
249
|
+
*/
|
|
250
|
+
processes?: InstrumentationReportProcess[] | null;
|
|
251
|
+
}
|
|
252
|
+
/** One live process under a VM workload (joined instance + processMetadata by pid). */
|
|
253
|
+
export interface InstrumentationReportProcess {
|
|
254
|
+
pid: number;
|
|
255
|
+
alive?: boolean | null;
|
|
256
|
+
exe?: string | null;
|
|
257
|
+
cmdline?: string | null;
|
|
258
|
+
instrumented: boolean;
|
|
259
|
+
probesAttached?: boolean | null;
|
|
260
|
+
message?: string | null;
|
|
261
|
+
distro?: string | null;
|
|
262
|
+
instrumentationEligible?: boolean | null;
|
|
263
|
+
excludedReason?: string | null;
|
|
264
|
+
}
|
|
265
|
+
export interface InstrumentationReportIssue {
|
|
266
|
+
code: string;
|
|
267
|
+
severity: string;
|
|
268
|
+
message: string;
|
|
269
|
+
since?: string | null;
|
|
270
|
+
transient?: boolean | null;
|
|
203
271
|
}
|
package/lib/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{bi as ActionKeyTypes,bj as ActionType,eS as AgentInjectedReason,eT as BooleanOperation,b$ as CloudConnectorFeatureKey,u as CodeAttributesKeyTypes,eU as ConditionType,b4 as Crud,q as CustomInstrumentationsKeyTypes,cq as DesiredConditionActionItemType,ca as DesiredStateProgress,eV as DestinationTypes,b5 as EntityTypes,bv as ExtractionDataFormat,F as FieldTypes,G as GolangCustomProbe,H as HeadersCollectionKeyTypes,l as InputTypes,eW as InstallationMethod,eX as InstallationStatus,p as InstrumentationRuleType,eY as IntrumentationStatus,J as JavaCustomProbe,eZ as JsonOperation,bs as K8sAttributesFrom,br as K8sResourceKind,e_ as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,e$ as ListDirection,f0 as NumberOperation,f1 as OtelDistroName,f2 as OtherEntityTypes,r as PayloadCollectionKeyTypes,P as PlatformType,f3 as PodContainerLifecycleStatus,f4 as PodContainerStatus,f5 as PodPhase,f6 as Profile,aI as ProgrammingLanguages,f7 as SIGNAL_KEY_TO_TYPE,f8 as SIGNAL_TYPE_TO_KEY,f9 as SignalKey,bo as SignalType,fa as SortDirection,aB as StatusType,fb as StringOperation,b as Tier,fc as WorkloadRolloutReason,ex as WorkloadRolloutStatus}from"./chunks/ui-components-Dq_j4_BI.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{fd as VISUAL_ODIGOS_LOGO_HEIGHT,fe as VISUAL_ODIGOS_LOGO_WIDTH,V as VisualGreenRings,ff as VisualOdigosLogo,d9 as VisualPurpleRings}from"./chunks/ui-components-Dq_j4_BI.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,F as n,c as i,d as s,e as o,f as d,C as c,D as u,g as p,I as h,s as g,h as m,i as v,j as f,k as b,l as y,m as x,L as C,n as S,o as $,J as k,G as w,H as T,p as A,q as P,r as M,b as L,u as O,v as I,w as D,S as z,x as X,y as N,z as R,E as H,K as E,M as B,N as V,O as j,Q as q,U as G,V as J,X as U,Y as K,Z as W,_ as F,$ as Y,a0 as Z,a1 as Q,a2 as _,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 $e,ar as ke,as as we,at as Te,au as Ae,av as Pe,aw as Me,ax as Le,ay as Oe,az as Ie,aA as De,aB as ze,aC as Xe,aD as Ne,aE as Re,aF as He,aG as Ee,aH as Be,aI as Ve,aJ as je,aK as qe,aL as Ge,aM as Je,aN as Ue,aO as Ke,aP as We,aQ as Fe,aR as Ye,aS as Ze,aT as Qe,aU as _e,aV as ea,aW as aa,R as ta,aX as la,aY as ra,A as na,aZ as ia,a_ as sa}from"./ui-components-CAPnizLR.js";import oa,{useMemo as da,useCallback as ca,useState as ua,useEffect as pa,useRef as ha,forwardRef as ga,useImperativeHandle as ma}from"react";import{a as va,C as fa,b as ba,u as ya,i as xa,d as Ca,e as Sa,f as $a,g as ka,h as wa,j as Ta,k as Aa,m as Pa}from"./odigos-context-_YAZF63s.js";import{EditIcon as Ma,OdigosLogoTextCentral as La,OdigosLogoTextEnterprise as Oa,OdigosLogoTextCommunity as Ia,OdigosLogoTextColoredCentral as Da,OdigosLogoTextColoredEnterprise as za,OdigosLogoTextColoredCommunity as Xa,ArrowLeftIcon as Na,ArrowRightIcon as Ra,VSquareIcon as Ha,VIcon as Ea,CopyIcon as Ba,YamlIcon as Va}from"../icons.js";import ja,{useTheme as qa}from"styled-components";const Ga=({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,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()}}})},Ua=({componentType:a,inputType:t,name:l,label:r,tooltip:b,badge:y,placeholder:x,required:C,disabled:S,value:$,setValue:k,errorMessage:w,warnMessage:T,helpMessage:A,dropdownOptions:P,dropdownNoSearch:M,dropdownNoCheckbox:L,timeUnits:O,timeDefaultUnit:I,toggleSize:D=o.L})=>{switch(a){case n.Input:return e(v,{name:l,type:t,label:r,tooltip:b,badge:y,placeholder:x,required:C,disabled:S,value:$??"",onChange:e=>{const a=e.target.value;k(t===f.Number?""===a?null:Number(a):a)},errorMessage:w,warnMessage:T,helpMessage:A},l);case n.MultiInput:return e(m,{name:l,label:r,tooltip:b,badge:y,placeholder:x,required:C,disabled:S,values:Array.isArray($)?$:g($,[]),setValues:e=>k(e),errorMessage:w,warnMessage:T,helpMessage:A,plain:!0},l);case n.KeyValuePair:return e(h,{name:l,label:r,tooltip:b,badge:y,required:C,disabled:S,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key",placeholder:"Key"},{keyName:"value",label:"Value",placeholder:"Value"}],values:Array.isArray($)?$:g($,[]),setValues:e=>k(e),errorMessage:w,warnMessage:T,helpMessage:A},l);case n.TextArea:return e(p,{name:l,label:r,tooltip:b,badge:y,required:C,disabled:S,placeholder:x,value:$??"",onChange:e=>k(e.target.value),errorMessage:w,warnMessage:T,helpMessage:A},l);case n.Dropdown:return e(u,{name:l,label:r,tooltip:b,badge:y,placeholder:x,required:C,disabled:S,withSearch:!M,options:P?.map(e=>({id:e.id||"",label:e.label||"",withCheckbox:!L}))||[],values:$?[String($)]:[],setValues:e=>k(e[0]),errorMessage:w,warnMessage:T,helpMessage:A},l);case n.Checkbox:return e(c,{name:l,label:r,tooltip:b,badge:y,value:!0===$||"true"===$,onChange:e=>k(e),disabled:S,errorMessage:w,warnMessage:T,helpMessage:A},l);case n.Time:return e(d,{name:l,label:r,tooltip:b,badge:y,placeholder:x,required:C,disabled:S,value:$??"",setValue:e=>k(e),units:O,defaultUnit:I,errorMessage:w,warnMessage:T,helpMessage:A},l);case n.Toggle:return e(i,{name:l,size:D,labelAlign:s.Right,label:r,tooltip:b,badge:y,value:!0===$||"true"===$,onChange:e=>k(e),disabled:S,errorMessage:w,warnMessage:T,helpMessage:A},l);default:return null}},Ka=ja.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
|
-
`,Wa=ja.div`
|
|
9
|
-
flex: 1;
|
|
10
|
-
min-width: 0;
|
|
11
|
-
white-space: pre;
|
|
12
|
-
overflow-x: auto;
|
|
13
|
-
`,Fa=({title:t,summary:l,onEdit:n,renderAction:i})=>{const s=da(()=>{const e=[];return t&&(e.push({text:t,variant:va.Default}),e.push({text:" - ",variant:va.Default})),e.push(...l),e},[t,l]);return a(Ka,{children:[e(Wa,{children:e(fa,{parts:s})}),i&&i(),n&&e(b,{"data-id":"sampling-btn-edit-auto-rule",label:x,rightIcon:Ma,variant:r.Text,size:y.S,onClick:n})]})},Ya={[A.HttpRequest]:"HTTP request",[A.HttpResponse]:"HTTP response",[A.DbQuery]:"DB query",[A.Messaging]:"messaging"};function Za(e,a,t){return 1===e?a:t??`${a}s`}function Qa(e,a){const t=[],l=e.slice(0,3),r=e.slice(3);return l.forEach((e,l)=>{l>0&&t.push({text:", ",variant:va.Default}),t.push({text:e,variant:a})}),r.length>0&&t.push({text:` + ${r.length} more`,variant:va.Default,tooltipItems:r}),t}const _a=({option:a,formState:t,renderAction:l})=>{const r=da(()=>{const e=function(e,a){switch(e){case S.CodeAttributes:return(e=>{const a=Object.values(P).filter(a=>!!e.codeAttributes?.[a]).map(e=>M(e).toLowerCase());return a.length?[{text:"Collect",variant:va.Action},{text:" ",variant:va.Default},...Qa(a,va.Endpoint)]:null})(a);case S.PayloadCollection:return(e=>{const a=Object.values(A).filter(a=>null!=e.payloadCollection?.[a]).map(e=>Ya[e]);return a.length?[{text:"Collect",variant:va.Action},{text:" ",variant:va.Default},...Qa(a,va.Endpoint)]:null})(a);case S.HeadersCollection:return(e=>{const a=(e.headersCollection?.[T.HeaderKeys]??[]).map(e=>e.trim()).filter(e=>e.length>0);if(!a.length)return null;const t=Za(a.length,"HTTP header");return[{text:`Collect ${a.length} ${t}`,variant:va.Action},{text:"",variant:va.Default,tooltipItems:a}]})(a);case S.CustomInstrumentation:return(e=>{const a=(e.customInstrumentations?.[$.Java]??[]).map(e=>new k(e.className,e.methodName)).filter(e=>e.Verify()),t=(e.customInstrumentations?.[$.Golang]??[]).map(e=>new w(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 ${Za(a.length,"probe")}`),t.length&&l.push(`${t.length} Go ${Za(t.length,"probe")}`);const r=[...a.map(e=>`Java: ${e.toString()}`),...t.map(e=>`Go: ${e.toString()}`)];return[{text:`Apply ${l.join(" + ")}`,variant:va.Action},{text:"",variant:va.Default,tooltipItems:r}]})(a);default:return null}}(a?.type,t);return e?[...e,...ba(t.sourceScopes)]:[]},[a?.type,t]),n=0===r.length;return e(Fa,{title:n?C:"Instrumentation Rule Preview",summary:r,renderAction:l})},et=({size:a=200,central:t=!1,useInline:l=!1})=>{const{tier:r}=ya();if(l){if(t)return e(La,{size:a});switch(r){case L.Community:return e(Ia,{size:a});case L.Onprem:return e(Oa,{size:a});default:return null}}if(t)return e(Da,{size:a});switch(r){case L.Community:return e(Xa,{size:a});case L.Onprem:return e(za,{size:a});default:return null}},at=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],tt=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],lt=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],rt=({description:t,options:l,selected:r,onSelect:n,customName:i,customLabel:s,customPlaceholder:o,customValue:d,onCustomChange:c,customInputType:u=f.Number,customMin:p,customMax:h})=>a(O,{$gap:6,children:[e(I,{label:t}),a(D,{$gap:8,$alignItems:"flex-end",children:[e(z,{options:l,selected:r,setSelected:n}),"custom"===r&&e(v,{name:i,label:s,placeholder:o,type:u,value:d,onChange:c,width:160,min:p,max:h})]})]}),nt=()=>{},it=a=>a.readOnly?e(st,{rule:a.rule}):e(ot,{ruleType:a.ruleType,formState:a.formState,onChange:a.onChange}),st=({rule:t})=>{const l=null!=t.durationAtLeastMs;return t.error?e(X,{richTitle:{title:N},children:e(i,{name:"sampling-view-toggle-keep-errors",onChange:nt,value:!0,size:o.S,label:R,labelAlign:s.Right})}):l?e(X,{richTitle:{title:H},children:a("div",{children:[e(E,{size:j.XXXS,color:V.Secondary,children:B}),e(E,{size:j.XS,children:`${t.durationAtLeastMs}ms`})]})}):null},ot=({ruleType:a,formState:t,onChange:l})=>{const r=ca(e=>l({durationPreset:e}),[l]),n=ca(e=>l({customDurationMs:e.target.value}),[l]);return"Duration"===a?e(X,{richTitle:{title:H,subTitle:q},children:e(rt,{description:B,options:lt,selected:t.durationPreset,onSelect:r,customName:"sampling-input-custom-duration",customLabel:G,customPlaceholder:"200ms",customValue:t.customDurationMs,onCustomChange:n})}):null},dt=ja.div`
|
|
14
|
-
display: flex;
|
|
15
|
-
gap: 32px;
|
|
16
|
-
`,ct=ja.div`
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
gap: 4px;
|
|
20
|
-
`,ut=ja.div`
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-wrap: wrap;
|
|
23
|
-
align-items: flex-end;
|
|
24
|
-
gap: 16px;
|
|
25
|
-
`,pt=ja.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
|
-
`,ht=ja.div`
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: flex-end;
|
|
35
|
-
gap: 10px;
|
|
36
|
-
flex: 1;
|
|
37
|
-
`,gt=ja.div`
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
height: 32px;
|
|
41
|
-
`,mt=ja.div`
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: flex-end;
|
|
44
|
-
gap: 16px;
|
|
45
|
-
margin-bottom: 12px;
|
|
46
|
-
`,vt="Any",ft="Kafka topic",bt=()=>e("div",{style:{marginBottom:"8px"},children:e(E,{size:j.XS,weight:500,children:"And"})}),yt=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],xt=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Ct=[{id:"",label:vt},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}],St=a=>a.readOnly?e($t,{data:a.data}):e(kt,{category:a.category,formState:a.formState,onChange:a.onChange}),$t=({data:t})=>{const l=da(()=>(e=>{if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:ne,value:re},{id:"route",title:Q,value:a.httpServer.route||a.httpServer.routePrefix||ie},{id:"method",title:te,value:a.httpServer.method||vt}];if(a?.httpClient){const e=[{id:"type",title:ne,value:se}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:Q,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||ie}),e.push({id:"method",title:te,value:a.httpClient.method||vt}),e}return[{id:"type",title:ne,value:oe}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:ne,value:re},{id:"route",title:Q,value:a.httpServer.route||a.httpServer.routePrefix||ie},{id:"method",title:te,value:a.httpServer.method||vt}]:a?.kafkaConsumer?[{id:"type",title:ne,value:de},{id:"topic",title:ft,value:a.kafkaConsumer.kafkaTopic||ie}]:a?.kafkaProducer?[{id:"type",title:ne,value:ce},{id:"topic",title:ft,value:a.kafkaProducer.kafkaTopic||ie}]:[{id:"type",title:ne,value:oe}]})(t),[t]);return e(X,{richTitle:{title:J},children:e(dt,{children:l.map(({id:t,title:l,value:r})=>a(ct,{children:[e(E,{size:j.XXXS,color:V.Secondary,nowrap:!0,children:l}),e(E,{size:j.XS,nowrap:!0,children:r})]},t))})})},kt=({category:t,formState:l,onChange:n})=>{const i=da(()=>"noisy"===t?yt:xt,[t]),s=ca(e=>n({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[n]),o=ca(e=>a=>{a&&n({routeType:e,route:""})},[n]),d=ca(e=>n({route:e.target.value}),[n]),c=ca(e=>n({serverAddress:e.target.value}),[n]),u=ca(e=>n({method:e[0]||""}),[n]),p=ca(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?Z:Q,f="httpClient"===l.operationType?_:ee;return a(X,{richTitle:{title:`2. ${J}`,subTitle:U},children:[e(O,{$alignItems:"flex-start",children:e(z,{options:i,selected:l.operationType,setSelected:s})}),h&&a(ut,{children:["httpClient"===l.operationType&&a(mt,{children:[e(v,{name:"sampling-input-server-address",label:W,placeholder:K,value:l.serverAddress,onChange:c}),e(bt,{})]}),a(pt,{children:[a(ht,{children:[e(gt,{children:e(F,{"data-id":"sampling-radio-route",value:"route"===l.routeType,onChange:o("route")})}),e(v,{name:"sampling-input-route",label:m,placeholder:Y,value:"route"===l.routeType?l.route:"",onChange:d,disabled:"route"!==l.routeType})]}),a(ht,{children:[e(gt,{children:e(F,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===l.routeType,onChange:o("routePrefix")})}),e(v,{name:"sampling-input-route-prefix",label:f,placeholder:Y,value:"routePrefix"===l.routeType?l.route:"",onChange:d,disabled:"routePrefix"!==l.routeType})]})]}),a(mt,{children:[e(bt,{}),e(ae,{label:te,items:Ct,selectedIds:[l.method||""],setSelectedIds:e=>u(e),buttonProps:{"data-id":"sampling-btn-method",label:Ct.find(e=>e.id===l.method)?.label||vt,size:y.S,variant:r.Secondary}})]})]}),g&&e(v,{name:"sampling-input-kafka-topic",label:le,placeholder:"Type kafka topic",value:l.kafkaTopic,onChange:p,width:"320px"})]})},wt=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Tt=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}],At=a=>a.readOnly?e(Pt,{data:a.data}):e(Mt,{category:a.category,formState:a.formState,onChange:a.onChange}),Pt=({data:t})=>{const l=da(()=>(e=>{switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:pe,method:me,description:he,value:`${e.rule.percentageAtLeast}%`}:{title:pe,method:fe,description:null,value:null};case"noisy":return xa(e.rule.percentageAtMost)?{title:pe,method:ve,description:null,value:null}:{title:pe,method:me,description:ge,value:`${e.rule.percentageAtMost}%`};case"costReduction":return{title:pe,method:me,description:ge,value:`${e.rule.percentageAtMost}%`}}})(t),[t]),r=[{id:"method",title:te,value:l.method},...null!=l.description?[{id:"value",title:l.description,value:l.value}]:[]];return e(X,{richTitle:{title:l.title},children:e(dt,{children:r.map(({id:t,title:l,value:r})=>a(ct,{children:[e(E,{size:j.XXXS,color:V.Secondary,nowrap:!0,children:l}),e(E,{size:j.XS,nowrap:!0,children:r})]},t))})})},Mt=({category:t,formState:l,onChange:r})=>{const n="highlyRelevant"===t,i=n?Tt:wt,s=`${n?4:3}. ${pe}`,o=ue[t],d=n?he:ge,c="noisy"===t?tt:at,u=ca(e=>r({percentageMode:e}),[r]),p=ca(e=>r({percentagePreset:e}),[r]),h=ca(e=>r({customPercentage:e.target.value}),[r]);return a(X,{richTitle:{title:s,subTitle:o},children:["costReduction"!==t&&e(O,{$alignItems:"flex-start",children:e(z,{options:i,selected:l.percentageMode,setSelected:u})}),("costReduction"===t||"sample"===l.percentageMode)&&e(rt,{description:d,options:c,selected:l.percentagePreset,onSelect:p,customName:"sampling-input-custom-percentage",customPlaceholder:"5%",customValue:l.customPercentage,onCustomChange:h,customInputType:f.Decimal,customMin:0,customMax:100})]})},Lt=ja.div`
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: flex-end;
|
|
49
|
-
gap: 16px;
|
|
50
|
-
`,Ot=ja.div`
|
|
51
|
-
width: 280px;
|
|
52
|
-
flex-shrink: 0;
|
|
53
|
-
`,It=ja.div`
|
|
54
|
-
flex: 1;
|
|
55
|
-
min-width: 0;
|
|
56
|
-
`;function Dt(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":we[e.category]}const zt=a=>a.readOnly?e(Xt,{data:a.data}):e(Nt,{formState:a.formState,onChange:a.onChange}),Xt=({data:t})=>{const l=da(()=>[{id:"name",title:ye,value:t.rule.name||be},{id:"type",title:xe,value:Dt(t)}],[t]),r=t.rule.notes||ie;return a(X,{children:[e(dt,{children:l.map(({id:t,title:l,value:r})=>a(ct,{children:[e(E,{size:j.XXXS,color:V.Secondary,nowrap:!0,children:l}),e(E,{size:j.XS,nowrap:!0,children:r})]},t))}),a(ct,{children:[e(E,{size:j.XXXS,color:V.Secondary,children:Ce}),e(E,{size:j.XS,children:r})]})]})},Nt=({formState:t,onChange:l})=>{const r=ca(e=>l({name:e.target.value}),[l]),n=ca(e=>l({notes:e.target.value}),[l]);return e(X,{children:a(Lt,{children:[e(Ot,{children:e(v,{name:"sampling-input-rule-name",label:ye,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:Se,value:t.name,onChange:r})}),e(It,{children:e(v,{name:"sampling-input-note",label:Ce,tooltip:ke,placeholder:$e,value:t.notes,onChange:n})})]})})},Rt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],Ht=({formState:a,onChange:t})=>{const l=ca(e=>t({ruleType:e,keepErrors:"Error"===e}),[t]);return e(X,{richTitle:{title:`3. ${xe}`,subTitle:Te},children:e(O,{$alignItems:"flex-start",children:e(z,{options:Rt,selected:a.ruleType,setSelected:l})})})},Et=a=>{const t=da(()=>{if(a.readOnly)return a.summary;switch(a.category){case"noisy":return $a(Ta(a.formState));case"highlyRelevant":return Sa(wa(a.formState));case"costReduction":return Ca(ka(a.formState))}},[a]);if(a.readOnly)return e(Fa,{title:Ae,summary:t,renderAction:a.renderAction});const l=1===t.length&&"default"===t[0].variant;return e(Fa,{title:l?C:Ae,summary:l?[]:t,renderAction:a.renderAction})},Bt=ja.div`
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-wrap: wrap;
|
|
59
|
-
gap: 8px;
|
|
60
|
-
`,Vt=ja.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
|
-
`,jt=ja.div`
|
|
74
|
-
display: flex;
|
|
75
|
-
width: 32px;
|
|
76
|
-
height: 32px;
|
|
77
|
-
justify-content: center;
|
|
78
|
-
align-items: center;
|
|
79
|
-
flex-shrink: 0;
|
|
80
|
-
`,qt=ja.div`
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: column;
|
|
83
|
-
gap: 12px;
|
|
84
|
-
`,Gt=ja.div`
|
|
85
|
-
display: flex;
|
|
86
|
-
flex-wrap: wrap;
|
|
87
|
-
gap: 6px;
|
|
88
|
-
`,Jt=ja.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
|
-
`,Ut=ja.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
|
-
`,Kt={[He.JavaScript]:"Node.js",[He.DotNet]:".NET",[He.Php]:"PHP",[He.Java]:"Java",[He.Go]:"Go",[He.Python]:"Python",[He.Ruby]:"Ruby",[He.Rust]:"Rust"},Wt=[He.Python,He.Java,He.JavaScript,He.DotNet,He.Php,He.Ruby,He.Go],Ft=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function Yt(e){return Kt[e]||e.charAt(0).toUpperCase()+e.slice(1)}function Zt(e){return null!=e?`${e}. ${Ue}`:Ue}const Qt=({readOnly:a,...t})=>e(a?al:ll,{...t}),_t=({title:t,count:l,children:r})=>a(O,{$gap:6,children:[a(D,{$gap:8,$alignItems:"center",children:[e(E,{size:j.XS,color:V.Primary,nowrap:!0,children:t}),l>1&&a(E,{size:j.XXS,color:V.Secondary,nowrap:!0,children:["(",Ge,")"]})]}),e(Gt,{children:r})]}),el=()=>{const a=qa();return e(Jt,{children:e(Ut,{children:e(E,{size:j.XXS,color:a.v2.colors.white[500],nowrap:!0,children:Je})})})},al=({scopes:t,titleNumber:l})=>{const r=Zt(l);if(Aa(t))return e(Pe,{bgTint:"900",richTitle:{title:r},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(Me,{status:Oe.Default,message:Le,fullWidth:!0})});const n=t.sources??[],i=t.namespaces??[],s=t.languages??[],o=[];return n.length&&o.push({kind:"sources",node:e(_t,{title:Ie,count:n.length,children:n.map((a,t)=>{const l=[a.namespace,a.kind,a.name].filter(Boolean),r=l.length?l.join(" / "):ze;return e(De,{label:r},`src-${t}-${r}`)})})}),i.length&&o.push({kind:"namespaces",node:e(_t,{title:Xe,count:i.length,children:i.map((a,t)=>e(De,{label:a},`ns-${t}-${a}`))})}),s.length&&o.push({kind:"languages",node:e(_t,{title:Ne,count:s.length,children:s.map((a,t)=>{const l=Ee(a);return e(De,{label:Yt(a),leftIcon:l},`lang-${t}-${a}`)})})}),e(Pe,{bgTint:"900",richTitle:{title:r,subTitle:o.length>1?Re:void 0},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(Pe,{bgTint:"800",children:e(qt,{children:o.map((t,l)=>a(oa.Fragment,{children:[l>0&&e(el,{}),t.node]},t.kind))})})})},tl=e=>e.sources.length>0?"source":e.namespaces.length>0?"namespace":e.languages.length>0?"language":"all",ll=({scopes:t,onChange:l,sourceOptions:r=[],namespaceOptions:n=[],supportedLanguages:i,titleNumber:s,dataIdPrefix:o="source-scope",slim:d})=>{const u=t??Pa(),[p,h]=ua(()=>tl(u)),{sources:g,namespaces:m,languages:v}=u,f=g.length>0||m.length>0||v.length>0;pa(()=>{f&&"all"===p&&h(tl(u))},[f,p]);const b=da(()=>Ft.map(e=>"language"===e.value&&0===i?.length?null:{...e,disabled:"all"===e.value&&f}).filter(Boolean),[f]),y=da(()=>g.map(e=>`${e.namespace}/${e.kind}/${e.name}`),[g]),x=da(()=>[...m],[m]),C=da(()=>new Set(v),[v]),S=ca(e=>{h(e)},[]),$=ca(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({...u,sources:a})},[u,l]),k=ca(e=>{l({...u,namespaces:e})},[u,l]),w=ca(e=>{const a=u.languages,t=a.includes(e)?a.filter(a=>a!==e):[...a,e];l({...u,languages:t})},[u,l]),T=!f&&"all"===p,A=(i||Wt).map(e=>({id:e,label:Kt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:Ee(e)}));return a(X,{richTitle:d?{title:Zt(s),titleSize:j.XS,titleColor:V.Secondary,tooltip:Be}:{title:Zt(s),subTitle:Be,subTitleWrap:!0},backgroundColor:d?"transparent":void 0,padding:d?0:void 0,children:[e(Me,T?{status:Oe.Default,message:Le,fullWidth:!0,smallIcon:!0}:{status:Oe.Info,message:Re,fullWidth:!0,smallIcon:!0}),e(O,{$alignItems:"flex-start",children:e(z,{options:b,selected:p,setSelected:S})}),"source"===p&&e(Ve,{multiple:!0,"data-id":`${o}-autocomplete-source`,options:r,value:y,onSelect:$,placeholder:je}),"namespace"===p&&e(Ve,{multiple:!0,"data-id":`${o}-autocomplete-namespace`,options:n,value:x,onSelect:k,placeholder:"Search namespace"}),"language"===p&&A.length>0&&e(Bt,{children:A.map(({id:t,label:l,Icon:r})=>{const n=C.has(t);return a(Vt,{$selected:n,onClick:()=>w(t),children:[e(c,{name:`${o}-lang-${t}`,size:qe.S,value:n,onChange:()=>w(t)}),e(jt,{children:e(r,{size:20})}),e(E,{size:j.XS,nowrap:!0,children:l})]},t)})})]})},rl=(e,a)=>!a?.length||!!a?.find(a=>a===e),nl=({title:t="Signals",required:l,errorMessage:r,allowedSignals:n,selectedSignals:i,setSelectedSignals:s,disabled:o})=>{const[d,u]=ua(1===i.length),p=ha(JSON.stringify(i));return pa(()=>{let e=Ke(i).filter(e=>rl(e,n));e.length||(e=We.filter(({id:e})=>rl(e,n)).map(({id:e})=>e));const a=JSON.stringify(e);p.current!==a&&(p.current=a,s(e),u(1===e.length))},[n,i]),a(O,{$gap:12,children:[e(I,{label:t,required:l}),e(D,{$gap:12,children:We.map(a=>{const t=rl(a.id,n),l=((e,a)=>!!a?.find(a=>a===e))(a.id,i);return t?e(c,{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),u(1===l.length)})(a.id,e)},a.id):null})}),e(Fe,{errorMessage:r})]})},il=({minSupportedVersion:a,currentVersion:t})=>e(l,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>e(Ye,{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}.`}),sl=ja.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
|
-
`,ol=ja.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
|
-
`,dl=ja.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
|
-
`,cl=({isLeft:l,isRight:r,heightOffset:n=0,width:i,header:s,list:o})=>a(sl,{$width:i,$columnHasHeader:!!s,children:[s&&e(ol,{children:s}),e(dl,{$gap:8,$isLeft:l,$isRight:r,$heightOffset:n,$columnHasHeader:!!s,children:o.length?o.length>1?e(Ze,{gap:8,elements:o}):e(t,{children:o[0]}):e(Qe,{$height:"100%",children:e(_e,{})})})]}),ul="75vw",pl=ja.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
|
-
`,hl=ja.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
|
-
`,gl=ja.div`
|
|
142
|
-
padding: 12px 12px 0 12px;
|
|
143
|
-
`,ml=ja.div`
|
|
144
|
-
display: flex;
|
|
145
|
-
gap: 12px;
|
|
146
|
-
padding: 16px;
|
|
147
|
-
`,vl=ja.div`
|
|
148
|
-
padding: 5vh 10vw;
|
|
149
|
-
border-radius: 12px;
|
|
150
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
151
|
-
`,fl=ga(({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:$,progress:k},w)=>{const[T,A]=ua(!1),[P,M]=ua(!1),[L,O]=ua(void 0);ma(w,()=>({clearErrors:()=>O(void 0)}));const I=P,D=ca(()=>{C&&!T?A(!0):(A(!1),s?.())},[C,T,s]),z=p||P||"boolean"==typeof C&&!C,X=ca(async()=>{M(!0);const e=await u();M(!1),!1!==e&&(e?.error?O(e.error):(h?.setValue([]),s?.()))},[u,h,s]),N=!!b||!!h||!!y,R=!!m,H=(N?48:0)+(R?50:0),E=da(()=>$?{status:Oe.Info,message:"Fetching Data..."}:P&&!k?{status:Oe.Info,message:"Saving Changes..."}:L||x?{status:Oe.Error,message:L||x}:"boolean"==typeof C&&C&&!S?{status:Oe.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:void 0,[$,P,k,L,x,C,S]),B=da(()=>o?{label:"Back",leftIcon:Na,variant:r.Secondary,onClick:o}:{label:"Cancel",variant:r.Secondary,onClick:D,disabled:I},[o,D,I]),[V,q]=ua(!1),G=da(()=>d?c?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:Ra,variant:r.Secondary,onClick:()=>q(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:Ra,variant:r.Primary,onClick:d}:{"data-id":"wide-drawer-save",label:"Save",variant:r.Primary,onClick:X,disabled:z},[d,c,X,z]);return a(ea,{width:ul,isOpen:t,disableAnimation:i,hideOverlay:!P&&!n,header:{...g,onClose:s?D:void 0,onCloseDisabled:I},footer:{note:E,actions:[B,G]},children:[P?e(Qe,{$height:"calc(100vh - 136px)",children:e(vl,{children:e(aa,{titleSize:j.S,subTitleSize:j.XXXS,withGradient:!0,withSpinner:!0,...k})})}):a(pl,{children:[N&&a(hl,{children:[h&&e(ta,{icon:Ha,title:"Selected Clusters",badge:{label:h.value.length}}),b&&e(la,{width:"100%",...b}),y]}),R&&e(gl,{children:e(ta,{icon:m.icon,title:m.title,subTitle:m.description,badge:m.badge})}),a(ml,{children:[e(cl,{isLeft:!0,heightOffset:H,...v}),e(cl,{isRight:!0,heightOffset:H,...f})]})]}),e(Ga,{isOpen:T,onClose:()=>A(!1),onApprove:D}),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:()=>q(!1),denyButton:{label:"Go Back",variant:r.Secondary,onClick:()=>q(!1)},approveButton:{label:"Skip",variant:r.Primary,onClick:()=>{d?.(),q(!1)}}})]})});fl.displayName=fl.name;const bl=ja.div`
|
|
152
|
-
padding: 0 24px;
|
|
153
|
-
border-radius: 12px;
|
|
154
|
-
background-color: ${({$codeBgColor:e})=>e||"transparent"};
|
|
155
|
-
`,yl=({title:a="YAML",yaml:t,defaultOpen:l,fullHeight:n,bgTint:i="1000",codeBgColor:s})=>{const{clickCopy:o,isCopied:d}=ra(),c=da(()=>t?[{id:ia(),type:na.Button,buttonProps:{variant:r.Text,size:y.S,leftIcon:d?Ea:Ba,onClick:()=>o(t||""),disabled:d}}]:[],[t,d]);return e(Pe,{bgTint:i,richTitle:{icon:Va,title:a},actions:c,withCollapse:!0,collapseIsDefaultOpen:l,fullHeight:n,children:e(bl,{$codeBgColor:s,children:t?e(sa,{code:t,language:"yaml",theme:"duotoneDark"}):e(Qe,{children:e(_e,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{Fa as A,Ga as C,lt as D,_a as I,tt as N,et as O,at as P,zt as R,Et as S,il as U,ul as W,yl as Y,Ja as a,it as b,Ua as c,St as d,At as e,rt as f,Ht as g,nl as h,Qt as i,fl as j};
|