@localstack/appinspector-ui 1.0.56 → 1.0.58
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 +154 -221
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +159 -226
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9651,7 +9651,7 @@ var AnimatePresence = function(_a) {
|
|
|
9651
9651
|
};
|
|
9652
9652
|
|
|
9653
9653
|
// src/components/spans-list/spans-data-grid.tsx
|
|
9654
|
-
import { useMemo as useMemo5 } from "react";
|
|
9654
|
+
import { memo as memo8, useMemo as useMemo5 } from "react";
|
|
9655
9655
|
|
|
9656
9656
|
// src/components/cells/responsive-timestamp-cell.tsx
|
|
9657
9657
|
import { memo as memo2 } from "react";
|
|
@@ -12145,15 +12145,65 @@ var newSpanBackgroundColor = {
|
|
|
12145
12145
|
dark: "#887b02",
|
|
12146
12146
|
light: "#ffde7b"
|
|
12147
12147
|
};
|
|
12148
|
+
var SpansDataGridRow = memo8(
|
|
12149
|
+
({ row }) => {
|
|
12150
|
+
const theme = useTheme2();
|
|
12151
|
+
return /* @__PURE__ */ jsx124(
|
|
12152
|
+
TableRow,
|
|
12153
|
+
{
|
|
12154
|
+
animate: {
|
|
12155
|
+
backgroundColor: "transparent"
|
|
12156
|
+
},
|
|
12157
|
+
component: motion.tr,
|
|
12158
|
+
initial: {
|
|
12159
|
+
backgroundColor: theme.palette.mode === "light" ? newSpanBackgroundColor.light : newSpanBackgroundColor.dark
|
|
12160
|
+
},
|
|
12161
|
+
sx: {
|
|
12162
|
+
transition: "background-color 1200ms ease-in"
|
|
12163
|
+
},
|
|
12164
|
+
children: row.getVisibleCells().map((cell) => {
|
|
12165
|
+
return /* @__PURE__ */ jsx124(
|
|
12166
|
+
TableCell,
|
|
12167
|
+
{
|
|
12168
|
+
sx: {
|
|
12169
|
+
height: 36,
|
|
12170
|
+
maxWidth: `${cell.column.getSize().toString()}px`,
|
|
12171
|
+
minWidth: `${cell.column.getSize().toString()}px`
|
|
12172
|
+
},
|
|
12173
|
+
children: /* @__PURE__ */ jsx124(
|
|
12174
|
+
Box3,
|
|
12175
|
+
{
|
|
12176
|
+
sx: {
|
|
12177
|
+
"alignItems": "center",
|
|
12178
|
+
"display": "flex",
|
|
12179
|
+
"flex-direction": "row",
|
|
12180
|
+
"height": "100%",
|
|
12181
|
+
"tr:hover &": {
|
|
12182
|
+
backgroundColor: (theme2) => theme2.palette.action.hover
|
|
12183
|
+
},
|
|
12184
|
+
"width": "100%"
|
|
12185
|
+
},
|
|
12186
|
+
children: /* @__PURE__ */ jsx124(Box3, { sx: { px: 1, width: "100%" }, children: flexRender(cell.column.columnDef.cell, cell.getContext()) })
|
|
12187
|
+
}
|
|
12188
|
+
)
|
|
12189
|
+
},
|
|
12190
|
+
cell.id
|
|
12191
|
+
);
|
|
12192
|
+
})
|
|
12193
|
+
},
|
|
12194
|
+
row.original.span_id
|
|
12195
|
+
);
|
|
12196
|
+
},
|
|
12197
|
+
// Since spans are immutable, we can cache this component by the span ID
|
|
12198
|
+
(previous, next) => previous.row.original.span_id === next.row.original.span_id
|
|
12199
|
+
);
|
|
12148
12200
|
var SpansDataGrid = ({
|
|
12149
12201
|
clearingSpans,
|
|
12150
12202
|
fetchingBackward,
|
|
12151
|
-
fetchingForward,
|
|
12152
12203
|
hasMoreBackward,
|
|
12153
12204
|
hasMoreForward,
|
|
12154
12205
|
onClearSpans,
|
|
12155
12206
|
onFetchBackward,
|
|
12156
|
-
onFetchForward,
|
|
12157
12207
|
onSpanClick,
|
|
12158
12208
|
spans
|
|
12159
12209
|
}) => {
|
|
@@ -12191,6 +12241,16 @@ var SpansDataGrid = ({
|
|
|
12191
12241
|
size: 180
|
|
12192
12242
|
}),
|
|
12193
12243
|
columnHelper.accessor("operation_name", {
|
|
12244
|
+
cell: (props) => /* @__PURE__ */ jsx124(
|
|
12245
|
+
Box3,
|
|
12246
|
+
{
|
|
12247
|
+
sx: {
|
|
12248
|
+
overflow: "hidden",
|
|
12249
|
+
textOverflow: "ellipsis"
|
|
12250
|
+
},
|
|
12251
|
+
children: /* @__PURE__ */ jsx124("span", { title: props.getValue(), children: props.getValue() })
|
|
12252
|
+
}
|
|
12253
|
+
),
|
|
12194
12254
|
header: "Action",
|
|
12195
12255
|
id: "operationName",
|
|
12196
12256
|
size: 96
|
|
@@ -12231,7 +12291,6 @@ var SpansDataGrid = ({
|
|
|
12231
12291
|
const columnCount = table.getAllColumns().length;
|
|
12232
12292
|
const rows = table.getRowModel().rows;
|
|
12233
12293
|
const hasRows = rows.length > 0;
|
|
12234
|
-
const theme = useTheme2();
|
|
12235
12294
|
return /* @__PURE__ */ jsxs120(Fragment3, { children: [
|
|
12236
12295
|
/* @__PURE__ */ jsx124(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "center", display: "flex", gap: "0.5rem" }, children: [
|
|
12237
12296
|
/* @__PURE__ */ jsx124(Box3, { sx: { flexGrow: 1 } }),
|
|
@@ -12293,74 +12352,20 @@ var SpansDataGrid = ({
|
|
|
12293
12352
|
/* @__PURE__ */ jsxs120(TableBody, { children: [
|
|
12294
12353
|
spans === void 0 && /* @__PURE__ */ jsx124(TableRow, { children: /* @__PURE__ */ jsx124(TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx124(CircularProgress, { size: 48, sx: { m: 4 } }) }) }),
|
|
12295
12354
|
spans?.length === 0 && /* @__PURE__ */ jsx124(TableRow, { children: /* @__PURE__ */ jsx124(TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx124("span", { children: "There are no spans" }) }) }),
|
|
12355
|
+
hasRows && !hasMoreBackward && /* @__PURE__ */ jsx124(TableRow, { children: /* @__PURE__ */ jsx124(TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx124("span", { children: "This is the beginning of the stream" }) }) }),
|
|
12296
12356
|
hasRows && hasMoreBackward && /* @__PURE__ */ jsx124(TableRow, { children: /* @__PURE__ */ jsxs120(TableCell, { colSpan: columnCount, sx: { textAlign: "center" }, children: [
|
|
12297
|
-
!fetchingBackward &&
|
|
12357
|
+
!fetchingBackward && /* @__PURE__ */ jsx124(
|
|
12298
12358
|
Button,
|
|
12299
12359
|
{
|
|
12300
12360
|
onClick: onFetchBackward,
|
|
12301
12361
|
sx: { my: 1 },
|
|
12302
|
-
children: "Load newer spans"
|
|
12303
|
-
}
|
|
12304
|
-
),
|
|
12305
|
-
(fetchingBackward || fetchingForward) && /* @__PURE__ */ jsx124(CircularProgress, { size: 24, sx: { m: 2 } })
|
|
12306
|
-
] }) }),
|
|
12307
|
-
hasRows && /* @__PURE__ */ jsx124(AnimatePresence, { initial: false, children: rows.map((row) => /* @__PURE__ */ jsx124(
|
|
12308
|
-
TableRow,
|
|
12309
|
-
{
|
|
12310
|
-
animate: {
|
|
12311
|
-
backgroundColor: "transparent"
|
|
12312
|
-
},
|
|
12313
|
-
component: motion.tr,
|
|
12314
|
-
initial: {
|
|
12315
|
-
backgroundColor: theme.palette.mode === "light" ? newSpanBackgroundColor.light : newSpanBackgroundColor.dark
|
|
12316
|
-
},
|
|
12317
|
-
sx: {
|
|
12318
|
-
transition: "background-color 1200ms ease-in"
|
|
12319
|
-
},
|
|
12320
|
-
children: row.getVisibleCells().map((cell) => {
|
|
12321
|
-
return /* @__PURE__ */ jsx124(
|
|
12322
|
-
TableCell,
|
|
12323
|
-
{
|
|
12324
|
-
sx: {
|
|
12325
|
-
height: 36,
|
|
12326
|
-
maxWidth: `${cell.column.getSize().toString()}px`,
|
|
12327
|
-
minWidth: `${cell.column.getSize().toString()}px`
|
|
12328
|
-
},
|
|
12329
|
-
children: /* @__PURE__ */ jsx124(
|
|
12330
|
-
Box3,
|
|
12331
|
-
{
|
|
12332
|
-
sx: {
|
|
12333
|
-
"alignItems": "center",
|
|
12334
|
-
"display": "flex",
|
|
12335
|
-
"flex-direction": "row",
|
|
12336
|
-
"height": "100%",
|
|
12337
|
-
"tr:hover &": {
|
|
12338
|
-
backgroundColor: (theme2) => theme2.palette.action.hover
|
|
12339
|
-
},
|
|
12340
|
-
"width": "100%"
|
|
12341
|
-
},
|
|
12342
|
-
children: /* @__PURE__ */ jsx124(Box3, { sx: { px: 1, width: "100%" }, children: flexRender(cell.column.columnDef.cell, cell.getContext()) })
|
|
12343
|
-
}
|
|
12344
|
-
)
|
|
12345
|
-
},
|
|
12346
|
-
cell.id
|
|
12347
|
-
);
|
|
12348
|
-
})
|
|
12349
|
-
},
|
|
12350
|
-
row.original.span_id
|
|
12351
|
-
)) }),
|
|
12352
|
-
hasRows && hasMoreForward && /* @__PURE__ */ jsx124(TableRow, { children: /* @__PURE__ */ jsxs120(TableCell, { colSpan: columnCount, sx: { textAlign: "center" }, children: [
|
|
12353
|
-
!fetchingBackward && !fetchingForward && /* @__PURE__ */ jsx124(
|
|
12354
|
-
Button,
|
|
12355
|
-
{
|
|
12356
|
-
onClick: onFetchForward,
|
|
12357
|
-
sx: { my: 1 },
|
|
12358
12362
|
children: "Load older spans"
|
|
12359
12363
|
}
|
|
12360
12364
|
),
|
|
12361
|
-
|
|
12365
|
+
fetchingBackward && /* @__PURE__ */ jsx124(CircularProgress, { size: 24, sx: { m: 2 } })
|
|
12362
12366
|
] }) }),
|
|
12363
|
-
hasRows &&
|
|
12367
|
+
hasRows && /* @__PURE__ */ jsx124(AnimatePresence, { initial: false, children: rows.map((row) => /* @__PURE__ */ jsx124(SpansDataGridRow, { row }, row.original.span_id)) }),
|
|
12368
|
+
hasRows && !hasMoreForward && /* @__PURE__ */ jsx124(TableRow, { children: /* @__PURE__ */ jsx124(TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx124("span", { children: "This is the end of the stream" }) }) })
|
|
12364
12369
|
] })
|
|
12365
12370
|
]
|
|
12366
12371
|
}
|
|
@@ -12377,7 +12382,7 @@ var SpansList = (props) => {
|
|
|
12377
12382
|
props.fetchError && /* @__PURE__ */ jsxs121(
|
|
12378
12383
|
Alert,
|
|
12379
12384
|
{
|
|
12380
|
-
action: /* @__PURE__ */ jsx125(Button2, { onClick: props.
|
|
12385
|
+
action: /* @__PURE__ */ jsx125(Button2, { onClick: props.onFetchForward, children: "Retry" }),
|
|
12381
12386
|
severity: "error",
|
|
12382
12387
|
children: [
|
|
12383
12388
|
"Unexpected error:",
|
|
@@ -12397,7 +12402,6 @@ var SpansList = (props) => {
|
|
|
12397
12402
|
onClearSpans: props.onClearSpans,
|
|
12398
12403
|
onFetchBackward: props.onFetchBackward,
|
|
12399
12404
|
onFetchForward: props.onFetchForward,
|
|
12400
|
-
onRefresh: props.onRefresh,
|
|
12401
12405
|
onSpanClick: props.onSpanClick,
|
|
12402
12406
|
refetching: props.refetching,
|
|
12403
12407
|
spans: props.spans
|
|
@@ -12731,7 +12735,7 @@ var useStatus = () => {
|
|
|
12731
12735
|
const hasFetchedReference = useRef8(false);
|
|
12732
12736
|
const abortControllerReference = useRef8(null);
|
|
12733
12737
|
const checkStatus = useCallback3(async () => {
|
|
12734
|
-
if (abortControllerReference.current) {
|
|
12738
|
+
if (abortControllerReference.current !== null) {
|
|
12735
12739
|
abortControllerReference.current.abort();
|
|
12736
12740
|
}
|
|
12737
12741
|
const abortController = new AbortController();
|
|
@@ -12764,26 +12768,53 @@ var useStatus = () => {
|
|
|
12764
12768
|
};
|
|
12765
12769
|
|
|
12766
12770
|
// src/utils/pagination-buffer.ts
|
|
12771
|
+
var insertSorted = (array, item, compareFunction, hint = "back") => {
|
|
12772
|
+
let left;
|
|
12773
|
+
let right;
|
|
12774
|
+
if (hint === "back") {
|
|
12775
|
+
left = array.length;
|
|
12776
|
+
right = array.length;
|
|
12777
|
+
let step = 1;
|
|
12778
|
+
while (left > 0 && compareFunction(array[left - 1], item) > 0) {
|
|
12779
|
+
right = left;
|
|
12780
|
+
left = Math.max(0, left - step);
|
|
12781
|
+
step *= 2;
|
|
12782
|
+
}
|
|
12783
|
+
} else {
|
|
12784
|
+
left = 0;
|
|
12785
|
+
right = 0;
|
|
12786
|
+
let step = 1;
|
|
12787
|
+
while (right < array.length && compareFunction(array[right], item) <= 0) {
|
|
12788
|
+
left = right + 1;
|
|
12789
|
+
right = Math.min(array.length, right + step);
|
|
12790
|
+
step *= 2;
|
|
12791
|
+
}
|
|
12792
|
+
}
|
|
12793
|
+
while (left < right) {
|
|
12794
|
+
const mid = left + right >>> 1;
|
|
12795
|
+
if (compareFunction(array[mid], item) <= 0) {
|
|
12796
|
+
left = mid + 1;
|
|
12797
|
+
} else {
|
|
12798
|
+
right = mid;
|
|
12799
|
+
}
|
|
12800
|
+
}
|
|
12801
|
+
array.splice(left, 0, item);
|
|
12802
|
+
};
|
|
12767
12803
|
var createPaginationBuffer = (options) => {
|
|
12768
|
-
const { fetchPage
|
|
12769
|
-
|
|
12770
|
-
|
|
12804
|
+
const { fetchPage } = options;
|
|
12805
|
+
let items = void 0;
|
|
12806
|
+
let nextForwardToken;
|
|
12807
|
+
let nextBackwardToken;
|
|
12808
|
+
let hasMoreForward = void 0;
|
|
12809
|
+
let hasMoreBackward = void 0;
|
|
12771
12810
|
let fetchingForward = false;
|
|
12772
12811
|
let fetchingBackward = false;
|
|
12773
|
-
|
|
12774
|
-
const hasMoreBackward = () => {
|
|
12775
|
-
const firstPage = pages2[0];
|
|
12776
|
-
return firstPage?.hasMoreBackward;
|
|
12777
|
-
};
|
|
12778
|
-
const hasMoreForward = () => {
|
|
12779
|
-
const lastPage = pages2.at(-1);
|
|
12780
|
-
return lastPage?.hasMoreForward;
|
|
12781
|
-
};
|
|
12812
|
+
const refetching = false;
|
|
12782
12813
|
const reportDataChange = () => {
|
|
12783
12814
|
options.onDataChange({
|
|
12784
|
-
hasMoreBackward: hasMoreBackward
|
|
12785
|
-
hasMoreForward: hasMoreForward
|
|
12786
|
-
items:
|
|
12815
|
+
hasMoreBackward: hasMoreBackward ?? false,
|
|
12816
|
+
hasMoreForward: hasMoreForward ?? false,
|
|
12817
|
+
items: items ?? []
|
|
12787
12818
|
});
|
|
12788
12819
|
};
|
|
12789
12820
|
const reportStatusChange = () => {
|
|
@@ -12798,35 +12829,24 @@ var createPaginationBuffer = (options) => {
|
|
|
12798
12829
|
};
|
|
12799
12830
|
let fetchForwardLater = false;
|
|
12800
12831
|
let fetchBackwardLater = false;
|
|
12801
|
-
let refetchCurrentLater = false;
|
|
12802
12832
|
const fetchForward = async () => {
|
|
12803
12833
|
fetchingForward = true;
|
|
12804
12834
|
reportStatusChange();
|
|
12805
12835
|
try {
|
|
12806
|
-
const
|
|
12807
|
-
|
|
12808
|
-
|
|
12809
|
-
|
|
12810
|
-
|
|
12811
|
-
|
|
12812
|
-
|
|
12813
|
-
pages2.push({
|
|
12814
|
-
hasMoreBackward: newPage.hasMoreBackward,
|
|
12815
|
-
hasMoreForward: newPage.hasMoreForward,
|
|
12816
|
-
items: newPage.items,
|
|
12817
|
-
nextBackwardToken: newPage.nextBackwardToken,
|
|
12818
|
-
nextForwardToken: newPage.nextForwardToken,
|
|
12819
|
-
token,
|
|
12820
|
-
tokenDirection: "forward"
|
|
12821
|
-
});
|
|
12822
|
-
if (pages2.length > 3) {
|
|
12823
|
-
const removedPage = pages2.shift();
|
|
12824
|
-
if (removedPage) {
|
|
12825
|
-
items.splice(0, removedPage.items.length);
|
|
12826
|
-
}
|
|
12836
|
+
const newPage = await fetchPage(nextForwardToken);
|
|
12837
|
+
if (options.sortComparator === void 0) {
|
|
12838
|
+
items = [...items ?? [], ...newPage.items];
|
|
12839
|
+
} else {
|
|
12840
|
+
const merged = [...items ?? []];
|
|
12841
|
+
for (const item of newPage.items.toSorted(options.sortComparator)) {
|
|
12842
|
+
insertSorted(merged, item, options.sortComparator, "back");
|
|
12827
12843
|
}
|
|
12844
|
+
items = merged;
|
|
12828
12845
|
}
|
|
12829
|
-
|
|
12846
|
+
hasMoreForward = newPage.hasMoreForward;
|
|
12847
|
+
nextForwardToken = newPage.nextForwardToken;
|
|
12848
|
+
hasMoreBackward ??= newPage.hasMoreBackward;
|
|
12849
|
+
nextBackwardToken ??= newPage.nextBackwardToken;
|
|
12830
12850
|
reportDataChange();
|
|
12831
12851
|
} catch (error) {
|
|
12832
12852
|
reportError(error instanceof Error ? error : new Error("Failed to fetch forward page", { cause: error }));
|
|
@@ -12840,32 +12860,20 @@ var createPaginationBuffer = (options) => {
|
|
|
12840
12860
|
fetchingBackward = true;
|
|
12841
12861
|
reportStatusChange();
|
|
12842
12862
|
try {
|
|
12843
|
-
const
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12847
|
-
|
|
12848
|
-
|
|
12849
|
-
|
|
12850
|
-
} else if (newPage.items.length > 0) {
|
|
12851
|
-
pages2.unshift({
|
|
12852
|
-
hasMoreBackward: newPage.hasMoreBackward,
|
|
12853
|
-
hasMoreForward: newPage.hasMoreForward,
|
|
12854
|
-
items: newPage.items,
|
|
12855
|
-
nextBackwardToken: newPage.nextBackwardToken,
|
|
12856
|
-
nextForwardToken: newPage.nextForwardToken,
|
|
12857
|
-
token,
|
|
12858
|
-
// If no token was used, the default direction is forward.
|
|
12859
|
-
tokenDirection: token ? "backward" : "forward"
|
|
12860
|
-
});
|
|
12861
|
-
if (pages2.length > 3) {
|
|
12862
|
-
const removedPage = pages2.pop();
|
|
12863
|
-
if (removedPage) {
|
|
12864
|
-
items.splice(items.length - removedPage.items.length, removedPage.items.length);
|
|
12865
|
-
}
|
|
12863
|
+
const newPage = await fetchPage(nextBackwardToken);
|
|
12864
|
+
if (options.sortComparator === void 0) {
|
|
12865
|
+
items = [...newPage.items, ...items ?? []];
|
|
12866
|
+
} else {
|
|
12867
|
+
const merged = [...items ?? []];
|
|
12868
|
+
for (const item of newPage.items.toSorted(options.sortComparator)) {
|
|
12869
|
+
insertSorted(merged, item, options.sortComparator, "front");
|
|
12866
12870
|
}
|
|
12867
|
-
items
|
|
12871
|
+
items = merged;
|
|
12868
12872
|
}
|
|
12873
|
+
hasMoreBackward = newPage.hasMoreBackward;
|
|
12874
|
+
nextBackwardToken = newPage.nextBackwardToken;
|
|
12875
|
+
hasMoreForward ??= newPage.hasMoreForward;
|
|
12876
|
+
nextForwardToken ??= newPage.nextForwardToken;
|
|
12869
12877
|
reportDataChange();
|
|
12870
12878
|
} catch (error) {
|
|
12871
12879
|
reportError(error instanceof Error ? error : new Error("Failed to fetch forward page", { cause: error }));
|
|
@@ -12875,62 +12883,6 @@ var createPaginationBuffer = (options) => {
|
|
|
12875
12883
|
}
|
|
12876
12884
|
runPostFetchActions();
|
|
12877
12885
|
};
|
|
12878
|
-
const refetchCurrent = async () => {
|
|
12879
|
-
if (pages2.length === 0) {
|
|
12880
|
-
await fetchForward();
|
|
12881
|
-
return;
|
|
12882
|
-
}
|
|
12883
|
-
refetching = true;
|
|
12884
|
-
reportStatusChange();
|
|
12885
|
-
try {
|
|
12886
|
-
const backwardIndex = pages2.findLastIndex((page) => page.tokenDirection === "backward");
|
|
12887
|
-
const backwardPage = backwardIndex === -1 ? void 0 : pages2[backwardIndex];
|
|
12888
|
-
const backwardPageCount = backwardIndex + 1;
|
|
12889
|
-
const forwardIndex = pages2.findIndex((page) => page.tokenDirection === "forward");
|
|
12890
|
-
const forwardPage = forwardIndex === -1 ? void 0 : pages2[forwardIndex];
|
|
12891
|
-
const forwardPageCount = forwardIndex === -1 ? 0 : pages2.length - forwardIndex;
|
|
12892
|
-
const [backwardResponse, forwardResponse] = await Promise.all([
|
|
12893
|
-
backwardPageCount > 0 ? fetchPage(backwardPage?.token, pageSize * backwardPageCount) : void 0,
|
|
12894
|
-
forwardPageCount > 0 ? fetchPage(forwardPage?.token, pageSize * forwardPageCount) : void 0
|
|
12895
|
-
]);
|
|
12896
|
-
pages2.length = 0;
|
|
12897
|
-
items.length = 0;
|
|
12898
|
-
if (backwardResponse) {
|
|
12899
|
-
pages2.push({
|
|
12900
|
-
hasMoreBackward: backwardResponse.hasMoreBackward,
|
|
12901
|
-
hasMoreForward: backwardResponse.hasMoreForward,
|
|
12902
|
-
items: backwardResponse.items,
|
|
12903
|
-
nextBackwardToken: backwardResponse.nextBackwardToken,
|
|
12904
|
-
nextForwardToken: backwardResponse.nextForwardToken,
|
|
12905
|
-
token: backwardPage?.token,
|
|
12906
|
-
tokenDirection: "backward"
|
|
12907
|
-
});
|
|
12908
|
-
items.push(...backwardResponse.items);
|
|
12909
|
-
}
|
|
12910
|
-
if (forwardResponse) {
|
|
12911
|
-
pages2.push({
|
|
12912
|
-
hasMoreBackward: forwardResponse.hasMoreBackward,
|
|
12913
|
-
hasMoreForward: forwardResponse.hasMoreForward,
|
|
12914
|
-
items: forwardResponse.items,
|
|
12915
|
-
nextBackwardToken: forwardResponse.nextBackwardToken,
|
|
12916
|
-
nextForwardToken: forwardResponse.nextForwardToken,
|
|
12917
|
-
token: forwardPage?.token,
|
|
12918
|
-
tokenDirection: "forward"
|
|
12919
|
-
});
|
|
12920
|
-
items.push(...forwardResponse.items);
|
|
12921
|
-
}
|
|
12922
|
-
reportDataChange();
|
|
12923
|
-
if (hasMoreForward() === false) {
|
|
12924
|
-
fetchForwardLater = true;
|
|
12925
|
-
}
|
|
12926
|
-
} catch (error) {
|
|
12927
|
-
reportError(error instanceof Error ? error : new Error("Failed to fetch forward page", { cause: error }));
|
|
12928
|
-
} finally {
|
|
12929
|
-
refetching = false;
|
|
12930
|
-
reportStatusChange();
|
|
12931
|
-
}
|
|
12932
|
-
runPostFetchActions();
|
|
12933
|
-
};
|
|
12934
12886
|
const runPostFetchActions = () => {
|
|
12935
12887
|
if (fetchBackwardLater) {
|
|
12936
12888
|
fetchBackwardLater = false;
|
|
@@ -12940,41 +12892,25 @@ var createPaginationBuffer = (options) => {
|
|
|
12940
12892
|
fetchForwardLater = false;
|
|
12941
12893
|
void fetchForward();
|
|
12942
12894
|
}
|
|
12943
|
-
if (refetchCurrentLater) {
|
|
12944
|
-
refetchCurrentLater = false;
|
|
12945
|
-
void refetchCurrent();
|
|
12946
|
-
}
|
|
12947
12895
|
};
|
|
12948
12896
|
return {
|
|
12897
|
+
clear: () => {
|
|
12898
|
+
if (items !== void 0) {
|
|
12899
|
+
items.length = 0;
|
|
12900
|
+
reportDataChange();
|
|
12901
|
+
}
|
|
12902
|
+
},
|
|
12949
12903
|
fetchBackward: () => {
|
|
12950
12904
|
if (fetchingForward || fetchingBackward) {
|
|
12951
12905
|
return;
|
|
12952
12906
|
}
|
|
12953
|
-
if (refetching) {
|
|
12954
|
-
fetchBackwardLater = true;
|
|
12955
|
-
return;
|
|
12956
|
-
}
|
|
12957
12907
|
void fetchBackward();
|
|
12958
12908
|
},
|
|
12959
12909
|
fetchForward: () => {
|
|
12960
12910
|
if (fetchingForward || fetchingBackward) {
|
|
12961
12911
|
return;
|
|
12962
12912
|
}
|
|
12963
|
-
if (refetching) {
|
|
12964
|
-
fetchForwardLater = true;
|
|
12965
|
-
return;
|
|
12966
|
-
}
|
|
12967
12913
|
void fetchForward();
|
|
12968
|
-
},
|
|
12969
|
-
refetchCurrent: () => {
|
|
12970
|
-
if (fetchingForward || fetchingBackward || refetching) {
|
|
12971
|
-
refetchCurrentLater = true;
|
|
12972
|
-
return;
|
|
12973
|
-
}
|
|
12974
|
-
if (refetchCurrentLater) {
|
|
12975
|
-
return;
|
|
12976
|
-
}
|
|
12977
|
-
void refetchCurrent();
|
|
12978
12914
|
}
|
|
12979
12915
|
};
|
|
12980
12916
|
};
|
|
@@ -13266,7 +13202,7 @@ function useSpansWebSocket(options) {
|
|
|
13266
13202
|
}
|
|
13267
13203
|
|
|
13268
13204
|
// src/hooks/use-spans.ts
|
|
13269
|
-
var PAGE_SIZE =
|
|
13205
|
+
var PAGE_SIZE = 30;
|
|
13270
13206
|
var useSpans = () => {
|
|
13271
13207
|
const api = useAppInspectorApi();
|
|
13272
13208
|
const [spans, setSpans] = useState6();
|
|
@@ -13275,9 +13211,9 @@ var useSpans = () => {
|
|
|
13275
13211
|
const [fetchingBackward, setFetchingBackward] = useState6(false);
|
|
13276
13212
|
const [refetching, setRefetching] = useState6(false);
|
|
13277
13213
|
const paginationBuffer = useRef10(createPaginationBuffer({
|
|
13278
|
-
async fetchPage(token
|
|
13214
|
+
async fetchPage(token) {
|
|
13279
13215
|
const response = await api.getSpans({
|
|
13280
|
-
limit,
|
|
13216
|
+
limit: PAGE_SIZE,
|
|
13281
13217
|
pagination_token: token
|
|
13282
13218
|
});
|
|
13283
13219
|
return {
|
|
@@ -13289,6 +13225,7 @@ var useSpans = () => {
|
|
|
13289
13225
|
};
|
|
13290
13226
|
},
|
|
13291
13227
|
onDataChange: ({ hasMoreBackward: hasMoreBackward2, hasMoreForward: hasMoreForward2, items }) => {
|
|
13228
|
+
setFetchError(void 0);
|
|
13292
13229
|
setSpans(items);
|
|
13293
13230
|
setHasMoreBackward(hasMoreBackward2);
|
|
13294
13231
|
setHasMoreForward(hasMoreForward2);
|
|
@@ -13301,7 +13238,12 @@ var useSpans = () => {
|
|
|
13301
13238
|
setFetchingForward(status2.fetchingForward);
|
|
13302
13239
|
setRefetching(status2.refetching);
|
|
13303
13240
|
},
|
|
13304
|
-
|
|
13241
|
+
// The spans endpoint is sorted by span ingestion time, which might differ from
|
|
13242
|
+
// the span timestamp. In order to accomodate for this, we will sort the spans
|
|
13243
|
+
// in the frontend with the following sort comparator.
|
|
13244
|
+
sortComparator(a2, b2) {
|
|
13245
|
+
return a2.start_time_unix_nano < b2.start_time_unix_nano ? -1 : 1;
|
|
13246
|
+
}
|
|
13305
13247
|
}));
|
|
13306
13248
|
const [hasMoreBackward, setHasMoreBackward] = useState6();
|
|
13307
13249
|
const [hasMoreForward, setHasMoreForward] = useState6();
|
|
@@ -13315,28 +13257,22 @@ var useSpans = () => {
|
|
|
13315
13257
|
fetchForward();
|
|
13316
13258
|
}, [fetchForward]);
|
|
13317
13259
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
13318
|
-
const refreshSpans = useCallback6(() => {
|
|
13319
|
-
paginationBuffer.current.refetchCurrent();
|
|
13320
|
-
}, []);
|
|
13321
|
-
useEffect13(() => {
|
|
13322
|
-
refreshSpans();
|
|
13323
|
-
}, [refreshSpans]);
|
|
13324
13260
|
const [clearingSpans, setClearingSpans] = useState6(false);
|
|
13325
13261
|
const clearSpans = useCallback6(async () => {
|
|
13326
13262
|
setClearingSpans(true);
|
|
13327
13263
|
try {
|
|
13328
13264
|
await api.deleteSpans();
|
|
13329
|
-
|
|
13265
|
+
paginationBuffer.current.clear();
|
|
13330
13266
|
} catch (error) {
|
|
13331
13267
|
console.error("Failed to delete spans:", error);
|
|
13332
13268
|
setFetchError(error instanceof Error ? error : new Error("Failed to delete spans", { cause: error }));
|
|
13333
13269
|
} finally {
|
|
13334
13270
|
setClearingSpans(false);
|
|
13335
13271
|
}
|
|
13336
|
-
}, [
|
|
13272
|
+
}, [paginationBuffer, api]);
|
|
13337
13273
|
useSpansWebSocket({
|
|
13338
13274
|
onMessage: () => {
|
|
13339
|
-
|
|
13275
|
+
paginationBuffer.current.fetchForward();
|
|
13340
13276
|
}
|
|
13341
13277
|
});
|
|
13342
13278
|
return {
|
|
@@ -13351,7 +13287,6 @@ var useSpans = () => {
|
|
|
13351
13287
|
hasMoreBackward,
|
|
13352
13288
|
hasMoreForward,
|
|
13353
13289
|
refetching,
|
|
13354
|
-
refreshSpans,
|
|
13355
13290
|
spans,
|
|
13356
13291
|
status,
|
|
13357
13292
|
statusError
|
|
@@ -14209,7 +14144,7 @@ import { useEffect as useEffect15, useState as useState10 } from "react";
|
|
|
14209
14144
|
import { Box as Box15, Stack as Stack2, Typography as Typography10 } from "@mui/material";
|
|
14210
14145
|
import "@xyflow/react/dist/style.css";
|
|
14211
14146
|
import { Handle, Position } from "@xyflow/react";
|
|
14212
|
-
import { memo as
|
|
14147
|
+
import { memo as memo9 } from "react";
|
|
14213
14148
|
|
|
14214
14149
|
// src/components/trace-graph/problem-indicator.tsx
|
|
14215
14150
|
import { Error as ErrorIcon2, Info as Info2, Warning as Warning2 } from "@mui/icons-material";
|
|
@@ -14269,7 +14204,7 @@ var handleStyle = {
|
|
|
14269
14204
|
borderColor: "lightgray",
|
|
14270
14205
|
opacity: 0
|
|
14271
14206
|
};
|
|
14272
|
-
var ServiceNode =
|
|
14207
|
+
var ServiceNode = memo9(({ data, selected }) => {
|
|
14273
14208
|
const hasErrors = (data.event.errors && data.event.errors.length > 0) ?? false;
|
|
14274
14209
|
return /* @__PURE__ */ jsxs130(Box15, { sx: { maxWidth: 200 }, children: [
|
|
14275
14210
|
/* @__PURE__ */ jsxs130(
|
|
@@ -14435,7 +14370,7 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
|
|
|
14435
14370
|
import { Add, FitScreen, Remove } from "@mui/icons-material";
|
|
14436
14371
|
import { Box as Box16, IconButton as IconButton4 } from "@mui/material";
|
|
14437
14372
|
import { useReactFlow, useStore } from "@xyflow/react";
|
|
14438
|
-
import { memo as
|
|
14373
|
+
import { memo as memo10 } from "react";
|
|
14439
14374
|
|
|
14440
14375
|
// node_modules/zustand/esm/shallow.mjs
|
|
14441
14376
|
function shallow$1(objA, objB) {
|
|
@@ -14482,7 +14417,7 @@ var selector = (s) => ({
|
|
|
14482
14417
|
maxZoomReached: s.transform[2] >= s.maxZoom,
|
|
14483
14418
|
minZoomReached: s.transform[2] <= s.minZoom
|
|
14484
14419
|
});
|
|
14485
|
-
var Controls =
|
|
14420
|
+
var Controls = memo10(() => {
|
|
14486
14421
|
const { maxZoomReached, minZoomReached } = useStore(selector, shallow$1);
|
|
14487
14422
|
const { fitView, zoomIn, zoomOut } = useReactFlow();
|
|
14488
14423
|
const onZoomInHandler = () => {
|
|
@@ -14877,7 +14812,6 @@ var SpansListPage = () => {
|
|
|
14877
14812
|
hasMoreBackward,
|
|
14878
14813
|
hasMoreForward,
|
|
14879
14814
|
refetching,
|
|
14880
|
-
refreshSpans,
|
|
14881
14815
|
spans,
|
|
14882
14816
|
status,
|
|
14883
14817
|
statusError
|
|
@@ -14930,7 +14864,6 @@ var SpansListPage = () => {
|
|
|
14930
14864
|
onClearSpans: clearSpansSync,
|
|
14931
14865
|
onFetchBackward: fetchBackward,
|
|
14932
14866
|
onFetchForward: fetchForward,
|
|
14933
|
-
onRefresh: refreshSpans,
|
|
14934
14867
|
onSpanClick: navigateToSpan,
|
|
14935
14868
|
refetching,
|
|
14936
14869
|
spans
|