@localstack/appinspector-ui 1.0.70 → 1.0.72
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 +81 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +62 -110
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -386,7 +386,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
386
386
|
|
|
387
387
|
// src/pages/spans-list-page.tsx
|
|
388
388
|
var import_material21 = require("@mui/material");
|
|
389
|
-
var
|
|
389
|
+
var import_react62 = require("react");
|
|
390
390
|
|
|
391
391
|
// src/components/spans-list/spans-list.tsx
|
|
392
392
|
var import_material5 = require("@mui/material");
|
|
@@ -12649,7 +12649,17 @@ var SpansDataGrid = ({
|
|
|
12649
12649
|
}),
|
|
12650
12650
|
columnHelper.accessor("startTime", {
|
|
12651
12651
|
cell: (props) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(ResponsiveTimestampCell, { date: props.getValue() }),
|
|
12652
|
-
header:
|
|
12652
|
+
header: () => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12653
|
+
import_material4.TableSortLabel,
|
|
12654
|
+
{
|
|
12655
|
+
active: true,
|
|
12656
|
+
direction: order2 === "newest_first" ? "asc" : "desc",
|
|
12657
|
+
onClick: () => {
|
|
12658
|
+
onOrderChange(order2 === "newest_first" ? "oldest_first" : "newest_first");
|
|
12659
|
+
},
|
|
12660
|
+
children: "Time"
|
|
12661
|
+
}
|
|
12662
|
+
),
|
|
12653
12663
|
id: "startTime",
|
|
12654
12664
|
size: 120
|
|
12655
12665
|
}),
|
|
@@ -12706,7 +12716,7 @@ var SpansDataGrid = ({
|
|
|
12706
12716
|
// The actions column doesn't need more space
|
|
12707
12717
|
size: 96
|
|
12708
12718
|
})
|
|
12709
|
-
], [onSpanClick]);
|
|
12719
|
+
], [onSpanClick, onOrderChange, order2]);
|
|
12710
12720
|
const table = useReactTable({
|
|
12711
12721
|
columns,
|
|
12712
12722
|
data: spans ?? [],
|
|
@@ -12733,23 +12743,6 @@ var SpansDataGrid = ({
|
|
|
12733
12743
|
label: ""
|
|
12734
12744
|
}
|
|
12735
12745
|
),
|
|
12736
|
-
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12737
|
-
import_material4.FormControlLabel,
|
|
12738
|
-
{
|
|
12739
|
-
control: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12740
|
-
import_material4.Button,
|
|
12741
|
-
{
|
|
12742
|
-
onClick: () => {
|
|
12743
|
-
onOrderChange(order2 === "newest_first" ? "oldest_first" : "newest_first");
|
|
12744
|
-
},
|
|
12745
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.SwapVertOutlined, {}),
|
|
12746
|
-
variant: "text",
|
|
12747
|
-
children: order2 === "newest_first" ? "Newest First" : "Oldest First"
|
|
12748
|
-
}
|
|
12749
|
-
),
|
|
12750
|
-
label: ""
|
|
12751
|
-
}
|
|
12752
|
-
),
|
|
12753
12746
|
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12754
12747
|
import_material4.FormControlLabel,
|
|
12755
12748
|
{
|
|
@@ -13854,8 +13847,8 @@ var useSpans = () => {
|
|
|
13854
13847
|
var import_icons_material11 = require("@mui/icons-material");
|
|
13855
13848
|
var import_material20 = require("@mui/material");
|
|
13856
13849
|
var import_styles = require("@mui/material/styles");
|
|
13857
|
-
var
|
|
13858
|
-
var
|
|
13850
|
+
var import_react60 = require("@xyflow/react");
|
|
13851
|
+
var import_react61 = require("react");
|
|
13859
13852
|
|
|
13860
13853
|
// src/components/event-details/event-details.tsx
|
|
13861
13854
|
var import_material15 = require("@mui/material");
|
|
@@ -24508,8 +24501,8 @@ function renderKeyValue(key, value) {
|
|
|
24508
24501
|
// src/components/trace-graph/trace-graph.tsx
|
|
24509
24502
|
var import_base = require("@xyflow/react/dist/base.css");
|
|
24510
24503
|
var import_material19 = require("@mui/material");
|
|
24511
|
-
var
|
|
24512
|
-
var
|
|
24504
|
+
var import_react58 = require("@xyflow/react");
|
|
24505
|
+
var import_react59 = require("react");
|
|
24513
24506
|
|
|
24514
24507
|
// src/components/trace-graph/service-node.tsx
|
|
24515
24508
|
var import_material17 = require("@mui/material");
|
|
@@ -24660,56 +24653,6 @@ var ServiceNode = (0, import_react55.memo)(({ data, selected }) => {
|
|
|
24660
24653
|
|
|
24661
24654
|
// src/components/trace-graph/utils.ts
|
|
24662
24655
|
var import_dagre = __toESM(require("@dagrejs/dagre"), 1);
|
|
24663
|
-
var import_react56 = require("@xyflow/react");
|
|
24664
|
-
var generateNodesAndEdges = (event, parentId) => {
|
|
24665
|
-
const nodes = [];
|
|
24666
|
-
const edges = [];
|
|
24667
|
-
nodes.push({
|
|
24668
|
-
data: {
|
|
24669
|
-
data: { [event.span_id]: event },
|
|
24670
|
-
event,
|
|
24671
|
-
height: 28,
|
|
24672
|
-
id: event.span_id,
|
|
24673
|
-
position: { x: 0, y: 0 },
|
|
24674
|
-
width: 28
|
|
24675
|
-
},
|
|
24676
|
-
id: event.span_id,
|
|
24677
|
-
position: { x: 0, y: 0 },
|
|
24678
|
-
// Will be set by layout
|
|
24679
|
-
sourcePosition: import_react56.Position.Right,
|
|
24680
|
-
targetPosition: import_react56.Position.Left,
|
|
24681
|
-
type: "service"
|
|
24682
|
-
});
|
|
24683
|
-
if (parentId) {
|
|
24684
|
-
edges.push({
|
|
24685
|
-
animated: false,
|
|
24686
|
-
id: `e-${parentId}-${event.span_id}`,
|
|
24687
|
-
markerEnd: {
|
|
24688
|
-
color: "lightgray",
|
|
24689
|
-
height: 16,
|
|
24690
|
-
type: import_react56.MarkerType.Arrow,
|
|
24691
|
-
width: 16
|
|
24692
|
-
},
|
|
24693
|
-
source: parentId,
|
|
24694
|
-
style: {
|
|
24695
|
-
stroke: "lightgray",
|
|
24696
|
-
strokeWidth: 1
|
|
24697
|
-
},
|
|
24698
|
-
target: event.span_id
|
|
24699
|
-
});
|
|
24700
|
-
}
|
|
24701
|
-
if (event.children && event.children.length > 0) {
|
|
24702
|
-
for (const child of event.children) {
|
|
24703
|
-
const { edges: childEdges, nodes: childNodes } = generateNodesAndEdges(
|
|
24704
|
-
child,
|
|
24705
|
-
event.span_id
|
|
24706
|
-
);
|
|
24707
|
-
nodes.push(...childNodes);
|
|
24708
|
-
edges.push(...childEdges);
|
|
24709
|
-
}
|
|
24710
|
-
}
|
|
24711
|
-
return { edges, nodes };
|
|
24712
|
-
};
|
|
24713
24656
|
var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
|
|
24714
24657
|
const dagreGraph = new import_dagre.default.graphlib.Graph().setDefaultEdgeLabel(() => ({}));
|
|
24715
24658
|
const direction = "LR";
|
|
@@ -24740,8 +24683,8 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
|
|
|
24740
24683
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
24741
24684
|
var import_icons_material10 = require("@mui/icons-material");
|
|
24742
24685
|
var import_material18 = require("@mui/material");
|
|
24743
|
-
var
|
|
24744
|
-
var
|
|
24686
|
+
var import_react56 = require("@xyflow/react");
|
|
24687
|
+
var import_react57 = require("react");
|
|
24745
24688
|
|
|
24746
24689
|
// node_modules/zustand/esm/shallow.mjs
|
|
24747
24690
|
function shallow$1(objA, objB) {
|
|
@@ -24788,9 +24731,9 @@ var selector = (s2) => ({
|
|
|
24788
24731
|
maxZoomReached: s2.transform[2] >= s2.maxZoom,
|
|
24789
24732
|
minZoomReached: s2.transform[2] <= s2.minZoom
|
|
24790
24733
|
});
|
|
24791
|
-
var Controls = (0,
|
|
24792
|
-
const { maxZoomReached, minZoomReached } = (0,
|
|
24793
|
-
const { fitView, zoomIn, zoomOut } = (0,
|
|
24734
|
+
var Controls = (0, import_react57.memo)(() => {
|
|
24735
|
+
const { maxZoomReached, minZoomReached } = (0, import_react56.useStore)(selector, shallow$1);
|
|
24736
|
+
const { fitView, zoomIn, zoomOut } = (0, import_react56.useReactFlow)();
|
|
24794
24737
|
const onZoomInHandler = () => {
|
|
24795
24738
|
void zoomIn();
|
|
24796
24739
|
};
|
|
@@ -24859,41 +24802,49 @@ var TraceGraph = ({
|
|
|
24859
24802
|
onRefresh,
|
|
24860
24803
|
spans
|
|
24861
24804
|
}) => {
|
|
24862
|
-
const [nodes, setNodes, onNodesChange] = (0,
|
|
24863
|
-
const [edges, setEdges] = (0,
|
|
24864
|
-
(0,
|
|
24865
|
-
const
|
|
24866
|
-
const
|
|
24867
|
-
for (const span of spans.data ?? []) {
|
|
24868
|
-
spansMap.set(span.span_id, { ...span, children: [] });
|
|
24869
|
-
}
|
|
24805
|
+
const [nodes, setNodes, onNodesChange] = (0, import_react58.useNodesState)([]);
|
|
24806
|
+
const [edges, setEdges] = (0, import_react58.useEdgesState)([]);
|
|
24807
|
+
(0, import_react59.useEffect)(() => {
|
|
24808
|
+
const allNodes = [];
|
|
24809
|
+
const allEdges = [];
|
|
24870
24810
|
for (const span of spans.data ?? []) {
|
|
24871
|
-
|
|
24872
|
-
|
|
24873
|
-
|
|
24874
|
-
|
|
24875
|
-
|
|
24876
|
-
|
|
24877
|
-
|
|
24878
|
-
|
|
24879
|
-
|
|
24880
|
-
|
|
24811
|
+
allNodes.push({
|
|
24812
|
+
data: {
|
|
24813
|
+
data: { [span.span_id]: span },
|
|
24814
|
+
event: span,
|
|
24815
|
+
height: 28,
|
|
24816
|
+
id: span.span_id,
|
|
24817
|
+
position: { x: 0, y: 0 },
|
|
24818
|
+
width: 28
|
|
24819
|
+
},
|
|
24820
|
+
id: span.span_id,
|
|
24821
|
+
position: { x: 0, y: 0 },
|
|
24822
|
+
sourcePosition: import_react58.Position.Right,
|
|
24823
|
+
targetPosition: import_react58.Position.Left,
|
|
24824
|
+
type: "service"
|
|
24825
|
+
});
|
|
24826
|
+
if (span.parent_span_id !== null) {
|
|
24827
|
+
allEdges.push({
|
|
24828
|
+
animated: false,
|
|
24829
|
+
id: `e-${span.parent_span_id}-${span.span_id}`,
|
|
24830
|
+
markerEnd: { color: "lightgray", height: 16, type: import_react58.MarkerType.Arrow, width: 16 },
|
|
24831
|
+
source: span.parent_span_id,
|
|
24832
|
+
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
24833
|
+
target: span.span_id
|
|
24834
|
+
});
|
|
24881
24835
|
}
|
|
24882
24836
|
for (const linkedSpanId of span.linked_span_ids ?? []) {
|
|
24883
|
-
|
|
24884
|
-
|
|
24885
|
-
|
|
24886
|
-
|
|
24887
|
-
|
|
24837
|
+
allEdges.push({
|
|
24838
|
+
id: `e-link-${linkedSpanId}-${span.span_id}`,
|
|
24839
|
+
markerEnd: { color: "lightgray", height: 16, type: import_react58.MarkerType.Arrow, width: 16 },
|
|
24840
|
+
source: linkedSpanId,
|
|
24841
|
+
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
24842
|
+
// animated: true,
|
|
24843
|
+
// style: { stroke: 'lightgray', strokeDasharray: '4 2', strokeWidth: 1 },
|
|
24844
|
+
target: span.span_id
|
|
24845
|
+
});
|
|
24888
24846
|
}
|
|
24889
24847
|
}
|
|
24890
|
-
let allNodes = [];
|
|
24891
|
-
let allEdges = [];
|
|
24892
|
-
for (const rootSpan of rootSpans) {
|
|
24893
|
-
const { edges: newEdges, nodes: newNodes } = generateNodesAndEdges(rootSpan);
|
|
24894
|
-
allNodes = [...allNodes, ...newNodes];
|
|
24895
|
-
allEdges = [...allEdges, ...newEdges];
|
|
24896
|
-
}
|
|
24897
24848
|
const { edges: layoutedEdges, nodes: layoutedNodes } = getLayoutedNodesAndEdges(allNodes, allEdges);
|
|
24898
24849
|
for (const node of layoutedNodes) {
|
|
24899
24850
|
if (node.id === initialFocusEventId) {
|
|
@@ -24902,7 +24853,7 @@ var TraceGraph = ({
|
|
|
24902
24853
|
}
|
|
24903
24854
|
setNodes(layoutedNodes);
|
|
24904
24855
|
setEdges(layoutedEdges);
|
|
24905
|
-
}, [spans.data, initialFocusEventId, setNodes]);
|
|
24856
|
+
}, [spans.data, initialFocusEventId, setNodes, setEdges]);
|
|
24906
24857
|
const theme = (0, import_material19.useTheme)();
|
|
24907
24858
|
return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(import_jsx_runtime141.Fragment, { children: [
|
|
24908
24859
|
spans.error && /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
@@ -24920,7 +24871,7 @@ var TraceGraph = ({
|
|
|
24920
24871
|
}
|
|
24921
24872
|
),
|
|
24922
24873
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
24923
|
-
|
|
24874
|
+
import_react58.ReactFlow,
|
|
24924
24875
|
{
|
|
24925
24876
|
"data-testid": "trace-graph",
|
|
24926
24877
|
edges,
|
|
@@ -24939,7 +24890,7 @@ var TraceGraph = ({
|
|
|
24939
24890
|
children: [
|
|
24940
24891
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(Controls, {}),
|
|
24941
24892
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
24942
|
-
|
|
24893
|
+
import_react58.Background,
|
|
24943
24894
|
{
|
|
24944
24895
|
bgColor: theme.palette.background.paper,
|
|
24945
24896
|
color: theme.palette.text.disabled
|
|
@@ -25044,7 +24995,7 @@ var TraceGraphView = ({
|
|
|
25044
24995
|
height: "100%",
|
|
25045
24996
|
overflow: "auto"
|
|
25046
24997
|
},
|
|
25047
|
-
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
24998
|
+
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_react60.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
25048
24999
|
TraceGraph,
|
|
25049
25000
|
{
|
|
25050
25001
|
initialFocusEventId: spanId,
|
|
@@ -25105,10 +25056,10 @@ async function fetchConnectedTraces(api, traceIds, allSpans = /* @__PURE__ */ ne
|
|
|
25105
25056
|
}
|
|
25106
25057
|
var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
25107
25058
|
const api = useAppInspectorApi();
|
|
25108
|
-
const [spans, setSpans] = (0,
|
|
25109
|
-
const [loading, setLoading] = (0,
|
|
25110
|
-
const [fetchError, setFetchError] = (0,
|
|
25111
|
-
const fetchSpans = (0,
|
|
25059
|
+
const [spans, setSpans] = (0, import_react61.useState)();
|
|
25060
|
+
const [loading, setLoading] = (0, import_react61.useState)(false);
|
|
25061
|
+
const [fetchError, setFetchError] = (0, import_react61.useState)();
|
|
25062
|
+
const fetchSpans = (0, import_react61.useCallback)(async () => {
|
|
25112
25063
|
setLoading(true);
|
|
25113
25064
|
try {
|
|
25114
25065
|
const spans2 = await fetchConnectedTraces(api, [traceId]);
|
|
@@ -25121,28 +25072,28 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
25121
25072
|
setLoading(false);
|
|
25122
25073
|
}
|
|
25123
25074
|
}, [api, traceId]);
|
|
25124
|
-
(0,
|
|
25075
|
+
(0, import_react61.useEffect)(() => {
|
|
25125
25076
|
void fetchSpans();
|
|
25126
25077
|
}, [fetchSpans]);
|
|
25127
|
-
const [open, setOpen] = (0,
|
|
25128
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
25129
|
-
const spansReference = (0,
|
|
25130
|
-
(0,
|
|
25078
|
+
const [open, setOpen] = (0, import_react61.useState)(true);
|
|
25079
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react61.useState)(() => spans?.find((span) => span.span_id === spanId));
|
|
25080
|
+
const spansReference = (0, import_react61.useRef)();
|
|
25081
|
+
(0, import_react61.useEffect)(() => {
|
|
25131
25082
|
if (!spansReference.current && spans) {
|
|
25132
25083
|
setSelectedEvent(spans.find((span) => span.span_id === spanId));
|
|
25133
25084
|
spansReference.current = spans;
|
|
25134
25085
|
}
|
|
25135
25086
|
}, [spans, setSelectedEvent, spanId]);
|
|
25136
25087
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
25137
|
-
const handleEventSelect = (0,
|
|
25088
|
+
const handleEventSelect = (0, import_react61.useCallback)((spanId2) => {
|
|
25138
25089
|
const span = spans?.find((s2) => s2.span_id === spanId2);
|
|
25139
25090
|
setSelectedEvent(span);
|
|
25140
25091
|
setOpen(true);
|
|
25141
25092
|
}, [spans]);
|
|
25142
|
-
const handleRetry = (0,
|
|
25093
|
+
const handleRetry = (0, import_react61.useCallback)(() => {
|
|
25143
25094
|
void checkStatus();
|
|
25144
25095
|
}, [checkStatus]);
|
|
25145
|
-
const navigateToSpansList = (0,
|
|
25096
|
+
const navigateToSpansList = (0, import_react61.useCallback)(() => {
|
|
25146
25097
|
onClose?.();
|
|
25147
25098
|
}, [onClose]);
|
|
25148
25099
|
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
@@ -25188,17 +25139,17 @@ var SpansListPage = () => {
|
|
|
25188
25139
|
streamPaused,
|
|
25189
25140
|
toggleStream
|
|
25190
25141
|
} = useSpans();
|
|
25191
|
-
const clearSpansSync = (0,
|
|
25142
|
+
const clearSpansSync = (0, import_react62.useCallback)(() => {
|
|
25192
25143
|
void clearSpans();
|
|
25193
25144
|
}, [clearSpans]);
|
|
25194
25145
|
const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
|
|
25195
|
-
const [selectedTraceId, setSelectedTraceId] = (0,
|
|
25196
|
-
const [selectedSpanId, setSelectedSpanId] = (0,
|
|
25197
|
-
const navigateToSpan = (0,
|
|
25146
|
+
const [selectedTraceId, setSelectedTraceId] = (0, import_react62.useState)();
|
|
25147
|
+
const [selectedSpanId, setSelectedSpanId] = (0, import_react62.useState)();
|
|
25148
|
+
const navigateToSpan = (0, import_react62.useCallback)((span) => {
|
|
25198
25149
|
setSelectedTraceId(span.trace_id);
|
|
25199
25150
|
setSelectedSpanId(span.span_id);
|
|
25200
25151
|
}, []);
|
|
25201
|
-
const handleRetry = (0,
|
|
25152
|
+
const handleRetry = (0, import_react62.useCallback)(() => {
|
|
25202
25153
|
void checkStatus();
|
|
25203
25154
|
}, [checkStatus]);
|
|
25204
25155
|
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|