@localstack/appinspector-ui 1.0.116 → 1.0.117
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 +45 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +83 -88
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2414,7 +2414,7 @@ var init_event_streams = __esm({
|
|
|
2414
2414
|
|
|
2415
2415
|
// src/pages/spans-list-page.tsx
|
|
2416
2416
|
import { Box as Box21 } from "@mui/material";
|
|
2417
|
-
import { useCallback as useCallback12, useState as
|
|
2417
|
+
import { useCallback as useCallback12, useState as useState17 } from "react";
|
|
2418
2418
|
|
|
2419
2419
|
// src/api/errors.ts
|
|
2420
2420
|
var AppInspectorDisabledError = class extends Error {
|
|
@@ -2487,6 +2487,9 @@ var EVENT_DETAILS_REQUEST_PAYLOAD = "event-details-request-payload";
|
|
|
2487
2487
|
var EVENT_DETAILS_RESPONSE_PAYLOAD_TEST_ID = "event-details-response-payload";
|
|
2488
2488
|
var EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID = "event-details-exception-payload";
|
|
2489
2489
|
var EVENT_DETAILS_IAM_ERRORS_SUPPRESSED_TEST_ID = "event-details-iam-errors-suppressed";
|
|
2490
|
+
var EVENT_DETAILS_IAM_PRINCIPAL_TEST_ID = "event-details-iam-principal";
|
|
2491
|
+
var EVENT_DETAILS_IAM_ACTIONS_TEST_ID = "event-details-iam-actions";
|
|
2492
|
+
var EVENT_DETAILS_IAM_RESOURCES_TEST_ID = "event-details-iam-resources";
|
|
2490
2493
|
var ERROR_COUNT_TEST_ID = "error-count";
|
|
2491
2494
|
var WARNING_COUNT_TEST_ID = "warning-count";
|
|
2492
2495
|
var SERVICE_NODE_TEST_ID = "service-node";
|
|
@@ -18611,12 +18614,12 @@ import { ArrowBack } from "@mui/icons-material";
|
|
|
18611
18614
|
import { Box as Box20, Button as Button6, Drawer, Paper as Paper3 } from "@mui/material";
|
|
18612
18615
|
import { styled } from "@mui/material/styles";
|
|
18613
18616
|
import { ReactFlowProvider } from "@xyflow/react";
|
|
18614
|
-
import { useCallback as useCallback11, useEffect as useEffect21, useRef as useRef17, useState as
|
|
18617
|
+
import { useCallback as useCallback11, useEffect as useEffect21, useRef as useRef17, useState as useState16 } from "react";
|
|
18615
18618
|
|
|
18616
18619
|
// src/components/event-details/event-details.tsx
|
|
18617
18620
|
import { Close as Close2 } from "@mui/icons-material";
|
|
18618
|
-
import { Alert as Alert4, Box as Box16, Chip as Chip3, Divider as Divider4, FormControlLabel as FormControlLabel2, IconButton as
|
|
18619
|
-
import { useMemo as useMemo12, useState as
|
|
18621
|
+
import { Alert as Alert4, Box as Box16, Chip as Chip3, Divider as Divider4, FormControlLabel as FormControlLabel2, IconButton as IconButton3, Stack as Stack3, Switch, Typography as Typography11 } from "@mui/material";
|
|
18622
|
+
import { useMemo as useMemo12, useState as useState15 } from "react";
|
|
18620
18623
|
|
|
18621
18624
|
// src/utils/event-utils.ts
|
|
18622
18625
|
var iamEventParser = (eventName, attributes) => {
|
|
@@ -18727,9 +18730,9 @@ var getEventGroupsByType = (events) => {
|
|
|
18727
18730
|
};
|
|
18728
18731
|
|
|
18729
18732
|
// src/components/event-details/event-detail.tsx
|
|
18730
|
-
import { KeyboardArrowDown
|
|
18731
|
-
import { Box as Box13, IconButton as
|
|
18732
|
-
import { useEffect as useEffect18, useMemo as useMemo10, useRef as useRef15, useState as
|
|
18733
|
+
import { KeyboardArrowDown, KeyboardArrowRight } from "@mui/icons-material";
|
|
18734
|
+
import { Box as Box13, IconButton as IconButton2, Typography as Typography8 } from "@mui/material";
|
|
18735
|
+
import { useEffect as useEffect18, useMemo as useMemo10, useRef as useRef15, useState as useState12 } from "react";
|
|
18733
18736
|
|
|
18734
18737
|
// src/components/status-icon.tsx
|
|
18735
18738
|
import { Cancel as Cancel2, CheckCircle, Error as Error3, Info, RemoveCircle } from "@mui/icons-material";
|
|
@@ -18837,57 +18840,48 @@ var IAMEventDetail = ({ event }) => {
|
|
|
18837
18840
|
};
|
|
18838
18841
|
|
|
18839
18842
|
// src/components/event-details/iam-permission-detail.tsx
|
|
18840
|
-
import {
|
|
18841
|
-
import {
|
|
18842
|
-
import { useMemo as useMemo8, useState as useState11 } from "react";
|
|
18843
|
+
import { Box as Box10, Chip as Chip2, Stack, Typography as Typography7 } from "@mui/material";
|
|
18844
|
+
import { useMemo as useMemo8 } from "react";
|
|
18843
18845
|
import { jsx as jsx135, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
18844
|
-
var
|
|
18845
|
-
|
|
18846
|
-
|
|
18847
|
-
|
|
18848
|
-
|
|
18849
|
-
|
|
18850
|
-
/* @__PURE__ */ jsx135(Typography7, { sx: {
|
|
18846
|
+
var getChipColor = (isAllowed, spanStatusCode) => {
|
|
18847
|
+
if (isAllowed) return "success.main";
|
|
18848
|
+
if (spanStatusCode === 2) return "error.main";
|
|
18849
|
+
return "warning.main";
|
|
18850
|
+
};
|
|
18851
|
+
var LabelValue = ({ label, value }) => /* @__PURE__ */ jsxs126(Box10, { children: [
|
|
18852
|
+
/* @__PURE__ */ jsx135(Typography7, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: label }),
|
|
18853
|
+
/* @__PURE__ */ jsx135(Typography7, { sx: { wordBreak: "break-all" }, variant: "body2", children: value })
|
|
18851
18854
|
] });
|
|
18852
|
-
var IAMPermissionItem = ({ event }) => {
|
|
18853
|
-
const [isOpen, setIsOpen] = useState11(false);
|
|
18855
|
+
var IAMPermissionItem = ({ event, spanStatusCode }) => {
|
|
18854
18856
|
const parsedData = useMemo8(() => {
|
|
18855
18857
|
const payloadString = event.attributes?.payload;
|
|
18856
18858
|
if (!payloadString) return;
|
|
18857
18859
|
const parsedIAM2 = parseIAMEvent(payloadString);
|
|
18858
18860
|
if (!parsedIAM2) return;
|
|
18859
|
-
return {
|
|
18861
|
+
return { parsedIAM: parsedIAM2 };
|
|
18860
18862
|
}, [event.attributes?.payload]);
|
|
18861
18863
|
if (!parsedData) {
|
|
18862
18864
|
return null;
|
|
18863
18865
|
}
|
|
18864
|
-
const {
|
|
18866
|
+
const { parsedIAM } = parsedData;
|
|
18867
|
+
const isAllowed = parsedIAM.permission === "explicitly_allowed" || parsedIAM.permission === "implicitly_allowed";
|
|
18868
|
+
const chipColors = { backgroundColor: getChipColor(isAllowed, spanStatusCode), color: "white" };
|
|
18865
18869
|
return /* @__PURE__ */ jsxs126(Box10, { sx: { mb: 0.5 }, children: [
|
|
18866
|
-
/* @__PURE__ */
|
|
18867
|
-
|
|
18868
|
-
|
|
18869
|
-
|
|
18870
|
-
|
|
18871
|
-
|
|
18872
|
-
parsedIAM.service,
|
|
18873
|
-
":",
|
|
18874
|
-
parsedIAM.operation
|
|
18875
|
-
] })
|
|
18876
|
-
] }),
|
|
18877
|
-
isOpen && /* @__PURE__ */ jsxs126(Box10, { sx: { borderColor: "divider", borderLeft: "2px solid", ml: 1, mt: 0.5, pl: 1.5, py: 0.5 }, children: [
|
|
18878
|
-
/* @__PURE__ */ jsx135(LabelValue, { label: "Principal", value: parsedIAM.principal }),
|
|
18879
|
-
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ jsxs126(Box10, { sx: { display: "grid", gap: 1, gridTemplateColumns: "72px 1fr", mb: 0.5 }, children: [
|
|
18880
|
-
/* @__PURE__ */ jsx135(Typography7, { color: "text.secondary", sx: { fontWeight: 600 }, variant: "caption", children: "Actions" }),
|
|
18881
|
-
/* @__PURE__ */ jsx135(Box10, { children: parsedIAM.details.actions.map((action) => /* @__PURE__ */ jsx135(Typography7, { sx: { display: "block" }, variant: "caption", children: action }, action)) })
|
|
18870
|
+
/* @__PURE__ */ jsx135(Box10, { sx: { alignItems: "center", display: "flex", gap: 1, mb: 0.5 }, children: /* @__PURE__ */ jsx135(Chip2, { label: formatPermissionStatus(parsedIAM.permission), size: "small", sx: { ...chipColors, fontWeight: 500 } }) }),
|
|
18871
|
+
/* @__PURE__ */ jsxs126(Stack, { spacing: 1, children: [
|
|
18872
|
+
/* @__PURE__ */ jsx135(Box10, { "data-testid": EVENT_DETAILS_IAM_PRINCIPAL_TEST_ID, children: /* @__PURE__ */ jsx135(LabelValue, { label: "Principal", value: parsedIAM.principal }) }),
|
|
18873
|
+
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ jsxs126(Box10, { "data-testid": EVENT_DETAILS_IAM_ACTIONS_TEST_ID, children: [
|
|
18874
|
+
/* @__PURE__ */ jsx135(Typography7, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Actions" }),
|
|
18875
|
+
parsedIAM.details.actions.map((action) => /* @__PURE__ */ jsx135(Typography7, { sx: { display: "block" }, variant: "body2", children: action }, action))
|
|
18882
18876
|
] }),
|
|
18883
|
-
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ jsxs126(Box10, {
|
|
18884
|
-
/* @__PURE__ */ jsx135(Typography7, {
|
|
18885
|
-
|
|
18877
|
+
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ jsxs126(Box10, { "data-testid": EVENT_DETAILS_IAM_RESOURCES_TEST_ID, children: [
|
|
18878
|
+
/* @__PURE__ */ jsx135(Typography7, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Resources" }),
|
|
18879
|
+
parsedIAM.details.resources.map((resource) => /* @__PURE__ */ jsx135(Typography7, { sx: { display: "block", wordBreak: "break-all" }, variant: "body2", children: resource }, resource))
|
|
18886
18880
|
] })
|
|
18887
18881
|
] })
|
|
18888
18882
|
] });
|
|
18889
18883
|
};
|
|
18890
|
-
var IAMPermissionDetail = ({ events }) => /* @__PURE__ */ jsx135(Box10, { children: events.map((event) => /* @__PURE__ */ jsx135(IAMPermissionItem, { event }, `${event.span_id}-${event.event_id}`)) });
|
|
18884
|
+
var IAMPermissionDetail = ({ events, spanStatusCode }) => /* @__PURE__ */ jsx135(Box10, { children: events.map((event) => /* @__PURE__ */ jsx135(IAMPermissionItem, { event, spanStatusCode }, `${event.span_id}-${event.event_id}`)) });
|
|
18891
18885
|
|
|
18892
18886
|
// src/components/event-details/payload-viewer.tsx
|
|
18893
18887
|
import { Box as Box12, useTheme as useTheme3 } from "@mui/material";
|
|
@@ -18896,7 +18890,7 @@ import { Box as Box12, useTheme as useTheme3 } from "@mui/material";
|
|
|
18896
18890
|
var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
|
|
18897
18891
|
import { jsx as jsx136, jsxs as jsxs127, Fragment as Fragment9 } from "react/jsx-runtime";
|
|
18898
18892
|
import { Box as Box11, InputBase, NoSsr, SvgIcon, createTheme, ThemeProvider, Paper as Paper2 } from "@mui/material";
|
|
18899
|
-
import { createContext as createContext10, useContext as useContext17, useState as
|
|
18893
|
+
import { createContext as createContext10, useContext as useContext17, useState as useState11, useRef as useRef14, useCallback as useCallback10, useMemo as useMemo9, useEffect as useEffect17, memo as memo9 } from "react";
|
|
18900
18894
|
import { create, useStore, createStore } from "zustand";
|
|
18901
18895
|
function r(e2) {
|
|
18902
18896
|
var t2, f2, n2 = "";
|
|
@@ -19140,7 +19134,7 @@ async function copyString(value) {
|
|
|
19140
19134
|
}
|
|
19141
19135
|
function useClipboard() {
|
|
19142
19136
|
let { timeout = 2e3 } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
19143
|
-
const [copied, setCopied] =
|
|
19137
|
+
const [copied, setCopied] = useState11(false);
|
|
19144
19138
|
const copyTimeout = useRef14(null);
|
|
19145
19139
|
const handleCopyResult = useCallback10((value) => {
|
|
19146
19140
|
const current = copyTimeout.current;
|
|
@@ -19223,7 +19217,7 @@ function useInspect(path, value, nestedIndex) {
|
|
|
19223
19217
|
value,
|
|
19224
19218
|
setInspectCache
|
|
19225
19219
|
]);
|
|
19226
|
-
const [inspect, set] =
|
|
19220
|
+
const [inspect, set] = useState11(() => {
|
|
19227
19221
|
const shouldInspect = getInspectCache(path, nestedIndex);
|
|
19228
19222
|
if (shouldInspect !== void 0) {
|
|
19229
19223
|
return shouldInspect;
|
|
@@ -19754,7 +19748,7 @@ var ObjectType = (props) => {
|
|
|
19754
19748
|
const borderColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
19755
19749
|
const groupArraysAfterLength = useJsonViewerStore((store) => store.groupArraysAfterLength);
|
|
19756
19750
|
const isTrap = useIsCycleReference(props.path, props.value);
|
|
19757
|
-
const [displayLength, setDisplayLength] =
|
|
19751
|
+
const [displayLength, setDisplayLength] = useState11(useJsonViewerStore((store) => store.maxDisplayLength));
|
|
19758
19752
|
const objectSortKeys = useJsonViewerStore((store) => store.objectSortKeys);
|
|
19759
19753
|
const elements = useMemo9(() => {
|
|
19760
19754
|
if (!props.inspect) {
|
|
@@ -19960,7 +19954,7 @@ var stringType = defineEasyType({
|
|
|
19960
19954
|
serialize: (value) => value,
|
|
19961
19955
|
deserialize: (value) => value,
|
|
19962
19956
|
Renderer: (props) => {
|
|
19963
|
-
const [showRest, setShowRest] =
|
|
19957
|
+
const [showRest, setShowRest] = useState11(false);
|
|
19964
19958
|
const collapseStringsAfterLength = useJsonViewerStore((store) => store.collapseStringsAfterLength);
|
|
19965
19959
|
const value = showRest ? props.value : props.value.slice(0, collapseStringsAfterLength);
|
|
19966
19960
|
const hasRest = props.value.length > collapseStringsAfterLength;
|
|
@@ -20114,7 +20108,7 @@ var DataKeyPair = (props) => {
|
|
|
20114
20108
|
storeEditable,
|
|
20115
20109
|
value
|
|
20116
20110
|
]);
|
|
20117
|
-
const [tempValue, setTempValue] =
|
|
20111
|
+
const [tempValue, setTempValue] = useState11("");
|
|
20118
20112
|
const depth = path.length;
|
|
20119
20113
|
const key = path[depth - 1];
|
|
20120
20114
|
const hoverPath = useJsonViewerStore((store) => store.hoverPath);
|
|
@@ -20128,7 +20122,7 @@ var DataKeyPair = (props) => {
|
|
|
20128
20122
|
const setHover = useJsonViewerStore((store) => store.setHover);
|
|
20129
20123
|
const root = useJsonViewerStore((store) => store.value);
|
|
20130
20124
|
const [inspect, setInspect] = useInspect(path, value, nestedIndex);
|
|
20131
|
-
const [editing, setEditing] =
|
|
20125
|
+
const [editing, setEditing] = useState11(false);
|
|
20132
20126
|
const onChange = useJsonViewerStore((store) => store.onChange);
|
|
20133
20127
|
const keyColor = useTextColor();
|
|
20134
20128
|
const numberKeyColor = useJsonViewerStore((store) => store.colorspace.base0C);
|
|
@@ -20513,7 +20507,7 @@ var DataKeyPair = (props) => {
|
|
|
20513
20507
|
};
|
|
20514
20508
|
var query = "(prefers-color-scheme: dark)";
|
|
20515
20509
|
function useThemeDetector() {
|
|
20516
|
-
const [isDark, setIsDark] =
|
|
20510
|
+
const [isDark, setIsDark] = useState11(false);
|
|
20517
20511
|
useEffect17(() => {
|
|
20518
20512
|
const listener = (e2) => setIsDark(e2.matches);
|
|
20519
20513
|
setIsDark(window.matchMedia(query).matches);
|
|
@@ -20734,8 +20728,8 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ jsxs128(Box13, { sx: {
|
|
|
20734
20728
|
/* @__PURE__ */ jsx138(Box13, { children: typeof content === "string" ? /* @__PURE__ */ jsx138(Typography8, { sx: { color: "text.primary", whiteSpace: "pre-wrap" }, variant: "caption", children: content }) : content })
|
|
20735
20729
|
] });
|
|
20736
20730
|
var EventMessage = ({ event }) => {
|
|
20737
|
-
const [isOpen, setIsOpen] =
|
|
20738
|
-
const [isOverflowing, setIsOverflowing] =
|
|
20731
|
+
const [isOpen, setIsOpen] = useState12(false);
|
|
20732
|
+
const [isOverflowing, setIsOverflowing] = useState12(false);
|
|
20739
20733
|
const textReference = useRef15(null);
|
|
20740
20734
|
const parsedMessage = useMemo10(() => parseEventMessage(event), [event]);
|
|
20741
20735
|
const isIAMPolicyEvent = useMemo10(
|
|
@@ -20766,14 +20760,14 @@ var EventMessage = ({ event }) => {
|
|
|
20766
20760
|
return /* @__PURE__ */ jsxs128(Box13, { sx: { display: "flex", flexDirection: "column" }, children: [
|
|
20767
20761
|
/* @__PURE__ */ jsxs128(Box13, { sx: { alignItems: "center", display: "flex" }, children: [
|
|
20768
20762
|
Boolean(shouldShowToggle) && /* @__PURE__ */ jsx138(
|
|
20769
|
-
|
|
20763
|
+
IconButton2,
|
|
20770
20764
|
{
|
|
20771
20765
|
onClick: () => {
|
|
20772
20766
|
setIsOpen(!isOpen);
|
|
20773
20767
|
},
|
|
20774
20768
|
size: "small",
|
|
20775
20769
|
sx: { mr: 1, p: 0 },
|
|
20776
|
-
children: isOpen ? /* @__PURE__ */ jsx138(
|
|
20770
|
+
children: isOpen ? /* @__PURE__ */ jsx138(KeyboardArrowDown, { sx: { fontSize: 16 } }) : /* @__PURE__ */ jsx138(KeyboardArrowRight, { sx: { fontSize: 16 } })
|
|
20777
20771
|
}
|
|
20778
20772
|
),
|
|
20779
20773
|
/* @__PURE__ */ jsx138(
|
|
@@ -20828,10 +20822,11 @@ var getEventLevelFromGroup = (group4) => {
|
|
|
20828
20822
|
var EventDetail = ({
|
|
20829
20823
|
displayText,
|
|
20830
20824
|
events,
|
|
20825
|
+
spanStatusCode,
|
|
20831
20826
|
type
|
|
20832
20827
|
}) => {
|
|
20833
20828
|
if (type === "permission") {
|
|
20834
|
-
return /* @__PURE__ */ jsx138(IAMPermissionDetail, { events });
|
|
20829
|
+
return /* @__PURE__ */ jsx138(IAMPermissionDetail, { events, spanStatusCode });
|
|
20835
20830
|
}
|
|
20836
20831
|
const eventLevel = getEventLevelFromGroup(type);
|
|
20837
20832
|
return /* @__PURE__ */ jsxs128(Box13, { children: [
|
|
@@ -30530,8 +30525,8 @@ var QueryStatus = {
|
|
|
30530
30525
|
};
|
|
30531
30526
|
|
|
30532
30527
|
// src/components/event-details/lambda-invoke-logs-section.tsx
|
|
30533
|
-
import { Box as Box14, CircularProgress as CircularProgress3, Stack, Typography as Typography9 } from "@mui/material";
|
|
30534
|
-
import { useEffect as useEffect19, useMemo as useMemo11, useRef as useRef16, useState as
|
|
30528
|
+
import { Box as Box14, CircularProgress as CircularProgress3, Stack as Stack2, Typography as Typography9 } from "@mui/material";
|
|
30529
|
+
import { useEffect as useEffect19, useMemo as useMemo11, useRef as useRef16, useState as useState13 } from "react";
|
|
30535
30530
|
import { jsx as jsx139, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
30536
30531
|
var POLL_INTERVAL_MS = 1e3;
|
|
30537
30532
|
async function pollQueryResults(client, queryId) {
|
|
@@ -30560,9 +30555,9 @@ function useCloudWatchLogsClient(region) {
|
|
|
30560
30555
|
return client;
|
|
30561
30556
|
}
|
|
30562
30557
|
function useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, endTimeNano) {
|
|
30563
|
-
const [loading, setLoading] =
|
|
30564
|
-
const [logs, setLogs] =
|
|
30565
|
-
const [error, setError] =
|
|
30558
|
+
const [loading, setLoading] = useState13(true);
|
|
30559
|
+
const [logs, setLogs] = useState13([]);
|
|
30560
|
+
const [error, setError] = useState13();
|
|
30566
30561
|
const pollTimerRef = useRef16(null);
|
|
30567
30562
|
const cloudWatchLogs = useCloudWatchLogsClient(region);
|
|
30568
30563
|
useEffect19(() => {
|
|
@@ -30622,7 +30617,7 @@ function useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, en
|
|
|
30622
30617
|
var LambdaInvokeLogsSection = ({ endTimeNano, functionName: functionName2, region, requestId, startTimeNano }) => {
|
|
30623
30618
|
const { error, loading, logs } = useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, endTimeNano);
|
|
30624
30619
|
if (loading) {
|
|
30625
|
-
return /* @__PURE__ */ jsxs129(
|
|
30620
|
+
return /* @__PURE__ */ jsxs129(Stack2, { alignItems: "center", direction: "row", spacing: 1, children: [
|
|
30626
30621
|
/* @__PURE__ */ jsx139(CircularProgress3, { size: 14 }),
|
|
30627
30622
|
/* @__PURE__ */ jsx139(Typography9, { color: "text.secondary", variant: "body2", children: "Loading logs\u2026" })
|
|
30628
30623
|
] });
|
|
@@ -30637,12 +30632,12 @@ var LambdaInvokeLogsSection = ({ endTimeNano, functionName: functionName2, regio
|
|
|
30637
30632
|
};
|
|
30638
30633
|
|
|
30639
30634
|
// src/components/event-details/toggle-section.tsx
|
|
30640
|
-
import { KeyboardArrowDown as
|
|
30635
|
+
import { KeyboardArrowDown as KeyboardArrowDown2, KeyboardArrowRight as KeyboardArrowRight2 } from "@mui/icons-material";
|
|
30641
30636
|
import { Box as Box15, Typography as Typography10 } from "@mui/material";
|
|
30642
|
-
import { useState as
|
|
30637
|
+
import { useState as useState14 } from "react";
|
|
30643
30638
|
import { jsx as jsx140, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
30644
30639
|
var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
|
|
30645
|
-
const [isOpen, setIsOpen] =
|
|
30640
|
+
const [isOpen, setIsOpen] = useState14(initialOpen);
|
|
30646
30641
|
return /* @__PURE__ */ jsxs130(Box15, { sx: { mt: 4 }, children: [
|
|
30647
30642
|
/* @__PURE__ */ jsxs130(
|
|
30648
30643
|
Box15,
|
|
@@ -30669,7 +30664,7 @@ var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
|
|
|
30669
30664
|
},
|
|
30670
30665
|
children: [
|
|
30671
30666
|
/* @__PURE__ */ jsx140(Typography10, { sx: { fontWeight: 600 }, variant: "subtitle2", children: headline }),
|
|
30672
|
-
isOpen ? /* @__PURE__ */ jsx140(
|
|
30667
|
+
isOpen ? /* @__PURE__ */ jsx140(KeyboardArrowDown2, { sx: { color: "text.secondary", height: 20, width: 20 } }) : /* @__PURE__ */ jsx140(KeyboardArrowRight2, { sx: { color: "text.secondary", height: 20, width: 20 } })
|
|
30673
30668
|
]
|
|
30674
30669
|
}
|
|
30675
30670
|
),
|
|
@@ -30703,7 +30698,7 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
30703
30698
|
() => getEventGroupsByType(selectedEvent?.events ?? []),
|
|
30704
30699
|
[selectedEvent?.events]
|
|
30705
30700
|
);
|
|
30706
|
-
const [parseNestedJson, setParseNestedJson] =
|
|
30701
|
+
const [parseNestedJson, setParseNestedJson] = useState15(true);
|
|
30707
30702
|
if (!selectedEvent) {
|
|
30708
30703
|
return /* @__PURE__ */ jsx141(Box16, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ jsx141(Typography11, { color: "text.secondary", variant: "body2", children: "Select an event to view details" }) });
|
|
30709
30704
|
}
|
|
@@ -30743,12 +30738,12 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
30743
30738
|
},
|
|
30744
30739
|
children: [
|
|
30745
30740
|
/* @__PURE__ */ jsx141(Box16, { children: /* @__PURE__ */ jsx141(Typography11, { sx: { fontWeight: 600 }, variant: "h6", children: "Operation Details" }) }),
|
|
30746
|
-
onClose && /* @__PURE__ */ jsx141(
|
|
30741
|
+
onClose && /* @__PURE__ */ jsx141(IconButton3, { "data-testid": EVENT_DETAILS_CLOSE_BUTTON_TEST_ID, onClick: onClose, size: "small", children: /* @__PURE__ */ jsx141(Close2, {}) })
|
|
30747
30742
|
]
|
|
30748
30743
|
}
|
|
30749
30744
|
),
|
|
30750
|
-
/* @__PURE__ */ jsx141(Box16, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ jsxs131(
|
|
30751
|
-
/* @__PURE__ */ jsx141(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ jsxs131(
|
|
30745
|
+
/* @__PURE__ */ jsx141(Box16, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ jsxs131(Stack3, { spacing: 2, children: [
|
|
30746
|
+
/* @__PURE__ */ jsx141(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ jsxs131(Stack3, { "data-testid": EVENT_DETAILS_SECTION_BASIC_INFORMATION_TEST_ID, spacing: 1, children: [
|
|
30752
30747
|
/* @__PURE__ */ jsxs131(Box16, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
|
|
30753
30748
|
/* @__PURE__ */ jsxs131(Box16, { children: [
|
|
30754
30749
|
/* @__PURE__ */ jsx141(Typography11, { sx: { fontWeight: 600 }, variant: "caption", children: "Service" }),
|
|
@@ -30798,7 +30793,7 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
30798
30793
|
] }),
|
|
30799
30794
|
/* @__PURE__ */ jsxs131(Box16, { children: [
|
|
30800
30795
|
/* @__PURE__ */ jsx141(Typography11, { sx: { fontWeight: 600 }, variant: "caption", children: "Status" }),
|
|
30801
|
-
/* @__PURE__ */ jsx141(
|
|
30796
|
+
/* @__PURE__ */ jsx141(Stack3, { alignItems: "center", direction: "row", flexWrap: "wrap", gap: 1, sx: { mb: eventGroups.errors || eventGroups.warnings ? 1 : 0 }, children: /* @__PURE__ */ jsx141(
|
|
30802
30797
|
Chip3,
|
|
30803
30798
|
{
|
|
30804
30799
|
color: selectedEvent.status_code === 2 ? "error" : selectedEvent.status_code === 1 ? "success" : "default",
|
|
@@ -30813,7 +30808,7 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
30813
30808
|
/* @__PURE__ */ jsxs131(ToggleSection, { headline: "Permissions", children: [
|
|
30814
30809
|
selectedEvent.iam_errors_suppressed && /* @__PURE__ */ jsx141(Alert4, { "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" }),
|
|
30815
30810
|
!selectedEvent.iam_errors_suppressed && !eventGroups.permissions && !eventGroups.errors && !eventGroups.warnings && /* @__PURE__ */ jsx141(Typography11, { color: "text.secondary", variant: "body2", children: "There is no permission information available." }),
|
|
30816
|
-
eventGroups.permissions && /* @__PURE__ */ jsx141(EventDetail, { displayText: "Permissions", events: eventGroups.permissions, type: "permission" }),
|
|
30811
|
+
eventGroups.permissions && /* @__PURE__ */ jsx141(EventDetail, { displayText: "Permissions", events: eventGroups.permissions, spanStatusCode: selectedEvent.status_code, type: "permission" }),
|
|
30817
30812
|
eventGroups.errors && /* @__PURE__ */ jsx141(EventDetail, { displayText: "Error", events: eventGroups.errors, type: "error" }),
|
|
30818
30813
|
eventGroups.warnings && /* @__PURE__ */ jsx141(EventDetail, { displayText: "Warning", events: eventGroups.warnings, type: "warning" })
|
|
30819
30814
|
] }),
|
|
@@ -30833,7 +30828,7 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
30833
30828
|
}
|
|
30834
30829
|
),
|
|
30835
30830
|
headline: "Payloads",
|
|
30836
|
-
children: /* @__PURE__ */ jsxs131(
|
|
30831
|
+
children: /* @__PURE__ */ jsxs131(Stack3, { spacing: 2, children: [
|
|
30837
30832
|
requestPayload !== void 0 && /* @__PURE__ */ jsxs131(Box16, { children: [
|
|
30838
30833
|
/* @__PURE__ */ jsx141(Typography11, { sx: { fontWeight: 600 }, variant: "caption", children: "Request" }),
|
|
30839
30834
|
/* @__PURE__ */ jsx141(PayloadViewer, { testId: EVENT_DETAILS_REQUEST_PAYLOAD, value: requestPayload })
|
|
@@ -30864,7 +30859,7 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
30864
30859
|
) })
|
|
30865
30860
|
] }),
|
|
30866
30861
|
/* @__PURE__ */ jsx141(Divider4, {}),
|
|
30867
|
-
/* @__PURE__ */ jsx141(ToggleSection, { headline: "Advanced Information", initialOpen: false, children: /* @__PURE__ */ jsxs131(
|
|
30862
|
+
/* @__PURE__ */ jsx141(ToggleSection, { headline: "Advanced Information", initialOpen: false, children: /* @__PURE__ */ jsxs131(Stack3, { spacing: 1, children: [
|
|
30868
30863
|
/* @__PURE__ */ jsxs131(Box16, { children: [
|
|
30869
30864
|
/* @__PURE__ */ jsx141(Typography11, { sx: { fontWeight: 600 }, variant: "caption", children: "Span ID" }),
|
|
30870
30865
|
/* @__PURE__ */ jsx141(Typography11, { "data-testid": EVENT_DETAILS_SPAN_ID_TEST_ID, variant: "body2", children: selectedEvent.span_id })
|
|
@@ -30890,7 +30885,7 @@ import { Background, MarkerType, Position as Position2, ReactFlow, useEdgesState
|
|
|
30890
30885
|
import { useEffect as useEffect20 } from "react";
|
|
30891
30886
|
|
|
30892
30887
|
// src/components/trace-graph/service-node.tsx
|
|
30893
|
-
import { Box as Box18, Divider as Divider5, Stack as
|
|
30888
|
+
import { Box as Box18, Divider as Divider5, Stack as Stack4, Typography as Typography12, useTheme as useTheme4 } from "@mui/material";
|
|
30894
30889
|
import "@xyflow/react/dist/style.css";
|
|
30895
30890
|
import { Handle, Position } from "@xyflow/react";
|
|
30896
30891
|
import { memo as memo11 } from "react";
|
|
@@ -30982,14 +30977,14 @@ var ServiceNode = memo11(({ data, selected }) => {
|
|
|
30982
30977
|
/* @__PURE__ */ jsx143(Handle, { position: Position.Left, style: handleStyle, type: "target" }),
|
|
30983
30978
|
/* @__PURE__ */ jsx143(Handle, { position: Position.Right, style: handleStyle, type: "source" }),
|
|
30984
30979
|
/* @__PURE__ */ jsxs132(
|
|
30985
|
-
|
|
30980
|
+
Stack4,
|
|
30986
30981
|
{
|
|
30987
30982
|
alignItems: "center",
|
|
30988
30983
|
direction: "row",
|
|
30989
30984
|
sx: { gap: "8px", pb: "2px", pt: "6px", px: "8px" },
|
|
30990
30985
|
children: [
|
|
30991
30986
|
/* @__PURE__ */ jsx143(Box18, { sx: { borderRadius: "4px", flexShrink: 0, lineHeight: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsx143(AwsServiceIcon, { hideTooltip: true, service: data.event.service_name, size: "medium" }) }),
|
|
30992
|
-
/* @__PURE__ */ jsxs132(
|
|
30987
|
+
/* @__PURE__ */ jsxs132(Stack4, { sx: { minWidth: 0 }, children: [
|
|
30993
30988
|
/* @__PURE__ */ jsx143(
|
|
30994
30989
|
Typography12,
|
|
30995
30990
|
{
|
|
@@ -31015,7 +31010,7 @@ var ServiceNode = memo11(({ data, selected }) => {
|
|
|
31015
31010
|
),
|
|
31016
31011
|
/* @__PURE__ */ jsx143(Divider5, { sx: { ml: "38px", mr: "8px", my: "5px" } }),
|
|
31017
31012
|
/* @__PURE__ */ jsxs132(
|
|
31018
|
-
|
|
31013
|
+
Stack4,
|
|
31019
31014
|
{
|
|
31020
31015
|
alignItems: "center",
|
|
31021
31016
|
direction: "row",
|
|
@@ -31108,7 +31103,7 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
|
|
|
31108
31103
|
|
|
31109
31104
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
31110
31105
|
import { Add, FitScreen, Remove } from "@mui/icons-material";
|
|
31111
|
-
import { Box as Box19, IconButton as
|
|
31106
|
+
import { Box as Box19, IconButton as IconButton4 } from "@mui/material";
|
|
31112
31107
|
import { useReactFlow, useStore as useStore2 } from "@xyflow/react";
|
|
31113
31108
|
import { memo as memo12 } from "react";
|
|
31114
31109
|
import { shallow } from "zustand/shallow";
|
|
@@ -31145,7 +31140,7 @@ var Controls = memo12(() => {
|
|
|
31145
31140
|
},
|
|
31146
31141
|
children: [
|
|
31147
31142
|
/* @__PURE__ */ jsx144(
|
|
31148
|
-
|
|
31143
|
+
IconButton4,
|
|
31149
31144
|
{
|
|
31150
31145
|
className: "react-flow__controls-zoomin",
|
|
31151
31146
|
disabled: maxZoomReached,
|
|
@@ -31155,7 +31150,7 @@ var Controls = memo12(() => {
|
|
|
31155
31150
|
}
|
|
31156
31151
|
),
|
|
31157
31152
|
/* @__PURE__ */ jsx144(
|
|
31158
|
-
|
|
31153
|
+
IconButton4,
|
|
31159
31154
|
{
|
|
31160
31155
|
className: "react-flow__controls-zoomout",
|
|
31161
31156
|
disabled: minZoomReached,
|
|
@@ -31165,7 +31160,7 @@ var Controls = memo12(() => {
|
|
|
31165
31160
|
}
|
|
31166
31161
|
),
|
|
31167
31162
|
/* @__PURE__ */ jsx144(
|
|
31168
|
-
|
|
31163
|
+
IconButton4,
|
|
31169
31164
|
{
|
|
31170
31165
|
className: "react-flow__controls-fitview",
|
|
31171
31166
|
onClick: onFitViewHandler,
|
|
@@ -31445,9 +31440,9 @@ async function fetchConnectedTraces(api, traceIds, allSpans = /* @__PURE__ */ ne
|
|
|
31445
31440
|
}
|
|
31446
31441
|
var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
31447
31442
|
const api = useAppInspectorApi();
|
|
31448
|
-
const [spans, setSpans] =
|
|
31449
|
-
const [loading, setLoading] =
|
|
31450
|
-
const [fetchError, setFetchError] =
|
|
31443
|
+
const [spans, setSpans] = useState16();
|
|
31444
|
+
const [loading, setLoading] = useState16(false);
|
|
31445
|
+
const [fetchError, setFetchError] = useState16();
|
|
31451
31446
|
const fetchSpans = useCallback11(async () => {
|
|
31452
31447
|
setLoading(true);
|
|
31453
31448
|
try {
|
|
@@ -31464,8 +31459,8 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
31464
31459
|
useEffect21(() => {
|
|
31465
31460
|
void fetchSpans();
|
|
31466
31461
|
}, [fetchSpans]);
|
|
31467
|
-
const [open, setOpen] =
|
|
31468
|
-
const [selectedEvent, setSelectedEvent] =
|
|
31462
|
+
const [open, setOpen] = useState16(true);
|
|
31463
|
+
const [selectedEvent, setSelectedEvent] = useState16(() => spans?.find((span) => span.span_id === spanId));
|
|
31469
31464
|
const spansReference = useRef17();
|
|
31470
31465
|
useEffect21(() => {
|
|
31471
31466
|
if (!spansReference.current && spans) {
|
|
@@ -31548,10 +31543,10 @@ var SpansListPage = () => {
|
|
|
31548
31543
|
}, [clearSpans]);
|
|
31549
31544
|
const localstackVersion = status?.localstackVersion ?? (statusError instanceof AppInspectorNotFoundError ? statusError.localstackVersion : void 0);
|
|
31550
31545
|
const versionCompatibility = checkEmulatorVersion(localstackVersion);
|
|
31551
|
-
const [bannerDismissed, setBannerDismissed] =
|
|
31546
|
+
const [bannerDismissed, setBannerDismissed] = useState17(false);
|
|
31552
31547
|
const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
|
|
31553
|
-
const [selectedTraceId, setSelectedTraceId] =
|
|
31554
|
-
const [selectedSpanId, setSelectedSpanId] =
|
|
31548
|
+
const [selectedTraceId, setSelectedTraceId] = useState17();
|
|
31549
|
+
const [selectedSpanId, setSelectedSpanId] = useState17();
|
|
31555
31550
|
const navigateToSpan = useCallback12((span) => {
|
|
31556
31551
|
setSelectedTraceId(span.trace_id);
|
|
31557
31552
|
setSelectedSpanId(span.span_id);
|