@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.js
CHANGED
|
@@ -2422,7 +2422,7 @@ var init_event_streams = __esm({
|
|
|
2422
2422
|
|
|
2423
2423
|
// src/pages/spans-list-page.tsx
|
|
2424
2424
|
import { Box as Box19 } from "@mui/material";
|
|
2425
|
-
import { useCallback as
|
|
2425
|
+
import { useCallback as useCallback12, useEffect as useEffect22, useRef as useRef17, useState as useState20 } from "react";
|
|
2426
2426
|
|
|
2427
2427
|
// src/api/errors.ts
|
|
2428
2428
|
var AppInspectorDisabledError = class extends Error {
|
|
@@ -17458,6 +17458,7 @@ var AwsServiceIconBase = memo5((props) => {
|
|
|
17458
17458
|
return Icon ? /* @__PURE__ */ jsx123(Icon, { ...props }) : null;
|
|
17459
17459
|
});
|
|
17460
17460
|
var supportedServiceNames = Object.keys(ICONS_MAP);
|
|
17461
|
+
var getServiceIconComponent = (service) => ICONS_MAP[service];
|
|
17461
17462
|
|
|
17462
17463
|
// src/components/aws-service-icon/aws-service-icon.tsx
|
|
17463
17464
|
import { jsx as jsx124 } from "react/jsx-runtime";
|
|
@@ -19089,7 +19090,7 @@ import { ArrowBack } from "@mui/icons-material";
|
|
|
19089
19090
|
import { Box as Box18, Button as Button6, Drawer, Paper as Paper3 } from "@mui/material";
|
|
19090
19091
|
import { styled } from "@mui/material/styles";
|
|
19091
19092
|
import { ReactFlowProvider } from "@xyflow/react";
|
|
19092
|
-
import { useCallback as
|
|
19093
|
+
import { useCallback as useCallback11, useEffect as useEffect21, useRef as useRef16, useState as useState19 } from "react";
|
|
19093
19094
|
|
|
19094
19095
|
// src/components/event-details/event-details.tsx
|
|
19095
19096
|
import { Close as Close3 } from "@mui/icons-material";
|
|
@@ -31696,9 +31697,9 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
31696
31697
|
|
|
31697
31698
|
// src/components/trace-graph/trace-graph.tsx
|
|
31698
31699
|
import "@xyflow/react/dist/base.css";
|
|
31699
|
-
import { Alert as Alert5, Button as Button5, useTheme as
|
|
31700
|
-
import { Background, MarkerType, Position as Position2, ReactFlow, useEdgesState, useNodesState } from "@xyflow/react";
|
|
31701
|
-
import { useEffect as useEffect20 } from "react";
|
|
31700
|
+
import { Alert as Alert5, Button as Button5, useTheme as useTheme6 } from "@mui/material";
|
|
31701
|
+
import { Background, MarkerType, MiniMap, Position as Position2, ReactFlow, useEdgesState, useNodesState, useStore as useStore4 } from "@xyflow/react";
|
|
31702
|
+
import { useCallback as useCallback10, useEffect as useEffect20, useRef as useRef15, useState as useState18 } from "react";
|
|
31702
31703
|
|
|
31703
31704
|
// src/components/trace-graph/service-node.tsx
|
|
31704
31705
|
import { Cancel as Cancel3, GppBad as GppBad2 } from "@mui/icons-material";
|
|
@@ -32028,11 +32029,96 @@ var Controls = memo12(() => {
|
|
|
32028
32029
|
);
|
|
32029
32030
|
});
|
|
32030
32031
|
|
|
32032
|
+
// src/components/trace-graph/xyflow/minimap-node.tsx
|
|
32033
|
+
import { useTheme as useTheme5 } from "@mui/material";
|
|
32034
|
+
import { useStore as useStore3 } from "@xyflow/react";
|
|
32035
|
+
import { memo as memo13 } from "react";
|
|
32036
|
+
import { jsx as jsx143, jsxs as jsxs133 } from "react/jsx-runtime";
|
|
32037
|
+
var ICON_FRACTION = 0.35;
|
|
32038
|
+
var PADDING_FRACTION = 0.18;
|
|
32039
|
+
var ICON_NATIVE_SIZE = 80;
|
|
32040
|
+
var MinimapServiceNode = memo13(({
|
|
32041
|
+
height,
|
|
32042
|
+
id: id2,
|
|
32043
|
+
onClick,
|
|
32044
|
+
selected,
|
|
32045
|
+
width,
|
|
32046
|
+
x,
|
|
32047
|
+
y
|
|
32048
|
+
}) => {
|
|
32049
|
+
const theme = useTheme5();
|
|
32050
|
+
const node = useStore3((s) => s.nodeLookup.get(id2));
|
|
32051
|
+
const event = node?.data.event;
|
|
32052
|
+
const serviceName = event?.service_name;
|
|
32053
|
+
const Icon = serviceName ? getServiceIconComponent(serviceName) : void 0;
|
|
32054
|
+
const { operation_status, status_code } = event ?? {};
|
|
32055
|
+
const isError = operation_status ? operation_status === "error" || operation_status === "iam_explicit_deny" || operation_status === "iam_implicit_deny" : status_code === 2;
|
|
32056
|
+
const errorColor = theme.palette.error.main;
|
|
32057
|
+
const iconSize = Math.min(width, height) * ICON_FRACTION;
|
|
32058
|
+
const padding = Math.min(width, height) * PADDING_FRACTION;
|
|
32059
|
+
const scale2 = iconSize / ICON_NATIVE_SIZE;
|
|
32060
|
+
const dotRadius = Math.min(width, height) * 0.12;
|
|
32061
|
+
const dotX = x + padding + iconSize / 2;
|
|
32062
|
+
const dotY = y + height - padding - dotRadius;
|
|
32063
|
+
const outlineColor = selected ? isError ? errorColor : "#1a73e8" : "#cccccc";
|
|
32064
|
+
const outlineWidth = selected ? 2 : 1;
|
|
32065
|
+
return /* @__PURE__ */ jsxs133("g", { onClick: onClick ? (event2) => {
|
|
32066
|
+
onClick(event2, id2);
|
|
32067
|
+
} : void 0, children: [
|
|
32068
|
+
/* @__PURE__ */ jsx143(
|
|
32069
|
+
"rect",
|
|
32070
|
+
{
|
|
32071
|
+
fill: "white",
|
|
32072
|
+
height,
|
|
32073
|
+
rx: 3,
|
|
32074
|
+
ry: 3,
|
|
32075
|
+
stroke: outlineColor,
|
|
32076
|
+
strokeWidth: outlineWidth,
|
|
32077
|
+
width,
|
|
32078
|
+
x,
|
|
32079
|
+
y
|
|
32080
|
+
}
|
|
32081
|
+
),
|
|
32082
|
+
isError && /* @__PURE__ */ jsx143(
|
|
32083
|
+
"rect",
|
|
32084
|
+
{
|
|
32085
|
+
fill: errorColor,
|
|
32086
|
+
height: height - 6,
|
|
32087
|
+
rx: 2,
|
|
32088
|
+
ry: 2,
|
|
32089
|
+
width: 3,
|
|
32090
|
+
x: x + 1.5,
|
|
32091
|
+
y: y + 3
|
|
32092
|
+
}
|
|
32093
|
+
),
|
|
32094
|
+
Icon && /* @__PURE__ */ jsx143("g", { transform: `translate(${String(x + padding)}, ${String(y + padding)}) scale(${String(scale2)})`, children: /* @__PURE__ */ jsx143(Icon, { height: ICON_NATIVE_SIZE, width: ICON_NATIVE_SIZE }) }),
|
|
32095
|
+
isError && Icon && /* @__PURE__ */ jsx143(
|
|
32096
|
+
"circle",
|
|
32097
|
+
{
|
|
32098
|
+
cx: dotX,
|
|
32099
|
+
cy: dotY,
|
|
32100
|
+
fill: errorColor,
|
|
32101
|
+
r: dotRadius
|
|
32102
|
+
}
|
|
32103
|
+
)
|
|
32104
|
+
] });
|
|
32105
|
+
});
|
|
32106
|
+
|
|
32031
32107
|
// src/components/trace-graph/trace-graph.tsx
|
|
32032
|
-
import { Fragment as Fragment11, jsx as
|
|
32108
|
+
import { Fragment as Fragment11, jsx as jsx144, jsxs as jsxs134 } from "react/jsx-runtime";
|
|
32033
32109
|
var nodeTypes = {
|
|
32034
32110
|
service: ServiceNode
|
|
32035
32111
|
};
|
|
32112
|
+
var ExtentUpdater = ({ onUpdate, viewportRef }) => {
|
|
32113
|
+
const zoom = useStore4((s) => s.transform[2]);
|
|
32114
|
+
const width = useStore4((s) => s.width);
|
|
32115
|
+
const height = useStore4((s) => s.height);
|
|
32116
|
+
useEffect20(() => {
|
|
32117
|
+
viewportRef.current = { height, width, zoom };
|
|
32118
|
+
onUpdate();
|
|
32119
|
+
}, [zoom, width, height, onUpdate, viewportRef]);
|
|
32120
|
+
return null;
|
|
32121
|
+
};
|
|
32036
32122
|
var TraceGraph = ({
|
|
32037
32123
|
initialFocusEventId,
|
|
32038
32124
|
onEventSelect,
|
|
@@ -32041,6 +32127,22 @@ var TraceGraph = ({
|
|
|
32041
32127
|
}) => {
|
|
32042
32128
|
const [nodes2, setNodes, onNodesChange] = useNodesState([]);
|
|
32043
32129
|
const [edges, setEdges] = useEdgesState([]);
|
|
32130
|
+
const [translateExtent, setTranslateExtent] = useState18();
|
|
32131
|
+
const nodeBoundsRef = useRef15(null);
|
|
32132
|
+
const viewportRef = useRef15({ height: 0, width: 0, zoom: 1 });
|
|
32133
|
+
const updateExtent = useCallback10(() => {
|
|
32134
|
+
const bounds = nodeBoundsRef.current;
|
|
32135
|
+
const { height, width, zoom } = viewportRef.current;
|
|
32136
|
+
if (!bounds || width === 0 || height === 0) return;
|
|
32137
|
+
const NODE_W = 200;
|
|
32138
|
+
const NODE_H = 80;
|
|
32139
|
+
const hMargin = (width - NODE_W) / zoom;
|
|
32140
|
+
const vMargin = (height - NODE_H) / zoom;
|
|
32141
|
+
setTranslateExtent([
|
|
32142
|
+
[bounds.minX - hMargin, bounds.minY - vMargin],
|
|
32143
|
+
[bounds.maxX + hMargin, bounds.maxY + vMargin]
|
|
32144
|
+
]);
|
|
32145
|
+
}, []);
|
|
32044
32146
|
useEffect20(() => {
|
|
32045
32147
|
const allNodes = [];
|
|
32046
32148
|
const allEdges = [];
|
|
@@ -32101,13 +32203,24 @@ var TraceGraph = ({
|
|
|
32101
32203
|
}
|
|
32102
32204
|
setNodes(layoutedNodes);
|
|
32103
32205
|
setEdges(layoutedEdges);
|
|
32104
|
-
|
|
32105
|
-
|
|
32106
|
-
|
|
32107
|
-
|
|
32206
|
+
if (layoutedNodes.length > 0) {
|
|
32207
|
+
const NODE_W = 200;
|
|
32208
|
+
const NODE_H = 80;
|
|
32209
|
+
nodeBoundsRef.current = {
|
|
32210
|
+
maxX: Math.max(...layoutedNodes.map((n) => n.position.x + NODE_W)),
|
|
32211
|
+
maxY: Math.max(...layoutedNodes.map((n) => n.position.y + NODE_H)),
|
|
32212
|
+
minX: Math.min(...layoutedNodes.map((n) => n.position.x)),
|
|
32213
|
+
minY: Math.min(...layoutedNodes.map((n) => n.position.y))
|
|
32214
|
+
};
|
|
32215
|
+
updateExtent();
|
|
32216
|
+
}
|
|
32217
|
+
}, [spans.data, initialFocusEventId, setNodes, setEdges, updateExtent]);
|
|
32218
|
+
const theme = useTheme6();
|
|
32219
|
+
return /* @__PURE__ */ jsxs134(Fragment11, { children: [
|
|
32220
|
+
spans.error && /* @__PURE__ */ jsxs134(
|
|
32108
32221
|
Alert5,
|
|
32109
32222
|
{
|
|
32110
|
-
action: /* @__PURE__ */
|
|
32223
|
+
action: /* @__PURE__ */ jsx144(Button5, { onClick: () => {
|
|
32111
32224
|
onRefresh();
|
|
32112
32225
|
}, children: "Retry" }),
|
|
32113
32226
|
severity: "error",
|
|
@@ -32118,7 +32231,7 @@ var TraceGraph = ({
|
|
|
32118
32231
|
]
|
|
32119
32232
|
}
|
|
32120
32233
|
),
|
|
32121
|
-
/* @__PURE__ */
|
|
32234
|
+
/* @__PURE__ */ jsxs134(
|
|
32122
32235
|
ReactFlow,
|
|
32123
32236
|
{
|
|
32124
32237
|
"data-testid": TRACE_GRAPH_TEST_ID,
|
|
@@ -32135,9 +32248,19 @@ var TraceGraph = ({
|
|
|
32135
32248
|
},
|
|
32136
32249
|
onNodesChange,
|
|
32137
32250
|
selectNodesOnDrag: false,
|
|
32251
|
+
translateExtent,
|
|
32138
32252
|
children: [
|
|
32139
|
-
/* @__PURE__ */
|
|
32140
|
-
/* @__PURE__ */
|
|
32253
|
+
/* @__PURE__ */ jsx144(ExtentUpdater, { onUpdate: updateExtent, viewportRef }),
|
|
32254
|
+
/* @__PURE__ */ jsx144(Controls, {}),
|
|
32255
|
+
/* @__PURE__ */ jsx144(
|
|
32256
|
+
MiniMap,
|
|
32257
|
+
{
|
|
32258
|
+
nodeComponent: MinimapServiceNode,
|
|
32259
|
+
pannable: true,
|
|
32260
|
+
zoomable: true
|
|
32261
|
+
}
|
|
32262
|
+
),
|
|
32263
|
+
/* @__PURE__ */ jsx144(
|
|
32141
32264
|
Background,
|
|
32142
32265
|
{
|
|
32143
32266
|
bgColor: theme.palette.background.default,
|
|
@@ -32151,7 +32274,7 @@ var TraceGraph = ({
|
|
|
32151
32274
|
};
|
|
32152
32275
|
|
|
32153
32276
|
// src/pages/trace-graph-page.tsx
|
|
32154
|
-
import { jsx as
|
|
32277
|
+
import { jsx as jsx145, jsxs as jsxs135 } from "react/jsx-runtime";
|
|
32155
32278
|
var DRAWER_WIDTH = "35%";
|
|
32156
32279
|
var Main = styled("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
|
|
32157
32280
|
flexGrow: 1,
|
|
@@ -32168,25 +32291,25 @@ var Main = styled("main", { shouldForwardProp: (property) => property !== "open"
|
|
|
32168
32291
|
})
|
|
32169
32292
|
}
|
|
32170
32293
|
}));
|
|
32171
|
-
var StyledDrawer = styled(Drawer)(
|
|
32294
|
+
var StyledDrawer = styled(Drawer)({
|
|
32172
32295
|
"& .MuiDrawer-paper": {
|
|
32173
32296
|
bottom: 0,
|
|
32174
32297
|
boxSizing: "border-box",
|
|
32175
|
-
height: `calc(100% - ${headerHeight.toString()}px)`,
|
|
32176
32298
|
overflowY: "auto",
|
|
32177
|
-
|
|
32178
|
-
|
|
32299
|
+
position: "absolute",
|
|
32300
|
+
top: 0,
|
|
32301
|
+
width: "100%"
|
|
32179
32302
|
},
|
|
32180
32303
|
"flexShrink": 0,
|
|
32304
|
+
"overflow": "hidden",
|
|
32181
32305
|
"position": "relative",
|
|
32182
32306
|
"width": DRAWER_WIDTH
|
|
32183
|
-
})
|
|
32307
|
+
});
|
|
32184
32308
|
var TraceGraphView = ({
|
|
32185
32309
|
fetchError,
|
|
32186
32310
|
fetchSpans,
|
|
32187
32311
|
handleClose,
|
|
32188
32312
|
handleEventSelect,
|
|
32189
|
-
headerHeight,
|
|
32190
32313
|
loading,
|
|
32191
32314
|
navigateToSpansList,
|
|
32192
32315
|
open,
|
|
@@ -32197,7 +32320,7 @@ var TraceGraphView = ({
|
|
|
32197
32320
|
}) => {
|
|
32198
32321
|
const { deploymentContainer } = useAppInspector();
|
|
32199
32322
|
const isVSCode = deploymentContainer.source === "vscode";
|
|
32200
|
-
return /* @__PURE__ */
|
|
32323
|
+
return /* @__PURE__ */ jsxs135(
|
|
32201
32324
|
Box18,
|
|
32202
32325
|
{
|
|
32203
32326
|
"data-testid": TRACE_GRAPH_PAGE_TEST_ID,
|
|
@@ -32210,13 +32333,13 @@ var TraceGraphView = ({
|
|
|
32210
32333
|
overflow: "hidden"
|
|
32211
32334
|
},
|
|
32212
32335
|
children: [
|
|
32213
|
-
/* @__PURE__ */
|
|
32214
|
-
/* @__PURE__ */
|
|
32336
|
+
/* @__PURE__ */ jsxs135(Box18, { sx: { display: "flex", width: "100%", ...isVSCode && { pt: 1.5, px: 2 } }, children: [
|
|
32337
|
+
/* @__PURE__ */ jsx145(Button6, { onClick: () => {
|
|
32215
32338
|
navigateToSpansList();
|
|
32216
|
-
}, startIcon: /* @__PURE__ */
|
|
32217
|
-
/* @__PURE__ */
|
|
32339
|
+
}, startIcon: /* @__PURE__ */ jsx145(ArrowBack, {}), children: "Go back" }),
|
|
32340
|
+
/* @__PURE__ */ jsx145(Box18, { sx: { flexGrow: 1 } })
|
|
32218
32341
|
] }),
|
|
32219
|
-
/* @__PURE__ */
|
|
32342
|
+
/* @__PURE__ */ jsxs135(
|
|
32220
32343
|
Paper3,
|
|
32221
32344
|
{
|
|
32222
32345
|
sx: {
|
|
@@ -32228,14 +32351,14 @@ var TraceGraphView = ({
|
|
|
32228
32351
|
...isVSCode && { borderRadius: 0 }
|
|
32229
32352
|
},
|
|
32230
32353
|
children: [
|
|
32231
|
-
/* @__PURE__ */
|
|
32354
|
+
/* @__PURE__ */ jsx145(Main, { open, children: /* @__PURE__ */ jsx145(
|
|
32232
32355
|
Box18,
|
|
32233
32356
|
{
|
|
32234
32357
|
sx: {
|
|
32235
32358
|
height: "100%",
|
|
32236
32359
|
overflow: "auto"
|
|
32237
32360
|
},
|
|
32238
|
-
children: traceId !== void 0 && /* @__PURE__ */
|
|
32361
|
+
children: traceId !== void 0 && /* @__PURE__ */ jsx145(ReactFlowProvider, { children: /* @__PURE__ */ jsx145(
|
|
32239
32362
|
TraceGraph,
|
|
32240
32363
|
{
|
|
32241
32364
|
initialFocusEventId: spanId,
|
|
@@ -32252,7 +32375,7 @@ var TraceGraphView = ({
|
|
|
32252
32375
|
) })
|
|
32253
32376
|
}
|
|
32254
32377
|
) }),
|
|
32255
|
-
/* @__PURE__ */
|
|
32378
|
+
/* @__PURE__ */ jsx145(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ jsx145(EventDetails, { onClose: handleClose, selectedEvent }) })
|
|
32256
32379
|
]
|
|
32257
32380
|
}
|
|
32258
32381
|
)
|
|
@@ -32303,11 +32426,10 @@ async function fetchConnectedTracesWaterfall(api, traceIds, allSpans = /* @__PUR
|
|
|
32303
32426
|
}
|
|
32304
32427
|
var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
32305
32428
|
const api = useAppInspectorApi();
|
|
32306
|
-
const
|
|
32307
|
-
const [
|
|
32308
|
-
const [
|
|
32309
|
-
const
|
|
32310
|
-
const fetchSpans = useCallback10(async () => {
|
|
32429
|
+
const [spans, setSpans] = useState19();
|
|
32430
|
+
const [loading, setLoading] = useState19(false);
|
|
32431
|
+
const [fetchError, setFetchError] = useState19();
|
|
32432
|
+
const fetchSpans = useCallback11(async () => {
|
|
32311
32433
|
setLoading(true);
|
|
32312
32434
|
try {
|
|
32313
32435
|
const spans2 = await fetchConnectedTraces(api, traceId);
|
|
@@ -32323,24 +32445,24 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32323
32445
|
useEffect21(() => {
|
|
32324
32446
|
void fetchSpans();
|
|
32325
32447
|
}, [fetchSpans]);
|
|
32326
|
-
const [open, setOpen] =
|
|
32327
|
-
const [selectedEvent, setSelectedEvent] =
|
|
32328
|
-
const spansReference =
|
|
32448
|
+
const [open, setOpen] = useState19(true);
|
|
32449
|
+
const [selectedEvent, setSelectedEvent] = useState19(() => spans?.find((span) => span.span_id === spanId));
|
|
32450
|
+
const spansReference = useRef16();
|
|
32329
32451
|
useEffect21(() => {
|
|
32330
32452
|
if (!spansReference.current && spans) {
|
|
32331
32453
|
setSelectedEvent(spans.find((span) => span.span_id === spanId));
|
|
32332
32454
|
spansReference.current = spans;
|
|
32333
32455
|
}
|
|
32334
32456
|
}, [spans, setSelectedEvent, spanId]);
|
|
32335
|
-
const handleEventSelect =
|
|
32457
|
+
const handleEventSelect = useCallback11((spanId2) => {
|
|
32336
32458
|
const span = spans?.find((s) => s.span_id === spanId2);
|
|
32337
32459
|
setSelectedEvent(span);
|
|
32338
32460
|
setOpen(true);
|
|
32339
32461
|
}, [spans]);
|
|
32340
|
-
const navigateToSpansList =
|
|
32462
|
+
const navigateToSpansList = useCallback11(() => {
|
|
32341
32463
|
onClose?.();
|
|
32342
32464
|
}, [onClose]);
|
|
32343
|
-
return /* @__PURE__ */
|
|
32465
|
+
return /* @__PURE__ */ jsx145(
|
|
32344
32466
|
TraceGraphView,
|
|
32345
32467
|
{
|
|
32346
32468
|
fetchError,
|
|
@@ -32349,7 +32471,6 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32349
32471
|
setOpen(false);
|
|
32350
32472
|
},
|
|
32351
32473
|
handleEventSelect,
|
|
32352
|
-
headerHeight,
|
|
32353
32474
|
loading,
|
|
32354
32475
|
navigateToSpansList,
|
|
32355
32476
|
open,
|
|
@@ -32362,7 +32483,7 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32362
32483
|
};
|
|
32363
32484
|
|
|
32364
32485
|
// src/pages/spans-list-page.tsx
|
|
32365
|
-
import { Fragment as Fragment12, jsx as
|
|
32486
|
+
import { Fragment as Fragment12, jsx as jsx146, jsxs as jsxs136 } from "react/jsx-runtime";
|
|
32366
32487
|
var SpansListPage = () => {
|
|
32367
32488
|
const api = useAppInspectorApi();
|
|
32368
32489
|
const {
|
|
@@ -32386,32 +32507,32 @@ var SpansListPage = () => {
|
|
|
32386
32507
|
warningCount
|
|
32387
32508
|
} = useSpans();
|
|
32388
32509
|
const { checkStatus, phase, status, statusError } = useAppInspectorStatus();
|
|
32389
|
-
const clearSpansSync =
|
|
32510
|
+
const clearSpansSync = useCallback12(() => {
|
|
32390
32511
|
void clearSpans();
|
|
32391
32512
|
}, [clearSpans]);
|
|
32392
32513
|
const localstackVersion = status?.localstackVersion ?? (statusError instanceof AppInspectorNotFoundError ? statusError.localstackVersion : void 0);
|
|
32393
32514
|
const versionCompatibility = checkEmulatorVersion(localstackVersion);
|
|
32394
32515
|
const searchSupported = emulatorSupportsSearch(localstackVersion);
|
|
32395
|
-
const [bannerDismissed, setBannerDismissed] =
|
|
32516
|
+
const [bannerDismissed, setBannerDismissed] = useState20(false);
|
|
32396
32517
|
const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
|
|
32397
|
-
const [selectedTraceId, setSelectedTraceId] =
|
|
32398
|
-
const [selectedSpanId, setSelectedSpanId] =
|
|
32399
|
-
const navigateToSpan =
|
|
32518
|
+
const [selectedTraceId, setSelectedTraceId] = useState20();
|
|
32519
|
+
const [selectedSpanId, setSelectedSpanId] = useState20();
|
|
32520
|
+
const navigateToSpan = useCallback12((span) => {
|
|
32400
32521
|
setSelectedTraceId(span.trace_id);
|
|
32401
32522
|
setSelectedSpanId(span.span_id);
|
|
32402
32523
|
}, []);
|
|
32403
|
-
const handleRetry =
|
|
32524
|
+
const handleRetry = useCallback12(() => {
|
|
32404
32525
|
checkStatus();
|
|
32405
32526
|
fetchForward();
|
|
32406
32527
|
}, [checkStatus, fetchForward]);
|
|
32407
|
-
const handleEnable =
|
|
32528
|
+
const handleEnable = useCallback12(async () => {
|
|
32408
32529
|
await api.setStatus({ status: "ENABLED" });
|
|
32409
32530
|
clearFetchError();
|
|
32410
32531
|
checkStatus();
|
|
32411
32532
|
}, [api, checkStatus, clearFetchError]);
|
|
32412
|
-
const isDelayedRefetchRef =
|
|
32413
|
-
const delayedRefetchTimerRef =
|
|
32414
|
-
const prevFetchingForwardRef =
|
|
32533
|
+
const isDelayedRefetchRef = useRef17(false);
|
|
32534
|
+
const delayedRefetchTimerRef = useRef17();
|
|
32535
|
+
const prevFetchingForwardRef = useRef17(false);
|
|
32415
32536
|
useEffect22(() => {
|
|
32416
32537
|
const wasFetching = prevFetchingForwardRef.current;
|
|
32417
32538
|
prevFetchingForwardRef.current = fetchingForward;
|
|
@@ -32433,10 +32554,10 @@ var SpansListPage = () => {
|
|
|
32433
32554
|
switch (phase) {
|
|
32434
32555
|
case "CHECKING_STATUS":
|
|
32435
32556
|
case "CONNECTING_WS": {
|
|
32436
|
-
return /* @__PURE__ */
|
|
32557
|
+
return /* @__PURE__ */ jsx146(StatusMessage, { phase });
|
|
32437
32558
|
}
|
|
32438
32559
|
case "DISABLED": {
|
|
32439
|
-
return /* @__PURE__ */
|
|
32560
|
+
return /* @__PURE__ */ jsx146(
|
|
32440
32561
|
StatusMessage,
|
|
32441
32562
|
{
|
|
32442
32563
|
onEnable: handleEnable,
|
|
@@ -32445,7 +32566,7 @@ var SpansListPage = () => {
|
|
|
32445
32566
|
);
|
|
32446
32567
|
}
|
|
32447
32568
|
case "INCOMPATIBLE": {
|
|
32448
|
-
return /* @__PURE__ */
|
|
32569
|
+
return /* @__PURE__ */ jsx146(
|
|
32449
32570
|
StatusMessage,
|
|
32450
32571
|
{
|
|
32451
32572
|
localstackVersion,
|
|
@@ -32458,7 +32579,7 @@ var SpansListPage = () => {
|
|
|
32458
32579
|
break;
|
|
32459
32580
|
}
|
|
32460
32581
|
case "UNREACHABLE": {
|
|
32461
|
-
return /* @__PURE__ */
|
|
32582
|
+
return /* @__PURE__ */ jsx146(
|
|
32462
32583
|
StatusMessage,
|
|
32463
32584
|
{
|
|
32464
32585
|
onRetry: handleRetry,
|
|
@@ -32467,8 +32588,8 @@ var SpansListPage = () => {
|
|
|
32467
32588
|
);
|
|
32468
32589
|
}
|
|
32469
32590
|
}
|
|
32470
|
-
return /* @__PURE__ */
|
|
32471
|
-
/* @__PURE__ */
|
|
32591
|
+
return /* @__PURE__ */ jsxs136(Fragment12, { children: [
|
|
32592
|
+
/* @__PURE__ */ jsxs136(
|
|
32472
32593
|
Box19,
|
|
32473
32594
|
{
|
|
32474
32595
|
"data-testid": SPANS_LIST_PAGE_TEST_ID,
|
|
@@ -32484,7 +32605,7 @@ var SpansListPage = () => {
|
|
|
32484
32605
|
width: "100%"
|
|
32485
32606
|
},
|
|
32486
32607
|
children: [
|
|
32487
|
-
/* @__PURE__ */
|
|
32608
|
+
/* @__PURE__ */ jsx146(
|
|
32488
32609
|
EmulatorVersionBanner,
|
|
32489
32610
|
{
|
|
32490
32611
|
compatibility: bannerDismissed && versionCompatibility === "warning" ? "ok" : versionCompatibility,
|
|
@@ -32494,7 +32615,7 @@ var SpansListPage = () => {
|
|
|
32494
32615
|
} : void 0
|
|
32495
32616
|
}
|
|
32496
32617
|
),
|
|
32497
|
-
/* @__PURE__ */
|
|
32618
|
+
/* @__PURE__ */ jsx146(
|
|
32498
32619
|
SpansList,
|
|
32499
32620
|
{
|
|
32500
32621
|
clearingSpans,
|
|
@@ -32523,7 +32644,7 @@ var SpansListPage = () => {
|
|
|
32523
32644
|
]
|
|
32524
32645
|
}
|
|
32525
32646
|
),
|
|
32526
|
-
selectedTraceId !== void 0 && /* @__PURE__ */
|
|
32647
|
+
selectedTraceId !== void 0 && /* @__PURE__ */ jsx146(TraceGraphPage, { onClose: () => {
|
|
32527
32648
|
setSelectedTraceId(void 0);
|
|
32528
32649
|
}, spanId: selectedSpanId, traceId: selectedTraceId })
|
|
32529
32650
|
] });
|