@localstack/appinspector-ui 1.0.116 → 1.0.118
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 +167 -213
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +144 -190
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2417,8 +2417,8 @@ __export(index_exports, {
|
|
|
2417
2417
|
module.exports = __toCommonJS(index_exports);
|
|
2418
2418
|
|
|
2419
2419
|
// src/pages/spans-list-page.tsx
|
|
2420
|
-
var
|
|
2421
|
-
var
|
|
2420
|
+
var import_material23 = require("@mui/material");
|
|
2421
|
+
var import_react68 = require("react");
|
|
2422
2422
|
|
|
2423
2423
|
// src/api/errors.ts
|
|
2424
2424
|
var AppInspectorDisabledError = class extends Error {
|
|
@@ -2491,6 +2491,9 @@ var EVENT_DETAILS_REQUEST_PAYLOAD = "event-details-request-payload";
|
|
|
2491
2491
|
var EVENT_DETAILS_RESPONSE_PAYLOAD_TEST_ID = "event-details-response-payload";
|
|
2492
2492
|
var EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID = "event-details-exception-payload";
|
|
2493
2493
|
var EVENT_DETAILS_IAM_ERRORS_SUPPRESSED_TEST_ID = "event-details-iam-errors-suppressed";
|
|
2494
|
+
var EVENT_DETAILS_IAM_PRINCIPAL_TEST_ID = "event-details-iam-principal";
|
|
2495
|
+
var EVENT_DETAILS_IAM_ACTIONS_TEST_ID = "event-details-iam-actions";
|
|
2496
|
+
var EVENT_DETAILS_IAM_RESOURCES_TEST_ID = "event-details-iam-resources";
|
|
2494
2497
|
var ERROR_COUNT_TEST_ID = "error-count";
|
|
2495
2498
|
var WARNING_COUNT_TEST_ID = "warning-count";
|
|
2496
2499
|
var SERVICE_NODE_TEST_ID = "service-node";
|
|
@@ -18594,14 +18597,14 @@ var useSpans = () => {
|
|
|
18594
18597
|
};
|
|
18595
18598
|
|
|
18596
18599
|
// src/pages/trace-graph-page.tsx
|
|
18597
|
-
var
|
|
18598
|
-
var
|
|
18600
|
+
var import_icons_material12 = require("@mui/icons-material");
|
|
18601
|
+
var import_material22 = require("@mui/material");
|
|
18599
18602
|
var import_styles = require("@mui/material/styles");
|
|
18600
|
-
var
|
|
18601
|
-
var
|
|
18603
|
+
var import_react66 = require("@xyflow/react");
|
|
18604
|
+
var import_react67 = require("react");
|
|
18602
18605
|
|
|
18603
18606
|
// src/components/event-details/event-details.tsx
|
|
18604
|
-
var
|
|
18607
|
+
var import_icons_material9 = require("@mui/icons-material");
|
|
18605
18608
|
var import_material18 = require("@mui/material");
|
|
18606
18609
|
var import_react59 = require("react");
|
|
18607
18610
|
|
|
@@ -18714,7 +18717,7 @@ var getEventGroupsByType = (events) => {
|
|
|
18714
18717
|
};
|
|
18715
18718
|
|
|
18716
18719
|
// src/components/event-details/event-detail.tsx
|
|
18717
|
-
var
|
|
18720
|
+
var import_icons_material7 = require("@mui/icons-material");
|
|
18718
18721
|
var import_material15 = require("@mui/material");
|
|
18719
18722
|
var import_react56 = require("react");
|
|
18720
18723
|
|
|
@@ -18824,57 +18827,48 @@ var IAMEventDetail = ({ event }) => {
|
|
|
18824
18827
|
};
|
|
18825
18828
|
|
|
18826
18829
|
// src/components/event-details/iam-permission-detail.tsx
|
|
18827
|
-
var import_icons_material7 = require("@mui/icons-material");
|
|
18828
18830
|
var import_material12 = require("@mui/material");
|
|
18829
18831
|
var import_react53 = require("react");
|
|
18830
18832
|
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
18831
|
-
var
|
|
18832
|
-
|
|
18833
|
-
|
|
18834
|
-
|
|
18835
|
-
|
|
18836
|
-
|
|
18837
|
-
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Typography, { sx: {
|
|
18833
|
+
var getChipColor = (isAllowed, spanStatusCode) => {
|
|
18834
|
+
if (isAllowed) return "success.main";
|
|
18835
|
+
if (spanStatusCode === 2) return "error.main";
|
|
18836
|
+
return "warning.main";
|
|
18837
|
+
};
|
|
18838
|
+
var LabelValue = ({ label, value }) => /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material12.Box, { children: [
|
|
18839
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Typography, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: label }),
|
|
18840
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Typography, { sx: { wordBreak: "break-all" }, variant: "body2", children: value })
|
|
18838
18841
|
] });
|
|
18839
|
-
var IAMPermissionItem = ({ event }) => {
|
|
18840
|
-
const [isOpen, setIsOpen] = (0, import_react53.useState)(false);
|
|
18842
|
+
var IAMPermissionItem = ({ event, spanStatusCode }) => {
|
|
18841
18843
|
const parsedData = (0, import_react53.useMemo)(() => {
|
|
18842
18844
|
const payloadString = event.attributes?.payload;
|
|
18843
18845
|
if (!payloadString) return;
|
|
18844
18846
|
const parsedIAM2 = parseIAMEvent(payloadString);
|
|
18845
18847
|
if (!parsedIAM2) return;
|
|
18846
|
-
return {
|
|
18848
|
+
return { parsedIAM: parsedIAM2 };
|
|
18847
18849
|
}, [event.attributes?.payload]);
|
|
18848
18850
|
if (!parsedData) {
|
|
18849
18851
|
return null;
|
|
18850
18852
|
}
|
|
18851
|
-
const {
|
|
18853
|
+
const { parsedIAM } = parsedData;
|
|
18854
|
+
const isAllowed = parsedIAM.permission === "explicitly_allowed" || parsedIAM.permission === "implicitly_allowed";
|
|
18855
|
+
const chipColors = { backgroundColor: getChipColor(isAllowed, spanStatusCode), color: "white" };
|
|
18852
18856
|
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material12.Box, { sx: { mb: 0.5 }, children: [
|
|
18853
|
-
/* @__PURE__ */ (0, import_jsx_runtime135.
|
|
18854
|
-
|
|
18855
|
-
|
|
18856
|
-
|
|
18857
|
-
|
|
18858
|
-
|
|
18859
|
-
parsedIAM.service,
|
|
18860
|
-
":",
|
|
18861
|
-
parsedIAM.operation
|
|
18862
|
-
] })
|
|
18863
|
-
] }),
|
|
18864
|
-
isOpen && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material12.Box, { sx: { borderColor: "divider", borderLeft: "2px solid", ml: 1, mt: 0.5, pl: 1.5, py: 0.5 }, children: [
|
|
18865
|
-
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(LabelValue, { label: "Principal", value: parsedIAM.principal }),
|
|
18866
|
-
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material12.Box, { sx: { display: "grid", gap: 1, gridTemplateColumns: "72px 1fr", mb: 0.5 }, children: [
|
|
18867
|
-
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Typography, { color: "text.secondary", sx: { fontWeight: 600 }, variant: "caption", children: "Actions" }),
|
|
18868
|
-
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Box, { children: parsedIAM.details.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Typography, { sx: { display: "block" }, variant: "caption", children: action }, action)) })
|
|
18857
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Box, { sx: { alignItems: "center", display: "flex", gap: 1, mb: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Chip, { label: formatPermissionStatus(parsedIAM.permission), size: "small", sx: { ...chipColors, fontWeight: 500 } }) }),
|
|
18858
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material12.Stack, { spacing: 1, children: [
|
|
18859
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Box, { "data-testid": EVENT_DETAILS_IAM_PRINCIPAL_TEST_ID, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(LabelValue, { label: "Principal", value: parsedIAM.principal }) }),
|
|
18860
|
+
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material12.Box, { "data-testid": EVENT_DETAILS_IAM_ACTIONS_TEST_ID, children: [
|
|
18861
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Typography, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Actions" }),
|
|
18862
|
+
parsedIAM.details.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Typography, { sx: { display: "block" }, variant: "body2", children: action }, action))
|
|
18869
18863
|
] }),
|
|
18870
|
-
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material12.Box, {
|
|
18871
|
-
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Typography, {
|
|
18872
|
-
|
|
18864
|
+
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material12.Box, { "data-testid": EVENT_DETAILS_IAM_RESOURCES_TEST_ID, children: [
|
|
18865
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Typography, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Resources" }),
|
|
18866
|
+
parsedIAM.details.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Typography, { sx: { display: "block", wordBreak: "break-all" }, variant: "body2", children: resource }, resource))
|
|
18873
18867
|
] })
|
|
18874
18868
|
] })
|
|
18875
18869
|
] });
|
|
18876
18870
|
};
|
|
18877
|
-
var IAMPermissionDetail = ({ events }) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Box, { children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(IAMPermissionItem, { event }, `${event.span_id}-${event.event_id}`)) });
|
|
18871
|
+
var IAMPermissionDetail = ({ events, spanStatusCode }) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material12.Box, { children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(IAMPermissionItem, { event, spanStatusCode }, `${event.span_id}-${event.event_id}`)) });
|
|
18878
18872
|
|
|
18879
18873
|
// src/components/event-details/payload-viewer.tsx
|
|
18880
18874
|
var import_material14 = require("@mui/material");
|
|
@@ -20760,7 +20754,7 @@ var EventMessage = ({ event }) => {
|
|
|
20760
20754
|
},
|
|
20761
20755
|
size: "small",
|
|
20762
20756
|
sx: { mr: 1, p: 0 },
|
|
20763
|
-
children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
20757
|
+
children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_icons_material7.KeyboardArrowDown, { sx: { fontSize: 16 } }) : /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_icons_material7.KeyboardArrowRight, { sx: { fontSize: 16 } })
|
|
20764
20758
|
}
|
|
20765
20759
|
),
|
|
20766
20760
|
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
@@ -20815,10 +20809,11 @@ var getEventLevelFromGroup = (group4) => {
|
|
|
20815
20809
|
var EventDetail = ({
|
|
20816
20810
|
displayText,
|
|
20817
20811
|
events,
|
|
20812
|
+
spanStatusCode,
|
|
20818
20813
|
type
|
|
20819
20814
|
}) => {
|
|
20820
20815
|
if (type === "permission") {
|
|
20821
|
-
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(IAMPermissionDetail, { events });
|
|
20816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(IAMPermissionDetail, { events, spanStatusCode });
|
|
20822
20817
|
}
|
|
20823
20818
|
const eventLevel = getEventLevelFromGroup(type);
|
|
20824
20819
|
return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material15.Box, { children: [
|
|
@@ -30624,7 +30619,7 @@ var LambdaInvokeLogsSection = ({ endTimeNano, functionName: functionName2, regio
|
|
|
30624
30619
|
};
|
|
30625
30620
|
|
|
30626
30621
|
// src/components/event-details/toggle-section.tsx
|
|
30627
|
-
var
|
|
30622
|
+
var import_icons_material8 = require("@mui/icons-material");
|
|
30628
30623
|
var import_material17 = require("@mui/material");
|
|
30629
30624
|
var import_react58 = require("react");
|
|
30630
30625
|
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
@@ -30656,7 +30651,7 @@ var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
|
|
|
30656
30651
|
},
|
|
30657
30652
|
children: [
|
|
30658
30653
|
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material17.Typography, { sx: { fontWeight: 600 }, variant: "subtitle2", children: headline }),
|
|
30659
|
-
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
30654
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_icons_material8.KeyboardArrowDown, { sx: { color: "text.secondary", height: 20, width: 20 } }) : /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_icons_material8.KeyboardArrowRight, { sx: { color: "text.secondary", height: 20, width: 20 } })
|
|
30660
30655
|
]
|
|
30661
30656
|
}
|
|
30662
30657
|
),
|
|
@@ -30730,7 +30725,7 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
30730
30725
|
},
|
|
30731
30726
|
children: [
|
|
30732
30727
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material18.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material18.Typography, { sx: { fontWeight: 600 }, variant: "h6", children: "Operation Details" }) }),
|
|
30733
|
-
onClose && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material18.IconButton, { "data-testid": EVENT_DETAILS_CLOSE_BUTTON_TEST_ID, onClick: onClose, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
30728
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material18.IconButton, { "data-testid": EVENT_DETAILS_CLOSE_BUTTON_TEST_ID, onClick: onClose, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_icons_material9.Close, {}) })
|
|
30734
30729
|
]
|
|
30735
30730
|
}
|
|
30736
30731
|
),
|
|
@@ -30800,7 +30795,7 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
30800
30795
|
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(ToggleSection, { headline: "Permissions", children: [
|
|
30801
30796
|
selectedEvent.iam_errors_suppressed && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material18.Alert, { "data-testid": EVENT_DETAILS_IAM_ERRORS_SUPPRESSED_TEST_ID, severity: "warning", sx: { mb: 1 }, children: "IAM errors are suppressed \u2014 upgrade your license to view" }),
|
|
30802
30797
|
!selectedEvent.iam_errors_suppressed && !eventGroups.permissions && !eventGroups.errors && !eventGroups.warnings && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material18.Typography, { color: "text.secondary", variant: "body2", children: "There is no permission information available." }),
|
|
30803
|
-
eventGroups.permissions && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(EventDetail, { displayText: "Permissions", events: eventGroups.permissions, type: "permission" }),
|
|
30798
|
+
eventGroups.permissions && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(EventDetail, { displayText: "Permissions", events: eventGroups.permissions, spanStatusCode: selectedEvent.status_code, type: "permission" }),
|
|
30804
30799
|
eventGroups.errors && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(EventDetail, { displayText: "Error", events: eventGroups.errors, type: "error" }),
|
|
30805
30800
|
eventGroups.warnings && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(EventDetail, { displayText: "Warning", events: eventGroups.warnings, type: "warning" })
|
|
30806
30801
|
] }),
|
|
@@ -30872,79 +30867,35 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
30872
30867
|
|
|
30873
30868
|
// src/components/trace-graph/trace-graph.tsx
|
|
30874
30869
|
var import_base = require("@xyflow/react/dist/base.css");
|
|
30875
|
-
var
|
|
30876
|
-
var
|
|
30877
|
-
var
|
|
30870
|
+
var import_material21 = require("@mui/material");
|
|
30871
|
+
var import_react64 = require("@xyflow/react");
|
|
30872
|
+
var import_react65 = require("react");
|
|
30878
30873
|
|
|
30879
30874
|
// src/components/trace-graph/service-node.tsx
|
|
30880
|
-
var
|
|
30881
|
-
var import_style = require("@xyflow/react/dist/style.css");
|
|
30882
|
-
var import_react61 = require("@xyflow/react");
|
|
30883
|
-
var import_react62 = require("react");
|
|
30884
|
-
|
|
30885
|
-
// src/components/trace-graph/problem-indicator.tsx
|
|
30886
|
-
var import_icons_material11 = require("@mui/icons-material");
|
|
30875
|
+
var import_icons_material10 = require("@mui/icons-material");
|
|
30887
30876
|
var import_material19 = require("@mui/material");
|
|
30888
|
-
var
|
|
30877
|
+
var import_style = require("@xyflow/react/dist/style.css");
|
|
30878
|
+
var import_react60 = require("@xyflow/react");
|
|
30879
|
+
var import_react61 = require("react");
|
|
30889
30880
|
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
30890
|
-
var ProblemIndicator = ({ error }) => {
|
|
30891
|
-
const icon = (0, import_react60.useMemo)(() => {
|
|
30892
|
-
switch (error.level) {
|
|
30893
|
-
case "error": {
|
|
30894
|
-
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_icons_material11.Error, { sx: { color: "#d32f2f", fontSize: "14px" } });
|
|
30895
|
-
}
|
|
30896
|
-
case "warning": {
|
|
30897
|
-
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_icons_material11.Warning, { sx: { color: "#ff9800", fontSize: "14px" } });
|
|
30898
|
-
}
|
|
30899
|
-
default: {
|
|
30900
|
-
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_icons_material11.Info, { sx: { color: "#2196f3", fontSize: "14px" } });
|
|
30901
|
-
}
|
|
30902
|
-
}
|
|
30903
|
-
}, [error.level]);
|
|
30904
|
-
const color2 = (0, import_react60.useMemo)(() => {
|
|
30905
|
-
switch (error.level) {
|
|
30906
|
-
case "error": {
|
|
30907
|
-
return "#d32f2f";
|
|
30908
|
-
}
|
|
30909
|
-
case "warning": {
|
|
30910
|
-
return "#ff9800";
|
|
30911
|
-
}
|
|
30912
|
-
default: {
|
|
30913
|
-
return "#2196f3";
|
|
30914
|
-
}
|
|
30915
|
-
}
|
|
30916
|
-
}, [error.level]);
|
|
30917
|
-
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material19.Tooltip, { arrow: true, title: error.message ?? "Issue detected", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
30918
|
-
import_material19.Box,
|
|
30919
|
-
{
|
|
30920
|
-
sx: {
|
|
30921
|
-
alignItems: "center",
|
|
30922
|
-
backgroundColor: `${color2}15`,
|
|
30923
|
-
border: `1px solid ${color2}`,
|
|
30924
|
-
borderRadius: "50%",
|
|
30925
|
-
cursor: "pointer",
|
|
30926
|
-
display: "inline-flex",
|
|
30927
|
-
height: "18px",
|
|
30928
|
-
justifyContent: "center",
|
|
30929
|
-
width: "18px"
|
|
30930
|
-
},
|
|
30931
|
-
children: icon
|
|
30932
|
-
}
|
|
30933
|
-
) });
|
|
30934
|
-
};
|
|
30935
|
-
|
|
30936
|
-
// src/components/trace-graph/service-node.tsx
|
|
30937
|
-
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
30938
30881
|
var handleStyle = {
|
|
30939
30882
|
backgroundColor: "white",
|
|
30940
30883
|
borderColor: "lightgray",
|
|
30941
30884
|
opacity: 0
|
|
30942
30885
|
};
|
|
30943
|
-
var ServiceNode = (0,
|
|
30944
|
-
const theme = (0,
|
|
30945
|
-
const
|
|
30946
|
-
|
|
30947
|
-
|
|
30886
|
+
var ServiceNode = (0, import_react61.memo)(({ data, selected }) => {
|
|
30887
|
+
const theme = (0, import_material19.useTheme)();
|
|
30888
|
+
const isError = data.event.status_code === 2;
|
|
30889
|
+
const hasPermissionEvents = (0, import_react61.useMemo)(
|
|
30890
|
+
() => data.event.events.some(
|
|
30891
|
+
(event) => event.event_type === "iam.policy_evaluation" && event.name === "iam.policy.denied"
|
|
30892
|
+
),
|
|
30893
|
+
[data.event.events]
|
|
30894
|
+
);
|
|
30895
|
+
const isWarning = !isError && data.event.status_code === 1 && hasPermissionEvents;
|
|
30896
|
+
const outlineColor = isError ? theme.palette.error.main : isWarning ? theme.palette.warning.main : void 0;
|
|
30897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
30898
|
+
import_material19.Box,
|
|
30948
30899
|
{
|
|
30949
30900
|
"data-testid": SERVICE_NODE_TEST_ID,
|
|
30950
30901
|
role: "button",
|
|
@@ -30953,32 +30904,32 @@ var ServiceNode = (0, import_react62.memo)(({ data, selected }) => {
|
|
|
30953
30904
|
boxShadow: theme.palette.mode === "dark" ? "0 4px 12px rgba(0,0,0,0.6)" : "0 4px 12px rgba(0,0,0,0.22)"
|
|
30954
30905
|
},
|
|
30955
30906
|
"backgroundColor": theme.palette.background.paper,
|
|
30956
|
-
"borderLeft": `3px solid ${
|
|
30907
|
+
"borderLeft": `3px solid ${outlineColor ?? "transparent"}`,
|
|
30957
30908
|
"borderRadius": 1,
|
|
30958
30909
|
"boxShadow": theme.palette.mode === "dark" ? "0 1px 4px rgba(0,0,0,0.5)" : "0 1px 4px rgba(0,0,0,0.13)",
|
|
30959
30910
|
"cursor": "pointer",
|
|
30960
30911
|
"maxWidth": 220,
|
|
30961
30912
|
"minWidth": 140,
|
|
30962
|
-
"outline": selected ? `2px solid ${
|
|
30913
|
+
"outline": selected ? `2px solid ${theme.palette.primary.main}` : `1px solid ${theme.palette.divider}`,
|
|
30963
30914
|
"overflow": "hidden",
|
|
30964
30915
|
"position": "relative",
|
|
30965
30916
|
"transition": "all 0.3s ease"
|
|
30966
30917
|
},
|
|
30967
30918
|
tabIndex: 0,
|
|
30968
30919
|
children: [
|
|
30969
|
-
/* @__PURE__ */ (0,
|
|
30970
|
-
/* @__PURE__ */ (0,
|
|
30971
|
-
/* @__PURE__ */ (0,
|
|
30972
|
-
|
|
30920
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_react60.Handle, { position: import_react60.Position.Left, style: handleStyle, type: "target" }),
|
|
30921
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_react60.Handle, { position: import_react60.Position.Right, style: handleStyle, type: "source" }),
|
|
30922
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
30923
|
+
import_material19.Stack,
|
|
30973
30924
|
{
|
|
30974
30925
|
alignItems: "center",
|
|
30975
30926
|
direction: "row",
|
|
30976
30927
|
sx: { gap: "8px", pb: "2px", pt: "6px", px: "8px" },
|
|
30977
30928
|
children: [
|
|
30978
|
-
/* @__PURE__ */ (0,
|
|
30979
|
-
/* @__PURE__ */ (0,
|
|
30980
|
-
/* @__PURE__ */ (0,
|
|
30981
|
-
|
|
30929
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material19.Box, { sx: { borderRadius: "4px", flexShrink: 0, lineHeight: 0, overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(AwsServiceIcon, { hideTooltip: true, service: data.event.service_name, size: "medium" }) }),
|
|
30930
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material19.Stack, { sx: { minWidth: 0 }, children: [
|
|
30931
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
30932
|
+
import_material19.Typography,
|
|
30982
30933
|
{
|
|
30983
30934
|
noWrap: true,
|
|
30984
30935
|
sx: { fontWeight: 700, lineHeight: 1.25 },
|
|
@@ -30986,8 +30937,8 @@ var ServiceNode = (0, import_react62.memo)(({ data, selected }) => {
|
|
|
30986
30937
|
children: getServiceDisplayName(data.event.service_name)
|
|
30987
30938
|
}
|
|
30988
30939
|
),
|
|
30989
|
-
data.event.resource_name != "" && /* @__PURE__ */ (0,
|
|
30990
|
-
|
|
30940
|
+
data.event.resource_name != "" && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
30941
|
+
import_material19.Typography,
|
|
30991
30942
|
{
|
|
30992
30943
|
color: "text.secondary",
|
|
30993
30944
|
noWrap: true,
|
|
@@ -31000,16 +30951,16 @@ var ServiceNode = (0, import_react62.memo)(({ data, selected }) => {
|
|
|
31000
30951
|
]
|
|
31001
30952
|
}
|
|
31002
30953
|
),
|
|
31003
|
-
/* @__PURE__ */ (0,
|
|
31004
|
-
/* @__PURE__ */ (0,
|
|
31005
|
-
|
|
30954
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material19.Divider, { sx: { ml: "38px", mr: "8px", my: "5px" } }),
|
|
30955
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
30956
|
+
import_material19.Stack,
|
|
31006
30957
|
{
|
|
31007
30958
|
alignItems: "center",
|
|
31008
30959
|
direction: "row",
|
|
31009
30960
|
sx: { minWidth: 0, pb: "5px", pr: "8px", pt: "1px" },
|
|
31010
30961
|
children: [
|
|
31011
|
-
/* @__PURE__ */ (0,
|
|
31012
|
-
|
|
30962
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
30963
|
+
import_material19.Box,
|
|
31013
30964
|
{
|
|
31014
30965
|
sx: {
|
|
31015
30966
|
alignItems: "center",
|
|
@@ -31018,11 +30969,14 @@ var ServiceNode = (0, import_react62.memo)(({ data, selected }) => {
|
|
|
31018
30969
|
justifyContent: "center",
|
|
31019
30970
|
width: "38px"
|
|
31020
30971
|
},
|
|
31021
|
-
children:
|
|
30972
|
+
children: [
|
|
30973
|
+
(isError || isWarning) && hasPermissionEvents && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material19.Tooltip, { arrow: true, title: "Permission denied", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_icons_material10.GppBad, { sx: { color: isError ? theme.palette.error.main : theme.palette.warning.main, fontSize: "16px" } }) }),
|
|
30974
|
+
isError && !hasPermissionEvents && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material19.Tooltip, { arrow: true, title: "Error", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_icons_material10.Cancel, { sx: { color: theme.palette.error.main, fontSize: "16px" } }) })
|
|
30975
|
+
]
|
|
31022
30976
|
}
|
|
31023
30977
|
),
|
|
31024
|
-
/* @__PURE__ */ (0,
|
|
31025
|
-
|
|
30978
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
30979
|
+
import_material19.Typography,
|
|
31026
30980
|
{
|
|
31027
30981
|
"data-testid": SERVICE_NODE_OPERATION_NAME_TEST_ID,
|
|
31028
30982
|
noWrap: true,
|
|
@@ -31094,20 +31048,20 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
|
|
|
31094
31048
|
};
|
|
31095
31049
|
|
|
31096
31050
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
31097
|
-
var
|
|
31098
|
-
var
|
|
31099
|
-
var
|
|
31100
|
-
var
|
|
31051
|
+
var import_icons_material11 = require("@mui/icons-material");
|
|
31052
|
+
var import_material20 = require("@mui/material");
|
|
31053
|
+
var import_react62 = require("@xyflow/react");
|
|
31054
|
+
var import_react63 = require("react");
|
|
31101
31055
|
var import_shallow = require("zustand/shallow");
|
|
31102
|
-
var
|
|
31056
|
+
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
31103
31057
|
var selector = (s2) => ({
|
|
31104
31058
|
isInteractive: s2.nodesDraggable || s2.nodesConnectable || s2.elementsSelectable,
|
|
31105
31059
|
maxZoomReached: s2.transform[2] >= s2.maxZoom,
|
|
31106
31060
|
minZoomReached: s2.transform[2] <= s2.minZoom
|
|
31107
31061
|
});
|
|
31108
|
-
var Controls = (0,
|
|
31109
|
-
const { maxZoomReached, minZoomReached } = (0,
|
|
31110
|
-
const { fitView, zoomIn, zoomOut } = (0,
|
|
31062
|
+
var Controls = (0, import_react63.memo)(() => {
|
|
31063
|
+
const { maxZoomReached, minZoomReached } = (0, import_react62.useStore)(selector, import_shallow.shallow);
|
|
31064
|
+
const { fitView, zoomIn, zoomOut } = (0, import_react62.useReactFlow)();
|
|
31111
31065
|
const onZoomInHandler = () => {
|
|
31112
31066
|
void zoomIn();
|
|
31113
31067
|
};
|
|
@@ -31117,8 +31071,8 @@ var Controls = (0, import_react64.memo)(() => {
|
|
|
31117
31071
|
const onFitViewHandler = () => {
|
|
31118
31072
|
void fitView();
|
|
31119
31073
|
};
|
|
31120
|
-
return /* @__PURE__ */ (0,
|
|
31121
|
-
|
|
31074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
|
|
31075
|
+
import_material20.Box,
|
|
31122
31076
|
{
|
|
31123
31077
|
sx: {
|
|
31124
31078
|
bottom: 0,
|
|
@@ -31131,33 +31085,33 @@ var Controls = (0, import_react64.memo)(() => {
|
|
|
31131
31085
|
zIndex: 5
|
|
31132
31086
|
},
|
|
31133
31087
|
children: [
|
|
31134
|
-
/* @__PURE__ */ (0,
|
|
31135
|
-
|
|
31088
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
31089
|
+
import_material20.IconButton,
|
|
31136
31090
|
{
|
|
31137
31091
|
className: "react-flow__controls-zoomin",
|
|
31138
31092
|
disabled: maxZoomReached,
|
|
31139
31093
|
onClick: onZoomInHandler,
|
|
31140
31094
|
size: "small",
|
|
31141
|
-
children: /* @__PURE__ */ (0,
|
|
31095
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_icons_material11.Add, {})
|
|
31142
31096
|
}
|
|
31143
31097
|
),
|
|
31144
|
-
/* @__PURE__ */ (0,
|
|
31145
|
-
|
|
31098
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
31099
|
+
import_material20.IconButton,
|
|
31146
31100
|
{
|
|
31147
31101
|
className: "react-flow__controls-zoomout",
|
|
31148
31102
|
disabled: minZoomReached,
|
|
31149
31103
|
onClick: onZoomOutHandler,
|
|
31150
31104
|
size: "small",
|
|
31151
|
-
children: /* @__PURE__ */ (0,
|
|
31105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_icons_material11.Remove, {})
|
|
31152
31106
|
}
|
|
31153
31107
|
),
|
|
31154
|
-
/* @__PURE__ */ (0,
|
|
31155
|
-
|
|
31108
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
31109
|
+
import_material20.IconButton,
|
|
31156
31110
|
{
|
|
31157
31111
|
className: "react-flow__controls-fitview",
|
|
31158
31112
|
onClick: onFitViewHandler,
|
|
31159
31113
|
size: "small",
|
|
31160
|
-
children: /* @__PURE__ */ (0,
|
|
31114
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_icons_material11.FitScreen, {})
|
|
31161
31115
|
}
|
|
31162
31116
|
)
|
|
31163
31117
|
]
|
|
@@ -31166,7 +31120,7 @@ var Controls = (0, import_react64.memo)(() => {
|
|
|
31166
31120
|
});
|
|
31167
31121
|
|
|
31168
31122
|
// src/components/trace-graph/trace-graph.tsx
|
|
31169
|
-
var
|
|
31123
|
+
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
31170
31124
|
var nodeTypes = {
|
|
31171
31125
|
service: ServiceNode
|
|
31172
31126
|
};
|
|
@@ -31176,9 +31130,9 @@ var TraceGraph = ({
|
|
|
31176
31130
|
onRefresh,
|
|
31177
31131
|
spans
|
|
31178
31132
|
}) => {
|
|
31179
|
-
const [nodes, setNodes, onNodesChange] = (0,
|
|
31180
|
-
const [edges, setEdges] = (0,
|
|
31181
|
-
(0,
|
|
31133
|
+
const [nodes, setNodes, onNodesChange] = (0, import_react64.useNodesState)([]);
|
|
31134
|
+
const [edges, setEdges] = (0, import_react64.useEdgesState)([]);
|
|
31135
|
+
(0, import_react65.useEffect)(() => {
|
|
31182
31136
|
const allNodes = [];
|
|
31183
31137
|
const allEdges = [];
|
|
31184
31138
|
for (const span of spans.data ?? []) {
|
|
@@ -31193,15 +31147,15 @@ var TraceGraph = ({
|
|
|
31193
31147
|
},
|
|
31194
31148
|
id: span.span_id,
|
|
31195
31149
|
position: { x: 0, y: 0 },
|
|
31196
|
-
sourcePosition:
|
|
31197
|
-
targetPosition:
|
|
31150
|
+
sourcePosition: import_react64.Position.Right,
|
|
31151
|
+
targetPosition: import_react64.Position.Left,
|
|
31198
31152
|
type: "service"
|
|
31199
31153
|
});
|
|
31200
31154
|
if (span.parent_span_id !== null) {
|
|
31201
31155
|
allEdges.push({
|
|
31202
31156
|
animated: false,
|
|
31203
31157
|
id: `e-${span.parent_span_id}-${span.span_id}`,
|
|
31204
|
-
markerEnd: { color: "lightgray", height: 16, type:
|
|
31158
|
+
markerEnd: { color: "lightgray", height: 16, type: import_react64.MarkerType.Arrow, width: 16 },
|
|
31205
31159
|
source: span.parent_span_id,
|
|
31206
31160
|
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
31207
31161
|
target: span.span_id
|
|
@@ -31210,7 +31164,7 @@ var TraceGraph = ({
|
|
|
31210
31164
|
for (const outgoingLinkSpanId of span.outgoing_link_span_ids ?? []) {
|
|
31211
31165
|
allEdges.push({
|
|
31212
31166
|
id: `e-link-${outgoingLinkSpanId}-${span.span_id}`,
|
|
31213
|
-
markerEnd: { color: "lightgray", height: 16, type:
|
|
31167
|
+
markerEnd: { color: "lightgray", height: 16, type: import_react64.MarkerType.Arrow, width: 16 },
|
|
31214
31168
|
source: outgoingLinkSpanId,
|
|
31215
31169
|
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
31216
31170
|
// animated: true,
|
|
@@ -31228,12 +31182,12 @@ var TraceGraph = ({
|
|
|
31228
31182
|
setNodes(layoutedNodes);
|
|
31229
31183
|
setEdges(layoutedEdges);
|
|
31230
31184
|
}, [spans.data, initialFocusEventId, setNodes, setEdges]);
|
|
31231
|
-
const theme = (0,
|
|
31232
|
-
return /* @__PURE__ */ (0,
|
|
31233
|
-
spans.error && /* @__PURE__ */ (0,
|
|
31234
|
-
|
|
31185
|
+
const theme = (0, import_material21.useTheme)();
|
|
31186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(import_jsx_runtime144.Fragment, { children: [
|
|
31187
|
+
spans.error && /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
|
|
31188
|
+
import_material21.Alert,
|
|
31235
31189
|
{
|
|
31236
|
-
action: /* @__PURE__ */ (0,
|
|
31190
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_material21.Button, { onClick: () => {
|
|
31237
31191
|
onRefresh();
|
|
31238
31192
|
}, children: "Retry" }),
|
|
31239
31193
|
severity: "error",
|
|
@@ -31244,8 +31198,8 @@ var TraceGraph = ({
|
|
|
31244
31198
|
]
|
|
31245
31199
|
}
|
|
31246
31200
|
),
|
|
31247
|
-
/* @__PURE__ */ (0,
|
|
31248
|
-
|
|
31201
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
|
|
31202
|
+
import_react64.ReactFlow,
|
|
31249
31203
|
{
|
|
31250
31204
|
"data-testid": TRACE_GRAPH_TEST_ID,
|
|
31251
31205
|
edges,
|
|
@@ -31262,9 +31216,9 @@ var TraceGraph = ({
|
|
|
31262
31216
|
onNodesChange,
|
|
31263
31217
|
selectNodesOnDrag: false,
|
|
31264
31218
|
children: [
|
|
31265
|
-
/* @__PURE__ */ (0,
|
|
31266
|
-
/* @__PURE__ */ (0,
|
|
31267
|
-
|
|
31219
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Controls, {}),
|
|
31220
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
31221
|
+
import_react64.Background,
|
|
31268
31222
|
{
|
|
31269
31223
|
bgColor: theme.palette.background.default,
|
|
31270
31224
|
color: theme.palette.text.disabled
|
|
@@ -31277,7 +31231,7 @@ var TraceGraph = ({
|
|
|
31277
31231
|
};
|
|
31278
31232
|
|
|
31279
31233
|
// src/pages/trace-graph-page.tsx
|
|
31280
|
-
var
|
|
31234
|
+
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
31281
31235
|
var HEADER_HEIGHT = 56;
|
|
31282
31236
|
var DRAWER_WIDTH = "35%";
|
|
31283
31237
|
var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
|
|
@@ -31295,7 +31249,7 @@ var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) =>
|
|
|
31295
31249
|
})
|
|
31296
31250
|
}
|
|
31297
31251
|
}));
|
|
31298
|
-
var StyledDrawer = (0, import_styles.styled)(
|
|
31252
|
+
var StyledDrawer = (0, import_styles.styled)(import_material22.Drawer)(() => ({
|
|
31299
31253
|
"& .MuiDrawer-paper": {
|
|
31300
31254
|
bottom: 0,
|
|
31301
31255
|
boxSizing: "border-box",
|
|
@@ -31326,8 +31280,8 @@ var TraceGraphView = ({
|
|
|
31326
31280
|
traceId
|
|
31327
31281
|
}) => {
|
|
31328
31282
|
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
31329
|
-
return /* @__PURE__ */ (0,
|
|
31330
|
-
|
|
31283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(
|
|
31284
|
+
import_material22.Box,
|
|
31331
31285
|
{
|
|
31332
31286
|
"data-testid": TRACE_GRAPH_PAGE_TEST_ID,
|
|
31333
31287
|
sx: {
|
|
@@ -31339,14 +31293,14 @@ var TraceGraphView = ({
|
|
|
31339
31293
|
overflow: "hidden"
|
|
31340
31294
|
},
|
|
31341
31295
|
children: [
|
|
31342
|
-
/* @__PURE__ */ (0,
|
|
31343
|
-
/* @__PURE__ */ (0,
|
|
31296
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_material22.Box, { sx: { display: "flex", width: "100%" }, children: [
|
|
31297
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_material22.Button, { onClick: () => {
|
|
31344
31298
|
navigateToSpansList();
|
|
31345
|
-
}, startIcon: /* @__PURE__ */ (0,
|
|
31346
|
-
/* @__PURE__ */ (0,
|
|
31299
|
+
}, startIcon: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_icons_material12.ArrowBack, {}), children: "Go back" }),
|
|
31300
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_material22.Box, { sx: { flexGrow: 1 } })
|
|
31347
31301
|
] }),
|
|
31348
|
-
/* @__PURE__ */ (0,
|
|
31349
|
-
|
|
31302
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
31303
|
+
import_material22.Paper,
|
|
31350
31304
|
{
|
|
31351
31305
|
sx: {
|
|
31352
31306
|
display: "flex",
|
|
@@ -31355,7 +31309,7 @@ var TraceGraphView = ({
|
|
|
31355
31309
|
position: "relative",
|
|
31356
31310
|
width: "100%"
|
|
31357
31311
|
},
|
|
31358
|
-
children: shouldShowStatusMessage ? /* @__PURE__ */ (0,
|
|
31312
|
+
children: shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
31359
31313
|
StatusMessage,
|
|
31360
31314
|
{
|
|
31361
31315
|
error: statusError,
|
|
@@ -31363,15 +31317,15 @@ var TraceGraphView = ({
|
|
|
31363
31317
|
onRetry: handleRetry,
|
|
31364
31318
|
status
|
|
31365
31319
|
}
|
|
31366
|
-
) : /* @__PURE__ */ (0,
|
|
31367
|
-
/* @__PURE__ */ (0,
|
|
31368
|
-
|
|
31320
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
|
|
31321
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Main, { open, children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
31322
|
+
import_material22.Box,
|
|
31369
31323
|
{
|
|
31370
31324
|
sx: {
|
|
31371
31325
|
height: "100%",
|
|
31372
31326
|
overflow: "auto"
|
|
31373
31327
|
},
|
|
31374
|
-
children: traceId !== void 0 && /* @__PURE__ */ (0,
|
|
31328
|
+
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_react66.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
31375
31329
|
TraceGraph,
|
|
31376
31330
|
{
|
|
31377
31331
|
initialFocusEventId: spanId,
|
|
@@ -31388,7 +31342,7 @@ var TraceGraphView = ({
|
|
|
31388
31342
|
) })
|
|
31389
31343
|
}
|
|
31390
31344
|
) }),
|
|
31391
|
-
/* @__PURE__ */ (0,
|
|
31345
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(EventDetails, { onClose: handleClose, selectedEvent }) })
|
|
31392
31346
|
] })
|
|
31393
31347
|
}
|
|
31394
31348
|
)
|
|
@@ -31432,10 +31386,10 @@ async function fetchConnectedTraces(api, traceIds, allSpans = /* @__PURE__ */ ne
|
|
|
31432
31386
|
}
|
|
31433
31387
|
var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
31434
31388
|
const api = useAppInspectorApi();
|
|
31435
|
-
const [spans, setSpans] = (0,
|
|
31436
|
-
const [loading, setLoading] = (0,
|
|
31437
|
-
const [fetchError, setFetchError] = (0,
|
|
31438
|
-
const fetchSpans = (0,
|
|
31389
|
+
const [spans, setSpans] = (0, import_react67.useState)();
|
|
31390
|
+
const [loading, setLoading] = (0, import_react67.useState)(false);
|
|
31391
|
+
const [fetchError, setFetchError] = (0, import_react67.useState)();
|
|
31392
|
+
const fetchSpans = (0, import_react67.useCallback)(async () => {
|
|
31439
31393
|
setLoading(true);
|
|
31440
31394
|
try {
|
|
31441
31395
|
const spans2 = await fetchConnectedTraces(api, [traceId]);
|
|
@@ -31448,40 +31402,40 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
31448
31402
|
setLoading(false);
|
|
31449
31403
|
}
|
|
31450
31404
|
}, [api, traceId]);
|
|
31451
|
-
(0,
|
|
31405
|
+
(0, import_react67.useEffect)(() => {
|
|
31452
31406
|
void fetchSpans();
|
|
31453
31407
|
}, [fetchSpans]);
|
|
31454
|
-
const [open, setOpen] = (0,
|
|
31455
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
31456
|
-
const spansReference = (0,
|
|
31457
|
-
(0,
|
|
31408
|
+
const [open, setOpen] = (0, import_react67.useState)(true);
|
|
31409
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react67.useState)(() => spans?.find((span) => span.span_id === spanId));
|
|
31410
|
+
const spansReference = (0, import_react67.useRef)();
|
|
31411
|
+
(0, import_react67.useEffect)(() => {
|
|
31458
31412
|
if (!spansReference.current && spans) {
|
|
31459
31413
|
setSelectedEvent(spans.find((span) => span.span_id === spanId));
|
|
31460
31414
|
spansReference.current = spans;
|
|
31461
31415
|
}
|
|
31462
31416
|
}, [spans, setSelectedEvent, spanId]);
|
|
31463
31417
|
const { checkStatus, reportDisabled, status, statusError } = useAppInspectorStatus();
|
|
31464
|
-
(0,
|
|
31418
|
+
(0, import_react67.useEffect)(() => {
|
|
31465
31419
|
if (fetchError instanceof AppInspectorDisabledError || fetchError instanceof ConnectionError) {
|
|
31466
31420
|
reportDisabled();
|
|
31467
31421
|
}
|
|
31468
31422
|
}, [fetchError, reportDisabled]);
|
|
31469
|
-
const handleEnable = (0,
|
|
31423
|
+
const handleEnable = (0, import_react67.useCallback)(async () => {
|
|
31470
31424
|
await api.setStatus({ status: "ENABLED" });
|
|
31471
31425
|
void checkStatus();
|
|
31472
31426
|
}, [api, checkStatus]);
|
|
31473
|
-
const handleEventSelect = (0,
|
|
31427
|
+
const handleEventSelect = (0, import_react67.useCallback)((spanId2) => {
|
|
31474
31428
|
const span = spans?.find((s2) => s2.span_id === spanId2);
|
|
31475
31429
|
setSelectedEvent(span);
|
|
31476
31430
|
setOpen(true);
|
|
31477
31431
|
}, [spans]);
|
|
31478
|
-
const handleRetry = (0,
|
|
31432
|
+
const handleRetry = (0, import_react67.useCallback)(() => {
|
|
31479
31433
|
void checkStatus();
|
|
31480
31434
|
}, [checkStatus]);
|
|
31481
|
-
const navigateToSpansList = (0,
|
|
31435
|
+
const navigateToSpansList = (0, import_react67.useCallback)(() => {
|
|
31482
31436
|
onClose?.();
|
|
31483
31437
|
}, [onClose]);
|
|
31484
|
-
return /* @__PURE__ */ (0,
|
|
31438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
31485
31439
|
TraceGraphView,
|
|
31486
31440
|
{
|
|
31487
31441
|
fetchError,
|
|
@@ -31506,7 +31460,7 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
31506
31460
|
};
|
|
31507
31461
|
|
|
31508
31462
|
// src/pages/spans-list-page.tsx
|
|
31509
|
-
var
|
|
31463
|
+
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
31510
31464
|
var SpansListPage = () => {
|
|
31511
31465
|
const api = useAppInspectorApi();
|
|
31512
31466
|
const {
|
|
@@ -31530,32 +31484,32 @@ var SpansListPage = () => {
|
|
|
31530
31484
|
warningCount
|
|
31531
31485
|
} = useSpans();
|
|
31532
31486
|
const { checking, checkStatus, status, statusError } = useAppInspectorStatus();
|
|
31533
|
-
const clearSpansSync = (0,
|
|
31487
|
+
const clearSpansSync = (0, import_react68.useCallback)(() => {
|
|
31534
31488
|
void clearSpans();
|
|
31535
31489
|
}, [clearSpans]);
|
|
31536
31490
|
const localstackVersion = status?.localstackVersion ?? (statusError instanceof AppInspectorNotFoundError ? statusError.localstackVersion : void 0);
|
|
31537
31491
|
const versionCompatibility = checkEmulatorVersion(localstackVersion);
|
|
31538
|
-
const [bannerDismissed, setBannerDismissed] = (0,
|
|
31492
|
+
const [bannerDismissed, setBannerDismissed] = (0, import_react68.useState)(false);
|
|
31539
31493
|
const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
|
|
31540
|
-
const [selectedTraceId, setSelectedTraceId] = (0,
|
|
31541
|
-
const [selectedSpanId, setSelectedSpanId] = (0,
|
|
31542
|
-
const navigateToSpan = (0,
|
|
31494
|
+
const [selectedTraceId, setSelectedTraceId] = (0, import_react68.useState)();
|
|
31495
|
+
const [selectedSpanId, setSelectedSpanId] = (0, import_react68.useState)();
|
|
31496
|
+
const navigateToSpan = (0, import_react68.useCallback)((span) => {
|
|
31543
31497
|
setSelectedTraceId(span.trace_id);
|
|
31544
31498
|
setSelectedSpanId(span.span_id);
|
|
31545
31499
|
}, []);
|
|
31546
|
-
const handleRetry = (0,
|
|
31500
|
+
const handleRetry = (0, import_react68.useCallback)(() => {
|
|
31547
31501
|
void checkStatus();
|
|
31548
31502
|
fetchForward();
|
|
31549
31503
|
}, [checkStatus, fetchForward]);
|
|
31550
|
-
const handleEnable = (0,
|
|
31504
|
+
const handleEnable = (0, import_react68.useCallback)(async () => {
|
|
31551
31505
|
await api.setStatus({ status: "ENABLED" });
|
|
31552
31506
|
clearFetchError();
|
|
31553
31507
|
void checkStatus();
|
|
31554
31508
|
}, [api, checkStatus, clearFetchError]);
|
|
31555
31509
|
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
31556
|
-
return /* @__PURE__ */ (0,
|
|
31557
|
-
/* @__PURE__ */ (0,
|
|
31558
|
-
|
|
31510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_jsx_runtime146.Fragment, { children: [
|
|
31511
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
|
|
31512
|
+
import_material23.Box,
|
|
31559
31513
|
{
|
|
31560
31514
|
"data-testid": SPANS_LIST_PAGE_TEST_ID,
|
|
31561
31515
|
sx: {
|
|
@@ -31570,7 +31524,7 @@ var SpansListPage = () => {
|
|
|
31570
31524
|
width: "100%"
|
|
31571
31525
|
},
|
|
31572
31526
|
children: [
|
|
31573
|
-
!checking && !shouldShowStatusMessage && /* @__PURE__ */ (0,
|
|
31527
|
+
!checking && !shouldShowStatusMessage && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
31574
31528
|
EmulatorVersionBanner,
|
|
31575
31529
|
{
|
|
31576
31530
|
compatibility: bannerDismissed && versionCompatibility === "warning" ? "ok" : versionCompatibility,
|
|
@@ -31580,7 +31534,7 @@ var SpansListPage = () => {
|
|
|
31580
31534
|
} : void 0
|
|
31581
31535
|
}
|
|
31582
31536
|
),
|
|
31583
|
-
shouldShowStatusMessage ? /* @__PURE__ */ (0,
|
|
31537
|
+
shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
31584
31538
|
StatusMessage,
|
|
31585
31539
|
{
|
|
31586
31540
|
error: statusError,
|
|
@@ -31589,7 +31543,7 @@ var SpansListPage = () => {
|
|
|
31589
31543
|
onRetry: handleRetry,
|
|
31590
31544
|
status
|
|
31591
31545
|
}
|
|
31592
|
-
) : /* @__PURE__ */ (0,
|
|
31546
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
31593
31547
|
SpansList,
|
|
31594
31548
|
{
|
|
31595
31549
|
clearingSpans,
|
|
@@ -31617,7 +31571,7 @@ var SpansListPage = () => {
|
|
|
31617
31571
|
]
|
|
31618
31572
|
}
|
|
31619
31573
|
),
|
|
31620
|
-
selectedTraceId !== void 0 && /* @__PURE__ */ (0,
|
|
31574
|
+
selectedTraceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(TraceGraphPage, { onClose: () => {
|
|
31621
31575
|
setSelectedTraceId(void 0);
|
|
31622
31576
|
}, spanId: selectedSpanId, traceId: selectedTraceId })
|
|
31623
31577
|
] });
|