@localstack/appinspector-ui 1.0.106 → 1.0.108

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 CHANGED
@@ -2484,7 +2484,8 @@ var EVENT_DETAILS_REQUEST_PAYLOAD = "event-details-request-payload";
2484
2484
  var EVENT_DETAILS_RESPONSE_PAYLOAD_TEST_ID = "event-details-response-payload";
2485
2485
  var EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID = "event-details-exception-payload";
2486
2486
  var EVENT_DETAILS_IAM_ERRORS_SUPPRESSED_TEST_ID = "event-details-iam-errors-suppressed";
2487
- var IAM_ERROR_COUNT_TEST_ID = "iam-error-count";
2487
+ var ERROR_COUNT_TEST_ID = "error-count";
2488
+ var WARNING_COUNT_TEST_ID = "warning-count";
2488
2489
  var SERVICE_NODE_TEST_ID = "service-node";
2489
2490
  var SERVICE_NODE_SERVICE_NAME_TEST_ID = "service-node-service-name";
2490
2491
  var SERVICE_NODE_OPERATION_NAME_TEST_ID = "service-node-operation-name";
@@ -14871,6 +14872,7 @@ var LABEL_END_OF_STREAM = "This is the end of the stream";
14871
14872
  var LABEL_NO_SPANS = "There are no operations";
14872
14873
  var LABEL_LOAD_OLDER = "Load older operations";
14873
14874
  var LABEL_LOAD_NEWER = "Load newer operations";
14875
+ var STICK_TO_EDGE_THRESHOLD_PX = 4;
14874
14876
  var StreamBoundaryRow = ({ colSpan, label }) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.TableCell, { colSpan, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { children: label }) }) });
14875
14877
  var LoadSpansRow = ({ colSpan, fetching, label, onFetch }) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material6.TableCell, { colSpan, sx: { textAlign: "center" }, children: [
14876
14878
  !fetching && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Button, { onClick: onFetch, sx: { my: 1 }, children: label }),
@@ -14931,11 +14933,11 @@ var SpansDataGridRow = (0, import_react42.memo)(
14931
14933
  );
14932
14934
  var SpansDataGrid = ({
14933
14935
  clearingSpans,
14936
+ errorCount,
14934
14937
  fetchingBackward,
14935
14938
  fetchingForward,
14936
14939
  hasMoreBackward,
14937
14940
  hasMoreForward,
14938
- iamErrorCount,
14939
14941
  licenseLimit,
14940
14942
  onClearSpans,
14941
14943
  onFetchBackward,
@@ -14947,7 +14949,8 @@ var SpansDataGrid = ({
14947
14949
  spans,
14948
14950
  streamPaused,
14949
14951
  systemLimit,
14950
- totalCount
14952
+ totalCount,
14953
+ warningCount
14951
14954
  }) => {
14952
14955
  const columns = (0, import_react42.useMemo)(() => [
14953
14956
  columnHelper.accessor("startTime", {
@@ -15029,23 +15032,55 @@ var SpansDataGrid = ({
15029
15032
  const columnCount = table.getAllColumns().length;
15030
15033
  const rows = table.getRowModel().rows;
15031
15034
  const hasRows = rows.length > 0;
15035
+ const containerRef = (0, import_react42.useRef)(null);
15036
+ const isAtLiveEdgeRef = (0, import_react42.useRef)(true);
15037
+ const handleScroll = (0, import_react42.useCallback)(() => {
15038
+ const element = containerRef.current;
15039
+ if (!element) return;
15040
+ if (order2 === "oldest_first") {
15041
+ const distanceFromBottom = element.scrollHeight - element.scrollTop - element.clientHeight;
15042
+ isAtLiveEdgeRef.current = distanceFromBottom <= STICK_TO_EDGE_THRESHOLD_PX;
15043
+ return;
15044
+ }
15045
+ isAtLiveEdgeRef.current = element.scrollTop <= STICK_TO_EDGE_THRESHOLD_PX;
15046
+ }, [order2]);
15047
+ const lastSpanId = spans?.at(-1)?.span_id;
15048
+ (0, import_react42.useLayoutEffect)(() => {
15049
+ handleScroll();
15050
+ }, [handleScroll]);
15051
+ (0, import_react42.useLayoutEffect)(() => {
15052
+ if (order2 !== "oldest_first") return;
15053
+ const element = containerRef.current;
15054
+ if (!element || !isAtLiveEdgeRef.current) return;
15055
+ element.scrollTop = element.scrollHeight;
15056
+ }, [order2, spans?.length, lastSpanId]);
15032
15057
  return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
15033
15058
  /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Grid, { item: true, xs: 12, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material6.Box, { sx: { alignItems: "center", display: "flex", gap: "0.5rem" }, children: [
15034
15059
  /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(SpanCountBadge, { licenseLimit, systemLimit, totalCount, visibleCount: spans?.length }),
15035
- iamErrorCount !== void 0 && iamErrorCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
15060
+ errorCount !== void 0 && errorCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
15036
15061
  /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Typography, { color: "text.disabled", sx: { mr: 0.5 }, variant: "body2", children: "\u2014" }),
15037
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Tooltip, { title: "Number of IAM permission errors detected across all operations", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
15062
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Tooltip, { title: "Number of errors detected across all operations", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
15038
15063
  import_material6.Box,
15039
15064
  {
15040
- "data-testid": IAM_ERROR_COUNT_TEST_ID,
15065
+ "data-testid": ERROR_COUNT_TEST_ID,
15041
15066
  sx: { alignItems: "center", borderBottom: "1px dotted", borderColor: "error.main", cursor: "default", display: "flex", gap: 0.5, mb: "-1px" },
15042
15067
  children: [
15043
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Typography, { color: "error", variant: "body2", children: iamErrorCount.toLocaleString() }),
15044
- /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material6.Typography, { color: "error", variant: "caption", children: [
15045
- "IAM",
15046
- " ",
15047
- iamErrorCount === 1 ? "error" : "errors"
15048
- ] })
15068
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Typography, { color: "error", variant: "body2", children: errorCount.toLocaleString() }),
15069
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Typography, { color: "error", variant: "caption", children: errorCount === 1 ? "error" : "errors" })
15070
+ ]
15071
+ }
15072
+ ) })
15073
+ ] }),
15074
+ warningCount !== void 0 && warningCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
15075
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Typography, { color: "text.disabled", sx: { mr: 0.5 }, variant: "body2", children: "\u2014" }),
15076
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Tooltip, { title: "Number of warnings detected across all operations", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
15077
+ import_material6.Box,
15078
+ {
15079
+ "data-testid": WARNING_COUNT_TEST_ID,
15080
+ sx: { alignItems: "center", borderBottom: "1px dotted", borderColor: "warning.main", cursor: "default", display: "flex", gap: 0.5, mb: "-1px" },
15081
+ children: [
15082
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Typography, { color: "warning.main", variant: "body2", children: warningCount.toLocaleString() }),
15083
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Typography, { color: "warning.main", variant: "caption", children: warningCount === 1 ? "warning" : "warnings" })
15049
15084
  ]
15050
15085
  }
15051
15086
  ) })
@@ -15086,6 +15121,8 @@ var SpansDataGrid = ({
15086
15121
  /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material6.Paper, { sx: { flexGrow: 1, overflow: "hidden", position: "relative", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
15087
15122
  import_material6.TableContainer,
15088
15123
  {
15124
+ onScroll: handleScroll,
15125
+ ref: containerRef,
15089
15126
  sx: {
15090
15127
  bottom: 0,
15091
15128
  flexGrow: 1,
@@ -15177,11 +15214,11 @@ var SpansList = (props) => {
15177
15214
  SpansDataGrid,
15178
15215
  {
15179
15216
  clearingSpans: props.clearingSpans,
15217
+ errorCount: props.errorCount,
15180
15218
  fetchingBackward: props.fetchingBackward,
15181
15219
  fetchingForward: props.fetchingForward,
15182
15220
  hasMoreBackward: props.hasMoreBackward,
15183
15221
  hasMoreForward: props.hasMoreForward,
15184
- iamErrorCount: props.iamErrorCount,
15185
15222
  licenseLimit: props.licenseLimit,
15186
15223
  onClearSpans: props.onClearSpans,
15187
15224
  onFetchBackward: props.onFetchBackward,
@@ -15193,7 +15230,8 @@ var SpansList = (props) => {
15193
15230
  spans: props.spans,
15194
15231
  streamPaused: props.streamPaused,
15195
15232
  systemLimit: props.systemLimit,
15196
- totalCount: props.totalCount
15233
+ totalCount: props.totalCount,
15234
+ warningCount: props.warningCount
15197
15235
  }
15198
15236
  )
15199
15237
  ] });
@@ -18126,7 +18164,8 @@ var useSpans = () => {
18126
18164
  setTotalCount(response.pagination.total_count);
18127
18165
  setLicenseLimit(response.limits.span_count_limit_license);
18128
18166
  setSystemLimit(response.limits.span_count_limit_system);
18129
- setIamErrorCount(response.iam_error_count);
18167
+ setErrorCount(response.error_count);
18168
+ setWarningCount(response.warning_count);
18130
18169
  return {
18131
18170
  hasMoreBackward: response.pagination.has_prev,
18132
18171
  hasMoreForward: response.pagination.has_next,
@@ -18158,7 +18197,8 @@ var useSpans = () => {
18158
18197
  const [totalCount, setTotalCount] = (0, import_react52.useState)();
18159
18198
  const [licenseLimit, setLicenseLimit] = (0, import_react52.useState)();
18160
18199
  const [systemLimit, setSystemLimit] = (0, import_react52.useState)();
18161
- const [iamErrorCount, setIamErrorCount] = (0, import_react52.useState)();
18200
+ const [errorCount, setErrorCount] = (0, import_react52.useState)();
18201
+ const [warningCount, setWarningCount] = (0, import_react52.useState)();
18162
18202
  const [hasMoreBackward, setHasMoreBackward] = (0, import_react52.useState)();
18163
18203
  const [hasMoreForward, setHasMoreForward] = (0, import_react52.useState)();
18164
18204
  const fetchForward = (0, import_react52.useCallback)(() => {
@@ -18214,6 +18254,7 @@ var useSpans = () => {
18214
18254
  return {
18215
18255
  clearingSpans,
18216
18256
  clearSpans,
18257
+ errorCount,
18217
18258
  fetchBackward,
18218
18259
  fetchError,
18219
18260
  fetchForward,
@@ -18221,13 +18262,13 @@ var useSpans = () => {
18221
18262
  fetchingForward,
18222
18263
  hasMoreBackward,
18223
18264
  hasMoreForward,
18224
- iamErrorCount,
18225
18265
  licenseLimit,
18226
18266
  spans: throttledSpans.items,
18227
18267
  streamPaused,
18228
18268
  systemLimit,
18229
18269
  toggleStream,
18230
- totalCount
18270
+ totalCount,
18271
+ warningCount
18231
18272
  };
18232
18273
  };
18233
18274
 
@@ -31235,6 +31276,7 @@ var SpansListPage = () => {
31235
31276
  const {
31236
31277
  clearingSpans,
31237
31278
  clearSpans,
31279
+ errorCount,
31238
31280
  fetchBackward,
31239
31281
  fetchError,
31240
31282
  fetchForward,
@@ -31242,13 +31284,13 @@ var SpansListPage = () => {
31242
31284
  fetchingForward,
31243
31285
  hasMoreBackward,
31244
31286
  hasMoreForward,
31245
- iamErrorCount,
31246
31287
  licenseLimit,
31247
31288
  spans,
31248
31289
  streamPaused,
31249
31290
  systemLimit,
31250
31291
  toggleStream,
31251
- totalCount
31292
+ totalCount,
31293
+ warningCount
31252
31294
  } = useSpans();
31253
31295
  const { checking, checkStatus, status, statusError } = useAppInspectorStatus();
31254
31296
  const clearSpansSync = (0, import_react69.useCallback)(() => {
@@ -31313,12 +31355,12 @@ var SpansListPage = () => {
31313
31355
  SpansList,
31314
31356
  {
31315
31357
  clearingSpans,
31358
+ errorCount,
31316
31359
  fetchError,
31317
31360
  fetchingBackward,
31318
31361
  fetchingForward,
31319
31362
  hasMoreBackward,
31320
31363
  hasMoreForward,
31321
- iamErrorCount,
31322
31364
  licenseLimit,
31323
31365
  onClearSpans: clearSpansSync,
31324
31366
  onFetchBackward: fetchBackward,
@@ -31330,7 +31372,8 @@ var SpansListPage = () => {
31330
31372
  spans,
31331
31373
  streamPaused,
31332
31374
  systemLimit,
31333
- totalCount
31375
+ totalCount,
31376
+ warningCount
31334
31377
  }
31335
31378
  )
31336
31379
  ]