@localstack/appinspector-ui 1.0.12 → 1.0.14
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 +137 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +137 -96
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2552,7 +2552,7 @@ var AwsServiceIcon = ({ hideTooltip, service, size = "medium", title }) => {
|
|
|
2552
2552
|
{
|
|
2553
2553
|
wrap: !hideTooltip,
|
|
2554
2554
|
wrapperFn: (child) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material.Tooltip, { placement: "top", title: title ?? service, children: child }),
|
|
2555
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Icon, { height, style: {
|
|
2555
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Icon, { height, style: { display: "block" }, width })
|
|
2556
2556
|
}
|
|
2557
2557
|
);
|
|
2558
2558
|
};
|
|
@@ -2560,37 +2560,44 @@ var AwsServiceIcon = ({ hideTooltip, service, size = "medium", title }) => {
|
|
|
2560
2560
|
// src/components/cells/pill-cell.tsx
|
|
2561
2561
|
var import_material2 = require("@mui/material");
|
|
2562
2562
|
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
2563
|
+
var defaultBackgroundColor = "background.paper";
|
|
2564
|
+
var defaultBorderColor = "text.secondary";
|
|
2563
2565
|
var PillCell = ({
|
|
2564
|
-
backgroundColor =
|
|
2565
|
-
borderColor =
|
|
2566
|
+
backgroundColor = defaultBackgroundColor,
|
|
2567
|
+
borderColor = defaultBorderColor,
|
|
2566
2568
|
borderWidth = "1px",
|
|
2567
2569
|
children,
|
|
2568
2570
|
height = "24px",
|
|
2569
2571
|
paddingBottom,
|
|
2570
2572
|
paddingTop
|
|
2571
|
-
}) =>
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2573
|
+
}) => {
|
|
2574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
2575
|
+
import_material2.Box,
|
|
2576
|
+
{
|
|
2577
|
+
sx: {
|
|
2578
|
+
alignItems: "center",
|
|
2579
|
+
backgroundColor,
|
|
2580
|
+
borderColor,
|
|
2581
|
+
borderRadius: "16px",
|
|
2582
|
+
borderStyle: "solid",
|
|
2583
|
+
borderWidth,
|
|
2584
|
+
display: "inline-flex",
|
|
2585
|
+
height: paddingTop || paddingBottom ? "auto" : height,
|
|
2586
|
+
maxWidth: "100%",
|
|
2587
|
+
...paddingTop && { paddingTop },
|
|
2588
|
+
...paddingBottom && { paddingBottom },
|
|
2589
|
+
overflow: "hidden"
|
|
2590
|
+
},
|
|
2591
|
+
children
|
|
2592
|
+
}
|
|
2593
|
+
);
|
|
2594
|
+
};
|
|
2588
2595
|
|
|
2589
2596
|
// src/components/cells/service-cell.tsx
|
|
2590
2597
|
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
2591
2598
|
var truncateName = (inputString, truncateLength = 15) => inputString.length > truncateLength ? `${inputString.slice(0, truncateLength - 3)}...` : inputString;
|
|
2592
2599
|
var ServiceCell = ({
|
|
2593
|
-
borderColor,
|
|
2600
|
+
borderColor = defaultBorderColor,
|
|
2594
2601
|
borderWidth,
|
|
2595
2602
|
height = "24px",
|
|
2596
2603
|
resource,
|
|
@@ -2605,9 +2612,9 @@ var ServiceCell = ({
|
|
|
2605
2612
|
{
|
|
2606
2613
|
sx: {
|
|
2607
2614
|
alignItems: "center",
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2615
|
+
borderRightColor: borderColor,
|
|
2616
|
+
borderRightStyle: "solid",
|
|
2617
|
+
borderRightWidth: `1px`,
|
|
2611
2618
|
display: "flex",
|
|
2612
2619
|
height,
|
|
2613
2620
|
justifyContent: "center",
|
|
@@ -2622,7 +2629,7 @@ var ServiceCell = ({
|
|
|
2622
2629
|
import_material3.Typography,
|
|
2623
2630
|
{
|
|
2624
2631
|
sx: {
|
|
2625
|
-
borderRight: resource ?
|
|
2632
|
+
borderRight: resource ? `1px solid ${borderColor}` : "none",
|
|
2626
2633
|
fontWeight: "bold",
|
|
2627
2634
|
overflow: "hidden",
|
|
2628
2635
|
padding: "1px 8px",
|
|
@@ -2641,7 +2648,7 @@ var ServiceCell = ({
|
|
|
2641
2648
|
children: service
|
|
2642
2649
|
}
|
|
2643
2650
|
),
|
|
2644
|
-
resource && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
2651
|
+
resource !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
2645
2652
|
import_material3.Typography,
|
|
2646
2653
|
{
|
|
2647
2654
|
sx: {
|
|
@@ -3764,7 +3771,7 @@ var ServiceNode = (0, import_react12.memo)(function ServiceNode2({ data, selecte
|
|
|
3764
3771
|
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3765
3772
|
ServiceCell,
|
|
3766
3773
|
{
|
|
3767
|
-
borderColor: selected ? "
|
|
3774
|
+
borderColor: selected ? "text.primary" : "text.secondary",
|
|
3768
3775
|
borderWidth: selected ? "1.5px" : "1px",
|
|
3769
3776
|
height: "32px",
|
|
3770
3777
|
resource: data.event.resource_name,
|
|
@@ -4189,72 +4196,23 @@ var StyledDrawer = (0, import_styles.styled)(import_material15.Drawer)(() => ({
|
|
|
4189
4196
|
"position": "relative",
|
|
4190
4197
|
"width": DRAWER_WIDTH
|
|
4191
4198
|
}));
|
|
4192
|
-
var
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
} catch (error) {
|
|
4209
|
-
console.error(error);
|
|
4210
|
-
setFetchError(error instanceof Error ? error : new Error("Unknown error", { cause: error }));
|
|
4211
|
-
} finally {
|
|
4212
|
-
setLoading(false);
|
|
4213
|
-
}
|
|
4214
|
-
}, [api, traceId]);
|
|
4215
|
-
(0, import_react19.useEffect)(() => {
|
|
4216
|
-
void fetchSpans();
|
|
4217
|
-
}, [fetchSpans]);
|
|
4218
|
-
const [open, setOpen] = (0, import_react19.useState)(true);
|
|
4219
|
-
const [selectedEvent, setSelectedEvent] = (0, import_react19.useState)();
|
|
4220
|
-
const [viewPortPixelWidth, setViewPortPixelWidth] = (0, import_react19.useState)(0);
|
|
4221
|
-
const { checkStatus, error: statusError, status } = useStatus();
|
|
4222
|
-
const calculateDrawerWidth = (0, import_react19.useCallback)(() => {
|
|
4223
|
-
const percentageMatch = /(\d+)%/.exec(DRAWER_WIDTH);
|
|
4224
|
-
if (percentageMatch && open) {
|
|
4225
|
-
const percentage = Number.parseInt(percentageMatch[1], 10);
|
|
4226
|
-
return window.innerWidth * percentage / 100;
|
|
4227
|
-
}
|
|
4228
|
-
return 0;
|
|
4229
|
-
}, [open]);
|
|
4230
|
-
(0, import_react19.useEffect)(() => {
|
|
4231
|
-
const updateViewportWidth = () => {
|
|
4232
|
-
const totalWidth = window.innerWidth;
|
|
4233
|
-
const drawerPixelWidth = open ? calculateDrawerWidth() : 0;
|
|
4234
|
-
setViewPortPixelWidth(totalWidth - drawerPixelWidth);
|
|
4235
|
-
};
|
|
4236
|
-
updateViewportWidth();
|
|
4237
|
-
const timeoutId = setTimeout(updateViewportWidth, 50);
|
|
4238
|
-
window.addEventListener("resize", updateViewportWidth);
|
|
4239
|
-
return () => {
|
|
4240
|
-
window.removeEventListener("resize", updateViewportWidth);
|
|
4241
|
-
clearTimeout(timeoutId);
|
|
4242
|
-
};
|
|
4243
|
-
}, [open, calculateDrawerWidth]);
|
|
4244
|
-
const handleEventSelect = (0, import_react19.useCallback)((event) => {
|
|
4245
|
-
setSelectedEvent(event);
|
|
4246
|
-
setOpen(true);
|
|
4247
|
-
}, []);
|
|
4248
|
-
const handleRetry = (0, import_react19.useCallback)(() => {
|
|
4249
|
-
void checkStatus();
|
|
4250
|
-
}, [checkStatus]);
|
|
4199
|
+
var TraceGraphView = ({
|
|
4200
|
+
fetchError,
|
|
4201
|
+
fetchSpans,
|
|
4202
|
+
handleEventSelect,
|
|
4203
|
+
handleRetry,
|
|
4204
|
+
loading,
|
|
4205
|
+
navigateToSpansList,
|
|
4206
|
+
open,
|
|
4207
|
+
selectedEvent,
|
|
4208
|
+
spanId,
|
|
4209
|
+
spans,
|
|
4210
|
+
status,
|
|
4211
|
+
statusError,
|
|
4212
|
+
traceId,
|
|
4213
|
+
viewPortPixelWidth
|
|
4214
|
+
}) => {
|
|
4251
4215
|
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
4252
|
-
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
4253
|
-
const { resolveLink } = useAppInspector();
|
|
4254
|
-
const navigateToSpansList = (0, import_react19.useCallback)(() => {
|
|
4255
|
-
const url = resolveLink({ to: "spans-list" });
|
|
4256
|
-
navigate(url);
|
|
4257
|
-
}, [navigate, resolveLink]);
|
|
4258
4216
|
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
4259
4217
|
import_material15.Box,
|
|
4260
4218
|
{
|
|
@@ -4305,7 +4263,7 @@ var TraceGraphPage = () => {
|
|
|
4305
4263
|
initialFocusEventId: spanId,
|
|
4306
4264
|
onEventSelect: handleEventSelect,
|
|
4307
4265
|
onRefresh: () => {
|
|
4308
|
-
|
|
4266
|
+
fetchSpans();
|
|
4309
4267
|
},
|
|
4310
4268
|
spans: {
|
|
4311
4269
|
data: spans,
|
|
@@ -4317,9 +4275,7 @@ var TraceGraphPage = () => {
|
|
|
4317
4275
|
) })
|
|
4318
4276
|
}
|
|
4319
4277
|
) }),
|
|
4320
|
-
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(EventDetails, {
|
|
4321
|
-
setOpen(false);
|
|
4322
|
-
}, selectedEvent }) })
|
|
4278
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(EventDetails, { selectedEvent }) })
|
|
4323
4279
|
] })
|
|
4324
4280
|
}
|
|
4325
4281
|
)
|
|
@@ -4327,6 +4283,91 @@ var TraceGraphPage = () => {
|
|
|
4327
4283
|
}
|
|
4328
4284
|
);
|
|
4329
4285
|
};
|
|
4286
|
+
var TraceGraphPage = () => {
|
|
4287
|
+
const { traceId } = (0, import_react_router_dom2.useParams)();
|
|
4288
|
+
const [searchParameters] = (0, import_react_router_dom2.useSearchParams)();
|
|
4289
|
+
const spanId = searchParameters.get("spanId");
|
|
4290
|
+
const api = useAppInspectorApi();
|
|
4291
|
+
const [spans, setSpans] = (0, import_react19.useState)();
|
|
4292
|
+
const [loading, setLoading] = (0, import_react19.useState)(false);
|
|
4293
|
+
const [fetchError, setFetchError] = (0, import_react19.useState)();
|
|
4294
|
+
const fetchSpans = (0, import_react19.useCallback)(async () => {
|
|
4295
|
+
setLoading(true);
|
|
4296
|
+
try {
|
|
4297
|
+
const response = await api.getSpans({
|
|
4298
|
+
trace_id: traceId
|
|
4299
|
+
});
|
|
4300
|
+
setSpans(response.spans);
|
|
4301
|
+
setFetchError(void 0);
|
|
4302
|
+
} catch (error) {
|
|
4303
|
+
console.error(error);
|
|
4304
|
+
setFetchError(error instanceof Error ? error : new Error("Unknown error", { cause: error }));
|
|
4305
|
+
} finally {
|
|
4306
|
+
setLoading(false);
|
|
4307
|
+
}
|
|
4308
|
+
}, [api, traceId]);
|
|
4309
|
+
(0, import_react19.useEffect)(() => {
|
|
4310
|
+
void fetchSpans();
|
|
4311
|
+
}, [fetchSpans]);
|
|
4312
|
+
const [open, setOpen] = (0, import_react19.useState)(true);
|
|
4313
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react19.useState)();
|
|
4314
|
+
const [viewPortPixelWidth, setViewPortPixelWidth] = (0, import_react19.useState)(0);
|
|
4315
|
+
const { checkStatus, error: statusError, status } = useStatus();
|
|
4316
|
+
const calculateDrawerWidth = (0, import_react19.useCallback)(() => {
|
|
4317
|
+
const percentageMatch = /(\d+)%/.exec(DRAWER_WIDTH);
|
|
4318
|
+
if (percentageMatch && open) {
|
|
4319
|
+
const percentage = Number.parseInt(percentageMatch[1], 10);
|
|
4320
|
+
return window.innerWidth * percentage / 100;
|
|
4321
|
+
}
|
|
4322
|
+
return 0;
|
|
4323
|
+
}, [open]);
|
|
4324
|
+
(0, import_react19.useEffect)(() => {
|
|
4325
|
+
const updateViewportWidth = () => {
|
|
4326
|
+
const totalWidth = window.innerWidth;
|
|
4327
|
+
const drawerPixelWidth = open ? calculateDrawerWidth() : 0;
|
|
4328
|
+
setViewPortPixelWidth(totalWidth - drawerPixelWidth);
|
|
4329
|
+
};
|
|
4330
|
+
updateViewportWidth();
|
|
4331
|
+
const timeoutId = setTimeout(updateViewportWidth, 50);
|
|
4332
|
+
window.addEventListener("resize", updateViewportWidth);
|
|
4333
|
+
return () => {
|
|
4334
|
+
window.removeEventListener("resize", updateViewportWidth);
|
|
4335
|
+
clearTimeout(timeoutId);
|
|
4336
|
+
};
|
|
4337
|
+
}, [open, calculateDrawerWidth]);
|
|
4338
|
+
const handleEventSelect = (0, import_react19.useCallback)((event) => {
|
|
4339
|
+
setSelectedEvent(event);
|
|
4340
|
+
setOpen(true);
|
|
4341
|
+
}, []);
|
|
4342
|
+
const handleRetry = (0, import_react19.useCallback)(() => {
|
|
4343
|
+
void checkStatus();
|
|
4344
|
+
}, [checkStatus]);
|
|
4345
|
+
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
4346
|
+
const { resolveLink } = useAppInspector();
|
|
4347
|
+
const navigateToSpansList = (0, import_react19.useCallback)(() => {
|
|
4348
|
+
const url = resolveLink({ to: "spans-list" });
|
|
4349
|
+
navigate(url);
|
|
4350
|
+
}, [navigate, resolveLink]);
|
|
4351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
4352
|
+
TraceGraphView,
|
|
4353
|
+
{
|
|
4354
|
+
fetchError,
|
|
4355
|
+
fetchSpans: () => void fetchSpans(),
|
|
4356
|
+
handleEventSelect,
|
|
4357
|
+
handleRetry,
|
|
4358
|
+
loading,
|
|
4359
|
+
navigateToSpansList,
|
|
4360
|
+
open,
|
|
4361
|
+
selectedEvent,
|
|
4362
|
+
spanId: spanId ?? void 0,
|
|
4363
|
+
spans,
|
|
4364
|
+
status,
|
|
4365
|
+
statusError,
|
|
4366
|
+
traceId,
|
|
4367
|
+
viewPortPixelWidth
|
|
4368
|
+
}
|
|
4369
|
+
);
|
|
4370
|
+
};
|
|
4330
4371
|
|
|
4331
4372
|
// src/routes.ts
|
|
4332
4373
|
var routes = {
|