@localstack/appinspector-ui 1.0.194 → 1.0.195
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 +40 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -15973,8 +15973,6 @@ var SpansDataGridRow = (0, import_react38.memo)(
|
|
|
15973
15973
|
var SpansDataGrid = ({
|
|
15974
15974
|
clearingSpans,
|
|
15975
15975
|
compute,
|
|
15976
|
-
fetchingBackward,
|
|
15977
|
-
fetchingForward,
|
|
15978
15976
|
getSpan,
|
|
15979
15977
|
hasMoreBackward,
|
|
15980
15978
|
hasMoreForward,
|
|
@@ -16121,10 +16119,14 @@ var SpansDataGrid = ({
|
|
|
16121
16119
|
}, [order2]);
|
|
16122
16120
|
const virtualizer = useVirtualizer({
|
|
16123
16121
|
count: displayRows.length,
|
|
16124
|
-
//
|
|
16125
|
-
|
|
16122
|
+
// The row's rendered height (its cells' `height: 48`, border included). A wrong estimate
|
|
16123
|
+
// shifts the rendered window off the viewport whenever a page is prepended.
|
|
16124
|
+
estimateSize: () => 48,
|
|
16126
16125
|
getScrollElement: () => containerRef.current,
|
|
16127
|
-
overscan: 5
|
|
16126
|
+
overscan: 5,
|
|
16127
|
+
// React 17 already renders synchronously from a native scroll listener, and flushSync
|
|
16128
|
+
// would warn when the layout effect below dispatches a scroll event.
|
|
16129
|
+
useFlushSync: false
|
|
16128
16130
|
});
|
|
16129
16131
|
const virtualItems = virtualizer.getVirtualItems();
|
|
16130
16132
|
const totalVirtualSize = virtualizer.getTotalSize();
|
|
@@ -16139,6 +16141,7 @@ var SpansDataGrid = ({
|
|
|
16139
16141
|
const element = containerRef.current;
|
|
16140
16142
|
if (!element || !isAtLiveEdgeRef.current) return;
|
|
16141
16143
|
element.scrollTop = element.scrollHeight;
|
|
16144
|
+
element.dispatchEvent(new Event("scroll"));
|
|
16142
16145
|
}, [order2, spans?.length, lastSpanId]);
|
|
16143
16146
|
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
|
|
16144
16147
|
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.Grid, { item: true, xs: 12, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_material8.Box, { sx: { display: "flex", flexDirection: "column", gap: "0.5rem", pt: 1, px: 1 }, children: [
|
|
@@ -16264,7 +16267,7 @@ var SpansDataGrid = ({
|
|
|
16264
16267
|
}
|
|
16265
16268
|
) : /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_NO_SPANS })),
|
|
16266
16269
|
!clearingSpans && order2 === "newest_first" && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
|
|
16267
|
-
hasRows && hasMoreForward &&
|
|
16270
|
+
hasRows && hasMoreForward && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(LoadingRow, { colSpan: columnCount }),
|
|
16268
16271
|
hasRows && !hasMoreForward && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_END_OF_STREAM }),
|
|
16269
16272
|
hasRows && paddingTop > 0 && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
16270
16273
|
import_material8.TableCell,
|
|
@@ -16295,12 +16298,12 @@ var SpansDataGrid = ({
|
|
|
16295
16298
|
sx: { border: 0, height: paddingBottom, p: 0 }
|
|
16296
16299
|
}
|
|
16297
16300
|
) }),
|
|
16298
|
-
hasRows && hasMoreBackward &&
|
|
16301
|
+
hasRows && hasMoreBackward && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(LoadingRow, { colSpan: columnCount }),
|
|
16299
16302
|
hasRows && !hasMoreBackward && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_BEGINNING_OF_STREAM })
|
|
16300
16303
|
] }),
|
|
16301
16304
|
!clearingSpans && order2 === "oldest_first" && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
|
|
16302
16305
|
hasRows && !hasMoreBackward && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_BEGINNING_OF_STREAM }),
|
|
16303
|
-
hasRows && hasMoreBackward &&
|
|
16306
|
+
hasRows && hasMoreBackward && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(LoadingRow, { colSpan: columnCount }),
|
|
16304
16307
|
hasRows && paddingTop > 0 && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material8.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
16305
16308
|
import_material8.TableCell,
|
|
16306
16309
|
{
|
|
@@ -16330,7 +16333,7 @@ var SpansDataGrid = ({
|
|
|
16330
16333
|
sx: { border: 0, height: paddingBottom, p: 0 }
|
|
16331
16334
|
}
|
|
16332
16335
|
) }),
|
|
16333
|
-
hasRows && hasMoreForward &&
|
|
16336
|
+
hasRows && hasMoreForward && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(LoadingRow, { colSpan: columnCount }),
|
|
16334
16337
|
hasRows && !hasMoreForward && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_END_OF_STREAM })
|
|
16335
16338
|
] })
|
|
16336
16339
|
] })
|
|
@@ -16364,8 +16367,6 @@ var SpansList = (props) => {
|
|
|
16364
16367
|
{
|
|
16365
16368
|
clearingSpans: props.clearingSpans,
|
|
16366
16369
|
compute: props.compute,
|
|
16367
|
-
fetchingBackward: props.fetchingBackward,
|
|
16368
|
-
fetchingForward: props.fetchingForward,
|
|
16369
16370
|
getSpan: props.getSpan,
|
|
16370
16371
|
hasMoreBackward: props.hasMoreBackward,
|
|
16371
16372
|
hasMoreForward: props.hasMoreForward,
|
|
@@ -32825,6 +32826,7 @@ var WorkerErrorMessage = ({ error, onRetry }) => /* @__PURE__ */ (0, import_jsx_
|
|
|
32825
32826
|
|
|
32826
32827
|
// src/hooks/use-spans.ts
|
|
32827
32828
|
var import_react64 = require("react");
|
|
32829
|
+
var import_react_dom2 = require("react-dom");
|
|
32828
32830
|
|
|
32829
32831
|
// src/utils/pagination-buffer.ts
|
|
32830
32832
|
var insertSorted = (array, item, compareFunction, hint = "back") => {
|
|
@@ -33102,12 +33104,14 @@ var EMPTY_RESULT = {
|
|
|
33102
33104
|
};
|
|
33103
33105
|
var useSpansCompute = () => {
|
|
33104
33106
|
const { spansWorkerUrl } = useAppInspector();
|
|
33105
|
-
const [
|
|
33107
|
+
const [computeState, setComputeState] = (0, import_react62.useState)({ loaded: false, result: EMPTY_RESULT });
|
|
33108
|
+
const { loaded, result } = computeState;
|
|
33106
33109
|
const [workerError, setWorkerError] = (0, import_react62.useState)();
|
|
33107
33110
|
const [retryCount, setRetryCount] = (0, import_react62.useState)(0);
|
|
33108
33111
|
const workerRef = (0, import_react62.useRef)();
|
|
33109
33112
|
const seqRef = (0, import_react62.useRef)(0);
|
|
33110
33113
|
const lastAppliedRef = (0, import_react62.useRef)(0);
|
|
33114
|
+
const firstPageSeqRef = (0, import_react62.useRef)();
|
|
33111
33115
|
(0, import_react62.useEffect)(() => {
|
|
33112
33116
|
try {
|
|
33113
33117
|
const worker = spansWorkerUrl ? new Worker(spansWorkerUrl) : createInlineWorker();
|
|
@@ -33115,7 +33119,8 @@ var useSpansCompute = () => {
|
|
|
33115
33119
|
const { result: nextResult, seq } = event.data;
|
|
33116
33120
|
if (seq < lastAppliedRef.current) return;
|
|
33117
33121
|
lastAppliedRef.current = seq;
|
|
33118
|
-
|
|
33122
|
+
const pageApplied = firstPageSeqRef.current !== void 0 && seq >= firstPageSeqRef.current;
|
|
33123
|
+
setComputeState((previous) => ({ loaded: previous.loaded || pageApplied, result: nextResult }));
|
|
33119
33124
|
});
|
|
33120
33125
|
worker.addEventListener("error", (event) => {
|
|
33121
33126
|
setWorkerError(new Error(event.message || "Spans filter worker crashed."));
|
|
@@ -33135,7 +33140,9 @@ var useSpansCompute = () => {
|
|
|
33135
33140
|
setRetryCount((count2) => count2 + 1);
|
|
33136
33141
|
}, []);
|
|
33137
33142
|
const addPage = (0, import_react62.useCallback)((direction, projections) => {
|
|
33138
|
-
|
|
33143
|
+
const seq = ++seqRef.current;
|
|
33144
|
+
firstPageSeqRef.current ??= seq;
|
|
33145
|
+
workerRef.current?.postMessage({ direction, op: "addPage", projections, seq });
|
|
33139
33146
|
}, []);
|
|
33140
33147
|
const setQuery = (0, import_react62.useCallback)((query2, textMatches) => {
|
|
33141
33148
|
workerRef.current?.postMessage({ op: "setQuery", query: query2, seq: ++seqRef.current, textMatches });
|
|
@@ -33143,7 +33150,7 @@ var useSpansCompute = () => {
|
|
|
33143
33150
|
const clear = (0, import_react62.useCallback)(() => {
|
|
33144
33151
|
workerRef.current?.postMessage({ op: "clear", seq: ++seqRef.current });
|
|
33145
33152
|
}, []);
|
|
33146
|
-
return { addPage, clear, result, retryWorker, setQuery, workerError };
|
|
33153
|
+
return { addPage, clear, loaded, result, retryWorker, setQuery, workerError };
|
|
33147
33154
|
};
|
|
33148
33155
|
|
|
33149
33156
|
// src/hooks/use-spans-ws.tsx
|
|
@@ -33277,7 +33284,7 @@ var NEW_SPAN_HIGHLIGHT_WINDOW_MS = 5e3;
|
|
|
33277
33284
|
var useSpans = () => {
|
|
33278
33285
|
const api = useAppInspectorApi();
|
|
33279
33286
|
const { onWsClose, onWsOpen, status, wsEnabled } = useAppInspectorStatus();
|
|
33280
|
-
const { addPage, clear: clearCompute, result: computeResult, retryWorker, setQuery: setComputeQuery, workerError } = useSpansCompute();
|
|
33287
|
+
const { addPage, clear: clearCompute, loaded: spansLoaded, result: computeResult, retryWorker, setQuery: setComputeQuery, workerError } = useSpansCompute();
|
|
33281
33288
|
const spanMapRef = (0, import_react64.useRef)(/* @__PURE__ */ new Map());
|
|
33282
33289
|
const newSpanIdsRef = (0, import_react64.useRef)(/* @__PURE__ */ new Set());
|
|
33283
33290
|
const caughtUpRef = (0, import_react64.useRef)(false);
|
|
@@ -33294,7 +33301,6 @@ var useSpans = () => {
|
|
|
33294
33301
|
const [warningCount, setWarningCount] = (0, import_react64.useState)();
|
|
33295
33302
|
const [hasMoreBackward, setHasMoreBackward] = (0, import_react64.useState)();
|
|
33296
33303
|
const [hasMoreForward, setHasMoreForward] = (0, import_react64.useState)();
|
|
33297
|
-
const [spansLoaded, setSpansLoaded] = (0, import_react64.useState)(false);
|
|
33298
33304
|
const fetchForward = (0, import_react64.useCallback)(() => {
|
|
33299
33305
|
void paginationBufferRef.current?.fetchForward();
|
|
33300
33306
|
}, []);
|
|
@@ -33373,12 +33379,14 @@ var useSpans = () => {
|
|
|
33373
33379
|
if (!response.pagination.epoch) {
|
|
33374
33380
|
hasFetchedWithoutEpochRef.current = true;
|
|
33375
33381
|
}
|
|
33376
|
-
|
|
33377
|
-
|
|
33378
|
-
|
|
33379
|
-
|
|
33380
|
-
|
|
33381
|
-
|
|
33382
|
+
(0, import_react_dom2.unstable_batchedUpdates)(() => {
|
|
33383
|
+
onEpochSeen(response.pagination.epoch);
|
|
33384
|
+
setTotalCount(response.pagination.total_count);
|
|
33385
|
+
setLicenseLimit(response.limits.span_count_limit_license);
|
|
33386
|
+
setSystemLimit(response.limits.span_count_limit_system);
|
|
33387
|
+
setErrorCount(response.error_count);
|
|
33388
|
+
setWarningCount(response.warning_count);
|
|
33389
|
+
});
|
|
33382
33390
|
return {
|
|
33383
33391
|
hasMoreBackward: response.pagination.has_prev,
|
|
33384
33392
|
hasMoreForward: response.pagination.has_next,
|
|
@@ -33397,11 +33405,12 @@ var useSpans = () => {
|
|
|
33397
33405
|
}
|
|
33398
33406
|
},
|
|
33399
33407
|
onDataChange: ({ hasMoreBackward: hasMoreBackward2, hasMoreForward: hasMoreForward2 }) => {
|
|
33400
|
-
setFetchError(void 0);
|
|
33401
|
-
setHasMoreBackward(hasMoreBackward2);
|
|
33402
|
-
setHasMoreForward(hasMoreForward2);
|
|
33403
33408
|
if (!hasMoreForward2) caughtUpRef.current = true;
|
|
33404
|
-
|
|
33409
|
+
(0, import_react_dom2.unstable_batchedUpdates)(() => {
|
|
33410
|
+
setFetchError(void 0);
|
|
33411
|
+
setHasMoreBackward(hasMoreBackward2);
|
|
33412
|
+
setHasMoreForward(hasMoreForward2);
|
|
33413
|
+
});
|
|
33405
33414
|
},
|
|
33406
33415
|
onError: (error) => {
|
|
33407
33416
|
setFetchError(error);
|
|
@@ -33421,8 +33430,10 @@ var useSpans = () => {
|
|
|
33421
33430
|
addPage(direction, items.map((span) => toSpanFilterProjection(span)));
|
|
33422
33431
|
},
|
|
33423
33432
|
onStatusChange(status2) {
|
|
33424
|
-
|
|
33425
|
-
|
|
33433
|
+
(0, import_react_dom2.unstable_batchedUpdates)(() => {
|
|
33434
|
+
setFetchingBackward(status2.fetchingBackward);
|
|
33435
|
+
setFetchingForward(status2.fetchingForward);
|
|
33436
|
+
});
|
|
33426
33437
|
}
|
|
33427
33438
|
});
|
|
33428
33439
|
paginationBufferRef.current = buffer;
|
|
@@ -33526,7 +33537,6 @@ var SpansListPage = () => {
|
|
|
33526
33537
|
compute,
|
|
33527
33538
|
fetchError,
|
|
33528
33539
|
fetchForward,
|
|
33529
|
-
fetchingBackward,
|
|
33530
33540
|
fetchingForward,
|
|
33531
33541
|
getSpan,
|
|
33532
33542
|
hasMoreBackward,
|
|
@@ -33669,8 +33679,6 @@ var SpansListPage = () => {
|
|
|
33669
33679
|
clearingSpans,
|
|
33670
33680
|
compute,
|
|
33671
33681
|
fetchError,
|
|
33672
|
-
fetchingBackward,
|
|
33673
|
-
fetchingForward,
|
|
33674
33682
|
getSpan,
|
|
33675
33683
|
hasMoreBackward,
|
|
33676
33684
|
hasMoreForward,
|