@localstack/appinspector-ui 1.0.151 → 1.0.153
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 +203 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +183 -62
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2425,8 +2425,8 @@ __export(index_exports, {
|
|
|
2425
2425
|
module.exports = __toCommonJS(index_exports);
|
|
2426
2426
|
|
|
2427
2427
|
// src/pages/spans-list-page.tsx
|
|
2428
|
-
var
|
|
2429
|
-
var
|
|
2428
|
+
var import_material24 = require("@mui/material");
|
|
2429
|
+
var import_react65 = require("react");
|
|
2430
2430
|
|
|
2431
2431
|
// src/api/errors.ts
|
|
2432
2432
|
var AppInspectorDisabledError = class extends Error {
|
|
@@ -17442,6 +17442,7 @@ var AwsServiceIconBase = (0, import_react38.memo)((props) => {
|
|
|
17442
17442
|
return Icon ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon, { ...props }) : null;
|
|
17443
17443
|
});
|
|
17444
17444
|
var supportedServiceNames = Object.keys(ICONS_MAP);
|
|
17445
|
+
var getServiceIconComponent = (service) => ICONS_MAP[service];
|
|
17445
17446
|
|
|
17446
17447
|
// src/components/aws-service-icon/aws-service-icon.tsx
|
|
17447
17448
|
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
@@ -19070,10 +19071,10 @@ var useSpans = () => {
|
|
|
19070
19071
|
|
|
19071
19072
|
// src/pages/trace-graph-page.tsx
|
|
19072
19073
|
var import_icons_material13 = require("@mui/icons-material");
|
|
19073
|
-
var
|
|
19074
|
+
var import_material23 = require("@mui/material");
|
|
19074
19075
|
var import_styles = require("@mui/material/styles");
|
|
19075
|
-
var
|
|
19076
|
-
var
|
|
19076
|
+
var import_react63 = require("@xyflow/react");
|
|
19077
|
+
var import_react64 = require("react");
|
|
19077
19078
|
|
|
19078
19079
|
// src/components/event-details/event-details.tsx
|
|
19079
19080
|
var import_icons_material10 = require("@mui/icons-material");
|
|
@@ -31680,9 +31681,9 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
31680
31681
|
|
|
31681
31682
|
// src/components/trace-graph/trace-graph.tsx
|
|
31682
31683
|
var import_base = require("@xyflow/react/dist/base.css");
|
|
31683
|
-
var
|
|
31684
|
-
var
|
|
31685
|
-
var
|
|
31684
|
+
var import_material22 = require("@mui/material");
|
|
31685
|
+
var import_react61 = require("@xyflow/react");
|
|
31686
|
+
var import_react62 = require("react");
|
|
31686
31687
|
|
|
31687
31688
|
// src/components/trace-graph/service-node.tsx
|
|
31688
31689
|
var import_icons_material11 = require("@mui/icons-material");
|
|
@@ -32012,20 +32013,121 @@ var Controls = (0, import_react58.memo)(() => {
|
|
|
32012
32013
|
);
|
|
32013
32014
|
});
|
|
32014
32015
|
|
|
32015
|
-
// src/components/trace-graph/
|
|
32016
|
+
// src/components/trace-graph/xyflow/minimap-node.tsx
|
|
32017
|
+
var import_material21 = require("@mui/material");
|
|
32018
|
+
var import_react59 = require("@xyflow/react");
|
|
32019
|
+
var import_react60 = require("react");
|
|
32016
32020
|
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
32021
|
+
var ICON_FRACTION = 0.35;
|
|
32022
|
+
var PADDING_FRACTION = 0.18;
|
|
32023
|
+
var ICON_NATIVE_SIZE = 80;
|
|
32024
|
+
var MinimapServiceNode = (0, import_react60.memo)(({
|
|
32025
|
+
height,
|
|
32026
|
+
id: id2,
|
|
32027
|
+
onClick,
|
|
32028
|
+
selected,
|
|
32029
|
+
width,
|
|
32030
|
+
x,
|
|
32031
|
+
y
|
|
32032
|
+
}) => {
|
|
32033
|
+
const theme = (0, import_material21.useTheme)();
|
|
32034
|
+
const node = (0, import_react59.useStore)((s) => s.nodeLookup.get(id2));
|
|
32035
|
+
const event = node?.data.event;
|
|
32036
|
+
const serviceName = event?.service_name;
|
|
32037
|
+
const Icon = serviceName ? getServiceIconComponent(serviceName) : void 0;
|
|
32038
|
+
const { operation_status, status_code } = event ?? {};
|
|
32039
|
+
const isError = operation_status ? operation_status === "error" || operation_status === "iam_explicit_deny" || operation_status === "iam_implicit_deny" : status_code === 2;
|
|
32040
|
+
const errorColor = theme.palette.error.main;
|
|
32041
|
+
const iconSize = Math.min(width, height) * ICON_FRACTION;
|
|
32042
|
+
const padding = Math.min(width, height) * PADDING_FRACTION;
|
|
32043
|
+
const scale2 = iconSize / ICON_NATIVE_SIZE;
|
|
32044
|
+
const dotRadius = Math.min(width, height) * 0.12;
|
|
32045
|
+
const dotX = x + padding + iconSize / 2;
|
|
32046
|
+
const dotY = y + height - padding - dotRadius;
|
|
32047
|
+
const outlineColor = selected ? isError ? errorColor : "#1a73e8" : "#cccccc";
|
|
32048
|
+
const outlineWidth = selected ? 2 : 1;
|
|
32049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("g", { onClick: onClick ? (event2) => {
|
|
32050
|
+
onClick(event2, id2);
|
|
32051
|
+
} : void 0, children: [
|
|
32052
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32053
|
+
"rect",
|
|
32054
|
+
{
|
|
32055
|
+
fill: "white",
|
|
32056
|
+
height,
|
|
32057
|
+
rx: 3,
|
|
32058
|
+
ry: 3,
|
|
32059
|
+
stroke: outlineColor,
|
|
32060
|
+
strokeWidth: outlineWidth,
|
|
32061
|
+
width,
|
|
32062
|
+
x,
|
|
32063
|
+
y
|
|
32064
|
+
}
|
|
32065
|
+
),
|
|
32066
|
+
isError && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32067
|
+
"rect",
|
|
32068
|
+
{
|
|
32069
|
+
fill: errorColor,
|
|
32070
|
+
height: height - 6,
|
|
32071
|
+
rx: 2,
|
|
32072
|
+
ry: 2,
|
|
32073
|
+
width: 3,
|
|
32074
|
+
x: x + 1.5,
|
|
32075
|
+
y: y + 3
|
|
32076
|
+
}
|
|
32077
|
+
),
|
|
32078
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("g", { transform: `translate(${String(x + padding)}, ${String(y + padding)}) scale(${String(scale2)})`, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Icon, { height: ICON_NATIVE_SIZE, width: ICON_NATIVE_SIZE }) }),
|
|
32079
|
+
isError && Icon && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32080
|
+
"circle",
|
|
32081
|
+
{
|
|
32082
|
+
cx: dotX,
|
|
32083
|
+
cy: dotY,
|
|
32084
|
+
fill: errorColor,
|
|
32085
|
+
r: dotRadius
|
|
32086
|
+
}
|
|
32087
|
+
)
|
|
32088
|
+
] });
|
|
32089
|
+
});
|
|
32090
|
+
|
|
32091
|
+
// src/components/trace-graph/trace-graph.tsx
|
|
32092
|
+
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
32017
32093
|
var nodeTypes = {
|
|
32018
32094
|
service: ServiceNode
|
|
32019
32095
|
};
|
|
32096
|
+
var ExtentUpdater = ({ onUpdate, viewportRef }) => {
|
|
32097
|
+
const zoom = (0, import_react61.useStore)((s) => s.transform[2]);
|
|
32098
|
+
const width = (0, import_react61.useStore)((s) => s.width);
|
|
32099
|
+
const height = (0, import_react61.useStore)((s) => s.height);
|
|
32100
|
+
(0, import_react62.useEffect)(() => {
|
|
32101
|
+
viewportRef.current = { height, width, zoom };
|
|
32102
|
+
onUpdate();
|
|
32103
|
+
}, [zoom, width, height, onUpdate, viewportRef]);
|
|
32104
|
+
return null;
|
|
32105
|
+
};
|
|
32020
32106
|
var TraceGraph = ({
|
|
32021
32107
|
initialFocusEventId,
|
|
32022
32108
|
onEventSelect,
|
|
32023
32109
|
onRefresh,
|
|
32024
32110
|
spans
|
|
32025
32111
|
}) => {
|
|
32026
|
-
const [nodes2, setNodes, onNodesChange] = (0,
|
|
32027
|
-
const [edges, setEdges] = (0,
|
|
32028
|
-
(0,
|
|
32112
|
+
const [nodes2, setNodes, onNodesChange] = (0, import_react61.useNodesState)([]);
|
|
32113
|
+
const [edges, setEdges] = (0, import_react61.useEdgesState)([]);
|
|
32114
|
+
const [translateExtent, setTranslateExtent] = (0, import_react62.useState)();
|
|
32115
|
+
const nodeBoundsRef = (0, import_react62.useRef)(null);
|
|
32116
|
+
const viewportRef = (0, import_react62.useRef)({ height: 0, width: 0, zoom: 1 });
|
|
32117
|
+
const updateExtent = (0, import_react62.useCallback)(() => {
|
|
32118
|
+
const bounds = nodeBoundsRef.current;
|
|
32119
|
+
const { height, width, zoom } = viewportRef.current;
|
|
32120
|
+
if (!bounds || width === 0 || height === 0) return;
|
|
32121
|
+
const NODE_W = 200;
|
|
32122
|
+
const NODE_H = 80;
|
|
32123
|
+
const hMargin = (width - NODE_W) / zoom;
|
|
32124
|
+
const vMargin = (height - NODE_H) / zoom;
|
|
32125
|
+
setTranslateExtent([
|
|
32126
|
+
[bounds.minX - hMargin, bounds.minY - vMargin],
|
|
32127
|
+
[bounds.maxX + hMargin, bounds.maxY + vMargin]
|
|
32128
|
+
]);
|
|
32129
|
+
}, []);
|
|
32130
|
+
(0, import_react62.useEffect)(() => {
|
|
32029
32131
|
const allNodes = [];
|
|
32030
32132
|
const allEdges = [];
|
|
32031
32133
|
for (const span of spans.data ?? []) {
|
|
@@ -32040,15 +32142,15 @@ var TraceGraph = ({
|
|
|
32040
32142
|
},
|
|
32041
32143
|
id: span.span_id,
|
|
32042
32144
|
position: { x: 0, y: 0 },
|
|
32043
|
-
sourcePosition:
|
|
32044
|
-
targetPosition:
|
|
32145
|
+
sourcePosition: import_react61.Position.Right,
|
|
32146
|
+
targetPosition: import_react61.Position.Left,
|
|
32045
32147
|
type: "service"
|
|
32046
32148
|
});
|
|
32047
32149
|
if (span.parent_span_id !== null) {
|
|
32048
32150
|
allEdges.push({
|
|
32049
32151
|
animated: false,
|
|
32050
32152
|
id: `e-${span.parent_span_id}-${span.span_id}`,
|
|
32051
|
-
markerEnd: { color: "lightgray", height: 16, type:
|
|
32153
|
+
markerEnd: { color: "lightgray", height: 16, type: import_react61.MarkerType.Arrow, width: 16 },
|
|
32052
32154
|
source: span.parent_span_id,
|
|
32053
32155
|
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
32054
32156
|
target: span.span_id
|
|
@@ -32057,7 +32159,7 @@ var TraceGraph = ({
|
|
|
32057
32159
|
for (const outgoingLinkSpanId of span.outgoing_link_span_ids ?? []) {
|
|
32058
32160
|
allEdges.push({
|
|
32059
32161
|
id: `e-link-${outgoingLinkSpanId}-${span.span_id}`,
|
|
32060
|
-
markerEnd: { color: "lightgray", height: 16, type:
|
|
32162
|
+
markerEnd: { color: "lightgray", height: 16, type: import_react61.MarkerType.Arrow, width: 16 },
|
|
32061
32163
|
source: outgoingLinkSpanId,
|
|
32062
32164
|
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
32063
32165
|
// animated: true,
|
|
@@ -32085,13 +32187,24 @@ var TraceGraph = ({
|
|
|
32085
32187
|
}
|
|
32086
32188
|
setNodes(layoutedNodes);
|
|
32087
32189
|
setEdges(layoutedEdges);
|
|
32088
|
-
|
|
32089
|
-
|
|
32090
|
-
|
|
32091
|
-
|
|
32092
|
-
|
|
32190
|
+
if (layoutedNodes.length > 0) {
|
|
32191
|
+
const NODE_W = 200;
|
|
32192
|
+
const NODE_H = 80;
|
|
32193
|
+
nodeBoundsRef.current = {
|
|
32194
|
+
maxX: Math.max(...layoutedNodes.map((n) => n.position.x + NODE_W)),
|
|
32195
|
+
maxY: Math.max(...layoutedNodes.map((n) => n.position.y + NODE_H)),
|
|
32196
|
+
minX: Math.min(...layoutedNodes.map((n) => n.position.x)),
|
|
32197
|
+
minY: Math.min(...layoutedNodes.map((n) => n.position.y))
|
|
32198
|
+
};
|
|
32199
|
+
updateExtent();
|
|
32200
|
+
}
|
|
32201
|
+
}, [spans.data, initialFocusEventId, setNodes, setEdges, updateExtent]);
|
|
32202
|
+
const theme = (0, import_material22.useTheme)();
|
|
32203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(import_jsx_runtime144.Fragment, { children: [
|
|
32204
|
+
spans.error && /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
|
|
32205
|
+
import_material22.Alert,
|
|
32093
32206
|
{
|
|
32094
|
-
action: /* @__PURE__ */ (0,
|
|
32207
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_material22.Button, { onClick: () => {
|
|
32095
32208
|
onRefresh();
|
|
32096
32209
|
}, children: "Retry" }),
|
|
32097
32210
|
severity: "error",
|
|
@@ -32102,8 +32215,8 @@ var TraceGraph = ({
|
|
|
32102
32215
|
]
|
|
32103
32216
|
}
|
|
32104
32217
|
),
|
|
32105
|
-
/* @__PURE__ */ (0,
|
|
32106
|
-
|
|
32218
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
|
|
32219
|
+
import_react61.ReactFlow,
|
|
32107
32220
|
{
|
|
32108
32221
|
"data-testid": TRACE_GRAPH_TEST_ID,
|
|
32109
32222
|
edges,
|
|
@@ -32119,10 +32232,20 @@ var TraceGraph = ({
|
|
|
32119
32232
|
},
|
|
32120
32233
|
onNodesChange,
|
|
32121
32234
|
selectNodesOnDrag: false,
|
|
32235
|
+
translateExtent,
|
|
32122
32236
|
children: [
|
|
32123
|
-
/* @__PURE__ */ (0,
|
|
32124
|
-
/* @__PURE__ */ (0,
|
|
32125
|
-
|
|
32237
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(ExtentUpdater, { onUpdate: updateExtent, viewportRef }),
|
|
32238
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Controls, {}),
|
|
32239
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
32240
|
+
import_react61.MiniMap,
|
|
32241
|
+
{
|
|
32242
|
+
nodeComponent: MinimapServiceNode,
|
|
32243
|
+
pannable: true,
|
|
32244
|
+
zoomable: true
|
|
32245
|
+
}
|
|
32246
|
+
),
|
|
32247
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
32248
|
+
import_react61.Background,
|
|
32126
32249
|
{
|
|
32127
32250
|
bgColor: theme.palette.background.default,
|
|
32128
32251
|
color: theme.palette.text.disabled
|
|
@@ -32135,7 +32258,7 @@ var TraceGraph = ({
|
|
|
32135
32258
|
};
|
|
32136
32259
|
|
|
32137
32260
|
// src/pages/trace-graph-page.tsx
|
|
32138
|
-
var
|
|
32261
|
+
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
32139
32262
|
var DRAWER_WIDTH = "35%";
|
|
32140
32263
|
var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
|
|
32141
32264
|
flexGrow: 1,
|
|
@@ -32152,25 +32275,25 @@ var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) =>
|
|
|
32152
32275
|
})
|
|
32153
32276
|
}
|
|
32154
32277
|
}));
|
|
32155
|
-
var StyledDrawer = (0, import_styles.styled)(
|
|
32278
|
+
var StyledDrawer = (0, import_styles.styled)(import_material23.Drawer)({
|
|
32156
32279
|
"& .MuiDrawer-paper": {
|
|
32157
32280
|
bottom: 0,
|
|
32158
32281
|
boxSizing: "border-box",
|
|
32159
|
-
height: `calc(100% - ${headerHeight.toString()}px)`,
|
|
32160
32282
|
overflowY: "auto",
|
|
32161
|
-
|
|
32162
|
-
|
|
32283
|
+
position: "absolute",
|
|
32284
|
+
top: 0,
|
|
32285
|
+
width: "100%"
|
|
32163
32286
|
},
|
|
32164
32287
|
"flexShrink": 0,
|
|
32288
|
+
"overflow": "hidden",
|
|
32165
32289
|
"position": "relative",
|
|
32166
32290
|
"width": DRAWER_WIDTH
|
|
32167
|
-
})
|
|
32291
|
+
});
|
|
32168
32292
|
var TraceGraphView = ({
|
|
32169
32293
|
fetchError,
|
|
32170
32294
|
fetchSpans,
|
|
32171
32295
|
handleClose,
|
|
32172
32296
|
handleEventSelect,
|
|
32173
|
-
headerHeight,
|
|
32174
32297
|
loading,
|
|
32175
32298
|
navigateToSpansList,
|
|
32176
32299
|
open,
|
|
@@ -32181,8 +32304,8 @@ var TraceGraphView = ({
|
|
|
32181
32304
|
}) => {
|
|
32182
32305
|
const { deploymentContainer } = useAppInspector();
|
|
32183
32306
|
const isVSCode = deploymentContainer.source === "vscode";
|
|
32184
|
-
return /* @__PURE__ */ (0,
|
|
32185
|
-
|
|
32307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(
|
|
32308
|
+
import_material23.Box,
|
|
32186
32309
|
{
|
|
32187
32310
|
"data-testid": TRACE_GRAPH_PAGE_TEST_ID,
|
|
32188
32311
|
sx: {
|
|
@@ -32194,14 +32317,14 @@ var TraceGraphView = ({
|
|
|
32194
32317
|
overflow: "hidden"
|
|
32195
32318
|
},
|
|
32196
32319
|
children: [
|
|
32197
|
-
/* @__PURE__ */ (0,
|
|
32198
|
-
/* @__PURE__ */ (0,
|
|
32320
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_material23.Box, { sx: { display: "flex", width: "100%", ...isVSCode && { pt: 1.5, px: 2 } }, children: [
|
|
32321
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_material23.Button, { onClick: () => {
|
|
32199
32322
|
navigateToSpansList();
|
|
32200
|
-
}, startIcon: /* @__PURE__ */ (0,
|
|
32201
|
-
/* @__PURE__ */ (0,
|
|
32323
|
+
}, startIcon: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_icons_material13.ArrowBack, {}), children: "Go back" }),
|
|
32324
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_material23.Box, { sx: { flexGrow: 1 } })
|
|
32202
32325
|
] }),
|
|
32203
|
-
/* @__PURE__ */ (0,
|
|
32204
|
-
|
|
32326
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(
|
|
32327
|
+
import_material23.Paper,
|
|
32205
32328
|
{
|
|
32206
32329
|
sx: {
|
|
32207
32330
|
display: "flex",
|
|
@@ -32212,14 +32335,14 @@ var TraceGraphView = ({
|
|
|
32212
32335
|
...isVSCode && { borderRadius: 0 }
|
|
32213
32336
|
},
|
|
32214
32337
|
children: [
|
|
32215
|
-
/* @__PURE__ */ (0,
|
|
32216
|
-
|
|
32338
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Main, { open, children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
32339
|
+
import_material23.Box,
|
|
32217
32340
|
{
|
|
32218
32341
|
sx: {
|
|
32219
32342
|
height: "100%",
|
|
32220
32343
|
overflow: "auto"
|
|
32221
32344
|
},
|
|
32222
|
-
children: traceId !== void 0 && /* @__PURE__ */ (0,
|
|
32345
|
+
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_react63.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
32223
32346
|
TraceGraph,
|
|
32224
32347
|
{
|
|
32225
32348
|
initialFocusEventId: spanId,
|
|
@@ -32236,7 +32359,7 @@ var TraceGraphView = ({
|
|
|
32236
32359
|
) })
|
|
32237
32360
|
}
|
|
32238
32361
|
) }),
|
|
32239
|
-
/* @__PURE__ */ (0,
|
|
32362
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(EventDetails, { onClose: handleClose, selectedEvent }) })
|
|
32240
32363
|
]
|
|
32241
32364
|
}
|
|
32242
32365
|
)
|
|
@@ -32287,11 +32410,10 @@ async function fetchConnectedTracesWaterfall(api, traceIds, allSpans = /* @__PUR
|
|
|
32287
32410
|
}
|
|
32288
32411
|
var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
32289
32412
|
const api = useAppInspectorApi();
|
|
32290
|
-
const
|
|
32291
|
-
const [
|
|
32292
|
-
const [
|
|
32293
|
-
const
|
|
32294
|
-
const fetchSpans = (0, import_react62.useCallback)(async () => {
|
|
32413
|
+
const [spans, setSpans] = (0, import_react64.useState)();
|
|
32414
|
+
const [loading, setLoading] = (0, import_react64.useState)(false);
|
|
32415
|
+
const [fetchError, setFetchError] = (0, import_react64.useState)();
|
|
32416
|
+
const fetchSpans = (0, import_react64.useCallback)(async () => {
|
|
32295
32417
|
setLoading(true);
|
|
32296
32418
|
try {
|
|
32297
32419
|
const spans2 = await fetchConnectedTraces(api, traceId);
|
|
@@ -32304,27 +32426,27 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32304
32426
|
setLoading(false);
|
|
32305
32427
|
}
|
|
32306
32428
|
}, [api, traceId]);
|
|
32307
|
-
(0,
|
|
32429
|
+
(0, import_react64.useEffect)(() => {
|
|
32308
32430
|
void fetchSpans();
|
|
32309
32431
|
}, [fetchSpans]);
|
|
32310
|
-
const [open, setOpen] = (0,
|
|
32311
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
32312
|
-
const spansReference = (0,
|
|
32313
|
-
(0,
|
|
32432
|
+
const [open, setOpen] = (0, import_react64.useState)(true);
|
|
32433
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react64.useState)(() => spans?.find((span) => span.span_id === spanId));
|
|
32434
|
+
const spansReference = (0, import_react64.useRef)();
|
|
32435
|
+
(0, import_react64.useEffect)(() => {
|
|
32314
32436
|
if (!spansReference.current && spans) {
|
|
32315
32437
|
setSelectedEvent(spans.find((span) => span.span_id === spanId));
|
|
32316
32438
|
spansReference.current = spans;
|
|
32317
32439
|
}
|
|
32318
32440
|
}, [spans, setSelectedEvent, spanId]);
|
|
32319
|
-
const handleEventSelect = (0,
|
|
32441
|
+
const handleEventSelect = (0, import_react64.useCallback)((spanId2) => {
|
|
32320
32442
|
const span = spans?.find((s) => s.span_id === spanId2);
|
|
32321
32443
|
setSelectedEvent(span);
|
|
32322
32444
|
setOpen(true);
|
|
32323
32445
|
}, [spans]);
|
|
32324
|
-
const navigateToSpansList = (0,
|
|
32446
|
+
const navigateToSpansList = (0, import_react64.useCallback)(() => {
|
|
32325
32447
|
onClose?.();
|
|
32326
32448
|
}, [onClose]);
|
|
32327
|
-
return /* @__PURE__ */ (0,
|
|
32449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
32328
32450
|
TraceGraphView,
|
|
32329
32451
|
{
|
|
32330
32452
|
fetchError,
|
|
@@ -32333,7 +32455,6 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32333
32455
|
setOpen(false);
|
|
32334
32456
|
},
|
|
32335
32457
|
handleEventSelect,
|
|
32336
|
-
headerHeight,
|
|
32337
32458
|
loading,
|
|
32338
32459
|
navigateToSpansList,
|
|
32339
32460
|
open,
|
|
@@ -32346,7 +32467,7 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32346
32467
|
};
|
|
32347
32468
|
|
|
32348
32469
|
// src/pages/spans-list-page.tsx
|
|
32349
|
-
var
|
|
32470
|
+
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
32350
32471
|
var SpansListPage = () => {
|
|
32351
32472
|
const api = useAppInspectorApi();
|
|
32352
32473
|
const {
|
|
@@ -32370,33 +32491,33 @@ var SpansListPage = () => {
|
|
|
32370
32491
|
warningCount
|
|
32371
32492
|
} = useSpans();
|
|
32372
32493
|
const { checkStatus, phase, status, statusError } = useAppInspectorStatus();
|
|
32373
|
-
const clearSpansSync = (0,
|
|
32494
|
+
const clearSpansSync = (0, import_react65.useCallback)(() => {
|
|
32374
32495
|
void clearSpans();
|
|
32375
32496
|
}, [clearSpans]);
|
|
32376
32497
|
const localstackVersion = status?.localstackVersion ?? (statusError instanceof AppInspectorNotFoundError ? statusError.localstackVersion : void 0);
|
|
32377
32498
|
const versionCompatibility = checkEmulatorVersion(localstackVersion);
|
|
32378
32499
|
const searchSupported = emulatorSupportsSearch(localstackVersion);
|
|
32379
|
-
const [bannerDismissed, setBannerDismissed] = (0,
|
|
32500
|
+
const [bannerDismissed, setBannerDismissed] = (0, import_react65.useState)(false);
|
|
32380
32501
|
const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
|
|
32381
|
-
const [selectedTraceId, setSelectedTraceId] = (0,
|
|
32382
|
-
const [selectedSpanId, setSelectedSpanId] = (0,
|
|
32383
|
-
const navigateToSpan = (0,
|
|
32502
|
+
const [selectedTraceId, setSelectedTraceId] = (0, import_react65.useState)();
|
|
32503
|
+
const [selectedSpanId, setSelectedSpanId] = (0, import_react65.useState)();
|
|
32504
|
+
const navigateToSpan = (0, import_react65.useCallback)((span) => {
|
|
32384
32505
|
setSelectedTraceId(span.trace_id);
|
|
32385
32506
|
setSelectedSpanId(span.span_id);
|
|
32386
32507
|
}, []);
|
|
32387
|
-
const handleRetry = (0,
|
|
32508
|
+
const handleRetry = (0, import_react65.useCallback)(() => {
|
|
32388
32509
|
checkStatus();
|
|
32389
32510
|
fetchForward();
|
|
32390
32511
|
}, [checkStatus, fetchForward]);
|
|
32391
|
-
const handleEnable = (0,
|
|
32512
|
+
const handleEnable = (0, import_react65.useCallback)(async () => {
|
|
32392
32513
|
await api.setStatus({ status: "ENABLED" });
|
|
32393
32514
|
clearFetchError();
|
|
32394
32515
|
checkStatus();
|
|
32395
32516
|
}, [api, checkStatus, clearFetchError]);
|
|
32396
|
-
const isDelayedRefetchRef = (0,
|
|
32397
|
-
const delayedRefetchTimerRef = (0,
|
|
32398
|
-
const prevFetchingForwardRef = (0,
|
|
32399
|
-
(0,
|
|
32517
|
+
const isDelayedRefetchRef = (0, import_react65.useRef)(false);
|
|
32518
|
+
const delayedRefetchTimerRef = (0, import_react65.useRef)();
|
|
32519
|
+
const prevFetchingForwardRef = (0, import_react65.useRef)(false);
|
|
32520
|
+
(0, import_react65.useEffect)(() => {
|
|
32400
32521
|
const wasFetching = prevFetchingForwardRef.current;
|
|
32401
32522
|
prevFetchingForwardRef.current = fetchingForward;
|
|
32402
32523
|
if (wasFetching && !fetchingForward) {
|
|
@@ -32417,10 +32538,10 @@ var SpansListPage = () => {
|
|
|
32417
32538
|
switch (phase) {
|
|
32418
32539
|
case "CHECKING_STATUS":
|
|
32419
32540
|
case "CONNECTING_WS": {
|
|
32420
|
-
return /* @__PURE__ */ (0,
|
|
32541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(StatusMessage, { phase });
|
|
32421
32542
|
}
|
|
32422
32543
|
case "DISABLED": {
|
|
32423
|
-
return /* @__PURE__ */ (0,
|
|
32544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
32424
32545
|
StatusMessage,
|
|
32425
32546
|
{
|
|
32426
32547
|
onEnable: handleEnable,
|
|
@@ -32429,7 +32550,7 @@ var SpansListPage = () => {
|
|
|
32429
32550
|
);
|
|
32430
32551
|
}
|
|
32431
32552
|
case "INCOMPATIBLE": {
|
|
32432
|
-
return /* @__PURE__ */ (0,
|
|
32553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
32433
32554
|
StatusMessage,
|
|
32434
32555
|
{
|
|
32435
32556
|
localstackVersion,
|
|
@@ -32442,7 +32563,7 @@ var SpansListPage = () => {
|
|
|
32442
32563
|
break;
|
|
32443
32564
|
}
|
|
32444
32565
|
case "UNREACHABLE": {
|
|
32445
|
-
return /* @__PURE__ */ (0,
|
|
32566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
32446
32567
|
StatusMessage,
|
|
32447
32568
|
{
|
|
32448
32569
|
onRetry: handleRetry,
|
|
@@ -32451,9 +32572,9 @@ var SpansListPage = () => {
|
|
|
32451
32572
|
);
|
|
32452
32573
|
}
|
|
32453
32574
|
}
|
|
32454
|
-
return /* @__PURE__ */ (0,
|
|
32455
|
-
/* @__PURE__ */ (0,
|
|
32456
|
-
|
|
32575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_jsx_runtime146.Fragment, { children: [
|
|
32576
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
|
|
32577
|
+
import_material24.Box,
|
|
32457
32578
|
{
|
|
32458
32579
|
"data-testid": SPANS_LIST_PAGE_TEST_ID,
|
|
32459
32580
|
sx: {
|
|
@@ -32468,7 +32589,7 @@ var SpansListPage = () => {
|
|
|
32468
32589
|
width: "100%"
|
|
32469
32590
|
},
|
|
32470
32591
|
children: [
|
|
32471
|
-
/* @__PURE__ */ (0,
|
|
32592
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
32472
32593
|
EmulatorVersionBanner,
|
|
32473
32594
|
{
|
|
32474
32595
|
compatibility: bannerDismissed && versionCompatibility === "warning" ? "ok" : versionCompatibility,
|
|
@@ -32478,7 +32599,7 @@ var SpansListPage = () => {
|
|
|
32478
32599
|
} : void 0
|
|
32479
32600
|
}
|
|
32480
32601
|
),
|
|
32481
|
-
/* @__PURE__ */ (0,
|
|
32602
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
32482
32603
|
SpansList,
|
|
32483
32604
|
{
|
|
32484
32605
|
clearingSpans,
|
|
@@ -32507,7 +32628,7 @@ var SpansListPage = () => {
|
|
|
32507
32628
|
]
|
|
32508
32629
|
}
|
|
32509
32630
|
),
|
|
32510
|
-
selectedTraceId !== void 0 && /* @__PURE__ */ (0,
|
|
32631
|
+
selectedTraceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(TraceGraphPage, { onClose: () => {
|
|
32511
32632
|
setSelectedTraceId(void 0);
|
|
32512
32633
|
}, spanId: selectedSpanId, traceId: selectedTraceId })
|
|
32513
32634
|
] });
|