@localstack/appinspector-ui 1.0.144 → 1.0.145
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 +25 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15300,13 +15300,14 @@ function parseIAMEvent(payloadString) {
|
|
|
15300
15300
|
|
|
15301
15301
|
// src/components/cells/status-cell.tsx
|
|
15302
15302
|
import { Fragment as Fragment2, jsx as jsx124, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
15303
|
-
var StatusIcon = ({ errorLevel, spanStatusCode }) => {
|
|
15303
|
+
var StatusIcon = ({ errorLevel, operationStatus, spanStatusCode }) => {
|
|
15304
15304
|
switch (errorLevel) {
|
|
15305
15305
|
case ErrorLevel.ERROR: {
|
|
15306
15306
|
return /* @__PURE__ */ jsx124(Cancel, { sx: { color: "red" } });
|
|
15307
15307
|
}
|
|
15308
15308
|
case ErrorLevel.IAM_PERMISSION: {
|
|
15309
|
-
|
|
15309
|
+
const isDenial = operationStatus ? operationStatus === "iam_explicit_deny" || operationStatus === "iam_implicit_deny" : spanStatusCode === 2;
|
|
15310
|
+
return /* @__PURE__ */ jsx124(GppBad, { sx: { color: isDenial ? "red" : "warning.main" } });
|
|
15310
15311
|
}
|
|
15311
15312
|
case ErrorLevel.WARNING: {
|
|
15312
15313
|
return /* @__PURE__ */ jsx124(Error2, { sx: { color: "orange" } });
|
|
@@ -15317,6 +15318,22 @@ var StatusIcon = ({ errorLevel, spanStatusCode }) => {
|
|
|
15317
15318
|
}
|
|
15318
15319
|
};
|
|
15319
15320
|
var calculateHighestErrorLevel = (span) => {
|
|
15321
|
+
if (span.operation_status) {
|
|
15322
|
+
switch (span.operation_status) {
|
|
15323
|
+
case "error": {
|
|
15324
|
+
return ErrorLevel.ERROR;
|
|
15325
|
+
}
|
|
15326
|
+
case "iam_explicit_deny":
|
|
15327
|
+
case "iam_explicit_warn":
|
|
15328
|
+
case "iam_implicit_deny":
|
|
15329
|
+
case "iam_implicit_warn": {
|
|
15330
|
+
return ErrorLevel.IAM_PERMISSION;
|
|
15331
|
+
}
|
|
15332
|
+
default: {
|
|
15333
|
+
return ErrorLevel.OK;
|
|
15334
|
+
}
|
|
15335
|
+
}
|
|
15336
|
+
}
|
|
15320
15337
|
const hasIamDenial = span.events.some((event) => {
|
|
15321
15338
|
if (!event.event_type?.toLowerCase().includes("iam")) return false;
|
|
15322
15339
|
if (typeof event.attributes?.payload !== "string") return false;
|
|
@@ -15360,7 +15377,7 @@ var buildTooltipContent = (span) => {
|
|
|
15360
15377
|
var StatusIconWithTooltip = ({ span }) => {
|
|
15361
15378
|
const errorLevel = calculateHighestErrorLevel(span);
|
|
15362
15379
|
if (errorLevel !== ErrorLevel.ERROR && errorLevel !== ErrorLevel.IAM_PERMISSION) return /* @__PURE__ */ jsx124(Fragment2, {});
|
|
15363
|
-
return /* @__PURE__ */ jsx124(Tooltip2, { title: buildTooltipContent(span), children: /* @__PURE__ */ jsx124(Box2, { sx: { alignItems: "center", cursor: "default", display: "flex" }, children: /* @__PURE__ */ jsx124(StatusIcon, { errorLevel, spanStatusCode: span.status_code }) }) });
|
|
15380
|
+
return /* @__PURE__ */ jsx124(Tooltip2, { title: buildTooltipContent(span), children: /* @__PURE__ */ jsx124(Box2, { sx: { alignItems: "center", cursor: "default", display: "flex" }, children: /* @__PURE__ */ jsx124(StatusIcon, { errorLevel, operationStatus: span.operation_status, spanStatusCode: span.status_code }) }) });
|
|
15364
15381
|
};
|
|
15365
15382
|
|
|
15366
15383
|
// src/components/spans-list/span-count-badge.tsx
|
|
@@ -31776,14 +31793,16 @@ var ServiceNode = memo11(({ data, selected }) => {
|
|
|
31776
31793
|
const theme = useTheme4();
|
|
31777
31794
|
const [isHovered, setIsHovered] = useState17(false);
|
|
31778
31795
|
const nodeRef = useRef14(null);
|
|
31779
|
-
const
|
|
31780
|
-
const
|
|
31796
|
+
const { operation_status } = data.event;
|
|
31797
|
+
const hasPermissionEventsLegacy = useMemo11(
|
|
31781
31798
|
() => data.event.events.some(
|
|
31782
31799
|
(event) => event.event_type === "iam.policy_evaluation" && event.name === "iam.policy.denied"
|
|
31783
31800
|
),
|
|
31784
31801
|
[data.event.events]
|
|
31785
31802
|
);
|
|
31786
|
-
const
|
|
31803
|
+
const isError = operation_status ? operation_status === "error" || operation_status === "iam_explicit_deny" || operation_status === "iam_implicit_deny" : data.event.status_code === 2;
|
|
31804
|
+
const isWarning = operation_status ? operation_status === "iam_explicit_warn" || operation_status === "iam_implicit_warn" : !isError && data.event.status_code === 1 && hasPermissionEventsLegacy;
|
|
31805
|
+
const hasPermissionEvents = operation_status ? operation_status.startsWith("iam_") : hasPermissionEventsLegacy;
|
|
31787
31806
|
const outlineColor = isError ? theme.palette.error.main : isWarning ? theme.palette.warning.main : void 0;
|
|
31788
31807
|
const sharedBoxSx = {
|
|
31789
31808
|
backgroundColor: theme.palette.background.paper,
|