@odigos/ui-kit 0.0.97 → 0.0.99

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.
@@ -1,342 +0,0 @@
1
- import { StatusType, DestinationTypes, EntityTypes } from './types.js';
2
- import { a as DEFAULT_DATA_STREAM_NAME, f as getProgrammingLanguageIcon, h as KafkaLogo } from './index-40dfa720.js';
3
- import 'react';
4
- import 'styled-components';
5
- import { O as OdigosLogo } from './index-eff01b3d.js';
6
- import { A as AlaudaLogo, a as AlibabaCloudLogo, b as AppDynamicsLogo, c as AxiomLogo, B as BlobStorageLogo, d as BetterStackLogo, e as BonreeLogo, C as CauselyLogo, f as ChecklyLogo, g as ChronosphereLogo, h as ClickhouseLogo, i as AwsCloudwatchLogo, j as CoralogixLogo, D as Dash0Logo, k as DatadogLogo, O as OpenTelemetryLogo, l as DynatraceLogo, E as ElasticApmLogo, m as ElasticSearchLogo, G as GoogleCloudPlatformLogo, n as GrafanaLogo, o as GreptimeLogo, p as GroundcoverLogo, H as HoneycombLogo, q as HyperDxLogo, I as InstanaLogo, J as JaegerLogo, K as KloudmateLogo, L as Last9Logo, r as LightstepLogo, s as LogzioLogo, t as LokiLogo, u as LumigoLogo, M as MiddlewareLogo, N as NewRelicLogo, v as ObserveLogo, w as OneUptimeLogo, x as OpenObserveLogo, y as OpsVerseLogo, z as OracleLogo, P as PrometheusLogo, Q as QrynLogo, F as GigapipeLogo, R as QuickwitLogo, S as AwsS3Logo, T as SeqLogo, U as SignozLogo, V as SplunkLogo, W as SumoLogicLogo, X as TelemetryHubLogo, Y as TempoLogo, Z as TingyunLogo, _ as TraceloopLogo, $ as UptraceLogo, a0 as VictoriaMetricsLogo, a1 as AwsXrayLogo, a2 as NamespacesIcon, a3 as SourcesIcon, a4 as DestinationsIcon, a5 as ActionsIcon, a6 as RulesIcon } from './index-b0883db6.js';
7
- import { s as safeJsonParse } from './index-5e5f7bda.js';
8
-
9
- const filterActions = (actions, filters) => {
10
- let filtered = [...actions];
11
- if (!!filters.monitors?.length)
12
- filtered = filtered.filter((action) => !!filters.monitors?.find((metric) => action.spec.signals.find((str) => str.toLowerCase() === metric.id)));
13
- return filtered;
14
- };
15
-
16
- const filterDestinations = (destinations, filters) => {
17
- let filtered = [...destinations];
18
- if (!!filters.monitors?.length)
19
- filtered = filtered.filter((dest) => !!filters.monitors?.find((metr) => dest.exportedSignals[metr.id]));
20
- return filtered;
21
- };
22
-
23
- const filterDestinationsByStream = (destinations, streamName) => {
24
- // if no stream is selected, return nothing (to prevent glitchy rendering)
25
- if (!streamName)
26
- return [];
27
- // note: destinations can also not have any streams assigned, and we want to show them
28
- return destinations.filter((dest) => dest.dataStreamNames.includes(streamName) || !dest.dataStreamNames.length);
29
- };
30
-
31
- const filterSources = (sources, filters) => {
32
- let filtered = [...sources];
33
- if (!!filters.namespaces?.length)
34
- filtered = filtered.filter(({ namespace }) => !!filters.namespaces?.find(({ id }) => id === namespace));
35
- if (!!filters.kinds?.length)
36
- filtered = filtered.filter(({ kind }) => !!filters.kinds?.find(({ id }) => id === kind));
37
- if (!!filters.languages?.length)
38
- filtered = filtered.filter(({ containers }) => !!filters.languages?.find(({ id }) => !!containers?.find(({ language }) => id === language)));
39
- if (!!filters.conditions?.length)
40
- filtered = filtered.filter(({ conditions }) => !!filters.conditions?.find(({ id }) => !!conditions?.find(({ type, reason }) => id === `${type}#${reason}`)));
41
- if (!!filters.onlyErrors)
42
- filtered = filtered.filter((source) => !!source.conditions?.find((cond) => cond.status === StatusType.Error));
43
- if (!!filters.errors?.length)
44
- filtered = filtered.filter((source) => !!filters.errors?.find((error) => !!source.conditions?.find((cond) => cond.message === error.id)));
45
- return filtered;
46
- };
47
-
48
- const filterSourcesByStream = (sources, streamName) => {
49
- // if no stream is selected, return nothing (to prevent glitchy rendering)
50
- if (!streamName)
51
- return [];
52
- return sources.filter((source) => source.dataStreamNames.includes(streamName) || (streamName === DEFAULT_DATA_STREAM_NAME && !source.dataStreamNames.length));
53
- };
54
-
55
- const formatBytes = (bytes) => {
56
- if (!bytes)
57
- return '0 KB/s';
58
- const sizes = ['Bytes/s', 'KB/s', 'MB/s', 'GB/s', 'TB/s'];
59
- const i = Math.floor(Math.log(bytes) / Math.log(1024));
60
- const value = bytes / Math.pow(1024, i);
61
- return `${value.toFixed(i === 0 ? 0 : 1)} ${sizes[i]}`;
62
- };
63
-
64
- // 1000000000000000000 ns = 1 s
65
- // 1000000000000000 ns = 1 ms
66
- // 1000000000 ns = 1 μs
67
- // 1000000 ns = 1 ns
68
- // 1000 ns = 1 ns
69
- // 100 ns = 1 ns
70
- // 10 ns = 1 ns
71
- // 1 ns = 1 ns
72
- const formatDuration = (durationNanoseconds) => {
73
- if (!durationNanoseconds)
74
- return '0 ns';
75
- // Define time unit thresholds and conversion factors
76
- if (durationNanoseconds < 1000) {
77
- // Less than 1 microsecond - show in nanoseconds
78
- return `${durationNanoseconds.toFixed(0)} ns`;
79
- }
80
- else if (durationNanoseconds < 1000000) {
81
- // Less than 1 millisecond - show in microseconds
82
- const microseconds = durationNanoseconds / 1000;
83
- return `${microseconds.toFixed(microseconds < 10 ? 2 : 0)} μs`;
84
- }
85
- else if (durationNanoseconds < 1000000000) {
86
- // Less than 1 second - show in milliseconds
87
- const milliseconds = durationNanoseconds / 1000000;
88
- return `${milliseconds.toFixed(milliseconds < 10 ? 2 : 0)} ms`;
89
- }
90
- else if (durationNanoseconds < 60000000000) {
91
- // Less than 1 minute - show in seconds
92
- const seconds = durationNanoseconds / 1000000000;
93
- return `${seconds.toFixed(seconds < 10 ? 2 : 0)} s`;
94
- }
95
- else if (durationNanoseconds < 3600000000000) {
96
- // Less than 1 hour - show in minutes
97
- const minutes = durationNanoseconds / 60000000000;
98
- return `${minutes.toFixed(minutes < 10 ? 2 : 0)} m`;
99
- }
100
- else if (durationNanoseconds < 86400000000000) {
101
- // Less than 1 day - show in hours
102
- const hours = durationNanoseconds / 3600000000000;
103
- return `${hours.toFixed(hours < 10 ? 2 : 0)} h`;
104
- }
105
- else {
106
- // 1 day or more - show in days
107
- const days = durationNanoseconds / 86400000000000;
108
- return `${days.toFixed(days < 10 ? 2 : 0)} d`;
109
- }
110
- };
111
-
112
- const getContainersInstrumentedCount = (containers) => {
113
- const instrumentedCount = containers?.reduce((prev, curr) => (curr.instrumented ? prev + 1 : prev), 0);
114
- const totalCount = containers?.length || 0;
115
- return `${instrumentedCount}/${totalCount} instrumented`;
116
- };
117
-
118
- const getContainersIcons = (containers) => {
119
- const icons = containers?.map(({ language }) => getProgrammingLanguageIcon(language)) || [];
120
- return icons;
121
- };
122
-
123
- const getDestinationIcon = (type, forceFromUrl) => {
124
- const LOGOS = {
125
- [DestinationTypes.Alauda]: AlaudaLogo,
126
- [DestinationTypes.AlibabaCloud]: AlibabaCloudLogo,
127
- [DestinationTypes.AppDynamics]: AppDynamicsLogo,
128
- [DestinationTypes.Axiom]: AxiomLogo,
129
- [DestinationTypes.AzureBlob]: BlobStorageLogo,
130
- [DestinationTypes.BetterStack]: BetterStackLogo,
131
- [DestinationTypes.Bonree]: BonreeLogo,
132
- [DestinationTypes.Causely]: CauselyLogo,
133
- [DestinationTypes.Checkly]: ChecklyLogo,
134
- [DestinationTypes.Chronosphere]: ChronosphereLogo,
135
- [DestinationTypes.ClickHouse]: ClickhouseLogo,
136
- [DestinationTypes.CloudWatch]: AwsCloudwatchLogo,
137
- [DestinationTypes.Coralogix]: CoralogixLogo,
138
- [DestinationTypes.Dash0]: Dash0Logo,
139
- [DestinationTypes.Datadog]: DatadogLogo,
140
- [DestinationTypes.Dynamic]: OpenTelemetryLogo,
141
- [DestinationTypes.Dynatrace]: DynatraceLogo,
142
- [DestinationTypes.ElasticApm]: ElasticApmLogo,
143
- [DestinationTypes.ElasticSearch]: ElasticSearchLogo,
144
- [DestinationTypes.GoogleCloud]: GoogleCloudPlatformLogo,
145
- [DestinationTypes.GrafanaCloudLoki]: GrafanaLogo,
146
- [DestinationTypes.GrafanaCloudPrometheus]: GrafanaLogo,
147
- [DestinationTypes.GrafanaCloudTempo]: GrafanaLogo,
148
- [DestinationTypes.Greptime]: GreptimeLogo,
149
- [DestinationTypes.Groundcover]: GroundcoverLogo,
150
- [DestinationTypes.Honeycomb]: HoneycombLogo,
151
- [DestinationTypes.HyperDX]: HyperDxLogo,
152
- [DestinationTypes.Instana]: InstanaLogo,
153
- [DestinationTypes.Jaeger]: JaegerLogo,
154
- [DestinationTypes.Kafka]: KafkaLogo,
155
- [DestinationTypes.Kloudmate]: KloudmateLogo,
156
- [DestinationTypes.Last9]: Last9Logo,
157
- [DestinationTypes.Lightstep]: LightstepLogo,
158
- [DestinationTypes.LogzIo]: LogzioLogo,
159
- [DestinationTypes.Loki]: LokiLogo,
160
- [DestinationTypes.Lumigo]: LumigoLogo,
161
- [DestinationTypes.Middleware]: MiddlewareLogo,
162
- [DestinationTypes.NewRelic]: NewRelicLogo,
163
- [DestinationTypes.Observe]: ObserveLogo,
164
- [DestinationTypes.Odigos]: OdigosLogo,
165
- [DestinationTypes.OneUptime]: OneUptimeLogo,
166
- [DestinationTypes.OpenObserve]: OpenObserveLogo,
167
- [DestinationTypes.Opsverse]: OpsVerseLogo,
168
- [DestinationTypes.Oracle]: OracleLogo,
169
- [DestinationTypes.OTLP]: OpenTelemetryLogo,
170
- [DestinationTypes.OTLPHttp]: OpenTelemetryLogo,
171
- [DestinationTypes.Prometheus]: PrometheusLogo,
172
- [DestinationTypes.Qryn]: QrynLogo,
173
- [DestinationTypes.QrynOss]: GigapipeLogo,
174
- [DestinationTypes.Quickwit]: QuickwitLogo,
175
- [DestinationTypes.S3]: AwsS3Logo,
176
- [DestinationTypes.Seq]: SeqLogo,
177
- [DestinationTypes.Signoz]: SignozLogo,
178
- [DestinationTypes.Splunk]: SplunkLogo,
179
- [DestinationTypes.SplunkSapm]: SplunkLogo,
180
- [DestinationTypes.SplunkOtlp]: SplunkLogo,
181
- [DestinationTypes.SumoLogic]: SumoLogicLogo,
182
- [DestinationTypes.TelemetryHub]: TelemetryHubLogo,
183
- [DestinationTypes.Tempo]: TempoLogo,
184
- [DestinationTypes.Tingyun]: TingyunLogo,
185
- [DestinationTypes.Traceloop]: TraceloopLogo,
186
- [DestinationTypes.Uptrace]: UptraceLogo,
187
- [DestinationTypes.VictoriaMetrics]: VictoriaMetricsLogo,
188
- [DestinationTypes.VictoriaMetricsCloud]: VictoriaMetricsLogo,
189
- [DestinationTypes.XRay]: AwsXrayLogo,
190
- };
191
- const logo = LOGOS[type];
192
- if (logo && !forceFromUrl)
193
- return { icon: logo };
194
- // Fallback to fetched-icon (in-case new destinations were added, and we haven't added the icon to the kit yet)
195
- return { iconSrc: `https://d15jtxgb40qetw.cloudfront.net/${type}.svg` };
196
- };
197
-
198
- const getEntityIcon = (type) => {
199
- const LOGOS = {
200
- [EntityTypes.Namespace]: NamespacesIcon,
201
- [EntityTypes.Source]: SourcesIcon,
202
- [EntityTypes.Destination]: DestinationsIcon,
203
- [EntityTypes.Action]: ActionsIcon,
204
- [EntityTypes.InstrumentationRule]: RulesIcon,
205
- };
206
- return LOGOS[type];
207
- };
208
-
209
- const getEntityLabel = (entity, entityType, options) => {
210
- const { extended, prioritizeDisplayName } = options || {};
211
- let type = '';
212
- let name = '';
213
- switch (entityType) {
214
- case EntityTypes.InstrumentationRule:
215
- const rule = entity;
216
- type = rule.type;
217
- name = rule.ruleName;
218
- break;
219
- case EntityTypes.Source:
220
- const source = entity;
221
- type = source.name;
222
- name = source.otelServiceName;
223
- break;
224
- case EntityTypes.Action:
225
- const action = entity;
226
- type = action.type;
227
- name = action.spec.actionName;
228
- break;
229
- case EntityTypes.Destination:
230
- const destination = entity;
231
- type = destination.destinationType.displayName;
232
- name = destination.name;
233
- break;
234
- case EntityTypes.Namespace:
235
- const namespace = entity;
236
- type = namespace.name;
237
- name = namespace.name;
238
- break;
239
- }
240
- if (extended)
241
- return type + (name && name !== type ? ` (${name})` : '');
242
- else if (prioritizeDisplayName)
243
- return name || type;
244
- else
245
- return type;
246
- };
247
-
248
- const getMetricForEntity = (metrics, entityType, entityId) => {
249
- const metric = entityType === EntityTypes.Source
250
- ? metrics?.sources.find((m) => m.kind === entityId.kind && m.name === entityId.name && m.namespace === entityId.namespace)
251
- : metrics?.destinations.find((m) => m.id === entityId);
252
- return metric || { throughput: 0 };
253
- };
254
-
255
- const getRecursiveValues = (obj, childrenKey, returnKey) => {
256
- const children = obj[childrenKey];
257
- if (!children)
258
- return [];
259
- return children.flatMap((item) => {
260
- const values = item[returnKey];
261
- const result = [];
262
- if (values !== undefined) {
263
- if (Array.isArray(values)) {
264
- result.push(...values);
265
- }
266
- else {
267
- result.push(values);
268
- }
269
- }
270
- result.push(...getRecursiveValues(item, childrenKey, returnKey));
271
- return result;
272
- });
273
- };
274
-
275
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
276
- const getValueForRange = (current, matrix) => {
277
- // CURRENT: represents the current value (such as window width)
278
- // MATRIX: represents the ranges (index[0] == min, index[1] == max, index[2] == value to get)
279
- // EXAMPLE:
280
- // getValueForRange(width, [
281
- // [0, 1000, 'small'], // ---> from 0 to 1000, return "small"
282
- // [1000, null, 'big'], // ---> from 1000 to infinite, return "big"
283
- // ])
284
- const found = matrix.find(([min, max]) => current >= min && (max === null || current <= max));
285
- return found?.[2] || null;
286
- };
287
-
288
- const getWorkloadId = ({ namespace, name, kind }) => {
289
- return { namespace, name, kind };
290
- };
291
-
292
- const getYamlFieldsForDestination = (categories, destination) => {
293
- const fields = [];
294
- const parsedCategories = JSON.parse(JSON.stringify(categories));
295
- for (const category of parsedCategories) {
296
- const autoFilledFields = safeJsonParse(destination.fields, {});
297
- const idx = category.items.findIndex((item) => item.type === destination.destinationType.type);
298
- if (idx !== -1) {
299
- fields.push(...category.items[idx].fields.map((field) => ({
300
- ...field,
301
- initialValue: autoFilledFields[field.name],
302
- })));
303
- }
304
- }
305
- return fields;
306
- };
307
-
308
- const hasUnhealthyInstances = (containers, instances) => {
309
- const hasUnhealthy = (list) => list?.some(({ healthy }) => healthy.status !== StatusType.Success);
310
- if (containers?.length) {
311
- return containers.some(({ instrumentationInstances }) => hasUnhealthy(instrumentationInstances));
312
- }
313
- return hasUnhealthy(instances) ?? false;
314
- };
315
-
316
- const isOverTime = (originDate, difference = 0) => {
317
- const now = new Date().getTime();
318
- const compareWith = new Date(originDate).getTime();
319
- return compareWith - now <= difference;
320
- };
321
-
322
- const mapDestinationFieldsForDisplay = (destination, yamlFields) => {
323
- const parsedFields = safeJsonParse(destination.fields, {});
324
- if (!yamlFields.length) {
325
- return Object.entries(parsedFields).map(([key, value]) => ({
326
- key,
327
- name: key,
328
- value,
329
- }));
330
- }
331
- return yamlFields
332
- .map((field) => ({
333
- key: field.name,
334
- name: field.displayName || field.name,
335
- value: parsedFields[field.name] ?? null,
336
- }))
337
- .filter((item) => item.value !== null);
338
- };
339
-
340
- const sleep = async (ms = 1000) => new Promise((resolve) => setTimeout(resolve, ms));
341
-
342
- export { filterDestinations as a, filterDestinationsByStream as b, filterSources as c, filterSourcesByStream as d, formatBytes as e, filterActions as f, formatDuration as g, getContainersInstrumentedCount as h, getContainersIcons as i, getDestinationIcon as j, getEntityIcon as k, getEntityLabel as l, getMetricForEntity as m, getRecursiveValues as n, getValueForRange as o, getWorkloadId as p, getYamlFieldsForDestination as q, hasUnhealthyInstances as r, isOverTime as s, mapDestinationFieldsForDisplay as t, sleep as u };
@@ -1,225 +0,0 @@
1
- import { StatusType, OtherStatus, SignalType } from './types.js';
2
- import 'react';
3
- import './index-40dfa720.js';
4
- import 'styled-components';
5
- import { L as LogsIcon, M as MetricsIcon, T as TracesIcon, C as CheckCircledIcon, E as ErrorTriangleIcon, W as WarningTriangleIcon, I as InfoIcon, O as OdigosLogo } from './index-eff01b3d.js';
6
-
7
- const capitalizeFirstLetter = (string) => {
8
- return string.charAt(0).toUpperCase() + string.slice(1);
9
- };
10
-
11
- /**
12
- * Recursively flattens a nested object into a single-level object where each key
13
- * represents the path to its corresponding value in the original object. Keys for nested
14
- * properties are concatenated using a dot (`.`) as a separator, while array elements
15
- * include their index in square brackets (`[]`).
16
- *
17
- * @param {Record<string, any>} obj - The input object to be flattened.
18
- * @param {string} [prefix=''] - The current prefix for the keys, used for recursion.
19
- * @param {Record<string, any>} [result={}] - The accumulator object that stores the flattened result.
20
- * @returns {Record<string, any>} A new object where all nested properties are flattened into
21
- * a single level with their paths as keys.
22
- *
23
- * @example
24
- * const input = {
25
- * name: {
26
- * name: 'Name',
27
- * value: 'load-generator',
28
- * status: null,
29
- * explain: '...',
30
- * },
31
- * };
32
- *
33
- * const output = flattenObjectKeys(input);
34
- * Output:
35
- * {
36
- * 'name.name': 'Name',
37
- * 'name.value': 'load-generator',
38
- * 'name.status': null,
39
- * 'name.explain': '...',
40
- * }
41
- */
42
- const flattenObjectKeys = (obj, prefix = '', result = {}) => {
43
- for (const key in obj) {
44
- if (obj.hasOwnProperty(key)) {
45
- const value = obj[key];
46
- const newKey = prefix ? `${prefix}.${key}` : key;
47
- if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
48
- // Recurse for nested objects
49
- flattenObjectKeys(value, newKey, result);
50
- }
51
- else if (Array.isArray(value)) {
52
- value.forEach((item, index) => {
53
- const arrayKey = `${newKey}[${index}]`;
54
- if (item !== null && typeof item === 'object') {
55
- // Recurse for objects in arrays
56
- flattenObjectKeys(item, arrayKey, result);
57
- }
58
- else {
59
- // Assign primitive array values
60
- result[arrayKey] = item;
61
- }
62
- });
63
- }
64
- else {
65
- // Assign non-object, non-array values
66
- result[newKey] = value;
67
- }
68
- }
69
- }
70
- return result;
71
- };
72
-
73
- const getConditionsBooleans = (conditions) => {
74
- const errors = conditions?.filter(({ status }) => status === StatusType.Error);
75
- const warnings = conditions?.filter(({ status }) => status === StatusType.Warning);
76
- const disableds = conditions?.filter(({ status }) => status === OtherStatus.Disabled);
77
- const loadings = conditions?.filter(({ status }) => status === OtherStatus.Loading);
78
- const hasErrors = errors.length > 0;
79
- const hasWarnings = warnings.length > 0;
80
- const hasDisableds = disableds.length > 0;
81
- const hasLoadings = loadings.length > 0;
82
- const priorotizedStatus = hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : hasDisableds ? StatusType.Info : undefined;
83
- return {
84
- errors,
85
- hasErrors,
86
- warnings,
87
- hasWarnings,
88
- disableds,
89
- hasDisableds,
90
- loadings,
91
- hasLoadings,
92
- priorotizedStatus,
93
- };
94
- };
95
-
96
- const getMonitorIcon = (type) => {
97
- const LOGOS = {
98
- [SignalType.Logs]: LogsIcon,
99
- [SignalType.Metrics]: MetricsIcon,
100
- [SignalType.Traces]: TracesIcon,
101
- };
102
- return LOGOS[type];
103
- };
104
-
105
- const getStatusIcon = (type, theme) => {
106
- const LOGOS = {
107
- [StatusType.Success]: (props) => CheckCircledIcon({ fill: theme.text[type], ...props }),
108
- [StatusType.Error]: (props) => ErrorTriangleIcon({ fill: theme.text[type], ...props }),
109
- [StatusType.Warning]: (props) => WarningTriangleIcon({ fill: theme.text[type], ...props }),
110
- [StatusType.Info]: (props) => InfoIcon({ fill: theme.text[type], ...props }),
111
- [StatusType.Default]: (props) => OdigosLogo({ fill: theme.text[type], ...props }),
112
- };
113
- return LOGOS[type];
114
- };
115
-
116
- const isStringABoolean = (value) => {
117
- const normalizedValue = String(value).trim().toLowerCase();
118
- const booleanValues = ['true', 'false', '1', '0'];
119
- return booleanValues.includes(normalizedValue);
120
- };
121
-
122
- const SEMVER_REGEX = /^(\d+\.)?(\d+\.)?(\*|\d+)$/;
123
- const isValidVersion = (version) => SEMVER_REGEX.test(version);
124
-
125
- // Example: splitCamelString('LoremIpsumDolorSitAmet')
126
- // > 'Lorem Ipsum Dolor Sit Amet'
127
- const splitCamelString = (str) => {
128
- if (!str)
129
- return '';
130
- return str.replace(/([a-z0-9])([A-Z])/g, '$1 $2');
131
- };
132
-
133
- const mapConditions = (conditions) => {
134
- return (conditions?.map(({ status, type, reason, message, lastTransitionTime }) => ({
135
- status,
136
- type: splitCamelString(type),
137
- reason: !!reason ? splitCamelString(reason) : '',
138
- message,
139
- lastTransitionTime,
140
- })) || []);
141
- };
142
-
143
- const numbersOnly = (value) => {
144
- // Use a regular expression to replace all non-digit characters with an empty string
145
- const cleaned = value.replace(/[^\d]/g, '');
146
- return cleaned;
147
- };
148
-
149
- const parseBooleanFromString = (value) => {
150
- const normalizedValue = String(value).trim().toLowerCase();
151
- if (normalizedValue === 'true' || normalizedValue === '1') {
152
- return true;
153
- }
154
- else if (normalizedValue === 'false' || normalizedValue === '0') {
155
- return false;
156
- }
157
- else {
158
- console.warn(`Cannot parse boolean from string: "${value}"`);
159
- return false;
160
- }
161
- };
162
-
163
- const parseJsonStringToPrettyString = (value) => {
164
- let str = '';
165
- try {
166
- const parsed = JSON.parse(value);
167
- // Handle arrays
168
- if (Array.isArray(parsed)) {
169
- str = parsed
170
- .map((item) => {
171
- if (typeof item === 'object' && item !== null)
172
- return `${item.key}: ${item.value}`;
173
- else
174
- return item;
175
- })
176
- .join(', ');
177
- }
178
- // Handle objects (non-array JSON objects)
179
- else if (typeof parsed === 'object' && parsed !== null) {
180
- str = Object.entries(parsed)
181
- .map(([key, val]) => `${key}: ${val}`)
182
- .join(', ');
183
- }
184
- // Should never reach this if it's a string (it will throw)
185
- else {
186
- str = value;
187
- }
188
- }
189
- catch (_) {
190
- str = value;
191
- }
192
- return str;
193
- };
194
-
195
- const removeEmptyValuesFromObject = (obj) => {
196
- if (typeof obj !== 'object')
197
- return obj;
198
- const result = Array.isArray(obj) ? [] : {};
199
- Object.keys(obj).forEach((key) => {
200
- const value = obj[key];
201
- if (Array.isArray(value)) {
202
- // Remove empty arrays or recursively clean non-empty ones
203
- const filteredArray = value.filter((item) => item !== null && item !== undefined && item !== '');
204
- if (filteredArray.length > 0)
205
- result[key] = filteredArray.map((item) => removeEmptyValuesFromObject(item));
206
- }
207
- else if (typeof value === 'object' && value !== null) {
208
- // Recursively clean nested objects
209
- const nestedObject = removeEmptyValuesFromObject(value);
210
- if (Object.keys(nestedObject).length > 0)
211
- result[key] = nestedObject;
212
- }
213
- else if (![undefined, null, ''].includes(value)) {
214
- // Keep valid values
215
- result[key] = value;
216
- }
217
- });
218
- return result;
219
- };
220
-
221
- const safeJsonStringify = (obj, indent = 2) => {
222
- return JSON.stringify(obj || {}, null, indent);
223
- };
224
-
225
- export { getMonitorIcon as a, getStatusIcon as b, capitalizeFirstLetter as c, isValidVersion as d, parseJsonStringToPrettyString as e, flattenObjectKeys as f, getConditionsBooleans as g, splitCamelString as h, isStringABoolean as i, mapConditions as m, numbersOnly as n, parseBooleanFromString as p, removeEmptyValuesFromObject as r, safeJsonStringify as s };
@@ -1,64 +0,0 @@
1
- import React from 'react';
2
- import { T as Theme } from './index-40dfa720.js';
3
-
4
- const OdigosLogo = ({ size = 16, fill: f, rotate = 0, onClick }) => {
5
- const theme = Theme.useTheme();
6
- const fill = f || theme.text.secondary;
7
- return (React.createElement("svg", { xmlns: 'http://www.w3.org/2000/svg', width: size * (45 / 46), height: size, viewBox: '0 0 45 46', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
8
- React.createElement("path", { fill: fill, d: 'M13.3419 15.7211L5.3234 7.70753C5.11464 7.49889 4.83818 7.40209 4.56735 7.41243C4.28243 7.42371 4.0022 7.55528 3.81225 7.80151C2.51549 9.48185 1.46981 11.2938 0.675203 13.1865C0.543553 13.4995 0.515342 13.8368 0.579287 14.1564C0.643231 14.4759 0.800271 14.7766 1.041 15.0172L7.30662 21.279C7.63387 21.6061 7.79749 22.0337 7.79843 22.4622C7.79937 22.8908 7.63575 23.3231 7.30662 23.652L0.994926 29.9599C0.664859 30.2888 0.491833 30.7333 0.500296 31.1826C0.504058 31.3846 0.545434 31.5885 0.625364 31.7831C1.41151 33.6843 2.44966 35.5047 3.74078 37.1944C3.92509 37.4359 4.19591 37.5684 4.4752 37.5863C4.75355 37.6042 5.03942 37.5074 5.25476 37.2931L13.3428 29.2099C13.6052 28.9477 13.7359 28.6047 13.7359 28.2608C13.7359 27.9168 13.6052 27.5738 13.3428 27.3116L9.68103 23.652C9.35285 23.324 9.18923 22.8945 9.18923 22.4651C9.18923 22.0356 9.35285 21.6061 9.68103 21.2781L13.3419 17.6195C13.6042 17.3573 13.7349 17.0143 13.7349 16.6703C13.7349 16.3263 13.6042 15.9833 13.3419 15.7211Z' }),
9
- React.createElement("path", { fill: fill, d: 'M37.8343 40.1988L29.4021 31.7717C29.2197 31.5894 29.0053 31.4456 28.7721 31.3451C28.5229 31.2379 28.253 31.1815 27.9775 31.1815H18.0896C17.8225 31.1815 17.5611 31.2342 17.3185 31.3347C17.0759 31.4353 16.8539 31.5828 16.6649 31.7708L8.19417 40.2383C7.97977 40.4526 7.88291 40.7383 7.89984 41.0164C7.9177 41.2946 8.04841 41.5653 8.29009 41.7495C9.97615 43.0426 11.7948 44.083 13.6934 44.8715C13.984 44.9927 14.2962 45.0247 14.5943 44.9767C14.9375 44.9213 15.2638 44.7596 15.5205 44.504L21.8463 38.182C22.1623 37.8663 22.5732 37.7027 22.987 37.6915C23.4318 37.6792 23.8813 37.8428 24.2207 38.182L30.5211 44.4786C30.7609 44.7183 31.0628 44.8762 31.3825 44.9401C31.7022 45.004 32.0398 44.9758 32.353 44.8442C34.2469 44.051 36.0599 43.006 37.7412 41.7091C38.2218 41.3388 38.2641 40.6274 37.8353 40.1988H37.8343Z' }),
10
- React.createElement("path", { fill: fill, d: 'M22.9881 17.1844C25.9043 17.1844 28.2683 19.547 28.2683 22.4614C28.2683 25.3757 25.9043 27.7383 22.9881 27.7383C20.072 27.7383 17.708 25.3757 17.708 22.4614C17.708 19.547 20.072 17.1844 22.9881 17.1844Z' }),
11
- React.createElement("path", { fill: fill, d: 'M8.19413 4.80009L16.6263 13.2272C16.7909 13.3917 16.9809 13.5251 17.1868 13.6228C17.4539 13.7497 17.7491 13.8174 18.051 13.8174H27.9389C28.2059 13.8174 28.4674 13.7648 28.71 13.6642C28.9526 13.5636 29.1745 13.4161 29.3635 13.2281L37.8352 4.76156C38.028 4.5689 38.1258 4.31892 38.1305 4.06799C38.1371 3.76068 38.0045 3.45337 37.7384 3.25038C36.0523 1.95722 34.2336 0.916875 32.3351 0.12839C32.0219 -0.00130081 31.6853 -0.0294962 31.3665 0.0353489C31.0477 0.100195 30.7477 0.257142 30.5079 0.495849L24.1821 6.81782C23.854 7.14581 23.4242 7.30933 22.9945 7.30933C22.5647 7.30933 22.135 7.14581 21.8068 6.81782L15.5073 0.522162C15.2863 0.301312 15.0136 0.150946 14.7231 0.0785818C14.3817 -0.00693989 14.014 0.0156145 13.6755 0.156583C11.7816 0.949766 9.96859 1.99481 8.28723 3.29173C8.04744 3.47686 7.91673 3.74752 7.89886 4.02476C7.88193 4.302 7.97879 4.5877 8.19319 4.80197L8.19413 4.80009Z' }),
12
- React.createElement("path", { fill: fill, d: 'M32.6587 29.2787L40.6771 37.2923C40.8915 37.5066 41.1764 37.6034 41.4548 37.5865C41.7331 37.5696 42.003 37.4389 42.1883 37.1984C43.485 35.518 44.5307 33.7061 45.3253 31.8134C45.3911 31.6564 45.4306 31.4938 45.4466 31.3303C45.4936 30.8397 45.3197 30.3426 44.9595 29.9826L38.6939 23.7208C38.3657 23.3928 38.2021 22.9633 38.2021 22.5339C38.2021 22.1044 38.3657 21.6749 38.6939 21.3469L45.0065 15.0381C45.2454 14.7994 45.4024 14.4996 45.4673 14.1819C45.5322 13.8643 45.5049 13.5278 45.3751 13.2149C44.589 11.3137 43.5508 9.49333 42.2597 7.80358C42.0952 7.58837 41.8638 7.46056 41.6184 7.42203C41.3119 7.3741 40.9846 7.4662 40.7458 7.70585L32.6577 15.789C32.3954 16.0512 32.2646 16.3942 32.2646 16.7382C32.2646 17.0821 32.3954 17.4252 32.6577 17.6874L36.3195 21.3469C36.6383 21.6655 36.8019 22.0809 36.8113 22.4982C36.8207 22.9389 36.6571 23.3834 36.3195 23.7199L32.6587 27.3785C32.3963 27.6407 32.2656 27.9837 32.2656 28.3277C32.2656 28.6716 32.3963 29.0147 32.6587 29.2769V29.2787Z' })));
13
- };
14
-
15
- const LogsIcon = ({ size = 16, fill: f, rotate = 0, onClick, strokeWidth = 1 }) => {
16
- const theme = Theme.useTheme();
17
- const fill = f || theme.text.secondary;
18
- return (React.createElement("svg", { width: size * (16 / 17), height: size, viewBox: '0 0 16 17', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
19
- React.createElement("path", { stroke: fill, strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M2.66699 8.5H6.66699M2.66699 12.5H6.66699M2.66699 4.5L13.3337 4.5M12.4765 12.0146C13.0334 11.61 13.5322 11.1357 13.96 10.6043C14.0138 10.5375 14.0138 10.4441 13.96 10.3773C13.5322 9.84585 13.0334 9.37156 12.4765 8.96696M10.1908 8.96696C9.63389 9.37156 9.13508 9.84585 8.7073 10.3773C8.65356 10.4441 8.65356 10.5375 8.7073 10.6043C9.13508 11.1357 9.63389 11.61 10.1908 12.0146' })));
20
- };
21
-
22
- const MetricsIcon = ({ size = 16, fill: f, rotate = 0, onClick, strokeWidth = 1 }) => {
23
- const theme = Theme.useTheme();
24
- const fill = f || theme.text.secondary;
25
- return (React.createElement("svg", { width: size * (16 / 17), height: size, viewBox: '0 0 16 17', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
26
- React.createElement("path", { stroke: fill, strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M13.2389 9.1672C13.2389 12.4305 10.5935 15.0758 7.33025 15.0758V14.3373M13.2389 9.1672H14.0883C14.0883 5.43485 11.0626 2.40918 7.33025 2.40918V4.73571M13.2389 9.1672L7.33025 9.1672M7.33025 14.3373C4.47491 14.3373 2.16016 12.0225 2.16016 9.1672H2.89877M7.33025 14.3373L7.33025 9.1672M2.89877 9.1672C2.89877 6.71975 4.88281 4.73571 7.33025 4.73571M2.89877 9.1672H7.33025M7.33025 4.73571L7.33025 9.1672' })));
27
- };
28
-
29
- const TracesIcon = ({ size = 16, fill: f, rotate = 0, onClick, strokeWidth = 1 }) => {
30
- const theme = Theme.useTheme();
31
- const fill = f || theme.text.secondary;
32
- return (React.createElement("svg", { width: size * (16 / 17), height: size, viewBox: '0 0 16 17', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
33
- React.createElement("path", { stroke: fill, strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M10.3337 8.5C10.3337 9.60457 11.2291 10.5 12.3337 10.5C13.4382 10.5 14.3337 9.60457 14.3337 8.5C14.3337 7.39543 13.4382 6.5 12.3337 6.5C11.2291 6.5 10.3337 7.39543 10.3337 8.5ZM10.3337 8.5L8.00032 8.5M8.00032 8.5L8.00032 9.3C8.00032 10.4201 8.00032 10.9802 7.78234 11.408C7.59059 11.7843 7.28463 12.0903 6.90831 12.282C6.60852 12.4348 6.24381 12.4805 5.66698 12.4942M8.00032 8.5L8.00032 7.7C8.00032 6.57989 8.00032 6.01984 7.78234 5.59202C7.59059 5.21569 7.28463 4.90973 6.90831 4.71799C6.60852 4.56524 6.24381 4.51952 5.66698 4.50584M5.66698 12.4942C5.66383 11.3923 4.76961 10.5 3.66699 10.5C2.56242 10.5 1.66699 11.3954 1.66699 12.5C1.66699 13.6046 2.56242 14.5 3.66699 14.5C4.77156 14.5 5.66699 13.6046 5.66699 12.5C5.66699 12.4981 5.66699 12.4961 5.66698 12.4942ZM5.66698 4.50584C5.66383 5.60773 4.76961 6.5 3.66699 6.5C2.56242 6.5 1.66699 5.60457 1.66699 4.5C1.66699 3.39543 2.56242 2.5 3.66699 2.5C4.77156 2.5 5.66699 3.39543 5.66699 4.5C5.66699 4.50195 5.66699 4.5039 5.66698 4.50584Z' })));
34
- };
35
-
36
- const CheckCircledIcon = ({ size = 16, fill: f, rotate = 0, onClick, strokeWidth = 1 }) => {
37
- const theme = Theme.useTheme();
38
- const fill = f || theme.text.secondary;
39
- return (React.createElement("svg", { width: size, height: size * (16 / 17), viewBox: '0 0 17 16', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
40
- React.createElement("path", { stroke: fill, strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M6.41707 8.34197L7.97787 9.90111C8.72855 8.58846 9.76744 7.46337 11.0162 6.61065L11.0837 6.56453M14.8504 8.00039C14.8504 11.3693 12.1193 14.1004 8.75039 14.1004C5.38145 14.1004 2.65039 11.3693 2.65039 8.00039C2.65039 4.63145 5.38145 1.90039 8.75039 1.90039C12.1193 1.90039 14.8504 4.63145 14.8504 8.00039Z' })));
41
- };
42
-
43
- const ErrorTriangleIcon = ({ size = 16, fill: f, rotate = 0, onClick, strokeWidth = 1 }) => {
44
- const theme = Theme.useTheme();
45
- const fill = f || theme.text.error;
46
- return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
47
- React.createElement("path", { stroke: fill, strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M8 8.66673V6.00006M8 10.9167V10.9175M7.07337 2.18915C7.66595 1.93695 8.33405 1.93695 8.92662 2.18915C10.6942 2.94145 14.8697 9.61453 14.7474 11.3981C14.6994 12.0972 14.3529 12.7408 13.7982 13.1614C12.323 14.2795 3.67698 14.2795 2.20185 13.1614C1.64705 12.7408 1.3006 12.0972 1.25263 11.3981C1.13026 9.61453 5.30575 2.94145 7.07337 2.18915Z' })));
48
- };
49
-
50
- const InfoIcon = ({ size = 16, fill: f, rotate = 0, onClick, strokeWidth = 1 }) => {
51
- const theme = Theme.useTheme();
52
- const fill = f || theme.text.secondary;
53
- return (React.createElement("svg", { width: size * (16 / 17), height: size, viewBox: '0 0 16 17', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
54
- React.createElement("path", { stroke: fill, strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M8 8.91498V11.5816M8 6.66498V6.66423M14 8.91504C14 12.2287 11.3137 14.915 8 14.915C4.68629 14.915 2 12.2287 2 8.91504C2 5.60133 4.68629 2.91504 8 2.91504C11.3137 2.91504 14 5.60133 14 8.91504Z' })));
55
- };
56
-
57
- const WarningTriangleIcon = ({ size = 16, fill: f, rotate = 0, onClick, strokeWidth = 1 }) => {
58
- const theme = Theme.useTheme();
59
- const fill = f || theme.text.warning;
60
- return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
61
- React.createElement("path", { stroke: fill, strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M8 8.66673V6.00006M8 10.9167V10.9175M7.07337 2.18915C7.66595 1.93695 8.33405 1.93695 8.92662 2.18915C10.6942 2.94145 14.8697 9.61453 14.7474 11.3981C14.6994 12.0972 14.3529 12.7408 13.7982 13.1614C12.323 14.2795 3.67698 14.2795 2.20185 13.1614C1.64705 12.7408 1.3006 12.0972 1.25263 11.3981C1.13026 9.61453 5.30575 2.94145 7.07337 2.18915Z' })));
62
- };
63
-
64
- export { CheckCircledIcon as C, ErrorTriangleIcon as E, InfoIcon as I, LogsIcon as L, MetricsIcon as M, OdigosLogo as O, TracesIcon as T, WarningTriangleIcon as W };