@odigos/ui-kit 0.0.40 → 0.0.42
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 +14 -0
- package/lib/components/data-card/data-card-fields/index.d.ts +1 -0
- package/lib/components/data-card/data-card-fields/override-runtime.d.ts +9 -0
- package/lib/components/dropdown/index.d.ts +4 -2
- package/lib/components.js +8 -8
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/sources/index.d.ts +4 -0
- package/lib/constants/strings/index.d.ts +3 -0
- package/lib/constants.js +1 -1
- package/lib/containers.js +15 -15
- package/lib/functions/index.d.ts +2 -0
- package/lib/functions/is-valid-version/index.d.ts +1 -0
- package/lib/functions/parse-boolean-from-string/index.d.ts +1 -0
- package/lib/functions.js +5 -5
- package/lib/hooks.js +3 -3
- package/lib/icons.js +6 -7
- package/lib/{index-BOzJKKRm.js → index-BJn6pgjP.js} +2 -2
- package/lib/{index-DnKXoQhy.js → index-BMkvXaM3.js} +20 -32
- package/lib/{index-BuoxtJOI.js → index-Biu8ddMV.js} +84 -20
- package/lib/{index-BeVb1H9n.js → index-BvZgTeSU.js} +1369 -36
- package/lib/{index-Quqq11nF.js → index-CN-rJ_ZV.js} +3 -4
- package/lib/{index-zXCdgpRU.js → index-CQ2z02Y8.js} +1 -1
- package/lib/{index-Cau7bWmr.js → index-CS6xAoTK.js} +9 -2
- package/lib/{index-CBgnxpkW.js → index-CmGKwhgi.js} +1 -1
- package/lib/index-DtSbC1Cl.js +62 -0
- package/lib/{index-CDljW3_P.js → index-VLuOq8HF.js} +4 -4
- package/lib/snippets.js +7 -8
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/sources/index.d.ts +8 -2
- package/lib/{useSourceSelectionFormData-CrtSxE3G.js → useSourceSelectionFormData-xhTNmN-P.js} +2 -2
- package/lib/{useTransition-BumZECD3.js → useTransition-BOwXSp5e.js} +1 -1
- package/package.json +1 -1
- package/lib/index-BdZq2vdJ.js +0 -1297
- package/lib/index-CDHYBh8C.js +0 -11
|
@@ -1,13 +1,95 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ActionCategory, ActionType, SignalType, InstrumentationRuleType, ProgrammingLanguages, EntityTypes } from './types.js';
|
|
3
|
+
import { ThemeProvider, keyframes, useTheme } from 'styled-components';
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
+
const createStoreImpl = (createState) => {
|
|
6
|
+
let state;
|
|
7
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
8
|
+
const setState = (partial, replace) => {
|
|
9
|
+
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
10
|
+
if (!Object.is(nextState, state)) {
|
|
11
|
+
const previousState = state;
|
|
12
|
+
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
|
13
|
+
listeners.forEach((listener) => listener(state, previousState));
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const getState = () => state;
|
|
17
|
+
const getInitialState = () => initialState;
|
|
18
|
+
const subscribe = (listener) => {
|
|
19
|
+
listeners.add(listener);
|
|
20
|
+
return () => listeners.delete(listener);
|
|
21
|
+
};
|
|
22
|
+
const api = { setState, getState, getInitialState, subscribe };
|
|
23
|
+
const initialState = state = createState(setState, getState, api);
|
|
24
|
+
return api;
|
|
25
|
+
};
|
|
26
|
+
const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
27
|
+
|
|
28
|
+
const identity = (arg) => arg;
|
|
29
|
+
function useStore(api, selector = identity) {
|
|
30
|
+
const slice = React.useSyncExternalStore(
|
|
31
|
+
api.subscribe,
|
|
32
|
+
() => selector(api.getState()),
|
|
33
|
+
() => selector(api.getInitialState())
|
|
34
|
+
);
|
|
35
|
+
React.useDebugValue(slice);
|
|
36
|
+
return slice;
|
|
37
|
+
}
|
|
38
|
+
const createImpl = (createState) => {
|
|
39
|
+
const api = createStore(createState);
|
|
40
|
+
const useBoundStore = (selector) => useStore(api, selector);
|
|
41
|
+
Object.assign(useBoundStore, api);
|
|
42
|
+
return useBoundStore;
|
|
43
|
+
};
|
|
44
|
+
const create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
45
|
+
|
|
46
|
+
const AddClusterInfoIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
|
|
47
|
+
const theme = Theme.useTheme();
|
|
48
|
+
const fill = f || theme.text.secondary;
|
|
49
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
|
|
50
|
+
React.createElement("path", { stroke: fill, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M7.99992 11.3333V9.33333M7.99992 9.33333V7.33333M7.99992 9.33333H5.99992M7.99992 9.33333H9.99992M14.6666 8.26667V9.73333C14.6666 11.2268 14.6666 11.9735 14.3759 12.544C14.1203 13.0457 13.7123 13.4537 13.2106 13.7094C12.6401 14 11.8934 14 10.3999 14H5.59992C4.10645 14 3.35971 14 2.78928 13.7094C2.28751 13.4537 1.87956 13.0457 1.6239 12.544C1.33325 11.9735 1.33325 11.2268 1.33325 9.73333V6.26667C1.33325 4.77319 1.33325 4.02646 1.6239 3.45603C1.87956 2.95426 2.28751 2.54631 2.78928 2.29065C3.35971 2 4.10645 2 5.59992 2H5.81029C6.12336 2 6.2799 2 6.42199 2.04315C6.54778 2.08135 6.6648 2.14398 6.76636 2.22745C6.88108 2.32174 6.96791 2.45199 7.14157 2.71248L7.52493 3.28752C7.69859 3.54801 7.78542 3.67826 7.90014 3.77255C8.0017 3.85602 8.11873 3.91865 8.24452 3.95685C8.38661 4 8.54314 4 8.85621 4H10.3999C11.8934 4 12.6401 4 13.2106 4.29065C13.7123 4.54631 14.1203 4.95426 14.3759 5.45603C14.6666 6.02646 14.6666 6.77319 14.6666 8.26667Z' })));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const DeleteAttributeIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
|
|
5
54
|
const theme = Theme.useTheme();
|
|
6
55
|
const fill = f || theme.text.secondary;
|
|
7
|
-
return (React.createElement("svg", {
|
|
8
|
-
React.createElement("path", { d: '
|
|
9
|
-
|
|
10
|
-
|
|
56
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
|
|
57
|
+
React.createElement("path", { stroke: fill, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M10.6666 10.0007L8.66659 8.00065M8.66659 8.00065L6.66659 6.00065M8.66659 8.00065L10.6666 6.00065M8.66659 8.00065L6.66659 10.0007M4.41666 4.01431C3.33136 5.06369 2.34376 6.24491 1.47059 7.5384C1.37903 7.67404 1.33325 7.83734 1.33325 8.00065C1.33325 8.16396 1.37903 8.32726 1.47059 8.4629C2.34376 9.75639 3.33136 10.9376 4.41666 11.987C4.65522 12.2177 4.77449 12.333 4.94023 12.4319C5.07791 12.514 5.25728 12.5866 5.41337 12.6232C5.60126 12.6673 5.78723 12.6673 6.15917 12.6673H11.3332C12.2667 12.6673 12.7334 12.6673 13.0899 12.4857C13.4035 12.3259 13.6585 12.0709 13.8183 11.7573C13.9999 11.4008 13.9999 10.9341 13.9999 10.0007V6.00065C13.9999 5.06723 13.9999 4.60052 13.8183 4.244C13.6585 3.9304 13.4035 3.67543 13.0899 3.51564C12.7334 3.33398 12.2667 3.33398 11.3332 3.33398H6.15917C5.78723 3.33398 5.60126 3.33398 5.41337 3.37809C5.25728 3.41473 5.07791 3.48727 4.94023 3.56943C4.77449 3.66832 4.65522 3.78365 4.41666 4.01431Z' })));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const PiiMaskingIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
|
|
61
|
+
const theme = Theme.useTheme();
|
|
62
|
+
const fill = f || theme.text.secondary;
|
|
63
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
|
|
64
|
+
React.createElement("path", { stroke: fill, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M13.9486 9.71582C13.8698 9.87282 13.6245 9.98885 13.1338 10.2209L8.95284 12.198C8.60345 12.3632 8.42876 12.4458 8.24552 12.4783C8.08323 12.5071 7.91669 12.5071 7.7544 12.4783C7.57117 12.4458 7.39647 12.3632 7.04709 12.198L2.86615 10.2209C2.37544 9.98885 2.13008 9.87282 2.05135 9.71582M8.95288 9.19806L13.1338 7.22096C13.6245 6.98891 13.8699 6.87289 13.9486 6.71588C14.0171 6.57926 14.0171 6.42074 13.9486 6.28412C13.8699 6.12711 13.6245 6.01109 13.1338 5.77904L8.95288 3.80194C8.60349 3.63672 8.4288 3.55411 8.24556 3.5216C8.08327 3.4928 7.91673 3.4928 7.75444 3.5216C7.5712 3.55411 7.39651 3.63672 7.04712 3.80194L2.86618 5.77904C2.37547 6.01109 2.13012 6.12711 2.05139 6.28412C1.98287 6.42074 1.98287 6.57926 2.05139 6.71588C2.13012 6.87289 2.37547 6.98891 2.86618 7.22096L7.04712 9.19806C7.39651 9.36328 7.5712 9.44589 7.75444 9.4784C7.91673 9.5072 8.08327 9.5072 8.24556 9.4784C8.4288 9.44589 8.60349 9.36328 8.95288 9.19806Z' })));
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const RenameAttributeIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
|
|
68
|
+
const theme = Theme.useTheme();
|
|
69
|
+
const fill = f || theme.text.secondary;
|
|
70
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
|
|
71
|
+
React.createElement("path", { stroke: fill, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M14.6666 8.00065V12.0007M1.33325 12.6673L4.23847 4.1055C4.40371 3.64283 4.84196 3.33398 5.33325 3.33398C5.83824 3.33398 6.28547 3.66 6.43999 4.14076L9.33325 12.6673M2.69054 8.66732H7.97596M14.6666 10.0007C14.6666 11.1052 13.7712 12.0007 12.6666 12.0007C11.562 12.0007 10.6666 11.1052 10.6666 10.0007C10.6666 8.89608 11.562 8.00065 12.6666 8.00065C13.7712 8.00065 14.6666 8.89608 14.6666 10.0007Z' })));
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const SamplerIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
|
|
75
|
+
const theme = Theme.useTheme();
|
|
76
|
+
const fill = f || theme.text.secondary;
|
|
77
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
|
|
78
|
+
React.createElement("path", { stroke: fill, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M5.67367 5.67497H5.687M10.515 3.91532L12.1293 5.52965C13.0067 6.40707 13.4454 6.84578 13.6851 7.31618C14.1695 8.2669 14.1695 9.39207 13.6851 10.3428C13.4454 10.8132 13.0067 11.2519 12.1293 12.1293C11.2519 13.0067 10.8132 13.4454 10.3428 13.6851C9.39207 14.1695 8.2669 14.1695 7.31618 13.6851C6.84578 13.4454 6.40707 13.0067 5.52965 12.1293L3.91532 10.515C3.17317 9.77284 2.8021 9.40176 2.54483 8.96668C2.31682 8.58108 2.15521 8.15991 2.06673 7.72076C1.9669 7.22527 1.99448 6.70122 2.04965 5.65312L2.07845 5.10584C2.13195 4.0893 2.1587 3.58104 2.36993 3.18719C2.55598 2.84028 2.84028 2.55598 3.18719 2.36993C3.58104 2.1587 4.0893 2.13195 5.10584 2.07845L5.65312 2.04965C6.70122 1.99448 7.22527 1.9669 7.72076 2.06673C8.15991 2.15521 8.58108 2.31682 8.96668 2.54483C9.40176 2.8021 9.77284 3.17317 10.515 3.91532ZM6.32633 5.65853C6.32633 6.02672 6.02786 6.3252 5.65967 6.3252C5.29148 6.3252 4.993 6.02672 4.993 5.65853C4.993 5.29034 5.29148 4.99186 5.65967 4.99186C6.02786 4.99186 6.32633 5.29034 6.32633 5.65853Z' })));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const ImageErrorIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
|
|
82
|
+
const theme = Theme.useTheme();
|
|
83
|
+
const fill = f || theme.text.secondary;
|
|
84
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
|
|
85
|
+
React.createElement("path", { stroke: fill, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M17.2 21.0002L19.6 18.6002M19.6 18.6002L22 16.2002M19.6 18.6002L17.2 16.2002M19.6 18.6002L22 21.0002M22 12.1944V11C22 10.6449 22 10.3123 21.9989 10M13.1992 21H10C9.24401 21 8.59006 21 8.01712 20.9893M21.9989 10H21C19.607 10 18.9104 10 18.324 10.0603C12.9031 10.6176 8.61758 14.9031 8.06029 20.324C8.03963 20.5249 8.02605 20.7388 8.01712 20.9893M21.9989 10C21.9912 7.84993 21.9309 6.66397 21.455 5.73005C20.9757 4.78924 20.2108 4.02433 19.27 3.54497C18.2004 3 16.8003 3 14 3H10C7.19974 3 5.79961 3 4.73005 3.54497C3.78924 4.02433 3.02433 4.78924 2.54497 5.73005C2 6.79961 2 8.19974 2 11V13C2 15.8003 2 17.2004 2.54497 18.27C3.02433 19.2108 3.78924 19.9757 4.73005 20.455C5.51086 20.8529 6.46784 20.9603 8.01712 20.9893M7.5 9.5C6.94772 9.5 6.5 9.05228 6.5 8.5C6.5 7.94772 6.94772 7.5 7.5 7.5C8.05228 7.5 8.5 7.94772 8.5 8.5C8.5 9.05228 8.05228 9.5 7.5 9.5Z' })));
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const K8sLogo = ({ size = 16, fill: f, rotate = 0, onClick }) => {
|
|
89
|
+
const theme = Theme.useTheme();
|
|
90
|
+
const fill = f || theme.text.secondary;
|
|
91
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 20 20', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
|
|
92
|
+
React.createElement("path", { fill: fill, d: 'M18.3862 11.574C18.3689 11.574 18.3689 11.574 18.3862 11.574H18.3689C18.3516 11.574 18.3343 11.574 18.3343 11.5562C18.2997 11.5562 18.2651 11.5384 18.2305 11.5384C18.1093 11.5206 18.0055 11.5028 17.9017 11.5028C17.8498 11.5028 17.7979 11.5028 17.7286 11.485H17.7113C17.3479 11.4494 17.0537 11.4138 16.7769 11.3248C16.6557 11.2714 16.6211 11.2002 16.5865 11.129C16.5865 11.1113 16.5692 11.1113 16.5692 11.0935L16.3442 11.0223C16.4481 10.2036 16.4135 9.3493 16.2231 8.51281C16.0328 7.67633 15.704 6.89324 15.254 6.18134L15.4271 6.02116V5.98556C15.4271 5.89658 15.4444 5.80759 15.5136 5.7186C15.7213 5.52283 15.9808 5.36265 16.2923 5.16688C16.3442 5.13128 16.3962 5.11349 16.4481 5.07789C16.5519 5.0245 16.6384 4.97111 16.7423 4.89992C16.7596 4.88212 16.7942 4.86432 16.8288 4.82873C16.8461 4.81093 16.8634 4.81093 16.8634 4.79313C17.1057 4.57956 17.1576 4.22361 16.9845 3.99224C16.898 3.86766 16.7423 3.79647 16.5865 3.79647C16.4481 3.79647 16.3269 3.84986 16.2058 3.93885C16.1885 3.95665 16.1885 3.95665 16.1712 3.97444C16.1366 3.99224 16.1193 4.02784 16.0847 4.04563C15.9981 4.13462 15.9289 4.20581 15.8597 4.2948C15.8251 4.33039 15.7905 4.38379 15.7386 4.41938C15.4963 4.68635 15.2713 4.89992 15.0464 5.06009C14.9945 5.09569 14.9425 5.11349 14.8906 5.11349C14.856 5.11349 14.8214 5.11349 14.7868 5.09569H14.7522L14.5445 5.23807C14.3196 4.9889 14.0773 4.77533 13.835 4.56176C12.7967 3.72528 11.5335 3.20915 10.2183 3.08457L10.201 2.8532C10.1837 2.8354 10.1837 2.8354 10.1664 2.81761C10.1145 2.76421 10.0452 2.71082 10.0279 2.58624C10.0106 2.30148 10.0452 1.98112 10.0799 1.62517V1.60737C10.0799 1.55398 10.0972 1.48279 10.1145 1.4294C10.1318 1.32261 10.1491 1.21583 10.1664 1.09125V0.984461V0.931068C10.1664 0.610713 9.92412 0.34375 9.62993 0.34375C9.49149 0.34375 9.35305 0.41494 9.24922 0.521725C9.1454 0.62851 9.09348 0.77089 9.09348 0.931068V0.966663V1.07345C9.09348 1.19803 9.11079 1.30482 9.1454 1.4116C9.1627 1.46499 9.1627 1.51839 9.18001 1.58958V1.60737C9.21461 1.96332 9.26653 2.28368 9.23192 2.56844C9.21461 2.69302 9.14539 2.74642 9.09348 2.79981C9.07617 2.81761 9.07617 2.81761 9.05887 2.8354L9.04156 3.06677C8.73008 3.10237 8.41859 3.13796 8.1071 3.20915C6.77462 3.51171 5.59789 4.20581 4.68073 5.20247L4.50768 5.07789H4.47307C4.43846 5.07789 4.40385 5.09569 4.36924 5.09569C4.31732 5.09569 4.26541 5.07789 4.21349 5.0423C3.98853 4.88212 3.76357 4.65075 3.5213 4.38379C3.48669 4.34819 3.45208 4.2948 3.40016 4.2592C3.33094 4.17022 3.26172 4.09903 3.1752 4.01004C3.15789 3.99224 3.12328 3.97444 3.08867 3.93885C3.07137 3.92105 3.05406 3.92105 3.05406 3.90325C2.95024 3.81427 2.8118 3.76087 2.67336 3.76087C2.51761 3.76087 2.36187 3.83206 2.27534 3.95665C2.10229 4.18801 2.15421 4.54397 2.39648 4.75754C2.41378 4.75754 2.41378 4.77533 2.43109 4.77533C2.4657 4.79313 2.483 4.82873 2.51761 4.84652C2.62144 4.91771 2.70797 4.97111 2.8118 5.0245C2.86371 5.0423 2.91563 5.07789 2.96754 5.11349C3.27903 5.30926 3.5386 5.46944 3.74626 5.66521C3.83279 5.7542 3.83279 5.84318 3.83279 5.93217V5.96777L4.00583 6.12794C3.97123 6.18134 3.93662 6.21693 3.91931 6.27033C3.05406 7.67633 2.72527 9.3315 2.95024 10.9689L2.72527 11.0401C2.72527 11.0579 2.70797 11.0579 2.70797 11.0757C2.67336 11.1468 2.62144 11.218 2.51761 11.2714C2.25804 11.3604 1.94655 11.396 1.58315 11.4316H1.56584C1.51393 11.4316 1.44471 11.4316 1.39279 11.4494C1.28896 11.4494 1.18513 11.4672 1.064 11.485C1.02939 11.485 0.99478 11.5028 0.96017 11.5028C0.942865 11.5028 0.925561 11.5028 0.908256 11.5206C0.596767 11.5918 0.406413 11.8943 0.458328 12.1791C0.510243 12.4283 0.735207 12.5884 1.01209 12.5884C1.064 12.5884 1.09861 12.5884 1.15052 12.5706C1.16783 12.5706 1.18513 12.5706 1.18513 12.5529C1.21974 12.5529 1.25435 12.5351 1.28896 12.5351C1.4101 12.4995 1.49662 12.4639 1.60045 12.4105C1.65237 12.3927 1.70428 12.3571 1.7562 12.3393H1.7735C2.10229 12.2147 2.39648 12.1079 2.67336 12.0723H2.70797C2.8118 12.0723 2.88102 12.1257 2.93293 12.1613C2.95024 12.1613 2.95024 12.1791 2.96754 12.1791L3.20981 12.1435C3.62513 13.4605 4.42115 14.6352 5.47675 15.4894C5.71902 15.6852 5.96129 15.8454 6.22086 16.0056L6.11703 16.2369C6.11703 16.2547 6.13434 16.2547 6.13434 16.2725C6.16895 16.3437 6.20356 16.4327 6.16895 16.5573C6.06512 16.8243 5.90938 17.0912 5.71902 17.3938V17.4116C5.68441 17.465 5.6498 17.5006 5.61519 17.554C5.54597 17.6429 5.49406 17.7319 5.42484 17.8387C5.40753 17.8565 5.39023 17.8921 5.37292 17.9277C5.37292 17.9455 5.35562 17.9633 5.35562 17.9633C5.21718 18.2659 5.32101 18.604 5.58058 18.7286C5.6498 18.7642 5.71902 18.782 5.78824 18.782C5.9959 18.782 6.20356 18.6396 6.30739 18.4438C6.30739 18.426 6.32469 18.4082 6.32469 18.4082C6.342 18.3726 6.3593 18.337 6.37661 18.3192C6.42852 18.1947 6.44583 18.1057 6.48044 17.9989C6.49774 17.9455 6.51505 17.8921 6.53235 17.8387C6.65349 17.4828 6.74001 17.198 6.89576 16.9488C6.96498 16.8421 7.0515 16.8243 7.12072 16.7887C7.13802 16.7887 7.13802 16.7887 7.15533 16.7709L7.27646 16.5395C8.03788 16.8421 8.86852 17.0022 9.69915 17.0022C10.201 17.0022 10.7201 16.9488 11.2047 16.8243C11.5162 16.7531 11.8104 16.6641 12.1045 16.5573L12.2084 16.7531C12.2257 16.7531 12.2257 16.7531 12.243 16.7709C12.3295 16.7887 12.3987 16.8243 12.4679 16.931C12.6064 17.1802 12.7102 17.4828 12.8313 17.8209V17.8387C12.8486 17.8921 12.866 17.9455 12.8833 17.9989C12.9179 18.1057 12.9352 18.2125 12.9871 18.3192C13.0044 18.3548 13.0217 18.3726 13.039 18.4082C13.039 18.426 13.0563 18.4438 13.0563 18.4438C13.1601 18.6574 13.3678 18.782 13.5755 18.782C13.6447 18.782 13.7139 18.7642 13.7831 18.7286C13.9042 18.6574 14.0081 18.5506 14.0427 18.4082C14.0773 18.2659 14.0773 18.1057 14.0081 17.9633C14.0081 17.9455 13.9908 17.9455 13.9908 17.9277C13.9735 17.8921 13.9562 17.8565 13.9389 17.8387C13.8869 17.7319 13.8177 17.6429 13.7485 17.554C13.7139 17.5006 13.6793 17.465 13.6447 17.4116V17.3938C13.4543 17.0912 13.2813 16.8243 13.1947 16.5573C13.1601 16.4327 13.1947 16.3615 13.212 16.2725C13.212 16.2547 13.2294 16.2547 13.2294 16.2369L13.1428 16.0234C14.06 15.4716 14.8387 14.6886 15.4271 13.7275C15.7386 13.2292 15.9808 12.6774 16.1539 12.1257L16.3615 12.1613C16.3788 12.1613 16.3788 12.1435 16.3962 12.1435C16.4654 12.1079 16.5173 12.0545 16.6211 12.0545H16.6557C16.9326 12.0901 17.2268 12.1969 17.5556 12.3215H17.5729C17.6248 12.3393 17.6767 12.3749 17.7286 12.3927C17.8325 12.4461 17.919 12.4817 18.0401 12.5173C18.0747 12.5173 18.1093 12.5351 18.1439 12.5351C18.1613 12.5351 18.1786 12.5351 18.1959 12.5529C18.2478 12.5706 18.2824 12.5706 18.3343 12.5706C18.5939 12.5706 18.8188 12.3927 18.8881 12.1613C18.8881 11.9477 18.6977 11.663 18.3862 11.574ZM10.374 10.7019L9.61263 11.0757L8.85121 10.7019L8.66086 9.86543L9.18001 9.18912H10.0279L10.5471 9.86543L10.374 10.7019ZM14.8906 8.85097C15.0291 9.45608 15.0637 10.0612 15.0118 10.6485L12.3641 9.86543C12.1218 9.79423 11.9834 9.54507 12.0353 9.2959C12.0526 9.22471 12.0872 9.15352 12.1391 9.10013L14.233 7.1602C14.5272 7.65853 14.7522 8.22805 14.8906 8.85097ZM13.4024 6.09235L11.1355 7.74752C10.9451 7.8721 10.6855 7.83651 10.5298 7.64073C10.4779 7.58734 10.4606 7.51615 10.4433 7.44496L10.2875 4.54397C11.4816 4.68635 12.5718 5.23807 13.4024 6.09235ZM8.38398 4.63295C8.57433 4.59736 8.74738 4.56176 8.93774 4.52617L8.78199 7.37377C8.76469 7.62294 8.57433 7.83651 8.31476 7.83651C8.24554 7.83651 8.15901 7.81871 8.1071 7.78311L5.80555 6.09235C6.51505 5.36265 7.3976 4.86432 8.38398 4.63295ZM4.97491 7.1602L7.03419 9.04674C7.22455 9.20692 7.24185 9.50947 7.08611 9.70525C7.03419 9.77644 6.96498 9.82983 6.87845 9.84763L4.19619 10.6485C4.09236 9.43828 4.35193 8.21026 4.97491 7.1602ZM4.50768 11.9833L7.25916 11.5028C7.48412 11.485 7.69178 11.6452 7.7437 11.8765C7.761 11.9833 7.761 12.0723 7.72639 12.1613L6.67079 14.7775C5.70172 14.1368 4.923 13.158 4.50768 11.9833ZM10.824 15.525C10.426 15.614 10.0279 15.6674 9.61263 15.6674C9.00696 15.6674 8.41859 15.5606 7.86483 15.3827L9.23192 12.8376C9.37036 12.6774 9.59532 12.6062 9.78568 12.713C9.8722 12.7664 9.94142 12.8376 9.99334 12.9088L11.3258 15.3827C11.1701 15.436 10.997 15.4716 10.824 15.525ZM14.1984 13.0512C13.7658 13.7631 13.1947 14.3326 12.5372 14.7775L11.4469 12.0901C11.395 11.8765 11.4816 11.6452 11.6892 11.5384C11.7584 11.5028 11.845 11.485 11.9315 11.485L14.7003 11.9655C14.5964 12.3571 14.4234 12.713 14.1984 13.0512Z' })));
|
|
11
93
|
};
|
|
12
94
|
|
|
13
95
|
const KafkaLogo = ({ size = 16, fill, rotate = 0, onClick }) => {
|
|
@@ -15,25 +97,25 @@ const KafkaLogo = ({ size = 16, fill, rotate = 0, onClick }) => {
|
|
|
15
97
|
React.createElement("path", { fill: fill || '#231f20', d: 'M201.816 230.216c-16.186 0-30.697 7.171-40.634 18.461l-25.463-18.026c2.703-7.442 4.255-15.433 4.255-23.797 0-8.219-1.498-16.076-4.112-23.408l25.406-17.835c9.936 11.233 24.409 18.365 40.548 18.365 29.875 0 54.184-24.305 54.184-54.184 0-29.879-24.309-54.184-54.184-54.184-29.875 0-54.184 24.305-54.184 54.184 0 5.348.808 10.505 2.258 15.389l-25.423 17.844c-10.62-13.175-25.911-22.374-43.333-25.182v-30.64c24.544-5.155 43.037-26.962 43.037-53.019C124.171 24.305 99.862 0 69.987 0 40.112 0 15.803 24.305 15.803 54.184c0 25.708 18.014 47.246 42.067 52.769v31.038C25.044 143.753 0 172.401 0 206.854c0 34.621 25.292 63.374 58.355 68.94v32.774c-24.299 5.341-42.552 27.011-42.552 52.894 0 29.879 24.309 54.184 54.184 54.184 29.875 0 54.184-24.305 54.184-54.184 0-25.883-18.253-47.553-42.552-52.894v-32.775a69.965 69.965 0 0 0 42.6-24.776l25.633 18.143c-1.423 4.84-2.22 9.946-2.22 15.24 0 29.879 24.309 54.184 54.184 54.184 29.875 0 54.184-24.305 54.184-54.184 0-29.879-24.309-54.184-54.184-54.184zm0-126.695c14.487 0 26.27 11.788 26.27 26.271s-11.783 26.27-26.27 26.27-26.27-11.787-26.27-26.27c0-14.483 11.783-26.271 26.27-26.271zm-158.1-49.337c0-14.483 11.784-26.27 26.271-26.27s26.27 11.787 26.27 26.27c0 14.483-11.783 26.27-26.27 26.27s-26.271-11.787-26.271-26.27zm52.541 307.278c0 14.483-11.783 26.27-26.27 26.27s-26.271-11.787-26.271-26.27c0-14.483 11.784-26.27 26.271-26.27s26.27 11.787 26.27 26.27zm-26.272-117.97c-20.205 0-36.642-16.434-36.642-36.638 0-20.205 16.437-36.642 36.642-36.642 20.204 0 36.641 16.437 36.641 36.642 0 20.204-16.437 36.638-36.641 36.638zm131.831 67.179c-14.487 0-26.27-11.788-26.27-26.271s11.783-26.27 26.27-26.27 26.27 11.787 26.27 26.27c0 14.483-11.783 26.271-26.27 26.271z' })));
|
|
16
98
|
};
|
|
17
99
|
|
|
18
|
-
const
|
|
100
|
+
const CodeAttributesIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
|
|
19
101
|
const theme = Theme.useTheme();
|
|
20
102
|
const fill = f || theme.text.secondary;
|
|
21
|
-
return (React.createElement("svg", { width: size
|
|
22
|
-
React.createElement("path", { stroke: fill, strokeLinecap: 'round', strokeLinejoin: 'round', d: '
|
|
103
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
|
|
104
|
+
React.createElement("path", { stroke: fill, strokeWidth: '1.5', strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M8 4C6.34315 4 5 5.19391 5 6.66667V9.33333C5 10.8061 3.65685 12 2 12C3.65685 12 5 13.1939 5 14.6667V17.3333C5 18.8061 6.34315 20 8 20M16 4C17.6569 4 19 5.19391 19 6.66667V9.33333C19 10.8061 20.3431 12 22 12C20.3431 12 19 13.1939 19 14.6667V17.3333C19 18.8061 17.6569 20 16 20M12.001 12H12M15.001 12H15M9.001 12H9' })));
|
|
23
105
|
};
|
|
24
106
|
|
|
25
|
-
const
|
|
107
|
+
const HeadersCollectionIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
|
|
26
108
|
const theme = Theme.useTheme();
|
|
27
109
|
const fill = f || theme.text.secondary;
|
|
28
|
-
return (React.createElement("svg", { width: size
|
|
29
|
-
React.createElement("path", { stroke: fill, strokeLinecap: 'round', strokeLinejoin: 'round', d: '
|
|
110
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
|
|
111
|
+
React.createElement("path", { stroke: fill, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M15.9959 6.49365C15.9959 4.28451 14.205 2.49365 11.9959 2.49365C9.78673 2.49365 7.99587 4.28451 7.99587 6.49365C7.99587 8.00872 8.8382 9.32706 10.0801 10.0059L5.99587 17.4937M15.8474 20.8547C17.7058 22.0491 20.1806 21.5107 21.3749 19.6522C22.5692 17.7937 22.0308 15.3189 20.1724 14.1246C18.8978 13.3055 17.3333 13.3014 16.0908 13.9792L11.9997 6.49524M4.07185 13.9954C2.13343 15.055 1.42105 17.4855 2.48069 19.4239C3.54033 21.3623 5.97073 22.0747 7.90915 21.015C9.23855 20.2883 9.9913 18.9168 9.99125 17.5015L18.5205 17.4937' })));
|
|
30
112
|
};
|
|
31
113
|
|
|
32
|
-
const
|
|
114
|
+
const PayloadCollectionIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
|
|
33
115
|
const theme = Theme.useTheme();
|
|
34
116
|
const fill = f || theme.text.secondary;
|
|
35
|
-
return (React.createElement("svg", { width: size
|
|
36
|
-
React.createElement("path", { stroke: fill, strokeLinecap: 'round', strokeLinejoin: 'round', d: '
|
|
117
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
|
|
118
|
+
React.createElement("path", { stroke: fill, strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M7.99967 7.33333V11.3333M7.99967 11.3333C7.92987 11.3333 7.86007 11.31 7.80254 11.2634C7.37701 10.9186 6.99534 10.5224 6.66634 10.0837M7.99967 11.3333C8.06947 11.3333 8.13927 11.31 8.19681 11.2634C8.62234 10.9186 9.00401 10.5224 9.33301 10.0837M1.33301 6.26667C1.33301 4.77319 1.33301 4.02645 1.62365 3.45603C1.87932 2.95426 2.28727 2.54631 2.78903 2.29065C3.35946 2 4.1062 2 5.59967 2H5.81005C6.12312 2 6.27965 2 6.42174 2.04315C6.54753 2.08135 6.66455 2.14398 6.76614 2.22745C6.88081 2.32175 6.96767 2.45199 7.14134 2.71248L7.52467 3.28752C7.69834 3.54801 7.78521 3.67825 7.89987 3.77255C8.00147 3.85602 8.11847 3.91865 8.24427 3.95685C8.38634 4 8.54287 4 8.85594 4H10.3997C11.8931 4 12.6399 4 13.2103 4.29065C13.7121 4.54631 14.12 4.95426 14.3757 5.45603C14.6663 6.02645 14.6663 6.7732 14.6663 8.26667V9.73333C14.6663 11.2268 14.6663 11.9735 14.3757 12.544C14.12 13.0457 13.7121 13.4537 13.2103 13.7093C12.6399 14 11.8931 14 10.3997 14H5.59967C4.1062 14 3.35946 14 2.78903 13.7093C2.28727 13.4537 1.87932 13.0457 1.62365 12.544C1.33301 11.9735 1.33301 11.2268 1.33301 9.73333V6.26667Z' })));
|
|
37
119
|
};
|
|
38
120
|
|
|
39
121
|
const CPlusPlusLogo = ({ size = 16, fill, rotate = 0, onClick }) => {
|
|
@@ -482,32 +564,1283 @@ const SwiftLogo = ({ size = 16, fill, rotate = 0, onClick }) => {
|
|
|
482
564
|
React.createElement("path", { fill: fill || '#FFFFFF', d: 'M144.7 38c84.4 57.4 57.1 120.7 57.1 120.7s24 27.1 14.3 50.8c0 0-9.9-16.6-26.5-16.6-16 0-25.4 16.6-57.6 16.6-71.7 0-105.6-59.9-105.6-59.9C91 192.1 135.1 162 135.1 162c-29.1-16.9-91-97.7-91-97.7 53.9 45.9 77.2 58 77.2 58-13.9-11.5-52.9-67.7-52.9-67.7 31.2 31.6 93.2 75.7 93.2 75.7C179.2 81.5 144.7 38 144.7 38z' })));
|
|
483
565
|
};
|
|
484
566
|
|
|
485
|
-
const
|
|
486
|
-
const
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
|
|
567
|
+
const getActionIcon = (type) => {
|
|
568
|
+
const typeLowerCased = type?.toLowerCase();
|
|
569
|
+
const isSamplerCategory = typeLowerCased?.includes(ActionCategory.Samplers);
|
|
570
|
+
const isAttributesCategory = typeLowerCased === ActionCategory.Attributes;
|
|
571
|
+
if (isSamplerCategory)
|
|
572
|
+
return SamplerIcon;
|
|
573
|
+
if (isAttributesCategory)
|
|
574
|
+
return PiiMaskingIcon;
|
|
575
|
+
const LOGOS = {
|
|
576
|
+
[ActionType.K8sAttributes]: K8sLogo,
|
|
577
|
+
[ActionType.AddClusterInfo]: AddClusterInfoIcon,
|
|
578
|
+
[ActionType.DeleteAttributes]: DeleteAttributeIcon,
|
|
579
|
+
[ActionType.PiiMasking]: PiiMaskingIcon,
|
|
580
|
+
[ActionType.RenameAttributes]: RenameAttributeIcon,
|
|
581
|
+
[ActionType.ErrorSampler]: SamplerIcon,
|
|
582
|
+
[ActionType.ProbabilisticSampler]: SamplerIcon,
|
|
583
|
+
[ActionType.LatencySampler]: SamplerIcon,
|
|
584
|
+
[ActionType.ServiceNameSampler]: SamplerIcon,
|
|
585
|
+
[ActionType.SpanAttributeSampler]: SamplerIcon,
|
|
586
|
+
};
|
|
587
|
+
return LOGOS[type] || ImageErrorIcon;
|
|
490
588
|
};
|
|
491
589
|
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
590
|
+
const ACTION_OPTIONS = [
|
|
591
|
+
{
|
|
592
|
+
label: 'Attributes',
|
|
593
|
+
icon: getActionIcon(ActionCategory.Attributes),
|
|
594
|
+
items: [
|
|
595
|
+
{
|
|
596
|
+
type: ActionType.K8sAttributes,
|
|
597
|
+
icon: getActionIcon(ActionType.K8sAttributes),
|
|
598
|
+
label: 'Kubernetes Attributes',
|
|
599
|
+
description: 'Add dynamic k8s resource attributes to your data.',
|
|
600
|
+
allowedSignals: [SignalType.Traces, SignalType.Metrics, SignalType.Logs],
|
|
601
|
+
docsEndpoint: '/pipeline/actions/attributes/k8sattributes',
|
|
602
|
+
docsDescription: 'This action adds kubernetes related resource attributes to spans, metrics data points and log records.',
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
type: ActionType.AddClusterInfo,
|
|
606
|
+
icon: getActionIcon(ActionType.AddClusterInfo),
|
|
607
|
+
label: 'Add Cluster Info',
|
|
608
|
+
description: 'Add static cluster-scoped attributes to your data.',
|
|
609
|
+
allowedSignals: [SignalType.Traces, SignalType.Metrics, SignalType.Logs],
|
|
610
|
+
docsEndpoint: '/pipeline/actions/attributes/addclusterinfo',
|
|
611
|
+
docsDescription: 'This action adds static resource attributes to spans, metrics data points and log records. It is useful to add cluster-wide attributes to all telemetry signals.',
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
type: ActionType.DeleteAttributes,
|
|
615
|
+
icon: getActionIcon(ActionType.DeleteAttributes),
|
|
616
|
+
label: 'Delete Attribute',
|
|
617
|
+
description: 'Delete attributes from logs, metrics, and traces.',
|
|
618
|
+
allowedSignals: [SignalType.Traces, SignalType.Metrics, SignalType.Logs],
|
|
619
|
+
docsEndpoint: '/pipeline/actions/attributes/deleteattribute',
|
|
620
|
+
docsDescription: 'This action will delete the specified attributes from all telemetry signals that are specified in the signals field, regardless of the source, or any other condition.',
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
type: ActionType.RenameAttributes,
|
|
624
|
+
icon: getActionIcon(ActionType.RenameAttributes),
|
|
625
|
+
label: 'Rename Attribute',
|
|
626
|
+
description: 'Rename attributes in logs, metrics, and traces.',
|
|
627
|
+
allowedSignals: [SignalType.Traces, SignalType.Metrics, SignalType.Logs],
|
|
628
|
+
docsEndpoint: '/pipeline/actions/attributes/renameattribute',
|
|
629
|
+
docsDescription: 'This action will rename the specified attributes from all telemetry signals that are specified in the signals field, regardless of the source, or any other condition.',
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
type: ActionType.PiiMasking,
|
|
633
|
+
icon: getActionIcon(ActionType.PiiMasking),
|
|
634
|
+
label: 'PII Masking',
|
|
635
|
+
description: 'Mask PII data in your traces.',
|
|
636
|
+
allowedSignals: [SignalType.Traces],
|
|
637
|
+
docsEndpoint: '/pipeline/actions/attributes/piimasking',
|
|
638
|
+
docsDescription: 'This action processes a list of PII categories to be masked from the traces.',
|
|
639
|
+
},
|
|
640
|
+
],
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
label: 'Samplers',
|
|
644
|
+
icon: getActionIcon(ActionCategory.Samplers),
|
|
645
|
+
items: [
|
|
646
|
+
{
|
|
647
|
+
type: ActionType.ErrorSampler,
|
|
648
|
+
icon: getActionIcon(ActionCategory.Samplers),
|
|
649
|
+
label: 'Error Sampler',
|
|
650
|
+
description: 'Sample errors based on percentage.',
|
|
651
|
+
allowedSignals: [SignalType.Traces],
|
|
652
|
+
docsEndpoint: '/pipeline/actions/sampling/errorsampler',
|
|
653
|
+
docsDescription: 'This action is a Global Action that supports error sampling by filtering out non-error traces.',
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
type: ActionType.LatencySampler,
|
|
657
|
+
icon: getActionIcon(ActionCategory.Samplers),
|
|
658
|
+
label: 'Latency Sampler',
|
|
659
|
+
description: 'Add latency to your traces.',
|
|
660
|
+
allowedSignals: [SignalType.Traces],
|
|
661
|
+
docsEndpoint: '/pipeline/actions/sampling/latencysampler',
|
|
662
|
+
docsDescription: 'This action is an Endpoint Action that samples traces based on their duration for a specific service and endpoint (HTTP route) filter.',
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
type: ActionType.ProbabilisticSampler,
|
|
666
|
+
icon: getActionIcon(ActionCategory.Samplers),
|
|
667
|
+
label: 'Probabilistic Sampler',
|
|
668
|
+
description: 'Sample traces based on percentage.',
|
|
669
|
+
allowedSignals: [SignalType.Traces],
|
|
670
|
+
docsEndpoint: '/pipeline/actions/sampling/probabilisticsampler',
|
|
671
|
+
docsDescription: 'This action supports probabilistic sampling based on a configured sampling percentage applied to the TraceID.',
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
type: ActionType.ServiceNameSampler,
|
|
675
|
+
icon: getActionIcon(ActionCategory.Samplers),
|
|
676
|
+
label: 'Service Name Sampler',
|
|
677
|
+
description: 'Sample traces based on the presence of specified services within a trace.',
|
|
678
|
+
allowedSignals: [SignalType.Traces],
|
|
679
|
+
docsEndpoint: '/pipeline/actions/sampling/servicenamesampler',
|
|
680
|
+
docsDescription: 'This action supports service name sampling based on the presence of specified services within a trace.',
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
type: ActionType.SpanAttributeSampler,
|
|
684
|
+
icon: getActionIcon(ActionCategory.Samplers),
|
|
685
|
+
label: 'Span Attributes Sampler',
|
|
686
|
+
description: 'Sample traces based on the presence or value of specific attributes within a trace.',
|
|
687
|
+
allowedSignals: [SignalType.Traces],
|
|
688
|
+
docsEndpoint: '/pipeline/actions/sampling/spanattributesampler',
|
|
689
|
+
docsDescription: 'This action supports service name sampling based on the presence or value of specific attributes within a trace.',
|
|
690
|
+
},
|
|
691
|
+
],
|
|
692
|
+
},
|
|
693
|
+
];
|
|
694
|
+
|
|
695
|
+
const getInstrumentationRuleIcon = (type) => {
|
|
696
|
+
const LOGOS = {
|
|
697
|
+
[InstrumentationRuleType.CodeAttributes]: CodeAttributesIcon,
|
|
698
|
+
[InstrumentationRuleType.HeadersCollection]: HeadersCollectionIcon,
|
|
699
|
+
[InstrumentationRuleType.PayloadCollection]: PayloadCollectionIcon,
|
|
700
|
+
[InstrumentationRuleType.UnknownType]: ImageErrorIcon,
|
|
701
|
+
};
|
|
702
|
+
return LOGOS[type] || ImageErrorIcon;
|
|
497
703
|
};
|
|
498
704
|
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
705
|
+
const INSTRUMENTATION_RULE_OPTIONS = [
|
|
706
|
+
{
|
|
707
|
+
type: InstrumentationRuleType.CodeAttributes,
|
|
708
|
+
icon: getInstrumentationRuleIcon(InstrumentationRuleType.CodeAttributes),
|
|
709
|
+
label: 'Code Attributes',
|
|
710
|
+
description: 'Collect code attributes containing payload data to traces.',
|
|
711
|
+
docsEndpoint: '/pipeline/rules/codeattributes',
|
|
712
|
+
docsDescription: 'The “Code Attributes” Rule can be used to add code attributes containing payload data to traces.',
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
type: InstrumentationRuleType.HeadersCollection,
|
|
716
|
+
icon: getInstrumentationRuleIcon(InstrumentationRuleType.HeadersCollection),
|
|
717
|
+
label: 'Headers Collection',
|
|
718
|
+
description: 'Collect span attributes containing HTTP Headers data to traces.',
|
|
719
|
+
docsEndpoint: '/pipeline/rules/headerscollection',
|
|
720
|
+
docsDescription: 'The “Headers Collection” Rule can be used to add span attributes containing HTTP Headers data to traces.',
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
type: InstrumentationRuleType.PayloadCollection,
|
|
724
|
+
icon: getInstrumentationRuleIcon(InstrumentationRuleType.PayloadCollection),
|
|
725
|
+
label: 'Payload Collection',
|
|
726
|
+
description: 'Collect span attributes containing payload data to traces.',
|
|
727
|
+
docsEndpoint: '/pipeline/rules/payloadcollection',
|
|
728
|
+
docsDescription: 'The “Payload Collection” Rule can be used to add span attributes containing payload data to traces.',
|
|
729
|
+
},
|
|
730
|
+
];
|
|
731
|
+
|
|
732
|
+
const MONITORS_OPTIONS = [
|
|
733
|
+
{
|
|
734
|
+
id: SignalType.Logs,
|
|
735
|
+
value: 'Logs',
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
id: SignalType.Metrics,
|
|
739
|
+
value: 'Metrics',
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
id: SignalType.Traces,
|
|
743
|
+
value: 'Traces',
|
|
744
|
+
},
|
|
745
|
+
];
|
|
746
|
+
|
|
747
|
+
const getProgrammingLanguageIcon = (language) => {
|
|
748
|
+
const LOGOS = {
|
|
749
|
+
[ProgrammingLanguages.Java]: JavaLogo,
|
|
750
|
+
[ProgrammingLanguages.Go]: GoLogo,
|
|
751
|
+
[ProgrammingLanguages.JavaScript]: NodejsLogo,
|
|
752
|
+
[ProgrammingLanguages.Python]: PythonLogo,
|
|
753
|
+
[ProgrammingLanguages.DotNet]: DotnetLogo,
|
|
754
|
+
[ProgrammingLanguages.CSharp]: CSharpLogo,
|
|
755
|
+
[ProgrammingLanguages.CPlusPlus]: CPlusPlusLogo,
|
|
756
|
+
[ProgrammingLanguages.Php]: PhpLogo,
|
|
757
|
+
[ProgrammingLanguages.Ruby]: RubyLogo,
|
|
758
|
+
[ProgrammingLanguages.Rust]: RustLogo,
|
|
759
|
+
[ProgrammingLanguages.Swift]: SwiftLogo,
|
|
760
|
+
[ProgrammingLanguages.Elixir]: ElixirLogo,
|
|
761
|
+
[ProgrammingLanguages.MySql]: MysqlLogo,
|
|
762
|
+
[ProgrammingLanguages.Nginx]: NginxLogo,
|
|
763
|
+
[ProgrammingLanguages.Postgres]: PostgresLogo,
|
|
764
|
+
[ProgrammingLanguages.Redis]: RedisLogo,
|
|
765
|
+
[ProgrammingLanguages.Kafka]: KafkaLogo,
|
|
766
|
+
[ProgrammingLanguages.Ignored]: ImageErrorIcon, // TODO: good icon
|
|
767
|
+
[ProgrammingLanguages.Unknown]: ImageErrorIcon, // TODO: good icon
|
|
768
|
+
[ProgrammingLanguages.Processing]: ImageErrorIcon, // TODO: good icon
|
|
769
|
+
[ProgrammingLanguages.NoContainers]: ImageErrorIcon, // TODO: good icon
|
|
770
|
+
[ProgrammingLanguages.NoRunningPods]: ImageErrorIcon, // TODO: good icon
|
|
771
|
+
};
|
|
772
|
+
return LOGOS[language] || ImageErrorIcon;
|
|
504
773
|
};
|
|
505
774
|
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
775
|
+
const getEntityId = (item) => {
|
|
776
|
+
if ('ruleId' in item && !!item.ruleId) {
|
|
777
|
+
// Instrumentation Rule
|
|
778
|
+
return item.ruleId;
|
|
779
|
+
}
|
|
780
|
+
else if ('id' in item && !!item.id) {
|
|
781
|
+
// Destination or Action
|
|
782
|
+
return item.id;
|
|
783
|
+
}
|
|
784
|
+
else if ('namespace' in item && !!item.namespace && 'kind' in item && !!item.kind && 'name' in item && !!item.name) {
|
|
785
|
+
// Source
|
|
786
|
+
return {
|
|
787
|
+
namespace: item.namespace,
|
|
788
|
+
name: item.name,
|
|
789
|
+
kind: item.kind,
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
else if ('name' in item && !!item.name) {
|
|
793
|
+
// Namespace
|
|
794
|
+
return item.name;
|
|
795
|
+
}
|
|
796
|
+
console.warn('getEntityId() - cannot get ID of entity:', item);
|
|
797
|
+
return undefined;
|
|
511
798
|
};
|
|
512
799
|
|
|
513
|
-
|
|
800
|
+
const DISPLAY_LANGUAGES = {
|
|
801
|
+
[ProgrammingLanguages.Go]: 'Go',
|
|
802
|
+
[ProgrammingLanguages.Java]: 'Java',
|
|
803
|
+
[ProgrammingLanguages.JavaScript]: 'Node.js',
|
|
804
|
+
[ProgrammingLanguages.Python]: 'Python',
|
|
805
|
+
[ProgrammingLanguages.DotNet]: '.NET',
|
|
806
|
+
[ProgrammingLanguages.CSharp]: 'C#',
|
|
807
|
+
[ProgrammingLanguages.CPlusPlus]: 'C++',
|
|
808
|
+
[ProgrammingLanguages.Php]: 'PHP',
|
|
809
|
+
[ProgrammingLanguages.Ruby]: 'Ruby',
|
|
810
|
+
[ProgrammingLanguages.Rust]: 'Rust',
|
|
811
|
+
[ProgrammingLanguages.Swift]: 'Swift',
|
|
812
|
+
[ProgrammingLanguages.Elixir]: 'Elixir',
|
|
813
|
+
[ProgrammingLanguages.MySql]: 'MySQL',
|
|
814
|
+
[ProgrammingLanguages.Nginx]: 'Nginx',
|
|
815
|
+
[ProgrammingLanguages.Postgres]: 'PostgreSQL',
|
|
816
|
+
[ProgrammingLanguages.Redis]: 'Redis',
|
|
817
|
+
[ProgrammingLanguages.Kafka]: 'Kafka',
|
|
818
|
+
[ProgrammingLanguages.Ignored]: 'Ignored',
|
|
819
|
+
[ProgrammingLanguages.Unknown]: 'Unknown',
|
|
820
|
+
[ProgrammingLanguages.Processing]: 'Processing',
|
|
821
|
+
[ProgrammingLanguages.NoContainers]: 'No Containers',
|
|
822
|
+
[ProgrammingLanguages.NoRunningPods]: 'No Running Pods',
|
|
823
|
+
};
|
|
824
|
+
const LANGUAGE_OPTIONS = [
|
|
825
|
+
{
|
|
826
|
+
id: ProgrammingLanguages.Go,
|
|
827
|
+
value: DISPLAY_LANGUAGES[ProgrammingLanguages.Go],
|
|
828
|
+
icon: getProgrammingLanguageIcon(ProgrammingLanguages.Go),
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
id: ProgrammingLanguages.Java,
|
|
832
|
+
value: DISPLAY_LANGUAGES[ProgrammingLanguages.Java],
|
|
833
|
+
icon: getProgrammingLanguageIcon(ProgrammingLanguages.Java),
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
id: ProgrammingLanguages.JavaScript,
|
|
837
|
+
value: DISPLAY_LANGUAGES[ProgrammingLanguages.JavaScript],
|
|
838
|
+
icon: getProgrammingLanguageIcon(ProgrammingLanguages.JavaScript),
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
id: ProgrammingLanguages.Python,
|
|
842
|
+
value: DISPLAY_LANGUAGES[ProgrammingLanguages.Python],
|
|
843
|
+
icon: getProgrammingLanguageIcon(ProgrammingLanguages.Python),
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
id: ProgrammingLanguages.DotNet,
|
|
847
|
+
value: DISPLAY_LANGUAGES[ProgrammingLanguages.DotNet],
|
|
848
|
+
icon: getProgrammingLanguageIcon(ProgrammingLanguages.DotNet),
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
id: ProgrammingLanguages.Php,
|
|
852
|
+
value: DISPLAY_LANGUAGES[ProgrammingLanguages.Php],
|
|
853
|
+
icon: getProgrammingLanguageIcon(ProgrammingLanguages.Php),
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
id: ProgrammingLanguages.Ruby,
|
|
857
|
+
value: DISPLAY_LANGUAGES[ProgrammingLanguages.Ruby],
|
|
858
|
+
icon: getProgrammingLanguageIcon(ProgrammingLanguages.Ruby),
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
id: ProgrammingLanguages.Unknown,
|
|
862
|
+
value: DISPLAY_LANGUAGES[ProgrammingLanguages.Unknown],
|
|
863
|
+
icon: getProgrammingLanguageIcon(ProgrammingLanguages.Unknown),
|
|
864
|
+
},
|
|
865
|
+
];
|
|
866
|
+
|
|
867
|
+
const DEFAULT_DATA_STREAM_NAME = 'default';
|
|
868
|
+
const STORAGE_KEYS = {
|
|
869
|
+
SELECTED_DATA_STREAM: 'SELECTED_DATA_STREAM',
|
|
870
|
+
SELECTED_DATA_STREAM_WITH_PROXY: (proxyId) => `SELECTED_DATA_STREAM_${proxyId}`,
|
|
871
|
+
OVERVIEW_FILTERS: 'OVERVIEW_FILTERS',
|
|
872
|
+
DARK_MODE: 'DARK_MODE',
|
|
873
|
+
};
|
|
874
|
+
const FORM_ALERTS = {
|
|
875
|
+
REQUIRED_FIELDS: 'Required fields are missing',
|
|
876
|
+
FIELD_IS_REQUIRED: 'This field is required',
|
|
877
|
+
FORBIDDEN: 'Forbidden',
|
|
878
|
+
ENTERPRISE_ONLY: (str = 'This') => `${str} is an Enterprise feature. Please upgrade your plan.`,
|
|
879
|
+
DEFINED_FOR_ALL_STREAMS: (str) => `${str} are defined for all Data Streams.`,
|
|
880
|
+
CANNOT_EDIT_RULE: 'Cannot edit a system-managed instrumentation rule',
|
|
881
|
+
CANNOT_DELETE_RULE: 'Cannot delete a system-managed instrumentation rule',
|
|
882
|
+
LATENCY_HTTP_ROUTE: 'HTTP route must start with a forward slash "/"',
|
|
883
|
+
READONLY_WARNING: "You're not allowed to create/update/delete in readonly mode",
|
|
884
|
+
ILLEGAL_K8S_LABEL: 'Must be 63 characters or less, must consist of alphanumeric characters, "-", "_", or ".", and must start & end with an alphanumeric character (e.g., my-name, 123.abc).',
|
|
885
|
+
INVALID_VERSION: 'Invalid version format, must be in the format of "major.minor.patch" (e.g. 1.0.0)',
|
|
886
|
+
};
|
|
887
|
+
const DISPLAY_TITLES = {
|
|
888
|
+
NAMESPACE: 'Namespace',
|
|
889
|
+
NAME: 'Name',
|
|
890
|
+
KIND: 'Kind',
|
|
891
|
+
CONNECTION: 'Connection',
|
|
892
|
+
CONNECTIONS: 'Connections',
|
|
893
|
+
DATA_STREAM: 'Data Stream',
|
|
894
|
+
DATA_STREAMS: 'Data Streams',
|
|
895
|
+
STREAM_NAME: 'Data Stream Name',
|
|
896
|
+
NAME_YOUR_STREAM: 'Name your Data Stream',
|
|
897
|
+
NAME_YOUR_STREAM_PLACEHOLDER: 'e.g. Highest priority',
|
|
898
|
+
STREAM_DESCRIPTION: 'Provide a clear and descriptive name for your pipeline to ensure its purpose is easily understood by you and your team.',
|
|
899
|
+
STREAM_CONFIRM: 'Confirm your new Data Stream',
|
|
900
|
+
ACTION: 'Action',
|
|
901
|
+
ACTIONS: 'Actions',
|
|
902
|
+
ADD_ACTION: 'Add Action',
|
|
903
|
+
ACTION_DETAILS: 'Action Details',
|
|
904
|
+
INSTRUMENTATION_RULE: 'Instrumentation Rule',
|
|
905
|
+
INSTRUMENTATION_RULES: 'Instrumentation Rules',
|
|
906
|
+
ADD_INSTRUMENTATION_RULE: 'Add Instrumentation Rule',
|
|
907
|
+
INSTRUMENTATION_RULE_DETAILS: 'Instrumentation Rule Details',
|
|
908
|
+
DESTINATION: 'Destination',
|
|
909
|
+
DESTINATIONS: 'Destinations',
|
|
910
|
+
ADD_DESTINATION: 'Add Destination',
|
|
911
|
+
ADD_DESTINATIONS: 'Add Destinations',
|
|
912
|
+
ADD_DESTINATION_DESCRIPTION: 'Add a destination to send your telemetry data to. You can add multiple destinations.',
|
|
913
|
+
DESTINATION_DETAILS: 'Destination Details',
|
|
914
|
+
SELECTED_DESTINATIONS: 'Selected Destinations',
|
|
915
|
+
SOURCE: 'Source',
|
|
916
|
+
SOURCES: 'Sources',
|
|
917
|
+
ADD_SOURCE: 'Add Source',
|
|
918
|
+
SOURCE_DETAILS: 'Source Details',
|
|
919
|
+
SELECT_SOURCES: 'Select Sources',
|
|
920
|
+
SELECTED_SOURCES: 'Selected Sources',
|
|
921
|
+
SELECT_SOURCES_DESCRIPTION: 'Choose which sources to monitor in your pipeline by searching by source name or namespace.',
|
|
922
|
+
NO_SOURCES: 'No sources',
|
|
923
|
+
NO_SOURCES_GO_BACK: 'No sources selected. Please go back to select sources.',
|
|
924
|
+
PLEASE_ADD_SOURCE: 'Please add a source',
|
|
925
|
+
NO_SOURCES_NAMESPACE: 'No sources available in this namespace',
|
|
926
|
+
TRY_SEARCH_OR_OTHER_NAMESPACE: 'Try searching again or select another namespace.',
|
|
927
|
+
PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES: 'Please make sure your cluster has unignored namespaces',
|
|
928
|
+
INSTALLATION: 'Installation',
|
|
929
|
+
SUMMARY: 'Summary',
|
|
930
|
+
TYPE: 'Type',
|
|
931
|
+
NOTES: 'Notes',
|
|
932
|
+
STATUS: 'Status',
|
|
933
|
+
READONLY: 'Readonly',
|
|
934
|
+
LANGUAGE: 'Language',
|
|
935
|
+
VERSION: 'Version',
|
|
936
|
+
VERSION_PLACEHOLDER: '1.0.0',
|
|
937
|
+
MONITORS: 'Monitors',
|
|
938
|
+
SIGNALS_FOR_PROCESSING: 'Signals for Processing',
|
|
939
|
+
MANAGED_BY_PROFILE: 'Managed by Profile',
|
|
940
|
+
API_TOKEN: 'API Token',
|
|
941
|
+
API_TOKENS: 'API Tokens',
|
|
942
|
+
DESCRIBE_ODIGOS: 'Describe Odigos',
|
|
943
|
+
DESCRIBE_SOURCE: 'Describe Source',
|
|
944
|
+
DETECTED_CONTAINERS: 'Detected Containers',
|
|
945
|
+
DETECTED_CONTAINERS_DESCRIPTION: 'The system automatically instruments the containers it detects with a supported programming language.',
|
|
946
|
+
CONTAINER_NAME: 'Container Name',
|
|
947
|
+
FILTERED_COUNT_TOOLTIP: 'Represents filtered amount, out of total amount',
|
|
948
|
+
SEARCH_NAMESPACES: 'Search Namespaces',
|
|
949
|
+
SEARCH_SOURCES: 'Search Sources',
|
|
950
|
+
SHOW_SELECTED_ONLY: 'Show selected only',
|
|
951
|
+
TO_COLLECT_OTEL_DATA: 'To collect OpenTelemetry data',
|
|
952
|
+
TO_MONITOR_OTEL_DATA: 'To monitor OpenTelemetry data',
|
|
953
|
+
TO_MODIFY_OTEL_DATA: 'To modify OpenTelemetry data',
|
|
954
|
+
QUICK_BACK_TO_SUMMARY: 'When you finish editing you can quickly go back to the summary.',
|
|
955
|
+
GO_TO_SUMMARY: 'Go to summary',
|
|
956
|
+
};
|
|
957
|
+
const BUTTON_TEXTS = {
|
|
958
|
+
ADD: 'Add',
|
|
959
|
+
ADD_NEW: 'Add New',
|
|
960
|
+
NEW: 'New',
|
|
961
|
+
SELECT: 'Select',
|
|
962
|
+
CREATE: 'Create',
|
|
963
|
+
UPDATE: 'Update',
|
|
964
|
+
EDIT: 'Edit',
|
|
965
|
+
DELETE: 'Delete',
|
|
966
|
+
CANCEL: 'Cancel',
|
|
967
|
+
DONE: 'Done',
|
|
968
|
+
SAVE: 'Save',
|
|
969
|
+
BACK: 'Back',
|
|
970
|
+
NEXT: 'Next',
|
|
971
|
+
TEST: 'Test',
|
|
972
|
+
TEST_CONNECTION: 'Test Connection',
|
|
973
|
+
INSTRUMENT: 'Instrument',
|
|
974
|
+
UNINSTRUMENT: 'Uninstrument',
|
|
975
|
+
};
|
|
976
|
+
|
|
977
|
+
function createJSONStorage(getStorage, options) {
|
|
978
|
+
let storage;
|
|
979
|
+
try {
|
|
980
|
+
storage = getStorage();
|
|
981
|
+
} catch (e) {
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
const persistStorage = {
|
|
985
|
+
getItem: (name) => {
|
|
986
|
+
var _a;
|
|
987
|
+
const parse = (str2) => {
|
|
988
|
+
if (str2 === null) {
|
|
989
|
+
return null;
|
|
990
|
+
}
|
|
991
|
+
return JSON.parse(str2, void 0 );
|
|
992
|
+
};
|
|
993
|
+
const str = (_a = storage.getItem(name)) != null ? _a : null;
|
|
994
|
+
if (str instanceof Promise) {
|
|
995
|
+
return str.then(parse);
|
|
996
|
+
}
|
|
997
|
+
return parse(str);
|
|
998
|
+
},
|
|
999
|
+
setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, void 0 )),
|
|
1000
|
+
removeItem: (name) => storage.removeItem(name)
|
|
1001
|
+
};
|
|
1002
|
+
return persistStorage;
|
|
1003
|
+
}
|
|
1004
|
+
const toThenable = (fn) => (input) => {
|
|
1005
|
+
try {
|
|
1006
|
+
const result = fn(input);
|
|
1007
|
+
if (result instanceof Promise) {
|
|
1008
|
+
return result;
|
|
1009
|
+
}
|
|
1010
|
+
return {
|
|
1011
|
+
then(onFulfilled) {
|
|
1012
|
+
return toThenable(onFulfilled)(result);
|
|
1013
|
+
},
|
|
1014
|
+
catch(_onRejected) {
|
|
1015
|
+
return this;
|
|
1016
|
+
}
|
|
1017
|
+
};
|
|
1018
|
+
} catch (e) {
|
|
1019
|
+
return {
|
|
1020
|
+
then(_onFulfilled) {
|
|
1021
|
+
return this;
|
|
1022
|
+
},
|
|
1023
|
+
catch(onRejected) {
|
|
1024
|
+
return toThenable(onRejected)(e);
|
|
1025
|
+
}
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
1030
|
+
let options = {
|
|
1031
|
+
storage: createJSONStorage(() => localStorage),
|
|
1032
|
+
partialize: (state) => state,
|
|
1033
|
+
version: 0,
|
|
1034
|
+
merge: (persistedState, currentState) => ({
|
|
1035
|
+
...currentState,
|
|
1036
|
+
...persistedState
|
|
1037
|
+
}),
|
|
1038
|
+
...baseOptions
|
|
1039
|
+
};
|
|
1040
|
+
let hasHydrated = false;
|
|
1041
|
+
const hydrationListeners = /* @__PURE__ */ new Set();
|
|
1042
|
+
const finishHydrationListeners = /* @__PURE__ */ new Set();
|
|
1043
|
+
let storage = options.storage;
|
|
1044
|
+
if (!storage) {
|
|
1045
|
+
return config(
|
|
1046
|
+
(...args) => {
|
|
1047
|
+
console.warn(
|
|
1048
|
+
`[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`
|
|
1049
|
+
);
|
|
1050
|
+
set(...args);
|
|
1051
|
+
},
|
|
1052
|
+
get,
|
|
1053
|
+
api
|
|
1054
|
+
);
|
|
1055
|
+
}
|
|
1056
|
+
const setItem = () => {
|
|
1057
|
+
const state = options.partialize({ ...get() });
|
|
1058
|
+
return storage.setItem(options.name, {
|
|
1059
|
+
state,
|
|
1060
|
+
version: options.version
|
|
1061
|
+
});
|
|
1062
|
+
};
|
|
1063
|
+
const savedSetState = api.setState;
|
|
1064
|
+
api.setState = (state, replace) => {
|
|
1065
|
+
savedSetState(state, replace);
|
|
1066
|
+
void setItem();
|
|
1067
|
+
};
|
|
1068
|
+
const configResult = config(
|
|
1069
|
+
(...args) => {
|
|
1070
|
+
set(...args);
|
|
1071
|
+
void setItem();
|
|
1072
|
+
},
|
|
1073
|
+
get,
|
|
1074
|
+
api
|
|
1075
|
+
);
|
|
1076
|
+
api.getInitialState = () => configResult;
|
|
1077
|
+
let stateFromStorage;
|
|
1078
|
+
const hydrate = () => {
|
|
1079
|
+
var _a, _b;
|
|
1080
|
+
if (!storage) return;
|
|
1081
|
+
hasHydrated = false;
|
|
1082
|
+
hydrationListeners.forEach((cb) => {
|
|
1083
|
+
var _a2;
|
|
1084
|
+
return cb((_a2 = get()) != null ? _a2 : configResult);
|
|
1085
|
+
});
|
|
1086
|
+
const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;
|
|
1087
|
+
return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
|
|
1088
|
+
if (deserializedStorageValue) {
|
|
1089
|
+
if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
|
|
1090
|
+
if (options.migrate) {
|
|
1091
|
+
const migration = options.migrate(
|
|
1092
|
+
deserializedStorageValue.state,
|
|
1093
|
+
deserializedStorageValue.version
|
|
1094
|
+
);
|
|
1095
|
+
if (migration instanceof Promise) {
|
|
1096
|
+
return migration.then((result) => [true, result]);
|
|
1097
|
+
}
|
|
1098
|
+
return [true, migration];
|
|
1099
|
+
}
|
|
1100
|
+
console.error(
|
|
1101
|
+
`State loaded from storage couldn't be migrated since no migrate function was provided`
|
|
1102
|
+
);
|
|
1103
|
+
} else {
|
|
1104
|
+
return [false, deserializedStorageValue.state];
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
return [false, void 0];
|
|
1108
|
+
}).then((migrationResult) => {
|
|
1109
|
+
var _a2;
|
|
1110
|
+
const [migrated, migratedState] = migrationResult;
|
|
1111
|
+
stateFromStorage = options.merge(
|
|
1112
|
+
migratedState,
|
|
1113
|
+
(_a2 = get()) != null ? _a2 : configResult
|
|
1114
|
+
);
|
|
1115
|
+
set(stateFromStorage, true);
|
|
1116
|
+
if (migrated) {
|
|
1117
|
+
return setItem();
|
|
1118
|
+
}
|
|
1119
|
+
}).then(() => {
|
|
1120
|
+
postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);
|
|
1121
|
+
stateFromStorage = get();
|
|
1122
|
+
hasHydrated = true;
|
|
1123
|
+
finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
|
|
1124
|
+
}).catch((e) => {
|
|
1125
|
+
postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);
|
|
1126
|
+
});
|
|
1127
|
+
};
|
|
1128
|
+
api.persist = {
|
|
1129
|
+
setOptions: (newOptions) => {
|
|
1130
|
+
options = {
|
|
1131
|
+
...options,
|
|
1132
|
+
...newOptions
|
|
1133
|
+
};
|
|
1134
|
+
if (newOptions.storage) {
|
|
1135
|
+
storage = newOptions.storage;
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1138
|
+
clearStorage: () => {
|
|
1139
|
+
storage == null ? void 0 : storage.removeItem(options.name);
|
|
1140
|
+
},
|
|
1141
|
+
getOptions: () => options,
|
|
1142
|
+
rehydrate: () => hydrate(),
|
|
1143
|
+
hasHydrated: () => hasHydrated,
|
|
1144
|
+
onHydrate: (cb) => {
|
|
1145
|
+
hydrationListeners.add(cb);
|
|
1146
|
+
return () => {
|
|
1147
|
+
hydrationListeners.delete(cb);
|
|
1148
|
+
};
|
|
1149
|
+
},
|
|
1150
|
+
onFinishHydration: (cb) => {
|
|
1151
|
+
finishHydrationListeners.add(cb);
|
|
1152
|
+
return () => {
|
|
1153
|
+
finishHydrationListeners.delete(cb);
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
if (!options.skipHydration) {
|
|
1158
|
+
hydrate();
|
|
1159
|
+
}
|
|
1160
|
+
return stateFromStorage || configResult;
|
|
1161
|
+
};
|
|
1162
|
+
const persist = persistImpl;
|
|
1163
|
+
|
|
1164
|
+
const useDarkMode = create()(persist((set) => ({
|
|
1165
|
+
darkMode: true,
|
|
1166
|
+
setDarkMode: (bool) => set({ darkMode: bool }),
|
|
1167
|
+
}), {
|
|
1168
|
+
name: STORAGE_KEYS.DARK_MODE,
|
|
1169
|
+
storage: typeof window !== 'undefined' ? createJSONStorage(() => localStorage) : undefined,
|
|
1170
|
+
}));
|
|
1171
|
+
|
|
1172
|
+
const initialState$1 = {
|
|
1173
|
+
dataStreamsLoading: false,
|
|
1174
|
+
dataStreams: [],
|
|
1175
|
+
selectedStreamName: '',
|
|
1176
|
+
};
|
|
1177
|
+
const useDataStreamStore = create((set) => ({
|
|
1178
|
+
...initialState$1,
|
|
1179
|
+
setDataStreamsLoading: (bool) => set({ dataStreamsLoading: bool }),
|
|
1180
|
+
setDataStreams: (dataStreams) => set({ dataStreams }),
|
|
1181
|
+
addDataStreams: (newStreams) => set((state) => {
|
|
1182
|
+
const merged = [...state.dataStreams, ...newStreams];
|
|
1183
|
+
const mapped = merged.map((ds) => [ds.name, ds]);
|
|
1184
|
+
const uniqueByName = Array.from(new Map(mapped).values());
|
|
1185
|
+
return { dataStreams: uniqueByName };
|
|
1186
|
+
}),
|
|
1187
|
+
removeDataStreams: (dataStreams) => set((state) => {
|
|
1188
|
+
const filtered = state.dataStreams.filter((ds) => !dataStreams.find((toRemove) => toRemove.name === ds.name));
|
|
1189
|
+
return { dataStreams: filtered };
|
|
1190
|
+
}),
|
|
1191
|
+
setSelectedStreamName: (streamName) => set({ selectedStreamName: streamName }),
|
|
1192
|
+
resetDataStreamStore: () => set(initialState$1),
|
|
1193
|
+
}));
|
|
1194
|
+
|
|
1195
|
+
const useDrawerStore = create((set) => ({
|
|
1196
|
+
drawerType: null,
|
|
1197
|
+
drawerEntityId: null,
|
|
1198
|
+
setDrawerType: (value) => set({ drawerType: value }),
|
|
1199
|
+
setDrawerEntityId: (value) => set({ drawerEntityId: value }),
|
|
1200
|
+
}));
|
|
1201
|
+
|
|
1202
|
+
const useEntityStore = create((set) => ({
|
|
1203
|
+
namespacesLoading: false,
|
|
1204
|
+
namespaces: [],
|
|
1205
|
+
sourcesLoading: false,
|
|
1206
|
+
sources: [],
|
|
1207
|
+
destinationsLoading: false,
|
|
1208
|
+
destinations: [],
|
|
1209
|
+
actionsLoading: false,
|
|
1210
|
+
actions: [],
|
|
1211
|
+
instrumentationRulesLoading: false,
|
|
1212
|
+
instrumentationRules: [],
|
|
1213
|
+
setEntitiesLoading: (entityType, bool) => {
|
|
1214
|
+
const KEY = entityType === EntityTypes.Namespace
|
|
1215
|
+
? 'namespacesLoading'
|
|
1216
|
+
: entityType === EntityTypes.Source
|
|
1217
|
+
? 'sourcesLoading'
|
|
1218
|
+
: entityType === EntityTypes.Destination
|
|
1219
|
+
? 'destinationsLoading'
|
|
1220
|
+
: entityType === EntityTypes.Action
|
|
1221
|
+
? 'actionsLoading'
|
|
1222
|
+
: entityType === EntityTypes.InstrumentationRule
|
|
1223
|
+
? 'instrumentationRulesLoading'
|
|
1224
|
+
: 'NONE';
|
|
1225
|
+
if (KEY === 'NONE')
|
|
1226
|
+
return;
|
|
1227
|
+
set({ [KEY]: bool });
|
|
1228
|
+
},
|
|
1229
|
+
setEntities: (entityType, payload) => {
|
|
1230
|
+
const KEY = entityType === EntityTypes.Namespace
|
|
1231
|
+
? 'namespaces'
|
|
1232
|
+
: entityType === EntityTypes.Source
|
|
1233
|
+
? 'sources'
|
|
1234
|
+
: entityType === EntityTypes.Destination
|
|
1235
|
+
? 'destinations'
|
|
1236
|
+
: entityType === EntityTypes.Action
|
|
1237
|
+
? 'actions'
|
|
1238
|
+
: entityType === EntityTypes.InstrumentationRule
|
|
1239
|
+
? 'instrumentationRules'
|
|
1240
|
+
: 'NONE';
|
|
1241
|
+
if (KEY === 'NONE')
|
|
1242
|
+
return;
|
|
1243
|
+
set({ [KEY]: payload });
|
|
1244
|
+
},
|
|
1245
|
+
addEntities: (entityType, entities) => {
|
|
1246
|
+
const KEY = entityType === EntityTypes.Namespace
|
|
1247
|
+
? 'namespaces'
|
|
1248
|
+
: entityType === EntityTypes.Source
|
|
1249
|
+
? 'sources'
|
|
1250
|
+
: entityType === EntityTypes.Destination
|
|
1251
|
+
? 'destinations'
|
|
1252
|
+
: entityType === EntityTypes.Action
|
|
1253
|
+
? 'actions'
|
|
1254
|
+
: entityType === EntityTypes.InstrumentationRule
|
|
1255
|
+
? 'instrumentationRules'
|
|
1256
|
+
: 'NONE';
|
|
1257
|
+
if (KEY === 'NONE')
|
|
1258
|
+
return;
|
|
1259
|
+
set((state) => {
|
|
1260
|
+
const prev = [...state[KEY]];
|
|
1261
|
+
entities.forEach((newItem) => {
|
|
1262
|
+
const foundIdx = prev.findIndex((oldItem) => JSON.stringify(getEntityId(oldItem)) === JSON.stringify(getEntityId(newItem)));
|
|
1263
|
+
if (foundIdx !== -1) {
|
|
1264
|
+
prev[foundIdx] = { ...prev[foundIdx], ...newItem };
|
|
1265
|
+
}
|
|
1266
|
+
else {
|
|
1267
|
+
prev.push(newItem);
|
|
1268
|
+
}
|
|
1269
|
+
});
|
|
1270
|
+
return { [KEY]: prev };
|
|
1271
|
+
});
|
|
1272
|
+
},
|
|
1273
|
+
removeEntities: (entityType, entityIds) => {
|
|
1274
|
+
const KEY = entityType === EntityTypes.Namespace
|
|
1275
|
+
? 'namespaces'
|
|
1276
|
+
: entityType === EntityTypes.Source
|
|
1277
|
+
? 'sources'
|
|
1278
|
+
: entityType === EntityTypes.Destination
|
|
1279
|
+
? 'destinations'
|
|
1280
|
+
: entityType === EntityTypes.Action
|
|
1281
|
+
? 'actions'
|
|
1282
|
+
: entityType === EntityTypes.InstrumentationRule
|
|
1283
|
+
? 'instrumentationRules'
|
|
1284
|
+
: 'NONE';
|
|
1285
|
+
if (KEY === 'NONE')
|
|
1286
|
+
return;
|
|
1287
|
+
set((state) => {
|
|
1288
|
+
const prev = [...state[KEY]];
|
|
1289
|
+
entityIds.forEach((id) => {
|
|
1290
|
+
const foundIdx = prev.findIndex((entity) => entityType === EntityTypes.Source ? JSON.stringify(getEntityId(entity)) === JSON.stringify(getEntityId(id)) : getEntityId(entity) === id);
|
|
1291
|
+
if (foundIdx !== -1) {
|
|
1292
|
+
prev.splice(foundIdx, 1);
|
|
1293
|
+
}
|
|
1294
|
+
});
|
|
1295
|
+
return { [KEY]: prev };
|
|
1296
|
+
});
|
|
1297
|
+
},
|
|
1298
|
+
resetEntityStore: () => {
|
|
1299
|
+
set({
|
|
1300
|
+
namespacesLoading: false,
|
|
1301
|
+
namespaces: [],
|
|
1302
|
+
sourcesLoading: false,
|
|
1303
|
+
sources: [],
|
|
1304
|
+
destinationsLoading: false,
|
|
1305
|
+
destinations: [],
|
|
1306
|
+
actionsLoading: false,
|
|
1307
|
+
actions: [],
|
|
1308
|
+
instrumentationRulesLoading: false,
|
|
1309
|
+
instrumentationRules: [],
|
|
1310
|
+
});
|
|
1311
|
+
},
|
|
1312
|
+
}));
|
|
1313
|
+
|
|
1314
|
+
const getEmptyState = () => ({
|
|
1315
|
+
searchText: '',
|
|
1316
|
+
statuses: [],
|
|
1317
|
+
platformTypes: [],
|
|
1318
|
+
namespaces: [],
|
|
1319
|
+
kinds: [],
|
|
1320
|
+
monitors: [],
|
|
1321
|
+
languages: [],
|
|
1322
|
+
errors: [],
|
|
1323
|
+
onlyErrors: false,
|
|
1324
|
+
});
|
|
1325
|
+
const useFilterStore = create((set) => ({
|
|
1326
|
+
searchText: '',
|
|
1327
|
+
setSearchText: (searchText) => set({ searchText }),
|
|
1328
|
+
statuses: [],
|
|
1329
|
+
setStatuses: (statuses) => set({ statuses }),
|
|
1330
|
+
platformTypes: [],
|
|
1331
|
+
setPlatformTypes: (platformTypes) => set({ platformTypes }),
|
|
1332
|
+
namespaces: [],
|
|
1333
|
+
setNamespaces: (namespaces) => set({ namespaces }),
|
|
1334
|
+
kinds: [],
|
|
1335
|
+
setKinds: (kinds) => set({ kinds }),
|
|
1336
|
+
monitors: [],
|
|
1337
|
+
setMonitors: (monitors) => set({ monitors }),
|
|
1338
|
+
languages: [],
|
|
1339
|
+
setLanguages: (languages) => set({ languages }),
|
|
1340
|
+
errors: [],
|
|
1341
|
+
setErrors: (errors) => set({ errors }),
|
|
1342
|
+
onlyErrors: false,
|
|
1343
|
+
setOnlyErrors: (onlyErrors) => set({ onlyErrors }),
|
|
1344
|
+
setAll: (params) => set(params),
|
|
1345
|
+
clearAll: () => set(getEmptyState()),
|
|
1346
|
+
getEmptyState,
|
|
1347
|
+
}));
|
|
1348
|
+
|
|
1349
|
+
const useInstrumentStore = create((set) => ({
|
|
1350
|
+
isAwaitingInstrumentation: false,
|
|
1351
|
+
sourcesToCreate: 0,
|
|
1352
|
+
sourcesCreated: 0,
|
|
1353
|
+
sourcesToDelete: 0,
|
|
1354
|
+
sourcesDeleted: 0,
|
|
1355
|
+
setInstrumentAwait: (v) => set({ isAwaitingInstrumentation: v }),
|
|
1356
|
+
setInstrumentCount: (k, v) => set({ [k]: v }),
|
|
1357
|
+
}));
|
|
1358
|
+
|
|
1359
|
+
const useModalStore = create((set) => ({
|
|
1360
|
+
currentModal: '',
|
|
1361
|
+
setCurrentModal: (str) => set({ currentModal: str }),
|
|
1362
|
+
}));
|
|
1363
|
+
|
|
1364
|
+
const useNotificationStore = create((set, get) => ({
|
|
1365
|
+
notifications: [],
|
|
1366
|
+
addNotification: (notif) => {
|
|
1367
|
+
const date = new Date();
|
|
1368
|
+
const id = `${date.getTime().toString()}${!!notif.target ? `#${notif.target}` : ''}`;
|
|
1369
|
+
// This is to prevent duplicate notifications.
|
|
1370
|
+
// This is useful for notifications that are triggered multiple times in a short period, like failed API queries...
|
|
1371
|
+
const { notifications } = get();
|
|
1372
|
+
const isSameNotification = (n) => n.type === notif.type && n.title === notif.title && n.message === notif.message && !n.dismissed;
|
|
1373
|
+
const hasThisToast = notifications.some(isSameNotification);
|
|
1374
|
+
if (!hasThisToast) {
|
|
1375
|
+
set((state) => ({
|
|
1376
|
+
notifications: [
|
|
1377
|
+
{
|
|
1378
|
+
...notif,
|
|
1379
|
+
id,
|
|
1380
|
+
time: date.toISOString(),
|
|
1381
|
+
dismissed: false,
|
|
1382
|
+
seen: false,
|
|
1383
|
+
},
|
|
1384
|
+
...state.notifications,
|
|
1385
|
+
],
|
|
1386
|
+
}));
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
markAsDismissed: (id) => {
|
|
1390
|
+
set((state) => {
|
|
1391
|
+
const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
|
|
1392
|
+
if (foundIdx !== -1) {
|
|
1393
|
+
state.notifications[foundIdx].dismissed = true;
|
|
1394
|
+
}
|
|
1395
|
+
return {
|
|
1396
|
+
notifications: state.notifications,
|
|
1397
|
+
};
|
|
1398
|
+
});
|
|
1399
|
+
},
|
|
1400
|
+
markAsSeen: (id) => {
|
|
1401
|
+
set((state) => {
|
|
1402
|
+
const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
|
|
1403
|
+
if (foundIdx !== -1) {
|
|
1404
|
+
state.notifications[foundIdx].seen = true;
|
|
1405
|
+
}
|
|
1406
|
+
return {
|
|
1407
|
+
notifications: state.notifications,
|
|
1408
|
+
};
|
|
1409
|
+
});
|
|
1410
|
+
},
|
|
1411
|
+
removeNotification: (id) => {
|
|
1412
|
+
set((state) => {
|
|
1413
|
+
const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
|
|
1414
|
+
if (foundIdx !== -1) {
|
|
1415
|
+
state.notifications.splice(foundIdx, 1);
|
|
1416
|
+
}
|
|
1417
|
+
return {
|
|
1418
|
+
notifications: state.notifications,
|
|
1419
|
+
};
|
|
1420
|
+
});
|
|
1421
|
+
},
|
|
1422
|
+
removeNotifications: (target) => {
|
|
1423
|
+
if (!target)
|
|
1424
|
+
return;
|
|
1425
|
+
set((state) => {
|
|
1426
|
+
const filtered = state.notifications.filter((notif) => notif.id.split('#')[1] !== target);
|
|
1427
|
+
return {
|
|
1428
|
+
notifications: filtered,
|
|
1429
|
+
};
|
|
1430
|
+
});
|
|
1431
|
+
},
|
|
1432
|
+
}));
|
|
1433
|
+
|
|
1434
|
+
const itemsAreEqual = (item1, item2) => {
|
|
1435
|
+
const entityTypesEqual = item1.entityType === item2.entityType;
|
|
1436
|
+
const idsEqual = typeof item1.entityId === 'string' && typeof item2.entityId === 'string'
|
|
1437
|
+
? item1.entityId === item2.entityId
|
|
1438
|
+
: typeof item1.entityId === 'object' && typeof item2.entityId === 'object'
|
|
1439
|
+
? item1.entityId.namespace === item2.entityId.namespace && item1.entityId.name === item2.entityId.name && item1.entityId.kind === item2.entityId.kind
|
|
1440
|
+
: !item1.entityId && !item2.entityId;
|
|
1441
|
+
return entityTypesEqual && idsEqual;
|
|
1442
|
+
};
|
|
1443
|
+
const usePendingStore = create((set, get) => ({
|
|
1444
|
+
pendingItems: [],
|
|
1445
|
+
setPendingItems: (arr) => set({ pendingItems: arr }),
|
|
1446
|
+
addPendingItems: (arr) => set((state) => ({
|
|
1447
|
+
pendingItems: state.pendingItems.concat(arr.filter((addItem) => !state.pendingItems.some((existingItem) => itemsAreEqual(existingItem, addItem)))),
|
|
1448
|
+
})),
|
|
1449
|
+
removePendingItems: (arr) => set((state) => ({
|
|
1450
|
+
pendingItems: state.pendingItems.filter((existingItem) => !arr.find((removeItem) => itemsAreEqual(existingItem, removeItem))),
|
|
1451
|
+
})),
|
|
1452
|
+
// Pass an item to check if it's in the pending items array.
|
|
1453
|
+
// This is used to show loading spinners, toasts etc.
|
|
1454
|
+
isThisPending: (item) => {
|
|
1455
|
+
const { pendingItems } = get();
|
|
1456
|
+
let bool = false;
|
|
1457
|
+
for (let i = 0; i < pendingItems.length; i++) {
|
|
1458
|
+
const pendingItem = pendingItems[i];
|
|
1459
|
+
if (pendingItem.entityType === item.entityType &&
|
|
1460
|
+
(!item.entityId ||
|
|
1461
|
+
(pendingItem.entityType === EntityTypes.Source
|
|
1462
|
+
? !!pendingItem.entityId &&
|
|
1463
|
+
!!item.entityId &&
|
|
1464
|
+
pendingItem.entityId.namespace === item.entityId.namespace &&
|
|
1465
|
+
pendingItem.entityId.name === item.entityId.name &&
|
|
1466
|
+
pendingItem.entityId.kind === item.entityId.kind
|
|
1467
|
+
: pendingItem.entityId === item.entityId))) {
|
|
1468
|
+
bool = true;
|
|
1469
|
+
break;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
return bool;
|
|
1473
|
+
},
|
|
1474
|
+
}));
|
|
1475
|
+
|
|
1476
|
+
const useSelectedStore = create((set) => ({
|
|
1477
|
+
selectedSources: {},
|
|
1478
|
+
setSelectedSources: (payload) => set({ selectedSources: payload }),
|
|
1479
|
+
resetSelectedState: () => set(() => ({ selectedSources: {} })),
|
|
1480
|
+
}));
|
|
1481
|
+
|
|
1482
|
+
const initialState = {
|
|
1483
|
+
availableSources: {},
|
|
1484
|
+
configuredSources: {},
|
|
1485
|
+
configuredFutureApps: {},
|
|
1486
|
+
configuredDestinations: [],
|
|
1487
|
+
configuredDestinationsUpdateOnly: [],
|
|
1488
|
+
};
|
|
1489
|
+
const filterByType = (existingDest, compareDest) => existingDest.destinationType.type !== compareDest.destinationType.type;
|
|
1490
|
+
const useSetupStore = create((set) => ({
|
|
1491
|
+
...initialState,
|
|
1492
|
+
setAvailableSources: (payload) => set({ availableSources: payload }),
|
|
1493
|
+
setConfiguredSources: (payload) => set({ configuredSources: payload }),
|
|
1494
|
+
setConfiguredFutureApps: (payload) => set({ configuredFutureApps: payload }),
|
|
1495
|
+
setConfiguredDestinations: (payload) => set({ configuredDestinations: payload }),
|
|
1496
|
+
addConfiguredDestination: (payload) => set((state) => ({ configuredDestinations: [...state.configuredDestinations, payload] })),
|
|
1497
|
+
removeConfiguredDestination: (payload) => set((state) => ({ configuredDestinations: state.configuredDestinations.filter((dest) => filterByType(dest, payload)) })),
|
|
1498
|
+
setConfiguredDestinationsUpdateOnly: (payload) => set({ configuredDestinationsUpdateOnly: payload }),
|
|
1499
|
+
addConfiguredDestinationUpdateOnly: (payload) => set((state) => {
|
|
1500
|
+
// For update-only cases, we have to prevent duplicates using the dest ID
|
|
1501
|
+
const merged = [...state.configuredDestinationsUpdateOnly, payload];
|
|
1502
|
+
const mapped = merged.map((d) => [d.id, d]);
|
|
1503
|
+
const uniqueById = Array.from(new Map(mapped).values());
|
|
1504
|
+
return { configuredDestinationsUpdateOnly: uniqueById };
|
|
1505
|
+
}),
|
|
1506
|
+
removeConfiguredDestinationUpdateOnly: (payload) => set((state) => ({ configuredDestinationsUpdateOnly: state.configuredDestinationsUpdateOnly.filter((dest) => filterByType(dest, payload)) })),
|
|
1507
|
+
resetState: () => set(() => ({ ...initialState })),
|
|
1508
|
+
}));
|
|
1509
|
+
|
|
1510
|
+
const baseTheme = {
|
|
1511
|
+
colors: {
|
|
1512
|
+
// Custom Colors
|
|
1513
|
+
majestic_blue: '#444AD9',
|
|
1514
|
+
majestic_blue_soft: '#6C7AE8',
|
|
1515
|
+
orange_og: '#FE9239',
|
|
1516
|
+
orange_soft: '#FFB160',
|
|
1517
|
+
dark_red: '#802828',
|
|
1518
|
+
darker_red: '#611F1F',
|
|
1519
|
+
darkest_red: '#281515',
|
|
1520
|
+
darkest_red_hover: '#351515',
|
|
1521
|
+
dark_green: '#2D4323',
|
|
1522
|
+
},
|
|
1523
|
+
font_family: {
|
|
1524
|
+
primary: 'Inter, sans-serif',
|
|
1525
|
+
secondary: 'Kode Mono, sans-serif',
|
|
1526
|
+
code: 'IBM Plex Mono, monospace',
|
|
1527
|
+
},
|
|
1528
|
+
};
|
|
1529
|
+
const darkModeTheme = {
|
|
1530
|
+
darkMode: true,
|
|
1531
|
+
colors: {
|
|
1532
|
+
...baseTheme.colors,
|
|
1533
|
+
// Base Colors
|
|
1534
|
+
primary: '#111111',
|
|
1535
|
+
secondary: '#F9F9F9',
|
|
1536
|
+
border: '#525252',
|
|
1537
|
+
dark_grey: '#151515',
|
|
1538
|
+
translucent_bg: '#1A1A1A',
|
|
1539
|
+
dropdown_bg: '#242424',
|
|
1540
|
+
dropdown_bg_2: '#333333',
|
|
1541
|
+
// Notification Colors
|
|
1542
|
+
warning: '#472300',
|
|
1543
|
+
error: '#431919',
|
|
1544
|
+
success: '#172013',
|
|
1545
|
+
info: '#242424',
|
|
1546
|
+
default: '#181944',
|
|
1547
|
+
},
|
|
1548
|
+
text: {
|
|
1549
|
+
// Base Colors
|
|
1550
|
+
white: '#FFFFFF',
|
|
1551
|
+
primary: '#111111',
|
|
1552
|
+
secondary: '#F9F9F9',
|
|
1553
|
+
grey: '#B8B8B8',
|
|
1554
|
+
dark_grey: '#8F8F8F',
|
|
1555
|
+
darker_grey: '#7A7A7A',
|
|
1556
|
+
light_grey: '#CCD0D2',
|
|
1557
|
+
dark_button: '#0A1824',
|
|
1558
|
+
// Notification Colors
|
|
1559
|
+
warning: '#E9CF35',
|
|
1560
|
+
warning_secondary: '#FFA349',
|
|
1561
|
+
error: '#EF7676',
|
|
1562
|
+
error_secondary: '#DB5151',
|
|
1563
|
+
success: '#81AF65',
|
|
1564
|
+
success_secondary: '#51DB51',
|
|
1565
|
+
info: '#B8B8B8',
|
|
1566
|
+
info_secondary: '#CCDDDD',
|
|
1567
|
+
default: '#AABEF7',
|
|
1568
|
+
default_secondary: '#8CBEFF',
|
|
1569
|
+
},
|
|
1570
|
+
font_family: baseTheme.font_family,
|
|
1571
|
+
};
|
|
1572
|
+
const lightModeTheme = {
|
|
1573
|
+
darkMode: false,
|
|
1574
|
+
colors: {
|
|
1575
|
+
...baseTheme.colors,
|
|
1576
|
+
// Base Colors
|
|
1577
|
+
primary: '#EEEEEE',
|
|
1578
|
+
secondary: '#060606',
|
|
1579
|
+
border: '#ADADAD',
|
|
1580
|
+
dark_grey: '#EAEAEA',
|
|
1581
|
+
translucent_bg: '#E5E5E5',
|
|
1582
|
+
dropdown_bg: '#DBDBDB',
|
|
1583
|
+
dropdown_bg_2: '#CCCCCC',
|
|
1584
|
+
// Notification Colors
|
|
1585
|
+
warning: '#F6F092',
|
|
1586
|
+
error: '#FACECE',
|
|
1587
|
+
success: '#C8DEB8',
|
|
1588
|
+
info: '#E0E0E0',
|
|
1589
|
+
default: '#CAD9FB',
|
|
1590
|
+
},
|
|
1591
|
+
text: {
|
|
1592
|
+
// Base Colors
|
|
1593
|
+
white: '#FFFFFF',
|
|
1594
|
+
primary: '#EEEEEE',
|
|
1595
|
+
secondary: '#060606',
|
|
1596
|
+
grey: '#474747',
|
|
1597
|
+
dark_grey: '#707070',
|
|
1598
|
+
darker_grey: '#858585',
|
|
1599
|
+
light_grey: '#332F2D',
|
|
1600
|
+
dark_button: '#F5E7DB',
|
|
1601
|
+
// Notification Colors
|
|
1602
|
+
warning: '#A56F12',
|
|
1603
|
+
warning_secondary: '#CA9416',
|
|
1604
|
+
error: '#B63A3A',
|
|
1605
|
+
error_secondary: '#DB5151',
|
|
1606
|
+
success: '#4E763A',
|
|
1607
|
+
success_secondary: '#67964C',
|
|
1608
|
+
info: '#525252',
|
|
1609
|
+
info_secondary: '#7A7A7A',
|
|
1610
|
+
default: '#444AD9',
|
|
1611
|
+
default_secondary: '#6C7AE8',
|
|
1612
|
+
},
|
|
1613
|
+
font_family: baseTheme.font_family,
|
|
1614
|
+
};
|
|
1615
|
+
const getTheme = (darkMode) => (darkMode ? darkModeTheme : lightModeTheme);
|
|
1616
|
+
|
|
1617
|
+
function styleInject(css, ref) {
|
|
1618
|
+
if ( ref === void 0 ) ref = {};
|
|
1619
|
+
var insertAt = ref.insertAt;
|
|
1620
|
+
|
|
1621
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
1622
|
+
|
|
1623
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
1624
|
+
var style = document.createElement('style');
|
|
1625
|
+
style.type = 'text/css';
|
|
1626
|
+
|
|
1627
|
+
if (insertAt === 'top') {
|
|
1628
|
+
if (head.firstChild) {
|
|
1629
|
+
head.insertBefore(style, head.firstChild);
|
|
1630
|
+
} else {
|
|
1631
|
+
head.appendChild(style);
|
|
1632
|
+
}
|
|
1633
|
+
} else {
|
|
1634
|
+
head.appendChild(style);
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
if (style.styleSheet) {
|
|
1638
|
+
style.styleSheet.cssText = css;
|
|
1639
|
+
} else {
|
|
1640
|
+
style.appendChild(document.createTextNode(css));
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
var css_248z = "/* Preload key fonts in your global CSS */\n@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Kode+Mono:wght@100;200;300;400;500;600;700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');\n\n* {\n -ms-overflow-style: none; /* IE, Edge */\n scrollbar-width: none; /* Firefox */\n}\n*::-webkit-scrollbar {\n display: none; /* Chrome, Safari, Opera */\n}\n\nsvg {\n transition: all 0.3s;\n}\n\n/*\n The input styles below are to override the browser \":-webkit-autofill\" default style declarations.\n The issue is when someone autocompletes an input field, the browser will apply its own styles (and the browser applies \"!important\" preventing direct overrides).\n With the following, we're able to delay the browser styles to be applied for 50000s (13.8 hours), so the user will not see the browser styles applied.\n*/\n\ninput {\n all: unset;\n}\n\ninput:-webkit-autofill,\ninput:-webkit-autofill:hover,\ninput:-webkit-autofill:focus,\ninput:-webkit-autofill:active {\n -webkit-transition: all 50000s ease-in-out 0s;\n transition: all 50000s ease-in-out 0s;\n}\n";
|
|
1645
|
+
styleInject(css_248z);
|
|
1646
|
+
|
|
1647
|
+
const Provider = ({ children }) => {
|
|
1648
|
+
const { darkMode } = useDarkMode();
|
|
1649
|
+
return React.createElement(ThemeProvider, { theme: getTheme(darkMode) }, children);
|
|
1650
|
+
};
|
|
1651
|
+
|
|
1652
|
+
const hex = {
|
|
1653
|
+
'100': 'FF',
|
|
1654
|
+
'099': 'FC',
|
|
1655
|
+
'098': 'FA',
|
|
1656
|
+
'097': 'F7',
|
|
1657
|
+
'096': 'F5',
|
|
1658
|
+
'095': 'F2',
|
|
1659
|
+
'094': 'F0',
|
|
1660
|
+
'093': 'ED',
|
|
1661
|
+
'092': 'EB',
|
|
1662
|
+
'091': 'E8',
|
|
1663
|
+
'090': 'E6',
|
|
1664
|
+
'089': 'E3',
|
|
1665
|
+
'088': 'E0',
|
|
1666
|
+
'087': 'DE',
|
|
1667
|
+
'086': 'DB',
|
|
1668
|
+
'085': 'D9',
|
|
1669
|
+
'084': 'D6',
|
|
1670
|
+
'083': 'D4',
|
|
1671
|
+
'082': 'D1',
|
|
1672
|
+
'081': 'CF',
|
|
1673
|
+
'080': 'CC',
|
|
1674
|
+
'079': 'C9',
|
|
1675
|
+
'078': 'C7',
|
|
1676
|
+
'077': 'C4',
|
|
1677
|
+
'076': 'C2',
|
|
1678
|
+
'075': 'BF',
|
|
1679
|
+
'074': 'BD',
|
|
1680
|
+
'073': 'BA',
|
|
1681
|
+
'072': 'B8',
|
|
1682
|
+
'071': 'B5',
|
|
1683
|
+
'070': 'B3',
|
|
1684
|
+
'069': 'B0',
|
|
1685
|
+
'068': 'AD',
|
|
1686
|
+
'067': 'AB',
|
|
1687
|
+
'066': 'A8',
|
|
1688
|
+
'065': 'A6',
|
|
1689
|
+
'064': 'A3',
|
|
1690
|
+
'063': 'A1',
|
|
1691
|
+
'062': '9E',
|
|
1692
|
+
'061': '9C',
|
|
1693
|
+
'060': '99',
|
|
1694
|
+
'059': '96',
|
|
1695
|
+
'058': '94',
|
|
1696
|
+
'057': '91',
|
|
1697
|
+
'056': '8F',
|
|
1698
|
+
'055': '8C',
|
|
1699
|
+
'054': '8A',
|
|
1700
|
+
'053': '87',
|
|
1701
|
+
'052': '85',
|
|
1702
|
+
'051': '82',
|
|
1703
|
+
'050': '80',
|
|
1704
|
+
'049': '7D',
|
|
1705
|
+
'048': '7A',
|
|
1706
|
+
'047': '78',
|
|
1707
|
+
'046': '75',
|
|
1708
|
+
'045': '73',
|
|
1709
|
+
'044': '70',
|
|
1710
|
+
'043': '6E',
|
|
1711
|
+
'042': '6B',
|
|
1712
|
+
'041': '69',
|
|
1713
|
+
'040': '66',
|
|
1714
|
+
'039': '63',
|
|
1715
|
+
'038': '61',
|
|
1716
|
+
'037': '5E',
|
|
1717
|
+
'036': '5C',
|
|
1718
|
+
'035': '59',
|
|
1719
|
+
'034': '57',
|
|
1720
|
+
'033': '54',
|
|
1721
|
+
'032': '52',
|
|
1722
|
+
'031': '4F',
|
|
1723
|
+
'030': '4D',
|
|
1724
|
+
'029': '4A',
|
|
1725
|
+
'028': '47',
|
|
1726
|
+
'027': '45',
|
|
1727
|
+
'026': '42',
|
|
1728
|
+
'025': '40',
|
|
1729
|
+
'024': '3D',
|
|
1730
|
+
'023': '3B',
|
|
1731
|
+
'022': '38',
|
|
1732
|
+
'021': '36',
|
|
1733
|
+
'020': '33',
|
|
1734
|
+
'019': '30',
|
|
1735
|
+
'018': '2E',
|
|
1736
|
+
'017': '2B',
|
|
1737
|
+
'016': '29',
|
|
1738
|
+
'015': '26',
|
|
1739
|
+
'014': '24',
|
|
1740
|
+
'013': '21',
|
|
1741
|
+
'012': '1F',
|
|
1742
|
+
'011': '1C',
|
|
1743
|
+
'010': '1A',
|
|
1744
|
+
'009': '17',
|
|
1745
|
+
'008': '14',
|
|
1746
|
+
'007': '12',
|
|
1747
|
+
'006': '0F',
|
|
1748
|
+
'005': '0D',
|
|
1749
|
+
'004': '0A',
|
|
1750
|
+
'003': '08',
|
|
1751
|
+
'002': '05',
|
|
1752
|
+
'001': '03',
|
|
1753
|
+
'000': '00',
|
|
1754
|
+
};
|
|
1755
|
+
|
|
1756
|
+
var opacity = /*#__PURE__*/Object.freeze({
|
|
1757
|
+
__proto__: null,
|
|
1758
|
+
hex: hex
|
|
1759
|
+
});
|
|
1760
|
+
|
|
1761
|
+
const slide = {
|
|
1762
|
+
in: {
|
|
1763
|
+
left: keyframes `
|
|
1764
|
+
from { transform: translateX(-100%); }
|
|
1765
|
+
to { transform: translateX(0); }
|
|
1766
|
+
`,
|
|
1767
|
+
right: keyframes `
|
|
1768
|
+
from { transform: translateX(100%); }
|
|
1769
|
+
to { transform: translateX(0); }
|
|
1770
|
+
`,
|
|
1771
|
+
top: keyframes `
|
|
1772
|
+
from { transform: translateY(-100%); }
|
|
1773
|
+
to { transform: translateY(0); }
|
|
1774
|
+
`,
|
|
1775
|
+
bottom: keyframes `
|
|
1776
|
+
from { transform: translateY(100%); }
|
|
1777
|
+
to { transform: translateY(0); }
|
|
1778
|
+
`,
|
|
1779
|
+
center: keyframes `
|
|
1780
|
+
from { transform: translate(-50%, 100%); }
|
|
1781
|
+
to { transform: translate(-50%, -50%); }
|
|
1782
|
+
`,
|
|
1783
|
+
},
|
|
1784
|
+
out: {
|
|
1785
|
+
left: keyframes `
|
|
1786
|
+
from { transform: translateX(0); }
|
|
1787
|
+
to { transform: translateX(-100%); }
|
|
1788
|
+
`,
|
|
1789
|
+
right: keyframes `
|
|
1790
|
+
from { transform: translateX(0); }
|
|
1791
|
+
to { transform: translateX(100%); }
|
|
1792
|
+
`,
|
|
1793
|
+
top: keyframes `
|
|
1794
|
+
from { transform: translateY(0); }
|
|
1795
|
+
to { transform: translateY(-100%); }
|
|
1796
|
+
`,
|
|
1797
|
+
bottom: keyframes `
|
|
1798
|
+
from { transform: translateY(0); }
|
|
1799
|
+
to { transform: translateY(100%); }
|
|
1800
|
+
`,
|
|
1801
|
+
center: keyframes `
|
|
1802
|
+
from { transform: translate(-50%, -50%); }
|
|
1803
|
+
to { transform: translate(-50%, 100%); }
|
|
1804
|
+
`,
|
|
1805
|
+
},
|
|
1806
|
+
};
|
|
1807
|
+
const progress = {
|
|
1808
|
+
in: keyframes `
|
|
1809
|
+
from { width: 0%; }
|
|
1810
|
+
to { width: 100%; }
|
|
1811
|
+
`,
|
|
1812
|
+
out: keyframes `
|
|
1813
|
+
from { width: 100%; }
|
|
1814
|
+
to { width: 0%; }
|
|
1815
|
+
`,
|
|
1816
|
+
};
|
|
1817
|
+
const ping = keyframes `
|
|
1818
|
+
0% {
|
|
1819
|
+
transform: scale(1);
|
|
1820
|
+
opacity: 1;
|
|
1821
|
+
}
|
|
1822
|
+
75%, 100% {
|
|
1823
|
+
transform: scale(2);
|
|
1824
|
+
opacity: 0;
|
|
1825
|
+
}
|
|
1826
|
+
`;
|
|
1827
|
+
const shimmer = keyframes `
|
|
1828
|
+
0% {
|
|
1829
|
+
background-position: -500px 0;
|
|
1830
|
+
}
|
|
1831
|
+
100% {
|
|
1832
|
+
background-position: 500px 0;
|
|
1833
|
+
}
|
|
1834
|
+
`;
|
|
1835
|
+
|
|
1836
|
+
var animations = /*#__PURE__*/Object.freeze({
|
|
1837
|
+
__proto__: null,
|
|
1838
|
+
ping: ping,
|
|
1839
|
+
progress: progress,
|
|
1840
|
+
shimmer: shimmer,
|
|
1841
|
+
slide: slide
|
|
1842
|
+
});
|
|
1843
|
+
|
|
1844
|
+
const Theme = { Provider, useTheme, opacity, animations };
|
|
1845
|
+
|
|
1846
|
+
export { styleInject as $, ACTION_OPTIONS as A, BUTTON_TEXTS as B, CodeAttributesIcon as C, DISPLAY_LANGUAGES as D, ElixirLogo as E, FORM_ALERTS as F, GoLogo as G, HeadersCollectionIcon as H, INSTRUMENTATION_RULE_OPTIONS as I, JavaLogo as J, K8sLogo as K, LANGUAGE_OPTIONS as L, MONITORS_OPTIONS as M, MysqlLogo as N, NginxLogo as O, PiiMaskingIcon as P, NodejsLogo as Q, RenameAttributeIcon as R, STORAGE_KEYS as S, Theme as T, PhpLogo as U, PostgresLogo as V, PythonLogo as W, RedisLogo as X, RubyLogo as Y, RustLogo as Z, SwiftLogo as _, useDataStreamStore as a, useDrawerStore as b, useEntityStore as c, useFilterStore as d, useInstrumentStore as e, useModalStore as f, useNotificationStore as g, usePendingStore as h, useSelectedStore as i, useSetupStore as j, DEFAULT_DATA_STREAM_NAME as k, DISPLAY_TITLES as l, getActionIcon as m, getEntityId as n, getInstrumentationRuleIcon as o, getProgrammingLanguageIcon as p, AddClusterInfoIcon as q, DeleteAttributeIcon as r, SamplerIcon as s, ImageErrorIcon as t, useDarkMode as u, KafkaLogo as v, PayloadCollectionIcon as w, CPlusPlusLogo as x, CSharpLogo as y, DotnetLogo as z };
|