@localstack/appinspector-ui 1.0.52 → 1.0.53
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 +106 -187
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +61 -143
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -58,7 +58,7 @@ var init_is_prop_valid_esm = __esm({
|
|
|
58
58
|
|
|
59
59
|
// src/pages/spans-list-page.tsx
|
|
60
60
|
import { Box as Box18 } from "@mui/material";
|
|
61
|
-
import { useCallback as
|
|
61
|
+
import { useCallback as useCallback8, useState as useState12 } from "react";
|
|
62
62
|
|
|
63
63
|
// src/components/spans-list/spans-list.tsx
|
|
64
64
|
import { Alert, Box as Box4, Button as Button2 } from "@mui/material";
|
|
@@ -72,7 +72,6 @@ import {
|
|
|
72
72
|
FormControlLabel,
|
|
73
73
|
Grid,
|
|
74
74
|
Paper,
|
|
75
|
-
Switch,
|
|
76
75
|
Table,
|
|
77
76
|
TableBody,
|
|
78
77
|
TableCell,
|
|
@@ -12152,11 +12151,9 @@ var SpansDataGrid = ({
|
|
|
12152
12151
|
fetchingForward,
|
|
12153
12152
|
hasMoreBackward,
|
|
12154
12153
|
hasMoreForward,
|
|
12155
|
-
includeReadOperations = false,
|
|
12156
12154
|
onClearSpans,
|
|
12157
12155
|
onFetchBackward,
|
|
12158
12156
|
onFetchForward,
|
|
12159
|
-
onIncludeReadOperationsChange,
|
|
12160
12157
|
onSpanClick,
|
|
12161
12158
|
spans
|
|
12162
12159
|
}) => {
|
|
@@ -12238,22 +12235,6 @@ var SpansDataGrid = ({
|
|
|
12238
12235
|
return /* @__PURE__ */ jsxs120(Fragment3, { children: [
|
|
12239
12236
|
/* @__PURE__ */ jsx124(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "center", display: "flex", gap: "0.5rem" }, children: [
|
|
12240
12237
|
/* @__PURE__ */ jsx124(Box3, { sx: { flexGrow: 1 } }),
|
|
12241
|
-
/* @__PURE__ */ jsx124(
|
|
12242
|
-
FormControlLabel,
|
|
12243
|
-
{
|
|
12244
|
-
control: /* @__PURE__ */ jsx124(
|
|
12245
|
-
Switch,
|
|
12246
|
-
{
|
|
12247
|
-
checked: includeReadOperations,
|
|
12248
|
-
onChange: (event) => {
|
|
12249
|
-
onIncludeReadOperationsChange(event.target.checked);
|
|
12250
|
-
},
|
|
12251
|
-
size: "small"
|
|
12252
|
-
}
|
|
12253
|
-
),
|
|
12254
|
-
label: "Include Read Operations"
|
|
12255
|
-
}
|
|
12256
|
-
),
|
|
12257
12238
|
/* @__PURE__ */ jsx124(
|
|
12258
12239
|
FormControlLabel,
|
|
12259
12240
|
{
|
|
@@ -12413,11 +12394,9 @@ var SpansList = (props) => {
|
|
|
12413
12394
|
fetchingForward: props.fetchingForward,
|
|
12414
12395
|
hasMoreBackward: props.hasMoreBackward,
|
|
12415
12396
|
hasMoreForward: props.hasMoreForward,
|
|
12416
|
-
includeReadOperations: props.includeReadOperations,
|
|
12417
12397
|
onClearSpans: props.onClearSpans,
|
|
12418
12398
|
onFetchBackward: props.onFetchBackward,
|
|
12419
12399
|
onFetchForward: props.onFetchForward,
|
|
12420
|
-
onIncludeReadOperationsChange: props.onIncludeReadOperationsChange,
|
|
12421
12400
|
onRefresh: props.onRefresh,
|
|
12422
12401
|
onSpanClick: props.onSpanClick,
|
|
12423
12402
|
refetching: props.refetching,
|
|
@@ -12724,59 +12703,8 @@ var StatusMessage = ({
|
|
|
12724
12703
|
return /* @__PURE__ */ jsx126(Fragment4, {});
|
|
12725
12704
|
};
|
|
12726
12705
|
|
|
12727
|
-
// src/hooks/use-local-storage.tsx
|
|
12728
|
-
import { useCallback as useCallback3, useEffect as useEffect11, useState as useState4 } from "react";
|
|
12729
|
-
function useLocalStorage(key, initialValue) {
|
|
12730
|
-
const [storedValue, setStoredValue] = useState4(() => {
|
|
12731
|
-
try {
|
|
12732
|
-
const item = globalThis.localStorage.getItem(key);
|
|
12733
|
-
return item ? JSON.parse(item) : initialValue;
|
|
12734
|
-
} catch (error) {
|
|
12735
|
-
console.error(`Error reading localStorage key "${key}":`, error);
|
|
12736
|
-
return initialValue;
|
|
12737
|
-
}
|
|
12738
|
-
});
|
|
12739
|
-
const setValue = useCallback3((value) => {
|
|
12740
|
-
try {
|
|
12741
|
-
setStoredValue(value);
|
|
12742
|
-
globalThis.localStorage.setItem(key, JSON.stringify(value));
|
|
12743
|
-
globalThis.dispatchEvent(new StorageEvent("storage", {
|
|
12744
|
-
key,
|
|
12745
|
-
newValue: JSON.stringify(value)
|
|
12746
|
-
}));
|
|
12747
|
-
} catch (error) {
|
|
12748
|
-
console.error(`Error setting localStorage key "${key}":`, error);
|
|
12749
|
-
}
|
|
12750
|
-
}, [key]);
|
|
12751
|
-
useEffect11(() => {
|
|
12752
|
-
const handleStorageChange = (event) => {
|
|
12753
|
-
if (event.key === key && event.newValue !== null) {
|
|
12754
|
-
try {
|
|
12755
|
-
setStoredValue(JSON.parse(event.newValue));
|
|
12756
|
-
} catch (error) {
|
|
12757
|
-
console.error(`Error parsing localStorage key "${key}":`, error);
|
|
12758
|
-
}
|
|
12759
|
-
}
|
|
12760
|
-
};
|
|
12761
|
-
globalThis.addEventListener("storage", handleStorageChange);
|
|
12762
|
-
return () => {
|
|
12763
|
-
globalThis.removeEventListener("storage", handleStorageChange);
|
|
12764
|
-
};
|
|
12765
|
-
}, [key]);
|
|
12766
|
-
return [storedValue, setValue];
|
|
12767
|
-
}
|
|
12768
|
-
|
|
12769
|
-
// src/hooks/use-include-read-operations.tsx
|
|
12770
|
-
var useIncludeReadOperations = () => {
|
|
12771
|
-
const [includeReadOperations, setIncludeReadOperations] = useLocalStorage("includeReadOperations", false);
|
|
12772
|
-
return {
|
|
12773
|
-
includeReadOperations,
|
|
12774
|
-
setIncludeReadOperations
|
|
12775
|
-
};
|
|
12776
|
-
};
|
|
12777
|
-
|
|
12778
12706
|
// src/hooks/use-spans.ts
|
|
12779
|
-
import { useCallback as
|
|
12707
|
+
import { useCallback as useCallback6, useEffect as useEffect13, useRef as useRef10, useState as useState6 } from "react";
|
|
12780
12708
|
|
|
12781
12709
|
// src/api/use-api.tsx
|
|
12782
12710
|
import { createContext as createContext7, useContext as useContext14 } from "react";
|
|
@@ -12794,15 +12722,15 @@ var useAppInspectorApi = () => {
|
|
|
12794
12722
|
};
|
|
12795
12723
|
|
|
12796
12724
|
// src/hooks/use-status.tsx
|
|
12797
|
-
import { useCallback as
|
|
12725
|
+
import { useCallback as useCallback3, useEffect as useEffect11, useRef as useRef8, useState as useState4 } from "react";
|
|
12798
12726
|
var useStatus = () => {
|
|
12799
12727
|
const api = useAppInspectorApi();
|
|
12800
|
-
const [checking, setChecking] =
|
|
12801
|
-
const [status, setStatus] =
|
|
12802
|
-
const [error, setError] =
|
|
12728
|
+
const [checking, setChecking] = useState4(true);
|
|
12729
|
+
const [status, setStatus] = useState4();
|
|
12730
|
+
const [error, setError] = useState4();
|
|
12803
12731
|
const hasFetchedReference = useRef8(false);
|
|
12804
12732
|
const abortControllerReference = useRef8(null);
|
|
12805
|
-
const checkStatus =
|
|
12733
|
+
const checkStatus = useCallback3(async () => {
|
|
12806
12734
|
if (abortControllerReference.current) {
|
|
12807
12735
|
abortControllerReference.current.abort();
|
|
12808
12736
|
}
|
|
@@ -12826,7 +12754,7 @@ var useStatus = () => {
|
|
|
12826
12754
|
}
|
|
12827
12755
|
}
|
|
12828
12756
|
}, [api]);
|
|
12829
|
-
|
|
12757
|
+
useEffect11(() => {
|
|
12830
12758
|
if (!hasFetchedReference.current) {
|
|
12831
12759
|
hasFetchedReference.current = true;
|
|
12832
12760
|
void checkStatus();
|
|
@@ -13052,11 +12980,11 @@ var createPaginationBuffer = (options) => {
|
|
|
13052
12980
|
};
|
|
13053
12981
|
|
|
13054
12982
|
// src/hooks/use-spans-ws.tsx
|
|
13055
|
-
import { useCallback as
|
|
12983
|
+
import { useCallback as useCallback5, useEffect as useEffect12, useRef as useRef9, useState as useState5 } from "react";
|
|
13056
12984
|
|
|
13057
12985
|
// src/context.tsx
|
|
13058
12986
|
import { createContext as createContext8, useContext as useContext15 } from "react";
|
|
13059
|
-
import { useCallback as
|
|
12987
|
+
import { useCallback as useCallback4, useMemo as useMemo6 } from "react";
|
|
13060
12988
|
|
|
13061
12989
|
// src/utils/time.ts
|
|
13062
12990
|
function unixNanoToDate(unixNanoString) {
|
|
@@ -13255,7 +13183,7 @@ var AppInspectorContextProvider = (props) => {
|
|
|
13255
13183
|
const api = useMemo6(() => {
|
|
13256
13184
|
return false ? createApiClientMock() : createApiClient({ localstackEndpoint: props.localstackEndpoint });
|
|
13257
13185
|
}, [props.localstackEndpoint]);
|
|
13258
|
-
const resolveLink =
|
|
13186
|
+
const resolveLink = useCallback4(
|
|
13259
13187
|
(options) => {
|
|
13260
13188
|
if (options.to === "settings") {
|
|
13261
13189
|
return `${props.routePrefix}/settings`;
|
|
@@ -13282,14 +13210,14 @@ var AppInspectorContextProvider = (props) => {
|
|
|
13282
13210
|
function useSpansWebSocket(options) {
|
|
13283
13211
|
const { onMessage } = options;
|
|
13284
13212
|
const onMessageRef = useRef9(onMessage);
|
|
13285
|
-
|
|
13213
|
+
useEffect12(() => {
|
|
13286
13214
|
onMessageRef.current = onMessage;
|
|
13287
13215
|
}, [onMessage]);
|
|
13288
|
-
const [connected, setConnected] =
|
|
13216
|
+
const [connected, setConnected] = useState5(false);
|
|
13289
13217
|
const wsRef = useRef9(void 0);
|
|
13290
13218
|
const reconnectRef = useRef9(void 0);
|
|
13291
13219
|
const { localstackEndpoint } = useAppInspector();
|
|
13292
|
-
const connect =
|
|
13220
|
+
const connect = useCallback5(() => {
|
|
13293
13221
|
if (wsRef.current !== void 0) return;
|
|
13294
13222
|
const url = new URL(getAppInspectorApiUrl(localstackEndpoint, API_ENDPOINTS.WEBSOCKET_SPANS));
|
|
13295
13223
|
url.protocol = globalThis.location.protocol === "https:" ? "wss" : "ws";
|
|
@@ -13315,7 +13243,7 @@ function useSpansWebSocket(options) {
|
|
|
13315
13243
|
}
|
|
13316
13244
|
});
|
|
13317
13245
|
}, [localstackEndpoint]);
|
|
13318
|
-
|
|
13246
|
+
useEffect12(() => {
|
|
13319
13247
|
connect();
|
|
13320
13248
|
return () => {
|
|
13321
13249
|
if (reconnectRef.current !== void 0) clearTimeout(reconnectRef.current);
|
|
@@ -13333,19 +13261,16 @@ function useSpansWebSocket(options) {
|
|
|
13333
13261
|
|
|
13334
13262
|
// src/hooks/use-spans.ts
|
|
13335
13263
|
var PAGE_SIZE = 50;
|
|
13336
|
-
var useSpans = (
|
|
13264
|
+
var useSpans = () => {
|
|
13337
13265
|
const api = useAppInspectorApi();
|
|
13338
|
-
const [spans, setSpans] =
|
|
13339
|
-
const
|
|
13340
|
-
|
|
13341
|
-
const [
|
|
13342
|
-
const [
|
|
13343
|
-
const [fetchingBackward, setFetchingBackward] = useState7(false);
|
|
13344
|
-
const [refetching, setRefetching] = useState7(false);
|
|
13266
|
+
const [spans, setSpans] = useState6();
|
|
13267
|
+
const [fetchError, setFetchError] = useState6();
|
|
13268
|
+
const [fetchingForward, setFetchingForward] = useState6(false);
|
|
13269
|
+
const [fetchingBackward, setFetchingBackward] = useState6(false);
|
|
13270
|
+
const [refetching, setRefetching] = useState6(false);
|
|
13345
13271
|
const paginationBuffer = useRef10(createPaginationBuffer({
|
|
13346
13272
|
async fetchPage(token, limit) {
|
|
13347
13273
|
const response = await api.getSpans({
|
|
13348
|
-
is_write_operation: includeReadOperationsRef.current ? void 0 : true,
|
|
13349
13274
|
limit,
|
|
13350
13275
|
pagination_token: token
|
|
13351
13276
|
});
|
|
@@ -13372,26 +13297,26 @@ var useSpans = (options) => {
|
|
|
13372
13297
|
},
|
|
13373
13298
|
pageSize: PAGE_SIZE
|
|
13374
13299
|
}));
|
|
13375
|
-
const [hasMoreBackward, setHasMoreBackward] =
|
|
13376
|
-
const [hasMoreForward, setHasMoreForward] =
|
|
13377
|
-
const fetchForward =
|
|
13300
|
+
const [hasMoreBackward, setHasMoreBackward] = useState6();
|
|
13301
|
+
const [hasMoreForward, setHasMoreForward] = useState6();
|
|
13302
|
+
const fetchForward = useCallback6(() => {
|
|
13378
13303
|
paginationBuffer.current.fetchForward();
|
|
13379
13304
|
}, []);
|
|
13380
|
-
const fetchBackward =
|
|
13305
|
+
const fetchBackward = useCallback6(() => {
|
|
13381
13306
|
paginationBuffer.current.fetchBackward();
|
|
13382
13307
|
}, []);
|
|
13383
|
-
|
|
13308
|
+
useEffect13(() => {
|
|
13384
13309
|
fetchForward();
|
|
13385
13310
|
}, [fetchForward]);
|
|
13386
13311
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
13387
|
-
const refreshSpans =
|
|
13312
|
+
const refreshSpans = useCallback6(() => {
|
|
13388
13313
|
paginationBuffer.current.refetchCurrent();
|
|
13389
13314
|
}, []);
|
|
13390
|
-
|
|
13315
|
+
useEffect13(() => {
|
|
13391
13316
|
refreshSpans();
|
|
13392
|
-
}, [
|
|
13393
|
-
const [clearingSpans, setClearingSpans] =
|
|
13394
|
-
const clearSpans =
|
|
13317
|
+
}, [refreshSpans]);
|
|
13318
|
+
const [clearingSpans, setClearingSpans] = useState6(false);
|
|
13319
|
+
const clearSpans = useCallback6(async () => {
|
|
13395
13320
|
setClearingSpans(true);
|
|
13396
13321
|
try {
|
|
13397
13322
|
await api.deleteSpans();
|
|
@@ -13432,7 +13357,7 @@ import { ArrowBack } from "@mui/icons-material";
|
|
|
13432
13357
|
import { Box as Box17, Button as Button5, Drawer, Paper as Paper2 } from "@mui/material";
|
|
13433
13358
|
import { styled } from "@mui/material/styles";
|
|
13434
13359
|
import { ReactFlowProvider } from "@xyflow/react";
|
|
13435
|
-
import { useCallback as
|
|
13360
|
+
import { useCallback as useCallback7, useEffect as useEffect16, useRef as useRef12, useState as useState11 } from "react";
|
|
13436
13361
|
|
|
13437
13362
|
// src/components/event-details/event-details.tsx
|
|
13438
13363
|
import { Box as Box13, Chip as Chip3, Divider as Divider2, Stack, Typography as Typography9 } from "@mui/material";
|
|
@@ -13670,7 +13595,7 @@ import { Box as Box12 } from "@mui/material";
|
|
|
13670
13595
|
// src/components/event-details/event-detail.tsx
|
|
13671
13596
|
import { KeyboardArrowDown as KeyboardArrowDown2, KeyboardArrowRight as KeyboardArrowRight2 } from "@mui/icons-material";
|
|
13672
13597
|
import { Box as Box10, Grid as Grid3, IconButton as IconButton3, Typography as Typography7 } from "@mui/material";
|
|
13673
|
-
import { useEffect as
|
|
13598
|
+
import { useEffect as useEffect14, useMemo as useMemo8, useRef as useRef11, useState as useState8 } from "react";
|
|
13674
13599
|
|
|
13675
13600
|
// src/components/status-icon.tsx
|
|
13676
13601
|
import { Cancel, CheckCircle, Error as Error2, Info, RemoveCircle } from "@mui/icons-material";
|
|
@@ -13821,7 +13746,7 @@ var IAMEventDetail = ({ event }) => {
|
|
|
13821
13746
|
// src/components/event-details/iam-permission-detail.tsx
|
|
13822
13747
|
import { KeyboardArrowDown, KeyboardArrowRight } from "@mui/icons-material";
|
|
13823
13748
|
import { Box as Box9, Chip as Chip2, IconButton as IconButton2, Typography as Typography6 } from "@mui/material";
|
|
13824
|
-
import { useMemo as useMemo7, useState as
|
|
13749
|
+
import { useMemo as useMemo7, useState as useState7 } from "react";
|
|
13825
13750
|
import { jsx as jsx132, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
13826
13751
|
var getChipColors = (status) => {
|
|
13827
13752
|
const isAllowed = status === "explicitly_allowed" || status === "implicitly_allowed";
|
|
@@ -13831,7 +13756,7 @@ var getChipColors = (status) => {
|
|
|
13831
13756
|
};
|
|
13832
13757
|
};
|
|
13833
13758
|
var IAMPermissionItem = ({ event }) => {
|
|
13834
|
-
const [isOpen, setIsOpen] =
|
|
13759
|
+
const [isOpen, setIsOpen] = useState7(false);
|
|
13835
13760
|
const parsedData = useMemo7(() => {
|
|
13836
13761
|
const payloadString = event.attributes?.payload;
|
|
13837
13762
|
if (!payloadString) {
|
|
@@ -13902,15 +13827,15 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ jsxs126(Grid3, { contai
|
|
|
13902
13827
|
) : content })
|
|
13903
13828
|
] });
|
|
13904
13829
|
var EventMessage = ({ event }) => {
|
|
13905
|
-
const [isOpen, setIsOpen] =
|
|
13906
|
-
const [isOverflowing, setIsOverflowing] =
|
|
13830
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
13831
|
+
const [isOverflowing, setIsOverflowing] = useState8(false);
|
|
13907
13832
|
const textReference = useRef11(null);
|
|
13908
13833
|
const parsedMessage = useMemo8(() => parseEventMessage(event), [event]);
|
|
13909
13834
|
const isIAMPolicyEvent = useMemo8(
|
|
13910
13835
|
() => event.event_type === "iam.policy_evaluation" && event.attributes?.payload && typeof event.attributes.payload === "string",
|
|
13911
13836
|
[event]
|
|
13912
13837
|
);
|
|
13913
|
-
|
|
13838
|
+
useEffect14(() => {
|
|
13914
13839
|
const checkOverflow = () => {
|
|
13915
13840
|
const element = textReference.current;
|
|
13916
13841
|
if (element) {
|
|
@@ -14069,10 +13994,10 @@ var EventDetail = ({
|
|
|
14069
13994
|
// src/components/event-details/toggle-section.tsx
|
|
14070
13995
|
import { KeyboardArrowDown as KeyboardArrowDown3, KeyboardArrowRight as KeyboardArrowRight3 } from "@mui/icons-material";
|
|
14071
13996
|
import { Box as Box11, Typography as Typography8 } from "@mui/material";
|
|
14072
|
-
import { useState as
|
|
13997
|
+
import { useState as useState9 } from "react";
|
|
14073
13998
|
import { jsx as jsx134, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
14074
13999
|
var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
14075
|
-
const [isOpen, setIsOpen] =
|
|
14000
|
+
const [isOpen, setIsOpen] = useState9(initialOpen);
|
|
14076
14001
|
return /* @__PURE__ */ jsxs127(Box11, { sx: { mt: 4 }, children: [
|
|
14077
14002
|
/* @__PURE__ */ jsx134(
|
|
14078
14003
|
Box11,
|
|
@@ -14272,7 +14197,7 @@ function renderKeyValue(key, value) {
|
|
|
14272
14197
|
import "@xyflow/react/dist/base.css";
|
|
14273
14198
|
import { Alert as Alert3, Button as Button4, useTheme as useTheme3 } from "@mui/material";
|
|
14274
14199
|
import { Background, ReactFlow, useNodesState } from "@xyflow/react";
|
|
14275
|
-
import { useEffect as
|
|
14200
|
+
import { useEffect as useEffect15, useState as useState10 } from "react";
|
|
14276
14201
|
|
|
14277
14202
|
// src/components/trace-graph/service-node.tsx
|
|
14278
14203
|
import { Box as Box15, Stack as Stack2, Typography as Typography10 } from "@mui/material";
|
|
@@ -14623,8 +14548,8 @@ var TraceGraph = ({
|
|
|
14623
14548
|
spans
|
|
14624
14549
|
}) => {
|
|
14625
14550
|
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
|
14626
|
-
const [edges, setEdges] =
|
|
14627
|
-
|
|
14551
|
+
const [edges, setEdges] = useState10([]);
|
|
14552
|
+
useEffect15(() => {
|
|
14628
14553
|
const spansMap = /* @__PURE__ */ new Map();
|
|
14629
14554
|
const rootSpans = [];
|
|
14630
14555
|
for (const span of spans.data ?? []) {
|
|
@@ -14827,15 +14752,13 @@ var TraceGraphView = ({
|
|
|
14827
14752
|
};
|
|
14828
14753
|
var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
14829
14754
|
const api = useAppInspectorApi();
|
|
14830
|
-
const [spans, setSpans] =
|
|
14831
|
-
const [loading, setLoading] =
|
|
14832
|
-
const
|
|
14833
|
-
const
|
|
14834
|
-
const fetchSpans = useCallback8(async () => {
|
|
14755
|
+
const [spans, setSpans] = useState11();
|
|
14756
|
+
const [loading, setLoading] = useState11(false);
|
|
14757
|
+
const [fetchError, setFetchError] = useState11();
|
|
14758
|
+
const fetchSpans = useCallback7(async () => {
|
|
14835
14759
|
setLoading(true);
|
|
14836
14760
|
try {
|
|
14837
14761
|
const response = await api.getSpans({
|
|
14838
|
-
is_write_operation: includeReadOperations ? void 0 : true,
|
|
14839
14762
|
trace_id: traceId
|
|
14840
14763
|
});
|
|
14841
14764
|
setSpans(response.spans);
|
|
@@ -14846,29 +14769,29 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
14846
14769
|
} finally {
|
|
14847
14770
|
setLoading(false);
|
|
14848
14771
|
}
|
|
14849
|
-
}, [api,
|
|
14850
|
-
|
|
14772
|
+
}, [api, traceId]);
|
|
14773
|
+
useEffect16(() => {
|
|
14851
14774
|
void fetchSpans();
|
|
14852
14775
|
}, [fetchSpans]);
|
|
14853
|
-
const [open, setOpen] =
|
|
14854
|
-
const [selectedEvent, setSelectedEvent] =
|
|
14776
|
+
const [open, setOpen] = useState11(true);
|
|
14777
|
+
const [selectedEvent, setSelectedEvent] = useState11(() => spans?.find((span) => span.span_id === spanId));
|
|
14855
14778
|
const spansReference = useRef12();
|
|
14856
|
-
|
|
14779
|
+
useEffect16(() => {
|
|
14857
14780
|
if (!spansReference.current && spans) {
|
|
14858
14781
|
setSelectedEvent(spans.find((span) => span.span_id === spanId));
|
|
14859
14782
|
spansReference.current = spans;
|
|
14860
14783
|
}
|
|
14861
14784
|
}, [spans, setSelectedEvent, spanId]);
|
|
14862
14785
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
14863
|
-
const handleEventSelect =
|
|
14786
|
+
const handleEventSelect = useCallback7((spanId2) => {
|
|
14864
14787
|
const span = spans?.find((s) => s.span_id === spanId2);
|
|
14865
14788
|
setSelectedEvent(span);
|
|
14866
14789
|
setOpen(true);
|
|
14867
14790
|
}, [spans]);
|
|
14868
|
-
const handleRetry =
|
|
14791
|
+
const handleRetry = useCallback7(() => {
|
|
14869
14792
|
void checkStatus();
|
|
14870
14793
|
}, [checkStatus]);
|
|
14871
|
-
const navigateToSpansList =
|
|
14794
|
+
const navigateToSpansList = useCallback7(() => {
|
|
14872
14795
|
onClose?.();
|
|
14873
14796
|
}, [onClose]);
|
|
14874
14797
|
return /* @__PURE__ */ jsx141(
|
|
@@ -14897,7 +14820,6 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
14897
14820
|
// src/pages/spans-list-page.tsx
|
|
14898
14821
|
import { Fragment as Fragment9, jsx as jsx142, jsxs as jsxs134 } from "react/jsx-runtime";
|
|
14899
14822
|
var SpansListPage = () => {
|
|
14900
|
-
const { includeReadOperations, setIncludeReadOperations } = useIncludeReadOperations();
|
|
14901
14823
|
const {
|
|
14902
14824
|
checkStatus,
|
|
14903
14825
|
clearingSpans,
|
|
@@ -14914,19 +14836,17 @@ var SpansListPage = () => {
|
|
|
14914
14836
|
spans,
|
|
14915
14837
|
status,
|
|
14916
14838
|
statusError
|
|
14917
|
-
} = useSpans(
|
|
14918
|
-
|
|
14919
|
-
});
|
|
14920
|
-
const clearSpansSync = useCallback9(() => {
|
|
14839
|
+
} = useSpans();
|
|
14840
|
+
const clearSpansSync = useCallback8(() => {
|
|
14921
14841
|
void clearSpans();
|
|
14922
14842
|
}, [clearSpans]);
|
|
14923
|
-
const [selectedTraceId, setSelectedTraceId] =
|
|
14924
|
-
const [selectedSpanId, setSelectedSpanId] =
|
|
14925
|
-
const navigateToSpan =
|
|
14843
|
+
const [selectedTraceId, setSelectedTraceId] = useState12();
|
|
14844
|
+
const [selectedSpanId, setSelectedSpanId] = useState12();
|
|
14845
|
+
const navigateToSpan = useCallback8((span) => {
|
|
14926
14846
|
setSelectedTraceId(span.trace_id);
|
|
14927
14847
|
setSelectedSpanId(span.span_id);
|
|
14928
14848
|
}, []);
|
|
14929
|
-
const handleRetry =
|
|
14849
|
+
const handleRetry = useCallback8(() => {
|
|
14930
14850
|
void checkStatus();
|
|
14931
14851
|
}, [checkStatus]);
|
|
14932
14852
|
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
@@ -14962,11 +14882,9 @@ var SpansListPage = () => {
|
|
|
14962
14882
|
fetchingForward,
|
|
14963
14883
|
hasMoreBackward,
|
|
14964
14884
|
hasMoreForward,
|
|
14965
|
-
includeReadOperations,
|
|
14966
14885
|
onClearSpans: clearSpansSync,
|
|
14967
14886
|
onFetchBackward: fetchBackward,
|
|
14968
14887
|
onFetchForward: fetchForward,
|
|
14969
|
-
onIncludeReadOperationsChange: setIncludeReadOperations,
|
|
14970
14888
|
onRefresh: refreshSpans,
|
|
14971
14889
|
onSpanClick: navigateToSpan,
|
|
14972
14890
|
refetching,
|