@localstack/appinspector-ui 1.0.19 → 1.0.20
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 +91 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +45 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3626,12 +3626,13 @@ var SpansListPage = () => {
|
|
|
3626
3626
|
var import_icons_material11 = require("@mui/icons-material");
|
|
3627
3627
|
var import_material21 = require("@mui/material");
|
|
3628
3628
|
var import_styles = require("@mui/material/styles");
|
|
3629
|
-
var
|
|
3630
|
-
var
|
|
3629
|
+
var import_react21 = require("@xyflow/react");
|
|
3630
|
+
var import_react22 = require("react");
|
|
3631
3631
|
var import_react_router_dom2 = require("react-router-dom");
|
|
3632
3632
|
|
|
3633
3633
|
// src/components/event-details/event-details.tsx
|
|
3634
3634
|
var import_material16 = require("@mui/material");
|
|
3635
|
+
var import_react12 = require("react");
|
|
3635
3636
|
|
|
3636
3637
|
// src/utils/iam-utils.ts
|
|
3637
3638
|
function determinePermissionStatus(payload) {
|
|
@@ -3901,7 +3902,7 @@ var DetailRow = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime13
|
|
|
3901
3902
|
{
|
|
3902
3903
|
sx: {
|
|
3903
3904
|
color: "text.secondary",
|
|
3904
|
-
fontWeight:
|
|
3905
|
+
fontWeight: 600
|
|
3905
3906
|
},
|
|
3906
3907
|
variant: "body2",
|
|
3907
3908
|
children: label
|
|
@@ -3936,11 +3937,11 @@ var PermissionIcon = ({ status }) => {
|
|
|
3936
3937
|
var IAMEventDetail = ({ event }) => {
|
|
3937
3938
|
const payloadString = event.attributes?.payload;
|
|
3938
3939
|
if (!payloadString) {
|
|
3939
|
-
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Box, { sx: { p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, {
|
|
3940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Box, { sx: { p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "body2", children: "No IAM policy evaluation data available" }) });
|
|
3940
3941
|
}
|
|
3941
3942
|
const parsedIAM = parseIAMEvent(payloadString);
|
|
3942
3943
|
if (!parsedIAM) {
|
|
3943
|
-
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Box, { sx: { p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, {
|
|
3944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Box, { sx: { p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "body2", children: "Failed to parse IAM event data" }) });
|
|
3944
3945
|
}
|
|
3945
3946
|
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Box, { sx: { p: 2 }, children: [
|
|
3946
3947
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Box, { sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
@@ -3965,9 +3966,7 @@ var IAMEventDetail = ({ event }) => {
|
|
|
3965
3966
|
import_material11.Typography,
|
|
3966
3967
|
{
|
|
3967
3968
|
sx: {
|
|
3968
|
-
color: "text.primary"
|
|
3969
|
-
fontFamily: "monospace",
|
|
3970
|
-
fontSize: "0.85rem"
|
|
3969
|
+
color: "text.primary"
|
|
3971
3970
|
},
|
|
3972
3971
|
variant: "body2",
|
|
3973
3972
|
children: action
|
|
@@ -3985,8 +3984,6 @@ var IAMEventDetail = ({ event }) => {
|
|
|
3985
3984
|
{
|
|
3986
3985
|
sx: {
|
|
3987
3986
|
color: "text.primary",
|
|
3988
|
-
fontFamily: "monospace",
|
|
3989
|
-
fontSize: "0.85rem",
|
|
3990
3987
|
wordBreak: "break-all"
|
|
3991
3988
|
},
|
|
3992
3989
|
variant: "body2",
|
|
@@ -3998,19 +3995,19 @@ var IAMEventDetail = ({ event }) => {
|
|
|
3998
3995
|
}
|
|
3999
3996
|
),
|
|
4000
3997
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Box, { sx: { mt: 2 }, children: [
|
|
4001
|
-
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, {
|
|
3998
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { sx: { fontWeight: 600, mb: 1 }, variant: "caption", children: "Policy Evaluation" }),
|
|
4002
3999
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Grid, { container: true, spacing: 2, children: [
|
|
4003
4000
|
parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Grid, { item: true, xs: 4, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Box, { sx: { textAlign: "center" }, children: [
|
|
4004
4001
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { color: "success.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.explicitAllows }),
|
|
4005
|
-
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, {
|
|
4002
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Allows" })
|
|
4006
4003
|
] }) }),
|
|
4007
4004
|
parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Grid, { item: true, xs: 4, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Box, { sx: { textAlign: "center" }, children: [
|
|
4008
4005
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { color: "error.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.explicitDenies }),
|
|
4009
|
-
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, {
|
|
4006
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Denies" })
|
|
4010
4007
|
] }) }),
|
|
4011
4008
|
parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Grid, { item: true, xs: 4, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Box, { sx: { textAlign: "center" }, children: [
|
|
4012
4009
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { color: "warning.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.implicitDenies }),
|
|
4013
|
-
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, {
|
|
4010
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Implicit Denies" })
|
|
4014
4011
|
] }) })
|
|
4015
4012
|
] })
|
|
4016
4013
|
] })
|
|
@@ -4067,8 +4064,8 @@ var IAMPermissionItem = ({ event }) => {
|
|
|
4067
4064
|
)
|
|
4068
4065
|
] }),
|
|
4069
4066
|
isOpen && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material12.Box, { sx: { ml: 4, mt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material12.Box, { children: [
|
|
4070
|
-
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material12.Typography, {
|
|
4071
|
-
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material12.Typography, {
|
|
4067
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material12.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Principal" }),
|
|
4068
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material12.Typography, { variant: "body2", children: parsedIAM.principal })
|
|
4072
4069
|
] }) })
|
|
4073
4070
|
] });
|
|
4074
4071
|
};
|
|
@@ -4082,7 +4079,7 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime1
|
|
|
4082
4079
|
{
|
|
4083
4080
|
sx: {
|
|
4084
4081
|
color: "text.primary",
|
|
4085
|
-
fontWeight:
|
|
4082
|
+
fontWeight: 600
|
|
4086
4083
|
},
|
|
4087
4084
|
variant: "body1",
|
|
4088
4085
|
children: label
|
|
@@ -4149,7 +4146,7 @@ var EventMessage = ({ event }) => {
|
|
|
4149
4146
|
ref: textReference,
|
|
4150
4147
|
sx: {
|
|
4151
4148
|
color: "text.primary",
|
|
4152
|
-
fontWeight:
|
|
4149
|
+
fontWeight: 600,
|
|
4153
4150
|
maxWidth: "100%",
|
|
4154
4151
|
ml: shouldShowToggle ? 0 : 4,
|
|
4155
4152
|
overflow: "hidden",
|
|
@@ -4206,10 +4203,9 @@ var EventDetail = ({
|
|
|
4206
4203
|
{
|
|
4207
4204
|
sx: {
|
|
4208
4205
|
alignItems: "left",
|
|
4209
|
-
color: "text.secondary",
|
|
4210
4206
|
display: "flex",
|
|
4211
4207
|
flexGrow: 1,
|
|
4212
|
-
fontWeight:
|
|
4208
|
+
fontWeight: 600
|
|
4213
4209
|
},
|
|
4214
4210
|
variant: "subtitle1",
|
|
4215
4211
|
children: displayText
|
|
@@ -4241,7 +4237,7 @@ var EventDetail = ({
|
|
|
4241
4237
|
color: "text.secondary",
|
|
4242
4238
|
display: "flex",
|
|
4243
4239
|
flexGrow: 1,
|
|
4244
|
-
fontWeight:
|
|
4240
|
+
fontWeight: 600,
|
|
4245
4241
|
ml: 1,
|
|
4246
4242
|
mr: 2
|
|
4247
4243
|
},
|
|
@@ -4348,6 +4344,10 @@ var EventSection = ({
|
|
|
4348
4344
|
// src/components/event-details/event-details.tsx
|
|
4349
4345
|
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
4350
4346
|
var EventDetails = ({ onClose, selectedEvent }) => {
|
|
4347
|
+
const attributes = (0, import_react12.useMemo)(() => {
|
|
4348
|
+
const attributes2 = Object.entries(selectedEvent?.attributes ?? {});
|
|
4349
|
+
return attributes2.filter(([key]) => key !== "localstack.aws.account_id" && key !== "localstack.aws.service");
|
|
4350
|
+
}, [selectedEvent?.attributes]);
|
|
4351
4351
|
if (!selectedEvent) {
|
|
4352
4352
|
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Box, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { color: "text.secondary", variant: "body2", children: "Select an event to view details" }) });
|
|
4353
4353
|
}
|
|
@@ -4356,41 +4356,41 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
4356
4356
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Box, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Stack, { spacing: 2, children: [
|
|
4357
4357
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Stack, { spacing: 1, children: [
|
|
4358
4358
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4359
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4359
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Span ID" }),
|
|
4360
4360
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.span_id })
|
|
4361
4361
|
] }),
|
|
4362
4362
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4363
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4364
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4363
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Trace ID" }),
|
|
4364
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.trace_id })
|
|
4365
4365
|
] }),
|
|
4366
4366
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4367
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4367
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Operation" }),
|
|
4368
4368
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.operation_name })
|
|
4369
4369
|
] })
|
|
4370
4370
|
] }) }),
|
|
4371
4371
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Divider, {}),
|
|
4372
4372
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ToggleSection, { headline: "Service Information", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Stack, { spacing: 1, children: [
|
|
4373
4373
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4374
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4374
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Service" }),
|
|
4375
4375
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.service_name })
|
|
4376
4376
|
] }),
|
|
4377
4377
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4378
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4378
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource" }),
|
|
4379
4379
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.resource_name })
|
|
4380
4380
|
] }),
|
|
4381
4381
|
Boolean(selectedEvent.region) && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4382
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4382
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Region" }),
|
|
4383
4383
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.region })
|
|
4384
4384
|
] })
|
|
4385
4385
|
] }) }),
|
|
4386
4386
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Divider, {}),
|
|
4387
4387
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ToggleSection, { headline: "Timing", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Stack, { spacing: 1, children: [
|
|
4388
4388
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4389
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4389
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Start Time" }),
|
|
4390
4390
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
|
|
4391
4391
|
] }),
|
|
4392
4392
|
Boolean(selectedEvent.end_time_unix_nano) && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4393
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4393
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Duration" }),
|
|
4394
4394
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Typography, { variant: "body2", children: [
|
|
4395
4395
|
((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString(),
|
|
4396
4396
|
" ",
|
|
@@ -4420,33 +4420,45 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
4420
4420
|
}
|
|
4421
4421
|
)
|
|
4422
4422
|
] }),
|
|
4423
|
-
|
|
4423
|
+
attributes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, { children: [
|
|
4424
4424
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Divider, {}),
|
|
4425
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ToggleSection, { headline: "Attributes", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.
|
|
4425
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ToggleSection, { headline: "Attributes", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Stack, { spacing: 1, children: attributes.map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4426
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: key }),
|
|
4427
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: renderKeyValue(key, value) })
|
|
4428
|
+
] }, key)) }) })
|
|
4426
4429
|
] })
|
|
4427
4430
|
] }) })
|
|
4428
4431
|
] });
|
|
4429
4432
|
};
|
|
4433
|
+
function renderKeyValue(key, value) {
|
|
4434
|
+
if (typeof value === "string" && (key === "localstack.aws.service.request" || key === "localstack.aws.service.response" || key === "localstack.aws.service.exception")) {
|
|
4435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Box, { sx: { backgroundColor: (theme) => theme.palette.background.default, borderRadius: 1, p: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("pre", { style: { margin: 0, overflow: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: JSON.stringify(JSON.parse(value), void 0, 2) }) }) });
|
|
4436
|
+
}
|
|
4437
|
+
if (typeof value === "boolean") {
|
|
4438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: value ? "yes" : "no" });
|
|
4439
|
+
}
|
|
4440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: value });
|
|
4441
|
+
}
|
|
4430
4442
|
|
|
4431
4443
|
// src/components/trace-graph/trace-graph.tsx
|
|
4432
4444
|
var import_base = require("@xyflow/react/dist/base.css");
|
|
4433
4445
|
var import_material20 = require("@mui/material");
|
|
4434
|
-
var
|
|
4435
|
-
var
|
|
4446
|
+
var import_react19 = require("@xyflow/react");
|
|
4447
|
+
var import_react20 = require("react");
|
|
4436
4448
|
|
|
4437
4449
|
// src/components/trace-graph/service-node.tsx
|
|
4438
4450
|
var import_material18 = require("@mui/material");
|
|
4439
4451
|
var import_style = require("@xyflow/react/dist/style.css");
|
|
4440
|
-
var
|
|
4441
|
-
var
|
|
4452
|
+
var import_react14 = require("@xyflow/react");
|
|
4453
|
+
var import_react15 = require("react");
|
|
4442
4454
|
|
|
4443
4455
|
// src/components/trace-graph/problem-indicator.tsx
|
|
4444
4456
|
var import_icons_material9 = require("@mui/icons-material");
|
|
4445
4457
|
var import_material17 = require("@mui/material");
|
|
4446
|
-
var
|
|
4458
|
+
var import_react13 = require("react");
|
|
4447
4459
|
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
4448
4460
|
var ProblemIndicator = ({ error }) => {
|
|
4449
|
-
const icon = (0,
|
|
4461
|
+
const icon = (0, import_react13.useMemo)(() => {
|
|
4450
4462
|
switch (error.level) {
|
|
4451
4463
|
case "error": {
|
|
4452
4464
|
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_icons_material9.Error, { sx: { color: "#d32f2f", fontSize: "14px" } });
|
|
@@ -4459,7 +4471,7 @@ var ProblemIndicator = ({ error }) => {
|
|
|
4459
4471
|
}
|
|
4460
4472
|
}
|
|
4461
4473
|
}, [error.level]);
|
|
4462
|
-
const color = (0,
|
|
4474
|
+
const color = (0, import_react13.useMemo)(() => {
|
|
4463
4475
|
switch (error.level) {
|
|
4464
4476
|
case "error": {
|
|
4465
4477
|
return "#d32f2f";
|
|
@@ -4498,11 +4510,11 @@ var handleStyle = {
|
|
|
4498
4510
|
borderColor: "lightgray",
|
|
4499
4511
|
opacity: 0
|
|
4500
4512
|
};
|
|
4501
|
-
var ServiceNode = (0,
|
|
4502
|
-
const handleClick = (0,
|
|
4513
|
+
var ServiceNode = (0, import_react15.memo)(function ServiceNode2({ data, selected }) {
|
|
4514
|
+
const handleClick = (0, import_react15.useCallback)(() => {
|
|
4503
4515
|
data.onEventSelect(data.event);
|
|
4504
4516
|
}, [data]);
|
|
4505
|
-
const handleKeyPress = (0,
|
|
4517
|
+
const handleKeyPress = (0, import_react15.useCallback)(
|
|
4506
4518
|
(event) => {
|
|
4507
4519
|
if (event.key === "Enter" || event.key === " ") {
|
|
4508
4520
|
handleClick();
|
|
@@ -4535,8 +4547,8 @@ var ServiceNode = (0, import_react14.memo)(function ServiceNode2({ data, selecte
|
|
|
4535
4547
|
},
|
|
4536
4548
|
tabIndex: 0,
|
|
4537
4549
|
children: [
|
|
4538
|
-
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
4539
|
-
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
4550
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_react14.Handle, { position: import_react14.Position.Left, style: handleStyle, type: "target" }),
|
|
4551
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_react14.Handle, { position: import_react14.Position.Right, style: handleStyle, type: "source" }),
|
|
4540
4552
|
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
4541
4553
|
ServiceCell,
|
|
4542
4554
|
{
|
|
@@ -4597,7 +4609,7 @@ var ServiceNode = (0, import_react14.memo)(function ServiceNode2({ data, selecte
|
|
|
4597
4609
|
|
|
4598
4610
|
// src/components/trace-graph/utils.ts
|
|
4599
4611
|
var import_dagre = __toESM(require("@dagrejs/dagre"), 1);
|
|
4600
|
-
var
|
|
4612
|
+
var import_react16 = require("@xyflow/react");
|
|
4601
4613
|
var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
4602
4614
|
const nodes = [];
|
|
4603
4615
|
const edges = [];
|
|
@@ -4614,8 +4626,8 @@ var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
|
4614
4626
|
id: event.span_id,
|
|
4615
4627
|
position: { x: 0, y: 0 },
|
|
4616
4628
|
// Will be set by layout
|
|
4617
|
-
sourcePosition:
|
|
4618
|
-
targetPosition:
|
|
4629
|
+
sourcePosition: import_react16.Position.Right,
|
|
4630
|
+
targetPosition: import_react16.Position.Left,
|
|
4619
4631
|
type: "service"
|
|
4620
4632
|
});
|
|
4621
4633
|
if (parentId) {
|
|
@@ -4625,7 +4637,7 @@ var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
|
4625
4637
|
markerEnd: {
|
|
4626
4638
|
color: "lightgray",
|
|
4627
4639
|
height: 16,
|
|
4628
|
-
type:
|
|
4640
|
+
type: import_react16.MarkerType.Arrow,
|
|
4629
4641
|
width: 16
|
|
4630
4642
|
},
|
|
4631
4643
|
source: parentId,
|
|
@@ -4690,8 +4702,8 @@ var calculateCenterX = (focusNodeX, viewPortPixelWidth, minX, maxX) => {
|
|
|
4690
4702
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
4691
4703
|
var import_icons_material10 = require("@mui/icons-material");
|
|
4692
4704
|
var import_material19 = require("@mui/material");
|
|
4693
|
-
var
|
|
4694
|
-
var
|
|
4705
|
+
var import_react17 = require("@xyflow/react");
|
|
4706
|
+
var import_react18 = require("react");
|
|
4695
4707
|
|
|
4696
4708
|
// node_modules/zustand/esm/shallow.mjs
|
|
4697
4709
|
function shallow$1(objA, objB) {
|
|
@@ -4738,9 +4750,9 @@ var selector = (s) => ({
|
|
|
4738
4750
|
maxZoomReached: s.transform[2] >= s.maxZoom,
|
|
4739
4751
|
minZoomReached: s.transform[2] <= s.minZoom
|
|
4740
4752
|
});
|
|
4741
|
-
var Controls = (0,
|
|
4742
|
-
const { maxZoomReached, minZoomReached } = (0,
|
|
4743
|
-
const { fitView, zoomIn, zoomOut } = (0,
|
|
4753
|
+
var Controls = (0, import_react18.memo)(() => {
|
|
4754
|
+
const { maxZoomReached, minZoomReached } = (0, import_react17.useStore)(selector, shallow$1);
|
|
4755
|
+
const { fitView, zoomIn, zoomOut } = (0, import_react17.useReactFlow)();
|
|
4744
4756
|
const onZoomInHandler = () => {
|
|
4745
4757
|
void zoomIn();
|
|
4746
4758
|
};
|
|
@@ -4810,12 +4822,12 @@ var TraceGraph = ({
|
|
|
4810
4822
|
spans,
|
|
4811
4823
|
viewPortPixelWidth
|
|
4812
4824
|
}) => {
|
|
4813
|
-
const [nodes, setNodes] = (0,
|
|
4814
|
-
const [edges, setEdges] = (0,
|
|
4815
|
-
const [initialViewSet, setInitialViewSet] = (0,
|
|
4816
|
-
const { fitView, setCenter } = (0,
|
|
4817
|
-
const store = (0,
|
|
4818
|
-
const updateSelectedNode = (0,
|
|
4825
|
+
const [nodes, setNodes] = (0, import_react20.useState)([]);
|
|
4826
|
+
const [edges, setEdges] = (0, import_react20.useState)([]);
|
|
4827
|
+
const [initialViewSet, setInitialViewSet] = (0, import_react20.useState)(false);
|
|
4828
|
+
const { fitView, setCenter } = (0, import_react19.useReactFlow)();
|
|
4829
|
+
const store = (0, import_react19.useStoreApi)();
|
|
4830
|
+
const updateSelectedNode = (0, import_react20.useCallback)(
|
|
4819
4831
|
(nodeId) => {
|
|
4820
4832
|
const { addSelectedNodes } = store.getState();
|
|
4821
4833
|
if (nodeId) {
|
|
@@ -4827,7 +4839,7 @@ var TraceGraph = ({
|
|
|
4827
4839
|
},
|
|
4828
4840
|
[nodes, store]
|
|
4829
4841
|
);
|
|
4830
|
-
(0,
|
|
4842
|
+
(0, import_react20.useEffect)(() => {
|
|
4831
4843
|
const spansMap = /* @__PURE__ */ new Map();
|
|
4832
4844
|
const rootSpans = [];
|
|
4833
4845
|
for (const span of spans.data ?? []) {
|
|
@@ -4859,7 +4871,7 @@ var TraceGraph = ({
|
|
|
4859
4871
|
setNodes(layoutedNodes);
|
|
4860
4872
|
setEdges(layoutedEdges);
|
|
4861
4873
|
}, [onEventSelect, spans.data]);
|
|
4862
|
-
(0,
|
|
4874
|
+
(0, import_react20.useEffect)(() => {
|
|
4863
4875
|
const shouldSetInitialView = !spans.loading && nodes.length > 0 && !initialViewSet;
|
|
4864
4876
|
if (shouldSetInitialView) {
|
|
4865
4877
|
if (initialFocusEventId) {
|
|
@@ -4879,12 +4891,12 @@ var TraceGraph = ({
|
|
|
4879
4891
|
setInitialViewSet(true);
|
|
4880
4892
|
}
|
|
4881
4893
|
}, [spans.loading, nodes, initialFocusEventId, viewPortPixelWidth, setCenter, fitView, onEventSelect, initialViewSet]);
|
|
4882
|
-
(0,
|
|
4894
|
+
(0, import_react20.useEffect)(() => {
|
|
4883
4895
|
if (initialFocusEventId) {
|
|
4884
4896
|
updateSelectedNode(initialFocusEventId);
|
|
4885
4897
|
}
|
|
4886
4898
|
}, [initialFocusEventId, updateSelectedNode]);
|
|
4887
|
-
const onNodeClick = (0,
|
|
4899
|
+
const onNodeClick = (0, import_react20.useCallback)((_event, node) => {
|
|
4888
4900
|
onEventSelect(node.data.event);
|
|
4889
4901
|
updateSelectedNode(node.id);
|
|
4890
4902
|
}, [onEventSelect, updateSelectedNode]);
|
|
@@ -4904,7 +4916,7 @@ var TraceGraph = ({
|
|
|
4904
4916
|
}
|
|
4905
4917
|
),
|
|
4906
4918
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
4907
|
-
|
|
4919
|
+
import_react19.ReactFlow,
|
|
4908
4920
|
{
|
|
4909
4921
|
"data-testid": "trace-graph",
|
|
4910
4922
|
defaultViewport: { x: 0, y: 0, zoom: 1 },
|
|
@@ -4918,7 +4930,7 @@ var TraceGraph = ({
|
|
|
4918
4930
|
selectNodesOnDrag: false,
|
|
4919
4931
|
children: [
|
|
4920
4932
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(Controls, {}),
|
|
4921
|
-
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
4933
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_react19.Background, {})
|
|
4922
4934
|
]
|
|
4923
4935
|
}
|
|
4924
4936
|
)
|
|
@@ -5019,7 +5031,7 @@ var TraceGraphView = ({
|
|
|
5019
5031
|
height: "100%",
|
|
5020
5032
|
overflow: "auto"
|
|
5021
5033
|
},
|
|
5022
|
-
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
5034
|
+
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_react21.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
5023
5035
|
TraceGraph,
|
|
5024
5036
|
{
|
|
5025
5037
|
initialFocusEventId: spanId,
|
|
@@ -5050,10 +5062,10 @@ var TraceGraphPage = () => {
|
|
|
5050
5062
|
const [searchParameters] = (0, import_react_router_dom2.useSearchParams)();
|
|
5051
5063
|
const spanId = searchParameters.get("spanId");
|
|
5052
5064
|
const api = useAppInspectorApi();
|
|
5053
|
-
const [spans, setSpans] = (0,
|
|
5054
|
-
const [loading, setLoading] = (0,
|
|
5055
|
-
const [fetchError, setFetchError] = (0,
|
|
5056
|
-
const fetchSpans = (0,
|
|
5065
|
+
const [spans, setSpans] = (0, import_react22.useState)();
|
|
5066
|
+
const [loading, setLoading] = (0, import_react22.useState)(false);
|
|
5067
|
+
const [fetchError, setFetchError] = (0, import_react22.useState)();
|
|
5068
|
+
const fetchSpans = (0, import_react22.useCallback)(async () => {
|
|
5057
5069
|
setLoading(true);
|
|
5058
5070
|
try {
|
|
5059
5071
|
const response = await api.getSpans({
|
|
@@ -5068,14 +5080,14 @@ var TraceGraphPage = () => {
|
|
|
5068
5080
|
setLoading(false);
|
|
5069
5081
|
}
|
|
5070
5082
|
}, [api, traceId]);
|
|
5071
|
-
(0,
|
|
5083
|
+
(0, import_react22.useEffect)(() => {
|
|
5072
5084
|
void fetchSpans();
|
|
5073
5085
|
}, [fetchSpans]);
|
|
5074
|
-
const [open, setOpen] = (0,
|
|
5075
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
5076
|
-
const [viewPortPixelWidth, setViewPortPixelWidth] = (0,
|
|
5086
|
+
const [open, setOpen] = (0, import_react22.useState)(true);
|
|
5087
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react22.useState)();
|
|
5088
|
+
const [viewPortPixelWidth, setViewPortPixelWidth] = (0, import_react22.useState)(0);
|
|
5077
5089
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
5078
|
-
const calculateDrawerWidth = (0,
|
|
5090
|
+
const calculateDrawerWidth = (0, import_react22.useCallback)(() => {
|
|
5079
5091
|
const percentageMatch = /(\d+)%/.exec(DRAWER_WIDTH);
|
|
5080
5092
|
if (percentageMatch && open) {
|
|
5081
5093
|
const percentage = Number.parseInt(percentageMatch[1], 10);
|
|
@@ -5083,7 +5095,7 @@ var TraceGraphPage = () => {
|
|
|
5083
5095
|
}
|
|
5084
5096
|
return 0;
|
|
5085
5097
|
}, [open]);
|
|
5086
|
-
(0,
|
|
5098
|
+
(0, import_react22.useEffect)(() => {
|
|
5087
5099
|
const updateViewportWidth = () => {
|
|
5088
5100
|
const totalWidth = window.innerWidth;
|
|
5089
5101
|
const drawerPixelWidth = open ? calculateDrawerWidth() : 0;
|
|
@@ -5097,16 +5109,16 @@ var TraceGraphPage = () => {
|
|
|
5097
5109
|
clearTimeout(timeoutId);
|
|
5098
5110
|
};
|
|
5099
5111
|
}, [open, calculateDrawerWidth]);
|
|
5100
|
-
const handleEventSelect = (0,
|
|
5112
|
+
const handleEventSelect = (0, import_react22.useCallback)((event) => {
|
|
5101
5113
|
setSelectedEvent(event);
|
|
5102
5114
|
setOpen(true);
|
|
5103
5115
|
}, []);
|
|
5104
|
-
const handleRetry = (0,
|
|
5116
|
+
const handleRetry = (0, import_react22.useCallback)(() => {
|
|
5105
5117
|
void checkStatus();
|
|
5106
5118
|
}, [checkStatus]);
|
|
5107
5119
|
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
5108
5120
|
const { resolveLink } = useAppInspector();
|
|
5109
|
-
const navigateToSpansList = (0,
|
|
5121
|
+
const navigateToSpansList = (0, import_react22.useCallback)(() => {
|
|
5110
5122
|
const url = resolveLink({ to: "spans-list" });
|
|
5111
5123
|
navigate(url);
|
|
5112
5124
|
}, [navigate, resolveLink]);
|