@localstack/appinspector-ui 1.0.133 → 1.0.135
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 +233 -260
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +315 -342
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2422,7 +2422,7 @@ var init_event_streams = __esm({
|
|
|
2422
2422
|
|
|
2423
2423
|
// src/pages/spans-list-page.tsx
|
|
2424
2424
|
import { Box as Box20 } from "@mui/material";
|
|
2425
|
-
import { useCallback as
|
|
2425
|
+
import { useCallback as useCallback11, useEffect as useEffect22, useRef as useRef16, useState as useState18 } from "react";
|
|
2426
2426
|
|
|
2427
2427
|
// src/api/errors.ts
|
|
2428
2428
|
var AppInspectorDisabledError = class extends Error {
|
|
@@ -2586,7 +2586,7 @@ var EmulatorVersionBanner = ({
|
|
|
2586
2586
|
import { Alert as Alert2, Box as Box6, Button as Button3 } from "@mui/material";
|
|
2587
2587
|
|
|
2588
2588
|
// src/components/spans-list/spans-data-grid.tsx
|
|
2589
|
-
import { DeleteForeverOutlined
|
|
2589
|
+
import { DeleteForeverOutlined } from "@mui/icons-material";
|
|
2590
2590
|
import {
|
|
2591
2591
|
Box as Box5,
|
|
2592
2592
|
Button as Button2,
|
|
@@ -15562,14 +15562,9 @@ var newSpanBackgroundColor = {
|
|
|
15562
15562
|
var LABEL_BEGINNING_OF_STREAM = "This is the beginning of the stream";
|
|
15563
15563
|
var LABEL_END_OF_STREAM = "This is the end of the stream";
|
|
15564
15564
|
var LABEL_NO_SPANS = "There are no operations";
|
|
15565
|
-
var LABEL_LOAD_OLDER = "Load older operations";
|
|
15566
|
-
var LABEL_LOAD_NEWER = "Load newer operations";
|
|
15567
15565
|
var STICK_TO_EDGE_THRESHOLD_PX = 4;
|
|
15568
15566
|
var StreamBoundaryRow = ({ colSpan, label }) => /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx127("span", { children: label }) }) });
|
|
15569
|
-
var
|
|
15570
|
-
!fetching && /* @__PURE__ */ jsx127(Button2, { onClick: onFetch, sx: { my: 1 }, children: label }),
|
|
15571
|
-
fetching && /* @__PURE__ */ jsx127(CircularProgress, { size: 24, sx: { m: 2 } })
|
|
15572
|
-
] }) });
|
|
15567
|
+
var LoadingRow = ({ colSpan }) => /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan, sx: { textAlign: "center" }, children: /* @__PURE__ */ jsx127(CircularProgress, { size: 24, sx: { m: 2 } }) }) });
|
|
15573
15568
|
var SpansDataGridRow = memo9(
|
|
15574
15569
|
({ isNew, onSpanClick, row }) => {
|
|
15575
15570
|
const theme = useTheme2();
|
|
@@ -15636,14 +15631,10 @@ var SpansDataGrid = ({
|
|
|
15636
15631
|
hasMoreForward,
|
|
15637
15632
|
licenseLimit,
|
|
15638
15633
|
onClearSpans,
|
|
15639
|
-
onFetchBackward,
|
|
15640
|
-
onFetchForward,
|
|
15641
15634
|
onOrderChange,
|
|
15642
15635
|
onSpanClick,
|
|
15643
|
-
onToggleStream,
|
|
15644
15636
|
order: order2,
|
|
15645
15637
|
spans,
|
|
15646
|
-
streamPaused,
|
|
15647
15638
|
systemLimit,
|
|
15648
15639
|
totalCount,
|
|
15649
15640
|
warningCount
|
|
@@ -15811,21 +15802,6 @@ var SpansDataGrid = ({
|
|
|
15811
15802
|
) })
|
|
15812
15803
|
] }),
|
|
15813
15804
|
/* @__PURE__ */ jsx127(Box5, { sx: { flexGrow: 1 } }),
|
|
15814
|
-
/* @__PURE__ */ jsx127(
|
|
15815
|
-
FormControlLabel,
|
|
15816
|
-
{
|
|
15817
|
-
control: /* @__PURE__ */ jsx127(
|
|
15818
|
-
Button2,
|
|
15819
|
-
{
|
|
15820
|
-
onClick: onToggleStream,
|
|
15821
|
-
startIcon: streamPaused ? /* @__PURE__ */ jsx127(PlayArrowOutlined, {}) : /* @__PURE__ */ jsx127(PauseOutlined, {}),
|
|
15822
|
-
variant: "text",
|
|
15823
|
-
children: streamPaused ? "Resume Stream" : "Pause Stream"
|
|
15824
|
-
}
|
|
15825
|
-
),
|
|
15826
|
-
label: ""
|
|
15827
|
-
}
|
|
15828
|
-
),
|
|
15829
15805
|
/* @__PURE__ */ jsx127(
|
|
15830
15806
|
FormControlLabel,
|
|
15831
15807
|
{
|
|
@@ -15888,7 +15864,7 @@ var SpansDataGrid = ({
|
|
|
15888
15864
|
(spans === void 0 || clearingSpans) && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx127(CircularProgress, { size: 48, sx: { m: 4 } }) }) }),
|
|
15889
15865
|
!clearingSpans && spans?.length === 0 && /* @__PURE__ */ jsx127(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_NO_SPANS }),
|
|
15890
15866
|
!clearingSpans && order2 === "newest_first" && /* @__PURE__ */ jsxs121(Fragment5, { children: [
|
|
15891
|
-
hasRows && hasMoreForward && /* @__PURE__ */ jsx127(
|
|
15867
|
+
hasRows && hasMoreForward && fetchingForward && /* @__PURE__ */ jsx127(LoadingRow, { colSpan: columnCount }),
|
|
15892
15868
|
hasRows && !hasMoreForward && /* @__PURE__ */ jsx127(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_END_OF_STREAM }),
|
|
15893
15869
|
hasRows && paddingTop > 0 && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingTop, p: 0 } }) }),
|
|
15894
15870
|
hasRows && virtualItems.map((virtualItem) => {
|
|
@@ -15897,12 +15873,12 @@ var SpansDataGrid = ({
|
|
|
15897
15873
|
return /* @__PURE__ */ jsx127(SpansDataGridRow, { isNew, onSpanClick, row }, row.original.span_id);
|
|
15898
15874
|
}),
|
|
15899
15875
|
hasRows && paddingBottom > 0 && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingBottom, p: 0 } }) }),
|
|
15900
|
-
hasRows && hasMoreBackward && /* @__PURE__ */ jsx127(
|
|
15876
|
+
hasRows && hasMoreBackward && fetchingBackward && /* @__PURE__ */ jsx127(LoadingRow, { colSpan: columnCount }),
|
|
15901
15877
|
hasRows && !hasMoreBackward && /* @__PURE__ */ jsx127(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_BEGINNING_OF_STREAM })
|
|
15902
15878
|
] }),
|
|
15903
15879
|
!clearingSpans && order2 === "oldest_first" && /* @__PURE__ */ jsxs121(Fragment5, { children: [
|
|
15904
15880
|
hasRows && !hasMoreBackward && /* @__PURE__ */ jsx127(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_BEGINNING_OF_STREAM }),
|
|
15905
|
-
hasRows && hasMoreBackward && /* @__PURE__ */ jsx127(
|
|
15881
|
+
hasRows && hasMoreBackward && fetchingBackward && /* @__PURE__ */ jsx127(LoadingRow, { colSpan: columnCount }),
|
|
15906
15882
|
hasRows && paddingTop > 0 && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingTop, p: 0 } }) }),
|
|
15907
15883
|
hasRows && virtualItems.map((virtualItem) => {
|
|
15908
15884
|
const row = displayRows[virtualItem.index];
|
|
@@ -15910,7 +15886,7 @@ var SpansDataGrid = ({
|
|
|
15910
15886
|
return /* @__PURE__ */ jsx127(SpansDataGridRow, { isNew, onSpanClick, row }, row.original.span_id);
|
|
15911
15887
|
}),
|
|
15912
15888
|
hasRows && paddingBottom > 0 && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingBottom, p: 0 } }) }),
|
|
15913
|
-
hasRows && hasMoreForward && /* @__PURE__ */ jsx127(
|
|
15889
|
+
hasRows && hasMoreForward && fetchingForward && /* @__PURE__ */ jsx127(LoadingRow, { colSpan: columnCount }),
|
|
15914
15890
|
hasRows && !hasMoreForward && /* @__PURE__ */ jsx127(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_END_OF_STREAM })
|
|
15915
15891
|
] })
|
|
15916
15892
|
] })
|
|
@@ -15949,14 +15925,10 @@ var SpansList = (props) => {
|
|
|
15949
15925
|
hasMoreForward: props.hasMoreForward,
|
|
15950
15926
|
licenseLimit: props.licenseLimit,
|
|
15951
15927
|
onClearSpans: props.onClearSpans,
|
|
15952
|
-
onFetchBackward: props.onFetchBackward,
|
|
15953
|
-
onFetchForward: props.onFetchForward,
|
|
15954
15928
|
onOrderChange: props.onOrderChange,
|
|
15955
15929
|
onSpanClick: props.onSpanClick,
|
|
15956
|
-
onToggleStream: props.onToggleStream,
|
|
15957
15930
|
order: props.order,
|
|
15958
15931
|
spans: props.spans,
|
|
15959
|
-
streamPaused: props.streamPaused,
|
|
15960
15932
|
systemLimit: props.systemLimit,
|
|
15961
15933
|
totalCount: props.totalCount,
|
|
15962
15934
|
warningCount: props.warningCount
|
|
@@ -15971,11 +15943,10 @@ import { Alert as Alert3, AlertTitle, Box as Box7, Button as Button4, CircularPr
|
|
|
15971
15943
|
import { useState as useState5 } from "react";
|
|
15972
15944
|
import { Fragment as Fragment6, jsx as jsx129, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
15973
15945
|
var StatusMessage = ({
|
|
15974
|
-
error,
|
|
15975
15946
|
localstackVersion,
|
|
15976
15947
|
onEnable,
|
|
15977
15948
|
onRetry,
|
|
15978
|
-
|
|
15949
|
+
phase
|
|
15979
15950
|
}) => {
|
|
15980
15951
|
const [enabling, setEnabling] = useState5(false);
|
|
15981
15952
|
const [enableError, setEnableError] = useState5();
|
|
@@ -15991,8 +15962,23 @@ var StatusMessage = ({
|
|
|
15991
15962
|
setEnabling(false);
|
|
15992
15963
|
}
|
|
15993
15964
|
};
|
|
15994
|
-
|
|
15995
|
-
|
|
15965
|
+
if (phase === "CHECKING_STATUS" || phase === "CONNECTING_WS") {
|
|
15966
|
+
return /* @__PURE__ */ jsx129(
|
|
15967
|
+
Box7,
|
|
15968
|
+
{
|
|
15969
|
+
sx: {
|
|
15970
|
+
alignItems: "center",
|
|
15971
|
+
display: "flex",
|
|
15972
|
+
flexDirection: "column",
|
|
15973
|
+
gap: 2,
|
|
15974
|
+
justifyContent: "center",
|
|
15975
|
+
p: 4
|
|
15976
|
+
},
|
|
15977
|
+
children: /* @__PURE__ */ jsx129(CircularProgress2, { size: 32 })
|
|
15978
|
+
}
|
|
15979
|
+
);
|
|
15980
|
+
}
|
|
15981
|
+
if (phase === "INCOMPATIBLE") {
|
|
15996
15982
|
return /* @__PURE__ */ jsx129(
|
|
15997
15983
|
Box7,
|
|
15998
15984
|
{
|
|
@@ -16012,7 +15998,7 @@ var StatusMessage = ({
|
|
|
16012
15998
|
sx: { maxWidth: 600, width: "100%" },
|
|
16013
15999
|
children: [
|
|
16014
16000
|
/* @__PURE__ */ jsx129(AlertTitle, { sx: { fontWeight: "bold" }, children: "App Inspector Not Available" }),
|
|
16015
|
-
/* @__PURE__ */ jsx129(Typography5, { sx: { mb: 2 }, variant: "body2", children:
|
|
16001
|
+
/* @__PURE__ */ jsx129(Typography5, { sx: { mb: 2 }, variant: "body2", children: localstackVersion === void 0 ? `App Inspector requires LocalStack ${MINIMUM_EMULATOR_VERSION} or later. Please update LocalStack.` : `App Inspector requires LocalStack ${MINIMUM_EMULATOR_VERSION} or later. You are running version ${localstackVersion}. Please update LocalStack.` }),
|
|
16016
16002
|
/* @__PURE__ */ jsx129(Typography5, { sx: { mb: 1 }, variant: "body2", children: /* @__PURE__ */ jsx129("strong", { children: "Update LocalStack:" }) }),
|
|
16017
16003
|
/* @__PURE__ */ jsx129(
|
|
16018
16004
|
Box7,
|
|
@@ -16027,11 +16013,10 @@ var StatusMessage = ({
|
|
|
16027
16013
|
children: "localstack update docker-images"
|
|
16028
16014
|
}
|
|
16029
16015
|
),
|
|
16030
|
-
/* @__PURE__ */ jsx129(Box7, { sx: { display: "flex", gap: 1, mt: 2 }, children:
|
|
16016
|
+
onRetry && /* @__PURE__ */ jsx129(Box7, { sx: { display: "flex", gap: 1, mt: 2 }, children: /* @__PURE__ */ jsx129(
|
|
16031
16017
|
Button4,
|
|
16032
16018
|
{
|
|
16033
16019
|
"aria-label": "Check App Inspector status again",
|
|
16034
|
-
disabled: enabling,
|
|
16035
16020
|
onClick: onRetry,
|
|
16036
16021
|
variant: "outlined",
|
|
16037
16022
|
children: "Check Again"
|
|
@@ -16043,7 +16028,7 @@ var StatusMessage = ({
|
|
|
16043
16028
|
}
|
|
16044
16029
|
);
|
|
16045
16030
|
}
|
|
16046
|
-
if (
|
|
16031
|
+
if (phase === "UNREACHABLE") {
|
|
16047
16032
|
return /* @__PURE__ */ jsx129(
|
|
16048
16033
|
Box7,
|
|
16049
16034
|
{
|
|
@@ -16105,7 +16090,7 @@ var StatusMessage = ({
|
|
|
16105
16090
|
}
|
|
16106
16091
|
);
|
|
16107
16092
|
}
|
|
16108
|
-
if (
|
|
16093
|
+
if (phase === "DISABLED") {
|
|
16109
16094
|
return /* @__PURE__ */ jsx129(
|
|
16110
16095
|
Box7,
|
|
16111
16096
|
{
|
|
@@ -16160,102 +16145,99 @@ var StatusMessage = ({
|
|
|
16160
16145
|
}
|
|
16161
16146
|
);
|
|
16162
16147
|
}
|
|
16163
|
-
if (error) {
|
|
16164
|
-
return /* @__PURE__ */ jsx129(
|
|
16165
|
-
Box7,
|
|
16166
|
-
{
|
|
16167
|
-
sx: {
|
|
16168
|
-
alignItems: "center",
|
|
16169
|
-
display: "flex",
|
|
16170
|
-
flexDirection: "column",
|
|
16171
|
-
gap: 2,
|
|
16172
|
-
justifyContent: "center",
|
|
16173
|
-
p: 4
|
|
16174
|
-
},
|
|
16175
|
-
children: /* @__PURE__ */ jsxs123(
|
|
16176
|
-
Alert3,
|
|
16177
|
-
{
|
|
16178
|
-
icon: /* @__PURE__ */ jsx129(ErrorOutline, { fontSize: "large" }),
|
|
16179
|
-
severity: "error",
|
|
16180
|
-
sx: { maxWidth: 600, width: "100%" },
|
|
16181
|
-
children: [
|
|
16182
|
-
/* @__PURE__ */ jsx129(AlertTitle, { sx: { fontWeight: "bold" }, children: "Error" }),
|
|
16183
|
-
/* @__PURE__ */ jsx129(Typography5, { sx: { mb: 2 }, variant: "body2", children: error.message }),
|
|
16184
|
-
onRetry && /* @__PURE__ */ jsx129(Box7, { sx: { display: "flex", justifyContent: "flex-start", mt: 2 }, children: /* @__PURE__ */ jsx129(
|
|
16185
|
-
Button4,
|
|
16186
|
-
{
|
|
16187
|
-
"aria-label": "Retry operation",
|
|
16188
|
-
onClick: onRetry,
|
|
16189
|
-
variant: "outlined",
|
|
16190
|
-
children: "Retry"
|
|
16191
|
-
}
|
|
16192
|
-
) })
|
|
16193
|
-
]
|
|
16194
|
-
}
|
|
16195
|
-
)
|
|
16196
|
-
}
|
|
16197
|
-
);
|
|
16198
|
-
}
|
|
16199
16148
|
return /* @__PURE__ */ jsx129(Fragment6, {});
|
|
16200
16149
|
};
|
|
16201
16150
|
|
|
16202
16151
|
// src/hooks/status-provider.tsx
|
|
16203
|
-
import { createContext as createContext8,
|
|
16152
|
+
import { createContext as createContext8, useContext as useContext14 } from "react";
|
|
16204
16153
|
|
|
16205
|
-
// src/hooks/use-
|
|
16154
|
+
// src/hooks/use-connection-state-machine.ts
|
|
16206
16155
|
import { useCallback as useCallback3, useEffect as useEffect12, useRef as useRef7, useState as useState6 } from "react";
|
|
16207
|
-
var
|
|
16156
|
+
var POLL_INTERVAL_MS = 5e3;
|
|
16157
|
+
function useConnectionStateMachine() {
|
|
16208
16158
|
const api = useAppInspectorApi();
|
|
16159
|
+
const [phase, setPhase] = useState6("CHECKING_STATUS");
|
|
16209
16160
|
const [checking, setChecking] = useState6(true);
|
|
16210
16161
|
const [status, setStatus] = useState6();
|
|
16211
|
-
const [
|
|
16212
|
-
const
|
|
16213
|
-
const
|
|
16214
|
-
|
|
16215
|
-
|
|
16216
|
-
|
|
16162
|
+
const [statusError, setStatusError] = useState6();
|
|
16163
|
+
const abortControllerRef = useRef7(null);
|
|
16164
|
+
const dispatchStatus = useCallback3((result, error) => {
|
|
16165
|
+
if (result === void 0) {
|
|
16166
|
+
setStatus(void 0);
|
|
16167
|
+
setStatusError(error);
|
|
16168
|
+
setPhase(error instanceof AppInspectorNotFoundError ? "INCOMPATIBLE" : "UNREACHABLE");
|
|
16169
|
+
return;
|
|
16170
|
+
}
|
|
16171
|
+
setStatus(result);
|
|
16172
|
+
setStatusError(void 0);
|
|
16173
|
+
if (checkEmulatorVersion(result.localstackVersion) === "below-minimum") {
|
|
16174
|
+
setPhase("INCOMPATIBLE");
|
|
16175
|
+
return;
|
|
16176
|
+
}
|
|
16177
|
+
setPhase(result.status === "ENABLED" ? "CONNECTING_WS" : "DISABLED");
|
|
16178
|
+
}, []);
|
|
16179
|
+
const runCheck = useCallback3(async () => {
|
|
16180
|
+
if (abortControllerRef.current !== null) {
|
|
16181
|
+
abortControllerRef.current.abort();
|
|
16217
16182
|
}
|
|
16218
16183
|
const abortController = new AbortController();
|
|
16219
|
-
|
|
16184
|
+
abortControllerRef.current = abortController;
|
|
16220
16185
|
setChecking(true);
|
|
16221
16186
|
try {
|
|
16222
|
-
const
|
|
16187
|
+
const result = await api.getStatus();
|
|
16223
16188
|
if (!abortController.signal.aborted) {
|
|
16224
|
-
|
|
16225
|
-
setError(void 0);
|
|
16189
|
+
dispatchStatus(result);
|
|
16226
16190
|
}
|
|
16227
|
-
} catch (
|
|
16191
|
+
} catch (error) {
|
|
16228
16192
|
if (!abortController.signal.aborted) {
|
|
16229
|
-
|
|
16230
|
-
setStatus(void 0);
|
|
16193
|
+
dispatchStatus(void 0, error instanceof Error ? error : new Error("Unknown error"));
|
|
16231
16194
|
}
|
|
16232
16195
|
} finally {
|
|
16233
16196
|
if (!abortController.signal.aborted) {
|
|
16234
16197
|
setChecking(false);
|
|
16235
16198
|
}
|
|
16236
16199
|
}
|
|
16237
|
-
}, [api]);
|
|
16200
|
+
}, [api, dispatchStatus]);
|
|
16238
16201
|
useEffect12(() => {
|
|
16239
|
-
|
|
16240
|
-
|
|
16241
|
-
|
|
16242
|
-
|
|
16243
|
-
|
|
16244
|
-
|
|
16245
|
-
};
|
|
16202
|
+
void runCheck();
|
|
16203
|
+
}, [runCheck]);
|
|
16204
|
+
useEffect12(() => {
|
|
16205
|
+
if (phase !== "UNREACHABLE" && phase !== "DISABLED") return;
|
|
16206
|
+
const intervalId = globalThis.setInterval(() => {
|
|
16207
|
+
void runCheck();
|
|
16208
|
+
}, POLL_INTERVAL_MS);
|
|
16209
|
+
return () => {
|
|
16210
|
+
globalThis.clearInterval(intervalId);
|
|
16211
|
+
};
|
|
16212
|
+
}, [phase, runCheck]);
|
|
16213
|
+
const checkStatus = useCallback3(() => {
|
|
16214
|
+
void runCheck();
|
|
16215
|
+
}, [runCheck]);
|
|
16216
|
+
const onWsOpen = useCallback3(() => {
|
|
16217
|
+
setPhase("LIVE");
|
|
16218
|
+
}, []);
|
|
16219
|
+
const onWsClose = useCallback3(() => {
|
|
16220
|
+
setPhase("CHECKING_STATUS");
|
|
16221
|
+
void runCheck();
|
|
16222
|
+
}, [runCheck]);
|
|
16223
|
+
const wsEnabled = phase === "CONNECTING_WS" || phase === "LIVE";
|
|
16224
|
+
return {
|
|
16225
|
+
checking,
|
|
16226
|
+
checkStatus,
|
|
16227
|
+
onWsClose,
|
|
16228
|
+
onWsOpen,
|
|
16229
|
+
phase,
|
|
16230
|
+
status,
|
|
16231
|
+
statusError,
|
|
16232
|
+
wsEnabled
|
|
16233
|
+
};
|
|
16234
|
+
}
|
|
16246
16235
|
|
|
16247
16236
|
// src/hooks/status-provider.tsx
|
|
16248
16237
|
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
16249
16238
|
var AppInspectorStatusContext = createContext8(void 0);
|
|
16250
16239
|
var StatusProvider = ({ children }) => {
|
|
16251
|
-
const
|
|
16252
|
-
const reportDisabled = useCallback4(() => {
|
|
16253
|
-
void checkStatus();
|
|
16254
|
-
}, [checkStatus]);
|
|
16255
|
-
const value = useMemo5(
|
|
16256
|
-
() => ({ checking, checkStatus, reportDisabled, status, statusError: error }),
|
|
16257
|
-
[checking, checkStatus, reportDisabled, status, error]
|
|
16258
|
-
);
|
|
16240
|
+
const value = useConnectionStateMachine();
|
|
16259
16241
|
return /* @__PURE__ */ jsx130(AppInspectorStatusContext.Provider, { value, children });
|
|
16260
16242
|
};
|
|
16261
16243
|
var useAppInspectorStatus = () => {
|
|
@@ -16267,7 +16249,7 @@ var useAppInspectorStatus = () => {
|
|
|
16267
16249
|
};
|
|
16268
16250
|
|
|
16269
16251
|
// src/hooks/use-local-storage.tsx
|
|
16270
|
-
import { useCallback as
|
|
16252
|
+
import { useCallback as useCallback4, useEffect as useEffect13, useState as useState7 } from "react";
|
|
16271
16253
|
function useLocalStorage(key, initialValue) {
|
|
16272
16254
|
const [storedValue, setStoredValue] = useState7(() => {
|
|
16273
16255
|
try {
|
|
@@ -16278,7 +16260,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
16278
16260
|
return initialValue;
|
|
16279
16261
|
}
|
|
16280
16262
|
});
|
|
16281
|
-
const setValue =
|
|
16263
|
+
const setValue = useCallback4((value) => {
|
|
16282
16264
|
try {
|
|
16283
16265
|
setStoredValue((previousState) => {
|
|
16284
16266
|
const next = typeof value === "function" ? value(previousState) : value;
|
|
@@ -16312,7 +16294,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
16312
16294
|
}
|
|
16313
16295
|
|
|
16314
16296
|
// src/hooks/use-spans.ts
|
|
16315
|
-
import { useCallback as
|
|
16297
|
+
import { useCallback as useCallback7, useEffect as useEffect16, useRef as useRef10, useState as useState9 } from "react";
|
|
16316
16298
|
|
|
16317
16299
|
// src/utils/pagination-buffer.ts
|
|
16318
16300
|
var insertSorted = (array, item, compareFunction, hint = "back") => {
|
|
@@ -16493,7 +16475,7 @@ var createPaginationBuffer = (options) => {
|
|
|
16493
16475
|
};
|
|
16494
16476
|
|
|
16495
16477
|
// src/hooks/use-spans-ws.tsx
|
|
16496
|
-
import { useCallback as
|
|
16478
|
+
import { useCallback as useCallback6, useEffect as useEffect15, useRef as useRef9, useState as useState8 } from "react";
|
|
16497
16479
|
|
|
16498
16480
|
// src/config.ts
|
|
16499
16481
|
var APPINSPECTOR_API_PREFIX = "/_localstack/appinspector";
|
|
@@ -16523,7 +16505,7 @@ var LOCALSTACK_INFO_PATH = "/_localstack/info";
|
|
|
16523
16505
|
|
|
16524
16506
|
// src/context.tsx
|
|
16525
16507
|
import { createContext as createContext9, useContext as useContext15 } from "react";
|
|
16526
|
-
import { useCallback as
|
|
16508
|
+
import { useCallback as useCallback5, useMemo as useMemo5 } from "react";
|
|
16527
16509
|
|
|
16528
16510
|
// src/api/client.ts
|
|
16529
16511
|
var import_semver2 = __toESM(require_semver2(), 1);
|
|
@@ -18689,11 +18671,11 @@ var AppInspectorAnalyticsBoundary = ({ children }) => {
|
|
|
18689
18671
|
return /* @__PURE__ */ jsx131(Fragment7, { children });
|
|
18690
18672
|
};
|
|
18691
18673
|
var AppInspectorContextProvider = (props) => {
|
|
18692
|
-
const api =
|
|
18674
|
+
const api = useMemo5(
|
|
18693
18675
|
() => createApiClient({ localstackEndpoint: props.localstackEndpoint }),
|
|
18694
18676
|
[props.localstackEndpoint]
|
|
18695
18677
|
);
|
|
18696
|
-
const resolveLink =
|
|
18678
|
+
const resolveLink = useCallback5(
|
|
18697
18679
|
(options) => {
|
|
18698
18680
|
if (options.to === "settings") {
|
|
18699
18681
|
return `${props.routePrefix}/settings`;
|
|
@@ -18705,11 +18687,11 @@ var AppInspectorContextProvider = (props) => {
|
|
|
18705
18687
|
},
|
|
18706
18688
|
[props.routePrefix]
|
|
18707
18689
|
);
|
|
18708
|
-
const deploymentContainer =
|
|
18690
|
+
const deploymentContainer = useMemo5(
|
|
18709
18691
|
() => props.deploymentContainer ?? { source: "web" },
|
|
18710
18692
|
[props.deploymentContainer]
|
|
18711
18693
|
);
|
|
18712
|
-
const contextValue =
|
|
18694
|
+
const contextValue = useMemo5(
|
|
18713
18695
|
() => ({
|
|
18714
18696
|
deploymentContainer,
|
|
18715
18697
|
linkComponent: props.linkComponent,
|
|
@@ -18723,35 +18705,45 @@ var AppInspectorContextProvider = (props) => {
|
|
|
18723
18705
|
|
|
18724
18706
|
// src/hooks/use-spans-ws.tsx
|
|
18725
18707
|
function useSpansWebSocket(options) {
|
|
18726
|
-
const { onMessage } = options;
|
|
18708
|
+
const { enabled, onClose, onMessage, onOpen } = options;
|
|
18727
18709
|
const onMessageRef = useRef9(onMessage);
|
|
18710
|
+
const onOpenRef = useRef9(onOpen);
|
|
18711
|
+
const onCloseRef = useRef9(onClose);
|
|
18728
18712
|
useEffect15(() => {
|
|
18729
18713
|
onMessageRef.current = onMessage;
|
|
18730
18714
|
}, [onMessage]);
|
|
18715
|
+
useEffect15(() => {
|
|
18716
|
+
onOpenRef.current = onOpen;
|
|
18717
|
+
}, [onOpen]);
|
|
18718
|
+
useEffect15(() => {
|
|
18719
|
+
onCloseRef.current = onClose;
|
|
18720
|
+
}, [onClose]);
|
|
18731
18721
|
const [connected, setConnected] = useState8(false);
|
|
18732
18722
|
const wsRef = useRef9(void 0);
|
|
18733
|
-
const reconnectRef = useRef9(void 0);
|
|
18734
18723
|
const { localstackEndpoint } = useAppInspector();
|
|
18735
|
-
const connect =
|
|
18724
|
+
const connect = useCallback6(() => {
|
|
18736
18725
|
if (wsRef.current !== void 0) return;
|
|
18737
18726
|
const url = new URL(getAppInspectorApiUrl(localstackEndpoint, API_ENDPOINTS.WEBSOCKET_SPANS));
|
|
18738
18727
|
url.protocol = globalThis.location.protocol === "https:" ? "wss" : "ws";
|
|
18739
18728
|
const ws = new WebSocket(url);
|
|
18740
18729
|
wsRef.current = ws;
|
|
18741
18730
|
ws.addEventListener("open", () => {
|
|
18731
|
+
if (wsRef.current !== ws) return;
|
|
18742
18732
|
setConnected(true);
|
|
18733
|
+
onOpenRef.current();
|
|
18743
18734
|
});
|
|
18744
18735
|
ws.addEventListener("message", () => {
|
|
18736
|
+
if (wsRef.current !== ws) return;
|
|
18745
18737
|
onMessageRef.current();
|
|
18746
18738
|
});
|
|
18747
18739
|
ws.addEventListener("close", () => {
|
|
18740
|
+
if (wsRef.current !== ws) return;
|
|
18748
18741
|
setConnected(false);
|
|
18749
18742
|
wsRef.current = void 0;
|
|
18750
|
-
|
|
18751
|
-
connect();
|
|
18752
|
-
}, 2e3);
|
|
18743
|
+
onCloseRef.current();
|
|
18753
18744
|
});
|
|
18754
18745
|
ws.addEventListener("error", () => {
|
|
18746
|
+
if (wsRef.current !== ws) return;
|
|
18755
18747
|
try {
|
|
18756
18748
|
ws.close();
|
|
18757
18749
|
} catch {
|
|
@@ -18759,26 +18751,34 @@ function useSpansWebSocket(options) {
|
|
|
18759
18751
|
});
|
|
18760
18752
|
}, [localstackEndpoint]);
|
|
18761
18753
|
useEffect15(() => {
|
|
18754
|
+
if (!enabled) {
|
|
18755
|
+
if (wsRef.current !== void 0) {
|
|
18756
|
+
wsRef.current.close();
|
|
18757
|
+
wsRef.current = void 0;
|
|
18758
|
+
setConnected(false);
|
|
18759
|
+
}
|
|
18760
|
+
return;
|
|
18761
|
+
}
|
|
18762
18762
|
connect();
|
|
18763
18763
|
return () => {
|
|
18764
|
-
if (reconnectRef.current !== void 0) clearTimeout(reconnectRef.current);
|
|
18765
18764
|
if (wsRef.current !== void 0) {
|
|
18766
18765
|
try {
|
|
18767
18766
|
wsRef.current.close();
|
|
18768
18767
|
} catch {
|
|
18769
18768
|
}
|
|
18770
18769
|
wsRef.current = void 0;
|
|
18770
|
+
setConnected(false);
|
|
18771
18771
|
}
|
|
18772
18772
|
};
|
|
18773
|
-
}, [connect]);
|
|
18773
|
+
}, [enabled, connect]);
|
|
18774
18774
|
return { connected };
|
|
18775
18775
|
}
|
|
18776
18776
|
|
|
18777
18777
|
// src/hooks/use-spans.ts
|
|
18778
|
-
var PAGE_SIZE =
|
|
18778
|
+
var PAGE_SIZE = 100;
|
|
18779
18779
|
var useSpans = () => {
|
|
18780
18780
|
const api = useAppInspectorApi();
|
|
18781
|
-
const {
|
|
18781
|
+
const { onWsClose, onWsOpen, wsEnabled } = useAppInspectorStatus();
|
|
18782
18782
|
const [spans, setSpans] = useState9();
|
|
18783
18783
|
const [fetchError, setFetchError] = useState9();
|
|
18784
18784
|
const [fetchingForward, setFetchingForward] = useState9(false);
|
|
@@ -18829,17 +18829,17 @@ var useSpans = () => {
|
|
|
18829
18829
|
const [warningCount, setWarningCount] = useState9();
|
|
18830
18830
|
const [hasMoreBackward, setHasMoreBackward] = useState9();
|
|
18831
18831
|
const [hasMoreForward, setHasMoreForward] = useState9();
|
|
18832
|
-
const fetchForward =
|
|
18832
|
+
const fetchForward = useCallback7(() => {
|
|
18833
18833
|
void paginationBufferRef.current.fetchForward();
|
|
18834
18834
|
}, []);
|
|
18835
|
-
const fetchBackward =
|
|
18835
|
+
const fetchBackward = useCallback7(() => {
|
|
18836
18836
|
void paginationBufferRef.current.fetchBackward();
|
|
18837
18837
|
}, []);
|
|
18838
18838
|
useEffect16(() => {
|
|
18839
18839
|
fetchForward();
|
|
18840
18840
|
}, [fetchForward]);
|
|
18841
18841
|
const [clearingSpans, setClearingSpans] = useState9(false);
|
|
18842
|
-
const clearSpans =
|
|
18842
|
+
const clearSpans = useCallback7(async () => {
|
|
18843
18843
|
if (clearingSpans) {
|
|
18844
18844
|
return;
|
|
18845
18845
|
}
|
|
@@ -18856,37 +18856,35 @@ var useSpans = () => {
|
|
|
18856
18856
|
setClearingSpans(false);
|
|
18857
18857
|
}
|
|
18858
18858
|
}, [clearingSpans, api]);
|
|
18859
|
-
const [streamPaused, setStreamPaused] = useState9(false);
|
|
18860
|
-
const toggleStream = useCallback8(() => {
|
|
18861
|
-
setStreamPaused((previous) => !previous);
|
|
18862
|
-
}, []);
|
|
18863
18859
|
useEffect16(() => {
|
|
18864
|
-
if (hasMoreForward === true && !fetchingForward
|
|
18860
|
+
if (hasMoreForward === true && !fetchingForward) {
|
|
18865
18861
|
void paginationBufferRef.current.fetchForward();
|
|
18866
18862
|
}
|
|
18867
|
-
}, [hasMoreForward, fetchingForward
|
|
18863
|
+
}, [hasMoreForward, fetchingForward]);
|
|
18864
|
+
useEffect16(() => {
|
|
18865
|
+
if (hasMoreBackward === true && !fetchingBackward && !fetchingForward) {
|
|
18866
|
+
void paginationBufferRef.current.fetchBackward();
|
|
18867
|
+
}
|
|
18868
|
+
}, [hasMoreBackward, fetchingBackward, fetchingForward]);
|
|
18868
18869
|
useSpansWebSocket({
|
|
18870
|
+
enabled: wsEnabled,
|
|
18871
|
+
onClose: onWsClose,
|
|
18869
18872
|
onMessage: () => {
|
|
18870
18873
|
if (clearingSpans) {
|
|
18871
18874
|
return;
|
|
18872
18875
|
}
|
|
18873
18876
|
if (!hasMoreForward) {
|
|
18874
|
-
|
|
18875
|
-
paginationBufferRef.current.checkIfThereAreMoreItemsForward();
|
|
18876
|
-
} else {
|
|
18877
|
-
void paginationBufferRef.current.fetchForward();
|
|
18878
|
-
}
|
|
18877
|
+
void paginationBufferRef.current.fetchForward();
|
|
18879
18878
|
}
|
|
18879
|
+
},
|
|
18880
|
+
onOpen: () => {
|
|
18881
|
+
onWsOpen();
|
|
18882
|
+
fetchForward();
|
|
18880
18883
|
}
|
|
18881
18884
|
});
|
|
18882
|
-
const clearFetchError =
|
|
18885
|
+
const clearFetchError = useCallback7(() => {
|
|
18883
18886
|
setFetchError(void 0);
|
|
18884
18887
|
}, []);
|
|
18885
|
-
useEffect16(() => {
|
|
18886
|
-
if (fetchError instanceof AppInspectorDisabledError || fetchError instanceof ConnectionError) {
|
|
18887
|
-
reportDisabled();
|
|
18888
|
-
}
|
|
18889
|
-
}, [fetchError, reportDisabled]);
|
|
18890
18888
|
return {
|
|
18891
18889
|
clearFetchError,
|
|
18892
18890
|
clearingSpans,
|
|
@@ -18901,9 +18899,7 @@ var useSpans = () => {
|
|
|
18901
18899
|
hasMoreForward,
|
|
18902
18900
|
licenseLimit,
|
|
18903
18901
|
spans,
|
|
18904
|
-
streamPaused,
|
|
18905
18902
|
systemLimit,
|
|
18906
|
-
toggleStream,
|
|
18907
18903
|
totalCount,
|
|
18908
18904
|
warningCount
|
|
18909
18905
|
};
|
|
@@ -18914,12 +18910,12 @@ import { ArrowBack } from "@mui/icons-material";
|
|
|
18914
18910
|
import { Box as Box19, Button as Button6, Drawer, Paper as Paper3 } from "@mui/material";
|
|
18915
18911
|
import { styled } from "@mui/material/styles";
|
|
18916
18912
|
import { ReactFlowProvider } from "@xyflow/react";
|
|
18917
|
-
import { useCallback as
|
|
18913
|
+
import { useCallback as useCallback10, useEffect as useEffect21, useRef as useRef15, useState as useState17 } from "react";
|
|
18918
18914
|
|
|
18919
18915
|
// src/components/event-details/event-details.tsx
|
|
18920
18916
|
import { Close as Close2 } from "@mui/icons-material";
|
|
18921
18917
|
import { Alert as Alert4, Box as Box16, Chip as Chip3, Divider as Divider4, FormControlLabel as FormControlLabel2, IconButton as IconButton4, Stack as Stack3, Switch, Typography as Typography11 } from "@mui/material";
|
|
18922
|
-
import { useMemo as
|
|
18918
|
+
import { useMemo as useMemo10, useState as useState15 } from "react";
|
|
18923
18919
|
|
|
18924
18920
|
// src/utils/event-utils.ts
|
|
18925
18921
|
var iamEventParser = (eventName, attributes) => {
|
|
@@ -19032,11 +19028,11 @@ var getEventGroupsByType = (events) => {
|
|
|
19032
19028
|
// src/components/event-details/copy-button.tsx
|
|
19033
19029
|
import { Check, ContentCopy } from "@mui/icons-material";
|
|
19034
19030
|
import { IconButton as IconButton2, Tooltip as Tooltip5 } from "@mui/material";
|
|
19035
|
-
import { useCallback as
|
|
19031
|
+
import { useCallback as useCallback8, useState as useState10 } from "react";
|
|
19036
19032
|
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
19037
19033
|
var CopyButton = ({ value }) => {
|
|
19038
19034
|
const [copied, setCopied] = useState10(false);
|
|
19039
|
-
const handleCopy =
|
|
19035
|
+
const handleCopy = useCallback8(() => {
|
|
19040
19036
|
const text2 = typeof value === "string" ? value : JSON.stringify(value, void 0, 2);
|
|
19041
19037
|
void navigator.clipboard.writeText(text2).then(() => {
|
|
19042
19038
|
setCopied(true);
|
|
@@ -19060,7 +19056,7 @@ var CopyButton = ({ value }) => {
|
|
|
19060
19056
|
// src/components/event-details/event-detail.tsx
|
|
19061
19057
|
import { KeyboardArrowDown, KeyboardArrowRight } from "@mui/icons-material";
|
|
19062
19058
|
import { Box as Box13, IconButton as IconButton3, Typography as Typography8 } from "@mui/material";
|
|
19063
|
-
import { useEffect as useEffect18, useMemo as
|
|
19059
|
+
import { useEffect as useEffect18, useMemo as useMemo8, useRef as useRef12, useState as useState12 } from "react";
|
|
19064
19060
|
|
|
19065
19061
|
// src/components/status-icon.tsx
|
|
19066
19062
|
import { Cancel as Cancel2, CheckCircle, Error as Error3, Info, RemoveCircle } from "@mui/icons-material";
|
|
@@ -19169,7 +19165,7 @@ var IAMEventDetail = ({ event }) => {
|
|
|
19169
19165
|
|
|
19170
19166
|
// src/components/event-details/iam-permission-detail.tsx
|
|
19171
19167
|
import { Box as Box10, Chip as Chip2, Stack, Typography as Typography7 } from "@mui/material";
|
|
19172
|
-
import { useMemo as
|
|
19168
|
+
import { useMemo as useMemo6 } from "react";
|
|
19173
19169
|
import { jsx as jsx135, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
19174
19170
|
var getChipColor = (isAllowed, spanStatusCode) => {
|
|
19175
19171
|
if (isAllowed) return "success.main";
|
|
@@ -19177,7 +19173,7 @@ var getChipColor = (isAllowed, spanStatusCode) => {
|
|
|
19177
19173
|
return "warning.main";
|
|
19178
19174
|
};
|
|
19179
19175
|
var IAMPermissionItem = ({ event, spanStatusCode }) => {
|
|
19180
|
-
const parsedData =
|
|
19176
|
+
const parsedData = useMemo6(() => {
|
|
19181
19177
|
const payloadString = event.attributes?.payload;
|
|
19182
19178
|
if (!payloadString) return;
|
|
19183
19179
|
const parsedIAM2 = parseIAMEvent(payloadString);
|
|
@@ -19226,7 +19222,7 @@ import { Box as Box12, useTheme as useTheme3 } from "@mui/material";
|
|
|
19226
19222
|
var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
|
|
19227
19223
|
import { jsx as jsx136, jsxs as jsxs126, Fragment as Fragment8 } from "react/jsx-runtime";
|
|
19228
19224
|
import { Box as Box11, InputBase, NoSsr, SvgIcon, createTheme, ThemeProvider, Paper as Paper2 } from "@mui/material";
|
|
19229
|
-
import { createContext as createContext10, useContext as useContext16, useState as useState11, useRef as useRef11, useCallback as
|
|
19225
|
+
import { createContext as createContext10, useContext as useContext16, useState as useState11, useRef as useRef11, useCallback as useCallback9, useMemo as useMemo7, useEffect as useEffect17, memo as memo10 } from "react";
|
|
19230
19226
|
import { create, useStore, createStore } from "zustand";
|
|
19231
19227
|
function r(e2) {
|
|
19232
19228
|
var t, f2, n = "";
|
|
@@ -19472,7 +19468,7 @@ function useClipboard() {
|
|
|
19472
19468
|
let { timeout = 2e3 } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
19473
19469
|
const [copied, setCopied] = useState11(false);
|
|
19474
19470
|
const copyTimeout = useRef11(null);
|
|
19475
|
-
const handleCopyResult =
|
|
19471
|
+
const handleCopyResult = useCallback9((value) => {
|
|
19476
19472
|
const current = copyTimeout.current;
|
|
19477
19473
|
if (current) {
|
|
19478
19474
|
window.clearTimeout(current);
|
|
@@ -19483,7 +19479,7 @@ function useClipboard() {
|
|
|
19483
19479
|
timeout
|
|
19484
19480
|
]);
|
|
19485
19481
|
const onCopy = useJsonViewerStore((store) => store.onCopy);
|
|
19486
|
-
const copy =
|
|
19482
|
+
const copy = useCallback9(async (path, value) => {
|
|
19487
19483
|
if (typeof onCopy === "function") {
|
|
19488
19484
|
try {
|
|
19489
19485
|
await onCopy(path, value, copyString);
|
|
@@ -19504,7 +19500,7 @@ function useClipboard() {
|
|
|
19504
19500
|
handleCopyResult,
|
|
19505
19501
|
onCopy
|
|
19506
19502
|
]);
|
|
19507
|
-
const reset =
|
|
19503
|
+
const reset = useCallback9(() => {
|
|
19508
19504
|
setCopied(false);
|
|
19509
19505
|
if (copyTimeout.current) {
|
|
19510
19506
|
clearTimeout(copyTimeout.current);
|
|
@@ -19518,7 +19514,7 @@ function useClipboard() {
|
|
|
19518
19514
|
}
|
|
19519
19515
|
function useIsCycleReference(path, value) {
|
|
19520
19516
|
const rootValue = useJsonViewerStore((store) => store.value);
|
|
19521
|
-
return
|
|
19517
|
+
return useMemo7(() => isCycleReference(rootValue, path, value), [
|
|
19522
19518
|
path,
|
|
19523
19519
|
value,
|
|
19524
19520
|
rootValue
|
|
@@ -19563,7 +19559,7 @@ function useInspect(path, value, nestedIndex) {
|
|
|
19563
19559
|
}
|
|
19564
19560
|
return isTrap ? false : typeof defaultInspectControl === "function" ? defaultInspectControl(path, value) : depth < defaultInspectDepth;
|
|
19565
19561
|
});
|
|
19566
|
-
const setInspect =
|
|
19562
|
+
const setInspect = useCallback9((apply) => {
|
|
19567
19563
|
set((oldState) => {
|
|
19568
19564
|
const newState = typeof apply === "boolean" ? apply : apply(oldState);
|
|
19569
19565
|
setInspectCache(path, newState, nestedIndex);
|
|
@@ -19640,7 +19636,7 @@ function defineEasyType(param) {
|
|
|
19640
19636
|
const EasyTypeEditor = (param2) => {
|
|
19641
19637
|
let { value, setValue, abortEditing, commitEditing } = param2;
|
|
19642
19638
|
const color2 = useJsonViewerStore((store) => store.colorspace[colorKey]);
|
|
19643
|
-
const handleKeyDown =
|
|
19639
|
+
const handleKeyDown = useCallback9((event) => {
|
|
19644
19640
|
if (event.key === "Enter") {
|
|
19645
19641
|
event.preventDefault();
|
|
19646
19642
|
commitEditing(value);
|
|
@@ -19654,7 +19650,7 @@ function defineEasyType(param) {
|
|
|
19654
19650
|
commitEditing,
|
|
19655
19651
|
value
|
|
19656
19652
|
]);
|
|
19657
|
-
const handleChange =
|
|
19653
|
+
const handleChange = useCallback9((event) => {
|
|
19658
19654
|
setValue(event.target.value);
|
|
19659
19655
|
}, [
|
|
19660
19656
|
setValue
|
|
@@ -19979,17 +19975,17 @@ function inspectMetadata(value) {
|
|
|
19979
19975
|
var PreObjectType = (props) => {
|
|
19980
19976
|
const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
|
|
19981
19977
|
const textColor = useTextColor();
|
|
19982
|
-
const isArrayLike =
|
|
19978
|
+
const isArrayLike = useMemo7(() => Array.isArray(props.value) || props.value instanceof Set, [
|
|
19983
19979
|
props.value
|
|
19984
19980
|
]);
|
|
19985
|
-
const isEmptyValue =
|
|
19981
|
+
const isEmptyValue = useMemo7(() => getValueSize(props.value) === 0, [
|
|
19986
19982
|
props.value
|
|
19987
19983
|
]);
|
|
19988
|
-
const sizeOfValue =
|
|
19984
|
+
const sizeOfValue = useMemo7(() => inspectMetadata(props.value), [
|
|
19989
19985
|
props.value
|
|
19990
19986
|
]);
|
|
19991
19987
|
const displaySize = useJsonViewerStore((store) => store.displaySize);
|
|
19992
|
-
const shouldDisplaySize =
|
|
19988
|
+
const shouldDisplaySize = useMemo7(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
|
|
19993
19989
|
displaySize,
|
|
19994
19990
|
props.path,
|
|
19995
19991
|
props.value
|
|
@@ -20037,17 +20033,17 @@ var PreObjectType = (props) => {
|
|
|
20037
20033
|
var PostObjectType = (props) => {
|
|
20038
20034
|
const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
|
|
20039
20035
|
const textColor = useTextColor();
|
|
20040
|
-
const isArrayLike =
|
|
20036
|
+
const isArrayLike = useMemo7(() => Array.isArray(props.value) || props.value instanceof Set, [
|
|
20041
20037
|
props.value
|
|
20042
20038
|
]);
|
|
20043
|
-
const isEmptyValue =
|
|
20039
|
+
const isEmptyValue = useMemo7(() => getValueSize(props.value) === 0, [
|
|
20044
20040
|
props.value
|
|
20045
20041
|
]);
|
|
20046
|
-
const sizeOfValue =
|
|
20042
|
+
const sizeOfValue = useMemo7(() => inspectMetadata(props.value), [
|
|
20047
20043
|
props.value
|
|
20048
20044
|
]);
|
|
20049
20045
|
const displaySize = useJsonViewerStore((store) => store.displaySize);
|
|
20050
|
-
const shouldDisplaySize =
|
|
20046
|
+
const shouldDisplaySize = useMemo7(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
|
|
20051
20047
|
displaySize,
|
|
20052
20048
|
props.path,
|
|
20053
20049
|
props.value
|
|
@@ -20086,7 +20082,7 @@ var ObjectType = (props) => {
|
|
|
20086
20082
|
const isTrap = useIsCycleReference(props.path, props.value);
|
|
20087
20083
|
const [displayLength, setDisplayLength] = useState11(useJsonViewerStore((store) => store.maxDisplayLength));
|
|
20088
20084
|
const objectSortKeys = useJsonViewerStore((store) => store.objectSortKeys);
|
|
20089
|
-
const elements =
|
|
20085
|
+
const elements = useMemo7(() => {
|
|
20090
20086
|
if (!props.inspect) {
|
|
20091
20087
|
return null;
|
|
20092
20088
|
}
|
|
@@ -20247,7 +20243,7 @@ var ObjectType = (props) => {
|
|
|
20247
20243
|
const marginLeft = props.inspect ? 0.6 : 0;
|
|
20248
20244
|
const width = useJsonViewerStore((store) => store.indentWidth);
|
|
20249
20245
|
const indentWidth = props.inspect ? width - marginLeft : width;
|
|
20250
|
-
const isEmptyValue =
|
|
20246
|
+
const isEmptyValue = useMemo7(() => getValueSize(props.value) === 0, [
|
|
20251
20247
|
props.value
|
|
20252
20248
|
]);
|
|
20253
20249
|
if (isEmptyValue) {
|
|
@@ -20406,7 +20402,7 @@ function matchTypeComponents(value, path, registry) {
|
|
|
20406
20402
|
}
|
|
20407
20403
|
function useTypeComponents(value, path) {
|
|
20408
20404
|
const registry = useTypeRegistryStore((store) => store.registry);
|
|
20409
|
-
return
|
|
20405
|
+
return useMemo7(() => matchTypeComponents(value, path, registry), [
|
|
20410
20406
|
value,
|
|
20411
20407
|
path,
|
|
20412
20408
|
registry
|
|
@@ -20427,7 +20423,7 @@ var DataKeyPair = (props) => {
|
|
|
20427
20423
|
var _props_editable;
|
|
20428
20424
|
const propsEditable = (_props_editable = props.editable) !== null && _props_editable !== void 0 ? _props_editable : void 0;
|
|
20429
20425
|
const storeEditable = useJsonViewerStore((store) => store.editable);
|
|
20430
|
-
const editable =
|
|
20426
|
+
const editable = useMemo7(() => {
|
|
20431
20427
|
if (storeEditable === false) {
|
|
20432
20428
|
return false;
|
|
20433
20429
|
}
|
|
@@ -20448,7 +20444,7 @@ var DataKeyPair = (props) => {
|
|
|
20448
20444
|
const depth = path.length;
|
|
20449
20445
|
const key = path[depth - 1];
|
|
20450
20446
|
const hoverPath = useJsonViewerStore((store) => store.hoverPath);
|
|
20451
|
-
const isHover =
|
|
20447
|
+
const isHover = useMemo7(() => {
|
|
20452
20448
|
return hoverPath && path.every((value2, index) => value2 === hoverPath.path[index] && nestedIndex === hoverPath.nestedIndex);
|
|
20453
20449
|
}, [
|
|
20454
20450
|
hoverPath,
|
|
@@ -20470,7 +20466,7 @@ var DataKeyPair = (props) => {
|
|
|
20470
20466
|
const isNumberKey = Number.isInteger(Number(key));
|
|
20471
20467
|
const storeEnableAdd = useJsonViewerStore((store) => store.enableAdd);
|
|
20472
20468
|
const onAdd = useJsonViewerStore((store) => store.onAdd);
|
|
20473
|
-
const enableAdd =
|
|
20469
|
+
const enableAdd = useMemo7(() => {
|
|
20474
20470
|
if (!onAdd || nestedIndex !== void 0) return false;
|
|
20475
20471
|
if (storeEnableAdd === false) {
|
|
20476
20472
|
return false;
|
|
@@ -20495,7 +20491,7 @@ var DataKeyPair = (props) => {
|
|
|
20495
20491
|
]);
|
|
20496
20492
|
const storeEnableDelete = useJsonViewerStore((store) => store.enableDelete);
|
|
20497
20493
|
const onDelete = useJsonViewerStore((store) => store.onDelete);
|
|
20498
|
-
const enableDelete =
|
|
20494
|
+
const enableDelete = useMemo7(() => {
|
|
20499
20495
|
if (!onDelete || nestedIndex !== void 0) return false;
|
|
20500
20496
|
if (isRoot) {
|
|
20501
20497
|
return false;
|
|
@@ -20522,7 +20518,7 @@ var DataKeyPair = (props) => {
|
|
|
20522
20518
|
const enableClipboard = useJsonViewerStore((store) => store.enableClipboard);
|
|
20523
20519
|
const { copy, copied } = useClipboard();
|
|
20524
20520
|
const highlightUpdates = useJsonViewerStore((store) => store.highlightUpdates);
|
|
20525
|
-
const isHighlight =
|
|
20521
|
+
const isHighlight = useMemo7(() => {
|
|
20526
20522
|
if (!highlightUpdates || prevValue === void 0) return false;
|
|
20527
20523
|
if (typeof value !== typeof prevValue) {
|
|
20528
20524
|
return true;
|
|
@@ -20567,7 +20563,7 @@ var DataKeyPair = (props) => {
|
|
|
20567
20563
|
prevValue,
|
|
20568
20564
|
value
|
|
20569
20565
|
]);
|
|
20570
|
-
const startEditing =
|
|
20566
|
+
const startEditing = useCallback9((event) => {
|
|
20571
20567
|
event.preventDefault();
|
|
20572
20568
|
if (serialize) setTempValue(serialize(value));
|
|
20573
20569
|
setEditing(true);
|
|
@@ -20575,14 +20571,14 @@ var DataKeyPair = (props) => {
|
|
|
20575
20571
|
serialize,
|
|
20576
20572
|
value
|
|
20577
20573
|
]);
|
|
20578
|
-
const abortEditing =
|
|
20574
|
+
const abortEditing = useCallback9(() => {
|
|
20579
20575
|
setEditing(false);
|
|
20580
20576
|
setTempValue("");
|
|
20581
20577
|
}, [
|
|
20582
20578
|
setEditing,
|
|
20583
20579
|
setTempValue
|
|
20584
20580
|
]);
|
|
20585
|
-
const commitEditing =
|
|
20581
|
+
const commitEditing = useCallback9((newValue) => {
|
|
20586
20582
|
setEditing(false);
|
|
20587
20583
|
if (!deserialize) return;
|
|
20588
20584
|
try {
|
|
@@ -20596,7 +20592,7 @@ var DataKeyPair = (props) => {
|
|
|
20596
20592
|
path,
|
|
20597
20593
|
value
|
|
20598
20594
|
]);
|
|
20599
|
-
const actionIcons =
|
|
20595
|
+
const actionIcons = useMemo7(() => {
|
|
20600
20596
|
if (editing) {
|
|
20601
20597
|
return /* @__PURE__ */ jsxs126(Fragment8, {
|
|
20602
20598
|
children: [
|
|
@@ -20692,12 +20688,12 @@ var DataKeyPair = (props) => {
|
|
|
20692
20688
|
abortEditing,
|
|
20693
20689
|
commitEditing
|
|
20694
20690
|
]);
|
|
20695
|
-
const isEmptyValue =
|
|
20691
|
+
const isEmptyValue = useMemo7(() => getValueSize(value) === 0, [
|
|
20696
20692
|
value
|
|
20697
20693
|
]);
|
|
20698
20694
|
const expandable = !isEmptyValue && !!(PreComponent && PostComponent);
|
|
20699
20695
|
const KeyRenderer = useJsonViewerStore((store) => store.keyRenderer);
|
|
20700
|
-
const downstreamProps =
|
|
20696
|
+
const downstreamProps = useMemo7(() => ({
|
|
20701
20697
|
path,
|
|
20702
20698
|
inspect,
|
|
20703
20699
|
setInspect,
|
|
@@ -20718,7 +20714,7 @@ var DataKeyPair = (props) => {
|
|
|
20718
20714
|
sx: {
|
|
20719
20715
|
userSelect: "text"
|
|
20720
20716
|
},
|
|
20721
|
-
onMouseEnter:
|
|
20717
|
+
onMouseEnter: useCallback9(() => setHover(path, nestedIndex), [
|
|
20722
20718
|
setHover,
|
|
20723
20719
|
path,
|
|
20724
20720
|
nestedIndex
|
|
@@ -20733,7 +20729,7 @@ var DataKeyPair = (props) => {
|
|
|
20733
20729
|
letterSpacing: 0.5,
|
|
20734
20730
|
opacity: 0.8
|
|
20735
20731
|
},
|
|
20736
|
-
onClick:
|
|
20732
|
+
onClick: useCallback9((event) => {
|
|
20737
20733
|
if (event.isDefaultPrevented()) {
|
|
20738
20734
|
return;
|
|
20739
20735
|
}
|
|
@@ -20915,7 +20911,7 @@ var JsonViewerInner = (props) => {
|
|
|
20915
20911
|
setState,
|
|
20916
20912
|
props.theme
|
|
20917
20913
|
]);
|
|
20918
|
-
const themeCls =
|
|
20914
|
+
const themeCls = useMemo7(() => {
|
|
20919
20915
|
if (typeof props.theme === "object") return "json-viewer-theme-custom";
|
|
20920
20916
|
return props.theme === "dark" ? "json-viewer-theme-dark" : "json-viewer-theme-light";
|
|
20921
20917
|
}, [
|
|
@@ -20947,9 +20943,9 @@ var JsonViewerInner = (props) => {
|
|
|
20947
20943
|
]);
|
|
20948
20944
|
const value = useJsonViewerStore((store) => store.value);
|
|
20949
20945
|
const prevValue = useJsonViewerStore((store) => store.prevValue);
|
|
20950
|
-
const emptyPath =
|
|
20946
|
+
const emptyPath = useMemo7(() => [], []);
|
|
20951
20947
|
const setHover = useJsonViewerStore((store) => store.setHover);
|
|
20952
|
-
const onMouseLeave =
|
|
20948
|
+
const onMouseLeave = useCallback9(() => setHover(null), [
|
|
20953
20949
|
setHover
|
|
20954
20950
|
]);
|
|
20955
20951
|
return /* @__PURE__ */ jsx136(Paper2, {
|
|
@@ -20978,14 +20974,14 @@ var JsonViewer = function JsonViewer2(props) {
|
|
|
20978
20974
|
}
|
|
20979
20975
|
}
|
|
20980
20976
|
const isAutoDarkTheme = useThemeDetector();
|
|
20981
|
-
const themeType =
|
|
20977
|
+
const themeType = useMemo7(() => {
|
|
20982
20978
|
var _props_theme;
|
|
20983
20979
|
return props.theme === "auto" ? isAutoDarkTheme ? "dark" : "light" : (_props_theme = props.theme) !== null && _props_theme !== void 0 ? _props_theme : "light";
|
|
20984
20980
|
}, [
|
|
20985
20981
|
isAutoDarkTheme,
|
|
20986
20982
|
props.theme
|
|
20987
20983
|
]);
|
|
20988
|
-
const theme =
|
|
20984
|
+
const theme = useMemo7(() => {
|
|
20989
20985
|
const backgroundColor = typeof themeType === "object" ? themeType.base00 : themeType === "dark" ? darkColorspace.base00 : lightColorspace.base00;
|
|
20990
20986
|
const foregroundColor = typeof themeType === "object" ? themeType.base07 : themeType === "dark" ? darkColorspace.base07 : lightColorspace.base07;
|
|
20991
20987
|
return createTheme({
|
|
@@ -21013,8 +21009,8 @@ var JsonViewer = function JsonViewer2(props) {
|
|
|
21013
21009
|
...props,
|
|
21014
21010
|
theme: themeType
|
|
21015
21011
|
};
|
|
21016
|
-
const jsonViewerStore =
|
|
21017
|
-
const typeRegistryStore =
|
|
21012
|
+
const jsonViewerStore = useMemo7(() => createJsonViewerStore(props), []);
|
|
21013
|
+
const typeRegistryStore = useMemo7(() => createTypeRegistryStore(), []);
|
|
21018
21014
|
return /* @__PURE__ */ jsx136(ThemeProvider, {
|
|
21019
21015
|
theme,
|
|
21020
21016
|
children: /* @__PURE__ */ jsx136(TypeRegistryStoreContext.Provider, {
|
|
@@ -21067,8 +21063,8 @@ var EventMessage = ({ event }) => {
|
|
|
21067
21063
|
const [isOpen, setIsOpen] = useState12(false);
|
|
21068
21064
|
const [isOverflowing, setIsOverflowing] = useState12(false);
|
|
21069
21065
|
const textReference = useRef12(null);
|
|
21070
|
-
const parsedMessage =
|
|
21071
|
-
const isIAMPolicyEvent =
|
|
21066
|
+
const parsedMessage = useMemo8(() => parseEventMessage(event), [event]);
|
|
21067
|
+
const isIAMPolicyEvent = useMemo8(
|
|
21072
21068
|
() => event.event_type === "iam.policy_evaluation" && event.attributes?.payload && typeof event.attributes.payload === "string",
|
|
21073
21069
|
[event]
|
|
21074
21070
|
);
|
|
@@ -21085,11 +21081,11 @@ var EventMessage = ({ event }) => {
|
|
|
21085
21081
|
window.removeEventListener("resize", checkOverflow);
|
|
21086
21082
|
};
|
|
21087
21083
|
}, [parsedMessage.headline]);
|
|
21088
|
-
const hasAdditionalContent =
|
|
21084
|
+
const hasAdditionalContent = useMemo8(
|
|
21089
21085
|
() => parsedMessage.message || parsedMessage.details || isIAMPolicyEvent,
|
|
21090
21086
|
[parsedMessage.message, parsedMessage.details, isIAMPolicyEvent]
|
|
21091
21087
|
);
|
|
21092
|
-
const shouldShowToggle =
|
|
21088
|
+
const shouldShowToggle = useMemo8(
|
|
21093
21089
|
() => isOverflowing || hasAdditionalContent,
|
|
21094
21090
|
[isOverflowing, hasAdditionalContent]
|
|
21095
21091
|
);
|
|
@@ -31128,9 +31124,9 @@ var QueryStatus = {
|
|
|
31128
31124
|
|
|
31129
31125
|
// src/components/event-details/lambda-invoke-logs-section.tsx
|
|
31130
31126
|
import { Box as Box14, CircularProgress as CircularProgress3, Stack as Stack2, Typography as Typography9 } from "@mui/material";
|
|
31131
|
-
import { useEffect as useEffect19, useMemo as
|
|
31127
|
+
import { useEffect as useEffect19, useMemo as useMemo9, useRef as useRef13, useState as useState13 } from "react";
|
|
31132
31128
|
import { jsx as jsx139, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
31133
|
-
var
|
|
31129
|
+
var POLL_INTERVAL_MS2 = 1e3;
|
|
31134
31130
|
async function pollQueryResults(client, queryId) {
|
|
31135
31131
|
return client.send(new GetQueryResultsCommand({ queryId }));
|
|
31136
31132
|
}
|
|
@@ -31146,7 +31142,7 @@ async function startLambdaLogsQuery(client, functionName2, requestId, startTimeS
|
|
|
31146
31142
|
}
|
|
31147
31143
|
function useCloudWatchLogsClient(region) {
|
|
31148
31144
|
const { localstackEndpoint } = useAppInspector();
|
|
31149
|
-
const client =
|
|
31145
|
+
const client = useMemo9(() => new CloudWatchLogsClient({
|
|
31150
31146
|
credentials: {
|
|
31151
31147
|
accessKeyId: "test",
|
|
31152
31148
|
secretAccessKey: "test"
|
|
@@ -31191,7 +31187,7 @@ function useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, en
|
|
|
31191
31187
|
setError(new Error(`Query ended with status: ${status}`));
|
|
31192
31188
|
setLoading(false);
|
|
31193
31189
|
} else {
|
|
31194
|
-
pollTimerRef.current = setTimeout(() => void poll(),
|
|
31190
|
+
pollTimerRef.current = setTimeout(() => void poll(), POLL_INTERVAL_MS2);
|
|
31195
31191
|
}
|
|
31196
31192
|
} catch (error_) {
|
|
31197
31193
|
if (!cancelled) {
|
|
@@ -31296,7 +31292,7 @@ var checkIsSqsSendMessage = (span) => {
|
|
|
31296
31292
|
return span.operation_name.startsWith("SendMessage");
|
|
31297
31293
|
};
|
|
31298
31294
|
var EventDetails = ({ onClose, selectedEvent }) => {
|
|
31299
|
-
const eventGroups =
|
|
31295
|
+
const eventGroups = useMemo10(
|
|
31300
31296
|
() => getEventGroupsByType(selectedEvent?.events ?? []),
|
|
31301
31297
|
[selectedEvent?.events]
|
|
31302
31298
|
);
|
|
@@ -31528,7 +31524,7 @@ import { Box as Box17, Divider as Divider5, Stack as Stack4, Tooltip as Tooltip6
|
|
|
31528
31524
|
import { Handle, Position } from "@xyflow/react";
|
|
31529
31525
|
import "@xyflow/react/dist/style.css";
|
|
31530
31526
|
import "react";
|
|
31531
|
-
import { memo as memo12, useMemo as
|
|
31527
|
+
import { memo as memo12, useMemo as useMemo11, useRef as useRef14, useState as useState16 } from "react";
|
|
31532
31528
|
import { Fragment as Fragment11, jsx as jsx142, jsxs as jsxs131 } from "react/jsx-runtime";
|
|
31533
31529
|
var handleStyle = {
|
|
31534
31530
|
backgroundColor: "white",
|
|
@@ -31616,7 +31612,7 @@ var ServiceNode = memo12(({ data, selected }) => {
|
|
|
31616
31612
|
const [isHovered, setIsHovered] = useState16(false);
|
|
31617
31613
|
const nodeRef = useRef14(null);
|
|
31618
31614
|
const isError = data.event.status_code === 2;
|
|
31619
|
-
const hasPermissionEvents =
|
|
31615
|
+
const hasPermissionEvents = useMemo11(
|
|
31620
31616
|
() => data.event.events.some(
|
|
31621
31617
|
(event) => event.event_type === "iam.policy_evaluation" && event.name === "iam.policy.denied"
|
|
31622
31618
|
),
|
|
@@ -31964,7 +31960,7 @@ var TraceGraph = ({
|
|
|
31964
31960
|
};
|
|
31965
31961
|
|
|
31966
31962
|
// src/pages/trace-graph-page.tsx
|
|
31967
|
-
import {
|
|
31963
|
+
import { jsx as jsx145, jsxs as jsxs134 } from "react/jsx-runtime";
|
|
31968
31964
|
var HEADER_HEIGHT = 56;
|
|
31969
31965
|
var DRAWER_WIDTH = "35%";
|
|
31970
31966
|
var Main = styled("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
|
|
@@ -31999,90 +31995,75 @@ var TraceGraphView = ({
|
|
|
31999
31995
|
fetchError,
|
|
32000
31996
|
fetchSpans,
|
|
32001
31997
|
handleClose,
|
|
32002
|
-
handleEnable,
|
|
32003
31998
|
handleEventSelect,
|
|
32004
|
-
handleRetry,
|
|
32005
31999
|
loading,
|
|
32006
32000
|
navigateToSpansList,
|
|
32007
32001
|
open,
|
|
32008
32002
|
selectedEvent,
|
|
32009
32003
|
spanId,
|
|
32010
32004
|
spans,
|
|
32011
|
-
status,
|
|
32012
|
-
statusError,
|
|
32013
32005
|
traceId
|
|
32014
|
-
}) =>
|
|
32015
|
-
|
|
32016
|
-
|
|
32017
|
-
|
|
32018
|
-
{
|
|
32019
|
-
"
|
|
32020
|
-
|
|
32021
|
-
|
|
32022
|
-
|
|
32023
|
-
|
|
32024
|
-
|
|
32025
|
-
|
|
32026
|
-
|
|
32027
|
-
},
|
|
32028
|
-
|
|
32029
|
-
|
|
32030
|
-
|
|
32031
|
-
|
|
32032
|
-
|
|
32033
|
-
|
|
32034
|
-
|
|
32035
|
-
|
|
32036
|
-
|
|
32037
|
-
|
|
32038
|
-
|
|
32039
|
-
|
|
32040
|
-
|
|
32041
|
-
|
|
32042
|
-
|
|
32043
|
-
|
|
32044
|
-
|
|
32045
|
-
|
|
32046
|
-
StatusMessage,
|
|
32006
|
+
}) => /* @__PURE__ */ jsxs134(
|
|
32007
|
+
Box19,
|
|
32008
|
+
{
|
|
32009
|
+
"data-testid": TRACE_GRAPH_PAGE_TEST_ID,
|
|
32010
|
+
sx: {
|
|
32011
|
+
alignItems: "center",
|
|
32012
|
+
display: "flex",
|
|
32013
|
+
flexDirection: "column",
|
|
32014
|
+
flexGrow: 1,
|
|
32015
|
+
gap: 2,
|
|
32016
|
+
overflow: "hidden"
|
|
32017
|
+
},
|
|
32018
|
+
children: [
|
|
32019
|
+
/* @__PURE__ */ jsxs134(Box19, { sx: { display: "flex", width: "100%" }, children: [
|
|
32020
|
+
/* @__PURE__ */ jsx145(Button6, { onClick: () => {
|
|
32021
|
+
navigateToSpansList();
|
|
32022
|
+
}, startIcon: /* @__PURE__ */ jsx145(ArrowBack, {}), children: "Go back" }),
|
|
32023
|
+
/* @__PURE__ */ jsx145(Box19, { sx: { flexGrow: 1 } })
|
|
32024
|
+
] }),
|
|
32025
|
+
/* @__PURE__ */ jsxs134(
|
|
32026
|
+
Paper3,
|
|
32027
|
+
{
|
|
32028
|
+
sx: {
|
|
32029
|
+
display: "flex",
|
|
32030
|
+
flexGrow: 1,
|
|
32031
|
+
overflow: "hidden",
|
|
32032
|
+
position: "relative",
|
|
32033
|
+
width: "100%"
|
|
32034
|
+
},
|
|
32035
|
+
children: [
|
|
32036
|
+
/* @__PURE__ */ jsx145(Main, { open, children: /* @__PURE__ */ jsx145(
|
|
32037
|
+
Box19,
|
|
32047
32038
|
{
|
|
32048
|
-
|
|
32049
|
-
|
|
32050
|
-
|
|
32051
|
-
|
|
32052
|
-
|
|
32053
|
-
|
|
32054
|
-
|
|
32055
|
-
|
|
32056
|
-
|
|
32057
|
-
|
|
32058
|
-
|
|
32059
|
-
|
|
32060
|
-
|
|
32061
|
-
|
|
32062
|
-
|
|
32063
|
-
|
|
32064
|
-
initialFocusEventId: spanId,
|
|
32065
|
-
onEventSelect: handleEventSelect,
|
|
32066
|
-
onRefresh: () => {
|
|
32067
|
-
fetchSpans();
|
|
32068
|
-
},
|
|
32069
|
-
spans: {
|
|
32070
|
-
data: spans,
|
|
32071
|
-
error: fetchError,
|
|
32072
|
-
loading
|
|
32073
|
-
}
|
|
32039
|
+
sx: {
|
|
32040
|
+
height: "100%",
|
|
32041
|
+
overflow: "auto"
|
|
32042
|
+
},
|
|
32043
|
+
children: traceId !== void 0 && /* @__PURE__ */ jsx145(ReactFlowProvider, { children: /* @__PURE__ */ jsx145(
|
|
32044
|
+
TraceGraph,
|
|
32045
|
+
{
|
|
32046
|
+
initialFocusEventId: spanId,
|
|
32047
|
+
onEventSelect: handleEventSelect,
|
|
32048
|
+
onRefresh: () => {
|
|
32049
|
+
fetchSpans();
|
|
32050
|
+
},
|
|
32051
|
+
spans: {
|
|
32052
|
+
data: spans,
|
|
32053
|
+
error: fetchError,
|
|
32054
|
+
loading
|
|
32074
32055
|
}
|
|
32075
|
-
|
|
32076
|
-
}
|
|
32077
|
-
|
|
32078
|
-
|
|
32079
|
-
|
|
32080
|
-
|
|
32081
|
-
|
|
32082
|
-
|
|
32083
|
-
|
|
32084
|
-
|
|
32085
|
-
|
|
32056
|
+
}
|
|
32057
|
+
) })
|
|
32058
|
+
}
|
|
32059
|
+
) }),
|
|
32060
|
+
/* @__PURE__ */ jsx145(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ jsx145(EventDetails, { onClose: handleClose, selectedEvent }) })
|
|
32061
|
+
]
|
|
32062
|
+
}
|
|
32063
|
+
)
|
|
32064
|
+
]
|
|
32065
|
+
}
|
|
32066
|
+
);
|
|
32086
32067
|
async function fetchConnectedTraces(api, traceIds, allSpans = /* @__PURE__ */ new Map(), processedTraceIds = /* @__PURE__ */ new Set()) {
|
|
32087
32068
|
const newTraceIds = traceIds.filter((id2) => !processedTraceIds.has(id2));
|
|
32088
32069
|
if (newTraceIds.length === 0) {
|
|
@@ -32122,7 +32103,7 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32122
32103
|
const [spans, setSpans] = useState17();
|
|
32123
32104
|
const [loading, setLoading] = useState17(false);
|
|
32124
32105
|
const [fetchError, setFetchError] = useState17();
|
|
32125
|
-
const fetchSpans =
|
|
32106
|
+
const fetchSpans = useCallback10(async () => {
|
|
32126
32107
|
setLoading(true);
|
|
32127
32108
|
try {
|
|
32128
32109
|
const spans2 = await fetchConnectedTraces(api, [traceId]);
|
|
@@ -32147,25 +32128,12 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32147
32128
|
spansReference.current = spans;
|
|
32148
32129
|
}
|
|
32149
32130
|
}, [spans, setSelectedEvent, spanId]);
|
|
32150
|
-
const
|
|
32151
|
-
useEffect21(() => {
|
|
32152
|
-
if (fetchError instanceof AppInspectorDisabledError || fetchError instanceof ConnectionError) {
|
|
32153
|
-
reportDisabled();
|
|
32154
|
-
}
|
|
32155
|
-
}, [fetchError, reportDisabled]);
|
|
32156
|
-
const handleEnable = useCallback11(async () => {
|
|
32157
|
-
await api.setStatus({ status: "ENABLED" });
|
|
32158
|
-
void checkStatus();
|
|
32159
|
-
}, [api, checkStatus]);
|
|
32160
|
-
const handleEventSelect = useCallback11((spanId2) => {
|
|
32131
|
+
const handleEventSelect = useCallback10((spanId2) => {
|
|
32161
32132
|
const span = spans?.find((s) => s.span_id === spanId2);
|
|
32162
32133
|
setSelectedEvent(span);
|
|
32163
32134
|
setOpen(true);
|
|
32164
32135
|
}, [spans]);
|
|
32165
|
-
const
|
|
32166
|
-
void checkStatus();
|
|
32167
|
-
}, [checkStatus]);
|
|
32168
|
-
const navigateToSpansList = useCallback11(() => {
|
|
32136
|
+
const navigateToSpansList = useCallback10(() => {
|
|
32169
32137
|
onClose?.();
|
|
32170
32138
|
}, [onClose]);
|
|
32171
32139
|
return /* @__PURE__ */ jsx145(
|
|
@@ -32176,24 +32144,20 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32176
32144
|
handleClose: () => {
|
|
32177
32145
|
setOpen(false);
|
|
32178
32146
|
},
|
|
32179
|
-
handleEnable,
|
|
32180
32147
|
handleEventSelect,
|
|
32181
|
-
handleRetry,
|
|
32182
32148
|
loading,
|
|
32183
32149
|
navigateToSpansList,
|
|
32184
32150
|
open,
|
|
32185
32151
|
selectedEvent,
|
|
32186
32152
|
spanId: spanId ?? void 0,
|
|
32187
32153
|
spans,
|
|
32188
|
-
status,
|
|
32189
|
-
statusError,
|
|
32190
32154
|
traceId
|
|
32191
32155
|
}
|
|
32192
32156
|
);
|
|
32193
32157
|
};
|
|
32194
32158
|
|
|
32195
32159
|
// src/pages/spans-list-page.tsx
|
|
32196
|
-
import { Fragment as
|
|
32160
|
+
import { Fragment as Fragment13, jsx as jsx146, jsxs as jsxs135 } from "react/jsx-runtime";
|
|
32197
32161
|
var SpansListPage = () => {
|
|
32198
32162
|
const api = useAppInspectorApi();
|
|
32199
32163
|
const {
|
|
@@ -32201,7 +32165,6 @@ var SpansListPage = () => {
|
|
|
32201
32165
|
clearingSpans,
|
|
32202
32166
|
clearSpans,
|
|
32203
32167
|
errorCount,
|
|
32204
|
-
fetchBackward,
|
|
32205
32168
|
fetchError,
|
|
32206
32169
|
fetchForward,
|
|
32207
32170
|
fetchingBackward,
|
|
@@ -32210,14 +32173,12 @@ var SpansListPage = () => {
|
|
|
32210
32173
|
hasMoreForward,
|
|
32211
32174
|
licenseLimit,
|
|
32212
32175
|
spans,
|
|
32213
|
-
streamPaused,
|
|
32214
32176
|
systemLimit,
|
|
32215
|
-
toggleStream,
|
|
32216
32177
|
totalCount,
|
|
32217
32178
|
warningCount
|
|
32218
32179
|
} = useSpans();
|
|
32219
|
-
const {
|
|
32220
|
-
const clearSpansSync =
|
|
32180
|
+
const { checkStatus, phase, status, statusError } = useAppInspectorStatus();
|
|
32181
|
+
const clearSpansSync = useCallback11(() => {
|
|
32221
32182
|
void clearSpans();
|
|
32222
32183
|
}, [clearSpans]);
|
|
32223
32184
|
const localstackVersion = status?.localstackVersion ?? (statusError instanceof AppInspectorNotFoundError ? statusError.localstackVersion : void 0);
|
|
@@ -32226,18 +32187,18 @@ var SpansListPage = () => {
|
|
|
32226
32187
|
const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
|
|
32227
32188
|
const [selectedTraceId, setSelectedTraceId] = useState18();
|
|
32228
32189
|
const [selectedSpanId, setSelectedSpanId] = useState18();
|
|
32229
|
-
const navigateToSpan =
|
|
32190
|
+
const navigateToSpan = useCallback11((span) => {
|
|
32230
32191
|
setSelectedTraceId(span.trace_id);
|
|
32231
32192
|
setSelectedSpanId(span.span_id);
|
|
32232
32193
|
}, []);
|
|
32233
|
-
const handleRetry =
|
|
32234
|
-
|
|
32194
|
+
const handleRetry = useCallback11(() => {
|
|
32195
|
+
checkStatus();
|
|
32235
32196
|
fetchForward();
|
|
32236
32197
|
}, [checkStatus, fetchForward]);
|
|
32237
|
-
const handleEnable =
|
|
32198
|
+
const handleEnable = useCallback11(async () => {
|
|
32238
32199
|
await api.setStatus({ status: "ENABLED" });
|
|
32239
32200
|
clearFetchError();
|
|
32240
|
-
|
|
32201
|
+
checkStatus();
|
|
32241
32202
|
}, [api, checkStatus, clearFetchError]);
|
|
32242
32203
|
const isDelayedRefetchRef = useRef16(false);
|
|
32243
32204
|
const delayedRefetchTimerRef = useRef16();
|
|
@@ -32260,29 +32221,44 @@ var SpansListPage = () => {
|
|
|
32260
32221
|
clearTimeout(delayedRefetchTimerRef.current);
|
|
32261
32222
|
};
|
|
32262
32223
|
}, [fetchingForward, fetchForward]);
|
|
32263
|
-
|
|
32264
|
-
|
|
32265
|
-
|
|
32266
|
-
StatusMessage,
|
|
32267
|
-
|
|
32268
|
-
|
|
32269
|
-
|
|
32270
|
-
|
|
32271
|
-
|
|
32272
|
-
|
|
32273
|
-
|
|
32274
|
-
|
|
32275
|
-
|
|
32276
|
-
|
|
32277
|
-
|
|
32278
|
-
|
|
32279
|
-
|
|
32280
|
-
|
|
32281
|
-
|
|
32282
|
-
|
|
32283
|
-
|
|
32224
|
+
switch (phase) {
|
|
32225
|
+
case "CHECKING_STATUS":
|
|
32226
|
+
case "CONNECTING_WS": {
|
|
32227
|
+
return /* @__PURE__ */ jsx146(StatusMessage, { phase });
|
|
32228
|
+
}
|
|
32229
|
+
case "DISABLED": {
|
|
32230
|
+
return /* @__PURE__ */ jsx146(
|
|
32231
|
+
StatusMessage,
|
|
32232
|
+
{
|
|
32233
|
+
onEnable: handleEnable,
|
|
32234
|
+
phase
|
|
32235
|
+
}
|
|
32236
|
+
);
|
|
32237
|
+
}
|
|
32238
|
+
case "INCOMPATIBLE": {
|
|
32239
|
+
return /* @__PURE__ */ jsx146(
|
|
32240
|
+
StatusMessage,
|
|
32241
|
+
{
|
|
32242
|
+
localstackVersion,
|
|
32243
|
+
onRetry: handleRetry,
|
|
32244
|
+
phase
|
|
32245
|
+
}
|
|
32246
|
+
);
|
|
32247
|
+
}
|
|
32248
|
+
case "LIVE": {
|
|
32249
|
+
break;
|
|
32250
|
+
}
|
|
32251
|
+
case "UNREACHABLE": {
|
|
32252
|
+
return /* @__PURE__ */ jsx146(
|
|
32253
|
+
StatusMessage,
|
|
32254
|
+
{
|
|
32255
|
+
onRetry: handleRetry,
|
|
32256
|
+
phase
|
|
32257
|
+
}
|
|
32258
|
+
);
|
|
32259
|
+
}
|
|
32284
32260
|
}
|
|
32285
|
-
return /* @__PURE__ */ jsxs135(
|
|
32261
|
+
return /* @__PURE__ */ jsxs135(Fragment13, { children: [
|
|
32286
32262
|
/* @__PURE__ */ jsxs135(
|
|
32287
32263
|
Box20,
|
|
32288
32264
|
{
|
|
@@ -32299,7 +32275,7 @@ var SpansListPage = () => {
|
|
|
32299
32275
|
width: "100%"
|
|
32300
32276
|
},
|
|
32301
32277
|
children: [
|
|
32302
|
-
|
|
32278
|
+
/* @__PURE__ */ jsx146(
|
|
32303
32279
|
EmulatorVersionBanner,
|
|
32304
32280
|
{
|
|
32305
32281
|
compatibility: bannerDismissed && versionCompatibility === "warning" ? "ok" : versionCompatibility,
|
|
@@ -32321,14 +32297,11 @@ var SpansListPage = () => {
|
|
|
32321
32297
|
hasMoreForward,
|
|
32322
32298
|
licenseLimit,
|
|
32323
32299
|
onClearSpans: clearSpansSync,
|
|
32324
|
-
onFetchBackward: fetchBackward,
|
|
32325
32300
|
onFetchForward: fetchForward,
|
|
32326
32301
|
onOrderChange: setOrder,
|
|
32327
32302
|
onSpanClick: navigateToSpan,
|
|
32328
|
-
onToggleStream: toggleStream,
|
|
32329
32303
|
order: order2,
|
|
32330
32304
|
spans,
|
|
32331
|
-
streamPaused,
|
|
32332
32305
|
systemLimit,
|
|
32333
32306
|
totalCount,
|
|
32334
32307
|
warningCount
|