@localstack/appinspector-ui 1.0.215 → 1.0.217
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 +73 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +94 -94
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2537,7 +2537,6 @@ var WATERFALL_ROW_TOGGLE_TEST_ID = "waterfall-row-toggle";
|
|
|
2537
2537
|
var DETAIL_TAB_DETAILS_TEST_ID = "detail-tab-details";
|
|
2538
2538
|
var DETAIL_TAB_REQUEST_TEST_ID = "detail-tab-request";
|
|
2539
2539
|
var DETAIL_TAB_RESPONSE_TEST_ID = "detail-tab-response";
|
|
2540
|
-
var DETAIL_TAB_ERROR_TEST_ID = "detail-tab-error";
|
|
2541
2540
|
var DETAIL_TAB_PERMISSIONS_TEST_ID = "detail-tab-permissions";
|
|
2542
2541
|
var DETAIL_TAB_LOGS_TEST_ID = "detail-tab-logs";
|
|
2543
2542
|
var DETAIL_TAB_ADVANCED_TEST_ID = "detail-tab-advanced";
|
|
@@ -7171,12 +7170,12 @@ var isColorString = (type, testProp) => (v) => {
|
|
|
7171
7170
|
var splitColor = (aName, bName, cName) => (v) => {
|
|
7172
7171
|
if (!isString(v))
|
|
7173
7172
|
return v;
|
|
7174
|
-
const [a3, b3, c3,
|
|
7173
|
+
const [a3, b3, c3, alpha8] = v.match(floatRegex);
|
|
7175
7174
|
return {
|
|
7176
7175
|
[aName]: parseFloat(a3),
|
|
7177
7176
|
[bName]: parseFloat(b3),
|
|
7178
7177
|
[cName]: parseFloat(c3),
|
|
7179
|
-
alpha:
|
|
7178
|
+
alpha: alpha8 !== void 0 ? parseFloat(alpha8) : 1
|
|
7180
7179
|
};
|
|
7181
7180
|
};
|
|
7182
7181
|
|
|
@@ -8290,7 +8289,7 @@ function hueToRgb(p, q, t) {
|
|
|
8290
8289
|
return p + (q - p) * (2 / 3 - t) * 6;
|
|
8291
8290
|
return p;
|
|
8292
8291
|
}
|
|
8293
|
-
function hslaToRgba({ hue, saturation, lightness, alpha:
|
|
8292
|
+
function hslaToRgba({ hue, saturation, lightness, alpha: alpha8 }) {
|
|
8294
8293
|
hue /= 360;
|
|
8295
8294
|
saturation /= 100;
|
|
8296
8295
|
lightness /= 100;
|
|
@@ -8310,7 +8309,7 @@ function hslaToRgba({ hue, saturation, lightness, alpha: alpha7 }) {
|
|
|
8310
8309
|
red: Math.round(red * 255),
|
|
8311
8310
|
green: Math.round(green * 255),
|
|
8312
8311
|
blue: Math.round(blue * 255),
|
|
8313
|
-
alpha:
|
|
8312
|
+
alpha: alpha8
|
|
8314
8313
|
};
|
|
8315
8314
|
}
|
|
8316
8315
|
|
|
@@ -15646,7 +15645,9 @@ var OperationIdentity = memo7(({
|
|
|
15646
15645
|
service,
|
|
15647
15646
|
sx,
|
|
15648
15647
|
tailTestId,
|
|
15649
|
-
testId
|
|
15648
|
+
testId,
|
|
15649
|
+
trailing,
|
|
15650
|
+
trailingRow = "title"
|
|
15650
15651
|
}) => {
|
|
15651
15652
|
const resource = shortResourceName(resourceName, arn);
|
|
15652
15653
|
const hasResource = resource !== "" && resource !== "*";
|
|
@@ -15654,20 +15655,26 @@ var OperationIdentity = memo7(({
|
|
|
15654
15655
|
const stackedIconSize = typeof iconSize === "number" ? iconSize : 32;
|
|
15655
15656
|
if (density === "heading") {
|
|
15656
15657
|
const isText = typeof children === "string";
|
|
15658
|
+
const trailingNode = (row) => trailing !== void 0 && trailingRow === row ? /* @__PURE__ */ jsx126(Box3, { sx: { alignSelf: "center", flex: "none", ml: "auto", pl: 1 }, children: trailing }) : void 0;
|
|
15657
15659
|
return /* @__PURE__ */ jsxs120(Box3, { "data-testid": testId, sx: { minWidth: 0, ...sx }, children: [
|
|
15658
|
-
label !== void 0 && /* @__PURE__ */
|
|
15660
|
+
label !== void 0 && /* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "center", display: "flex", minWidth: 0 }, children: [
|
|
15661
|
+
/* @__PURE__ */ jsx126(Typography3, { color: "text.secondary", component: "div", sx: { fontSize: 11, fontWeight: 500, letterSpacing: "0.06em", lineHeight: "16px", textTransform: "uppercase" }, children: label }),
|
|
15662
|
+
trailingNode("label")
|
|
15663
|
+
] }),
|
|
15659
15664
|
/* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "center", columnGap: "10px", display: "flex", minWidth: 0 }, children: [
|
|
15660
15665
|
/* @__PURE__ */ jsx126(Box3, { sx: { borderRadius: "6px", flex: "none", lineHeight: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsx126(AwsServiceIcon, { hideTooltip: true, service, size: "large" }) }),
|
|
15661
15666
|
/* @__PURE__ */ jsxs120(Stack, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
15662
15667
|
/* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "baseline", columnGap: "6px", display: "flex", fontSize: 15, lineHeight: "20px", minWidth: 0 }, children: [
|
|
15663
15668
|
/* @__PURE__ */ jsx126(Typography3, { component: "span", noWrap: true, sx: { flex: "0 100 auto", fontWeight: 700, minWidth: "3ch" }, title: getServiceDisplayName(service), variant: "inherit", children: getServiceDisplayName(service) }),
|
|
15664
|
-
hasOperation && /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": SERVICE_NODE_OPERATION_NAME_TEST_ID, noWrap: true, sx: { flex: "0 1 auto", minWidth: 0 }, variant: "inherit", children: operation2 })
|
|
15669
|
+
hasOperation && /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": SERVICE_NODE_OPERATION_NAME_TEST_ID, noWrap: true, sx: { flex: "0 1 auto", minWidth: 0 }, variant: "inherit", children: operation2 }),
|
|
15670
|
+
trailingNode("title")
|
|
15665
15671
|
] }),
|
|
15666
|
-
(hasResource || resourcePlaceholder !== void 0 || children !== void 0) && /* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "center", color: "text.secondary", columnGap: "6px", display: "flex", flexWrap: isText ? "nowrap" : "wrap", fontSize: 12, lineHeight: "18px", minWidth: 0, rowGap: "4px" }, children: [
|
|
15672
|
+
(hasResource || resourcePlaceholder !== void 0 || children !== void 0 || trailingRow === "resource") && /* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "center", color: "text.secondary", columnGap: "6px", display: "flex", flexWrap: isText ? "nowrap" : "wrap", fontSize: 12, lineHeight: "18px", minWidth: 0, rowGap: "4px" }, children: [
|
|
15667
15673
|
hasResource && /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": SERVICE_NODE_SERVICE_NAME_TEST_ID, noWrap: true, sx: { ...RESOURCE_CODE_SX, flex: "0 3 auto", minWidth: "3ch" }, title: resourceName || arn, variant: "inherit", children: resource }),
|
|
15668
15674
|
!hasResource && resourcePlaceholder !== void 0 && /* @__PURE__ */ jsx126(Box3, { component: "span", sx: { color: "text.disabled", flex: "none" }, children: resourcePlaceholder }),
|
|
15669
15675
|
(hasResource || resourcePlaceholder !== void 0) && isText && /* @__PURE__ */ jsx126(Box3, { "aria-hidden": true, component: "span", sx: { color: "text.disabled", flex: "none" }, children: "\xB7" }),
|
|
15670
|
-
isText ? /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": tailTestId, noWrap: true, sx: { flex: "1 1 0", minWidth: 0 }, title: children, variant: "inherit", children }) : children
|
|
15676
|
+
isText ? /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": tailTestId, noWrap: true, sx: { flex: "1 1 0", minWidth: 0 }, title: children, variant: "inherit", children }) : children,
|
|
15677
|
+
trailingNode("resource")
|
|
15671
15678
|
] })
|
|
15672
15679
|
] })
|
|
15673
15680
|
] })
|
|
@@ -16977,9 +16984,15 @@ import * as React125 from "react";
|
|
|
16977
16984
|
|
|
16978
16985
|
// src/components/event-details/event-details.tsx
|
|
16979
16986
|
import { Cancel as Cancel5, Close as Close3, GppBad as GppBad2, GppMaybe as GppMaybe6 } from "@mui/icons-material";
|
|
16980
|
-
import { Alert as Alert4, Box as Box18, FormControlLabel, IconButton as IconButton6, Stack as Stack4, Switch, Tab, Tabs, Typography as Typography13 } from "@mui/material";
|
|
16987
|
+
import { Alert as Alert4, alpha as alpha6, Box as Box18, FormControlLabel, IconButton as IconButton6, Stack as Stack4, Switch, Tab, Tabs, Typography as Typography13 } from "@mui/material";
|
|
16981
16988
|
import { useEffect as useEffect17, useMemo as useMemo10, useRef as useRef13, useState as useState14 } from "react";
|
|
16982
16989
|
|
|
16990
|
+
// src/dev-settings.tsx
|
|
16991
|
+
import * as React122 from "react";
|
|
16992
|
+
var DEFAULT_DEV_SETTINGS = { allowedPillWhenSucceeded: "hide", headingPills: "resource-line", succeededIconColor: "green", waterfallLayout: "tree" };
|
|
16993
|
+
var DevSettingsContext = React122.createContext(DEFAULT_DEV_SETTINGS);
|
|
16994
|
+
var useDevSettings = () => React122.useContext(DevSettingsContext);
|
|
16995
|
+
|
|
16983
16996
|
// src/utils/event-utils.ts
|
|
16984
16997
|
var iamEventParser = (eventName, attributes) => {
|
|
16985
16998
|
if (attributes?.payload && typeof attributes.payload === "string") {
|
|
@@ -17316,7 +17329,7 @@ import { Box as Box14, useTheme as useTheme3 } from "@mui/material";
|
|
|
17316
17329
|
var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
|
|
17317
17330
|
import { jsx as jsx137, jsxs as jsxs128, Fragment as Fragment8 } from "react/jsx-runtime";
|
|
17318
17331
|
import { Box as Box13, InputBase, NoSsr, SvgIcon, createTheme, ThemeProvider, Paper } from "@mui/material";
|
|
17319
|
-
import { createContext as
|
|
17332
|
+
import { createContext as createContext9, useContext as useContext15, useState as useState10, useRef as useRef8, useCallback as useCallback4, useMemo as useMemo6, useEffect as useEffect12, memo as memo10 } from "react";
|
|
17320
17333
|
import { create, useStore, createStore } from "zustand";
|
|
17321
17334
|
function r(e2) {
|
|
17322
17335
|
var t, f2, n = "";
|
|
@@ -17432,10 +17445,10 @@ var createJsonViewerStore = (props) => {
|
|
|
17432
17445
|
};
|
|
17433
17446
|
});
|
|
17434
17447
|
};
|
|
17435
|
-
var JsonViewerStoreContext =
|
|
17448
|
+
var JsonViewerStoreContext = createContext9(void 0);
|
|
17436
17449
|
JsonViewerStoreContext.Provider;
|
|
17437
17450
|
var useJsonViewerStore = (selector2, equalityFn) => {
|
|
17438
|
-
const store =
|
|
17451
|
+
const store = useContext15(JsonViewerStoreContext);
|
|
17439
17452
|
return useStore(store, selector2, equalityFn);
|
|
17440
17453
|
};
|
|
17441
17454
|
var useTextColor = () => {
|
|
@@ -18473,10 +18486,10 @@ var createTypeRegistryStore = () => {
|
|
|
18473
18486
|
}
|
|
18474
18487
|
}));
|
|
18475
18488
|
};
|
|
18476
|
-
var TypeRegistryStoreContext = /* @__PURE__ */
|
|
18489
|
+
var TypeRegistryStoreContext = /* @__PURE__ */ createContext9(void 0);
|
|
18477
18490
|
TypeRegistryStoreContext.Provider;
|
|
18478
18491
|
var useTypeRegistryStore = (selector2, equalityFn) => {
|
|
18479
|
-
const store =
|
|
18492
|
+
const store = useContext15(TypeRegistryStoreContext);
|
|
18480
18493
|
return useStore(store, selector2, equalityFn);
|
|
18481
18494
|
};
|
|
18482
18495
|
function matchTypeComponents(value, path, registry) {
|
|
@@ -18944,7 +18957,7 @@ function useThemeDetector() {
|
|
|
18944
18957
|
return isDark;
|
|
18945
18958
|
}
|
|
18946
18959
|
function useSetIfNotUndefinedEffect(key, value) {
|
|
18947
|
-
const { setState } =
|
|
18960
|
+
const { setState } = useContext15(JsonViewerStoreContext);
|
|
18948
18961
|
useEffect12(() => {
|
|
18949
18962
|
if (value !== void 0) {
|
|
18950
18963
|
setState({
|
|
@@ -18958,7 +18971,7 @@ function useSetIfNotUndefinedEffect(key, value) {
|
|
|
18958
18971
|
]);
|
|
18959
18972
|
}
|
|
18960
18973
|
var JsonViewerInner = (props) => {
|
|
18961
|
-
const { setState } =
|
|
18974
|
+
const { setState } = useContext15(JsonViewerStoreContext);
|
|
18962
18975
|
useEffect12(() => {
|
|
18963
18976
|
setState((state) => ({
|
|
18964
18977
|
prevValue: state.value,
|
|
@@ -29210,7 +29223,7 @@ import { Box as Box16, CircularProgress as CircularProgress3, Stack as Stack3, T
|
|
|
29210
29223
|
import { useEffect as useEffect16, useMemo as useMemo9, useRef as useRef12, useState as useState13 } from "react";
|
|
29211
29224
|
|
|
29212
29225
|
// src/context.tsx
|
|
29213
|
-
import { createContext as
|
|
29226
|
+
import { createContext as createContext11, useContext as useContext17 } from "react";
|
|
29214
29227
|
import { useCallback as useCallback6, useMemo as useMemo8 } from "react";
|
|
29215
29228
|
|
|
29216
29229
|
// src/api/client.ts
|
|
@@ -29495,7 +29508,7 @@ var createApiClient = ({ localstackEndpoint }) => {
|
|
|
29495
29508
|
};
|
|
29496
29509
|
|
|
29497
29510
|
// src/hooks/status-provider.tsx
|
|
29498
|
-
import { createContext as
|
|
29511
|
+
import { createContext as createContext10, useContext as useContext16 } from "react";
|
|
29499
29512
|
|
|
29500
29513
|
// src/hooks/use-connection-state-machine.ts
|
|
29501
29514
|
import { useCallback as useCallback5, useEffect as useEffect14, useRef as useRef10, useState as useState12 } from "react";
|
|
@@ -29581,13 +29594,13 @@ function useConnectionStateMachine() {
|
|
|
29581
29594
|
|
|
29582
29595
|
// src/hooks/status-provider.tsx
|
|
29583
29596
|
import { jsx as jsx140 } from "react/jsx-runtime";
|
|
29584
|
-
var AppInspectorStatusContext =
|
|
29597
|
+
var AppInspectorStatusContext = createContext10(void 0);
|
|
29585
29598
|
var StatusProvider = ({ children }) => {
|
|
29586
29599
|
const value = useConnectionStateMachine();
|
|
29587
29600
|
return /* @__PURE__ */ jsx140(AppInspectorStatusContext.Provider, { value, children });
|
|
29588
29601
|
};
|
|
29589
29602
|
var useAppInspectorStatus = () => {
|
|
29590
|
-
const value =
|
|
29603
|
+
const value = useContext16(AppInspectorStatusContext);
|
|
29591
29604
|
if (!value) {
|
|
29592
29605
|
throw new Error("@localstack-studio/ui: useAppInspectorStatus must be used within a <StatusProvider> (rendered internally by <AppInspectorContextProvider>)");
|
|
29593
29606
|
}
|
|
@@ -31523,9 +31536,9 @@ var AppInspectorTheme = ({ children }) => /* @__PURE__ */ jsx141(ThemeProvider2,
|
|
|
31523
31536
|
|
|
31524
31537
|
// src/context.tsx
|
|
31525
31538
|
import { Fragment as Fragment10, jsx as jsx142 } from "react/jsx-runtime";
|
|
31526
|
-
var AppInspectorContext =
|
|
31539
|
+
var AppInspectorContext = createContext11(void 0);
|
|
31527
31540
|
var useAppInspector = () => {
|
|
31528
|
-
const context =
|
|
31541
|
+
const context = useContext17(AppInspectorContext);
|
|
31529
31542
|
if (!context) {
|
|
31530
31543
|
throw new Error("@localstack-studio/ui: components must be used within a <AppInspectorContextProvider>");
|
|
31531
31544
|
}
|
|
@@ -31677,7 +31690,7 @@ var LambdaInvokeLogsSection = ({ endTimeNano, functionName: functionName2, regio
|
|
|
31677
31690
|
|
|
31678
31691
|
// src/components/event-details/operation-status-badges.tsx
|
|
31679
31692
|
import { Cancel as Cancel4, CheckCircle as CheckCircle3, GppBad, GppGood, GppMaybe as GppMaybe5, HelpOutline } from "@mui/icons-material";
|
|
31680
|
-
import { alpha as alpha5, Box as Box17,
|
|
31693
|
+
import { alpha as alpha5, Box as Box17, darken, lighten, Typography as Typography12 } from "@mui/material";
|
|
31681
31694
|
import { jsx as jsx144, jsxs as jsxs131 } from "react/jsx-runtime";
|
|
31682
31695
|
var IAM = {
|
|
31683
31696
|
allowed: { color: "success", icon: GppGood, label: "IAM allowed", title: "IAM allowed the call" },
|
|
@@ -31698,17 +31711,14 @@ var tint = (color2) => ({
|
|
|
31698
31711
|
px: 0.75,
|
|
31699
31712
|
py: 0.25
|
|
31700
31713
|
});
|
|
31701
|
-
var
|
|
31702
|
-
|
|
31703
|
-
onClick,
|
|
31704
|
-
sx: { "&:hover": { filter: "brightness(1.15)" }, "borderRadius": 1, "cursor": "pointer", "font": "inherit" }
|
|
31705
|
-
};
|
|
31706
|
-
var OperationStatusBadges = ({ iam, iamPermission, onIamClick, onStatusClick, status, statusLabel }) => {
|
|
31714
|
+
var OperationStatusBadges = ({ iam, iamPermission, status, statusLabel }) => {
|
|
31715
|
+
const { allowedPillWhenSucceeded, succeededIconColor } = useDevSettings();
|
|
31707
31716
|
const isError = status === "error";
|
|
31708
31717
|
const statusText = isError ? statusLabel ?? "Error" : "OK";
|
|
31709
31718
|
const StatusIcon2 = isError ? Cancel4 : CheckCircle3;
|
|
31710
31719
|
const statusColor = isError ? "error" : "success";
|
|
31711
|
-
const
|
|
31720
|
+
const hideAllowed = iam === "allowed" && status === "ok" && allowedPillWhenSucceeded === "hide";
|
|
31721
|
+
const iamStyle = iam === void 0 || hideAllowed ? void 0 : IAM[iam];
|
|
31712
31722
|
const iamLabel = iamPermission === void 0 || iam === "suppressed" ? iamStyle?.label : sentenceCase(formatPermissionStatus(iamPermission));
|
|
31713
31723
|
const showStatus = status !== "unset";
|
|
31714
31724
|
if (!showStatus && !iamStyle) {
|
|
@@ -31719,10 +31729,9 @@ var OperationStatusBadges = ({ iam, iamPermission, onIamClick, onStatusClick, st
|
|
|
31719
31729
|
Box17,
|
|
31720
31730
|
{
|
|
31721
31731
|
"data-testid": EVENT_DETAILS_HEADING_STATUS_TEST_ID,
|
|
31722
|
-
...
|
|
31723
|
-
sx: { alignItems: "center", display: "flex", gap: 0.5, minWidth: 0, ...clickable(onStatusClick).sx, ...tint(statusColor) },
|
|
31732
|
+
sx: { alignItems: "center", display: "flex", gap: 0.5, minWidth: 0, ...tint(statusColor) },
|
|
31724
31733
|
children: [
|
|
31725
|
-
/* @__PURE__ */ jsx144(StatusIcon2, { sx: { color: `${statusColor}.main`, fontSize: 14 } }),
|
|
31734
|
+
/* @__PURE__ */ jsx144(StatusIcon2, { sx: { color: !isError && succeededIconColor === "gray" ? "text.disabled" : `${statusColor}.main`, fontSize: 14 } }),
|
|
31726
31735
|
/* @__PURE__ */ jsx144(Typography12, { color: "inherit", noWrap: true, variant: "caption", children: isError ? `Failed \xB7 ${statusText}` : "Succeeded" })
|
|
31727
31736
|
]
|
|
31728
31737
|
}
|
|
@@ -31731,8 +31740,7 @@ var OperationStatusBadges = ({ iam, iamPermission, onIamClick, onStatusClick, st
|
|
|
31731
31740
|
Box17,
|
|
31732
31741
|
{
|
|
31733
31742
|
"data-testid": EVENT_DETAILS_HEADING_IAM_TEST_ID,
|
|
31734
|
-
...
|
|
31735
|
-
sx: { alignItems: "center", display: "flex", flex: "none", gap: 0.5, ...clickable(onIamClick).sx, ...tint(iamStyle.color) },
|
|
31743
|
+
sx: { alignItems: "center", display: "flex", flex: "none", gap: 0.5, ...tint(iamStyle.color) },
|
|
31736
31744
|
children: [
|
|
31737
31745
|
/* @__PURE__ */ jsx144(iamStyle.icon, { sx: { color: paletteColor(iamStyle.color), fontSize: 14 } }),
|
|
31738
31746
|
/* @__PURE__ */ jsx144(Typography12, { color: "inherit", variant: "caption", children: iamLabel })
|
|
@@ -31759,12 +31767,15 @@ var checkIsSqsSendMessage = (span) => {
|
|
|
31759
31767
|
};
|
|
31760
31768
|
var PERMISSION_SEVERITY = ["explicitly_denied", "implicitly_denied", "explicitly_allowed"];
|
|
31761
31769
|
var getWorstPermission = (events) => PERMISSION_SEVERITY.find((permission) => events.some((event) => event.permission === permission));
|
|
31770
|
+
var ERROR_BOX_SX = { bgcolor: (theme) => alpha6(theme.palette.error.main, 0.08), borderLeft: 4, borderLeftColor: "error.main", borderRadius: 1, p: 1.5 };
|
|
31771
|
+
var TRAILING_ROW = { "bottom-right": "resource", "resource-line": "title", "title-row": "title", "top-right": "label" };
|
|
31762
31772
|
var IAM_OUTCOME = { allowed: "allowed", error: "denied", none: void 0, warning: "warning" };
|
|
31763
|
-
var OPTIONAL_TABS = ["
|
|
31773
|
+
var OPTIONAL_TABS = ["logs", "permissions", "response"];
|
|
31764
31774
|
var getOptionalTabs = (span, eventGroups) => ({
|
|
31765
|
-
error: getSpanIssues(span).error,
|
|
31766
31775
|
logs: checkIsLambdaInvoke(span) && typeof span.attributes?.["localstack.request_id"] === "string",
|
|
31767
|
-
permissions: span.iam_errors_suppressed === true || eventGroups.permissions !== void 0
|
|
31776
|
+
permissions: span.iam_errors_suppressed === true || eventGroups.permissions !== void 0,
|
|
31777
|
+
// A failed call has no response; its error is at the top of Details.
|
|
31778
|
+
response: span.attributes?.["localstack.aws.service.response_suppressed"] === true || tryParseJson(span.attributes?.["localstack.aws.service.response"]) !== void 0
|
|
31768
31779
|
});
|
|
31769
31780
|
var Field = ({ children, copy, label, testId, testIdOn = "value" }) => /* @__PURE__ */ jsxs132(Box18, { children: [
|
|
31770
31781
|
/* @__PURE__ */ jsx145(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: label }),
|
|
@@ -31779,6 +31790,7 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
|
|
|
31779
31790
|
() => getEventGroupsByType(selectedEvent?.events ?? []),
|
|
31780
31791
|
[selectedEvent?.events]
|
|
31781
31792
|
);
|
|
31793
|
+
const { headingPills } = useDevSettings();
|
|
31782
31794
|
const [parseNestedJson, setParseNestedJson] = useState14(true);
|
|
31783
31795
|
const [tab, setTab] = useState14("details");
|
|
31784
31796
|
const optionalTabs = selectedEvent ? getOptionalTabs(selectedEvent, eventGroups) : void 0;
|
|
@@ -31823,7 +31835,8 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
|
|
|
31823
31835
|
const functionError = isLambdaInvoke ? getLambdaFunctionError(selectedEvent.attributes?.["localstack.aws.service.response"]) : void 0;
|
|
31824
31836
|
const errorType = functionError?.errorType ?? issues.errorType;
|
|
31825
31837
|
const duration = selectedEvent.end_time_unix_nano ? ((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString() : void 0;
|
|
31826
|
-
const
|
|
31838
|
+
const showError = issues.error;
|
|
31839
|
+
const { logs: showLogs, permissions: showPermissions, response: showResponse } = getOptionalTabs(selectedEvent, eventGroups);
|
|
31827
31840
|
const errorMessages = functionError?.errorMessage === void 0 ? [.../* @__PURE__ */ new Set([selectedEvent.status_message, ...(selectedEvent.errors ?? []).filter((item) => item.level === "error").map((item) => item.message)])].filter((message) => Boolean(message) && message !== errorType) : [functionError.errorMessage];
|
|
31828
31841
|
const iamEvents = getIamEvents(selectedEvent);
|
|
31829
31842
|
const iamPermission = getWorstPermission(iamEvents);
|
|
@@ -31833,12 +31846,6 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
|
|
|
31833
31846
|
{
|
|
31834
31847
|
iam: iamOutcome,
|
|
31835
31848
|
iamPermission,
|
|
31836
|
-
onIamClick: showPermissions ? () => {
|
|
31837
|
-
setTab("permissions");
|
|
31838
|
-
} : void 0,
|
|
31839
|
-
onStatusClick: () => {
|
|
31840
|
-
setTab(showError ? "error" : "response");
|
|
31841
|
-
},
|
|
31842
31849
|
status: issues.error ? "error" : selectedEvent.status_code === 1 ? "ok" : "unset",
|
|
31843
31850
|
statusLabel: errorType
|
|
31844
31851
|
}
|
|
@@ -31871,7 +31878,7 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
|
|
|
31871
31878
|
py: 1.25
|
|
31872
31879
|
},
|
|
31873
31880
|
children: [
|
|
31874
|
-
/* @__PURE__ */ jsx145(OperationIdentity, { ...identity, density: "heading", label: "Selected operation", sx: { flex: 1 }, testId: EVENT_DETAILS_HEADING_TEST_ID, children: statusBadges }),
|
|
31881
|
+
/* @__PURE__ */ jsx145(OperationIdentity, { ...identity, density: "heading", label: "Selected operation", sx: { flex: 1 }, testId: EVENT_DETAILS_HEADING_TEST_ID, trailing: headingPills === "resource-line" ? void 0 : statusBadges, trailingRow: TRAILING_ROW[headingPills], children: headingPills === "resource-line" ? statusBadges : void 0 }),
|
|
31875
31882
|
onClose && /* @__PURE__ */ jsx145(IconButton6, { "data-testid": EVENT_DETAILS_CLOSE_BUTTON_TEST_ID, onClick: onClose, size: "small", children: /* @__PURE__ */ jsx145(Close3, {}) })
|
|
31876
31883
|
]
|
|
31877
31884
|
}
|
|
@@ -31899,10 +31906,9 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
|
|
|
31899
31906
|
value: activeTab,
|
|
31900
31907
|
variant: "scrollable",
|
|
31901
31908
|
children: [
|
|
31902
|
-
/* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_DETAILS_TEST_ID, label: "Details", value: "details" }),
|
|
31909
|
+
/* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_DETAILS_TEST_ID, icon: showError ? /* @__PURE__ */ jsx145(Cancel5, { color: "error", sx: { fontSize: 16 } }) : void 0, iconPosition: "end", label: "Details", value: "details" }),
|
|
31903
31910
|
/* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_REQUEST_TEST_ID, label: "Payload", value: "payload" }),
|
|
31904
|
-
/* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_RESPONSE_TEST_ID, label: "Response", value: "response" }),
|
|
31905
|
-
showError && /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_ERROR_TEST_ID, icon: /* @__PURE__ */ jsx145(Cancel5, { color: "error", sx: { fontSize: 16 } }), iconPosition: "end", label: "Error", value: "error" }),
|
|
31911
|
+
showResponse && /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_RESPONSE_TEST_ID, label: "Response", value: "response" }),
|
|
31906
31912
|
showPermissions && /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_PERMISSIONS_TEST_ID, icon: permissionsIcon, iconPosition: "end", label: "Permissions", value: "permissions" }),
|
|
31907
31913
|
showLogs && /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_LOGS_TEST_ID, label: "Logs", value: "logs" }),
|
|
31908
31914
|
/* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_ADVANCED_TEST_ID, label: "Advanced", value: "advanced" })
|
|
@@ -31911,6 +31917,35 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
|
|
|
31911
31917
|
),
|
|
31912
31918
|
/* @__PURE__ */ jsxs132(Box18, { sx: { p: 2 }, children: [
|
|
31913
31919
|
activeTab === "details" && /* @__PURE__ */ jsxs132(Stack4, { spacing: 2, children: [
|
|
31920
|
+
showError && /* @__PURE__ */ jsxs132(Stack4, { spacing: 2, sx: ERROR_BOX_SX, children: [
|
|
31921
|
+
/* @__PURE__ */ jsxs132(Stack4, { spacing: 1, children: [
|
|
31922
|
+
/* @__PURE__ */ jsx145(Field, { label: "Type", children: errorType }),
|
|
31923
|
+
errorMessages.length > 0 && /* @__PURE__ */ jsx145(Field, { label: "Message", children: errorMessages.join(" \xB7 ") }),
|
|
31924
|
+
functionError && /* @__PURE__ */ jsxs132(Box18, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
|
|
31925
|
+
functionError.requestId !== void 0 && /* @__PURE__ */ jsx145(Field, { label: "Request ID", children: functionError.requestId }),
|
|
31926
|
+
/* @__PURE__ */ jsx145(Field, { label: "Function Error", testId: EVENT_DETAILS_FUNCTION_ERROR_TEST_ID, children: functionError.functionError })
|
|
31927
|
+
] })
|
|
31928
|
+
] }),
|
|
31929
|
+
functionError?.stackTrace !== void 0 && /* @__PURE__ */ jsxs132(Box18, { children: [
|
|
31930
|
+
/* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
31931
|
+
/* @__PURE__ */ jsx145(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Stack Trace" }),
|
|
31932
|
+
/* @__PURE__ */ jsx145(CopyButton, { value: functionError.stackTrace })
|
|
31933
|
+
] }),
|
|
31934
|
+
/* @__PURE__ */ jsx145(
|
|
31935
|
+
Box18,
|
|
31936
|
+
{
|
|
31937
|
+
component: "pre",
|
|
31938
|
+
"data-testid": EVENT_DETAILS_STACK_TRACE_TEST_ID,
|
|
31939
|
+
sx: { backgroundColor: "background.default", borderRadius: 1, fontFamily: "monospace", fontSize: 12, m: 0, overflow: "auto", p: 1 },
|
|
31940
|
+
children: functionError.stackTrace
|
|
31941
|
+
}
|
|
31942
|
+
)
|
|
31943
|
+
] }),
|
|
31944
|
+
exceptionPayload !== void 0 && /* @__PURE__ */ jsxs132(Box18, { children: [
|
|
31945
|
+
/* @__PURE__ */ jsx145(Typography13, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Exception" }),
|
|
31946
|
+
/* @__PURE__ */ jsx145(PayloadViewer, { testId: EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID, value: exceptionPayload })
|
|
31947
|
+
] })
|
|
31948
|
+
] }),
|
|
31914
31949
|
/* @__PURE__ */ jsxs132(Stack4, { "data-testid": EVENT_DETAILS_SECTION_BASIC_INFORMATION_TEST_ID, spacing: 1, children: [
|
|
31915
31950
|
/* @__PURE__ */ jsxs132(Box18, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
|
|
31916
31951
|
/* @__PURE__ */ jsx145(Field, { copy: getServiceDisplayName(selectedEvent.service_name), label: "Service", testId: EVENT_DETAILS_SERVICE_NAME_TEST_ID, children: getServiceDisplayName(selectedEvent.service_name) }),
|
|
@@ -31950,38 +31985,9 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
|
|
|
31950
31985
|
rawDataSwitch,
|
|
31951
31986
|
/* @__PURE__ */ jsx145(PayloadViewer, { testId: EVENT_DETAILS_REQUEST_PAYLOAD, value: requestPayload })
|
|
31952
31987
|
] })),
|
|
31953
|
-
activeTab === "response" &&
|
|
31988
|
+
activeTab === "response" && /* @__PURE__ */ jsxs132(Fragment11, { children: [
|
|
31954
31989
|
rawDataSwitch,
|
|
31955
31990
|
isResponseSuppressed ? /* @__PURE__ */ jsx145(Alert4, { severity: "warning", children: "Response payload is available \u2014 upgrade your license to view" }) : /* @__PURE__ */ jsx145(PayloadViewer, { testId: EVENT_DETAILS_RESPONSE_PAYLOAD_TEST_ID, value: responsePayload })
|
|
31956
|
-
] })),
|
|
31957
|
-
activeTab === "error" && /* @__PURE__ */ jsxs132(Stack4, { spacing: 2, children: [
|
|
31958
|
-
/* @__PURE__ */ jsxs132(Stack4, { spacing: 1, children: [
|
|
31959
|
-
/* @__PURE__ */ jsx145(Field, { label: "Type", children: errorType }),
|
|
31960
|
-
errorMessages.length > 0 && /* @__PURE__ */ jsx145(Field, { label: "Message", children: errorMessages.join(" \xB7 ") }),
|
|
31961
|
-
functionError && /* @__PURE__ */ jsxs132(Box18, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
|
|
31962
|
-
functionError.requestId !== void 0 && /* @__PURE__ */ jsx145(Field, { label: "Request ID", children: functionError.requestId }),
|
|
31963
|
-
/* @__PURE__ */ jsx145(Field, { label: "Function Error", testId: EVENT_DETAILS_FUNCTION_ERROR_TEST_ID, children: functionError.functionError })
|
|
31964
|
-
] })
|
|
31965
|
-
] }),
|
|
31966
|
-
functionError?.stackTrace !== void 0 && /* @__PURE__ */ jsxs132(Box18, { children: [
|
|
31967
|
-
/* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
31968
|
-
/* @__PURE__ */ jsx145(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Stack Trace" }),
|
|
31969
|
-
/* @__PURE__ */ jsx145(CopyButton, { value: functionError.stackTrace })
|
|
31970
|
-
] }),
|
|
31971
|
-
/* @__PURE__ */ jsx145(
|
|
31972
|
-
Box18,
|
|
31973
|
-
{
|
|
31974
|
-
component: "pre",
|
|
31975
|
-
"data-testid": EVENT_DETAILS_STACK_TRACE_TEST_ID,
|
|
31976
|
-
sx: { backgroundColor: "background.default", borderRadius: 1, fontFamily: "monospace", fontSize: 12, m: 0, overflow: "auto", p: 1 },
|
|
31977
|
-
children: functionError.stackTrace
|
|
31978
|
-
}
|
|
31979
|
-
)
|
|
31980
|
-
] }),
|
|
31981
|
-
exceptionPayload !== void 0 && /* @__PURE__ */ jsxs132(Box18, { children: [
|
|
31982
|
-
/* @__PURE__ */ jsx145(Typography13, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Exception" }),
|
|
31983
|
-
/* @__PURE__ */ jsx145(PayloadViewer, { testId: EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID, value: exceptionPayload })
|
|
31984
|
-
] })
|
|
31985
31991
|
] }),
|
|
31986
31992
|
activeTab === "permissions" && /* @__PURE__ */ jsxs132(Fragment11, { children: [
|
|
31987
31993
|
selectedEvent.iam_errors_suppressed && /* @__PURE__ */ jsx145(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" }),
|
|
@@ -32577,16 +32583,10 @@ function useLocalStorage(key, initialValue) {
|
|
|
32577
32583
|
|
|
32578
32584
|
// src/components/trace-panel/waterfall.tsx
|
|
32579
32585
|
import { AccountTreeOutlined, Cancel as Cancel7, FormatListBulleted, GppMaybe as GppMaybe8, KeyboardArrowDown as KeyboardArrowDown2, KeyboardArrowRight as KeyboardArrowRight2 } from "@mui/icons-material";
|
|
32580
|
-
import { Box as Box21, ButtonBase
|
|
32581
|
-
import { alpha as
|
|
32586
|
+
import { Box as Box21, ButtonBase, ToggleButton as ToggleButton2, ToggleButtonGroup as ToggleButtonGroup2, Typography as Typography14 } from "@mui/material";
|
|
32587
|
+
import { alpha as alpha7 } from "@mui/material/styles";
|
|
32582
32588
|
import * as React124 from "react";
|
|
32583
32589
|
|
|
32584
|
-
// src/dev-settings.tsx
|
|
32585
|
-
import * as React123 from "react";
|
|
32586
|
-
var DEFAULT_DEV_SETTINGS = { waterfallLayout: "tree" };
|
|
32587
|
-
var DevSettingsContext = React123.createContext(DEFAULT_DEV_SETTINGS);
|
|
32588
|
-
var useDevSettings = () => React123.useContext(DevSettingsContext);
|
|
32589
|
-
|
|
32590
32590
|
// src/components/trace-panel/axis-ticks.ts
|
|
32591
32591
|
var getAxisTicks = (durationMs, maxIntervals) => {
|
|
32592
32592
|
if (durationMs <= 0 || maxIntervals < 1) return [0];
|
|
@@ -32842,12 +32842,12 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
|
|
|
32842
32842
|
"&:focus-visible": { boxShadow: `inset 0 0 0 2px ${theme.palette.primary.main}` },
|
|
32843
32843
|
// Tints over the paper, all in one opaque background: the duration label repeats it
|
|
32844
32844
|
// to cover the lead line behind it, which a translucent tint would let through.
|
|
32845
|
-
"&:hover": { "--row-tint": selected ?
|
|
32845
|
+
"&:hover": { "--row-tint": selected ? alpha7(theme.palette.primary.main, 0.16) : alpha7(theme.palette.text.primary, 0.04) },
|
|
32846
32846
|
// Only the content fades for a row the filters don't match: its background (selection, hover)
|
|
32847
32847
|
// keeps its contrast.
|
|
32848
32848
|
"& > *": { opacity: spanMatches && !spanMatches(span.span_id) ? 0.4 : 1 },
|
|
32849
32849
|
"--row-bg": `linear-gradient(var(--row-tint), var(--row-tint)), ${theme.palette.background.paper}`,
|
|
32850
|
-
"--row-tint": selected ?
|
|
32850
|
+
"--row-tint": selected ? alpha7(theme.palette.primary.main, 0.12) : "transparent",
|
|
32851
32851
|
"background": "var(--row-bg)",
|
|
32852
32852
|
"cursor": "pointer",
|
|
32853
32853
|
"display": "grid",
|
|
@@ -32885,7 +32885,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
|
|
|
32885
32885
|
] }),
|
|
32886
32886
|
hasChildren && !isCollapsed && /* @__PURE__ */ jsx150(Line, { left: lineX(depth), top: 19 }),
|
|
32887
32887
|
hasChildren ? /* @__PURE__ */ jsx150(
|
|
32888
|
-
|
|
32888
|
+
ButtonBase,
|
|
32889
32889
|
{
|
|
32890
32890
|
"aria-label": isCollapsed ? "Expand" : "Collapse",
|
|
32891
32891
|
"data-testid": WATERFALL_ROW_TOGGLE_TEST_ID,
|
|
@@ -32896,7 +32896,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
|
|
|
32896
32896
|
sx: (theme) => ({
|
|
32897
32897
|
// A tint of the text colour: the theme's hover and selected shades match the
|
|
32898
32898
|
// row's own hover, so they wouldn't show on a hovered row.
|
|
32899
|
-
"&:hover": { backgroundColor:
|
|
32899
|
+
"&:hover": { backgroundColor: alpha7(theme.palette.text.primary, 0.12), color: "text.primary" },
|
|
32900
32900
|
"borderRadius": "3px",
|
|
32901
32901
|
"color": "text.secondary",
|
|
32902
32902
|
"flex": "none",
|
|
@@ -32915,7 +32915,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
|
|
|
32915
32915
|
Box21,
|
|
32916
32916
|
{
|
|
32917
32917
|
sx: (theme) => ({
|
|
32918
|
-
background: issues.error ? `repeating-linear-gradient(135deg, ${theme.palette.error.main} 0 4px, ${
|
|
32918
|
+
background: issues.error ? `repeating-linear-gradient(135deg, ${theme.palette.error.main} 0 4px, ${alpha7(theme.palette.error.main, 0.7)} 4px 8px)` : serviceColor,
|
|
32919
32919
|
borderRadius: "1px",
|
|
32920
32920
|
height: 10,
|
|
32921
32921
|
left: `${String(startPercent)}%`,
|