@odigos/ui-kit 0.0.9 → 0.0.11
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 +21 -0
- package/lib/components/badge/index.d.ts +2 -2
- package/lib/components/data-card/data-card-fields/index.d.ts +14 -14
- package/lib/components/data-card/index.d.ts +2 -2
- package/lib/components/data-tab/index.d.ts +3 -3
- package/lib/components/delete-warning/index.d.ts +2 -2
- package/lib/components/describe-row/index.d.ts +2 -2
- package/lib/components/divider/index.d.ts +2 -2
- package/lib/components/drawer/drawer-header/index.d.ts +1 -1
- package/lib/components/icon-group/index.d.ts +2 -2
- package/lib/components/icon-wrapped/index.d.ts +2 -2
- package/lib/components/interactive-table/index.d.ts +2 -2
- package/lib/components/interactive-table/row.d.ts +2 -2
- package/lib/components/monitors-checkboxes/index.d.ts +4 -4
- package/lib/components/monitors-icons/index.d.ts +2 -2
- package/lib/components/notification-note/index.d.ts +2 -2
- package/lib/components/status/index.d.ts +2 -2
- package/lib/components/stepper/index.d.ts +1 -1
- package/lib/components/styled.d.ts +12 -0
- package/lib/components/warning-modal/index.d.ts +2 -2
- package/lib/components.js +8 -8
- package/lib/constants/strings/index.d.ts +11 -10
- package/lib/constants.js +4 -4
- package/lib/containers/action-drawer/build-card.d.ts +2 -2
- package/lib/containers/action-drawer/index.d.ts +2 -2
- package/lib/containers/action-form/custom-fields/index.d.ts +2 -2
- package/lib/containers/data-flow/edges/labeled-edge.d.ts +2 -2
- package/lib/containers/data-flow/helpers/get-main-container-language.d.ts +2 -2
- package/lib/containers/data-flow/helpers/get-node-positions.d.ts +2 -2
- package/lib/containers/data-flow/nodes/add-node.d.ts +3 -3
- package/lib/containers/data-flow/nodes/base-node.d.ts +5 -5
- package/lib/containers/data-flow/nodes/edged-node.d.ts +2 -2
- package/lib/containers/data-flow/nodes/frame-node.d.ts +2 -2
- package/lib/containers/data-flow/nodes/header-node.d.ts +2 -2
- package/lib/containers/data-flow/nodes/scroll-node.d.ts +5 -5
- package/lib/containers/data-flow/nodes/skeleton-node.d.ts +2 -2
- package/lib/containers/data-flow-actions-menu/index.d.ts +2 -2
- package/lib/containers/data-flow-actions-menu/search/search-results/builder.d.ts +2 -2
- package/lib/containers/destination-drawer/build-card.d.ts +2 -2
- package/lib/containers/destination-form/test-connection/index.d.ts +2 -2
- package/lib/containers/instrumentation-rule-drawer/build-card.d.ts +2 -2
- package/lib/containers/instrumentation-rule-form/custom-fields/index.d.ts +2 -2
- package/lib/containers/side-nav/index.d.ts +8 -8
- package/lib/containers/source-drawer/build-card.d.ts +1 -1
- package/lib/containers.js +380 -385
- package/lib/data/sources/index.d.ts +3 -3
- package/lib/functions/get-action-icon/index.d.ts +2 -2
- package/lib/functions/get-conditions-booleans/index.d.ts +2 -2
- package/lib/functions/get-entity-icon/index.d.ts +2 -2
- package/lib/functions/get-entity-label/index.d.ts +2 -2
- package/lib/functions/get-id-from-sse-target/index.d.ts +2 -2
- package/lib/functions/get-instrumentation-rule-icon/index.d.ts +2 -2
- package/lib/functions/get-metric-for-entity/index.d.ts +2 -2
- package/lib/functions/get-monitor-icon/index.d.ts +2 -2
- package/lib/functions/get-platform-icon/index.d.ts +2 -2
- package/lib/functions/get-platform-label/index.d.ts +2 -2
- package/lib/functions/get-programming-language-icon/index.d.ts +2 -2
- package/lib/functions/get-sse-target-from-id/index.d.ts +2 -2
- package/lib/functions/get-status-icon/index.d.ts +2 -2
- package/lib/functions/index.d.ts +0 -1
- package/lib/functions.js +9 -20
- package/lib/hooks.js +7 -7
- package/lib/icons.js +2 -2
- package/lib/{index-BFct3S32.js → index-7-KCQK-x.js} +2 -2
- package/lib/{index-ixs381n-.js → index-9ObpINp4.js} +4 -4
- package/lib/{index-m62aT4IR.js → index-B_fzHjxk.js} +111 -93
- package/lib/{index-g6Twdelv.js → index-BtuW12KL.js} +22 -22
- package/lib/{index-CZe2VX28.js → index-CJKFedQi.js} +31 -31
- package/lib/{index-Bc8gi9FH.js → index-CYn62h8x.js} +33 -33
- package/lib/{index-Cu2uHOuh.js → index-C_0J5P9M.js} +11 -10
- package/lib/{index-DIcomki-.js → index-DYEcdkUF.js} +19 -19
- package/lib/{index-BumPE6cF.js → index-Db_ZDrEr.js} +13 -13
- package/lib/store/useDrawerStore.d.ts +2 -2
- package/lib/store/useEntityStore.d.ts +5 -5
- package/lib/store/usePendingStore.d.ts +2 -2
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +14 -14
- package/lib/types/common/index.d.ts +80 -76
- package/lib/types/connection/index.d.ts +3 -3
- package/lib/types/data-flow/index.d.ts +15 -15
- package/lib/types/destinations/index.d.ts +2 -2
- package/lib/types/instrumentation-rules/index.d.ts +28 -28
- package/lib/types/signals/index.d.ts +5 -5
- package/lib/types/sources/index.d.ts +7 -7
- package/lib/types.js +164 -159
- package/lib/{useSourceSelectionFormData-BY6B70Kf.js → useSourceSelectionFormData-BnlRp8m3.js} +40 -40
- package/lib/{useTransition-Dfxjcy-C.js → useTransition-CFmm4scp.js} +23 -23
- package/package.json +10 -10
- package/lib/functions/derive-type-from-rule/index.d.ts +0 -2
package/lib/containers.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import React, { useState, useEffect, forwardRef, useImperativeHandle, useRef, useMemo, useId, memo, useContext, createContext, useCallback, useLayoutEffect, Fragment } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { A as ACTION_OPTIONS, M as MONITORS_OPTIONS, I as INSTRUMENTATION_RULE_OPTIONS } from './index-
|
|
4
|
-
import { D as DISPLAY_TITLES, F as FORM_ALERTS } from './index-
|
|
5
|
-
import {
|
|
6
|
-
import { f as
|
|
7
|
-
import { g as usePendingStore, f as useNotificationStore, a as useDrawerStore, b as useEntityStore, e as useModalStore, c as useFilterStore, s as styleInject, h as useSelectedStore, d as useInstrumentStore, k as getEntityId, i as useSetupStore, u as useDarkMode } from './index-
|
|
3
|
+
import { A as ACTION_OPTIONS, M as MONITORS_OPTIONS, I as INSTRUMENTATION_RULE_OPTIONS } from './index-CJKFedQi.js';
|
|
4
|
+
import { D as DISPLAY_TITLES, F as FORM_ALERTS } from './index-C_0J5P9M.js';
|
|
5
|
+
import { ActionType, EntityTypes, StatusType, Crud, OtherStatus, NodeTypes, AddNodeTypes, EdgeTypes, FieldTypes, SignalType, CodeAttributesKeyTypes, PayloadCollectionKeyTypes, InstrumentationRuleType } from './types.js';
|
|
6
|
+
import { f as DataCardFieldTypes, p as FieldLabel, b as Checkbox, o as FieldError, v as Input, x as InputTable, K as KeyValueInputsList, w as InputList, U as Text, O as Segment, S as SectionTitle, j as DocsButton, z as MonitorsCheckboxes, V as TextArea, k as Drawer, h as DeleteWarning, C as CancelWarning, d as ConditionDetails, D as DataCard, M as Modal, N as NavigationButtons, a2 as ModalBody, A as AutocompleteInput, i as Divider, Q as Status, _ as FlexRow, X as Tooltip, s as IconWrapped, G as MonitorsIcons, a3 as TableContainer, a4 as TableTitleWrap, r as IconTitleBadge, a5 as TableWrap, y as InteractiveTable, a0 as CenterThis, J as NoDataFound, $ as FlexColumn, Y as TraceLoader, a as Badge, B as Button, E as ExtendArrow, n as Dropdown, a6 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, P as SkeletonLoader, W as Toggle, L as NotificationNote, R as Stepper, I as IconButton, e as DataCardFields, t as IconsNav, q as IconGroup } from './index-B_fzHjxk.js';
|
|
7
|
+
import { g as usePendingStore, f as useNotificationStore, a as useDrawerStore, b as useEntityStore, e as useModalStore, c as useFilterStore, s as styleInject, h as useSelectedStore, d as useInstrumentStore, k as getEntityId, i as useSetupStore, u as useDarkMode } from './index-DYEcdkUF.js';
|
|
8
8
|
import Theme from './theme.js';
|
|
9
9
|
import { i as isEmpty, s as safeJsonParse } from './index-BZS1ijMm.js';
|
|
10
|
-
import { i as CheckCircledIcon, h as ErrorTriangleIcon, W as WarningTriangleIcon } from './index-
|
|
10
|
+
import { i as CheckCircledIcon, h as ErrorTriangleIcon, W as WarningTriangleIcon } from './index-9ObpINp4.js';
|
|
11
11
|
import { C as CrossCircledIcon, E as EditIcon, O as OdigosLogoText, b as OverviewIcon, F as FilterIcon, N as NotificationIcon, S as SlackLogo, a as FolderIcon, K as KeyIcon, T as TerminalIcon } from './index-3KUV6Vlt.js';
|
|
12
|
-
import { g as getActionIcon, a as getInstrumentationRuleIcon } from './index-
|
|
13
|
-
import { u as useActionFormData, a as useClickNode, c as useDestinationFormData, b as useClickNotification, d as useSourceFormData, e as useSourceSelectionFormData } from './useSourceSelectionFormData-
|
|
14
|
-
import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, c as useInstrumentationRuleFormData, g as useTransition, f as useTimeAgo, a as useCopy } from './useTransition-
|
|
12
|
+
import { g as getActionIcon, a as getInstrumentationRuleIcon } from './index-Db_ZDrEr.js';
|
|
13
|
+
import { u as useActionFormData, a as useClickNode, c as useDestinationFormData, b as useClickNotification, d as useSourceFormData, e as useSourceSelectionFormData } from './useSourceSelectionFormData-BnlRp8m3.js';
|
|
14
|
+
import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, c as useInstrumentationRuleFormData, g as useTransition, f as useTimeAgo, a as useCopy } from './useTransition-CFmm4scp.js';
|
|
15
15
|
import { T as TrashIcon, S as SearchIcon, P as PlusIcon$1, A as ArrowIcon, a as CopyIcon, f as CheckIcon, g as CrossIcon } from './index-D_Qn2U89.js';
|
|
16
|
-
import { m as mapConditions, b as getStatusIcon, c as capitalizeFirstLetter } from './index-
|
|
17
|
-
import { f as filterActions, g as getConditionsBooleans, j as getEntityLabel, i as getEntityIcon, s as sleep$1, l as getPlatformIcon, m as getPlatformLabel, d as formatBytes, h as getContainersIcons, n as getValueForRange, b as filterSources, a as filterDestinations, c as compareCondition, k as getMetricForEntity, e as getContainersInstrumentedCount, o as isOverTime } from './index-
|
|
16
|
+
import { m as mapConditions, b as getStatusIcon, c as capitalizeFirstLetter } from './index-CYn62h8x.js';
|
|
17
|
+
import { f as filterActions, g as getConditionsBooleans, j as getEntityLabel, i as getEntityIcon, s as sleep$1, l as getPlatformIcon, m as getPlatformLabel, d as formatBytes, h as getContainersIcons, n as getValueForRange, b as filterSources, a as filterDestinations, c as compareCondition, k as getMetricForEntity, e as getContainersInstrumentedCount, o as isOverTime } from './index-BtuW12KL.js';
|
|
18
18
|
import require$$1 from 'use-sync-external-store/shim';
|
|
19
19
|
import { createPortal } from 'react-dom';
|
|
20
20
|
import { O as OdigosLogo } from './index-BGlk5VhF.js';
|
|
@@ -26,24 +26,24 @@ import 'babel-runtime/helpers/createClass';
|
|
|
26
26
|
import 'babel-runtime/helpers/possibleConstructorReturn';
|
|
27
27
|
import 'babel-runtime/helpers/inherits';
|
|
28
28
|
import 'object-assign';
|
|
29
|
-
import './index-
|
|
29
|
+
import './index-7-KCQK-x.js';
|
|
30
30
|
|
|
31
31
|
const buildCard$3 = (action) => {
|
|
32
32
|
const { type, spec: { actionName, notes, signals, disabled, collectContainerAttributes, collectWorkloadId, collectClusterId, labelsAttributes, annotationsAttributes, clusterAttributes, attributeNamesToDelete, renames, piiCategories, fallbackSamplingRatio, samplingPercentage, endpointsFilters, }, } = action;
|
|
33
33
|
const arr = [
|
|
34
34
|
{ title: DISPLAY_TITLES.TYPE, value: type },
|
|
35
|
-
{ type:
|
|
36
|
-
{ type:
|
|
35
|
+
{ type: DataCardFieldTypes.ActiveStatus, title: DISPLAY_TITLES.STATUS, value: String(!disabled) },
|
|
36
|
+
{ type: DataCardFieldTypes.Monitors, title: DISPLAY_TITLES.SIGNALS_FOR_PROCESSING, value: signals.map((str) => str.toLowerCase()).join(', ') },
|
|
37
37
|
{ title: DISPLAY_TITLES.NAME, value: actionName },
|
|
38
38
|
{ title: DISPLAY_TITLES.NOTES, value: notes },
|
|
39
|
-
{ type:
|
|
39
|
+
{ type: DataCardFieldTypes.Divider },
|
|
40
40
|
];
|
|
41
|
-
if (type ===
|
|
41
|
+
if (type === ActionType.K8sAttributes) {
|
|
42
42
|
arr.push({ title: 'Collect Container Attributes', value: String(collectContainerAttributes) });
|
|
43
43
|
arr.push({ title: 'Collect Workload ID', value: String(collectWorkloadId) });
|
|
44
44
|
arr.push({ title: 'Collect Cluster ID', value: String(collectClusterId) });
|
|
45
45
|
if (!!labelsAttributes?.length)
|
|
46
|
-
arr.push({ type:
|
|
46
|
+
arr.push({ type: DataCardFieldTypes.Divider });
|
|
47
47
|
labelsAttributes?.forEach(({ labelKey, attributeKey }, idx) => {
|
|
48
48
|
let str = '';
|
|
49
49
|
str += `Label Key: ${labelKey}\n`;
|
|
@@ -51,7 +51,7 @@ const buildCard$3 = (action) => {
|
|
|
51
51
|
arr.push({ title: `Label${labelsAttributes.length > 1 ? ` #${idx + 1}` : ''}`, value: str });
|
|
52
52
|
});
|
|
53
53
|
if (!!annotationsAttributes?.length)
|
|
54
|
-
arr.push({ type:
|
|
54
|
+
arr.push({ type: DataCardFieldTypes.Divider });
|
|
55
55
|
annotationsAttributes?.forEach(({ annotationKey, attributeKey }, idx) => {
|
|
56
56
|
let str = '';
|
|
57
57
|
str += `Annotation Key: ${annotationKey}\n`;
|
|
@@ -59,7 +59,7 @@ const buildCard$3 = (action) => {
|
|
|
59
59
|
arr.push({ title: `Annotation${annotationsAttributes.length > 1 ? ` #${idx + 1}` : ''}`, value: str });
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
if (type ===
|
|
62
|
+
if (type === ActionType.AddClusterInfo) {
|
|
63
63
|
let str = '';
|
|
64
64
|
clusterAttributes?.forEach(({ attributeName, attributeStringValue }, idx) => {
|
|
65
65
|
str += `${attributeName}: ${attributeStringValue}`;
|
|
@@ -68,7 +68,7 @@ const buildCard$3 = (action) => {
|
|
|
68
68
|
});
|
|
69
69
|
arr.push({ title: 'Attributes', value: str });
|
|
70
70
|
}
|
|
71
|
-
if (type ===
|
|
71
|
+
if (type === ActionType.DeleteAttributes) {
|
|
72
72
|
let str = '';
|
|
73
73
|
attributeNamesToDelete?.forEach((attributeName, idx) => {
|
|
74
74
|
str += attributeName;
|
|
@@ -77,7 +77,7 @@ const buildCard$3 = (action) => {
|
|
|
77
77
|
});
|
|
78
78
|
arr.push({ title: 'Attributes', value: str });
|
|
79
79
|
}
|
|
80
|
-
if (type ===
|
|
80
|
+
if (type === ActionType.RenameAttributes) {
|
|
81
81
|
let str = '';
|
|
82
82
|
const entries = Object.entries(renames || {});
|
|
83
83
|
entries.forEach(([oldName, newName], idx) => {
|
|
@@ -87,7 +87,7 @@ const buildCard$3 = (action) => {
|
|
|
87
87
|
});
|
|
88
88
|
arr.push({ title: 'Attributes', value: str });
|
|
89
89
|
}
|
|
90
|
-
if (type ===
|
|
90
|
+
if (type === ActionType.PiiMasking) {
|
|
91
91
|
let str = '';
|
|
92
92
|
piiCategories?.forEach((attributeName, idx) => {
|
|
93
93
|
str += attributeName;
|
|
@@ -96,13 +96,13 @@ const buildCard$3 = (action) => {
|
|
|
96
96
|
});
|
|
97
97
|
arr.push({ title: 'Categories', value: str });
|
|
98
98
|
}
|
|
99
|
-
if (type ===
|
|
99
|
+
if (type === ActionType.ErrorSampler) {
|
|
100
100
|
arr.push({ title: 'Sampling Ratio', value: String(fallbackSamplingRatio) });
|
|
101
101
|
}
|
|
102
|
-
if (type ===
|
|
102
|
+
if (type === ActionType.ProbabilisticSampler) {
|
|
103
103
|
arr.push({ title: 'Sampling Percentage', value: String(samplingPercentage) });
|
|
104
104
|
}
|
|
105
|
-
if (type ===
|
|
105
|
+
if (type === ActionType.LatencySampler) {
|
|
106
106
|
endpointsFilters?.forEach(({ serviceName, httpRoute, minimumLatencyThreshold, fallbackSamplingRatio }, idx) => {
|
|
107
107
|
let str = '';
|
|
108
108
|
str += `Service Name: ${serviceName}\n`;
|
|
@@ -291,14 +291,14 @@ const ProbabilisticSampler = ({ value, setValue, formErrors }) => {
|
|
|
291
291
|
};
|
|
292
292
|
|
|
293
293
|
const componentsMap$1 = {
|
|
294
|
-
[
|
|
295
|
-
[
|
|
296
|
-
[
|
|
297
|
-
[
|
|
298
|
-
[
|
|
299
|
-
[
|
|
300
|
-
[
|
|
301
|
-
[
|
|
294
|
+
[ActionType.K8sAttributes]: K8sAttributes,
|
|
295
|
+
[ActionType.AddClusterInfo]: AddClusterInfo,
|
|
296
|
+
[ActionType.DeleteAttributes]: DeleteAttributes,
|
|
297
|
+
[ActionType.RenameAttributes]: RenameAttributes,
|
|
298
|
+
[ActionType.PiiMasking]: PiiMasking,
|
|
299
|
+
[ActionType.ErrorSampler]: ErrorSampler,
|
|
300
|
+
[ActionType.ProbabilisticSampler]: ProbabilisticSampler,
|
|
301
|
+
[ActionType.LatencySampler]: LatencySampler,
|
|
302
302
|
};
|
|
303
303
|
const CustomFields$1 = ({ actionType, value, setValue, formErrors }) => {
|
|
304
304
|
if (!actionType)
|
|
@@ -341,7 +341,7 @@ const OverviewDrawer = ({ children, width = 640, title, titleTooltip, icon, icon
|
|
|
341
341
|
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
|
|
342
342
|
const [isCancelModalOpen, setIsCancelModalOpen] = useState(false);
|
|
343
343
|
const titleRef = useRef(null);
|
|
344
|
-
const isSource = drawerType ===
|
|
344
|
+
const isSource = drawerType === EntityTypes.Source;
|
|
345
345
|
const closeDrawer = () => {
|
|
346
346
|
setDrawerType(null);
|
|
347
347
|
setDrawerEntityId(null);
|
|
@@ -361,7 +361,7 @@ const OverviewDrawer = ({ children, width = 640, title, titleTooltip, icon, icon
|
|
|
361
361
|
closeWarningModals();
|
|
362
362
|
};
|
|
363
363
|
const clickCancel = () => {
|
|
364
|
-
const isTitleDirty = titleRef.current?.
|
|
364
|
+
const isTitleDirty = titleRef.current?.isTitleDirty();
|
|
365
365
|
if (isFormDirty || isTitleDirty) {
|
|
366
366
|
setIsCancelModalOpen(true);
|
|
367
367
|
}
|
|
@@ -391,7 +391,7 @@ const OverviewDrawer = ({ children, width = 640, title, titleTooltip, icon, icon
|
|
|
391
391
|
}, [drawerType, drawerEntityId]);
|
|
392
392
|
const handlePending = (action) => {
|
|
393
393
|
addNotification({
|
|
394
|
-
type:
|
|
394
|
+
type: StatusType.Warning,
|
|
395
395
|
title: 'Pending',
|
|
396
396
|
message: `Cannot click ${action}, ${drawerType} is pending`,
|
|
397
397
|
hideFromHistory: true,
|
|
@@ -422,7 +422,7 @@ const OverviewDrawer = ({ children, width = 640, title, titleTooltip, icon, icon
|
|
|
422
422
|
iconSrc,
|
|
423
423
|
title,
|
|
424
424
|
titleTooltip,
|
|
425
|
-
replaceTitleWith: !isSource && isEdit ?
|
|
425
|
+
replaceTitleWith: !isSource && isEdit ? React.createElement(EditTitle, { ref: titleRef, title: title }) : undefined,
|
|
426
426
|
actionButtons,
|
|
427
427
|
tabs,
|
|
428
428
|
}, footer: {
|
|
@@ -461,7 +461,8 @@ const EditTitle = forwardRef(({ title }, ref) => {
|
|
|
461
461
|
setInputValue(title);
|
|
462
462
|
}, [title]);
|
|
463
463
|
useImperativeHandle(ref, () => ({
|
|
464
|
-
getTitle: () => inputValue,
|
|
464
|
+
getTitle: () => inputValue || title,
|
|
465
|
+
isTitleDirty: () => inputValue !== title,
|
|
465
466
|
clearTitle: () => setInputValue(title),
|
|
466
467
|
}));
|
|
467
468
|
return React.createElement(Input, { "data-id": 'title', value: inputValue, onChange: (e) => setInputValue(e.target.value) });
|
|
@@ -482,7 +483,7 @@ const DataContainer$3 = styled.div `
|
|
|
482
483
|
const ActionDrawer = ({ updateAction, deleteAction }) => {
|
|
483
484
|
const { actions } = useEntityStore();
|
|
484
485
|
const { drawerType, drawerEntityId, setDrawerEntityId, setDrawerType } = useDrawerStore();
|
|
485
|
-
const isOpen = drawerType !==
|
|
486
|
+
const isOpen = drawerType !== EntityTypes.Action;
|
|
486
487
|
const onClose = () => {
|
|
487
488
|
setDrawerType(null);
|
|
488
489
|
setDrawerEntityId(null);
|
|
@@ -520,7 +521,7 @@ const ActionDrawer = ({ updateAction, deleteAction }) => {
|
|
|
520
521
|
onClose();
|
|
521
522
|
};
|
|
522
523
|
const handleSave = (newTitle) => {
|
|
523
|
-
if (validateForm({ withAlert: true, alertTitle:
|
|
524
|
+
if (validateForm({ withAlert: true, alertTitle: Crud.Update })) {
|
|
524
525
|
const title = newTitle !== thisItem.type ? newTitle : '';
|
|
525
526
|
handleFormChange('name', title);
|
|
526
527
|
updateAction(drawerEntityId, { ...formData, name: title });
|
|
@@ -539,7 +540,7 @@ const ActionDrawer = ({ updateAction, deleteAction }) => {
|
|
|
539
540
|
|
|
540
541
|
const ActionModal = ({ createAction }) => {
|
|
541
542
|
const { currentModal, setCurrentModal } = useModalStore();
|
|
542
|
-
const isOpen = currentModal ===
|
|
543
|
+
const isOpen = currentModal === EntityTypes.Action;
|
|
543
544
|
const { formData, formErrors, handleFormChange, resetFormData, validateForm } = useActionFormData();
|
|
544
545
|
const [selectedItem, setSelectedItem] = useState(undefined);
|
|
545
546
|
const handleClose = () => {
|
|
@@ -553,7 +554,7 @@ const ActionModal = ({ createAction }) => {
|
|
|
553
554
|
setSelectedItem(item);
|
|
554
555
|
};
|
|
555
556
|
const handleSubmit = () => {
|
|
556
|
-
const isFormOk = validateForm({ withAlert: true, alertTitle:
|
|
557
|
+
const isFormOk = validateForm({ withAlert: true, alertTitle: Crud.Create });
|
|
557
558
|
if (!isFormOk)
|
|
558
559
|
return null;
|
|
559
560
|
createAction(formData);
|
|
@@ -579,7 +580,7 @@ const ActionModal = ({ createAction }) => {
|
|
|
579
580
|
const buildSpecCell$1 = (action) => {
|
|
580
581
|
const { type, spec: { collectContainerAttributes, collectWorkloadId, collectClusterId, labelsAttributes, annotationsAttributes, clusterAttributes, attributeNamesToDelete, renames, piiCategories, fallbackSamplingRatio, samplingPercentage, endpointsFilters, }, } = action;
|
|
581
582
|
let str = '';
|
|
582
|
-
if (type ===
|
|
583
|
+
if (type === ActionType.K8sAttributes) {
|
|
583
584
|
if (collectContainerAttributes)
|
|
584
585
|
str += 'Container Attributes, ';
|
|
585
586
|
if (collectWorkloadId)
|
|
@@ -595,21 +596,21 @@ const buildSpecCell$1 = (action) => {
|
|
|
595
596
|
;
|
|
596
597
|
});
|
|
597
598
|
}
|
|
598
|
-
if (type ===
|
|
599
|
+
if (type === ActionType.AddClusterInfo) {
|
|
599
600
|
clusterAttributes?.forEach(({ attributeName, attributeStringValue }, idx) => {
|
|
600
601
|
str += `${attributeName}: ${attributeStringValue}`;
|
|
601
602
|
if (idx < clusterAttributes.length - 1)
|
|
602
603
|
str += ', ';
|
|
603
604
|
});
|
|
604
605
|
}
|
|
605
|
-
if (type ===
|
|
606
|
+
if (type === ActionType.DeleteAttributes) {
|
|
606
607
|
attributeNamesToDelete?.forEach((attributeName, idx) => {
|
|
607
608
|
str += attributeName;
|
|
608
609
|
if (idx < attributeNamesToDelete.length - 1)
|
|
609
610
|
str += ', ';
|
|
610
611
|
});
|
|
611
612
|
}
|
|
612
|
-
if (type ===
|
|
613
|
+
if (type === ActionType.RenameAttributes) {
|
|
613
614
|
const entries = Object.entries(renames || {});
|
|
614
615
|
entries.forEach(([oldName, newName], idx) => {
|
|
615
616
|
str += `${oldName}: ${newName}`;
|
|
@@ -617,21 +618,21 @@ const buildSpecCell$1 = (action) => {
|
|
|
617
618
|
str += ', ';
|
|
618
619
|
});
|
|
619
620
|
}
|
|
620
|
-
if (type ===
|
|
621
|
+
if (type === ActionType.PiiMasking) {
|
|
621
622
|
piiCategories?.forEach((attributeName, idx) => {
|
|
622
623
|
str += attributeName;
|
|
623
624
|
if (idx < piiCategories.length - 1)
|
|
624
625
|
str += ', ';
|
|
625
626
|
});
|
|
626
627
|
}
|
|
627
|
-
if (type ===
|
|
628
|
+
if (type === ActionType.ErrorSampler) {
|
|
628
629
|
str += String(fallbackSamplingRatio);
|
|
629
630
|
}
|
|
630
|
-
if (type ===
|
|
631
|
+
if (type === ActionType.ProbabilisticSampler) {
|
|
631
632
|
str += String(samplingPercentage);
|
|
632
633
|
str += '%';
|
|
633
634
|
}
|
|
634
|
-
if (type ===
|
|
635
|
+
if (type === ActionType.LatencySampler) {
|
|
635
636
|
endpointsFilters?.forEach(({ serviceName, httpRoute, minimumLatencyThreshold, fallbackSamplingRatio }, idx) => {
|
|
636
637
|
str += `Endpoint${endpointsFilters.length > 1 ? ` #${idx + 1}` : ''}=${serviceName}${httpRoute}`;
|
|
637
638
|
str += ` Latency=${minimumLatencyThreshold}`;
|
|
@@ -644,32 +645,27 @@ const buildSpecCell$1 = (action) => {
|
|
|
644
645
|
};
|
|
645
646
|
|
|
646
647
|
const TableCellConditions = ({ conditions }) => {
|
|
647
|
-
const errors = useMemo(() => conditions?.filter(({ status }) => status ===
|
|
648
|
-
const warnings = useMemo(() => conditions?.filter(({ status }) => status ===
|
|
649
|
-
const disableds = useMemo(() => conditions?.filter(({ status }) => status ===
|
|
650
|
-
const isLoading = useMemo(() => !conditions?.length || !!conditions?.find(({ status }) => status ===
|
|
651
|
-
return (React.createElement("div", { style: { lineHeight: 1 } }, errors.length > 0 ? (React.createElement(ConditionsStatuses, { conditions: errors })) : warnings.length > 0 ? (React.createElement(ConditionsStatuses, { conditions: warnings })) : disableds.length > 0 ? (React.createElement(ConditionsStatuses, { conditions: disableds })) : isLoading ? (React.createElement(Status, { status:
|
|
648
|
+
const errors = useMemo(() => conditions?.filter(({ status }) => status === StatusType.Error) || [], [conditions]);
|
|
649
|
+
const warnings = useMemo(() => conditions?.filter(({ status }) => status === StatusType.Warning) || [], [conditions]);
|
|
650
|
+
const disableds = useMemo(() => conditions?.filter(({ status }) => status === OtherStatus.Disabled) || [], [conditions]);
|
|
651
|
+
const isLoading = useMemo(() => !conditions?.length || !!conditions?.find(({ status }) => status === OtherStatus.Loading), [conditions]);
|
|
652
|
+
return (React.createElement("div", { style: { lineHeight: 1 } }, errors.length > 0 ? (React.createElement(ConditionsStatuses, { conditions: errors })) : warnings.length > 0 ? (React.createElement(ConditionsStatuses, { conditions: warnings })) : disableds.length > 0 ? (React.createElement(ConditionsStatuses, { conditions: disableds })) : isLoading ? (React.createElement(Status, { status: OtherStatus.Loading, title: OtherStatus.Loading, withBorder: true, withIcon: true })) : (React.createElement(Status, { status: StatusType.Success, title: StatusType.Success, withBorder: true, withIcon: true }))));
|
|
652
653
|
};
|
|
653
654
|
const ConditionsStatuses = ({ conditions }) => {
|
|
654
655
|
const theme = Theme.useTheme();
|
|
655
656
|
return (React.createElement(FlexRow, null, mapConditions(conditions).map(({ status, type, reason, message, lastTransitionTime }) => {
|
|
656
657
|
if (status === 'loading' || status === 'disabled')
|
|
657
|
-
status =
|
|
658
|
+
status = StatusType.Info;
|
|
658
659
|
const icon = getStatusIcon(status, theme);
|
|
659
660
|
return (React.createElement(Tooltip, { key: useId(), titleIcon: icon, title: type, text: message || reason || '', timestamp: lastTransitionTime },
|
|
660
661
|
React.createElement(Status, { status: status, title: reason || type, withBorder: true, withIcon: true })));
|
|
661
662
|
})));
|
|
662
663
|
};
|
|
663
664
|
|
|
664
|
-
const TableWrap$3 = styled.div `
|
|
665
|
-
width: 100%;
|
|
666
|
-
max-height: ${({ $maxHeight }) => $maxHeight || 'unset'};
|
|
667
|
-
overflow-y: auto;
|
|
668
|
-
`;
|
|
669
665
|
const columns$3 = [
|
|
670
666
|
{ key: 'icon', title: '' },
|
|
671
667
|
{ key: 'name', title: DISPLAY_TITLES.NAME, sortable: true },
|
|
672
|
-
{ key: 'signals', title: DISPLAY_TITLES.
|
|
668
|
+
{ key: 'signals', title: DISPLAY_TITLES.Monitors },
|
|
673
669
|
{ key: 'active-status', title: DISPLAY_TITLES.STATUS },
|
|
674
670
|
{ key: 'conditions', title: 'Conditions' },
|
|
675
671
|
{ key: 'type', title: DISPLAY_TITLES.TYPE, sortable: true },
|
|
@@ -679,13 +675,13 @@ const columns$3 = [
|
|
|
679
675
|
const ActionTable = ({ maxHeight, maxWidth }) => {
|
|
680
676
|
const theme = Theme.useTheme();
|
|
681
677
|
const filters = useFilterStore();
|
|
682
|
-
const { actions } = useEntityStore();
|
|
678
|
+
const { actions, actionsLoading } = useEntityStore();
|
|
683
679
|
const { setDrawerType, setDrawerEntityId } = useDrawerStore();
|
|
684
680
|
const filtered = useMemo(() => filterActions(actions, filters), [actions, filters]);
|
|
685
681
|
const rows = useMemo(() => filtered.map((act) => {
|
|
686
682
|
const { hasErrors, hasWarnings, hasDisableds } = getConditionsBooleans(act.conditions || []);
|
|
687
683
|
return {
|
|
688
|
-
status: hasErrors ?
|
|
684
|
+
status: hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : undefined,
|
|
689
685
|
faded: hasDisableds,
|
|
690
686
|
cells: [
|
|
691
687
|
{
|
|
@@ -694,7 +690,7 @@ const ActionTable = ({ maxHeight, maxWidth }) => {
|
|
|
694
690
|
},
|
|
695
691
|
{
|
|
696
692
|
columnKey: 'name',
|
|
697
|
-
value: getEntityLabel(act,
|
|
693
|
+
value: getEntityLabel(act, EntityTypes.Action, { prioritizeDisplayName: true }),
|
|
698
694
|
},
|
|
699
695
|
{
|
|
700
696
|
columnKey: 'type',
|
|
@@ -724,17 +720,19 @@ const ActionTable = ({ maxHeight, maxWidth }) => {
|
|
|
724
720
|
{
|
|
725
721
|
columnKey: 'active-status',
|
|
726
722
|
component: () => (React.createElement("div", { style: { lineHeight: 1 } },
|
|
727
|
-
React.createElement(Status, { status: act.spec.disabled ?
|
|
723
|
+
React.createElement(Status, { status: act.spec.disabled ? StatusType.Error : StatusType.Success, title: act.spec.disabled ? 'Inactive' : 'Active', withIcon: true, withBorder: true }))),
|
|
728
724
|
},
|
|
729
725
|
],
|
|
730
726
|
};
|
|
731
727
|
}), [filtered]);
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
React.createElement(
|
|
728
|
+
const badge = useMemo(() => (filtered.length !== actions.length ? `${filtered.length}/${actions.length}` : actions.length), [filtered, actions]);
|
|
729
|
+
const badgeTooltip = useMemo(() => (filtered.length !== actions.length ? DISPLAY_TITLES.FILTERED_COUNT_TOOLTIP : undefined), [filtered, actions]);
|
|
730
|
+
return (React.createElement(TableContainer, { "$maxWidth": maxWidth },
|
|
731
|
+
React.createElement(TableTitleWrap, null,
|
|
732
|
+
React.createElement(IconTitleBadge, { icon: getEntityIcon(EntityTypes.Action), title: DISPLAY_TITLES.Actions, badge: badge, badgeTooltip: badgeTooltip, loading: actionsLoading })),
|
|
733
|
+
React.createElement(TableWrap, { "$maxHeight": maxHeight },
|
|
736
734
|
React.createElement(InteractiveTable, { columns: columns$3, rows: rows, onRowClick: (idx) => {
|
|
737
|
-
setDrawerType(
|
|
735
|
+
setDrawerType(EntityTypes.Action);
|
|
738
736
|
setDrawerEntityId(filtered[idx].id);
|
|
739
737
|
} })),
|
|
740
738
|
!filtered.length && (React.createElement(CenterThis, { style: { marginTop: '2rem' } },
|
|
@@ -898,13 +896,13 @@ const ComputePlatformSelect = ({ connections, selected, onSelect, onViewAll }) =
|
|
|
898
896
|
isOpen && withSelect && (React.createElement(AbsoluteContainer$2, null,
|
|
899
897
|
React.createElement(HeadWrap, null,
|
|
900
898
|
React.createElement(Input, { placeholder: 'Search...', icon: SearchIcon, value: searchText, onChange: (e) => setSearchText(e.target.value.toLowerCase()) })),
|
|
901
|
-
React.createElement(VerticalScroll$1, { style: { maxHeight: '240px' } }, filtered.map(({ id, type, name, status }, idx) => (React.createElement(SelectionButton, { key: `platform-${id}`, icon: () => getPlatformIcon(type)({ fill: status ===
|
|
902
|
-
if (status ===
|
|
899
|
+
React.createElement(VerticalScroll$1, { style: { maxHeight: '240px' } }, filtered.map(({ id, type, name, status }, idx) => (React.createElement(SelectionButton, { key: `platform-${id}`, icon: () => getPlatformIcon(type)({ fill: status === StatusType.Success ? theme.text.success : theme.text.error }), label: `${!!name ? name : getPlatformLabel(type)} (${id})`, isSelected: selected?.id === id, onClick: () => {
|
|
900
|
+
if (status === StatusType.Success) {
|
|
903
901
|
onSelect(filtered[idx]);
|
|
904
902
|
}
|
|
905
903
|
else {
|
|
906
904
|
addNotification({
|
|
907
|
-
type:
|
|
905
|
+
type: StatusType.Warning,
|
|
908
906
|
title: 'Connection lost',
|
|
909
907
|
message: 'Cannot connect to this platform',
|
|
910
908
|
hideFromHistory: true,
|
|
@@ -937,7 +935,7 @@ const ComputePlatforms = ({ connections, onSelect }) => {
|
|
|
937
935
|
{
|
|
938
936
|
columnKey: 'status',
|
|
939
937
|
component: () => (React.createElement("div", { style: { lineHeight: 1 } },
|
|
940
|
-
React.createElement(Status, { title: status ===
|
|
938
|
+
React.createElement(Status, { title: status === StatusType.Success ? 'connection alive' : 'connection lost', status: status, withIcon: true, withBorder: true }))),
|
|
941
939
|
},
|
|
942
940
|
],
|
|
943
941
|
})), onRowClick: (idx) => onSelect(filtered[idx]) }),
|
|
@@ -980,7 +978,7 @@ const ErrorDropdown = ({ title = 'Error Message', value, onSelect, onDeselect, d
|
|
|
980
978
|
// instead, it is now optional and we should fallback to "reason" which is also optional.
|
|
981
979
|
sources.forEach(({ conditions }) => {
|
|
982
980
|
mapConditions(conditions || []).forEach(({ status, message, reason }) => {
|
|
983
|
-
if (status ===
|
|
981
|
+
if (status === StatusType.Error && !payload.find((opt) => opt.id === message)) {
|
|
984
982
|
if (!!message) {
|
|
985
983
|
if (!payload.find((opt) => opt.id === message))
|
|
986
984
|
payload.push({ id: message, value: message });
|
|
@@ -12694,12 +12692,12 @@ const Container$i = styled.div `
|
|
|
12694
12692
|
`;
|
|
12695
12693
|
const BaseNode = memo(({ id: nodeId, data }) => {
|
|
12696
12694
|
const { nodeWidth, id: entityId, type: entityType, status, faded, title, subTitle, icon, icons, iconSrc, iconSrcs, monitors, isActive, raw } = data;
|
|
12697
|
-
const isSource = entityType ===
|
|
12695
|
+
const isSource = entityType === EntityTypes.Source;
|
|
12698
12696
|
const { isThisPending } = usePendingStore();
|
|
12699
12697
|
const isPending = isThisPending({ entityType, entityId });
|
|
12700
12698
|
const renderActions = () => {
|
|
12701
12699
|
const sourceIsInstrumenting = isSource && (!raw.conditions?.length || raw.conditions?.some(({ status }) => status === 'loading'));
|
|
12702
|
-
return (React.createElement(React.Fragment, null, isPending ? (React.createElement(FadeLoader, null)) : status ===
|
|
12700
|
+
return (React.createElement(React.Fragment, null, isPending ? (React.createElement(FadeLoader, null)) : status === StatusType.Error ? (React.createElement(ErrorTriangleIcon, { size: 20 })) : status === StatusType.Warning ? (React.createElement(WarningTriangleIcon, { size: 20 })) : sourceIsInstrumenting ? (React.createElement(FadeLoader, null)) : null));
|
|
12703
12701
|
};
|
|
12704
12702
|
const { selectedSources, setSelectedSources } = useSelectedStore();
|
|
12705
12703
|
const namespaces = { ...selectedSources };
|
|
@@ -12729,7 +12727,7 @@ const Container$h = styled.div `
|
|
|
12729
12727
|
`;
|
|
12730
12728
|
const EdgedNode = memo(({ data }) => {
|
|
12731
12729
|
const { nodeWidth, nodeHeight } = data;
|
|
12732
|
-
return (React.createElement(Container$h, { "$nodeWidth": nodeWidth, "$nodeHeight": nodeHeight },
|
|
12730
|
+
return (React.createElement(Container$h, { "$nodeWidth": nodeWidth, "$nodeHeight": nodeHeight, className: 'nowheel nodrag' },
|
|
12733
12731
|
React.createElement(Handle, { type: 'source', position: Position.Right, style: { visibility: 'hidden' } }),
|
|
12734
12732
|
React.createElement(Handle, { type: 'target', position: Position.Left, style: { visibility: 'hidden' } })));
|
|
12735
12733
|
});
|
|
@@ -12750,6 +12748,7 @@ const FrameNode = memo(({ data }) => {
|
|
|
12750
12748
|
|
|
12751
12749
|
const Container$f = styled.div `
|
|
12752
12750
|
position: relative;
|
|
12751
|
+
z-index: 1;
|
|
12753
12752
|
width: ${({ $nodeWidth }) => $nodeWidth}px;
|
|
12754
12753
|
height: ${({ $nodeHeight }) => $nodeHeight}px;
|
|
12755
12754
|
background: transparent;
|
|
@@ -12814,7 +12813,7 @@ const ScrollNode = memo(({ data, ...rest }) => {
|
|
|
12814
12813
|
// @ts-ignore
|
|
12815
12814
|
onClickNode(e, item);
|
|
12816
12815
|
} },
|
|
12817
|
-
React.createElement(BaseNode, { ...rest, type:
|
|
12816
|
+
React.createElement(BaseNode, { ...rest, type: NodeTypes.Base, id: item.id, data: item.data })))),
|
|
12818
12817
|
React.createElement(LoadMoreWrapper, { "$hide": isBottomOfList })));
|
|
12819
12818
|
});
|
|
12820
12819
|
|
|
@@ -12855,7 +12854,7 @@ const HeaderNode = memo(({ id: nodeId, data }) => {
|
|
|
12855
12854
|
const { nodeWidth, title, icon: Icon, badge, badgeTooltip, isFetching, sources } = data;
|
|
12856
12855
|
const entityType = nodeId.split('-')[0];
|
|
12857
12856
|
const { isAwaitingInstrumentation, sourcesToCreate, sourcesCreated, sourcesToDelete, sourcesDeleted } = useInstrumentStore();
|
|
12858
|
-
const isSourceAwaitingInstrumentation = entityType ===
|
|
12857
|
+
const isSourceAwaitingInstrumentation = entityType === EntityTypes.Source && isAwaitingInstrumentation;
|
|
12859
12858
|
const instrumentingPercent = (!!sourcesToCreate ? Math.floor((100 / sourcesToCreate) * sourcesCreated) : !!sourcesToDelete ? Math.floor((100 / sourcesToDelete) * sourcesDeleted) : 0) || 1;
|
|
12860
12859
|
const { selectedSources, setSelectedSources } = useSelectedStore();
|
|
12861
12860
|
const { isThisPending } = usePendingStore();
|
|
@@ -12871,7 +12870,7 @@ const HeaderNode = memo(({ id: nodeId, data }) => {
|
|
|
12871
12870
|
const payload = {};
|
|
12872
12871
|
sources?.forEach((source) => {
|
|
12873
12872
|
const id = { namespace: source.namespace, name: source.name, kind: source.kind };
|
|
12874
|
-
const isPending = isThisPending({ entityType:
|
|
12873
|
+
const isPending = isThisPending({ entityType: EntityTypes.Source, entityId: id });
|
|
12875
12874
|
if (!isPending) {
|
|
12876
12875
|
if (!payload[source.namespace]) {
|
|
12877
12876
|
payload[source.namespace] = [source];
|
|
@@ -12888,7 +12887,7 @@ const HeaderNode = memo(({ id: nodeId, data }) => {
|
|
|
12888
12887
|
}
|
|
12889
12888
|
};
|
|
12890
12889
|
return (React.createElement(Container$e, { "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
|
|
12891
|
-
entityType ===
|
|
12890
|
+
entityType === EntityTypes.Source && (React.createElement(SelectorWrapper, null,
|
|
12892
12891
|
React.createElement(Checkbox, { partiallyChecked: hasSelected && sources?.length !== totalSelectedSources, value: hasSelected && sources?.length === totalSelectedSources, onChange: onSelect, disabled: !sources?.length }))),
|
|
12893
12892
|
React.createElement(IconTitleBadge, { icon: Icon, title: title, badge: isSourceAwaitingInstrumentation ? `${instrumentingPercent}%` : badge, badgeTooltip: badgeTooltip, loading: isFetching && !isSourceAwaitingInstrumentation }),
|
|
12894
12893
|
React.createElement(Actions$1, { entityType: entityType }),
|
|
@@ -12903,13 +12902,13 @@ const Actions$1 = memo(({ entityType }) => {
|
|
|
12903
12902
|
// @ts-ignore
|
|
12904
12903
|
onClickNode(undefined, {
|
|
12905
12904
|
data: {
|
|
12906
|
-
type: entityType ===
|
|
12907
|
-
?
|
|
12908
|
-
: entityType ===
|
|
12909
|
-
?
|
|
12910
|
-
: entityType ===
|
|
12911
|
-
?
|
|
12912
|
-
:
|
|
12905
|
+
type: entityType === EntityTypes.Source
|
|
12906
|
+
? AddNodeTypes.AddSource
|
|
12907
|
+
: entityType === EntityTypes.Destination
|
|
12908
|
+
? AddNodeTypes.AddDestination
|
|
12909
|
+
: entityType === EntityTypes.Action
|
|
12910
|
+
? AddNodeTypes.AddAction
|
|
12911
|
+
: AddNodeTypes.AddRule,
|
|
12913
12912
|
},
|
|
12914
12913
|
});
|
|
12915
12914
|
} },
|
|
@@ -12980,16 +12979,16 @@ const ControllerWrapper = styled.div `
|
|
|
12980
12979
|
}
|
|
12981
12980
|
`;
|
|
12982
12981
|
const nodeTypes = {
|
|
12983
|
-
[
|
|
12984
|
-
[
|
|
12985
|
-
[
|
|
12986
|
-
[
|
|
12987
|
-
[
|
|
12988
|
-
[
|
|
12989
|
-
[
|
|
12982
|
+
[NodeTypes.Header]: HeaderNode,
|
|
12983
|
+
[NodeTypes.Add]: AddNode,
|
|
12984
|
+
[NodeTypes.Base]: BaseNode,
|
|
12985
|
+
[NodeTypes.Edged]: EdgedNode,
|
|
12986
|
+
[NodeTypes.Frame]: FrameNode,
|
|
12987
|
+
[NodeTypes.Scroll]: ScrollNode,
|
|
12988
|
+
[NodeTypes.Skeleton]: SkeletonNode,
|
|
12990
12989
|
};
|
|
12991
12990
|
const edgeTypes = {
|
|
12992
|
-
[
|
|
12991
|
+
[EdgeTypes.Labeled]: LabeledEdge,
|
|
12993
12992
|
};
|
|
12994
12993
|
const Flow = ({ nodes, edges, onNodesChange, onEdgesChange }) => {
|
|
12995
12994
|
const { onClickNode } = useClickNode();
|
|
@@ -13018,7 +13017,7 @@ const createEdge = (edgeId, params) => {
|
|
|
13018
13017
|
const [sourceNodeId, targetNodeId] = edgeId.split('-to-');
|
|
13019
13018
|
return {
|
|
13020
13019
|
id: edgeId,
|
|
13021
|
-
type: !!label ?
|
|
13020
|
+
type: !!label ? EdgeTypes.Labeled : 'default',
|
|
13022
13021
|
source: sourceNodeId,
|
|
13023
13022
|
target: targetNodeId,
|
|
13024
13023
|
animated,
|
|
@@ -13028,9 +13027,9 @@ const createEdge = (edgeId, params) => {
|
|
|
13028
13027
|
};
|
|
13029
13028
|
const buildEdges = ({ theme, nodes, metrics, containerHeight }) => {
|
|
13030
13029
|
const edges = [];
|
|
13031
|
-
const actionNodeId = nodes.find(({ id: nodeId }) => [`${
|
|
13030
|
+
const actionNodeId = nodes.find(({ id: nodeId }) => [`${EntityTypes.Action}-${NodeTypes.Frame}`, `${EntityTypes.Action}-${NodeTypes.Add}`].includes(nodeId))?.id;
|
|
13032
13031
|
nodes.forEach(({ type: nodeType, id: nodeId, data: { type: entityType, id: entityId, status }, position }) => {
|
|
13033
|
-
if (nodeType ===
|
|
13032
|
+
if (nodeType === NodeTypes.Edged && entityType === EntityTypes.Source) {
|
|
13034
13033
|
const { namespace, name, kind } = entityId;
|
|
13035
13034
|
const metric = metrics?.sources.find((m) => m.kind === kind && m.name === name && m.namespace === namespace);
|
|
13036
13035
|
const topLimit = -80 / 2 + framePadding$2;
|
|
@@ -13041,18 +13040,18 @@ const buildEdges = ({ theme, nodes, metrics, containerHeight }) => {
|
|
|
13041
13040
|
animated: false,
|
|
13042
13041
|
isMultiTarget: false,
|
|
13043
13042
|
label: formatBytes(metric?.throughput),
|
|
13044
|
-
isError: status ===
|
|
13043
|
+
isError: status === StatusType.Error,
|
|
13045
13044
|
}));
|
|
13046
13045
|
}
|
|
13047
13046
|
}
|
|
13048
|
-
if (nodeType ===
|
|
13047
|
+
if (nodeType === NodeTypes.Base && entityType === EntityTypes.Destination) {
|
|
13049
13048
|
const metric = metrics?.destinations.find((m) => m.id === entityId);
|
|
13050
13049
|
edges.push(createEdge(`${actionNodeId}-to-${nodeId}`, {
|
|
13051
13050
|
theme,
|
|
13052
13051
|
animated: false,
|
|
13053
13052
|
isMultiTarget: true,
|
|
13054
13053
|
label: formatBytes(metric?.throughput),
|
|
13055
|
-
isError: status ===
|
|
13054
|
+
isError: status === StatusType.Error,
|
|
13056
13055
|
}));
|
|
13057
13056
|
}
|
|
13058
13057
|
});
|
|
@@ -13064,9 +13063,9 @@ const mapToNodeData$3 = (entity) => {
|
|
|
13064
13063
|
return {
|
|
13065
13064
|
nodeWidth: nodeWidth$4,
|
|
13066
13065
|
id: entity.ruleId,
|
|
13067
|
-
type:
|
|
13066
|
+
type: EntityTypes.InstrumentationRule,
|
|
13068
13067
|
status: undefined,
|
|
13069
|
-
title: getEntityLabel(entity,
|
|
13068
|
+
title: getEntityLabel(entity, EntityTypes.InstrumentationRule, { prioritizeDisplayName: true }),
|
|
13070
13069
|
subTitle: entity.type,
|
|
13071
13070
|
icon: getInstrumentationRuleIcon(entity.type),
|
|
13072
13071
|
isActive: !entity.disabled,
|
|
@@ -13075,18 +13074,18 @@ const mapToNodeData$3 = (entity) => {
|
|
|
13075
13074
|
};
|
|
13076
13075
|
const buildRuleNodes = ({ loading, entities, positions, unfilteredCount }) => {
|
|
13077
13076
|
const nodes = [];
|
|
13078
|
-
const position = positions[
|
|
13077
|
+
const position = positions[EntityTypes.InstrumentationRule];
|
|
13079
13078
|
nodes.push({
|
|
13080
|
-
id: `${
|
|
13081
|
-
type:
|
|
13079
|
+
id: `${EntityTypes.InstrumentationRule}-${NodeTypes.Header}`,
|
|
13080
|
+
type: NodeTypes.Header,
|
|
13082
13081
|
position: {
|
|
13083
|
-
x: positions[
|
|
13082
|
+
x: positions[EntityTypes.InstrumentationRule]['x'],
|
|
13084
13083
|
y: 0,
|
|
13085
13084
|
},
|
|
13086
13085
|
data: {
|
|
13087
13086
|
nodeWidth: nodeWidth$4,
|
|
13088
|
-
title:
|
|
13089
|
-
icon: getEntityIcon(
|
|
13087
|
+
title: DISPLAY_TITLES.InstrumentationRules,
|
|
13088
|
+
icon: getEntityIcon(EntityTypes.InstrumentationRule),
|
|
13090
13089
|
badge: unfilteredCount,
|
|
13091
13090
|
isFetching: loading,
|
|
13092
13091
|
},
|
|
@@ -13094,8 +13093,8 @@ const buildRuleNodes = ({ loading, entities, positions, unfilteredCount }) => {
|
|
|
13094
13093
|
if (!!entities.length) {
|
|
13095
13094
|
entities.forEach((rule, idx) => {
|
|
13096
13095
|
nodes.push({
|
|
13097
|
-
id: `${
|
|
13098
|
-
type:
|
|
13096
|
+
id: `${EntityTypes.InstrumentationRule}-${idx}`,
|
|
13097
|
+
type: NodeTypes.Base,
|
|
13099
13098
|
position: {
|
|
13100
13099
|
x: position['x'],
|
|
13101
13100
|
y: position['y'](idx),
|
|
@@ -13106,8 +13105,8 @@ const buildRuleNodes = ({ loading, entities, positions, unfilteredCount }) => {
|
|
|
13106
13105
|
}
|
|
13107
13106
|
else if (loading) {
|
|
13108
13107
|
nodes.push({
|
|
13109
|
-
id: `${
|
|
13110
|
-
type:
|
|
13108
|
+
id: `${EntityTypes.InstrumentationRule}-${NodeTypes.Skeleton}`,
|
|
13109
|
+
type: NodeTypes.Skeleton,
|
|
13111
13110
|
position: {
|
|
13112
13111
|
x: position['x'],
|
|
13113
13112
|
y: position['y'](),
|
|
@@ -13119,15 +13118,15 @@ const buildRuleNodes = ({ loading, entities, positions, unfilteredCount }) => {
|
|
|
13119
13118
|
}
|
|
13120
13119
|
else {
|
|
13121
13120
|
nodes.push({
|
|
13122
|
-
id: `${
|
|
13123
|
-
type:
|
|
13121
|
+
id: `${EntityTypes.InstrumentationRule}-${NodeTypes.Add}`,
|
|
13122
|
+
type: NodeTypes.Add,
|
|
13124
13123
|
position: {
|
|
13125
13124
|
x: position['x'],
|
|
13126
13125
|
y: position['y'](),
|
|
13127
13126
|
},
|
|
13128
13127
|
data: {
|
|
13129
13128
|
nodeWidth: nodeWidth$4,
|
|
13130
|
-
type:
|
|
13129
|
+
type: AddNodeTypes.AddRule,
|
|
13131
13130
|
title: 'ADD RULE',
|
|
13132
13131
|
subTitle: 'To modify OpenTelemetry data',
|
|
13133
13132
|
},
|
|
@@ -13142,10 +13141,10 @@ const mapToNodeData$2 = (entity) => {
|
|
|
13142
13141
|
return {
|
|
13143
13142
|
nodeWidth: nodeWidth$3,
|
|
13144
13143
|
id: entity.id,
|
|
13145
|
-
type:
|
|
13144
|
+
type: EntityTypes.Action,
|
|
13146
13145
|
status: priorotizedStatus,
|
|
13147
13146
|
faded: hasDisableds,
|
|
13148
|
-
title: getEntityLabel(entity,
|
|
13147
|
+
title: getEntityLabel(entity, EntityTypes.Action, { prioritizeDisplayName: true }),
|
|
13149
13148
|
subTitle: entity.type,
|
|
13150
13149
|
icon: getActionIcon(entity.type),
|
|
13151
13150
|
monitors: entity.spec.signals,
|
|
@@ -13155,26 +13154,26 @@ const mapToNodeData$2 = (entity) => {
|
|
|
13155
13154
|
};
|
|
13156
13155
|
const buildActionNodes = ({ loading, entities, positions, unfilteredCount }) => {
|
|
13157
13156
|
const nodes = [];
|
|
13158
|
-
const position = positions[
|
|
13157
|
+
const position = positions[EntityTypes.Action];
|
|
13159
13158
|
nodes.push({
|
|
13160
|
-
id: `${
|
|
13161
|
-
type:
|
|
13159
|
+
id: `${EntityTypes.Action}-${NodeTypes.Header}`,
|
|
13160
|
+
type: NodeTypes.Header,
|
|
13162
13161
|
position: {
|
|
13163
|
-
x: positions[
|
|
13162
|
+
x: positions[EntityTypes.Action]['x'],
|
|
13164
13163
|
y: 0,
|
|
13165
13164
|
},
|
|
13166
13165
|
data: {
|
|
13167
13166
|
nodeWidth: nodeWidth$3,
|
|
13168
|
-
title:
|
|
13169
|
-
icon: getEntityIcon(
|
|
13167
|
+
title: DISPLAY_TITLES.Actions,
|
|
13168
|
+
icon: getEntityIcon(EntityTypes.Action),
|
|
13170
13169
|
badge: unfilteredCount,
|
|
13171
13170
|
isFetching: loading,
|
|
13172
13171
|
},
|
|
13173
13172
|
});
|
|
13174
13173
|
if (!!entities.length) {
|
|
13175
13174
|
nodes.push({
|
|
13176
|
-
id: `${
|
|
13177
|
-
type:
|
|
13175
|
+
id: `${EntityTypes.Action}-${NodeTypes.Frame}`,
|
|
13176
|
+
type: NodeTypes.Frame,
|
|
13178
13177
|
position: {
|
|
13179
13178
|
x: position['x'] - framePadding$1,
|
|
13180
13179
|
y: position['y']() - framePadding$1,
|
|
@@ -13186,10 +13185,10 @@ const buildActionNodes = ({ loading, entities, positions, unfilteredCount }) =>
|
|
|
13186
13185
|
});
|
|
13187
13186
|
entities.forEach((action, idx) => {
|
|
13188
13187
|
nodes.push({
|
|
13189
|
-
id: `${
|
|
13190
|
-
type:
|
|
13188
|
+
id: `${EntityTypes.Action}-${idx}`,
|
|
13189
|
+
type: NodeTypes.Base,
|
|
13191
13190
|
extent: 'parent',
|
|
13192
|
-
parentId: `${
|
|
13191
|
+
parentId: `${EntityTypes.Action}-${NodeTypes.Frame}`,
|
|
13193
13192
|
position: {
|
|
13194
13193
|
x: framePadding$1,
|
|
13195
13194
|
y: position['y'](idx) - (nodeHeight$2 - framePadding$1),
|
|
@@ -13200,8 +13199,8 @@ const buildActionNodes = ({ loading, entities, positions, unfilteredCount }) =>
|
|
|
13200
13199
|
}
|
|
13201
13200
|
else if (loading) {
|
|
13202
13201
|
nodes.push({
|
|
13203
|
-
id: `${
|
|
13204
|
-
type:
|
|
13202
|
+
id: `${EntityTypes.Action}-${NodeTypes.Skeleton}`,
|
|
13203
|
+
type: NodeTypes.Skeleton,
|
|
13205
13204
|
position: {
|
|
13206
13205
|
x: position['x'],
|
|
13207
13206
|
y: position['y'](),
|
|
@@ -13213,16 +13212,16 @@ const buildActionNodes = ({ loading, entities, positions, unfilteredCount }) =>
|
|
|
13213
13212
|
}
|
|
13214
13213
|
else {
|
|
13215
13214
|
nodes.push({
|
|
13216
|
-
id: `${
|
|
13217
|
-
type:
|
|
13215
|
+
id: `${EntityTypes.Action}-${NodeTypes.Add}`,
|
|
13216
|
+
type: NodeTypes.Add,
|
|
13218
13217
|
position: {
|
|
13219
13218
|
x: position['x'],
|
|
13220
13219
|
y: position['y'](),
|
|
13221
13220
|
},
|
|
13222
13221
|
data: {
|
|
13223
13222
|
nodeWidth: nodeWidth$3,
|
|
13224
|
-
type:
|
|
13225
|
-
title: 'ADD
|
|
13223
|
+
type: AddNodeTypes.AddAction,
|
|
13224
|
+
title: 'ADD Action',
|
|
13226
13225
|
subTitle: 'To modify OpenTelemetry data',
|
|
13227
13226
|
},
|
|
13228
13227
|
});
|
|
@@ -13242,10 +13241,10 @@ const mapToNodeData$1 = (entity) => {
|
|
|
13242
13241
|
name: entity.name,
|
|
13243
13242
|
kind: entity.kind,
|
|
13244
13243
|
},
|
|
13245
|
-
type:
|
|
13244
|
+
type: EntityTypes.Source,
|
|
13246
13245
|
status: priorotizedStatus,
|
|
13247
13246
|
faded: hasDisableds,
|
|
13248
|
-
title: getEntityLabel(entity,
|
|
13247
|
+
title: getEntityLabel(entity, EntityTypes.Source, { extended: true }),
|
|
13249
13248
|
subTitle: `${entity.namespace} • ${entity.kind}`,
|
|
13250
13249
|
icons: getContainersIcons(entity.containers),
|
|
13251
13250
|
raw: entity,
|
|
@@ -13253,29 +13252,29 @@ const mapToNodeData$1 = (entity) => {
|
|
|
13253
13252
|
};
|
|
13254
13253
|
const buildSourceNodes = ({ loading, entities, positions, unfilteredCount, containerHeight, onScroll }) => {
|
|
13255
13254
|
const nodes = [];
|
|
13256
|
-
const position = positions[
|
|
13255
|
+
const position = positions[EntityTypes.Source];
|
|
13257
13256
|
const hasFiltersApplied = entities.length !== unfilteredCount;
|
|
13258
13257
|
nodes.push({
|
|
13259
|
-
id: `${
|
|
13260
|
-
type:
|
|
13258
|
+
id: `${EntityTypes.Source}-${NodeTypes.Header}`,
|
|
13259
|
+
type: NodeTypes.Header,
|
|
13261
13260
|
position: {
|
|
13262
|
-
x: positions[
|
|
13261
|
+
x: positions[EntityTypes.Source]['x'],
|
|
13263
13262
|
y: 0,
|
|
13264
13263
|
},
|
|
13265
13264
|
data: {
|
|
13266
13265
|
nodeWidth: nodeWidth$2,
|
|
13267
|
-
title:
|
|
13268
|
-
icon: getEntityIcon(
|
|
13266
|
+
title: DISPLAY_TITLES.Sources,
|
|
13267
|
+
icon: getEntityIcon(EntityTypes.Source),
|
|
13269
13268
|
badge: hasFiltersApplied ? `${entities.length}/${unfilteredCount}` : unfilteredCount,
|
|
13270
|
-
badgeTooltip: hasFiltersApplied ?
|
|
13269
|
+
badgeTooltip: hasFiltersApplied ? DISPLAY_TITLES.FILTERED_COUNT_TOOLTIP : undefined,
|
|
13271
13270
|
isFetching: loading,
|
|
13272
13271
|
sources: entities,
|
|
13273
13272
|
},
|
|
13274
13273
|
});
|
|
13275
13274
|
if (!!entities.length) {
|
|
13276
13275
|
nodes.push({
|
|
13277
|
-
id: `${
|
|
13278
|
-
type:
|
|
13276
|
+
id: `${EntityTypes.Source}-${NodeTypes.Scroll}`,
|
|
13277
|
+
type: NodeTypes.Scroll,
|
|
13279
13278
|
position: {
|
|
13280
13279
|
x: position['x'],
|
|
13281
13280
|
y: position['y']() - framePadding,
|
|
@@ -13287,7 +13286,7 @@ const buildSourceNodes = ({ loading, entities, positions, unfilteredCount, conta
|
|
|
13287
13286
|
nodeWidth: nodeWidth$2,
|
|
13288
13287
|
nodeHeight: containerHeight - nodeHeight$1 + framePadding * 2,
|
|
13289
13288
|
items: entities.map((source, idx) => ({
|
|
13290
|
-
id: `${
|
|
13289
|
+
id: `${EntityTypes.Source}-${idx}`,
|
|
13291
13290
|
data: mapToNodeData$1(source),
|
|
13292
13291
|
})),
|
|
13293
13292
|
onScroll,
|
|
@@ -13295,10 +13294,10 @@ const buildSourceNodes = ({ loading, entities, positions, unfilteredCount, conta
|
|
|
13295
13294
|
});
|
|
13296
13295
|
entities.forEach((source, idx) => {
|
|
13297
13296
|
nodes.push({
|
|
13298
|
-
id: `${
|
|
13299
|
-
type:
|
|
13297
|
+
id: `${EntityTypes.Source}-${idx}-hidden`,
|
|
13298
|
+
type: NodeTypes.Edged,
|
|
13300
13299
|
extent: 'parent',
|
|
13301
|
-
parentId: `${
|
|
13300
|
+
parentId: `${EntityTypes.Source}-${NodeTypes.Scroll}`,
|
|
13302
13301
|
position: {
|
|
13303
13302
|
x: framePadding,
|
|
13304
13303
|
y: position['y'](idx) - (nodeHeight$1 - framePadding / 2),
|
|
@@ -13312,8 +13311,8 @@ const buildSourceNodes = ({ loading, entities, positions, unfilteredCount, conta
|
|
|
13312
13311
|
}
|
|
13313
13312
|
else if (loading) {
|
|
13314
13313
|
nodes.push({
|
|
13315
|
-
id: `${
|
|
13316
|
-
type:
|
|
13314
|
+
id: `${EntityTypes.Source}-${NodeTypes.Skeleton}`,
|
|
13315
|
+
type: NodeTypes.Skeleton,
|
|
13317
13316
|
position: {
|
|
13318
13317
|
x: position['x'],
|
|
13319
13318
|
y: position['y'](),
|
|
@@ -13325,16 +13324,16 @@ const buildSourceNodes = ({ loading, entities, positions, unfilteredCount, conta
|
|
|
13325
13324
|
}
|
|
13326
13325
|
else {
|
|
13327
13326
|
nodes.push({
|
|
13328
|
-
id: `${
|
|
13329
|
-
type:
|
|
13327
|
+
id: `${EntityTypes.Source}-${NodeTypes.Add}`,
|
|
13328
|
+
type: NodeTypes.Add,
|
|
13330
13329
|
position: {
|
|
13331
13330
|
x: position['x'],
|
|
13332
13331
|
y: position['y'](),
|
|
13333
13332
|
},
|
|
13334
13333
|
data: {
|
|
13335
13334
|
nodeWidth: nodeWidth$2,
|
|
13336
|
-
type:
|
|
13337
|
-
title: 'ADD
|
|
13335
|
+
type: AddNodeTypes.AddSource,
|
|
13336
|
+
title: 'ADD Source',
|
|
13338
13337
|
subTitle: 'To collect OpenTelemetry data',
|
|
13339
13338
|
},
|
|
13340
13339
|
});
|
|
@@ -13348,25 +13347,25 @@ const getNodePositions = ({ containerWidth }) => {
|
|
|
13348
13347
|
const endX = (containerWidth <= 1500 ? 1500 : containerWidth) - nodeWidth$1 - startX;
|
|
13349
13348
|
const getY = (idx) => nodeHeight * ((idx || 0) + 1);
|
|
13350
13349
|
const positions = {
|
|
13351
|
-
[
|
|
13350
|
+
[EntityTypes.InstrumentationRule]: {
|
|
13352
13351
|
x: startX,
|
|
13353
13352
|
y: getY,
|
|
13354
13353
|
},
|
|
13355
|
-
[
|
|
13354
|
+
[EntityTypes.Source]: {
|
|
13356
13355
|
x: getValueForRange(containerWidth, [
|
|
13357
13356
|
[0, 1600, endX / 3.5],
|
|
13358
13357
|
[1600, null, endX / 4],
|
|
13359
13358
|
]),
|
|
13360
13359
|
y: getY,
|
|
13361
13360
|
},
|
|
13362
|
-
[
|
|
13361
|
+
[EntityTypes.Action]: {
|
|
13363
13362
|
x: getValueForRange(containerWidth, [
|
|
13364
13363
|
[0, 1600, endX / 1.55],
|
|
13365
13364
|
[1600, null, endX / 1.6],
|
|
13366
13365
|
]),
|
|
13367
13366
|
y: getY,
|
|
13368
13367
|
},
|
|
13369
|
-
[
|
|
13368
|
+
[EntityTypes.Destination]: {
|
|
13370
13369
|
x: endX,
|
|
13371
13370
|
y: getY,
|
|
13372
13371
|
},
|
|
@@ -13380,10 +13379,10 @@ const mapToNodeData = (entity) => {
|
|
|
13380
13379
|
return {
|
|
13381
13380
|
nodeWidth,
|
|
13382
13381
|
id: entity.id,
|
|
13383
|
-
type:
|
|
13382
|
+
type: EntityTypes.Destination,
|
|
13384
13383
|
status: priorotizedStatus,
|
|
13385
13384
|
faded: hasDisableds,
|
|
13386
|
-
title: getEntityLabel(entity,
|
|
13385
|
+
title: getEntityLabel(entity, EntityTypes.Destination, { prioritizeDisplayName: true }),
|
|
13387
13386
|
subTitle: entity.destinationType.displayName,
|
|
13388
13387
|
iconSrc: entity.destinationType.imageUrl,
|
|
13389
13388
|
monitors: Object.keys(entity.exportedSignals).filter((signal) => entity.exportedSignals[signal] === true),
|
|
@@ -13392,18 +13391,18 @@ const mapToNodeData = (entity) => {
|
|
|
13392
13391
|
};
|
|
13393
13392
|
const buildDestinationNodes = ({ loading, entities, positions, unfilteredCount }) => {
|
|
13394
13393
|
const nodes = [];
|
|
13395
|
-
const position = positions[
|
|
13394
|
+
const position = positions[EntityTypes.Destination];
|
|
13396
13395
|
nodes.push({
|
|
13397
|
-
id: `${
|
|
13398
|
-
type:
|
|
13396
|
+
id: `${EntityTypes.Destination}-${NodeTypes.Header}`,
|
|
13397
|
+
type: NodeTypes.Header,
|
|
13399
13398
|
position: {
|
|
13400
|
-
x: positions[
|
|
13399
|
+
x: positions[EntityTypes.Destination]['x'],
|
|
13401
13400
|
y: 0,
|
|
13402
13401
|
},
|
|
13403
13402
|
data: {
|
|
13404
13403
|
nodeWidth,
|
|
13405
|
-
title:
|
|
13406
|
-
icon: getEntityIcon(
|
|
13404
|
+
title: DISPLAY_TITLES.Destinations,
|
|
13405
|
+
icon: getEntityIcon(EntityTypes.Destination),
|
|
13407
13406
|
badge: unfilteredCount,
|
|
13408
13407
|
isFetching: loading,
|
|
13409
13408
|
},
|
|
@@ -13411,8 +13410,8 @@ const buildDestinationNodes = ({ loading, entities, positions, unfilteredCount }
|
|
|
13411
13410
|
if (!!entities.length) {
|
|
13412
13411
|
entities.forEach((destination, idx) => {
|
|
13413
13412
|
nodes.push({
|
|
13414
|
-
id: `${
|
|
13415
|
-
type:
|
|
13413
|
+
id: `${EntityTypes.Destination}-${idx}`,
|
|
13414
|
+
type: NodeTypes.Base,
|
|
13416
13415
|
position: {
|
|
13417
13416
|
x: position['x'],
|
|
13418
13417
|
y: position['y'](idx),
|
|
@@ -13423,8 +13422,8 @@ const buildDestinationNodes = ({ loading, entities, positions, unfilteredCount }
|
|
|
13423
13422
|
}
|
|
13424
13423
|
else if (loading) {
|
|
13425
13424
|
nodes.push({
|
|
13426
|
-
id: `${
|
|
13427
|
-
type:
|
|
13425
|
+
id: `${EntityTypes.Destination}-${NodeTypes.Skeleton}`,
|
|
13426
|
+
type: NodeTypes.Skeleton,
|
|
13428
13427
|
position: {
|
|
13429
13428
|
x: position['x'],
|
|
13430
13429
|
y: position['y'](),
|
|
@@ -13436,16 +13435,16 @@ const buildDestinationNodes = ({ loading, entities, positions, unfilteredCount }
|
|
|
13436
13435
|
}
|
|
13437
13436
|
else {
|
|
13438
13437
|
nodes.push({
|
|
13439
|
-
id: `${
|
|
13440
|
-
type:
|
|
13438
|
+
id: `${EntityTypes.Destination}-${NodeTypes.Add}`,
|
|
13439
|
+
type: NodeTypes.Add,
|
|
13441
13440
|
position: {
|
|
13442
13441
|
x: position['x'],
|
|
13443
13442
|
y: position['y'](),
|
|
13444
13443
|
},
|
|
13445
13444
|
data: {
|
|
13446
13445
|
nodeWidth,
|
|
13447
|
-
type:
|
|
13448
|
-
title: 'ADD
|
|
13446
|
+
type: AddNodeTypes.AddDestination,
|
|
13447
|
+
title: 'ADD Destination',
|
|
13449
13448
|
subTitle: 'To monitor OpenTelemetry data',
|
|
13450
13449
|
},
|
|
13451
13450
|
});
|
|
@@ -13477,7 +13476,7 @@ const DataFlow = ({ heightToRemove, metrics }) => {
|
|
|
13477
13476
|
};
|
|
13478
13477
|
const handleNodesScrolled = (currNodes, key, yOffset) => {
|
|
13479
13478
|
setNodes((prevNodes) => applyNodeChanges(currNodes
|
|
13480
|
-
.filter((node) => node.extent === 'parent' && node.parentId === `${key}-${
|
|
13479
|
+
.filter((node) => node.extent === 'parent' && node.parentId === `${key}-${NodeTypes.Scroll}`)
|
|
13481
13480
|
.map((node) => ({
|
|
13482
13481
|
id: node.id,
|
|
13483
13482
|
type: 'position',
|
|
@@ -13494,10 +13493,10 @@ const DataFlow = ({ heightToRemove, metrics }) => {
|
|
|
13494
13493
|
unfilteredCount: sources.length,
|
|
13495
13494
|
positions,
|
|
13496
13495
|
containerHeight,
|
|
13497
|
-
onScroll: ({ scrollTop }) => handleNodesScrolled(sourceNodes,
|
|
13496
|
+
onScroll: ({ scrollTop }) => handleNodesScrolled(sourceNodes, EntityTypes.Source, scrollTop),
|
|
13498
13497
|
});
|
|
13499
|
-
handleNodesChanged(sourceNodes,
|
|
13500
|
-
}, [sources, sourcesLoading, isAwaitingInstrumentation, positions.
|
|
13498
|
+
handleNodesChanged(sourceNodes, EntityTypes.Source);
|
|
13499
|
+
}, [sources, sourcesLoading, isAwaitingInstrumentation, positions[EntityTypes.Source], filters, containerHeight]);
|
|
13501
13500
|
useEffect(() => {
|
|
13502
13501
|
const destinationNodes = buildDestinationNodes({
|
|
13503
13502
|
entities: filterDestinations(destinations, filters),
|
|
@@ -13505,8 +13504,8 @@ const DataFlow = ({ heightToRemove, metrics }) => {
|
|
|
13505
13504
|
unfilteredCount: destinations.length,
|
|
13506
13505
|
positions,
|
|
13507
13506
|
});
|
|
13508
|
-
handleNodesChanged(destinationNodes,
|
|
13509
|
-
}, [destinations, destinationsLoading, positions.
|
|
13507
|
+
handleNodesChanged(destinationNodes, EntityTypes.Destination);
|
|
13508
|
+
}, [destinations, destinationsLoading, positions[EntityTypes.Destination], filters]);
|
|
13510
13509
|
useEffect(() => {
|
|
13511
13510
|
const actionNodes = buildActionNodes({
|
|
13512
13511
|
entities: filterActions(actions, filters),
|
|
@@ -13514,8 +13513,8 @@ const DataFlow = ({ heightToRemove, metrics }) => {
|
|
|
13514
13513
|
unfilteredCount: actions.length,
|
|
13515
13514
|
positions,
|
|
13516
13515
|
});
|
|
13517
|
-
handleNodesChanged(actionNodes,
|
|
13518
|
-
}, [actions, actionsLoading, positions.
|
|
13516
|
+
handleNodesChanged(actionNodes, EntityTypes.Action);
|
|
13517
|
+
}, [actions, actionsLoading, positions[EntityTypes.Action], filters]);
|
|
13519
13518
|
useEffect(() => {
|
|
13520
13519
|
// note: rules do not have filters yet
|
|
13521
13520
|
const ruleNodes = buildRuleNodes({
|
|
@@ -13524,8 +13523,8 @@ const DataFlow = ({ heightToRemove, metrics }) => {
|
|
|
13524
13523
|
unfilteredCount: instrumentationRules.length,
|
|
13525
13524
|
positions,
|
|
13526
13525
|
});
|
|
13527
|
-
handleNodesChanged(ruleNodes,
|
|
13528
|
-
}, [instrumentationRules, instrumentationRulesLoading, positions.
|
|
13526
|
+
handleNodesChanged(ruleNodes, EntityTypes.InstrumentationRule);
|
|
13527
|
+
}, [instrumentationRules, instrumentationRulesLoading, positions[EntityTypes.InstrumentationRule]]);
|
|
13529
13528
|
return (React.createElement(Container$c, { ref: containerRef, "$heightToRemove": heightToRemove },
|
|
13530
13529
|
React.createElement(Flow, { nodes: nodes, edges: edges, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange })));
|
|
13531
13530
|
};
|
|
@@ -13556,25 +13555,25 @@ const buildSearchResults = ({ instrumentationRules, sources, actions, destinatio
|
|
|
13556
13555
|
: destinations.filter((destination) => destination.destinationType.displayName?.toLowerCase().includes(searchText) || destination.name?.toLowerCase().includes(searchText));
|
|
13557
13556
|
const categories = [
|
|
13558
13557
|
{
|
|
13559
|
-
category:
|
|
13558
|
+
category: EntityTypes.Source,
|
|
13560
13559
|
label: 'Sources',
|
|
13561
13560
|
count: filteredSources.length,
|
|
13562
13561
|
entities: [],
|
|
13563
13562
|
},
|
|
13564
13563
|
{
|
|
13565
|
-
category:
|
|
13564
|
+
category: EntityTypes.Action,
|
|
13566
13565
|
label: 'Actions',
|
|
13567
13566
|
count: filteredActions.length,
|
|
13568
13567
|
entities: [],
|
|
13569
13568
|
},
|
|
13570
13569
|
{
|
|
13571
|
-
category:
|
|
13570
|
+
category: EntityTypes.Destination,
|
|
13572
13571
|
label: 'Destinations',
|
|
13573
13572
|
count: filteredDestinations.length,
|
|
13574
13573
|
entities: [],
|
|
13575
13574
|
},
|
|
13576
13575
|
{
|
|
13577
|
-
category:
|
|
13576
|
+
category: EntityTypes.InstrumentationRule,
|
|
13578
13577
|
label: 'Instrumentation Rules',
|
|
13579
13578
|
count: filteredRules.length,
|
|
13580
13579
|
entities: [],
|
|
@@ -13590,13 +13589,13 @@ const buildSearchResults = ({ instrumentationRules, sources, actions, destinatio
|
|
|
13590
13589
|
.filter(({ count, category }) => !!count && category !== 'all' && ['all', category].includes(selectedCategory))
|
|
13591
13590
|
.map((item) => ({
|
|
13592
13591
|
...item,
|
|
13593
|
-
entities: item.category ===
|
|
13592
|
+
entities: item.category === EntityTypes.InstrumentationRule
|
|
13594
13593
|
? filteredRules
|
|
13595
|
-
: item.category ===
|
|
13594
|
+
: item.category === EntityTypes.Source
|
|
13596
13595
|
? filteredSources
|
|
13597
|
-
: item.category ===
|
|
13596
|
+
: item.category === EntityTypes.Action
|
|
13598
13597
|
? filteredActions
|
|
13599
|
-
: item.category ===
|
|
13598
|
+
: item.category === EntityTypes.Destination
|
|
13600
13599
|
? filteredDestinations
|
|
13601
13600
|
: [],
|
|
13602
13601
|
}));
|
|
@@ -13774,8 +13773,8 @@ const buildCard$2 = (destination, yamlFields) => {
|
|
|
13774
13773
|
const arr = [
|
|
13775
13774
|
{ title: DISPLAY_TITLES.NAME, value: destinationType.displayName },
|
|
13776
13775
|
{ title: DISPLAY_TITLES.TYPE, value: destinationType.type },
|
|
13777
|
-
{ type:
|
|
13778
|
-
{ type:
|
|
13776
|
+
{ type: DataCardFieldTypes.Monitors, title: DISPLAY_TITLES.Monitors, value: buildMonitorsList(exportedSignals) },
|
|
13777
|
+
{ type: DataCardFieldTypes.Divider },
|
|
13779
13778
|
];
|
|
13780
13779
|
const parsedFields = safeJsonParse(fields, {});
|
|
13781
13780
|
const sortedParsedFields = yamlFields.map((field) => ({ key: field.name, value: parsedFields[field.name] ?? null })).filter((item) => item.value !== null) ||
|
|
@@ -13816,17 +13815,17 @@ const DynamicFields = ({ fields, onChange, formErrors }) => {
|
|
|
13816
13815
|
if (!shouldRender)
|
|
13817
13816
|
return null;
|
|
13818
13817
|
switch (componentType) {
|
|
13819
|
-
case
|
|
13818
|
+
case FieldTypes.Input:
|
|
13820
13819
|
return React.createElement(Input, { key: field.name, ...rest, onChange: (e) => onChange(field.name, e.target.value), errorMessage: formErrors[field.name] });
|
|
13821
|
-
case
|
|
13820
|
+
case FieldTypes.Dropdown:
|
|
13822
13821
|
return (React.createElement(Dropdown, { key: field.name, ...rest, value: { id: rest.value || '', value: rest.value || '' }, options: rest.options || [], onSelect: (option) => onChange(field.name, option.value), errorMessage: formErrors[field.name] }));
|
|
13823
|
-
case
|
|
13822
|
+
case FieldTypes.MultiInput:
|
|
13824
13823
|
return (React.createElement(InputList, { key: field.name, ...rest, value: typeof rest.value === 'string' ? safeJsonParse(rest.value, []) : rest.value, onChange: (value) => onChange(field.name, JSON.stringify(value)), errorMessage: formErrors[field.name] }));
|
|
13825
|
-
case
|
|
13824
|
+
case FieldTypes.KeyValuePair:
|
|
13826
13825
|
return (React.createElement(KeyValueInputsList, { key: field.name, ...rest, value: typeof rest.value === 'string' ? safeJsonParse(rest.value, []) : rest.value, onChange: (value) => onChange(field.name, JSON.stringify(value)), errorMessage: formErrors[field.name] }));
|
|
13827
|
-
case
|
|
13826
|
+
case FieldTypes.TextArea:
|
|
13828
13827
|
return React.createElement(TextArea, { key: field.name, ...rest, onChange: (e) => onChange(field.name, e.target.value), errorMessage: formErrors[field.name] });
|
|
13829
|
-
case
|
|
13828
|
+
case FieldTypes.Checkbox:
|
|
13830
13829
|
return React.createElement(Checkbox, { key: field.name, ...rest, value: rest.value == 'true', onChange: (bool) => onChange(field.name, String(bool)), errorMessage: formErrors[field.name] });
|
|
13831
13830
|
default:
|
|
13832
13831
|
return null;
|
|
@@ -13917,45 +13916,45 @@ const DestinationForm = ({ isUpdate, categoryItem, formData, formErrors, validat
|
|
|
13917
13916
|
const { logs, metrics, traces } = supportedSignals || {};
|
|
13918
13917
|
const arr = [];
|
|
13919
13918
|
if (logs?.supported)
|
|
13920
|
-
arr.push(
|
|
13919
|
+
arr.push(SignalType.Logs);
|
|
13921
13920
|
if (metrics?.supported)
|
|
13922
|
-
arr.push(
|
|
13921
|
+
arr.push(SignalType.Metrics);
|
|
13923
13922
|
if (traces?.supported)
|
|
13924
|
-
arr.push(
|
|
13923
|
+
arr.push(SignalType.Traces);
|
|
13925
13924
|
return arr;
|
|
13926
13925
|
}, [supportedSignals]);
|
|
13927
13926
|
const selectedMonitors = useMemo(() => {
|
|
13928
13927
|
const { logs, metrics, traces } = formData['exportedSignals'] || {};
|
|
13929
13928
|
const arr = [];
|
|
13930
13929
|
if (logs)
|
|
13931
|
-
arr.push(
|
|
13930
|
+
arr.push(SignalType.Logs);
|
|
13932
13931
|
if (metrics)
|
|
13933
|
-
arr.push(
|
|
13932
|
+
arr.push(SignalType.Metrics);
|
|
13934
13933
|
if (traces)
|
|
13935
|
-
arr.push(
|
|
13934
|
+
arr.push(SignalType.Traces);
|
|
13936
13935
|
return arr;
|
|
13937
13936
|
}, [formData['exportedSignals']]);
|
|
13938
13937
|
const handleSelectedSignals = (signals) => {
|
|
13939
13938
|
dirtyForm();
|
|
13940
13939
|
handleFormChange('exportedSignals', {
|
|
13941
|
-
logs: signals.includes(
|
|
13942
|
-
metrics: signals.includes(
|
|
13943
|
-
traces: signals.includes(
|
|
13940
|
+
logs: signals.includes(SignalType.Logs),
|
|
13941
|
+
metrics: signals.includes(SignalType.Metrics),
|
|
13942
|
+
traces: signals.includes(SignalType.Traces),
|
|
13944
13943
|
});
|
|
13945
13944
|
};
|
|
13946
13945
|
return (React.createElement(Container$a, null,
|
|
13947
13946
|
!isUpdate && (React.createElement(React.Fragment, null,
|
|
13948
13947
|
React.createElement(SectionTitle, { title: 'Create connection', description: `Connect ${displayName} with Odigos.`, actionButton: testConnectionSupported && (React.createElement(TestConnection, { destination: formData, disabled: !isFormDirty, validateForm: validateForm, status: connectionStatus, testConnection: testConnection, testLoading: testLoading, testResult: testResult, onError: () => {
|
|
13949
13948
|
setIsFormDirty(false);
|
|
13950
|
-
setConnectionStatus(
|
|
13949
|
+
setConnectionStatus(StatusType.Error);
|
|
13951
13950
|
}, onSuccess: () => {
|
|
13952
13951
|
setIsFormDirty(false);
|
|
13953
|
-
setConnectionStatus(
|
|
13952
|
+
setConnectionStatus(StatusType.Success);
|
|
13954
13953
|
} })) }),
|
|
13955
13954
|
(testConnectionSupported || autoFilled) && (React.createElement(NotesWrapper, null,
|
|
13956
|
-
testConnectionSupported && connectionStatus ===
|
|
13957
|
-
testConnectionSupported && connectionStatus ===
|
|
13958
|
-
autoFilled && React.createElement(NotificationNote, { type:
|
|
13955
|
+
testConnectionSupported && connectionStatus === StatusType.Error && React.createElement(NotificationNote, { type: StatusType.Error, message: 'Connection failed. Please check your input and try again.' }),
|
|
13956
|
+
testConnectionSupported && connectionStatus === StatusType.Success && React.createElement(NotificationNote, { type: StatusType.Success, message: 'Connection succeeded.' }),
|
|
13957
|
+
autoFilled && React.createElement(NotificationNote, { type: StatusType.Default, message: `Odigos autocompleted ${displayName} connection details.` }))),
|
|
13959
13958
|
React.createElement(Divider, null))),
|
|
13960
13959
|
React.createElement(MonitorsCheckboxes, { title: isUpdate ? '' : 'This connection will monitor:', required: true, allowedSignals: supportedMonitors, selectedSignals: selectedMonitors, setSelectedSignals: handleSelectedSignals, errorMessage: formErrors['exportedSignals'] }),
|
|
13961
13960
|
!isUpdate && (React.createElement(Input, { title: 'Destination name', placeholder: 'Enter destination name', value: formData['name'], onChange: (e) => {
|
|
@@ -13990,7 +13989,7 @@ const DataContainer$2 = styled.div `
|
|
|
13990
13989
|
const DestinationDrawer = ({ categories, updateDestination, deleteDestination, testConnection, testLoading, testResult }) => {
|
|
13991
13990
|
const { destinations } = useEntityStore();
|
|
13992
13991
|
const { drawerType, drawerEntityId, setDrawerEntityId, setDrawerType } = useDrawerStore();
|
|
13993
|
-
const isOpen = drawerType !==
|
|
13992
|
+
const isOpen = drawerType !== EntityTypes.Destination;
|
|
13994
13993
|
const onClose = () => {
|
|
13995
13994
|
setDrawerType(null);
|
|
13996
13995
|
setDrawerEntityId(null);
|
|
@@ -14045,7 +14044,7 @@ const DestinationDrawer = ({ categories, updateDestination, deleteDestination, t
|
|
|
14045
14044
|
onClose();
|
|
14046
14045
|
};
|
|
14047
14046
|
const handleSave = async (newTitle) => {
|
|
14048
|
-
if (validateForm({ withAlert: true, alertTitle:
|
|
14047
|
+
if (validateForm({ withAlert: true, alertTitle: Crud.Update })) {
|
|
14049
14048
|
const title = newTitle !== thisItem.destinationType.displayName ? newTitle : '';
|
|
14050
14049
|
handleFormChange('name', title);
|
|
14051
14050
|
updateDestination(drawerEntityId, { ...formData, name: title });
|
|
@@ -14126,7 +14125,7 @@ const DROPDOWN_OPTIONS = [
|
|
|
14126
14125
|
{ value: 'Self-hosted', id: 'self hosted' },
|
|
14127
14126
|
];
|
|
14128
14127
|
const DEFAULT_CATEGORY = DROPDOWN_OPTIONS[0];
|
|
14129
|
-
const DEFAULT_MONITORS = [
|
|
14128
|
+
const DEFAULT_MONITORS = [SignalType.Logs, SignalType.Metrics, SignalType.Traces];
|
|
14130
14129
|
const ChooseDestinationBody = ({ hidden, categories, potentialDestinations, onSelect }) => {
|
|
14131
14130
|
const [search, setSearch] = useState('');
|
|
14132
14131
|
const [selectedCategory, setSelectedCategory] = useState(DEFAULT_CATEGORY);
|
|
@@ -14175,7 +14174,7 @@ const SideMenuWrapper = styled.div `
|
|
|
14175
14174
|
const DestinationModal = ({ isOnboarding, categories, potentialDestinations, createDestination, testConnection, testLoading, testResult }) => {
|
|
14176
14175
|
const { addConfiguredDestination } = useSetupStore();
|
|
14177
14176
|
const { currentModal, setCurrentModal } = useModalStore();
|
|
14178
|
-
const isOpen = currentModal ===
|
|
14177
|
+
const isOpen = currentModal === EntityTypes.Destination;
|
|
14179
14178
|
const [selectedItem, setSelectedItem] = useState(undefined);
|
|
14180
14179
|
const { formData, formErrors, handleFormChange, resetFormData, validateForm, setYamlFields, dynamicFields, setDynamicFields } = useDestinationFormData({
|
|
14181
14180
|
supportedSignals: selectedItem?.supportedSignals,
|
|
@@ -14197,13 +14196,13 @@ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, cre
|
|
|
14197
14196
|
setSelectedItem(item);
|
|
14198
14197
|
};
|
|
14199
14198
|
const handleSubmit = async () => {
|
|
14200
|
-
const isFormOk = validateForm({ withAlert: !isOnboarding, alertTitle:
|
|
14199
|
+
const isFormOk = validateForm({ withAlert: !isOnboarding, alertTitle: Crud.Create });
|
|
14201
14200
|
if (!isFormOk)
|
|
14202
14201
|
return null;
|
|
14203
14202
|
if (isOnboarding) {
|
|
14204
14203
|
const destinationTypeDetails = dynamicFields.map((field) => ({
|
|
14205
14204
|
title: field.title || '',
|
|
14206
|
-
value: (field.componentType ===
|
|
14205
|
+
value: (field.componentType === FieldTypes.Dropdown ? field.value?.value || '' : field.value),
|
|
14207
14206
|
}));
|
|
14208
14207
|
destinationTypeDetails.unshift({
|
|
14209
14208
|
title: 'Destination name',
|
|
@@ -14248,7 +14247,7 @@ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, cre
|
|
|
14248
14247
|
React.createElement(Container$8, null,
|
|
14249
14248
|
React.createElement(SideMenuWrapper, null,
|
|
14250
14249
|
React.createElement(Stepper, { currentStep: !!selectedItem ? 2 : 1, data: [
|
|
14251
|
-
{ stepNumber: 1, title: '
|
|
14250
|
+
{ stepNumber: 1, title: 'Destinations' },
|
|
14252
14251
|
{ stepNumber: 2, title: 'CONNECTION' },
|
|
14253
14252
|
] })),
|
|
14254
14253
|
React.createElement(ModalBody, { style: { margin: '32px 24px 12px 24px' } },
|
|
@@ -14277,7 +14276,7 @@ const ListItem$1 = ({ item, isLastItem, ...props }) => {
|
|
|
14277
14276
|
return (React.createElement(React.Fragment, null,
|
|
14278
14277
|
React.createElement(DataTab, { title: item.displayName, iconSrc: item.imageUrl, monitors: Object.keys(item.exportedSignals).filter((signal) => item.exportedSignals[signal] === true), monitorsWithLabels: true, withExtend: true, renderExtended: () => React.createElement(DataCardFields, { data: item.destinationTypeDetails }), renderActions: () => (React.createElement(IconButton, { onClick: () => setDeleteWarning(true) },
|
|
14279
14278
|
React.createElement(TrashIcon, null))), ...props }),
|
|
14280
|
-
React.createElement(DeleteWarning, { isOpen: deleteWarning, name: item.displayName || item.type, type:
|
|
14279
|
+
React.createElement(DeleteWarning, { isOpen: deleteWarning, name: item.displayName || item.type, type: EntityTypes.Destination, isLastItem: isLastItem, onApprove: () => removeConfiguredDestination(item), onDeny: () => setDeleteWarning(false) })));
|
|
14281
14280
|
};
|
|
14282
14281
|
|
|
14283
14282
|
const ContentWrapper = styled.div `
|
|
@@ -14301,46 +14300,41 @@ const StyledAddDestinationButton = styled(Button) `
|
|
|
14301
14300
|
const DestinationSelectionForm = ({ categories, potentialDestinations, createDestination, isLoading, testConnection, testLoading, testResult, isSourcesListEmpty, goToSources, }) => {
|
|
14302
14301
|
const theme = Theme.useTheme();
|
|
14303
14302
|
const { setCurrentModal } = useModalStore();
|
|
14304
|
-
const onOpen = () => setCurrentModal(
|
|
14303
|
+
const onOpen = () => setCurrentModal(EntityTypes.Destination);
|
|
14305
14304
|
return (React.createElement(ContentWrapper, null,
|
|
14306
14305
|
React.createElement(SectionTitle, { title: 'Configure destinations', description: 'Select destinations where telemetry data will be sent and configure their settings.' }),
|
|
14307
14306
|
!isLoading && isSourcesListEmpty && (React.createElement(NotificationNoteWrapper, null,
|
|
14308
|
-
React.createElement(NotificationNote, { type:
|
|
14307
|
+
React.createElement(NotificationNote, { type: StatusType.Warning, message: 'No sources selected. Please go back to select sources.', action: {
|
|
14309
14308
|
label: 'Select Sources',
|
|
14310
14309
|
onClick: goToSources,
|
|
14311
14310
|
} }))),
|
|
14312
14311
|
React.createElement(AddDestinationButtonWrapper, null,
|
|
14313
14312
|
React.createElement(StyledAddDestinationButton, { variant: 'secondary', disabled: isLoading, onClick: onOpen },
|
|
14314
14313
|
React.createElement(PlusIcon$1, null),
|
|
14315
|
-
React.createElement(Text, { color: theme.colors.secondary, size: 14, decoration: 'underline', family: 'secondary' }, "ADD
|
|
14314
|
+
React.createElement(Text, { color: theme.colors.secondary, size: 14, decoration: 'underline', family: 'secondary' }, "ADD Destination")),
|
|
14316
14315
|
React.createElement(DestinationModal, { isOnboarding: true, categories: categories, potentialDestinations: potentialDestinations, createDestination: createDestination, testConnection: testConnection, testLoading: testLoading, testResult: testResult })),
|
|
14317
14316
|
isLoading ? (React.createElement(CenterThis, null,
|
|
14318
14317
|
React.createElement(FadeLoader, { scale: 2, cssOverride: { marginTop: '3rem' } }))) : (React.createElement(ConfiguredList, null))));
|
|
14319
14318
|
};
|
|
14320
14319
|
|
|
14321
|
-
const TableWrap$2 = styled.div `
|
|
14322
|
-
width: 100%;
|
|
14323
|
-
max-height: ${({ $maxHeight }) => $maxHeight || 'unset'};
|
|
14324
|
-
overflow-y: auto;
|
|
14325
|
-
`;
|
|
14326
14320
|
const columns$2 = [
|
|
14327
14321
|
{ key: 'icon', title: '' },
|
|
14328
14322
|
{ key: 'name', title: DISPLAY_TITLES.NAME, sortable: true },
|
|
14329
14323
|
{ key: 'type', title: DISPLAY_TITLES.TYPE, sortable: true },
|
|
14330
|
-
{ key: 'signals', title: DISPLAY_TITLES.
|
|
14324
|
+
{ key: 'signals', title: DISPLAY_TITLES.Monitors },
|
|
14331
14325
|
{ key: 'conditions', title: 'Conditions' },
|
|
14332
14326
|
{ key: 'throughput', title: 'Throughput', sortable: true },
|
|
14333
14327
|
];
|
|
14334
14328
|
const DestinationTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
14335
14329
|
const theme = Theme.useTheme();
|
|
14336
14330
|
const filters = useFilterStore();
|
|
14337
|
-
const { destinations } = useEntityStore();
|
|
14331
|
+
const { destinations, destinationsLoading } = useEntityStore();
|
|
14338
14332
|
const { setDrawerType, setDrawerEntityId } = useDrawerStore();
|
|
14339
14333
|
const filtered = useMemo(() => filterDestinations(destinations, filters), [destinations, filters]);
|
|
14340
14334
|
const rows = useMemo(() => filtered.map((dest) => {
|
|
14341
14335
|
const { hasErrors, hasWarnings, hasDisableds } = getConditionsBooleans(dest.conditions || []);
|
|
14342
14336
|
return {
|
|
14343
|
-
status: hasErrors ?
|
|
14337
|
+
status: hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : undefined,
|
|
14344
14338
|
faded: hasDisableds,
|
|
14345
14339
|
cells: [
|
|
14346
14340
|
{
|
|
@@ -14349,7 +14343,7 @@ const DestinationTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
14349
14343
|
},
|
|
14350
14344
|
{
|
|
14351
14345
|
columnKey: 'name',
|
|
14352
|
-
value: getEntityLabel(dest,
|
|
14346
|
+
value: getEntityLabel(dest, EntityTypes.Destination, { prioritizeDisplayName: true }),
|
|
14353
14347
|
},
|
|
14354
14348
|
{
|
|
14355
14349
|
columnKey: 'type',
|
|
@@ -14358,7 +14352,7 @@ const DestinationTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
14358
14352
|
},
|
|
14359
14353
|
{
|
|
14360
14354
|
columnKey: 'throughput',
|
|
14361
|
-
value: formatBytes(getMetricForEntity(metrics,
|
|
14355
|
+
value: formatBytes(getMetricForEntity(metrics, EntityTypes.Destination, dest.id).throughput),
|
|
14362
14356
|
textColor: theme.text.info,
|
|
14363
14357
|
},
|
|
14364
14358
|
{
|
|
@@ -14372,12 +14366,14 @@ const DestinationTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
14372
14366
|
],
|
|
14373
14367
|
};
|
|
14374
14368
|
}), [filtered, metrics]);
|
|
14375
|
-
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
React.createElement(
|
|
14369
|
+
const badge = useMemo(() => (filtered.length !== destinations.length ? `${filtered.length}/${destinations.length}` : destinations.length), [filtered, destinations]);
|
|
14370
|
+
const badgeTooltip = useMemo(() => (filtered.length !== destinations.length ? DISPLAY_TITLES.FILTERED_COUNT_TOOLTIP : undefined), [filtered, destinations]);
|
|
14371
|
+
return (React.createElement(TableContainer, { "$maxWidth": maxWidth },
|
|
14372
|
+
React.createElement(TableTitleWrap, null,
|
|
14373
|
+
React.createElement(IconTitleBadge, { icon: getEntityIcon(EntityTypes.Destination), title: DISPLAY_TITLES.Destinations, badge: badge, badgeTooltip: badgeTooltip, loading: destinationsLoading })),
|
|
14374
|
+
React.createElement(TableWrap, { "$maxHeight": maxHeight },
|
|
14379
14375
|
React.createElement(InteractiveTable, { columns: columns$2, rows: rows, onRowClick: (idx) => {
|
|
14380
|
-
setDrawerType(
|
|
14376
|
+
setDrawerType(EntityTypes.Destination);
|
|
14381
14377
|
setDrawerEntityId(filtered[idx].id);
|
|
14382
14378
|
} })),
|
|
14383
14379
|
!filtered.length && (React.createElement(CenterThis, { style: { marginTop: '2rem' } },
|
|
@@ -14388,11 +14384,11 @@ const buildCard$1 = (rule) => {
|
|
|
14388
14384
|
const { type, ruleName, notes, disabled, profileName, payloadCollection, codeAttributes } = rule;
|
|
14389
14385
|
const arr = [
|
|
14390
14386
|
{ title: DISPLAY_TITLES.TYPE, value: type },
|
|
14391
|
-
{ type:
|
|
14387
|
+
{ type: DataCardFieldTypes.ActiveStatus, title: DISPLAY_TITLES.STATUS, value: String(!disabled) },
|
|
14392
14388
|
{ title: DISPLAY_TITLES.NAME, value: ruleName },
|
|
14393
14389
|
{ title: DISPLAY_TITLES.NOTES, value: notes },
|
|
14394
14390
|
{ title: DISPLAY_TITLES.MANAGED_BY_PROFILE, value: profileName },
|
|
14395
|
-
{ type:
|
|
14391
|
+
{ type: DataCardFieldTypes.Divider },
|
|
14396
14392
|
];
|
|
14397
14393
|
if (!!payloadCollection) {
|
|
14398
14394
|
const str = Object.entries(payloadCollection)
|
|
@@ -14427,34 +14423,34 @@ const ListContainer$1 = styled.div `
|
|
|
14427
14423
|
`;
|
|
14428
14424
|
const recommendedList = [
|
|
14429
14425
|
{
|
|
14430
|
-
id:
|
|
14426
|
+
id: CodeAttributesKeyTypes.FilePath,
|
|
14431
14427
|
label: 'Collect File Path',
|
|
14432
14428
|
tooltip: 'Indicates whether to record the `code.filepath` attribute.',
|
|
14433
14429
|
},
|
|
14434
14430
|
{
|
|
14435
|
-
id:
|
|
14431
|
+
id: CodeAttributesKeyTypes.Function,
|
|
14436
14432
|
label: 'Collect Function',
|
|
14437
14433
|
tooltip: 'Indicates whether to record the `code.function` attribute.',
|
|
14438
14434
|
},
|
|
14439
14435
|
{
|
|
14440
|
-
id:
|
|
14436
|
+
id: CodeAttributesKeyTypes.LineNumber,
|
|
14441
14437
|
label: 'Collect Line Number',
|
|
14442
14438
|
tooltip: 'Indicates whether to record the `code.lineno` attribute.',
|
|
14443
14439
|
},
|
|
14444
14440
|
];
|
|
14445
14441
|
const verboseList = [
|
|
14446
14442
|
{
|
|
14447
|
-
id:
|
|
14443
|
+
id: CodeAttributesKeyTypes.Column,
|
|
14448
14444
|
label: 'Collect Column',
|
|
14449
14445
|
tooltip: 'Indicates whether to record the `code.column` attribute.',
|
|
14450
14446
|
},
|
|
14451
14447
|
{
|
|
14452
|
-
id:
|
|
14448
|
+
id: CodeAttributesKeyTypes.Namespace,
|
|
14453
14449
|
label: 'Collect Namespace',
|
|
14454
14450
|
tooltip: 'Indicates whether to record the `code.namespace` attribute.',
|
|
14455
14451
|
},
|
|
14456
14452
|
{
|
|
14457
|
-
id:
|
|
14453
|
+
id: CodeAttributesKeyTypes.StackTrace,
|
|
14458
14454
|
label: 'Collect Stacktrace',
|
|
14459
14455
|
tooltip: 'Indicates whether to record the `code.stacktrace` attribute.',
|
|
14460
14456
|
},
|
|
@@ -14468,12 +14464,12 @@ const CodeAttributes = ({ value, setValue, formErrors }) => {
|
|
|
14468
14464
|
useEffect(() => {
|
|
14469
14465
|
if (!mappedValue.length) {
|
|
14470
14466
|
const payload = {
|
|
14471
|
-
[
|
|
14472
|
-
[
|
|
14473
|
-
[
|
|
14474
|
-
[
|
|
14475
|
-
[
|
|
14476
|
-
[
|
|
14467
|
+
[CodeAttributesKeyTypes.Column]: null,
|
|
14468
|
+
[CodeAttributesKeyTypes.FilePath]: true,
|
|
14469
|
+
[CodeAttributesKeyTypes.Function]: true,
|
|
14470
|
+
[CodeAttributesKeyTypes.LineNumber]: true,
|
|
14471
|
+
[CodeAttributesKeyTypes.Namespace]: null,
|
|
14472
|
+
[CodeAttributesKeyTypes.StackTrace]: null,
|
|
14477
14473
|
};
|
|
14478
14474
|
setValue('codeAttributes', payload);
|
|
14479
14475
|
setIsLastSelection(false);
|
|
@@ -14482,7 +14478,7 @@ const CodeAttributes = ({ value, setValue, formErrors }) => {
|
|
|
14482
14478
|
}, []);
|
|
14483
14479
|
const handleChange = (id, isAdd) => {
|
|
14484
14480
|
const arr = isAdd ? [...mappedValue, id] : mappedValue.filter((str) => str !== id);
|
|
14485
|
-
const payload = Object.values(
|
|
14481
|
+
const payload = Object.values(CodeAttributesKeyTypes).reduce((acc, attribute) => {
|
|
14486
14482
|
// @ts-ignore - TS doesn't know that `acc` is initialized 2 rows below
|
|
14487
14483
|
acc[attribute] = arr.includes(attribute) ? true : null;
|
|
14488
14484
|
return acc;
|
|
@@ -14517,19 +14513,19 @@ const ListContainer = styled.div `
|
|
|
14517
14513
|
`;
|
|
14518
14514
|
const strictPicklist = [
|
|
14519
14515
|
{
|
|
14520
|
-
id:
|
|
14516
|
+
id: PayloadCollectionKeyTypes.HttpRequest,
|
|
14521
14517
|
label: 'Collect HTTP Request',
|
|
14522
14518
|
},
|
|
14523
14519
|
{
|
|
14524
|
-
id:
|
|
14520
|
+
id: PayloadCollectionKeyTypes.HttpResponse,
|
|
14525
14521
|
label: 'Collect HTTP Response',
|
|
14526
14522
|
},
|
|
14527
14523
|
{
|
|
14528
|
-
id:
|
|
14524
|
+
id: PayloadCollectionKeyTypes.DbQuery,
|
|
14529
14525
|
label: 'Collect DB Query',
|
|
14530
14526
|
},
|
|
14531
14527
|
{
|
|
14532
|
-
id:
|
|
14528
|
+
id: PayloadCollectionKeyTypes.Messaging,
|
|
14533
14529
|
label: 'Collect Messaging',
|
|
14534
14530
|
},
|
|
14535
14531
|
];
|
|
@@ -14542,10 +14538,10 @@ const PayloadCollection = ({ value, setValue, formErrors }) => {
|
|
|
14542
14538
|
useEffect(() => {
|
|
14543
14539
|
if (!mappedValue.length) {
|
|
14544
14540
|
const payload = {
|
|
14545
|
-
[
|
|
14546
|
-
[
|
|
14547
|
-
[
|
|
14548
|
-
[
|
|
14541
|
+
[PayloadCollectionKeyTypes.HttpRequest]: {},
|
|
14542
|
+
[PayloadCollectionKeyTypes.HttpResponse]: {},
|
|
14543
|
+
[PayloadCollectionKeyTypes.DbQuery]: {},
|
|
14544
|
+
[PayloadCollectionKeyTypes.Messaging]: {},
|
|
14549
14545
|
};
|
|
14550
14546
|
setValue('payloadCollection', payload);
|
|
14551
14547
|
setIsLastSelection(false);
|
|
@@ -14555,10 +14551,10 @@ const PayloadCollection = ({ value, setValue, formErrors }) => {
|
|
|
14555
14551
|
const handleChange = (id, isAdd) => {
|
|
14556
14552
|
const arr = isAdd ? [...mappedValue, id] : mappedValue.filter((str) => str !== id);
|
|
14557
14553
|
const payload = {
|
|
14558
|
-
[
|
|
14559
|
-
[
|
|
14560
|
-
[
|
|
14561
|
-
[
|
|
14554
|
+
[PayloadCollectionKeyTypes.HttpRequest]: arr.includes(PayloadCollectionKeyTypes.HttpRequest) ? {} : null,
|
|
14555
|
+
[PayloadCollectionKeyTypes.HttpResponse]: arr.includes(PayloadCollectionKeyTypes.HttpResponse) ? {} : null,
|
|
14556
|
+
[PayloadCollectionKeyTypes.DbQuery]: arr.includes(PayloadCollectionKeyTypes.DbQuery) ? {} : null,
|
|
14557
|
+
[PayloadCollectionKeyTypes.Messaging]: arr.includes(PayloadCollectionKeyTypes.Messaging) ? {} : null,
|
|
14562
14558
|
};
|
|
14563
14559
|
setValue('payloadCollection', payload);
|
|
14564
14560
|
setIsLastSelection(arr.length === 1);
|
|
@@ -14570,9 +14566,9 @@ const PayloadCollection = ({ value, setValue, formErrors }) => {
|
|
|
14570
14566
|
};
|
|
14571
14567
|
|
|
14572
14568
|
const componentsMap = {
|
|
14573
|
-
[
|
|
14574
|
-
[
|
|
14575
|
-
[
|
|
14569
|
+
[InstrumentationRuleType.PayloadCollection]: PayloadCollection,
|
|
14570
|
+
[InstrumentationRuleType.CodeAttributes]: CodeAttributes,
|
|
14571
|
+
[InstrumentationRuleType.UnknownType]: null,
|
|
14576
14572
|
};
|
|
14577
14573
|
const CustomFields = ({ ruleType, value, setValue, formErrors }) => {
|
|
14578
14574
|
if (!ruleType)
|
|
@@ -14616,7 +14612,7 @@ const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrument
|
|
|
14616
14612
|
const { instrumentationRules } = useEntityStore();
|
|
14617
14613
|
const { addNotification } = useNotificationStore();
|
|
14618
14614
|
const { drawerType, drawerEntityId, setDrawerType, setDrawerEntityId } = useDrawerStore();
|
|
14619
|
-
const isOpen = drawerType !==
|
|
14615
|
+
const isOpen = drawerType !== EntityTypes.InstrumentationRule;
|
|
14620
14616
|
const onClose = () => {
|
|
14621
14617
|
setDrawerType(null);
|
|
14622
14618
|
setDrawerEntityId(null);
|
|
@@ -14638,10 +14634,10 @@ const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrument
|
|
|
14638
14634
|
const handleEdit = (bool) => {
|
|
14639
14635
|
if (!thisItem.mutable && (bool || bool === undefined)) {
|
|
14640
14636
|
addNotification({
|
|
14641
|
-
type:
|
|
14637
|
+
type: StatusType.Warning,
|
|
14642
14638
|
title: FORM_ALERTS.FORBIDDEN,
|
|
14643
14639
|
message: FORM_ALERTS.CANNOT_EDIT_RULE,
|
|
14644
|
-
crdType:
|
|
14640
|
+
crdType: EntityTypes.InstrumentationRule,
|
|
14645
14641
|
target: drawerEntityId,
|
|
14646
14642
|
hideFromHistory: true,
|
|
14647
14643
|
});
|
|
@@ -14658,10 +14654,10 @@ const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrument
|
|
|
14658
14654
|
const handleDelete = () => {
|
|
14659
14655
|
if (!thisItem.mutable) {
|
|
14660
14656
|
addNotification({
|
|
14661
|
-
type:
|
|
14657
|
+
type: StatusType.Warning,
|
|
14662
14658
|
title: FORM_ALERTS.FORBIDDEN,
|
|
14663
14659
|
message: FORM_ALERTS.CANNOT_DELETE_RULE,
|
|
14664
|
-
crdType:
|
|
14660
|
+
crdType: EntityTypes.InstrumentationRule,
|
|
14665
14661
|
target: drawerEntityId,
|
|
14666
14662
|
hideFromHistory: true,
|
|
14667
14663
|
});
|
|
@@ -14676,7 +14672,7 @@ const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrument
|
|
|
14676
14672
|
}
|
|
14677
14673
|
};
|
|
14678
14674
|
const handleSave = (newTitle) => {
|
|
14679
|
-
if (validateForm({ withAlert: true, alertTitle:
|
|
14675
|
+
if (validateForm({ withAlert: true, alertTitle: Crud.Update })) {
|
|
14680
14676
|
const title = newTitle !== thisItem.type ? newTitle : '';
|
|
14681
14677
|
handleFormChange('ruleName', title);
|
|
14682
14678
|
updateInstrumentationRule(drawerEntityId, { ...formData, ruleName: title });
|
|
@@ -14693,7 +14689,7 @@ const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrument
|
|
|
14693
14689
|
|
|
14694
14690
|
const InstrumentationRuleModal = ({ isEnterprise, createInstrumentationRule }) => {
|
|
14695
14691
|
const { currentModal, setCurrentModal } = useModalStore();
|
|
14696
|
-
const isOpen = currentModal ===
|
|
14692
|
+
const isOpen = currentModal === EntityTypes.InstrumentationRule;
|
|
14697
14693
|
const { formData, formErrors, handleFormChange, resetFormData, validateForm } = useInstrumentationRuleFormData();
|
|
14698
14694
|
const [selectedItem, setSelectedItem] = useState(undefined);
|
|
14699
14695
|
const handleClose = () => {
|
|
@@ -14706,7 +14702,7 @@ const InstrumentationRuleModal = ({ isEnterprise, createInstrumentationRule }) =
|
|
|
14706
14702
|
setSelectedItem(item);
|
|
14707
14703
|
};
|
|
14708
14704
|
const handleSubmit = () => {
|
|
14709
|
-
const isFormOk = validateForm({ withAlert: true, alertTitle:
|
|
14705
|
+
const isFormOk = validateForm({ withAlert: true, alertTitle: Crud.Create });
|
|
14710
14706
|
if (!isFormOk)
|
|
14711
14707
|
return null;
|
|
14712
14708
|
createInstrumentationRule(formData);
|
|
@@ -14724,7 +14720,7 @@ const InstrumentationRuleModal = ({ isEnterprise, createInstrumentationRule }) =
|
|
|
14724
14720
|
] }) },
|
|
14725
14721
|
React.createElement(ModalBody, null,
|
|
14726
14722
|
React.createElement(SectionTitle, { title: 'Select Instrumentation Rule', description: 'Define how telemetry is recorded from your application. Choose a rule type and configure the details.' }),
|
|
14727
|
-
!isEnterprise && React.createElement(NotificationNote, { type:
|
|
14723
|
+
!isEnterprise && React.createElement(NotificationNote, { type: StatusType.Default, message: FORM_ALERTS.ENTERPRISE_ONLY('Instrumentation Rules'), style: { marginTop: '24px' } }),
|
|
14728
14724
|
React.createElement(AutocompleteInput, { options: INSTRUMENTATION_RULE_OPTIONS, selectedOption: selectedItem, onOptionSelect: (opt) => handleSelect(opt), style: { marginTop: isEnterprise ? '24px' : '12px' }, autoFocus: !selectedItem?.type }),
|
|
14729
14725
|
!!selectedItem?.type ? (React.createElement("div", null,
|
|
14730
14726
|
React.createElement(Divider, { margin: '16px 0' }),
|
|
@@ -14749,11 +14745,6 @@ const buildSpecCell = (rule) => {
|
|
|
14749
14745
|
return str;
|
|
14750
14746
|
};
|
|
14751
14747
|
|
|
14752
|
-
const TableWrap$1 = styled.div `
|
|
14753
|
-
width: 100%;
|
|
14754
|
-
max-height: ${({ $maxHeight }) => $maxHeight || 'unset'};
|
|
14755
|
-
overflow-y: auto;
|
|
14756
|
-
`;
|
|
14757
14748
|
const columns$1 = [
|
|
14758
14749
|
{ key: 'icon', title: '' },
|
|
14759
14750
|
{ key: 'name', title: DISPLAY_TITLES.NAME, sortable: true },
|
|
@@ -14766,8 +14757,8 @@ const columns$1 = [
|
|
|
14766
14757
|
];
|
|
14767
14758
|
const InstrumentationRuleTable = ({ maxHeight, maxWidth }) => {
|
|
14768
14759
|
const theme = Theme.useTheme();
|
|
14769
|
-
const { instrumentationRules } = useEntityStore();
|
|
14770
14760
|
const { setDrawerType, setDrawerEntityId } = useDrawerStore();
|
|
14761
|
+
const { instrumentationRules, instrumentationRulesLoading } = useEntityStore();
|
|
14771
14762
|
const rows = useMemo(() =>
|
|
14772
14763
|
// note: rules do not have filters yet
|
|
14773
14764
|
instrumentationRules.map((rule) => {
|
|
@@ -14779,7 +14770,7 @@ const InstrumentationRuleTable = ({ maxHeight, maxWidth }) => {
|
|
|
14779
14770
|
},
|
|
14780
14771
|
{
|
|
14781
14772
|
columnKey: 'name',
|
|
14782
|
-
value: getEntityLabel(rule,
|
|
14773
|
+
value: getEntityLabel(rule, EntityTypes.InstrumentationRule, { prioritizeDisplayName: true }),
|
|
14783
14774
|
},
|
|
14784
14775
|
{
|
|
14785
14776
|
columnKey: 'type',
|
|
@@ -14806,22 +14797,22 @@ const InstrumentationRuleTable = ({ maxHeight, maxWidth }) => {
|
|
|
14806
14797
|
{
|
|
14807
14798
|
columnKey: 'active-status',
|
|
14808
14799
|
component: () => (React.createElement("div", { style: { lineHeight: 1 } },
|
|
14809
|
-
React.createElement(Status, { status: rule.disabled ?
|
|
14800
|
+
React.createElement(Status, { status: rule.disabled ? StatusType.Error : StatusType.Success, title: rule.disabled ? 'Inactive' : 'Active', withIcon: true, withBorder: true }))),
|
|
14810
14801
|
},
|
|
14811
14802
|
{
|
|
14812
14803
|
columnKey: 'source-count',
|
|
14813
14804
|
component: () => (React.createElement("div", { style: { lineHeight: 1 } },
|
|
14814
|
-
React.createElement(Status, { status:
|
|
14805
|
+
React.createElement(Status, { status: StatusType.Info, title: 'all sources', withBorder: true }))),
|
|
14815
14806
|
},
|
|
14816
14807
|
],
|
|
14817
14808
|
};
|
|
14818
14809
|
}), [instrumentationRules]);
|
|
14819
|
-
return (React.createElement(
|
|
14820
|
-
React.createElement(
|
|
14821
|
-
React.createElement(IconTitleBadge, { icon: getEntityIcon(
|
|
14822
|
-
React.createElement(TableWrap
|
|
14810
|
+
return (React.createElement(TableContainer, { "$maxWidth": maxWidth },
|
|
14811
|
+
React.createElement(TableTitleWrap, null,
|
|
14812
|
+
React.createElement(IconTitleBadge, { icon: getEntityIcon(EntityTypes.Action), title: DISPLAY_TITLES.InstrumentationRules, badge: instrumentationRules.length, loading: instrumentationRulesLoading })),
|
|
14813
|
+
React.createElement(TableWrap, { "$maxHeight": maxHeight },
|
|
14823
14814
|
React.createElement(InteractiveTable, { columns: columns$1, rows: rows, onRowClick: (idx) => {
|
|
14824
|
-
setDrawerType(
|
|
14815
|
+
setDrawerType(EntityTypes.InstrumentationRule);
|
|
14825
14816
|
setDrawerEntityId(instrumentationRules[idx].ruleId);
|
|
14826
14817
|
} })),
|
|
14827
14818
|
!instrumentationRules.length && (React.createElement(CenterThis, { style: { marginTop: '2rem' } },
|
|
@@ -14876,7 +14867,7 @@ const MultiSourceControl = ({ totalSourceCount, uninstrumentSources }) => {
|
|
|
14876
14867
|
React.createElement(Button, { variant: 'tertiary', onClick: () => setIsWarnModalOpen(true) },
|
|
14877
14868
|
React.createElement(TrashIcon, null),
|
|
14878
14869
|
React.createElement(Text, { family: 'secondary', decoration: 'underline', color: theme.text.error }, "Uninstrument"))),
|
|
14879
|
-
React.createElement(DeleteWarning, { isOpen: isWarnModalOpen, name: `${totalSelected} sources`, type:
|
|
14870
|
+
React.createElement(DeleteWarning, { isOpen: isWarnModalOpen, name: `${totalSelected} sources`, type: EntityTypes.Source, isLastItem: totalSelected === totalSourceCount, onApprove: onDelete, onDeny: () => setIsWarnModalOpen(false) })));
|
|
14880
14871
|
};
|
|
14881
14872
|
|
|
14882
14873
|
const RelativeContainer = styled.div `
|
|
@@ -15005,7 +14996,7 @@ const NotificationListItem = ({ id, seen, type, title, message, time, crdType, t
|
|
|
15005
14996
|
const timeAgo = useTimeAgo();
|
|
15006
14997
|
const { onClickNotification } = useClickNotification();
|
|
15007
14998
|
const canClick = !!crdType && !!target;
|
|
15008
|
-
const isDeleted = title?.toLowerCase().includes(
|
|
14999
|
+
const isDeleted = title?.toLowerCase().includes(Crud.Delete.toLowerCase()) || false;
|
|
15009
15000
|
const Icon = getStatusIcon(type, theme);
|
|
15010
15001
|
return (React.createElement(NotifCard, { key: `notification-${id}`, className: canClick ? 'click-enabled' : '', onClick: () => {
|
|
15011
15002
|
if (canClick) {
|
|
@@ -15013,7 +15004,7 @@ const NotificationListItem = ({ id, seen, type, title, message, time, crdType, t
|
|
|
15013
15004
|
onClickNotification({ id, crdType, target });
|
|
15014
15005
|
}
|
|
15015
15006
|
} },
|
|
15016
|
-
React.createElement(StatusIcon, { "$type": isDeleted ?
|
|
15007
|
+
React.createElement(StatusIcon, { "$type": isDeleted ? StatusType.Error : type }, isDeleted ? React.createElement(TrashIcon, null) : React.createElement(Icon, null)),
|
|
15017
15008
|
React.createElement(NotifTextWrap, null,
|
|
15018
15009
|
React.createElement(NotifHeaderTextWrap, null,
|
|
15019
15010
|
React.createElement(Text, { size: 14 }, message)),
|
|
@@ -15024,24 +15015,24 @@ const NotificationListItem = ({ id, seen, type, title, message, time, crdType, t
|
|
|
15024
15015
|
React.createElement(Text, { size: 10, color: theme.colors.orange_soft }, "new")))))));
|
|
15025
15016
|
};
|
|
15026
15017
|
|
|
15027
|
-
var
|
|
15028
|
-
(function (
|
|
15029
|
-
|
|
15030
|
-
|
|
15031
|
-
|
|
15032
|
-
|
|
15033
|
-
|
|
15034
|
-
})(
|
|
15018
|
+
var NavIconIds;
|
|
15019
|
+
(function (NavIconIds) {
|
|
15020
|
+
NavIconIds["Overview"] = "overview";
|
|
15021
|
+
NavIconIds["InstrumentationRules"] = "instrumentation rule";
|
|
15022
|
+
NavIconIds["Sources"] = "source";
|
|
15023
|
+
NavIconIds["Actions"] = "action";
|
|
15024
|
+
NavIconIds["Destinations"] = "destination";
|
|
15025
|
+
})(NavIconIds || (NavIconIds = {}));
|
|
15035
15026
|
const SideNav = ({ onClickId, defaultSelectedId, extendedNavIcons }) => {
|
|
15036
15027
|
const [selectedId, setSelectedId] = useState(defaultSelectedId || '');
|
|
15037
15028
|
const mainIcons = useMemo(() => [
|
|
15038
15029
|
{
|
|
15039
|
-
id:
|
|
15030
|
+
id: NavIconIds.Overview,
|
|
15040
15031
|
icon: OverviewIcon,
|
|
15041
|
-
selected: selectedId ===
|
|
15032
|
+
selected: selectedId === NavIconIds.Overview,
|
|
15042
15033
|
onClick: () => {
|
|
15043
|
-
setSelectedId(
|
|
15044
|
-
onClickId(
|
|
15034
|
+
setSelectedId(NavIconIds.Overview);
|
|
15035
|
+
onClickId(NavIconIds.Overview);
|
|
15045
15036
|
},
|
|
15046
15037
|
tooltip: 'Overview',
|
|
15047
15038
|
},
|
|
@@ -15054,45 +15045,45 @@ const SideNav = ({ onClickId, defaultSelectedId, extendedNavIcons }) => {
|
|
|
15054
15045
|
},
|
|
15055
15046
|
})),
|
|
15056
15047
|
], [selectedId]);
|
|
15057
|
-
const subIcons = useMemo(() => [
|
|
15048
|
+
const subIcons = useMemo(() => [NavIconIds.Overview, NavIconIds.InstrumentationRules, NavIconIds.Sources, NavIconIds.Actions, NavIconIds.Destinations].includes(selectedId)
|
|
15058
15049
|
? [
|
|
15059
15050
|
{
|
|
15060
|
-
id:
|
|
15051
|
+
id: NavIconIds.InstrumentationRules,
|
|
15061
15052
|
icon: RulesIcon,
|
|
15062
|
-
selected: selectedId ===
|
|
15053
|
+
selected: selectedId === NavIconIds.InstrumentationRules,
|
|
15063
15054
|
onClick: () => {
|
|
15064
|
-
setSelectedId(
|
|
15065
|
-
onClickId(
|
|
15055
|
+
setSelectedId(NavIconIds.InstrumentationRules);
|
|
15056
|
+
onClickId(NavIconIds.InstrumentationRules);
|
|
15066
15057
|
},
|
|
15067
15058
|
tooltip: 'Instrumentation Rules',
|
|
15068
15059
|
},
|
|
15069
15060
|
{
|
|
15070
|
-
id:
|
|
15061
|
+
id: NavIconIds.Sources,
|
|
15071
15062
|
icon: SourcesIcon,
|
|
15072
|
-
selected: selectedId ===
|
|
15063
|
+
selected: selectedId === NavIconIds.Sources,
|
|
15073
15064
|
onClick: () => {
|
|
15074
|
-
setSelectedId(
|
|
15075
|
-
onClickId(
|
|
15065
|
+
setSelectedId(NavIconIds.Sources);
|
|
15066
|
+
onClickId(NavIconIds.Sources);
|
|
15076
15067
|
},
|
|
15077
15068
|
tooltip: 'Sources',
|
|
15078
15069
|
},
|
|
15079
15070
|
{
|
|
15080
|
-
id:
|
|
15071
|
+
id: NavIconIds.Actions,
|
|
15081
15072
|
icon: ActionsIcon,
|
|
15082
|
-
selected: selectedId ===
|
|
15073
|
+
selected: selectedId === NavIconIds.Actions,
|
|
15083
15074
|
onClick: () => {
|
|
15084
|
-
setSelectedId(
|
|
15085
|
-
onClickId(
|
|
15075
|
+
setSelectedId(NavIconIds.Actions);
|
|
15076
|
+
onClickId(NavIconIds.Actions);
|
|
15086
15077
|
},
|
|
15087
15078
|
tooltip: 'Actions',
|
|
15088
15079
|
},
|
|
15089
15080
|
{
|
|
15090
|
-
id:
|
|
15081
|
+
id: NavIconIds.Destinations,
|
|
15091
15082
|
icon: DestinationsIcon,
|
|
15092
|
-
selected: selectedId ===
|
|
15083
|
+
selected: selectedId === NavIconIds.Destinations,
|
|
15093
15084
|
onClick: () => {
|
|
15094
|
-
setSelectedId(
|
|
15095
|
-
onClickId(
|
|
15085
|
+
setSelectedId(NavIconIds.Destinations);
|
|
15086
|
+
onClickId(NavIconIds.Destinations);
|
|
15096
15087
|
},
|
|
15097
15088
|
tooltip: 'Destinations',
|
|
15098
15089
|
},
|
|
@@ -15128,18 +15119,18 @@ const Describe$1 = ({ source, fetchDescribeSource }) => {
|
|
|
15128
15119
|
}
|
|
15129
15120
|
return (React.createElement(FlexColumn, { "$gap": 12 }, !describe.pods?.length ? (React.createElement(CenterThis, null,
|
|
15130
15121
|
React.createElement(NoDataFound, { subTitle: 'Check if you have any running pods and try again' }))) : (describe.pods.map(({ podName, nodeName, phase, containers }) => {
|
|
15131
|
-
const podHasErrors = phase.status !==
|
|
15132
|
-
containers.findIndex(({ instrumentationInstances }) => instrumentationInstances.findIndex(({ healthy }) => healthy.status !==
|
|
15133
|
-
const podStatus = podHasErrors ?
|
|
15134
|
-
const divider = { type:
|
|
15122
|
+
const podHasErrors = phase.status !== StatusType.Success ||
|
|
15123
|
+
containers.findIndex(({ instrumentationInstances }) => instrumentationInstances.findIndex(({ healthy }) => healthy.status !== StatusType.Success) !== -1) !== -1;
|
|
15124
|
+
const podStatus = podHasErrors ? StatusType.Error : StatusType.Success;
|
|
15125
|
+
const divider = { type: DataCardFieldTypes.Divider };
|
|
15135
15126
|
return (React.createElement(DataCard, { key: `pod-${podName.value}`, title: `Pod: ${podName.value}`, withExtend: true, action: () => React.createElement(Status, { status: podStatus, title: podStatus, withIcon: true, withBorder: true }), data: [
|
|
15136
15127
|
{
|
|
15137
|
-
type:
|
|
15128
|
+
type: DataCardFieldTypes.CopyText,
|
|
15138
15129
|
value: `kubectl get pod ${podName.value} -n ${describe?.namespace?.value || source.namespace}`,
|
|
15139
15130
|
},
|
|
15140
15131
|
divider,
|
|
15141
15132
|
{
|
|
15142
|
-
type:
|
|
15133
|
+
type: DataCardFieldTypes.DescribeRow,
|
|
15143
15134
|
value: JSON.stringify({
|
|
15144
15135
|
title: nodeName.name,
|
|
15145
15136
|
tooltip: nodeName.explain,
|
|
@@ -15151,7 +15142,7 @@ const Describe$1 = ({ source, fetchDescribeSource }) => {
|
|
|
15151
15142
|
},
|
|
15152
15143
|
divider,
|
|
15153
15144
|
{
|
|
15154
|
-
type:
|
|
15145
|
+
type: DataCardFieldTypes.DescribeRow,
|
|
15155
15146
|
value: JSON.stringify({
|
|
15156
15147
|
title: phase.name,
|
|
15157
15148
|
tooltip: phase.explain,
|
|
@@ -15164,7 +15155,7 @@ const Describe$1 = ({ source, fetchDescribeSource }) => {
|
|
|
15164
15155
|
divider,
|
|
15165
15156
|
...containers.map((container) => {
|
|
15166
15157
|
return {
|
|
15167
|
-
type:
|
|
15158
|
+
type: DataCardFieldTypes.PodContainer,
|
|
15168
15159
|
value: JSON.stringify({
|
|
15169
15160
|
containerName: container.containerName.value,
|
|
15170
15161
|
actualDevice: {
|
|
@@ -15187,7 +15178,7 @@ const Describe$1 = ({ source, fetchDescribeSource }) => {
|
|
|
15187
15178
|
const buildCard = (source) => {
|
|
15188
15179
|
const { name, kind, namespace } = source;
|
|
15189
15180
|
const arr = [
|
|
15190
|
-
{ title: DISPLAY_TITLES.
|
|
15181
|
+
{ title: DISPLAY_TITLES.Namespace, value: namespace },
|
|
15191
15182
|
{ title: DISPLAY_TITLES.KIND, value: kind },
|
|
15192
15183
|
{ title: DISPLAY_TITLES.NAME, value: name, tooltip: 'K8s resource name' },
|
|
15193
15184
|
];
|
|
@@ -15205,11 +15196,11 @@ const SourceForm = ({ formData, handleFormChange }) => {
|
|
|
15205
15196
|
React.createElement(Input, { name: 'sourceName', title: 'Source name', tooltip: 'This overrides the default service name that runs in your cluster.', placeholder: 'Use a name that overrides the source name', value: formData.otelServiceName, onChange: ({ target: { value } }) => handleFormChange('otelServiceName', value) })));
|
|
15206
15197
|
};
|
|
15207
15198
|
|
|
15208
|
-
var
|
|
15209
|
-
(function (
|
|
15210
|
-
|
|
15211
|
-
|
|
15212
|
-
})(
|
|
15199
|
+
var Tabs;
|
|
15200
|
+
(function (Tabs) {
|
|
15201
|
+
Tabs["Overview"] = "Overview";
|
|
15202
|
+
Tabs["Pods"] = "Pods";
|
|
15203
|
+
})(Tabs || (Tabs = {}));
|
|
15213
15204
|
const FormContainer = styled.div `
|
|
15214
15205
|
width: 100%;
|
|
15215
15206
|
height: 100%;
|
|
@@ -15225,10 +15216,10 @@ const DataContainer$1 = styled.div `
|
|
|
15225
15216
|
const SourceDrawer = ({ persistSources, updateSource, fetchDescribeSource }) => {
|
|
15226
15217
|
const { sources } = useEntityStore();
|
|
15227
15218
|
const { drawerType, drawerEntityId, setDrawerEntityId, setDrawerType } = useDrawerStore();
|
|
15228
|
-
const [selectedTab, setSelectedTab] = useState(
|
|
15229
|
-
const isOpen = drawerType !==
|
|
15219
|
+
const [selectedTab, setSelectedTab] = useState(Tabs.Overview);
|
|
15220
|
+
const isOpen = drawerType !== EntityTypes.Source;
|
|
15230
15221
|
const onClose = () => {
|
|
15231
|
-
setSelectedTab(
|
|
15222
|
+
setSelectedTab(Tabs.Overview);
|
|
15232
15223
|
setDrawerType(null);
|
|
15233
15224
|
setDrawerEntityId(null);
|
|
15234
15225
|
};
|
|
@@ -15246,7 +15237,7 @@ const SourceDrawer = ({ persistSources, updateSource, fetchDescribeSource }) =>
|
|
|
15246
15237
|
if (!thisItem)
|
|
15247
15238
|
return null;
|
|
15248
15239
|
const containersData = thisItem.containers?.map((container) => ({
|
|
15249
|
-
type:
|
|
15240
|
+
type: DataCardFieldTypes.SourceContainer,
|
|
15250
15241
|
value: JSON.stringify(container),
|
|
15251
15242
|
})) || [];
|
|
15252
15243
|
const handleEdit = (bool) => {
|
|
@@ -15273,18 +15264,18 @@ const SourceDrawer = ({ persistSources, updateSource, fetchDescribeSource }) =>
|
|
|
15273
15264
|
setIsEditing(false);
|
|
15274
15265
|
setIsFormDirty(false);
|
|
15275
15266
|
};
|
|
15276
|
-
return (React.createElement(OverviewDrawer, { title: thisItem.otelServiceName || thisItem.name, titleTooltip: 'This attribute is used to identify the name of the service (service.name) that is generating telemetry data.', icon: getEntityIcon(
|
|
15267
|
+
return (React.createElement(OverviewDrawer, { title: thisItem.otelServiceName || thisItem.name, titleTooltip: 'This attribute is used to identify the name of the service (service.name) that is generating telemetry data.', icon: getEntityIcon(EntityTypes.Source), isEdit: isEditing, isFormDirty: isFormDirty, onEdit: selectedTab === Tabs.Overview ? handleEdit : undefined, onSave: handleSave, onDelete: selectedTab === Tabs.Overview ? handleDelete : undefined, onCancel: handleCancel, isLastItem: sources.length === 1, tabs: [
|
|
15277
15268
|
{
|
|
15278
|
-
label:
|
|
15279
|
-
onClick: () => setSelectedTab(
|
|
15280
|
-
selected: selectedTab ===
|
|
15269
|
+
label: Tabs.Overview,
|
|
15270
|
+
onClick: () => setSelectedTab(Tabs.Overview),
|
|
15271
|
+
selected: selectedTab === Tabs.Overview,
|
|
15281
15272
|
},
|
|
15282
15273
|
{
|
|
15283
|
-
label:
|
|
15284
|
-
onClick: () => setSelectedTab(
|
|
15285
|
-
selected: selectedTab ===
|
|
15274
|
+
label: Tabs.Pods,
|
|
15275
|
+
onClick: () => setSelectedTab(Tabs.Pods),
|
|
15276
|
+
selected: selectedTab === Tabs.Pods,
|
|
15286
15277
|
},
|
|
15287
|
-
] }, selectedTab ===
|
|
15278
|
+
] }, selectedTab === Tabs.Overview ? (isEditing ? (React.createElement(FormContainer, null,
|
|
15288
15279
|
React.createElement(SourceForm, { formData: formData, handleFormChange: (...params) => {
|
|
15289
15280
|
setIsFormDirty(true);
|
|
15290
15281
|
handleFormChange(...params);
|
|
@@ -15550,7 +15541,7 @@ const SourceSelectionForm = forwardRef(({ componentType, isModal, namespaces, na
|
|
|
15550
15541
|
|
|
15551
15542
|
const SourceModal = ({ componentType = 'FAST', namespaces, namespace, namespacesLoading, selectedNamespace, setSelectedNamespace, persistSources }) => {
|
|
15552
15543
|
const { currentModal, setCurrentModal } = useModalStore();
|
|
15553
|
-
const isOpen = currentModal ===
|
|
15544
|
+
const isOpen = currentModal === EntityTypes.Source;
|
|
15554
15545
|
const onSelectNamespace = (ns) => {
|
|
15555
15546
|
setSelectedNamespace((prev) => (prev === ns ? '' : ns));
|
|
15556
15547
|
};
|
|
@@ -15577,16 +15568,11 @@ const SourceModal = ({ componentType = 'FAST', namespaces, namespace, namespaces
|
|
|
15577
15568
|
React.createElement(SourceSelectionForm, { ref: formRef, componentType: componentType, isModal: true, namespaces: namespaces, namespace: namespace, namespacesLoading: namespacesLoading, selectedNamespace: selectedNamespace, onSelectNamespace: onSelectNamespace })));
|
|
15578
15569
|
};
|
|
15579
15570
|
|
|
15580
|
-
const TableWrap = styled.div `
|
|
15581
|
-
width: 100%;
|
|
15582
|
-
max-height: ${({ $maxHeight }) => $maxHeight || 'unset'};
|
|
15583
|
-
overflow-y: auto;
|
|
15584
|
-
`;
|
|
15585
15571
|
const columns = [
|
|
15586
15572
|
{ key: 'checkbox-and-icon', title: '' },
|
|
15587
15573
|
{ key: 'name', title: DISPLAY_TITLES.NAME, sortable: true },
|
|
15588
15574
|
{ key: 'type', title: 'Kubernetes Type', sortable: true },
|
|
15589
|
-
{ key: 'namespace', title: DISPLAY_TITLES.
|
|
15575
|
+
{ key: 'namespace', title: DISPLAY_TITLES.Namespace, sortable: true },
|
|
15590
15576
|
{ key: 'containers', title: DISPLAY_TITLES.DETECTED_CONTAINERS },
|
|
15591
15577
|
{ key: 'conditions', title: 'Conditions' },
|
|
15592
15578
|
{ key: 'throughput', title: 'Throughput', sortable: true },
|
|
@@ -15594,10 +15580,20 @@ const columns = [
|
|
|
15594
15580
|
const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
15595
15581
|
const theme = Theme.useTheme();
|
|
15596
15582
|
const filters = useFilterStore();
|
|
15597
|
-
const { sources } = useEntityStore();
|
|
15598
15583
|
const { isThisPending } = usePendingStore();
|
|
15584
|
+
const { sources, sourcesLoading } = useEntityStore();
|
|
15599
15585
|
const { setDrawerType, setDrawerEntityId } = useDrawerStore();
|
|
15600
15586
|
const { selectedSources, setSelectedSources } = useSelectedStore();
|
|
15587
|
+
const { isAwaitingInstrumentation, sourcesToCreate, sourcesCreated, sourcesToDelete, sourcesDeleted } = useInstrumentStore();
|
|
15588
|
+
const instrumentingPercent = useMemo(() => {
|
|
15589
|
+
const calculateProgress = (total, completed) => (total > 0 ? Math.floor((100 / total) * completed) || 1 : 1);
|
|
15590
|
+
if (sourcesToCreate)
|
|
15591
|
+
return calculateProgress(sourcesToCreate, sourcesCreated);
|
|
15592
|
+
if (sourcesToDelete)
|
|
15593
|
+
return calculateProgress(sourcesToDelete, sourcesDeleted);
|
|
15594
|
+
return 1;
|
|
15595
|
+
}, [sourcesToCreate, sourcesCreated, sourcesToDelete, sourcesDeleted]);
|
|
15596
|
+
const filtered = useMemo(() => filterSources(sources, filters), [sources, filters]);
|
|
15601
15597
|
const [hasSelected, totalSelectedSources] = useMemo(() => {
|
|
15602
15598
|
let num = 0;
|
|
15603
15599
|
Object.values(selectedSources).forEach((selectedSources) => {
|
|
@@ -15608,9 +15604,9 @@ const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
15608
15604
|
const onSelectAll = useCallback((bool) => {
|
|
15609
15605
|
if (bool) {
|
|
15610
15606
|
const payload = {};
|
|
15611
|
-
|
|
15607
|
+
filtered.forEach((source) => {
|
|
15612
15608
|
const id = { namespace: source.namespace, name: source.name, kind: source.kind };
|
|
15613
|
-
const isPending = isThisPending({ entityType:
|
|
15609
|
+
const isPending = isThisPending({ entityType: EntityTypes.Source, entityId: id });
|
|
15614
15610
|
if (!isPending) {
|
|
15615
15611
|
if (!payload[source.namespace]) {
|
|
15616
15612
|
payload[source.namespace] = [source];
|
|
@@ -15625,7 +15621,7 @@ const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
15625
15621
|
else {
|
|
15626
15622
|
setSelectedSources({});
|
|
15627
15623
|
}
|
|
15628
|
-
}, [
|
|
15624
|
+
}, [filtered]);
|
|
15629
15625
|
const onSelectOne = useCallback((source) => {
|
|
15630
15626
|
const { namespace, name, kind } = source;
|
|
15631
15627
|
const payload = { ...selectedSources };
|
|
@@ -15640,16 +15636,13 @@ const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
15640
15636
|
}
|
|
15641
15637
|
setSelectedSources(payload);
|
|
15642
15638
|
}, [selectedSources]);
|
|
15643
|
-
const { isAwaitingInstrumentation, sourcesToCreate, sourcesCreated, sourcesToDelete, sourcesDeleted } = useInstrumentStore();
|
|
15644
|
-
const instrumentingPercent = (!!sourcesToCreate ? Math.floor((100 / sourcesToCreate) * sourcesCreated) : !!sourcesToDelete ? Math.floor((100 / sourcesToDelete) * sourcesDeleted) : 0) || 1;
|
|
15645
|
-
const filtered = useMemo(() => filterSources(sources, filters), [sources, filters]);
|
|
15646
15639
|
const rows = useMemo(() => filtered.map((source) => {
|
|
15647
15640
|
const id = { namespace: source.namespace, name: source.name, kind: source.kind };
|
|
15648
15641
|
const { hasErrors, hasWarnings, hasDisableds } = getConditionsBooleans(source.conditions || []);
|
|
15649
|
-
const isPending = isThisPending({ entityType:
|
|
15642
|
+
const isPending = isThisPending({ entityType: EntityTypes.Source, entityId: id });
|
|
15650
15643
|
const isChecked = !!selectedSources[id.namespace]?.find((x) => x.namespace === id.namespace && x.name === id.name && x.kind === id.kind);
|
|
15651
15644
|
return {
|
|
15652
|
-
status: hasErrors ?
|
|
15645
|
+
status: hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : undefined,
|
|
15653
15646
|
faded: hasDisableds,
|
|
15654
15647
|
cells: [
|
|
15655
15648
|
{
|
|
@@ -15660,7 +15653,7 @@ const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
15660
15653
|
},
|
|
15661
15654
|
{
|
|
15662
15655
|
columnKey: 'name',
|
|
15663
|
-
value: getEntityLabel(source,
|
|
15656
|
+
value: getEntityLabel(source, EntityTypes.Source, { extended: true }),
|
|
15664
15657
|
},
|
|
15665
15658
|
{
|
|
15666
15659
|
columnKey: 'type',
|
|
@@ -15674,7 +15667,7 @@ const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
15674
15667
|
},
|
|
15675
15668
|
{
|
|
15676
15669
|
columnKey: 'throughput',
|
|
15677
|
-
value: formatBytes(getMetricForEntity(metrics,
|
|
15670
|
+
value: formatBytes(getMetricForEntity(metrics, EntityTypes.Source, id).throughput),
|
|
15678
15671
|
textColor: theme.text.info,
|
|
15679
15672
|
},
|
|
15680
15673
|
{
|
|
@@ -15684,18 +15677,20 @@ const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
15684
15677
|
{
|
|
15685
15678
|
columnKey: 'containers',
|
|
15686
15679
|
component: () => (React.createElement("div", { style: { lineHeight: 1 } },
|
|
15687
|
-
React.createElement(Status, { status:
|
|
15680
|
+
React.createElement(Status, { status: StatusType.Info, title: getContainersInstrumentedCount(source.containers), withBorder: true }))),
|
|
15688
15681
|
},
|
|
15689
15682
|
],
|
|
15690
15683
|
};
|
|
15691
15684
|
}), [filtered, selectedSources, metrics, onSelectOne]);
|
|
15692
|
-
|
|
15693
|
-
|
|
15694
|
-
|
|
15695
|
-
|
|
15685
|
+
const badge = useMemo(() => (filtered.length !== sources.length ? `${filtered.length}/${sources.length}` : sources.length), [filtered, sources]);
|
|
15686
|
+
const badgeTooltip = useMemo(() => (filtered.length !== sources.length ? DISPLAY_TITLES.FILTERED_COUNT_TOOLTIP : undefined), [filtered, sources]);
|
|
15687
|
+
return (React.createElement(TableContainer, { "$maxWidth": maxWidth },
|
|
15688
|
+
React.createElement(TableTitleWrap, null,
|
|
15689
|
+
React.createElement(Checkbox, { partiallyChecked: hasSelected && filtered?.length !== totalSelectedSources, value: hasSelected && filtered?.length === totalSelectedSources, onChange: onSelectAll, disabled: !filtered?.length }),
|
|
15690
|
+
React.createElement(IconTitleBadge, { icon: getEntityIcon(EntityTypes.Source), title: DISPLAY_TITLES.Sources, badge: badge, badgeTooltip: badgeTooltip, loading: sourcesLoading && !isAwaitingInstrumentation })),
|
|
15696
15691
|
React.createElement(TableWrap, { "$maxHeight": maxHeight },
|
|
15697
15692
|
React.createElement(InteractiveTable, { columns: columns, rows: isAwaitingInstrumentation ? [] : rows, onRowClick: (idx) => {
|
|
15698
|
-
setDrawerType(
|
|
15693
|
+
setDrawerType(EntityTypes.Source);
|
|
15699
15694
|
setDrawerEntityId({ namespace: filtered[idx].namespace, name: filtered[idx].name, kind: filtered[idx].kind });
|
|
15700
15695
|
} })),
|
|
15701
15696
|
isAwaitingInstrumentation ? (React.createElement(CenterThis, { style: { marginTop: '2rem', gap: '24px' } },
|
|
@@ -15760,7 +15755,7 @@ const TokenActions = ({ token, saveToken }) => {
|
|
|
15760
15755
|
setIsEdit(false);
|
|
15761
15756
|
setInputValue(token);
|
|
15762
15757
|
};
|
|
15763
|
-
const SuccessIcon = getStatusIcon(
|
|
15758
|
+
const SuccessIcon = getStatusIcon(StatusType.Success, theme);
|
|
15764
15759
|
useOnClickOutside(popupRef, onCloseEdit);
|
|
15765
15760
|
return (React.createElement(FlexRow, { "$gap": 0 },
|
|
15766
15761
|
React.createElement(IconButton, { size: 32, onClick: () => clickCopy(token) }, isCopied ? React.createElement(SuccessIcon, null) : React.createElement(CopyIcon, null)),
|
|
@@ -15783,7 +15778,7 @@ const TokenActions = ({ token, saveToken }) => {
|
|
|
15783
15778
|
const Tokens = ({ tokens, saveToken }) => {
|
|
15784
15779
|
return (React.createElement(DataCard, { title: 'Authorization Tokens', titleBadge: tokens.length, data: [
|
|
15785
15780
|
{
|
|
15786
|
-
type:
|
|
15781
|
+
type: DataCardFieldTypes.Table,
|
|
15787
15782
|
value: {
|
|
15788
15783
|
columns: [
|
|
15789
15784
|
{ key: 'icon', title: '' },
|
|
@@ -15826,10 +15821,10 @@ const Describe = ({ fetchDescribeOdigos }) => {
|
|
|
15826
15821
|
const mapObjectToCardFields = (obj) => !!obj?.name
|
|
15827
15822
|
? [
|
|
15828
15823
|
{
|
|
15829
|
-
type:
|
|
15824
|
+
type: DataCardFieldTypes.Divider,
|
|
15830
15825
|
},
|
|
15831
15826
|
{
|
|
15832
|
-
type:
|
|
15827
|
+
type: DataCardFieldTypes.DescribeRow,
|
|
15833
15828
|
value: JSON.stringify({
|
|
15834
15829
|
title: obj.name,
|
|
15835
15830
|
subTitle: obj.explain,
|
|
@@ -15956,4 +15951,4 @@ const ToggleDarkMode = () => {
|
|
|
15956
15951
|
React.createElement(Background, { "$darkMode": darkMode })));
|
|
15957
15952
|
};
|
|
15958
15953
|
|
|
15959
|
-
export { ActionDrawer, ActionForm, ActionModal, ActionTable, AwaitPipeline, ComputePlatformSelect, ComputePlatforms, ComputePlatformsActionsMenu, ConnectionStatusDropdown, ConnectionTypeDropdown, DataFlow, DataFlowActionsMenu, DestinationDrawer, DestinationForm, DestinationModal, DestinationSelectionForm, DestinationTable, ErrorDropdown, InstrumentationRuleDrawer, InstrumentationRuleForm, InstrumentationRuleModal, InstrumentationRuleTable, KindDropdown, LanguageDropdown, MonitorDropdown, MultiSourceControl,
|
|
15954
|
+
export { ActionDrawer, ActionForm, ActionModal, ActionTable, AwaitPipeline, ComputePlatformSelect, ComputePlatforms, ComputePlatformsActionsMenu, ConnectionStatusDropdown, ConnectionTypeDropdown, DataFlow, DataFlowActionsMenu, DestinationDrawer, DestinationForm, DestinationModal, DestinationSelectionForm, DestinationTable, ErrorDropdown, InstrumentationRuleDrawer, InstrumentationRuleForm, InstrumentationRuleModal, InstrumentationRuleTable, KindDropdown, LanguageDropdown, MonitorDropdown, MultiSourceControl, NamespaceDropdown, NavIconIds, NotificationManager, OverviewDrawer, SideNav, SlackInvite, SourceDrawer, SourceForm, SourceModal, SourceSelectionForm, SourceTable, SystemOverview, ToastList, ToggleDarkMode };
|