@localstack/appinspector-ui 1.0.23 → 1.0.25
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/dist/index.cjs +388 -383
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +236 -231
- package/dist/index.js.map +1 -1
- package/package.json +49 -37
package/dist/index.cjs
CHANGED
|
@@ -37,7 +37,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
37
37
|
|
|
38
38
|
// src/pages/spans-list-page.tsx
|
|
39
39
|
var import_material8 = require("@mui/material");
|
|
40
|
-
var
|
|
40
|
+
var import_react9 = require("react");
|
|
41
41
|
var import_react_router_dom = require("react-router-dom");
|
|
42
42
|
|
|
43
43
|
// src/api/use-api.tsx
|
|
@@ -62,7 +62,7 @@ var import_material6 = require("@mui/material");
|
|
|
62
62
|
var import_icons_material = require("@mui/icons-material");
|
|
63
63
|
var import_material5 = require("@mui/material");
|
|
64
64
|
var import_x_data_grid = require("@mui/x-data-grid");
|
|
65
|
-
var
|
|
65
|
+
var import_react4 = require("react");
|
|
66
66
|
|
|
67
67
|
// src/components/cells/event-indicator-cell.tsx
|
|
68
68
|
var import_material = require("@mui/material");
|
|
@@ -199,6 +199,9 @@ var WrapInComponent = ({ children, wrap, wrapperFn }) => {
|
|
|
199
199
|
return children;
|
|
200
200
|
};
|
|
201
201
|
|
|
202
|
+
// src/components/aws-service-icon/icons/index.tsx
|
|
203
|
+
var import_react3 = require("react");
|
|
204
|
+
|
|
202
205
|
// src/types/service-names.ts
|
|
203
206
|
var SERVICE_NAME = {
|
|
204
207
|
ACCESSANALYZER: "accessanalyzer",
|
|
@@ -2388,7 +2391,8 @@ var SvgXray = (props) => /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("svg",
|
|
|
2388
2391
|
] });
|
|
2389
2392
|
var xray_default = SvgXray;
|
|
2390
2393
|
|
|
2391
|
-
// src/components/aws-service-icon/icons/index.
|
|
2394
|
+
// src/components/aws-service-icon/icons/index.tsx
|
|
2395
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
2392
2396
|
var ICONS_MAP = {
|
|
2393
2397
|
[SERVICE_NAME.ACCOUNT]: account_default,
|
|
2394
2398
|
[SERVICE_NAME.ACM]: acm_default,
|
|
@@ -2511,30 +2515,30 @@ var ICONS_MAP = {
|
|
|
2511
2515
|
[SERVICE_NAME.WAFV2]: wafv2_default,
|
|
2512
2516
|
[SERVICE_NAME.XRAY]: xray_default
|
|
2513
2517
|
};
|
|
2514
|
-
var
|
|
2515
|
-
|
|
2516
|
-
};
|
|
2518
|
+
var AwsServiceIconBase = (0, import_react3.memo)((props) => {
|
|
2519
|
+
const Icon = ICONS_MAP[props.service] ?? ICONS_MAP.infrastructure;
|
|
2520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { ...props });
|
|
2521
|
+
});
|
|
2517
2522
|
var supportedServiceNames = Object.keys(ICONS_MAP);
|
|
2518
2523
|
|
|
2519
2524
|
// src/components/aws-service-icon/aws-service-icon.tsx
|
|
2520
|
-
var
|
|
2525
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
2521
2526
|
var sizes = { large: [32, 32], medium: [22, 22], small: [11, 11] };
|
|
2522
2527
|
var AwsServiceIcon = ({ hideTooltip, service, size = "medium", title }) => {
|
|
2523
2528
|
const [width, height] = sizes[size];
|
|
2524
|
-
|
|
2525
|
-
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
2529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
2526
2530
|
WrapInComponent,
|
|
2527
2531
|
{
|
|
2528
2532
|
wrap: !hideTooltip,
|
|
2529
|
-
wrapperFn: (child) => /* @__PURE__ */ (0,
|
|
2530
|
-
children: /* @__PURE__ */ (0,
|
|
2533
|
+
wrapperFn: (child) => /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_material2.Tooltip, { placement: "top", title: title ?? service, children: child }),
|
|
2534
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(AwsServiceIconBase, { height, service, style: { display: "block" }, width })
|
|
2531
2535
|
}
|
|
2532
2536
|
);
|
|
2533
2537
|
};
|
|
2534
2538
|
|
|
2535
2539
|
// src/components/cells/pill-cell.tsx
|
|
2536
2540
|
var import_material3 = require("@mui/material");
|
|
2537
|
-
var
|
|
2541
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
2538
2542
|
var PillCell = ({
|
|
2539
2543
|
backgroundColor,
|
|
2540
2544
|
borderColor,
|
|
@@ -2544,7 +2548,7 @@ var PillCell = ({
|
|
|
2544
2548
|
paddingBottom,
|
|
2545
2549
|
paddingTop
|
|
2546
2550
|
}) => {
|
|
2547
|
-
return /* @__PURE__ */ (0,
|
|
2551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
2548
2552
|
import_material3.Box,
|
|
2549
2553
|
{
|
|
2550
2554
|
sx: {
|
|
@@ -2567,7 +2571,7 @@ var PillCell = ({
|
|
|
2567
2571
|
};
|
|
2568
2572
|
|
|
2569
2573
|
// src/components/cells/service-cell.tsx
|
|
2570
|
-
var
|
|
2574
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
2571
2575
|
var ServiceCell = ({
|
|
2572
2576
|
borderColor,
|
|
2573
2577
|
borderWidth,
|
|
@@ -2577,26 +2581,27 @@ var ServiceCell = ({
|
|
|
2577
2581
|
showIcon = true,
|
|
2578
2582
|
width = "32px"
|
|
2579
2583
|
}) => {
|
|
2580
|
-
return /* @__PURE__ */ (0,
|
|
2581
|
-
showIcon ? /* @__PURE__ */ (0,
|
|
2582
|
-
/* @__PURE__ */ (0,
|
|
2584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material4.Box, { sx: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(PillCell, { borderColor, borderWidth, height, children: [
|
|
2585
|
+
showIcon ? /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(import_jsx_runtime125.Fragment, { children: [
|
|
2586
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
2583
2587
|
import_material4.Box,
|
|
2584
2588
|
{
|
|
2585
2589
|
sx: {
|
|
2586
2590
|
alignItems: "center",
|
|
2587
2591
|
display: "flex",
|
|
2592
|
+
flexShrink: 0,
|
|
2588
2593
|
height,
|
|
2589
2594
|
justifyContent: "center",
|
|
2590
2595
|
overflow: "hidden",
|
|
2591
2596
|
padding: 0,
|
|
2592
2597
|
width
|
|
2593
2598
|
},
|
|
2594
|
-
children: /* @__PURE__ */ (0,
|
|
2599
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(AwsServiceIcon, { hideTooltip: true, service, size: "large" })
|
|
2595
2600
|
}
|
|
2596
2601
|
),
|
|
2597
|
-
/* @__PURE__ */ (0,
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material4.Divider, { orientation: "vertical" })
|
|
2598
2603
|
] }) : void 0,
|
|
2599
|
-
/* @__PURE__ */ (0,
|
|
2604
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
2600
2605
|
import_material4.Typography,
|
|
2601
2606
|
{
|
|
2602
2607
|
sx: {
|
|
@@ -2619,9 +2624,9 @@ var ServiceCell = ({
|
|
|
2619
2624
|
children: service
|
|
2620
2625
|
}
|
|
2621
2626
|
),
|
|
2622
|
-
resource ? /* @__PURE__ */ (0,
|
|
2623
|
-
/* @__PURE__ */ (0,
|
|
2624
|
-
/* @__PURE__ */ (0,
|
|
2627
|
+
resource ? /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(import_jsx_runtime125.Fragment, { children: [
|
|
2628
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material4.Box, { sx: { height: "100%", paddingY: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material4.Divider, { orientation: "vertical" }) }),
|
|
2629
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
2625
2630
|
import_material4.Typography,
|
|
2626
2631
|
{
|
|
2627
2632
|
sx: {
|
|
@@ -2711,7 +2716,7 @@ var searchInObject = (object, searchTerm, skipKeys = []) => {
|
|
|
2711
2716
|
};
|
|
2712
2717
|
|
|
2713
2718
|
// src/components/spans-list/spans-data-grid.tsx
|
|
2714
|
-
var
|
|
2719
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
2715
2720
|
var resourceNameComparator = (v1 = "", v2 = "") => {
|
|
2716
2721
|
return v1.localeCompare(v2);
|
|
2717
2722
|
};
|
|
@@ -2726,7 +2731,7 @@ var columns = [
|
|
|
2726
2731
|
field: "trace_id",
|
|
2727
2732
|
headerName: "Trace",
|
|
2728
2733
|
renderCell: (parameters) => {
|
|
2729
|
-
return /* @__PURE__ */ (0,
|
|
2734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material5.Tooltip, { arrow: true, title: String(parameters.value), children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
2730
2735
|
"span",
|
|
2731
2736
|
{
|
|
2732
2737
|
style: {
|
|
@@ -2745,7 +2750,7 @@ var columns = [
|
|
|
2745
2750
|
{
|
|
2746
2751
|
field: "start_time_unix_nano",
|
|
2747
2752
|
headerName: "Time",
|
|
2748
|
-
renderCell: (parameters) => /* @__PURE__ */ (0,
|
|
2753
|
+
renderCell: (parameters) => /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(ResponsiveTimestampCell, { value: parameters.value }),
|
|
2749
2754
|
type: "string",
|
|
2750
2755
|
width: 180
|
|
2751
2756
|
},
|
|
@@ -2756,7 +2761,7 @@ var columns = [
|
|
|
2756
2761
|
if (!parameters.row.parent_service_name || !parameters.row.parent_resource_name) {
|
|
2757
2762
|
return;
|
|
2758
2763
|
}
|
|
2759
|
-
return /* @__PURE__ */ (0,
|
|
2764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(ServiceCell, { resource: parameters.row.parent_resource_name, service: parameters.row.parent_service_name });
|
|
2760
2765
|
},
|
|
2761
2766
|
sortable: true,
|
|
2762
2767
|
sortComparator: resourceNameComparator,
|
|
@@ -2774,7 +2779,7 @@ var columns = [
|
|
|
2774
2779
|
headerName: "Consumer",
|
|
2775
2780
|
maxWidth: 260,
|
|
2776
2781
|
renderCell: (parameters) => {
|
|
2777
|
-
return /* @__PURE__ */ (0,
|
|
2782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(ServiceCell, { resource: parameters.row.resource_name, service: parameters.row.service_name });
|
|
2778
2783
|
},
|
|
2779
2784
|
sortComparator: resourceNameComparator
|
|
2780
2785
|
},
|
|
@@ -2783,7 +2788,7 @@ var columns = [
|
|
|
2783
2788
|
field: "events",
|
|
2784
2789
|
headerName: "Events",
|
|
2785
2790
|
minWidth: 120,
|
|
2786
|
-
renderCell: (parameters) => /* @__PURE__ */ (0,
|
|
2791
|
+
renderCell: (parameters) => /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(EventIndicatorCell, { events: parameters.row.events }),
|
|
2787
2792
|
sortable: false
|
|
2788
2793
|
}
|
|
2789
2794
|
];
|
|
@@ -2805,8 +2810,8 @@ var SpansDataGrid = ({
|
|
|
2805
2810
|
// setRows,
|
|
2806
2811
|
sortingOption = defaultSortingOption
|
|
2807
2812
|
}) => {
|
|
2808
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2809
|
-
const [sortModel, setSortModel] = (0,
|
|
2813
|
+
const [searchTerm, setSearchTerm] = (0, import_react4.useState)(() => localStorage.getItem("spansSearchTerm") ?? "");
|
|
2814
|
+
const [sortModel, setSortModel] = (0, import_react4.useState)(() => {
|
|
2810
2815
|
const savedSorting = localStorage.getItem("spansSortModel");
|
|
2811
2816
|
if (savedSorting) {
|
|
2812
2817
|
try {
|
|
@@ -2822,38 +2827,38 @@ var SpansDataGrid = ({
|
|
|
2822
2827
|
}
|
|
2823
2828
|
];
|
|
2824
2829
|
});
|
|
2825
|
-
const handleRowClick = (0,
|
|
2830
|
+
const handleRowClick = (0, import_react4.useCallback)((parameters) => {
|
|
2826
2831
|
onSpanClick(parameters.row);
|
|
2827
2832
|
}, [onSpanClick]);
|
|
2828
|
-
const handleSearchTermChange = (0,
|
|
2833
|
+
const handleSearchTermChange = (0, import_react4.useCallback)((span) => {
|
|
2829
2834
|
const newValue = span.target.value;
|
|
2830
2835
|
setSearchTerm(newValue);
|
|
2831
2836
|
localStorage.setItem("spansSearchTerm", newValue);
|
|
2832
2837
|
}, []);
|
|
2833
|
-
const handleSortModelChange = (0,
|
|
2838
|
+
const handleSortModelChange = (0, import_react4.useCallback)((newSortModel) => {
|
|
2834
2839
|
setSortModel(newSortModel);
|
|
2835
2840
|
localStorage.setItem("spansSortModel", JSON.stringify(newSortModel));
|
|
2836
2841
|
}, []);
|
|
2837
|
-
const filterSpansBySearchTerm = (0,
|
|
2842
|
+
const filterSpansBySearchTerm = (0, import_react4.useCallback)(
|
|
2838
2843
|
(span) => {
|
|
2839
2844
|
if (searchTerm.length === 0) return true;
|
|
2840
2845
|
return searchInObject(span, searchTerm);
|
|
2841
2846
|
},
|
|
2842
2847
|
[searchTerm]
|
|
2843
2848
|
);
|
|
2844
|
-
const filtersToApply = (0,
|
|
2845
|
-
const filteredRows = (0,
|
|
2849
|
+
const filtersToApply = (0, import_react4.useMemo)(() => [filterSpansBySearchTerm], [filterSpansBySearchTerm]);
|
|
2850
|
+
const filteredRows = (0, import_react4.useMemo)(
|
|
2846
2851
|
() => rows.filter((row) => filtersToApply.every((filter) => filter(row))),
|
|
2847
2852
|
[filtersToApply, rows]
|
|
2848
2853
|
);
|
|
2849
|
-
return /* @__PURE__ */ (0,
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
2851
|
-
/* @__PURE__ */ (0,
|
|
2854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(import_jsx_runtime126.Fragment, { children: [
|
|
2855
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material5.Grid, { item: true, xs: 12, children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(import_material5.Box, { sx: { alignItems: "center", display: "flex", gap: "0.5rem" }, children: [
|
|
2856
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
2852
2857
|
import_material5.TextField,
|
|
2853
2858
|
{
|
|
2854
|
-
label: /* @__PURE__ */ (0,
|
|
2855
|
-
/* @__PURE__ */ (0,
|
|
2856
|
-
/* @__PURE__ */ (0,
|
|
2859
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(import_material5.Box, { sx: { display: "flex", gap: "0.25rem" }, children: [
|
|
2860
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_icons_material.Search, { fontSize: "small" }),
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material5.Typography, { children: "Search Spans" })
|
|
2857
2862
|
] }),
|
|
2858
2863
|
onChange: handleSearchTermChange,
|
|
2859
2864
|
size: "small",
|
|
@@ -2861,11 +2866,11 @@ var SpansDataGrid = ({
|
|
|
2861
2866
|
value: searchTerm
|
|
2862
2867
|
}
|
|
2863
2868
|
),
|
|
2864
|
-
/* @__PURE__ */ (0,
|
|
2865
|
-
onFilterWriteOperationsChange && /* @__PURE__ */ (0,
|
|
2869
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material5.Box, { sx: { flexGrow: 1 } }),
|
|
2870
|
+
onFilterWriteOperationsChange && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
2866
2871
|
import_material5.FormControlLabel,
|
|
2867
2872
|
{
|
|
2868
|
-
control: /* @__PURE__ */ (0,
|
|
2873
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
2869
2874
|
import_material5.Switch,
|
|
2870
2875
|
{
|
|
2871
2876
|
checked: filterWriteOperations,
|
|
@@ -2878,10 +2883,10 @@ var SpansDataGrid = ({
|
|
|
2878
2883
|
label: "Only Write Operations"
|
|
2879
2884
|
}
|
|
2880
2885
|
),
|
|
2881
|
-
/* @__PURE__ */ (0,
|
|
2882
|
-
/* @__PURE__ */ (0,
|
|
2886
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material5.Button, { onClick: onClearSpans, startIcon: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_icons_material.DeleteForeverOutlined, {}), children: "Clear Spans" }),
|
|
2887
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material5.Button, { disabled: loading, onClick: onRefresh, startIcon: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_icons_material.Cached, {}), children: "Refresh" })
|
|
2883
2888
|
] }) }),
|
|
2884
|
-
/* @__PURE__ */ (0,
|
|
2889
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { style: { display: "flex", flexDirection: "column", flexGrow: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
2885
2890
|
import_material5.Paper,
|
|
2886
2891
|
{
|
|
2887
2892
|
sx: {
|
|
@@ -2892,7 +2897,7 @@ var SpansDataGrid = ({
|
|
|
2892
2897
|
minHeight: 120,
|
|
2893
2898
|
p: 2
|
|
2894
2899
|
},
|
|
2895
|
-
children: /* @__PURE__ */ (0,
|
|
2900
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
2896
2901
|
import_x_data_grid.DataGrid,
|
|
2897
2902
|
{
|
|
2898
2903
|
columns,
|
|
@@ -2930,13 +2935,13 @@ var SpansDataGrid = ({
|
|
|
2930
2935
|
};
|
|
2931
2936
|
|
|
2932
2937
|
// src/components/spans-list/spans-list.tsx
|
|
2933
|
-
var
|
|
2938
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
2934
2939
|
var SpansList = (props) => {
|
|
2935
|
-
return /* @__PURE__ */ (0,
|
|
2936
|
-
props.spans.error && /* @__PURE__ */ (0,
|
|
2940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material6.Box, { "data-testid": "spans-data-grid", sx: { display: "flex", flexDirection: "column", flexGrow: 1, gap: 2, width: "100%" }, children: [
|
|
2941
|
+
props.spans.error && /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
2937
2942
|
import_material6.Alert,
|
|
2938
2943
|
{
|
|
2939
|
-
action: /* @__PURE__ */ (0,
|
|
2944
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Button, { onClick: props.onRefresh, children: "Retry" }),
|
|
2940
2945
|
severity: "error",
|
|
2941
2946
|
children: [
|
|
2942
2947
|
"Unexpected error:",
|
|
@@ -2945,7 +2950,7 @@ var SpansList = (props) => {
|
|
|
2945
2950
|
]
|
|
2946
2951
|
}
|
|
2947
2952
|
),
|
|
2948
|
-
(props.spans.data !== void 0 || props.spans.loading) && /* @__PURE__ */ (0,
|
|
2953
|
+
(props.spans.data !== void 0 || props.spans.loading) && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
2949
2954
|
SpansDataGrid,
|
|
2950
2955
|
{
|
|
2951
2956
|
filterWriteOperations: props.filterWriteOperations,
|
|
@@ -3011,14 +3016,14 @@ var getAppInspectorApiUrl = (localstackEndpoint, endpoint) => {
|
|
|
3011
3016
|
};
|
|
3012
3017
|
|
|
3013
3018
|
// src/components/status-message/status-message.tsx
|
|
3014
|
-
var
|
|
3019
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
3015
3020
|
var StatusMessage = ({
|
|
3016
3021
|
error,
|
|
3017
3022
|
onRetry,
|
|
3018
3023
|
status
|
|
3019
3024
|
}) => {
|
|
3020
3025
|
if (error instanceof AppInspectorNotFoundError) {
|
|
3021
|
-
return /* @__PURE__ */ (0,
|
|
3026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3022
3027
|
import_material7.Box,
|
|
3023
3028
|
{
|
|
3024
3029
|
sx: {
|
|
@@ -3029,18 +3034,18 @@ var StatusMessage = ({
|
|
|
3029
3034
|
justifyContent: "center",
|
|
3030
3035
|
p: 4
|
|
3031
3036
|
},
|
|
3032
|
-
children: /* @__PURE__ */ (0,
|
|
3037
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
3033
3038
|
import_material7.Alert,
|
|
3034
3039
|
{
|
|
3035
|
-
icon: /* @__PURE__ */ (0,
|
|
3040
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_icons_material2.ErrorOutline, { fontSize: "large" }),
|
|
3036
3041
|
severity: "error",
|
|
3037
3042
|
sx: { maxWidth: 600, width: "100%" },
|
|
3038
3043
|
children: [
|
|
3039
|
-
/* @__PURE__ */ (0,
|
|
3040
|
-
/* @__PURE__ */ (0,
|
|
3041
|
-
/* @__PURE__ */ (0,
|
|
3042
|
-
/* @__PURE__ */ (0,
|
|
3043
|
-
/* @__PURE__ */ (0,
|
|
3044
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.AlertTitle, { sx: { fontWeight: "bold" }, children: "App Inspector Not Available" }),
|
|
3045
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { mb: 2 }, variant: "body2", children: "The App Inspector extension is not licensed or not enabled in LocalStack." }),
|
|
3046
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { mb: 1 }, variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("strong", { children: "To enable App Inspector:" }) }),
|
|
3047
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { mb: 1 }, variant: "body2", children: "Set the environment variable and restart LocalStack:" }),
|
|
3048
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3044
3049
|
import_material7.Box,
|
|
3045
3050
|
{
|
|
3046
3051
|
component: "pre",
|
|
@@ -3053,24 +3058,24 @@ var StatusMessage = ({
|
|
|
3053
3058
|
children: "LOCALSTACK_APPINSPECTOR_ENABLE=1"
|
|
3054
3059
|
}
|
|
3055
3060
|
),
|
|
3056
|
-
/* @__PURE__ */ (0,
|
|
3061
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_material7.Typography, { sx: { fontStyle: "italic", mb: 1, mt: 2 }, variant: "body2", children: [
|
|
3057
3062
|
"Runtime changes can be made via endpoint",
|
|
3058
3063
|
" ",
|
|
3059
|
-
/* @__PURE__ */ (0,
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("code", { children: [
|
|
3060
3065
|
APPINSPECTOR_API_PREFIX,
|
|
3061
3066
|
"/status"
|
|
3062
3067
|
] }),
|
|
3063
3068
|
". For persistent default state across restarts, adjust the",
|
|
3064
3069
|
" ",
|
|
3065
|
-
/* @__PURE__ */ (0,
|
|
3070
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("code", { children: "LOCALSTACK_APPINSPECTOR_ENABLE" }),
|
|
3066
3071
|
" ",
|
|
3067
3072
|
"environment variable in your",
|
|
3068
3073
|
" ",
|
|
3069
|
-
/* @__PURE__ */ (0,
|
|
3074
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("code", { children: "~/.localstack" }),
|
|
3070
3075
|
" ",
|
|
3071
3076
|
"profile files.",
|
|
3072
3077
|
" ",
|
|
3073
|
-
/* @__PURE__ */ (0,
|
|
3078
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3074
3079
|
import_material7.Link,
|
|
3075
3080
|
{
|
|
3076
3081
|
href: "https://docs.localstack.cloud/aws/capabilities/config/configuration/#profiles",
|
|
@@ -3080,8 +3085,8 @@ var StatusMessage = ({
|
|
|
3080
3085
|
}
|
|
3081
3086
|
)
|
|
3082
3087
|
] }),
|
|
3083
|
-
/* @__PURE__ */ (0,
|
|
3084
|
-
/* @__PURE__ */ (0,
|
|
3088
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { mb: 1, mt: 2 }, variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("strong", { children: "For more information:" }) }),
|
|
3089
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3085
3090
|
import_material7.Link,
|
|
3086
3091
|
{
|
|
3087
3092
|
href: "https://docs.localstack.cloud/user-guide/tools/application-inspector/",
|
|
@@ -3090,7 +3095,7 @@ var StatusMessage = ({
|
|
|
3090
3095
|
children: "App Inspector Documentation"
|
|
3091
3096
|
}
|
|
3092
3097
|
),
|
|
3093
|
-
onRetry && /* @__PURE__ */ (0,
|
|
3098
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Box, { sx: { display: "flex", justifyContent: "flex-start", mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3094
3099
|
import_material7.Button,
|
|
3095
3100
|
{
|
|
3096
3101
|
"aria-label": "Check App Inspector status again",
|
|
@@ -3106,7 +3111,7 @@ var StatusMessage = ({
|
|
|
3106
3111
|
);
|
|
3107
3112
|
}
|
|
3108
3113
|
if (error instanceof ConnectionError) {
|
|
3109
|
-
return /* @__PURE__ */ (0,
|
|
3114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3110
3115
|
import_material7.Box,
|
|
3111
3116
|
{
|
|
3112
3117
|
sx: {
|
|
@@ -3117,17 +3122,17 @@ var StatusMessage = ({
|
|
|
3117
3122
|
justifyContent: "center",
|
|
3118
3123
|
p: 4
|
|
3119
3124
|
},
|
|
3120
|
-
children: /* @__PURE__ */ (0,
|
|
3125
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
3121
3126
|
import_material7.Alert,
|
|
3122
3127
|
{
|
|
3123
|
-
icon: /* @__PURE__ */ (0,
|
|
3128
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_icons_material2.ErrorOutline, { fontSize: "large" }),
|
|
3124
3129
|
severity: "error",
|
|
3125
3130
|
sx: { maxWidth: 600, width: "100%" },
|
|
3126
3131
|
children: [
|
|
3127
|
-
/* @__PURE__ */ (0,
|
|
3128
|
-
/* @__PURE__ */ (0,
|
|
3129
|
-
/* @__PURE__ */ (0,
|
|
3130
|
-
/* @__PURE__ */ (0,
|
|
3132
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.AlertTitle, { sx: { fontWeight: "bold" }, children: "Connection Error" }),
|
|
3133
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { mb: 2 }, variant: "body2", children: "Failed to connect to LocalStack. Please ensure LocalStack is running and accessible." }),
|
|
3134
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { mb: 1 }, variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("strong", { children: "To start LocalStack:" }) }),
|
|
3135
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3131
3136
|
import_material7.Box,
|
|
3132
3137
|
{
|
|
3133
3138
|
component: "pre",
|
|
@@ -3140,7 +3145,7 @@ var StatusMessage = ({
|
|
|
3140
3145
|
children: "localstack start"
|
|
3141
3146
|
}
|
|
3142
3147
|
),
|
|
3143
|
-
onRetry && /* @__PURE__ */ (0,
|
|
3148
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Box, { sx: { display: "flex", justifyContent: "flex-start", mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3144
3149
|
import_material7.Button,
|
|
3145
3150
|
{
|
|
3146
3151
|
"aria-label": "Retry connection to LocalStack",
|
|
@@ -3156,7 +3161,7 @@ var StatusMessage = ({
|
|
|
3156
3161
|
);
|
|
3157
3162
|
}
|
|
3158
3163
|
if (status?.status === "DISABLED") {
|
|
3159
|
-
return /* @__PURE__ */ (0,
|
|
3164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3160
3165
|
import_material7.Box,
|
|
3161
3166
|
{
|
|
3162
3167
|
sx: {
|
|
@@ -3167,17 +3172,17 @@ var StatusMessage = ({
|
|
|
3167
3172
|
justifyContent: "center",
|
|
3168
3173
|
p: 4
|
|
3169
3174
|
},
|
|
3170
|
-
children: /* @__PURE__ */ (0,
|
|
3175
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
3171
3176
|
import_material7.Alert,
|
|
3172
3177
|
{
|
|
3173
|
-
icon: /* @__PURE__ */ (0,
|
|
3178
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_icons_material2.InfoOutlined, { fontSize: "large" }),
|
|
3174
3179
|
severity: "warning",
|
|
3175
3180
|
sx: { maxWidth: 600, width: "100%" },
|
|
3176
3181
|
children: [
|
|
3177
|
-
/* @__PURE__ */ (0,
|
|
3178
|
-
/* @__PURE__ */ (0,
|
|
3179
|
-
/* @__PURE__ */ (0,
|
|
3180
|
-
/* @__PURE__ */ (0,
|
|
3182
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.AlertTitle, { sx: { fontWeight: "bold" }, children: "App Inspector is Disabled" }),
|
|
3183
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { mb: 2 }, variant: "body2", children: "App Inspector is currently disabled. Please enable it to view traces and spans." }),
|
|
3184
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { mb: 1 }, variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("strong", { children: "To enable App Inspector at runtime:" }) }),
|
|
3185
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3181
3186
|
import_material7.Box,
|
|
3182
3187
|
{
|
|
3183
3188
|
component: "pre",
|
|
@@ -3188,14 +3193,14 @@ var StatusMessage = ({
|
|
|
3188
3193
|
overflowX: "auto",
|
|
3189
3194
|
p: 1
|
|
3190
3195
|
},
|
|
3191
|
-
children: `curl -X PUT http://localhost:4566${APPINSPECTOR_API_PREFIX}/status
|
|
3192
|
-
-H "Content-Type: application/json"
|
|
3196
|
+
children: String.raw`curl -X PUT http://localhost:4566${APPINSPECTOR_API_PREFIX}/status \
|
|
3197
|
+
-H "Content-Type: application/json" \
|
|
3193
3198
|
-d '{"status": "ENABLED"}'`
|
|
3194
3199
|
}
|
|
3195
3200
|
),
|
|
3196
|
-
/* @__PURE__ */ (0,
|
|
3197
|
-
/* @__PURE__ */ (0,
|
|
3198
|
-
/* @__PURE__ */ (0,
|
|
3201
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { mb: 1, mt: 2 }, variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("strong", { children: "To enable App Inspector persistently across restarts:" }) }),
|
|
3202
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { mb: 1 }, variant: "body2", children: "Set the environment variable:" }),
|
|
3203
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3199
3204
|
import_material7.Box,
|
|
3200
3205
|
{
|
|
3201
3206
|
component: "pre",
|
|
@@ -3208,8 +3213,8 @@ var StatusMessage = ({
|
|
|
3208
3213
|
children: "APPINSPECTOR=1"
|
|
3209
3214
|
}
|
|
3210
3215
|
),
|
|
3211
|
-
Boolean(status.note) && /* @__PURE__ */ (0,
|
|
3212
|
-
onRetry && /* @__PURE__ */ (0,
|
|
3216
|
+
Boolean(status.note) && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { display: "block", fontStyle: "italic", mt: 2 }, variant: "caption", children: status.note }),
|
|
3217
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Box, { sx: { display: "flex", justifyContent: "flex-start", mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3213
3218
|
import_material7.Button,
|
|
3214
3219
|
{
|
|
3215
3220
|
"aria-label": "Check if App Inspector is enabled",
|
|
@@ -3225,7 +3230,7 @@ var StatusMessage = ({
|
|
|
3225
3230
|
);
|
|
3226
3231
|
}
|
|
3227
3232
|
if (error) {
|
|
3228
|
-
return /* @__PURE__ */ (0,
|
|
3233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3229
3234
|
import_material7.Box,
|
|
3230
3235
|
{
|
|
3231
3236
|
sx: {
|
|
@@ -3236,16 +3241,16 @@ var StatusMessage = ({
|
|
|
3236
3241
|
justifyContent: "center",
|
|
3237
3242
|
p: 4
|
|
3238
3243
|
},
|
|
3239
|
-
children: /* @__PURE__ */ (0,
|
|
3244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
3240
3245
|
import_material7.Alert,
|
|
3241
3246
|
{
|
|
3242
|
-
icon: /* @__PURE__ */ (0,
|
|
3247
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_icons_material2.ErrorOutline, { fontSize: "large" }),
|
|
3243
3248
|
severity: "error",
|
|
3244
3249
|
sx: { maxWidth: 600, width: "100%" },
|
|
3245
3250
|
children: [
|
|
3246
|
-
/* @__PURE__ */ (0,
|
|
3247
|
-
/* @__PURE__ */ (0,
|
|
3248
|
-
onRetry && /* @__PURE__ */ (0,
|
|
3251
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.AlertTitle, { sx: { fontWeight: "bold" }, children: "Error" }),
|
|
3252
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Typography, { sx: { mb: 2 }, variant: "body2", children: error.message }),
|
|
3253
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material7.Box, { sx: { display: "flex", justifyContent: "flex-start", mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
3249
3254
|
import_material7.Button,
|
|
3250
3255
|
{
|
|
3251
3256
|
"aria-label": "Retry operation",
|
|
@@ -3260,12 +3265,12 @@ var StatusMessage = ({
|
|
|
3260
3265
|
}
|
|
3261
3266
|
);
|
|
3262
3267
|
}
|
|
3263
|
-
return /* @__PURE__ */ (0,
|
|
3268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_jsx_runtime128.Fragment, {});
|
|
3264
3269
|
};
|
|
3265
3270
|
|
|
3266
3271
|
// src/context.tsx
|
|
3267
|
-
var import_react4 = require("react");
|
|
3268
3272
|
var import_react5 = require("react");
|
|
3273
|
+
var import_react6 = require("react");
|
|
3269
3274
|
|
|
3270
3275
|
// src/constants/error-messages.ts
|
|
3271
3276
|
var ERROR_MESSAGES = {
|
|
@@ -3386,20 +3391,20 @@ var createApiClient = ({ localstackEndpoint }) => {
|
|
|
3386
3391
|
};
|
|
3387
3392
|
|
|
3388
3393
|
// src/context.tsx
|
|
3389
|
-
var
|
|
3390
|
-
var AppInspectorContext = (0,
|
|
3394
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
3395
|
+
var AppInspectorContext = (0, import_react5.createContext)(void 0);
|
|
3391
3396
|
var useAppInspector = () => {
|
|
3392
|
-
const context = (0,
|
|
3397
|
+
const context = (0, import_react5.useContext)(AppInspectorContext);
|
|
3393
3398
|
if (!context) {
|
|
3394
3399
|
throw new Error("@localstack-studio/ui: components must be used within a <AppInspectorContextProvider>");
|
|
3395
3400
|
}
|
|
3396
3401
|
return context;
|
|
3397
3402
|
};
|
|
3398
3403
|
var AppInspectorContextProvider = (props) => {
|
|
3399
|
-
const api = (0,
|
|
3404
|
+
const api = (0, import_react6.useMemo)(() => {
|
|
3400
3405
|
return false ? createApiClientMock() : createApiClient({ localstackEndpoint: props.localstackEndpoint });
|
|
3401
3406
|
}, [props.localstackEndpoint]);
|
|
3402
|
-
const resolveLink = (0,
|
|
3407
|
+
const resolveLink = (0, import_react6.useCallback)(
|
|
3403
3408
|
(options) => {
|
|
3404
3409
|
if (options.to === "settings") {
|
|
3405
3410
|
return `${props.routePrefix}/settings`;
|
|
@@ -3411,7 +3416,7 @@ var AppInspectorContextProvider = (props) => {
|
|
|
3411
3416
|
},
|
|
3412
3417
|
[props.routePrefix]
|
|
3413
3418
|
);
|
|
3414
|
-
const contextValue = (0,
|
|
3419
|
+
const contextValue = (0, import_react6.useMemo)(
|
|
3415
3420
|
() => ({
|
|
3416
3421
|
linkComponent: props.linkComponent,
|
|
3417
3422
|
localstackEndpoint: props.localstackEndpoint,
|
|
@@ -3419,13 +3424,13 @@ var AppInspectorContextProvider = (props) => {
|
|
|
3419
3424
|
}),
|
|
3420
3425
|
[props.linkComponent, props.localstackEndpoint, resolveLink]
|
|
3421
3426
|
);
|
|
3422
|
-
return /* @__PURE__ */ (0,
|
|
3427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(ApiProvider, { api, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(AppInspectorContext.Provider, { value: contextValue, children: props.children }) });
|
|
3423
3428
|
};
|
|
3424
3429
|
|
|
3425
3430
|
// src/hooks/use-local-storage.tsx
|
|
3426
|
-
var
|
|
3431
|
+
var import_react7 = require("react");
|
|
3427
3432
|
function useLocalStorage(key, initialValue) {
|
|
3428
|
-
const [storedValue, setStoredValue] = (0,
|
|
3433
|
+
const [storedValue, setStoredValue] = (0, import_react7.useState)(() => {
|
|
3429
3434
|
try {
|
|
3430
3435
|
const item = globalThis.localStorage.getItem(key);
|
|
3431
3436
|
return item ? JSON.parse(item) : initialValue;
|
|
@@ -3434,7 +3439,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
3434
3439
|
return initialValue;
|
|
3435
3440
|
}
|
|
3436
3441
|
});
|
|
3437
|
-
const setValue = (0,
|
|
3442
|
+
const setValue = (0, import_react7.useCallback)((value) => {
|
|
3438
3443
|
try {
|
|
3439
3444
|
setStoredValue(value);
|
|
3440
3445
|
globalThis.localStorage.setItem(key, JSON.stringify(value));
|
|
@@ -3446,7 +3451,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
3446
3451
|
console.error(`Error setting localStorage key "${key}":`, error);
|
|
3447
3452
|
}
|
|
3448
3453
|
}, [key]);
|
|
3449
|
-
(0,
|
|
3454
|
+
(0, import_react7.useEffect)(() => {
|
|
3450
3455
|
const handleStorageChange = (event) => {
|
|
3451
3456
|
if (event.key === key && event.newValue !== null) {
|
|
3452
3457
|
try {
|
|
@@ -3465,15 +3470,15 @@ function useLocalStorage(key, initialValue) {
|
|
|
3465
3470
|
}
|
|
3466
3471
|
|
|
3467
3472
|
// src/hooks/use-status.tsx
|
|
3468
|
-
var
|
|
3473
|
+
var import_react8 = require("react");
|
|
3469
3474
|
var useStatus = () => {
|
|
3470
3475
|
const api = useAppInspectorApi();
|
|
3471
|
-
const [checking, setChecking] = (0,
|
|
3472
|
-
const [status, setStatus] = (0,
|
|
3473
|
-
const [error, setError] = (0,
|
|
3474
|
-
const hasFetchedReference = (0,
|
|
3475
|
-
const abortControllerReference = (0,
|
|
3476
|
-
const checkStatus = (0,
|
|
3476
|
+
const [checking, setChecking] = (0, import_react8.useState)(true);
|
|
3477
|
+
const [status, setStatus] = (0, import_react8.useState)();
|
|
3478
|
+
const [error, setError] = (0, import_react8.useState)();
|
|
3479
|
+
const hasFetchedReference = (0, import_react8.useRef)(false);
|
|
3480
|
+
const abortControllerReference = (0, import_react8.useRef)(null);
|
|
3481
|
+
const checkStatus = (0, import_react8.useCallback)(async () => {
|
|
3477
3482
|
if (abortControllerReference.current) {
|
|
3478
3483
|
abortControllerReference.current.abort();
|
|
3479
3484
|
}
|
|
@@ -3497,7 +3502,7 @@ var useStatus = () => {
|
|
|
3497
3502
|
}
|
|
3498
3503
|
}
|
|
3499
3504
|
}, [api]);
|
|
3500
|
-
(0,
|
|
3505
|
+
(0, import_react8.useEffect)(() => {
|
|
3501
3506
|
if (!hasFetchedReference.current) {
|
|
3502
3507
|
hasFetchedReference.current = true;
|
|
3503
3508
|
void checkStatus();
|
|
@@ -3507,28 +3512,28 @@ var useStatus = () => {
|
|
|
3507
3512
|
};
|
|
3508
3513
|
|
|
3509
3514
|
// src/pages/spans-list-page.tsx
|
|
3510
|
-
var
|
|
3515
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
3516
|
+
var spansPerPageOptions = [25, 50, 100];
|
|
3511
3517
|
var SpansListPage = () => {
|
|
3512
3518
|
const api = useAppInspectorApi();
|
|
3513
|
-
const [spans, setSpans] = (0,
|
|
3514
|
-
const [loading, setLoading] = (0,
|
|
3515
|
-
const hasFetched = (0,
|
|
3519
|
+
const [spans, setSpans] = (0, import_react9.useState)();
|
|
3520
|
+
const [loading, setLoading] = (0, import_react9.useState)(false);
|
|
3521
|
+
const hasFetched = (0, import_react9.useRef)(false);
|
|
3516
3522
|
const [filterWriteOperations, setFilterWriteOperations] = useLocalStorage("filterWriteOperations", true);
|
|
3517
|
-
const mapPageToNextCursor = (0,
|
|
3518
|
-
const [page, setPage] = (0,
|
|
3519
|
-
const [pageSize, setPageSize] = (0,
|
|
3520
|
-
const [
|
|
3521
|
-
const
|
|
3522
|
-
const queryOptions = (0, import_react8.useMemo)(() => {
|
|
3523
|
+
const mapPageToNextCursor = (0, import_react9.useRef)({});
|
|
3524
|
+
const [page, setPage] = (0, import_react9.useState)(0);
|
|
3525
|
+
const [pageSize, setPageSize] = (0, import_react9.useState)(100);
|
|
3526
|
+
const [spanCount, setSpanCount] = (0, import_react9.useState)(0);
|
|
3527
|
+
const queryOptions = (0, import_react9.useMemo)(() => {
|
|
3523
3528
|
return {
|
|
3524
3529
|
is_write_operation: filterWriteOperations ? true : void 0,
|
|
3525
3530
|
limit: pageSize,
|
|
3526
3531
|
pagination_token: mapPageToNextCursor.current[page - 1]
|
|
3527
3532
|
};
|
|
3528
3533
|
}, [filterWriteOperations, pageSize, page]);
|
|
3529
|
-
const [fetchError, setFetchError] = (0,
|
|
3534
|
+
const [fetchError, setFetchError] = (0, import_react9.useState)();
|
|
3530
3535
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
3531
|
-
const fetchSpans = (0,
|
|
3536
|
+
const fetchSpans = (0, import_react9.useCallback)(async () => {
|
|
3532
3537
|
setLoading(true);
|
|
3533
3538
|
try {
|
|
3534
3539
|
const response = await api.getSpans(queryOptions);
|
|
@@ -3545,26 +3550,26 @@ var SpansListPage = () => {
|
|
|
3545
3550
|
setLoading(false);
|
|
3546
3551
|
}
|
|
3547
3552
|
}, [api, page, queryOptions]);
|
|
3548
|
-
const fetchSpansSync = (0,
|
|
3553
|
+
const fetchSpansSync = (0, import_react9.useCallback)(() => {
|
|
3549
3554
|
void fetchSpans();
|
|
3550
3555
|
}, [fetchSpans]);
|
|
3551
|
-
(0,
|
|
3556
|
+
(0, import_react9.useEffect)(() => {
|
|
3552
3557
|
if (hasFetched.current) return;
|
|
3553
3558
|
if (status?.status !== "ENABLED") return;
|
|
3554
3559
|
hasFetched.current = true;
|
|
3555
3560
|
void fetchSpans();
|
|
3556
3561
|
}, [fetchSpans, status]);
|
|
3557
|
-
(0,
|
|
3562
|
+
(0, import_react9.useEffect)(() => {
|
|
3558
3563
|
if (!hasFetched.current) return;
|
|
3559
3564
|
void fetchSpans();
|
|
3560
3565
|
}, [fetchSpans]);
|
|
3561
3566
|
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
3562
3567
|
const { resolveLink } = useAppInspector();
|
|
3563
|
-
const navigateToSpan = (0,
|
|
3568
|
+
const navigateToSpan = (0, import_react9.useCallback)((span) => {
|
|
3564
3569
|
const url = resolveLink({ to: "trace-graph", traceId: span.trace_id });
|
|
3565
3570
|
navigate(`${url}?spanId=${span.span_id}`);
|
|
3566
3571
|
}, [navigate, resolveLink]);
|
|
3567
|
-
const clearSpans = (0,
|
|
3572
|
+
const clearSpans = (0, import_react9.useCallback)(async () => {
|
|
3568
3573
|
setLoading(true);
|
|
3569
3574
|
try {
|
|
3570
3575
|
await api.deleteSpans();
|
|
@@ -3578,11 +3583,11 @@ var SpansListPage = () => {
|
|
|
3578
3583
|
setLoading(false);
|
|
3579
3584
|
}
|
|
3580
3585
|
}, [api, fetchSpans]);
|
|
3581
|
-
const handleRetry = (0,
|
|
3586
|
+
const handleRetry = (0, import_react9.useCallback)(() => {
|
|
3582
3587
|
void checkStatus();
|
|
3583
3588
|
}, [checkStatus]);
|
|
3584
3589
|
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
3585
|
-
return /* @__PURE__ */ (0,
|
|
3590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
3586
3591
|
import_material8.Box,
|
|
3587
3592
|
{
|
|
3588
3593
|
"data-testid": "spans-list-page",
|
|
@@ -3593,14 +3598,14 @@ var SpansListPage = () => {
|
|
|
3593
3598
|
flexGrow: 1,
|
|
3594
3599
|
width: "100%"
|
|
3595
3600
|
},
|
|
3596
|
-
children: shouldShowStatusMessage ? /* @__PURE__ */ (0,
|
|
3601
|
+
children: shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
3597
3602
|
StatusMessage,
|
|
3598
3603
|
{
|
|
3599
3604
|
error: statusError,
|
|
3600
3605
|
onRetry: handleRetry,
|
|
3601
3606
|
status
|
|
3602
3607
|
}
|
|
3603
|
-
) : /* @__PURE__ */ (0,
|
|
3608
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
3604
3609
|
SpansList,
|
|
3605
3610
|
{
|
|
3606
3611
|
filterWriteOperations,
|
|
@@ -3637,13 +3642,13 @@ var SpansListPage = () => {
|
|
|
3637
3642
|
var import_icons_material11 = require("@mui/icons-material");
|
|
3638
3643
|
var import_material21 = require("@mui/material");
|
|
3639
3644
|
var import_styles = require("@mui/material/styles");
|
|
3640
|
-
var
|
|
3641
|
-
var
|
|
3645
|
+
var import_react22 = require("@xyflow/react");
|
|
3646
|
+
var import_react23 = require("react");
|
|
3642
3647
|
var import_react_router_dom2 = require("react-router-dom");
|
|
3643
3648
|
|
|
3644
3649
|
// src/components/event-details/event-details.tsx
|
|
3645
3650
|
var import_material16 = require("@mui/material");
|
|
3646
|
-
var
|
|
3651
|
+
var import_react13 = require("react");
|
|
3647
3652
|
|
|
3648
3653
|
// src/utils/iam-utils.ts
|
|
3649
3654
|
function determinePermissionStatus(payload) {
|
|
@@ -3842,9 +3847,9 @@ var getEventGroupsByType = (events) => {
|
|
|
3842
3847
|
// src/components/event-details/event-details-header.tsx
|
|
3843
3848
|
var import_icons_material3 = require("@mui/icons-material");
|
|
3844
3849
|
var import_material9 = require("@mui/material");
|
|
3845
|
-
var
|
|
3850
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
3846
3851
|
var EventDetailsHeader = ({ event, onClose }) => {
|
|
3847
|
-
return /* @__PURE__ */ (0,
|
|
3852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
3848
3853
|
import_material9.Box,
|
|
3849
3854
|
{
|
|
3850
3855
|
sx: {
|
|
@@ -3856,16 +3861,16 @@ var EventDetailsHeader = ({ event, onClose }) => {
|
|
|
3856
3861
|
p: 2
|
|
3857
3862
|
},
|
|
3858
3863
|
children: [
|
|
3859
|
-
/* @__PURE__ */ (0,
|
|
3860
|
-
/* @__PURE__ */ (0,
|
|
3861
|
-
/* @__PURE__ */ (0,
|
|
3864
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material9.Box, { children: [
|
|
3865
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material9.Typography, { sx: { fontWeight: 600 }, variant: "h6", children: "Event Details" }),
|
|
3866
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material9.Typography, { color: "text.secondary", variant: "body2", children: [
|
|
3862
3867
|
event.service_name,
|
|
3863
3868
|
" ",
|
|
3864
3869
|
"-",
|
|
3865
3870
|
event.operation_name
|
|
3866
3871
|
] })
|
|
3867
3872
|
] }),
|
|
3868
|
-
onClose && /* @__PURE__ */ (0,
|
|
3873
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material9.IconButton, { onClick: onClose, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_icons_material3.Close, {}) })
|
|
3869
3874
|
]
|
|
3870
3875
|
}
|
|
3871
3876
|
);
|
|
@@ -3877,28 +3882,28 @@ var import_material15 = require("@mui/material");
|
|
|
3877
3882
|
// src/components/event-details/event-detail.tsx
|
|
3878
3883
|
var import_icons_material7 = require("@mui/icons-material");
|
|
3879
3884
|
var import_material13 = require("@mui/material");
|
|
3880
|
-
var
|
|
3885
|
+
var import_react11 = require("react");
|
|
3881
3886
|
|
|
3882
3887
|
// src/components/status-icon.tsx
|
|
3883
3888
|
var import_icons_material4 = require("@mui/icons-material");
|
|
3884
3889
|
var import_material10 = require("@mui/material");
|
|
3885
|
-
var
|
|
3890
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
3886
3891
|
var StatusIcon = ({ errorLevel }) => {
|
|
3887
3892
|
switch (errorLevel) {
|
|
3888
3893
|
case EventLevel.LevelError: {
|
|
3889
|
-
return /* @__PURE__ */ (0,
|
|
3894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_icons_material4.Cancel, { sx: { color: "red" } });
|
|
3890
3895
|
}
|
|
3891
3896
|
case EventLevel.LevelInfo: {
|
|
3892
|
-
return /* @__PURE__ */ (0,
|
|
3897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_icons_material4.Info, { sx: { color: "gray" } });
|
|
3893
3898
|
}
|
|
3894
3899
|
case EventLevel.LevelPermission: {
|
|
3895
|
-
return /* @__PURE__ */ (0,
|
|
3900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_icons_material4.RemoveCircle, { sx: { color: "blue" } });
|
|
3896
3901
|
}
|
|
3897
3902
|
case EventLevel.LevelWarning: {
|
|
3898
|
-
return /* @__PURE__ */ (0,
|
|
3903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_icons_material4.Error, { sx: { color: "orange" } });
|
|
3899
3904
|
}
|
|
3900
3905
|
default: {
|
|
3901
|
-
return /* @__PURE__ */ (0,
|
|
3906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_icons_material4.CheckCircle, { sx: { color: "lightgray" } });
|
|
3902
3907
|
}
|
|
3903
3908
|
}
|
|
3904
3909
|
};
|
|
@@ -3906,9 +3911,9 @@ var StatusIcon = ({ errorLevel }) => {
|
|
|
3906
3911
|
// src/components/event-details/iam-event-detail.tsx
|
|
3907
3912
|
var import_icons_material5 = require("@mui/icons-material");
|
|
3908
3913
|
var import_material11 = require("@mui/material");
|
|
3909
|
-
var
|
|
3910
|
-
var DetailRow = ({ content, label }) => /* @__PURE__ */ (0,
|
|
3911
|
-
/* @__PURE__ */ (0,
|
|
3914
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
3915
|
+
var DetailRow = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material11.Grid, { container: true, spacing: 0, sx: { mb: 1 }, children: [
|
|
3916
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Grid, { item: true, sx: { pr: 1 }, xs: 3, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3912
3917
|
import_material11.Typography,
|
|
3913
3918
|
{
|
|
3914
3919
|
sx: {
|
|
@@ -3919,7 +3924,7 @@ var DetailRow = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime13
|
|
|
3919
3924
|
children: label
|
|
3920
3925
|
}
|
|
3921
3926
|
) }),
|
|
3922
|
-
/* @__PURE__ */ (0,
|
|
3927
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Grid, { item: true, xs: 9, children: typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3923
3928
|
import_material11.Typography,
|
|
3924
3929
|
{
|
|
3925
3930
|
sx: {
|
|
@@ -3935,30 +3940,30 @@ var PermissionIcon = ({ status }) => {
|
|
|
3935
3940
|
switch (status) {
|
|
3936
3941
|
case "explicitly_allowed":
|
|
3937
3942
|
case "implicitly_allowed": {
|
|
3938
|
-
return /* @__PURE__ */ (0,
|
|
3943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_icons_material5.CheckCircle, { sx: { color: "success.main", fontSize: "1rem" } });
|
|
3939
3944
|
}
|
|
3940
3945
|
case "explicitly_denied": {
|
|
3941
|
-
return /* @__PURE__ */ (0,
|
|
3946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_icons_material5.Error, { sx: { color: "error.main", fontSize: "1rem" } });
|
|
3942
3947
|
}
|
|
3943
3948
|
case "implicitly_denied": {
|
|
3944
|
-
return /* @__PURE__ */ (0,
|
|
3949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_icons_material5.Warning, { sx: { color: "warning.main", fontSize: "1rem" } });
|
|
3945
3950
|
}
|
|
3946
3951
|
}
|
|
3947
3952
|
};
|
|
3948
3953
|
var IAMEventDetail = ({ event }) => {
|
|
3949
3954
|
const payloadString = event.attributes?.payload;
|
|
3950
3955
|
if (!payloadString) {
|
|
3951
|
-
return /* @__PURE__ */ (0,
|
|
3956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Box, { sx: { p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "body2", children: "No IAM policy evaluation data available" }) });
|
|
3952
3957
|
}
|
|
3953
3958
|
const parsedIAM = parseIAMEvent(payloadString);
|
|
3954
3959
|
if (!parsedIAM) {
|
|
3955
|
-
return /* @__PURE__ */ (0,
|
|
3960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Box, { sx: { p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "body2", children: "Failed to parse IAM event data" }) });
|
|
3956
3961
|
}
|
|
3957
|
-
return /* @__PURE__ */ (0,
|
|
3958
|
-
/* @__PURE__ */ (0,
|
|
3962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material11.Box, { sx: { p: 2 }, children: [
|
|
3963
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Box, { sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3959
3964
|
import_material11.Chip,
|
|
3960
3965
|
{
|
|
3961
|
-
icon: /* @__PURE__ */ (0,
|
|
3966
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(PermissionIcon, { status: parsedIAM.permission }),
|
|
3962
3967
|
label: formatPermissionStatus(parsedIAM.permission),
|
|
3963
3968
|
size: "small",
|
|
3964
3969
|
sx: {
|
|
@@ -3968,12 +3973,12 @@ var IAMEventDetail = ({ event }) => {
|
|
|
3968
3973
|
variant: "outlined"
|
|
3969
3974
|
}
|
|
3970
3975
|
) }),
|
|
3971
|
-
/* @__PURE__ */ (0,
|
|
3972
|
-
/* @__PURE__ */ (0,
|
|
3973
|
-
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ (0,
|
|
3976
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(DetailRow, { content: `${parsedIAM.service}:${parsedIAM.operation}`, label: "Operation" }),
|
|
3977
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(DetailRow, { content: parsedIAM.principal, label: "Principal" }),
|
|
3978
|
+
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3974
3979
|
DetailRow,
|
|
3975
3980
|
{
|
|
3976
|
-
content: /* @__PURE__ */ (0,
|
|
3981
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Box, { children: parsedIAM.details.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3977
3982
|
import_material11.Typography,
|
|
3978
3983
|
{
|
|
3979
3984
|
sx: {
|
|
@@ -3987,10 +3992,10 @@ var IAMEventDetail = ({ event }) => {
|
|
|
3987
3992
|
label: "Actions"
|
|
3988
3993
|
}
|
|
3989
3994
|
),
|
|
3990
|
-
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ (0,
|
|
3995
|
+
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3991
3996
|
DetailRow,
|
|
3992
3997
|
{
|
|
3993
|
-
content: /* @__PURE__ */ (0,
|
|
3998
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Box, { children: parsedIAM.details.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3994
3999
|
import_material11.Typography,
|
|
3995
4000
|
{
|
|
3996
4001
|
sx: {
|
|
@@ -4005,20 +4010,20 @@ var IAMEventDetail = ({ event }) => {
|
|
|
4005
4010
|
label: "Resources"
|
|
4006
4011
|
}
|
|
4007
4012
|
),
|
|
4008
|
-
/* @__PURE__ */ (0,
|
|
4009
|
-
/* @__PURE__ */ (0,
|
|
4010
|
-
/* @__PURE__ */ (0,
|
|
4011
|
-
parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ (0,
|
|
4012
|
-
/* @__PURE__ */ (0,
|
|
4013
|
-
/* @__PURE__ */ (0,
|
|
4013
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material11.Box, { sx: { mt: 2 }, children: [
|
|
4014
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Typography, { sx: { fontWeight: 600, mb: 1 }, variant: "caption", children: "Policy Evaluation" }),
|
|
4015
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material11.Grid, { container: true, spacing: 2, children: [
|
|
4016
|
+
parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Grid, { item: true, xs: 4, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material11.Box, { sx: { textAlign: "center" }, children: [
|
|
4017
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Typography, { color: "success.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.explicitAllows }),
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Allows" })
|
|
4014
4019
|
] }) }),
|
|
4015
|
-
parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ (0,
|
|
4016
|
-
/* @__PURE__ */ (0,
|
|
4017
|
-
/* @__PURE__ */ (0,
|
|
4020
|
+
parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Grid, { item: true, xs: 4, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material11.Box, { sx: { textAlign: "center" }, children: [
|
|
4021
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Typography, { color: "error.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.explicitDenies }),
|
|
4022
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Denies" })
|
|
4018
4023
|
] }) }),
|
|
4019
|
-
parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ (0,
|
|
4020
|
-
/* @__PURE__ */ (0,
|
|
4021
|
-
/* @__PURE__ */ (0,
|
|
4024
|
+
parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Grid, { item: true, xs: 4, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material11.Box, { sx: { textAlign: "center" }, children: [
|
|
4025
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Typography, { color: "warning.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.implicitDenies }),
|
|
4026
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Implicit Denies" })
|
|
4022
4027
|
] }) })
|
|
4023
4028
|
] })
|
|
4024
4029
|
] })
|
|
@@ -4028,8 +4033,8 @@ var IAMEventDetail = ({ event }) => {
|
|
|
4028
4033
|
// src/components/event-details/iam-permission-detail.tsx
|
|
4029
4034
|
var import_icons_material6 = require("@mui/icons-material");
|
|
4030
4035
|
var import_material12 = require("@mui/material");
|
|
4031
|
-
var
|
|
4032
|
-
var
|
|
4036
|
+
var import_react10 = require("react");
|
|
4037
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
4033
4038
|
var getChipColors = (status) => {
|
|
4034
4039
|
const isAllowed = status === "explicitly_allowed" || status === "implicitly_allowed";
|
|
4035
4040
|
return {
|
|
@@ -4038,8 +4043,8 @@ var getChipColors = (status) => {
|
|
|
4038
4043
|
};
|
|
4039
4044
|
};
|
|
4040
4045
|
var IAMPermissionItem = ({ event }) => {
|
|
4041
|
-
const [isOpen, setIsOpen] = (0,
|
|
4042
|
-
const parsedData = (0,
|
|
4046
|
+
const [isOpen, setIsOpen] = (0, import_react10.useState)(false);
|
|
4047
|
+
const parsedData = (0, import_react10.useMemo)(() => {
|
|
4043
4048
|
const payloadString = event.attributes?.payload;
|
|
4044
4049
|
if (!payloadString) {
|
|
4045
4050
|
return;
|
|
@@ -4057,12 +4062,12 @@ var IAMPermissionItem = ({ event }) => {
|
|
|
4057
4062
|
return null;
|
|
4058
4063
|
}
|
|
4059
4064
|
const { chipColors, parsedIAM } = parsedData;
|
|
4060
|
-
return /* @__PURE__ */ (0,
|
|
4061
|
-
/* @__PURE__ */ (0,
|
|
4062
|
-
/* @__PURE__ */ (0,
|
|
4065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_material12.Box, { sx: { mb: 1 }, children: [
|
|
4066
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_material12.Box, { sx: { alignItems: "center", display: "flex" }, children: [
|
|
4067
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material12.IconButton, { onClick: () => {
|
|
4063
4068
|
setIsOpen(!isOpen);
|
|
4064
|
-
}, size: "small", sx: { mr: 1, p: 0 }, children: isOpen ? /* @__PURE__ */ (0,
|
|
4065
|
-
/* @__PURE__ */ (0,
|
|
4069
|
+
}, size: "small", sx: { mr: 1, p: 0 }, children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material6.KeyboardArrowDown, {}) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material6.KeyboardArrowRight, {}) }),
|
|
4070
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
4066
4071
|
import_material12.Chip,
|
|
4067
4072
|
{
|
|
4068
4073
|
label: formatPermissionStatus(parsedIAM.permission),
|
|
@@ -4074,18 +4079,18 @@ var IAMPermissionItem = ({ event }) => {
|
|
|
4074
4079
|
}
|
|
4075
4080
|
)
|
|
4076
4081
|
] }),
|
|
4077
|
-
isOpen && /* @__PURE__ */ (0,
|
|
4078
|
-
/* @__PURE__ */ (0,
|
|
4079
|
-
/* @__PURE__ */ (0,
|
|
4082
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material12.Box, { sx: { ml: 4, mt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_material12.Box, { children: [
|
|
4083
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material12.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Principal" }),
|
|
4084
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material12.Typography, { variant: "body2", children: parsedIAM.principal })
|
|
4080
4085
|
] }) })
|
|
4081
4086
|
] });
|
|
4082
4087
|
};
|
|
4083
|
-
var IAMPermissionDetail = ({ events }) => /* @__PURE__ */ (0,
|
|
4088
|
+
var IAMPermissionDetail = ({ events }) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material12.Box, { sx: { mt: 2 }, children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(IAMPermissionItem, { event }, `${event.span_id}-${event.event_id}`)) });
|
|
4084
4089
|
|
|
4085
4090
|
// src/components/event-details/event-detail.tsx
|
|
4086
|
-
var
|
|
4087
|
-
var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0,
|
|
4088
|
-
/* @__PURE__ */ (0,
|
|
4091
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
4092
|
+
var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Grid, { container: true, spacing: 0, sx: { mb: 1 }, children: [
|
|
4093
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Grid, { item: true, sx: { pr: 1 }, xs: 3, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4089
4094
|
import_material13.Typography,
|
|
4090
4095
|
{
|
|
4091
4096
|
sx: {
|
|
@@ -4096,7 +4101,7 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime1
|
|
|
4096
4101
|
children: label
|
|
4097
4102
|
}
|
|
4098
4103
|
) }),
|
|
4099
|
-
/* @__PURE__ */ (0,
|
|
4104
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Grid, { item: true, xs: 9, children: typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4100
4105
|
import_material13.Typography,
|
|
4101
4106
|
{
|
|
4102
4107
|
sx: {
|
|
@@ -4109,15 +4114,15 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime1
|
|
|
4109
4114
|
) : content })
|
|
4110
4115
|
] });
|
|
4111
4116
|
var EventMessage = ({ event }) => {
|
|
4112
|
-
const [isOpen, setIsOpen] = (0,
|
|
4113
|
-
const [isOverflowing, setIsOverflowing] = (0,
|
|
4114
|
-
const textReference = (0,
|
|
4115
|
-
const parsedMessage = (0,
|
|
4116
|
-
const isIAMPolicyEvent = (0,
|
|
4117
|
+
const [isOpen, setIsOpen] = (0, import_react11.useState)(false);
|
|
4118
|
+
const [isOverflowing, setIsOverflowing] = (0, import_react11.useState)(false);
|
|
4119
|
+
const textReference = (0, import_react11.useRef)(null);
|
|
4120
|
+
const parsedMessage = (0, import_react11.useMemo)(() => parseEventMessage(event), [event]);
|
|
4121
|
+
const isIAMPolicyEvent = (0, import_react11.useMemo)(
|
|
4117
4122
|
() => event.event_type === "iam.policy_evaluation" && event.attributes?.payload && typeof event.attributes.payload === "string",
|
|
4118
|
-
[event
|
|
4123
|
+
[event]
|
|
4119
4124
|
);
|
|
4120
|
-
(0,
|
|
4125
|
+
(0, import_react11.useEffect)(() => {
|
|
4121
4126
|
const checkOverflow = () => {
|
|
4122
4127
|
const element = textReference.current;
|
|
4123
4128
|
if (element) {
|
|
@@ -4130,17 +4135,17 @@ var EventMessage = ({ event }) => {
|
|
|
4130
4135
|
window.removeEventListener("resize", checkOverflow);
|
|
4131
4136
|
};
|
|
4132
4137
|
}, [parsedMessage.headline]);
|
|
4133
|
-
const hasAdditionalContent = (0,
|
|
4138
|
+
const hasAdditionalContent = (0, import_react11.useMemo)(
|
|
4134
4139
|
() => parsedMessage.message || parsedMessage.details || isIAMPolicyEvent,
|
|
4135
4140
|
[parsedMessage.message, parsedMessage.details, isIAMPolicyEvent]
|
|
4136
4141
|
);
|
|
4137
|
-
const shouldShowToggle = (0,
|
|
4142
|
+
const shouldShowToggle = (0, import_react11.useMemo)(
|
|
4138
4143
|
() => isOverflowing || hasAdditionalContent,
|
|
4139
4144
|
[isOverflowing, hasAdditionalContent]
|
|
4140
4145
|
);
|
|
4141
|
-
return /* @__PURE__ */ (0,
|
|
4142
|
-
/* @__PURE__ */ (0,
|
|
4143
|
-
Boolean(shouldShowToggle) && /* @__PURE__ */ (0,
|
|
4146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Box, { sx: { display: "flex", flexDirection: "column" }, children: [
|
|
4147
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Box, { sx: { alignItems: "flex-start", display: "flex" }, children: [
|
|
4148
|
+
Boolean(shouldShowToggle) && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4144
4149
|
import_material13.IconButton,
|
|
4145
4150
|
{
|
|
4146
4151
|
onClick: () => {
|
|
@@ -4148,10 +4153,10 @@ var EventMessage = ({ event }) => {
|
|
|
4148
4153
|
},
|
|
4149
4154
|
size: "small",
|
|
4150
4155
|
sx: { mr: 1, mt: -0.5, p: 0 },
|
|
4151
|
-
children: isOpen ? /* @__PURE__ */ (0,
|
|
4156
|
+
children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_icons_material7.KeyboardArrowDown, {}) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_icons_material7.KeyboardArrowRight, {})
|
|
4152
4157
|
}
|
|
4153
4158
|
),
|
|
4154
|
-
/* @__PURE__ */ (0,
|
|
4159
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4155
4160
|
import_material13.Typography,
|
|
4156
4161
|
{
|
|
4157
4162
|
ref: textReference,
|
|
@@ -4169,9 +4174,9 @@ var EventMessage = ({ event }) => {
|
|
|
4169
4174
|
}
|
|
4170
4175
|
)
|
|
4171
4176
|
] }),
|
|
4172
|
-
isOpen && /* @__PURE__ */ (0,
|
|
4173
|
-
Boolean(parsedMessage.message) && /* @__PURE__ */ (0,
|
|
4174
|
-
Boolean(parsedMessage.details) && /* @__PURE__ */ (0,
|
|
4177
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Box, { sx: { ml: 4, mt: 1 }, children: isIAMPolicyEvent ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(IAMEventDetail, { event }) : /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
|
|
4178
|
+
Boolean(parsedMessage.message) && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(DetailRow2, { content: parsedMessage.message, label: "Message:" }),
|
|
4179
|
+
Boolean(parsedMessage.details) && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(DetailRow2, { content: parsedMessage.details, label: "Details:" })
|
|
4175
4180
|
] }) })
|
|
4176
4181
|
] });
|
|
4177
4182
|
};
|
|
@@ -4200,8 +4205,8 @@ var EventDetail = ({
|
|
|
4200
4205
|
type
|
|
4201
4206
|
}) => {
|
|
4202
4207
|
if (type === "permission") {
|
|
4203
|
-
return /* @__PURE__ */ (0,
|
|
4204
|
-
/* @__PURE__ */ (0,
|
|
4208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Box, { children: [
|
|
4209
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4205
4210
|
import_material13.Box,
|
|
4206
4211
|
{
|
|
4207
4212
|
sx: {
|
|
@@ -4209,7 +4214,7 @@ var EventDetail = ({
|
|
|
4209
4214
|
display: "flex",
|
|
4210
4215
|
mb: 1
|
|
4211
4216
|
},
|
|
4212
|
-
children: /* @__PURE__ */ (0,
|
|
4217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4213
4218
|
import_material13.Typography,
|
|
4214
4219
|
{
|
|
4215
4220
|
sx: {
|
|
@@ -4224,12 +4229,12 @@ var EventDetail = ({
|
|
|
4224
4229
|
)
|
|
4225
4230
|
}
|
|
4226
4231
|
),
|
|
4227
|
-
/* @__PURE__ */ (0,
|
|
4232
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(IAMPermissionDetail, { events })
|
|
4228
4233
|
] });
|
|
4229
4234
|
}
|
|
4230
4235
|
const eventLevel = getEventLevelFromGroup(type);
|
|
4231
|
-
return /* @__PURE__ */ (0,
|
|
4232
|
-
/* @__PURE__ */ (0,
|
|
4236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Box, { children: [
|
|
4237
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
4233
4238
|
import_material13.Box,
|
|
4234
4239
|
{
|
|
4235
4240
|
sx: {
|
|
@@ -4239,8 +4244,8 @@ var EventDetail = ({
|
|
|
4239
4244
|
mb: 1
|
|
4240
4245
|
},
|
|
4241
4246
|
children: [
|
|
4242
|
-
/* @__PURE__ */ (0,
|
|
4243
|
-
/* @__PURE__ */ (0,
|
|
4247
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(StatusIcon, { errorLevel: eventLevel }),
|
|
4248
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4244
4249
|
import_material13.Typography,
|
|
4245
4250
|
{
|
|
4246
4251
|
sx: {
|
|
@@ -4259,14 +4264,14 @@ var EventDetail = ({
|
|
|
4259
4264
|
]
|
|
4260
4265
|
}
|
|
4261
4266
|
),
|
|
4262
|
-
/* @__PURE__ */ (0,
|
|
4267
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Box, { sx: { mt: 2 }, children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4263
4268
|
import_material13.Box,
|
|
4264
4269
|
{
|
|
4265
4270
|
sx: {
|
|
4266
4271
|
maxWidth: "100%",
|
|
4267
4272
|
mb: 1
|
|
4268
4273
|
},
|
|
4269
|
-
children: /* @__PURE__ */ (0,
|
|
4274
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(EventMessage, { event })
|
|
4270
4275
|
},
|
|
4271
4276
|
`${event.span_id}-${event.event_id}`
|
|
4272
4277
|
)) })
|
|
@@ -4276,12 +4281,12 @@ var EventDetail = ({
|
|
|
4276
4281
|
// src/components/event-details/toggle-section.tsx
|
|
4277
4282
|
var import_icons_material8 = require("@mui/icons-material");
|
|
4278
4283
|
var import_material14 = require("@mui/material");
|
|
4279
|
-
var
|
|
4280
|
-
var
|
|
4284
|
+
var import_react12 = require("react");
|
|
4285
|
+
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
4281
4286
|
var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
4282
|
-
const [isOpen, setIsOpen] = (0,
|
|
4283
|
-
return /* @__PURE__ */ (0,
|
|
4284
|
-
/* @__PURE__ */ (0,
|
|
4287
|
+
const [isOpen, setIsOpen] = (0, import_react12.useState)(initialOpen);
|
|
4288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material14.Box, { sx: { mt: 4 }, children: [
|
|
4289
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
4285
4290
|
import_material14.Box,
|
|
4286
4291
|
{
|
|
4287
4292
|
onClick: () => {
|
|
@@ -4291,7 +4296,7 @@ var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
|
4291
4296
|
cursor: "pointer",
|
|
4292
4297
|
mb: 1
|
|
4293
4298
|
},
|
|
4294
|
-
children: /* @__PURE__ */ (0,
|
|
4299
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
4295
4300
|
import_material14.Box,
|
|
4296
4301
|
{
|
|
4297
4302
|
role: "button",
|
|
@@ -4301,24 +4306,24 @@ var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
|
4301
4306
|
gap: 1
|
|
4302
4307
|
},
|
|
4303
4308
|
children: [
|
|
4304
|
-
/* @__PURE__ */ (0,
|
|
4305
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
4309
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material14.Typography, { sx: { fontWeight: 600 }, variant: "subtitle2", children: headline }),
|
|
4310
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_icons_material8.KeyboardArrowDown, { sx: { color: "text.secondary", height: 20, width: 20 } }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_icons_material8.KeyboardArrowRight, { sx: { color: "text.secondary", height: 20, width: 20 } })
|
|
4306
4311
|
]
|
|
4307
4312
|
}
|
|
4308
4313
|
)
|
|
4309
4314
|
}
|
|
4310
4315
|
),
|
|
4311
|
-
isOpen && /* @__PURE__ */ (0,
|
|
4316
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material14.Box, { children })
|
|
4312
4317
|
] });
|
|
4313
4318
|
};
|
|
4314
4319
|
|
|
4315
4320
|
// src/components/event-details/event-section.tsx
|
|
4316
|
-
var
|
|
4321
|
+
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
4317
4322
|
var EventSection = ({
|
|
4318
4323
|
eventGroups,
|
|
4319
4324
|
headline
|
|
4320
|
-
}) => /* @__PURE__ */ (0,
|
|
4321
|
-
eventGroups.errors && /* @__PURE__ */ (0,
|
|
4325
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ToggleSection, { headline, children: /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.Box, { children: [
|
|
4326
|
+
eventGroups.errors && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
4322
4327
|
EventDetail,
|
|
4323
4328
|
{
|
|
4324
4329
|
displayText: "Error",
|
|
@@ -4326,7 +4331,7 @@ var EventSection = ({
|
|
|
4326
4331
|
type: "error"
|
|
4327
4332
|
}
|
|
4328
4333
|
),
|
|
4329
|
-
eventGroups.warnings && /* @__PURE__ */ (0,
|
|
4334
|
+
eventGroups.warnings && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
4330
4335
|
EventDetail,
|
|
4331
4336
|
{
|
|
4332
4337
|
displayText: "Warning",
|
|
@@ -4334,7 +4339,7 @@ var EventSection = ({
|
|
|
4334
4339
|
type: "warning"
|
|
4335
4340
|
}
|
|
4336
4341
|
),
|
|
4337
|
-
eventGroups.permissions && /* @__PURE__ */ (0,
|
|
4342
|
+
eventGroups.permissions && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
4338
4343
|
EventDetail,
|
|
4339
4344
|
{
|
|
4340
4345
|
displayText: "IAM Permission",
|
|
@@ -4342,7 +4347,7 @@ var EventSection = ({
|
|
|
4342
4347
|
type: "permission"
|
|
4343
4348
|
}
|
|
4344
4349
|
),
|
|
4345
|
-
eventGroups.info && /* @__PURE__ */ (0,
|
|
4350
|
+
eventGroups.info && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
4346
4351
|
EventDetail,
|
|
4347
4352
|
{
|
|
4348
4353
|
displayText: "Info",
|
|
@@ -4353,65 +4358,65 @@ var EventSection = ({
|
|
|
4353
4358
|
] }) });
|
|
4354
4359
|
|
|
4355
4360
|
// src/components/event-details/event-details.tsx
|
|
4356
|
-
var
|
|
4361
|
+
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
4357
4362
|
var EventDetails = ({ onClose, selectedEvent }) => {
|
|
4358
|
-
const attributes = (0,
|
|
4363
|
+
const attributes = (0, import_react13.useMemo)(() => {
|
|
4359
4364
|
const attributes2 = Object.entries(selectedEvent?.attributes ?? {});
|
|
4360
4365
|
return attributes2.filter(([key]) => key !== "localstack.aws.account_id" && key !== "localstack.aws.service");
|
|
4361
4366
|
}, [selectedEvent?.attributes]);
|
|
4362
4367
|
if (!selectedEvent) {
|
|
4363
|
-
return /* @__PURE__ */ (0,
|
|
4368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Box, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { color: "text.secondary", variant: "body2", children: "Select an event to view details" }) });
|
|
4364
4369
|
}
|
|
4365
|
-
return /* @__PURE__ */ (0,
|
|
4366
|
-
/* @__PURE__ */ (0,
|
|
4367
|
-
/* @__PURE__ */ (0,
|
|
4368
|
-
/* @__PURE__ */ (0,
|
|
4369
|
-
/* @__PURE__ */ (0,
|
|
4370
|
-
/* @__PURE__ */ (0,
|
|
4371
|
-
/* @__PURE__ */ (0,
|
|
4370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Box, { "data-testid": "event-details", sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
4371
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(EventDetailsHeader, { event: selectedEvent, onClose }),
|
|
4372
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Box, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Stack, { spacing: 2, children: [
|
|
4373
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Stack, { spacing: 1, children: [
|
|
4374
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Box, { children: [
|
|
4375
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Span ID" }),
|
|
4376
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.span_id })
|
|
4372
4377
|
] }),
|
|
4373
|
-
/* @__PURE__ */ (0,
|
|
4374
|
-
/* @__PURE__ */ (0,
|
|
4375
|
-
/* @__PURE__ */ (0,
|
|
4378
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Box, { children: [
|
|
4379
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Trace ID" }),
|
|
4380
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.trace_id })
|
|
4376
4381
|
] }),
|
|
4377
|
-
/* @__PURE__ */ (0,
|
|
4378
|
-
/* @__PURE__ */ (0,
|
|
4379
|
-
/* @__PURE__ */ (0,
|
|
4382
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Box, { children: [
|
|
4383
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Operation" }),
|
|
4384
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.operation_name })
|
|
4380
4385
|
] })
|
|
4381
4386
|
] }) }),
|
|
4382
|
-
/* @__PURE__ */ (0,
|
|
4383
|
-
/* @__PURE__ */ (0,
|
|
4384
|
-
/* @__PURE__ */ (0,
|
|
4385
|
-
/* @__PURE__ */ (0,
|
|
4386
|
-
/* @__PURE__ */ (0,
|
|
4387
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Divider, {}),
|
|
4388
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ToggleSection, { headline: "Service Information", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Stack, { spacing: 1, children: [
|
|
4389
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Box, { children: [
|
|
4390
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Service" }),
|
|
4391
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.service_name })
|
|
4387
4392
|
] }),
|
|
4388
|
-
/* @__PURE__ */ (0,
|
|
4389
|
-
/* @__PURE__ */ (0,
|
|
4390
|
-
/* @__PURE__ */ (0,
|
|
4393
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Box, { children: [
|
|
4394
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource" }),
|
|
4395
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.resource_name })
|
|
4391
4396
|
] }),
|
|
4392
|
-
Boolean(selectedEvent.region) && /* @__PURE__ */ (0,
|
|
4393
|
-
/* @__PURE__ */ (0,
|
|
4394
|
-
/* @__PURE__ */ (0,
|
|
4397
|
+
Boolean(selectedEvent.region) && /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Box, { children: [
|
|
4398
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Region" }),
|
|
4399
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.region })
|
|
4395
4400
|
] })
|
|
4396
4401
|
] }) }),
|
|
4397
|
-
/* @__PURE__ */ (0,
|
|
4398
|
-
/* @__PURE__ */ (0,
|
|
4399
|
-
/* @__PURE__ */ (0,
|
|
4400
|
-
/* @__PURE__ */ (0,
|
|
4401
|
-
/* @__PURE__ */ (0,
|
|
4402
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Divider, {}),
|
|
4403
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ToggleSection, { headline: "Timing", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Stack, { spacing: 1, children: [
|
|
4404
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Box, { children: [
|
|
4405
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Start Time" }),
|
|
4406
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
|
|
4402
4407
|
] }),
|
|
4403
|
-
Boolean(selectedEvent.end_time_unix_nano) && /* @__PURE__ */ (0,
|
|
4404
|
-
/* @__PURE__ */ (0,
|
|
4405
|
-
/* @__PURE__ */ (0,
|
|
4408
|
+
Boolean(selectedEvent.end_time_unix_nano) && /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Box, { children: [
|
|
4409
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Duration" }),
|
|
4410
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Typography, { variant: "body2", children: [
|
|
4406
4411
|
((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString(),
|
|
4407
4412
|
" ",
|
|
4408
4413
|
"ms"
|
|
4409
4414
|
] })
|
|
4410
4415
|
] })
|
|
4411
4416
|
] }) }),
|
|
4412
|
-
/* @__PURE__ */ (0,
|
|
4413
|
-
/* @__PURE__ */ (0,
|
|
4414
|
-
/* @__PURE__ */ (0,
|
|
4417
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Divider, {}),
|
|
4418
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ToggleSection, { headline: "Status", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Stack, { direction: "row", spacing: 1, children: [
|
|
4419
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
4415
4420
|
import_material16.Chip,
|
|
4416
4421
|
{
|
|
4417
4422
|
color: selectedEvent.status_code === 2 ? "error" : selectedEvent.status_code === 1 ? "success" : "default",
|
|
@@ -4419,11 +4424,11 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
4419
4424
|
size: "small"
|
|
4420
4425
|
}
|
|
4421
4426
|
),
|
|
4422
|
-
Boolean(selectedEvent.status_message) && /* @__PURE__ */ (0,
|
|
4427
|
+
Boolean(selectedEvent.status_message) && /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.status_message })
|
|
4423
4428
|
] }) }),
|
|
4424
|
-
selectedEvent.events.length > 0 && /* @__PURE__ */ (0,
|
|
4425
|
-
/* @__PURE__ */ (0,
|
|
4426
|
-
/* @__PURE__ */ (0,
|
|
4429
|
+
selectedEvent.events.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_jsx_runtime138.Fragment, { children: [
|
|
4430
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Divider, {}),
|
|
4431
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
4427
4432
|
EventSection,
|
|
4428
4433
|
{
|
|
4429
4434
|
eventGroups: getEventGroupsByType(selectedEvent.events),
|
|
@@ -4431,11 +4436,11 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
4431
4436
|
}
|
|
4432
4437
|
)
|
|
4433
4438
|
] }),
|
|
4434
|
-
attributes.length > 0 && /* @__PURE__ */ (0,
|
|
4435
|
-
/* @__PURE__ */ (0,
|
|
4436
|
-
/* @__PURE__ */ (0,
|
|
4437
|
-
/* @__PURE__ */ (0,
|
|
4438
|
-
/* @__PURE__ */ (0,
|
|
4439
|
+
attributes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_jsx_runtime138.Fragment, { children: [
|
|
4440
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Divider, {}),
|
|
4441
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ToggleSection, { headline: "Attributes", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Stack, { spacing: 1, children: attributes.map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Box, { children: [
|
|
4442
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: key }),
|
|
4443
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: renderKeyValue(key, value) })
|
|
4439
4444
|
] }, key)) }) })
|
|
4440
4445
|
] })
|
|
4441
4446
|
] }) })
|
|
@@ -4443,46 +4448,46 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
4443
4448
|
};
|
|
4444
4449
|
function renderKeyValue(key, value) {
|
|
4445
4450
|
if (typeof value === "string" && (key === "localstack.aws.service.request" || key === "localstack.aws.service.response" || key === "localstack.aws.service.exception")) {
|
|
4446
|
-
return /* @__PURE__ */ (0,
|
|
4451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Box, { sx: { backgroundColor: (theme) => theme.palette.background.default, borderRadius: 1, p: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("pre", { style: { margin: 0, overflow: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: JSON.stringify(JSON.parse(value), void 0, 2) }) }) });
|
|
4447
4452
|
}
|
|
4448
4453
|
if (typeof value === "boolean") {
|
|
4449
|
-
return /* @__PURE__ */ (0,
|
|
4454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: value ? "yes" : "no" });
|
|
4450
4455
|
}
|
|
4451
|
-
return /* @__PURE__ */ (0,
|
|
4456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Typography, { variant: "body2", children: value });
|
|
4452
4457
|
}
|
|
4453
4458
|
|
|
4454
4459
|
// src/components/trace-graph/trace-graph.tsx
|
|
4455
4460
|
var import_base = require("@xyflow/react/dist/base.css");
|
|
4456
4461
|
var import_material20 = require("@mui/material");
|
|
4457
|
-
var
|
|
4458
|
-
var
|
|
4462
|
+
var import_react20 = require("@xyflow/react");
|
|
4463
|
+
var import_react21 = require("react");
|
|
4459
4464
|
|
|
4460
4465
|
// src/components/trace-graph/service-node.tsx
|
|
4461
4466
|
var import_material18 = require("@mui/material");
|
|
4462
4467
|
var import_style = require("@xyflow/react/dist/style.css");
|
|
4463
|
-
var
|
|
4464
|
-
var
|
|
4468
|
+
var import_react15 = require("@xyflow/react");
|
|
4469
|
+
var import_react16 = require("react");
|
|
4465
4470
|
|
|
4466
4471
|
// src/components/trace-graph/problem-indicator.tsx
|
|
4467
4472
|
var import_icons_material9 = require("@mui/icons-material");
|
|
4468
4473
|
var import_material17 = require("@mui/material");
|
|
4469
|
-
var
|
|
4470
|
-
var
|
|
4474
|
+
var import_react14 = require("react");
|
|
4475
|
+
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
4471
4476
|
var ProblemIndicator = ({ error }) => {
|
|
4472
|
-
const icon = (0,
|
|
4477
|
+
const icon = (0, import_react14.useMemo)(() => {
|
|
4473
4478
|
switch (error.level) {
|
|
4474
4479
|
case "error": {
|
|
4475
|
-
return /* @__PURE__ */ (0,
|
|
4480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_icons_material9.Error, { sx: { color: "#d32f2f", fontSize: "14px" } });
|
|
4476
4481
|
}
|
|
4477
4482
|
case "warning": {
|
|
4478
|
-
return /* @__PURE__ */ (0,
|
|
4483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_icons_material9.Warning, { sx: { color: "#ff9800", fontSize: "14px" } });
|
|
4479
4484
|
}
|
|
4480
4485
|
default: {
|
|
4481
|
-
return /* @__PURE__ */ (0,
|
|
4486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_icons_material9.Info, { sx: { color: "#2196f3", fontSize: "14px" } });
|
|
4482
4487
|
}
|
|
4483
4488
|
}
|
|
4484
4489
|
}, [error.level]);
|
|
4485
|
-
const color = (0,
|
|
4490
|
+
const color = (0, import_react14.useMemo)(() => {
|
|
4486
4491
|
switch (error.level) {
|
|
4487
4492
|
case "error": {
|
|
4488
4493
|
return "#d32f2f";
|
|
@@ -4495,7 +4500,7 @@ var ProblemIndicator = ({ error }) => {
|
|
|
4495
4500
|
}
|
|
4496
4501
|
}
|
|
4497
4502
|
}, [error.level]);
|
|
4498
|
-
return /* @__PURE__ */ (0,
|
|
4503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_material17.Tooltip, { arrow: true, title: error.message ?? "Issue detected", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
4499
4504
|
import_material17.Box,
|
|
4500
4505
|
{
|
|
4501
4506
|
sx: {
|
|
@@ -4515,17 +4520,17 @@ var ProblemIndicator = ({ error }) => {
|
|
|
4515
4520
|
};
|
|
4516
4521
|
|
|
4517
4522
|
// src/components/trace-graph/service-node.tsx
|
|
4518
|
-
var
|
|
4523
|
+
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
4519
4524
|
var handleStyle = {
|
|
4520
4525
|
backgroundColor: "white",
|
|
4521
4526
|
borderColor: "lightgray",
|
|
4522
4527
|
opacity: 0
|
|
4523
4528
|
};
|
|
4524
|
-
var ServiceNode = (0,
|
|
4525
|
-
const handleClick = (0,
|
|
4529
|
+
var ServiceNode = (0, import_react16.memo)(function ServiceNode2({ data, selected }) {
|
|
4530
|
+
const handleClick = (0, import_react16.useCallback)(() => {
|
|
4526
4531
|
data.onEventSelect(data.event);
|
|
4527
4532
|
}, [data]);
|
|
4528
|
-
const handleKeyPress = (0,
|
|
4533
|
+
const handleKeyPress = (0, import_react16.useCallback)(
|
|
4529
4534
|
(event) => {
|
|
4530
4535
|
if (event.key === "Enter" || event.key === " ") {
|
|
4531
4536
|
handleClick();
|
|
@@ -4534,8 +4539,8 @@ var ServiceNode = (0, import_react15.memo)(function ServiceNode2({ data, selecte
|
|
|
4534
4539
|
[handleClick]
|
|
4535
4540
|
);
|
|
4536
4541
|
const hasErrors = (data.event.errors && data.event.errors.length > 0) ?? false;
|
|
4537
|
-
return /* @__PURE__ */ (0,
|
|
4538
|
-
/* @__PURE__ */ (0,
|
|
4542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_material18.Box, { sx: { maxWidth: 200 }, children: [
|
|
4543
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
|
|
4539
4544
|
import_material18.Box,
|
|
4540
4545
|
{
|
|
4541
4546
|
onClick: handleClick,
|
|
@@ -4558,9 +4563,9 @@ var ServiceNode = (0, import_react15.memo)(function ServiceNode2({ data, selecte
|
|
|
4558
4563
|
},
|
|
4559
4564
|
tabIndex: 0,
|
|
4560
4565
|
children: [
|
|
4561
|
-
/* @__PURE__ */ (0,
|
|
4562
|
-
/* @__PURE__ */ (0,
|
|
4563
|
-
/* @__PURE__ */ (0,
|
|
4566
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_react15.Handle, { position: import_react15.Position.Left, style: handleStyle, type: "target" }),
|
|
4567
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_react15.Handle, { position: import_react15.Position.Right, style: handleStyle, type: "source" }),
|
|
4568
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
4564
4569
|
ServiceCell,
|
|
4565
4570
|
{
|
|
4566
4571
|
borderColor: selected ? "text.primary" : void 0,
|
|
@@ -4574,7 +4579,7 @@ var ServiceNode = (0, import_react15.memo)(function ServiceNode2({ data, selecte
|
|
|
4574
4579
|
]
|
|
4575
4580
|
}
|
|
4576
4581
|
),
|
|
4577
|
-
/* @__PURE__ */ (0,
|
|
4582
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
|
|
4578
4583
|
import_material18.Stack,
|
|
4579
4584
|
{
|
|
4580
4585
|
alignItems: "center",
|
|
@@ -4585,7 +4590,7 @@ var ServiceNode = (0, import_react15.memo)(function ServiceNode2({ data, selecte
|
|
|
4585
4590
|
mt: 0.5
|
|
4586
4591
|
},
|
|
4587
4592
|
children: [
|
|
4588
|
-
hasErrors && /* @__PURE__ */ (0,
|
|
4593
|
+
hasErrors && /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
4589
4594
|
import_material18.Stack,
|
|
4590
4595
|
{
|
|
4591
4596
|
direction: "row",
|
|
@@ -4594,10 +4599,10 @@ var ServiceNode = (0, import_react15.memo)(function ServiceNode2({ data, selecte
|
|
|
4594
4599
|
flexWrap: "wrap",
|
|
4595
4600
|
gap: "2px"
|
|
4596
4601
|
},
|
|
4597
|
-
children: data.event.errors?.map((error) => /* @__PURE__ */ (0,
|
|
4602
|
+
children: data.event.errors?.map((error) => /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(ProblemIndicator, { error }, error.span_id))
|
|
4598
4603
|
}
|
|
4599
4604
|
),
|
|
4600
|
-
/* @__PURE__ */ (0,
|
|
4605
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
4601
4606
|
import_material18.Typography,
|
|
4602
4607
|
{
|
|
4603
4608
|
sx: {
|
|
@@ -4620,7 +4625,7 @@ var ServiceNode = (0, import_react15.memo)(function ServiceNode2({ data, selecte
|
|
|
4620
4625
|
|
|
4621
4626
|
// src/components/trace-graph/utils.ts
|
|
4622
4627
|
var import_dagre = __toESM(require("@dagrejs/dagre"), 1);
|
|
4623
|
-
var
|
|
4628
|
+
var import_react17 = require("@xyflow/react");
|
|
4624
4629
|
var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
4625
4630
|
const nodes = [];
|
|
4626
4631
|
const edges = [];
|
|
@@ -4637,8 +4642,8 @@ var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
|
4637
4642
|
id: event.span_id,
|
|
4638
4643
|
position: { x: 0, y: 0 },
|
|
4639
4644
|
// Will be set by layout
|
|
4640
|
-
sourcePosition:
|
|
4641
|
-
targetPosition:
|
|
4645
|
+
sourcePosition: import_react17.Position.Right,
|
|
4646
|
+
targetPosition: import_react17.Position.Left,
|
|
4642
4647
|
type: "service"
|
|
4643
4648
|
});
|
|
4644
4649
|
if (parentId) {
|
|
@@ -4648,7 +4653,7 @@ var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
|
4648
4653
|
markerEnd: {
|
|
4649
4654
|
color: "lightgray",
|
|
4650
4655
|
height: 16,
|
|
4651
|
-
type:
|
|
4656
|
+
type: import_react17.MarkerType.Arrow,
|
|
4652
4657
|
width: 16
|
|
4653
4658
|
},
|
|
4654
4659
|
source: parentId,
|
|
@@ -4713,8 +4718,8 @@ var calculateCenterX = (focusNodeX, viewPortPixelWidth, minX, maxX) => {
|
|
|
4713
4718
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
4714
4719
|
var import_icons_material10 = require("@mui/icons-material");
|
|
4715
4720
|
var import_material19 = require("@mui/material");
|
|
4716
|
-
var
|
|
4717
|
-
var
|
|
4721
|
+
var import_react18 = require("@xyflow/react");
|
|
4722
|
+
var import_react19 = require("react");
|
|
4718
4723
|
|
|
4719
4724
|
// node_modules/zustand/esm/shallow.mjs
|
|
4720
4725
|
function shallow$1(objA, objB) {
|
|
@@ -4755,15 +4760,15 @@ function shallow$1(objA, objB) {
|
|
|
4755
4760
|
}
|
|
4756
4761
|
|
|
4757
4762
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
4758
|
-
var
|
|
4763
|
+
var import_jsx_runtime141 = require("react/jsx-runtime");
|
|
4759
4764
|
var selector = (s) => ({
|
|
4760
4765
|
isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,
|
|
4761
4766
|
maxZoomReached: s.transform[2] >= s.maxZoom,
|
|
4762
4767
|
minZoomReached: s.transform[2] <= s.minZoom
|
|
4763
4768
|
});
|
|
4764
|
-
var Controls = (0,
|
|
4765
|
-
const { maxZoomReached, minZoomReached } = (0,
|
|
4766
|
-
const { fitView, zoomIn, zoomOut } = (0,
|
|
4769
|
+
var Controls = (0, import_react19.memo)(() => {
|
|
4770
|
+
const { maxZoomReached, minZoomReached } = (0, import_react18.useStore)(selector, shallow$1);
|
|
4771
|
+
const { fitView, zoomIn, zoomOut } = (0, import_react18.useReactFlow)();
|
|
4767
4772
|
const onZoomInHandler = () => {
|
|
4768
4773
|
void zoomIn();
|
|
4769
4774
|
};
|
|
@@ -4773,7 +4778,7 @@ var Controls = (0, import_react18.memo)(() => {
|
|
|
4773
4778
|
const onFitViewHandler = () => {
|
|
4774
4779
|
void fitView();
|
|
4775
4780
|
};
|
|
4776
|
-
return /* @__PURE__ */ (0,
|
|
4781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
4777
4782
|
import_material19.Box,
|
|
4778
4783
|
{
|
|
4779
4784
|
sx: {
|
|
@@ -4787,33 +4792,33 @@ var Controls = (0, import_react18.memo)(() => {
|
|
|
4787
4792
|
zIndex: 5
|
|
4788
4793
|
},
|
|
4789
4794
|
children: [
|
|
4790
|
-
/* @__PURE__ */ (0,
|
|
4795
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
4791
4796
|
import_material19.IconButton,
|
|
4792
4797
|
{
|
|
4793
4798
|
className: "react-flow__controls-zoomin",
|
|
4794
4799
|
disabled: maxZoomReached,
|
|
4795
4800
|
onClick: onZoomInHandler,
|
|
4796
4801
|
size: "small",
|
|
4797
|
-
children: /* @__PURE__ */ (0,
|
|
4802
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_icons_material10.Add, {})
|
|
4798
4803
|
}
|
|
4799
4804
|
),
|
|
4800
|
-
/* @__PURE__ */ (0,
|
|
4805
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
4801
4806
|
import_material19.IconButton,
|
|
4802
4807
|
{
|
|
4803
4808
|
className: "react-flow__controls-zoomout",
|
|
4804
4809
|
disabled: minZoomReached,
|
|
4805
4810
|
onClick: onZoomOutHandler,
|
|
4806
4811
|
size: "small",
|
|
4807
|
-
children: /* @__PURE__ */ (0,
|
|
4812
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_icons_material10.Remove, {})
|
|
4808
4813
|
}
|
|
4809
4814
|
),
|
|
4810
|
-
/* @__PURE__ */ (0,
|
|
4815
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
4811
4816
|
import_material19.IconButton,
|
|
4812
4817
|
{
|
|
4813
4818
|
className: "react-flow__controls-fitview",
|
|
4814
4819
|
onClick: onFitViewHandler,
|
|
4815
4820
|
size: "small",
|
|
4816
|
-
children: /* @__PURE__ */ (0,
|
|
4821
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_icons_material10.FitScreen, {})
|
|
4817
4822
|
}
|
|
4818
4823
|
)
|
|
4819
4824
|
]
|
|
@@ -4822,7 +4827,7 @@ var Controls = (0, import_react18.memo)(() => {
|
|
|
4822
4827
|
});
|
|
4823
4828
|
|
|
4824
4829
|
// src/components/trace-graph/trace-graph.tsx
|
|
4825
|
-
var
|
|
4830
|
+
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
4826
4831
|
var nodeTypes = {
|
|
4827
4832
|
service: ServiceNode
|
|
4828
4833
|
};
|
|
@@ -4833,12 +4838,12 @@ var TraceGraph = ({
|
|
|
4833
4838
|
spans,
|
|
4834
4839
|
viewPortPixelWidth
|
|
4835
4840
|
}) => {
|
|
4836
|
-
const [nodes, setNodes] = (0,
|
|
4837
|
-
const [edges, setEdges] = (0,
|
|
4838
|
-
const [initialViewSet, setInitialViewSet] = (0,
|
|
4839
|
-
const { fitView, setCenter } = (0,
|
|
4840
|
-
const store = (0,
|
|
4841
|
-
const updateSelectedNode = (0,
|
|
4841
|
+
const [nodes, setNodes] = (0, import_react21.useState)([]);
|
|
4842
|
+
const [edges, setEdges] = (0, import_react21.useState)([]);
|
|
4843
|
+
const [initialViewSet, setInitialViewSet] = (0, import_react21.useState)(false);
|
|
4844
|
+
const { fitView, setCenter } = (0, import_react20.useReactFlow)();
|
|
4845
|
+
const store = (0, import_react20.useStoreApi)();
|
|
4846
|
+
const updateSelectedNode = (0, import_react21.useCallback)(
|
|
4842
4847
|
(nodeId) => {
|
|
4843
4848
|
const { addSelectedNodes } = store.getState();
|
|
4844
4849
|
if (nodeId) {
|
|
@@ -4850,7 +4855,7 @@ var TraceGraph = ({
|
|
|
4850
4855
|
},
|
|
4851
4856
|
[nodes, store]
|
|
4852
4857
|
);
|
|
4853
|
-
(0,
|
|
4858
|
+
(0, import_react21.useEffect)(() => {
|
|
4854
4859
|
const spansMap = /* @__PURE__ */ new Map();
|
|
4855
4860
|
const rootSpans = [];
|
|
4856
4861
|
for (const span of spans.data ?? []) {
|
|
@@ -4882,7 +4887,7 @@ var TraceGraph = ({
|
|
|
4882
4887
|
setNodes(layoutedNodes);
|
|
4883
4888
|
setEdges(layoutedEdges);
|
|
4884
4889
|
}, [onEventSelect, spans.data]);
|
|
4885
|
-
(0,
|
|
4890
|
+
(0, import_react21.useEffect)(() => {
|
|
4886
4891
|
const shouldSetInitialView = !spans.loading && nodes.length > 0 && !initialViewSet;
|
|
4887
4892
|
if (shouldSetInitialView) {
|
|
4888
4893
|
if (initialFocusEventId) {
|
|
@@ -4902,20 +4907,20 @@ var TraceGraph = ({
|
|
|
4902
4907
|
setInitialViewSet(true);
|
|
4903
4908
|
}
|
|
4904
4909
|
}, [spans.loading, nodes, initialFocusEventId, viewPortPixelWidth, setCenter, fitView, onEventSelect, initialViewSet]);
|
|
4905
|
-
(0,
|
|
4910
|
+
(0, import_react21.useEffect)(() => {
|
|
4906
4911
|
if (initialFocusEventId) {
|
|
4907
4912
|
updateSelectedNode(initialFocusEventId);
|
|
4908
4913
|
}
|
|
4909
4914
|
}, [initialFocusEventId, updateSelectedNode]);
|
|
4910
|
-
const onNodeClick = (0,
|
|
4915
|
+
const onNodeClick = (0, import_react21.useCallback)((_event, node) => {
|
|
4911
4916
|
onEventSelect(node.data.event);
|
|
4912
4917
|
updateSelectedNode(node.id);
|
|
4913
4918
|
}, [onEventSelect, updateSelectedNode]);
|
|
4914
|
-
return /* @__PURE__ */ (0,
|
|
4915
|
-
spans.error && /* @__PURE__ */ (0,
|
|
4919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_jsx_runtime142.Fragment, { children: [
|
|
4920
|
+
spans.error && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
4916
4921
|
import_material20.Alert,
|
|
4917
4922
|
{
|
|
4918
|
-
action: /* @__PURE__ */ (0,
|
|
4923
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Button, { onClick: () => {
|
|
4919
4924
|
onRefresh();
|
|
4920
4925
|
}, children: "Retry" }),
|
|
4921
4926
|
severity: "error",
|
|
@@ -4926,8 +4931,8 @@ var TraceGraph = ({
|
|
|
4926
4931
|
]
|
|
4927
4932
|
}
|
|
4928
4933
|
),
|
|
4929
|
-
/* @__PURE__ */ (0,
|
|
4930
|
-
|
|
4934
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
4935
|
+
import_react20.ReactFlow,
|
|
4931
4936
|
{
|
|
4932
4937
|
"data-testid": "trace-graph",
|
|
4933
4938
|
defaultViewport: { x: 0, y: 0, zoom: 1 },
|
|
@@ -4940,8 +4945,8 @@ var TraceGraph = ({
|
|
|
4940
4945
|
onNodeClick,
|
|
4941
4946
|
selectNodesOnDrag: false,
|
|
4942
4947
|
children: [
|
|
4943
|
-
/* @__PURE__ */ (0,
|
|
4944
|
-
/* @__PURE__ */ (0,
|
|
4948
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(Controls, {}),
|
|
4949
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_react20.Background, {})
|
|
4945
4950
|
]
|
|
4946
4951
|
}
|
|
4947
4952
|
)
|
|
@@ -4949,7 +4954,7 @@ var TraceGraph = ({
|
|
|
4949
4954
|
};
|
|
4950
4955
|
|
|
4951
4956
|
// src/pages/trace-graph-page.tsx
|
|
4952
|
-
var
|
|
4957
|
+
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
4953
4958
|
var HEADER_HEIGHT = 56;
|
|
4954
4959
|
var DRAWER_WIDTH = "35%";
|
|
4955
4960
|
var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
|
|
@@ -4998,7 +5003,7 @@ var TraceGraphView = ({
|
|
|
4998
5003
|
viewPortPixelWidth
|
|
4999
5004
|
}) => {
|
|
5000
5005
|
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
5001
|
-
return /* @__PURE__ */ (0,
|
|
5006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
|
|
5002
5007
|
import_material21.Box,
|
|
5003
5008
|
{
|
|
5004
5009
|
"data-testid": "trace-graph-page",
|
|
@@ -5011,13 +5016,13 @@ var TraceGraphView = ({
|
|
|
5011
5016
|
overflow: "hidden"
|
|
5012
5017
|
},
|
|
5013
5018
|
children: [
|
|
5014
|
-
/* @__PURE__ */ (0,
|
|
5015
|
-
/* @__PURE__ */ (0,
|
|
5019
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_material21.Box, { sx: { display: "flex", width: "100%" }, children: [
|
|
5020
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_material21.Button, { onClick: () => {
|
|
5016
5021
|
navigateToSpansList();
|
|
5017
|
-
}, startIcon: /* @__PURE__ */ (0,
|
|
5018
|
-
/* @__PURE__ */ (0,
|
|
5022
|
+
}, startIcon: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_icons_material11.ArrowBack, {}), children: "Go back" }),
|
|
5023
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_material21.Box, { sx: { flexGrow: 1 } })
|
|
5019
5024
|
] }),
|
|
5020
|
-
/* @__PURE__ */ (0,
|
|
5025
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
5021
5026
|
import_material21.Paper,
|
|
5022
5027
|
{
|
|
5023
5028
|
sx: {
|
|
@@ -5027,22 +5032,22 @@ var TraceGraphView = ({
|
|
|
5027
5032
|
position: "relative",
|
|
5028
5033
|
width: "100%"
|
|
5029
5034
|
},
|
|
5030
|
-
children: shouldShowStatusMessage ? /* @__PURE__ */ (0,
|
|
5035
|
+
children: shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
5031
5036
|
StatusMessage,
|
|
5032
5037
|
{
|
|
5033
5038
|
error: statusError,
|
|
5034
5039
|
onRetry: handleRetry,
|
|
5035
5040
|
status
|
|
5036
5041
|
}
|
|
5037
|
-
) : /* @__PURE__ */ (0,
|
|
5038
|
-
/* @__PURE__ */ (0,
|
|
5042
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
|
|
5043
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Main, { open, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
5039
5044
|
import_material21.Box,
|
|
5040
5045
|
{
|
|
5041
5046
|
sx: {
|
|
5042
5047
|
height: "100%",
|
|
5043
5048
|
overflow: "auto"
|
|
5044
5049
|
},
|
|
5045
|
-
children: traceId !== void 0 && /* @__PURE__ */ (0,
|
|
5050
|
+
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_react22.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
5046
5051
|
TraceGraph,
|
|
5047
5052
|
{
|
|
5048
5053
|
initialFocusEventId: spanId,
|
|
@@ -5060,7 +5065,7 @@ var TraceGraphView = ({
|
|
|
5060
5065
|
) })
|
|
5061
5066
|
}
|
|
5062
5067
|
) }),
|
|
5063
|
-
/* @__PURE__ */ (0,
|
|
5068
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(EventDetails, { onClose: handleClose, selectedEvent }) })
|
|
5064
5069
|
] })
|
|
5065
5070
|
}
|
|
5066
5071
|
)
|
|
@@ -5073,10 +5078,10 @@ var TraceGraphPage = () => {
|
|
|
5073
5078
|
const [searchParameters] = (0, import_react_router_dom2.useSearchParams)();
|
|
5074
5079
|
const spanId = searchParameters.get("spanId");
|
|
5075
5080
|
const api = useAppInspectorApi();
|
|
5076
|
-
const [spans, setSpans] = (0,
|
|
5077
|
-
const [loading, setLoading] = (0,
|
|
5078
|
-
const [fetchError, setFetchError] = (0,
|
|
5079
|
-
const fetchSpans = (0,
|
|
5081
|
+
const [spans, setSpans] = (0, import_react23.useState)();
|
|
5082
|
+
const [loading, setLoading] = (0, import_react23.useState)(false);
|
|
5083
|
+
const [fetchError, setFetchError] = (0, import_react23.useState)();
|
|
5084
|
+
const fetchSpans = (0, import_react23.useCallback)(async () => {
|
|
5080
5085
|
setLoading(true);
|
|
5081
5086
|
try {
|
|
5082
5087
|
const response = await api.getSpans({
|
|
@@ -5091,14 +5096,14 @@ var TraceGraphPage = () => {
|
|
|
5091
5096
|
setLoading(false);
|
|
5092
5097
|
}
|
|
5093
5098
|
}, [api, traceId]);
|
|
5094
|
-
(0,
|
|
5099
|
+
(0, import_react23.useEffect)(() => {
|
|
5095
5100
|
void fetchSpans();
|
|
5096
5101
|
}, [fetchSpans]);
|
|
5097
|
-
const [open, setOpen] = (0,
|
|
5098
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
5099
|
-
const [viewPortPixelWidth, setViewPortPixelWidth] = (0,
|
|
5102
|
+
const [open, setOpen] = (0, import_react23.useState)(true);
|
|
5103
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react23.useState)();
|
|
5104
|
+
const [viewPortPixelWidth, setViewPortPixelWidth] = (0, import_react23.useState)(0);
|
|
5100
5105
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
5101
|
-
const calculateDrawerWidth = (0,
|
|
5106
|
+
const calculateDrawerWidth = (0, import_react23.useCallback)(() => {
|
|
5102
5107
|
const percentageMatch = /(\d+)%/.exec(DRAWER_WIDTH);
|
|
5103
5108
|
if (percentageMatch && open) {
|
|
5104
5109
|
const percentage = Number.parseInt(percentageMatch[1], 10);
|
|
@@ -5106,7 +5111,7 @@ var TraceGraphPage = () => {
|
|
|
5106
5111
|
}
|
|
5107
5112
|
return 0;
|
|
5108
5113
|
}, [open]);
|
|
5109
|
-
(0,
|
|
5114
|
+
(0, import_react23.useEffect)(() => {
|
|
5110
5115
|
const updateViewportWidth = () => {
|
|
5111
5116
|
const totalWidth = window.innerWidth;
|
|
5112
5117
|
const drawerPixelWidth = open ? calculateDrawerWidth() : 0;
|
|
@@ -5120,20 +5125,20 @@ var TraceGraphPage = () => {
|
|
|
5120
5125
|
clearTimeout(timeoutId);
|
|
5121
5126
|
};
|
|
5122
5127
|
}, [open, calculateDrawerWidth]);
|
|
5123
|
-
const handleEventSelect = (0,
|
|
5128
|
+
const handleEventSelect = (0, import_react23.useCallback)((event) => {
|
|
5124
5129
|
setSelectedEvent(event);
|
|
5125
5130
|
setOpen(true);
|
|
5126
5131
|
}, []);
|
|
5127
|
-
const handleRetry = (0,
|
|
5132
|
+
const handleRetry = (0, import_react23.useCallback)(() => {
|
|
5128
5133
|
void checkStatus();
|
|
5129
5134
|
}, [checkStatus]);
|
|
5130
5135
|
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
5131
5136
|
const { resolveLink } = useAppInspector();
|
|
5132
|
-
const navigateToSpansList = (0,
|
|
5137
|
+
const navigateToSpansList = (0, import_react23.useCallback)(() => {
|
|
5133
5138
|
const url = resolveLink({ to: "spans-list" });
|
|
5134
5139
|
navigate(url);
|
|
5135
5140
|
}, [navigate, resolveLink]);
|
|
5136
|
-
return /* @__PURE__ */ (0,
|
|
5141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
5137
5142
|
TraceGraphView,
|
|
5138
5143
|
{
|
|
5139
5144
|
fetchError,
|