@localstack/appinspector-ui 1.0.19 → 1.0.21
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 +109 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +66 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2727,16 +2727,28 @@ var columns = [
|
|
|
2727
2727
|
field: "trace_id",
|
|
2728
2728
|
headerName: "Trace",
|
|
2729
2729
|
renderCell: (parameters) => {
|
|
2730
|
-
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
2730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material5.Tooltip, { arrow: true, title: String(parameters.value), children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
2731
|
+
"span",
|
|
2732
|
+
{
|
|
2733
|
+
style: {
|
|
2734
|
+
maxWidth: "100%",
|
|
2735
|
+
overflow: "hidden",
|
|
2736
|
+
textOverflow: "ellipsis",
|
|
2737
|
+
whiteSpace: "nowrap"
|
|
2738
|
+
},
|
|
2739
|
+
children: parameters.value
|
|
2740
|
+
}
|
|
2741
|
+
) });
|
|
2731
2742
|
},
|
|
2732
|
-
|
|
2743
|
+
type: "string",
|
|
2744
|
+
width: 120
|
|
2733
2745
|
},
|
|
2734
2746
|
{
|
|
2735
2747
|
field: "start_time_unix_nano",
|
|
2736
2748
|
headerName: "Time",
|
|
2737
2749
|
renderCell: (parameters) => /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(ResponsiveTimestampCell, { value: parameters.value }),
|
|
2738
2750
|
type: "string",
|
|
2739
|
-
width:
|
|
2751
|
+
width: 180
|
|
2740
2752
|
},
|
|
2741
2753
|
{
|
|
2742
2754
|
field: "producer",
|
|
@@ -2749,19 +2761,19 @@ var columns = [
|
|
|
2749
2761
|
},
|
|
2750
2762
|
sortable: true,
|
|
2751
2763
|
sortComparator: resourceNameComparator,
|
|
2752
|
-
width:
|
|
2764
|
+
width: 260
|
|
2753
2765
|
},
|
|
2754
2766
|
{
|
|
2755
2767
|
field: "operation_name",
|
|
2756
2768
|
headerName: "Action",
|
|
2757
2769
|
type: "string",
|
|
2758
|
-
width:
|
|
2770
|
+
width: 130
|
|
2759
2771
|
},
|
|
2760
2772
|
{
|
|
2761
2773
|
field: "consumer",
|
|
2762
2774
|
flex: 1,
|
|
2763
2775
|
headerName: "Consumer",
|
|
2764
|
-
|
|
2776
|
+
maxWidth: 260,
|
|
2765
2777
|
renderCell: (parameters) => {
|
|
2766
2778
|
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(ServiceCell, { resource: parameters.row.resource_name, service: parameters.row.service_name });
|
|
2767
2779
|
},
|
|
@@ -3626,12 +3638,13 @@ var SpansListPage = () => {
|
|
|
3626
3638
|
var import_icons_material11 = require("@mui/icons-material");
|
|
3627
3639
|
var import_material21 = require("@mui/material");
|
|
3628
3640
|
var import_styles = require("@mui/material/styles");
|
|
3629
|
-
var
|
|
3630
|
-
var
|
|
3641
|
+
var import_react21 = require("@xyflow/react");
|
|
3642
|
+
var import_react22 = require("react");
|
|
3631
3643
|
var import_react_router_dom2 = require("react-router-dom");
|
|
3632
3644
|
|
|
3633
3645
|
// src/components/event-details/event-details.tsx
|
|
3634
3646
|
var import_material16 = require("@mui/material");
|
|
3647
|
+
var import_react12 = require("react");
|
|
3635
3648
|
|
|
3636
3649
|
// src/utils/iam-utils.ts
|
|
3637
3650
|
function determinePermissionStatus(payload) {
|
|
@@ -3901,7 +3914,7 @@ var DetailRow = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime13
|
|
|
3901
3914
|
{
|
|
3902
3915
|
sx: {
|
|
3903
3916
|
color: "text.secondary",
|
|
3904
|
-
fontWeight:
|
|
3917
|
+
fontWeight: 600
|
|
3905
3918
|
},
|
|
3906
3919
|
variant: "body2",
|
|
3907
3920
|
children: label
|
|
@@ -3936,11 +3949,11 @@ var PermissionIcon = ({ status }) => {
|
|
|
3936
3949
|
var IAMEventDetail = ({ event }) => {
|
|
3937
3950
|
const payloadString = event.attributes?.payload;
|
|
3938
3951
|
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, {
|
|
3952
|
+
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
3953
|
}
|
|
3941
3954
|
const parsedIAM = parseIAMEvent(payloadString);
|
|
3942
3955
|
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, {
|
|
3956
|
+
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
3957
|
}
|
|
3945
3958
|
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Box, { sx: { p: 2 }, children: [
|
|
3946
3959
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Box, { sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
@@ -3965,9 +3978,7 @@ var IAMEventDetail = ({ event }) => {
|
|
|
3965
3978
|
import_material11.Typography,
|
|
3966
3979
|
{
|
|
3967
3980
|
sx: {
|
|
3968
|
-
color: "text.primary"
|
|
3969
|
-
fontFamily: "monospace",
|
|
3970
|
-
fontSize: "0.85rem"
|
|
3981
|
+
color: "text.primary"
|
|
3971
3982
|
},
|
|
3972
3983
|
variant: "body2",
|
|
3973
3984
|
children: action
|
|
@@ -3985,8 +3996,6 @@ var IAMEventDetail = ({ event }) => {
|
|
|
3985
3996
|
{
|
|
3986
3997
|
sx: {
|
|
3987
3998
|
color: "text.primary",
|
|
3988
|
-
fontFamily: "monospace",
|
|
3989
|
-
fontSize: "0.85rem",
|
|
3990
3999
|
wordBreak: "break-all"
|
|
3991
4000
|
},
|
|
3992
4001
|
variant: "body2",
|
|
@@ -3998,19 +4007,19 @@ var IAMEventDetail = ({ event }) => {
|
|
|
3998
4007
|
}
|
|
3999
4008
|
),
|
|
4000
4009
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Box, { sx: { mt: 2 }, children: [
|
|
4001
|
-
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, {
|
|
4010
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { sx: { fontWeight: 600, mb: 1 }, variant: "caption", children: "Policy Evaluation" }),
|
|
4002
4011
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Grid, { container: true, spacing: 2, children: [
|
|
4003
4012
|
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
4013
|
/* @__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, {
|
|
4014
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Allows" })
|
|
4006
4015
|
] }) }),
|
|
4007
4016
|
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
4017
|
/* @__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, {
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Denies" })
|
|
4010
4019
|
] }) }),
|
|
4011
4020
|
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
4021
|
/* @__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, {
|
|
4022
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Implicit Denies" })
|
|
4014
4023
|
] }) })
|
|
4015
4024
|
] })
|
|
4016
4025
|
] })
|
|
@@ -4067,8 +4076,8 @@ var IAMPermissionItem = ({ event }) => {
|
|
|
4067
4076
|
)
|
|
4068
4077
|
] }),
|
|
4069
4078
|
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, {
|
|
4079
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material12.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Principal" }),
|
|
4080
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material12.Typography, { variant: "body2", children: parsedIAM.principal })
|
|
4072
4081
|
] }) })
|
|
4073
4082
|
] });
|
|
4074
4083
|
};
|
|
@@ -4082,7 +4091,7 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime1
|
|
|
4082
4091
|
{
|
|
4083
4092
|
sx: {
|
|
4084
4093
|
color: "text.primary",
|
|
4085
|
-
fontWeight:
|
|
4094
|
+
fontWeight: 600
|
|
4086
4095
|
},
|
|
4087
4096
|
variant: "body1",
|
|
4088
4097
|
children: label
|
|
@@ -4149,7 +4158,7 @@ var EventMessage = ({ event }) => {
|
|
|
4149
4158
|
ref: textReference,
|
|
4150
4159
|
sx: {
|
|
4151
4160
|
color: "text.primary",
|
|
4152
|
-
fontWeight:
|
|
4161
|
+
fontWeight: 600,
|
|
4153
4162
|
maxWidth: "100%",
|
|
4154
4163
|
ml: shouldShowToggle ? 0 : 4,
|
|
4155
4164
|
overflow: "hidden",
|
|
@@ -4206,10 +4215,9 @@ var EventDetail = ({
|
|
|
4206
4215
|
{
|
|
4207
4216
|
sx: {
|
|
4208
4217
|
alignItems: "left",
|
|
4209
|
-
color: "text.secondary",
|
|
4210
4218
|
display: "flex",
|
|
4211
4219
|
flexGrow: 1,
|
|
4212
|
-
fontWeight:
|
|
4220
|
+
fontWeight: 600
|
|
4213
4221
|
},
|
|
4214
4222
|
variant: "subtitle1",
|
|
4215
4223
|
children: displayText
|
|
@@ -4241,7 +4249,7 @@ var EventDetail = ({
|
|
|
4241
4249
|
color: "text.secondary",
|
|
4242
4250
|
display: "flex",
|
|
4243
4251
|
flexGrow: 1,
|
|
4244
|
-
fontWeight:
|
|
4252
|
+
fontWeight: 600,
|
|
4245
4253
|
ml: 1,
|
|
4246
4254
|
mr: 2
|
|
4247
4255
|
},
|
|
@@ -4348,6 +4356,10 @@ var EventSection = ({
|
|
|
4348
4356
|
// src/components/event-details/event-details.tsx
|
|
4349
4357
|
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
4350
4358
|
var EventDetails = ({ onClose, selectedEvent }) => {
|
|
4359
|
+
const attributes = (0, import_react12.useMemo)(() => {
|
|
4360
|
+
const attributes2 = Object.entries(selectedEvent?.attributes ?? {});
|
|
4361
|
+
return attributes2.filter(([key]) => key !== "localstack.aws.account_id" && key !== "localstack.aws.service");
|
|
4362
|
+
}, [selectedEvent?.attributes]);
|
|
4351
4363
|
if (!selectedEvent) {
|
|
4352
4364
|
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
4365
|
}
|
|
@@ -4356,41 +4368,41 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
4356
4368
|
/* @__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
4369
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Stack, { spacing: 1, children: [
|
|
4358
4370
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4359
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4371
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Span ID" }),
|
|
4360
4372
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.span_id })
|
|
4361
4373
|
] }),
|
|
4362
4374
|
/* @__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, {
|
|
4375
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Trace ID" }),
|
|
4376
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.trace_id })
|
|
4365
4377
|
] }),
|
|
4366
4378
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4367
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4379
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Operation" }),
|
|
4368
4380
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.operation_name })
|
|
4369
4381
|
] })
|
|
4370
4382
|
] }) }),
|
|
4371
4383
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Divider, {}),
|
|
4372
4384
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ToggleSection, { headline: "Service Information", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Stack, { spacing: 1, children: [
|
|
4373
4385
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4374
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4386
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Service" }),
|
|
4375
4387
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.service_name })
|
|
4376
4388
|
] }),
|
|
4377
4389
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4378
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4390
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource" }),
|
|
4379
4391
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.resource_name })
|
|
4380
4392
|
] }),
|
|
4381
4393
|
Boolean(selectedEvent.region) && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4382
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4394
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Region" }),
|
|
4383
4395
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: selectedEvent.region })
|
|
4384
4396
|
] })
|
|
4385
4397
|
] }) }),
|
|
4386
4398
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Divider, {}),
|
|
4387
4399
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ToggleSection, { headline: "Timing", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Stack, { spacing: 1, children: [
|
|
4388
4400
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Box, { children: [
|
|
4389
|
-
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, {
|
|
4401
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Start Time" }),
|
|
4390
4402
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
|
|
4391
4403
|
] }),
|
|
4392
4404
|
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, {
|
|
4405
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Duration" }),
|
|
4394
4406
|
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material16.Typography, { variant: "body2", children: [
|
|
4395
4407
|
((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString(),
|
|
4396
4408
|
" ",
|
|
@@ -4420,33 +4432,45 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
4420
4432
|
}
|
|
4421
4433
|
)
|
|
4422
4434
|
] }),
|
|
4423
|
-
|
|
4435
|
+
attributes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, { children: [
|
|
4424
4436
|
/* @__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.
|
|
4437
|
+
/* @__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: [
|
|
4438
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: key }),
|
|
4439
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: renderKeyValue(key, value) })
|
|
4440
|
+
] }, key)) }) })
|
|
4426
4441
|
] })
|
|
4427
4442
|
] }) })
|
|
4428
4443
|
] });
|
|
4429
4444
|
};
|
|
4445
|
+
function renderKeyValue(key, value) {
|
|
4446
|
+
if (typeof value === "string" && (key === "localstack.aws.service.request" || key === "localstack.aws.service.response" || key === "localstack.aws.service.exception")) {
|
|
4447
|
+
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) }) }) });
|
|
4448
|
+
}
|
|
4449
|
+
if (typeof value === "boolean") {
|
|
4450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: value ? "yes" : "no" });
|
|
4451
|
+
}
|
|
4452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Typography, { variant: "body2", children: value });
|
|
4453
|
+
}
|
|
4430
4454
|
|
|
4431
4455
|
// src/components/trace-graph/trace-graph.tsx
|
|
4432
4456
|
var import_base = require("@xyflow/react/dist/base.css");
|
|
4433
4457
|
var import_material20 = require("@mui/material");
|
|
4434
|
-
var
|
|
4435
|
-
var
|
|
4458
|
+
var import_react19 = require("@xyflow/react");
|
|
4459
|
+
var import_react20 = require("react");
|
|
4436
4460
|
|
|
4437
4461
|
// src/components/trace-graph/service-node.tsx
|
|
4438
4462
|
var import_material18 = require("@mui/material");
|
|
4439
4463
|
var import_style = require("@xyflow/react/dist/style.css");
|
|
4440
|
-
var
|
|
4441
|
-
var
|
|
4464
|
+
var import_react14 = require("@xyflow/react");
|
|
4465
|
+
var import_react15 = require("react");
|
|
4442
4466
|
|
|
4443
4467
|
// src/components/trace-graph/problem-indicator.tsx
|
|
4444
4468
|
var import_icons_material9 = require("@mui/icons-material");
|
|
4445
4469
|
var import_material17 = require("@mui/material");
|
|
4446
|
-
var
|
|
4470
|
+
var import_react13 = require("react");
|
|
4447
4471
|
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
4448
4472
|
var ProblemIndicator = ({ error }) => {
|
|
4449
|
-
const icon = (0,
|
|
4473
|
+
const icon = (0, import_react13.useMemo)(() => {
|
|
4450
4474
|
switch (error.level) {
|
|
4451
4475
|
case "error": {
|
|
4452
4476
|
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_icons_material9.Error, { sx: { color: "#d32f2f", fontSize: "14px" } });
|
|
@@ -4459,7 +4483,7 @@ var ProblemIndicator = ({ error }) => {
|
|
|
4459
4483
|
}
|
|
4460
4484
|
}
|
|
4461
4485
|
}, [error.level]);
|
|
4462
|
-
const color = (0,
|
|
4486
|
+
const color = (0, import_react13.useMemo)(() => {
|
|
4463
4487
|
switch (error.level) {
|
|
4464
4488
|
case "error": {
|
|
4465
4489
|
return "#d32f2f";
|
|
@@ -4498,11 +4522,11 @@ var handleStyle = {
|
|
|
4498
4522
|
borderColor: "lightgray",
|
|
4499
4523
|
opacity: 0
|
|
4500
4524
|
};
|
|
4501
|
-
var ServiceNode = (0,
|
|
4502
|
-
const handleClick = (0,
|
|
4525
|
+
var ServiceNode = (0, import_react15.memo)(function ServiceNode2({ data, selected }) {
|
|
4526
|
+
const handleClick = (0, import_react15.useCallback)(() => {
|
|
4503
4527
|
data.onEventSelect(data.event);
|
|
4504
4528
|
}, [data]);
|
|
4505
|
-
const handleKeyPress = (0,
|
|
4529
|
+
const handleKeyPress = (0, import_react15.useCallback)(
|
|
4506
4530
|
(event) => {
|
|
4507
4531
|
if (event.key === "Enter" || event.key === " ") {
|
|
4508
4532
|
handleClick();
|
|
@@ -4535,8 +4559,8 @@ var ServiceNode = (0, import_react14.memo)(function ServiceNode2({ data, selecte
|
|
|
4535
4559
|
},
|
|
4536
4560
|
tabIndex: 0,
|
|
4537
4561
|
children: [
|
|
4538
|
-
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
4539
|
-
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
4562
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_react14.Handle, { position: import_react14.Position.Left, style: handleStyle, type: "target" }),
|
|
4563
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_react14.Handle, { position: import_react14.Position.Right, style: handleStyle, type: "source" }),
|
|
4540
4564
|
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
4541
4565
|
ServiceCell,
|
|
4542
4566
|
{
|
|
@@ -4597,7 +4621,7 @@ var ServiceNode = (0, import_react14.memo)(function ServiceNode2({ data, selecte
|
|
|
4597
4621
|
|
|
4598
4622
|
// src/components/trace-graph/utils.ts
|
|
4599
4623
|
var import_dagre = __toESM(require("@dagrejs/dagre"), 1);
|
|
4600
|
-
var
|
|
4624
|
+
var import_react16 = require("@xyflow/react");
|
|
4601
4625
|
var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
4602
4626
|
const nodes = [];
|
|
4603
4627
|
const edges = [];
|
|
@@ -4614,8 +4638,8 @@ var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
|
4614
4638
|
id: event.span_id,
|
|
4615
4639
|
position: { x: 0, y: 0 },
|
|
4616
4640
|
// Will be set by layout
|
|
4617
|
-
sourcePosition:
|
|
4618
|
-
targetPosition:
|
|
4641
|
+
sourcePosition: import_react16.Position.Right,
|
|
4642
|
+
targetPosition: import_react16.Position.Left,
|
|
4619
4643
|
type: "service"
|
|
4620
4644
|
});
|
|
4621
4645
|
if (parentId) {
|
|
@@ -4625,7 +4649,7 @@ var generateNodesAndEdges = (event, onEventSelect, parentId) => {
|
|
|
4625
4649
|
markerEnd: {
|
|
4626
4650
|
color: "lightgray",
|
|
4627
4651
|
height: 16,
|
|
4628
|
-
type:
|
|
4652
|
+
type: import_react16.MarkerType.Arrow,
|
|
4629
4653
|
width: 16
|
|
4630
4654
|
},
|
|
4631
4655
|
source: parentId,
|
|
@@ -4690,8 +4714,8 @@ var calculateCenterX = (focusNodeX, viewPortPixelWidth, minX, maxX) => {
|
|
|
4690
4714
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
4691
4715
|
var import_icons_material10 = require("@mui/icons-material");
|
|
4692
4716
|
var import_material19 = require("@mui/material");
|
|
4693
|
-
var
|
|
4694
|
-
var
|
|
4717
|
+
var import_react17 = require("@xyflow/react");
|
|
4718
|
+
var import_react18 = require("react");
|
|
4695
4719
|
|
|
4696
4720
|
// node_modules/zustand/esm/shallow.mjs
|
|
4697
4721
|
function shallow$1(objA, objB) {
|
|
@@ -4738,9 +4762,9 @@ var selector = (s) => ({
|
|
|
4738
4762
|
maxZoomReached: s.transform[2] >= s.maxZoom,
|
|
4739
4763
|
minZoomReached: s.transform[2] <= s.minZoom
|
|
4740
4764
|
});
|
|
4741
|
-
var Controls = (0,
|
|
4742
|
-
const { maxZoomReached, minZoomReached } = (0,
|
|
4743
|
-
const { fitView, zoomIn, zoomOut } = (0,
|
|
4765
|
+
var Controls = (0, import_react18.memo)(() => {
|
|
4766
|
+
const { maxZoomReached, minZoomReached } = (0, import_react17.useStore)(selector, shallow$1);
|
|
4767
|
+
const { fitView, zoomIn, zoomOut } = (0, import_react17.useReactFlow)();
|
|
4744
4768
|
const onZoomInHandler = () => {
|
|
4745
4769
|
void zoomIn();
|
|
4746
4770
|
};
|
|
@@ -4810,12 +4834,12 @@ var TraceGraph = ({
|
|
|
4810
4834
|
spans,
|
|
4811
4835
|
viewPortPixelWidth
|
|
4812
4836
|
}) => {
|
|
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,
|
|
4837
|
+
const [nodes, setNodes] = (0, import_react20.useState)([]);
|
|
4838
|
+
const [edges, setEdges] = (0, import_react20.useState)([]);
|
|
4839
|
+
const [initialViewSet, setInitialViewSet] = (0, import_react20.useState)(false);
|
|
4840
|
+
const { fitView, setCenter } = (0, import_react19.useReactFlow)();
|
|
4841
|
+
const store = (0, import_react19.useStoreApi)();
|
|
4842
|
+
const updateSelectedNode = (0, import_react20.useCallback)(
|
|
4819
4843
|
(nodeId) => {
|
|
4820
4844
|
const { addSelectedNodes } = store.getState();
|
|
4821
4845
|
if (nodeId) {
|
|
@@ -4827,7 +4851,7 @@ var TraceGraph = ({
|
|
|
4827
4851
|
},
|
|
4828
4852
|
[nodes, store]
|
|
4829
4853
|
);
|
|
4830
|
-
(0,
|
|
4854
|
+
(0, import_react20.useEffect)(() => {
|
|
4831
4855
|
const spansMap = /* @__PURE__ */ new Map();
|
|
4832
4856
|
const rootSpans = [];
|
|
4833
4857
|
for (const span of spans.data ?? []) {
|
|
@@ -4859,7 +4883,7 @@ var TraceGraph = ({
|
|
|
4859
4883
|
setNodes(layoutedNodes);
|
|
4860
4884
|
setEdges(layoutedEdges);
|
|
4861
4885
|
}, [onEventSelect, spans.data]);
|
|
4862
|
-
(0,
|
|
4886
|
+
(0, import_react20.useEffect)(() => {
|
|
4863
4887
|
const shouldSetInitialView = !spans.loading && nodes.length > 0 && !initialViewSet;
|
|
4864
4888
|
if (shouldSetInitialView) {
|
|
4865
4889
|
if (initialFocusEventId) {
|
|
@@ -4879,12 +4903,12 @@ var TraceGraph = ({
|
|
|
4879
4903
|
setInitialViewSet(true);
|
|
4880
4904
|
}
|
|
4881
4905
|
}, [spans.loading, nodes, initialFocusEventId, viewPortPixelWidth, setCenter, fitView, onEventSelect, initialViewSet]);
|
|
4882
|
-
(0,
|
|
4906
|
+
(0, import_react20.useEffect)(() => {
|
|
4883
4907
|
if (initialFocusEventId) {
|
|
4884
4908
|
updateSelectedNode(initialFocusEventId);
|
|
4885
4909
|
}
|
|
4886
4910
|
}, [initialFocusEventId, updateSelectedNode]);
|
|
4887
|
-
const onNodeClick = (0,
|
|
4911
|
+
const onNodeClick = (0, import_react20.useCallback)((_event, node) => {
|
|
4888
4912
|
onEventSelect(node.data.event);
|
|
4889
4913
|
updateSelectedNode(node.id);
|
|
4890
4914
|
}, [onEventSelect, updateSelectedNode]);
|
|
@@ -4904,7 +4928,7 @@ var TraceGraph = ({
|
|
|
4904
4928
|
}
|
|
4905
4929
|
),
|
|
4906
4930
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
4907
|
-
|
|
4931
|
+
import_react19.ReactFlow,
|
|
4908
4932
|
{
|
|
4909
4933
|
"data-testid": "trace-graph",
|
|
4910
4934
|
defaultViewport: { x: 0, y: 0, zoom: 1 },
|
|
@@ -4918,7 +4942,7 @@ var TraceGraph = ({
|
|
|
4918
4942
|
selectNodesOnDrag: false,
|
|
4919
4943
|
children: [
|
|
4920
4944
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(Controls, {}),
|
|
4921
|
-
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
4945
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_react19.Background, {})
|
|
4922
4946
|
]
|
|
4923
4947
|
}
|
|
4924
4948
|
)
|
|
@@ -5019,7 +5043,7 @@ var TraceGraphView = ({
|
|
|
5019
5043
|
height: "100%",
|
|
5020
5044
|
overflow: "auto"
|
|
5021
5045
|
},
|
|
5022
|
-
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
5046
|
+
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_react21.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
5023
5047
|
TraceGraph,
|
|
5024
5048
|
{
|
|
5025
5049
|
initialFocusEventId: spanId,
|
|
@@ -5050,10 +5074,10 @@ var TraceGraphPage = () => {
|
|
|
5050
5074
|
const [searchParameters] = (0, import_react_router_dom2.useSearchParams)();
|
|
5051
5075
|
const spanId = searchParameters.get("spanId");
|
|
5052
5076
|
const api = useAppInspectorApi();
|
|
5053
|
-
const [spans, setSpans] = (0,
|
|
5054
|
-
const [loading, setLoading] = (0,
|
|
5055
|
-
const [fetchError, setFetchError] = (0,
|
|
5056
|
-
const fetchSpans = (0,
|
|
5077
|
+
const [spans, setSpans] = (0, import_react22.useState)();
|
|
5078
|
+
const [loading, setLoading] = (0, import_react22.useState)(false);
|
|
5079
|
+
const [fetchError, setFetchError] = (0, import_react22.useState)();
|
|
5080
|
+
const fetchSpans = (0, import_react22.useCallback)(async () => {
|
|
5057
5081
|
setLoading(true);
|
|
5058
5082
|
try {
|
|
5059
5083
|
const response = await api.getSpans({
|
|
@@ -5068,14 +5092,14 @@ var TraceGraphPage = () => {
|
|
|
5068
5092
|
setLoading(false);
|
|
5069
5093
|
}
|
|
5070
5094
|
}, [api, traceId]);
|
|
5071
|
-
(0,
|
|
5095
|
+
(0, import_react22.useEffect)(() => {
|
|
5072
5096
|
void fetchSpans();
|
|
5073
5097
|
}, [fetchSpans]);
|
|
5074
|
-
const [open, setOpen] = (0,
|
|
5075
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
5076
|
-
const [viewPortPixelWidth, setViewPortPixelWidth] = (0,
|
|
5098
|
+
const [open, setOpen] = (0, import_react22.useState)(true);
|
|
5099
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react22.useState)();
|
|
5100
|
+
const [viewPortPixelWidth, setViewPortPixelWidth] = (0, import_react22.useState)(0);
|
|
5077
5101
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
5078
|
-
const calculateDrawerWidth = (0,
|
|
5102
|
+
const calculateDrawerWidth = (0, import_react22.useCallback)(() => {
|
|
5079
5103
|
const percentageMatch = /(\d+)%/.exec(DRAWER_WIDTH);
|
|
5080
5104
|
if (percentageMatch && open) {
|
|
5081
5105
|
const percentage = Number.parseInt(percentageMatch[1], 10);
|
|
@@ -5083,7 +5107,7 @@ var TraceGraphPage = () => {
|
|
|
5083
5107
|
}
|
|
5084
5108
|
return 0;
|
|
5085
5109
|
}, [open]);
|
|
5086
|
-
(0,
|
|
5110
|
+
(0, import_react22.useEffect)(() => {
|
|
5087
5111
|
const updateViewportWidth = () => {
|
|
5088
5112
|
const totalWidth = window.innerWidth;
|
|
5089
5113
|
const drawerPixelWidth = open ? calculateDrawerWidth() : 0;
|
|
@@ -5097,16 +5121,16 @@ var TraceGraphPage = () => {
|
|
|
5097
5121
|
clearTimeout(timeoutId);
|
|
5098
5122
|
};
|
|
5099
5123
|
}, [open, calculateDrawerWidth]);
|
|
5100
|
-
const handleEventSelect = (0,
|
|
5124
|
+
const handleEventSelect = (0, import_react22.useCallback)((event) => {
|
|
5101
5125
|
setSelectedEvent(event);
|
|
5102
5126
|
setOpen(true);
|
|
5103
5127
|
}, []);
|
|
5104
|
-
const handleRetry = (0,
|
|
5128
|
+
const handleRetry = (0, import_react22.useCallback)(() => {
|
|
5105
5129
|
void checkStatus();
|
|
5106
5130
|
}, [checkStatus]);
|
|
5107
5131
|
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
5108
5132
|
const { resolveLink } = useAppInspector();
|
|
5109
|
-
const navigateToSpansList = (0,
|
|
5133
|
+
const navigateToSpansList = (0, import_react22.useCallback)(() => {
|
|
5110
5134
|
const url = resolveLink({ to: "spans-list" });
|
|
5111
5135
|
navigate(url);
|
|
5112
5136
|
}, [navigate, resolveLink]);
|