@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.cjs
CHANGED
|
@@ -77,7 +77,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
77
77
|
|
|
78
78
|
// src/pages/spans-list-page.tsx
|
|
79
79
|
var import_material20 = require("@mui/material");
|
|
80
|
-
var
|
|
80
|
+
var import_react61 = require("react");
|
|
81
81
|
|
|
82
82
|
// src/components/spans-list/spans-list.tsx
|
|
83
83
|
var import_material5 = require("@mui/material");
|
|
@@ -12154,11 +12154,9 @@ var SpansDataGrid = ({
|
|
|
12154
12154
|
fetchingForward,
|
|
12155
12155
|
hasMoreBackward,
|
|
12156
12156
|
hasMoreForward,
|
|
12157
|
-
includeReadOperations = false,
|
|
12158
12157
|
onClearSpans,
|
|
12159
12158
|
onFetchBackward,
|
|
12160
12159
|
onFetchForward,
|
|
12161
|
-
onIncludeReadOperationsChange,
|
|
12162
12160
|
onSpanClick,
|
|
12163
12161
|
spans
|
|
12164
12162
|
}) => {
|
|
@@ -12240,22 +12238,6 @@ var SpansDataGrid = ({
|
|
|
12240
12238
|
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_jsx_runtime124.Fragment, { children: [
|
|
12241
12239
|
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material4.Grid, { item: true, xs: 12, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_material4.Box, { sx: { alignItems: "center", display: "flex", gap: "0.5rem" }, children: [
|
|
12242
12240
|
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material4.Box, { sx: { flexGrow: 1 } }),
|
|
12243
|
-
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12244
|
-
import_material4.FormControlLabel,
|
|
12245
|
-
{
|
|
12246
|
-
control: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12247
|
-
import_material4.Switch,
|
|
12248
|
-
{
|
|
12249
|
-
checked: includeReadOperations,
|
|
12250
|
-
onChange: (event) => {
|
|
12251
|
-
onIncludeReadOperationsChange(event.target.checked);
|
|
12252
|
-
},
|
|
12253
|
-
size: "small"
|
|
12254
|
-
}
|
|
12255
|
-
),
|
|
12256
|
-
label: "Include Read Operations"
|
|
12257
|
-
}
|
|
12258
|
-
),
|
|
12259
12241
|
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12260
12242
|
import_material4.FormControlLabel,
|
|
12261
12243
|
{
|
|
@@ -12415,11 +12397,9 @@ var SpansList = (props) => {
|
|
|
12415
12397
|
fetchingForward: props.fetchingForward,
|
|
12416
12398
|
hasMoreBackward: props.hasMoreBackward,
|
|
12417
12399
|
hasMoreForward: props.hasMoreForward,
|
|
12418
|
-
includeReadOperations: props.includeReadOperations,
|
|
12419
12400
|
onClearSpans: props.onClearSpans,
|
|
12420
12401
|
onFetchBackward: props.onFetchBackward,
|
|
12421
12402
|
onFetchForward: props.onFetchForward,
|
|
12422
|
-
onIncludeReadOperationsChange: props.onIncludeReadOperationsChange,
|
|
12423
12403
|
onRefresh: props.onRefresh,
|
|
12424
12404
|
onSpanClick: props.onSpanClick,
|
|
12425
12405
|
refetching: props.refetching,
|
|
@@ -12726,69 +12706,18 @@ var StatusMessage = ({
|
|
|
12726
12706
|
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_jsx_runtime126.Fragment, {});
|
|
12727
12707
|
};
|
|
12728
12708
|
|
|
12729
|
-
// src/hooks/use-local-storage.tsx
|
|
12730
|
-
var import_react41 = require("react");
|
|
12731
|
-
function useLocalStorage(key, initialValue) {
|
|
12732
|
-
const [storedValue, setStoredValue] = (0, import_react41.useState)(() => {
|
|
12733
|
-
try {
|
|
12734
|
-
const item = globalThis.localStorage.getItem(key);
|
|
12735
|
-
return item ? JSON.parse(item) : initialValue;
|
|
12736
|
-
} catch (error) {
|
|
12737
|
-
console.error(`Error reading localStorage key "${key}":`, error);
|
|
12738
|
-
return initialValue;
|
|
12739
|
-
}
|
|
12740
|
-
});
|
|
12741
|
-
const setValue = (0, import_react41.useCallback)((value) => {
|
|
12742
|
-
try {
|
|
12743
|
-
setStoredValue(value);
|
|
12744
|
-
globalThis.localStorage.setItem(key, JSON.stringify(value));
|
|
12745
|
-
globalThis.dispatchEvent(new StorageEvent("storage", {
|
|
12746
|
-
key,
|
|
12747
|
-
newValue: JSON.stringify(value)
|
|
12748
|
-
}));
|
|
12749
|
-
} catch (error) {
|
|
12750
|
-
console.error(`Error setting localStorage key "${key}":`, error);
|
|
12751
|
-
}
|
|
12752
|
-
}, [key]);
|
|
12753
|
-
(0, import_react41.useEffect)(() => {
|
|
12754
|
-
const handleStorageChange = (event) => {
|
|
12755
|
-
if (event.key === key && event.newValue !== null) {
|
|
12756
|
-
try {
|
|
12757
|
-
setStoredValue(JSON.parse(event.newValue));
|
|
12758
|
-
} catch (error) {
|
|
12759
|
-
console.error(`Error parsing localStorage key "${key}":`, error);
|
|
12760
|
-
}
|
|
12761
|
-
}
|
|
12762
|
-
};
|
|
12763
|
-
globalThis.addEventListener("storage", handleStorageChange);
|
|
12764
|
-
return () => {
|
|
12765
|
-
globalThis.removeEventListener("storage", handleStorageChange);
|
|
12766
|
-
};
|
|
12767
|
-
}, [key]);
|
|
12768
|
-
return [storedValue, setValue];
|
|
12769
|
-
}
|
|
12770
|
-
|
|
12771
|
-
// src/hooks/use-include-read-operations.tsx
|
|
12772
|
-
var useIncludeReadOperations = () => {
|
|
12773
|
-
const [includeReadOperations, setIncludeReadOperations] = useLocalStorage("includeReadOperations", false);
|
|
12774
|
-
return {
|
|
12775
|
-
includeReadOperations,
|
|
12776
|
-
setIncludeReadOperations
|
|
12777
|
-
};
|
|
12778
|
-
};
|
|
12779
|
-
|
|
12780
12709
|
// src/hooks/use-spans.ts
|
|
12781
|
-
var
|
|
12710
|
+
var import_react46 = require("react");
|
|
12782
12711
|
|
|
12783
12712
|
// src/api/use-api.tsx
|
|
12784
|
-
var
|
|
12713
|
+
var import_react41 = require("react");
|
|
12785
12714
|
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
12786
|
-
var AppInspectorApiContext = (0,
|
|
12715
|
+
var AppInspectorApiContext = (0, import_react41.createContext)(void 0);
|
|
12787
12716
|
var ApiProvider = (props) => {
|
|
12788
12717
|
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(AppInspectorApiContext.Provider, { value: props.api, children: props.children });
|
|
12789
12718
|
};
|
|
12790
12719
|
var useAppInspectorApi = () => {
|
|
12791
|
-
const api = (0,
|
|
12720
|
+
const api = (0, import_react41.useContext)(AppInspectorApiContext);
|
|
12792
12721
|
if (!api) {
|
|
12793
12722
|
throw new Error("useAppInspectorApi must be used within AppInspectorApiProvider");
|
|
12794
12723
|
}
|
|
@@ -12796,15 +12725,15 @@ var useAppInspectorApi = () => {
|
|
|
12796
12725
|
};
|
|
12797
12726
|
|
|
12798
12727
|
// src/hooks/use-status.tsx
|
|
12799
|
-
var
|
|
12728
|
+
var import_react42 = require("react");
|
|
12800
12729
|
var useStatus = () => {
|
|
12801
12730
|
const api = useAppInspectorApi();
|
|
12802
|
-
const [checking, setChecking] = (0,
|
|
12803
|
-
const [status, setStatus] = (0,
|
|
12804
|
-
const [error, setError] = (0,
|
|
12805
|
-
const hasFetchedReference = (0,
|
|
12806
|
-
const abortControllerReference = (0,
|
|
12807
|
-
const checkStatus = (0,
|
|
12731
|
+
const [checking, setChecking] = (0, import_react42.useState)(true);
|
|
12732
|
+
const [status, setStatus] = (0, import_react42.useState)();
|
|
12733
|
+
const [error, setError] = (0, import_react42.useState)();
|
|
12734
|
+
const hasFetchedReference = (0, import_react42.useRef)(false);
|
|
12735
|
+
const abortControllerReference = (0, import_react42.useRef)(null);
|
|
12736
|
+
const checkStatus = (0, import_react42.useCallback)(async () => {
|
|
12808
12737
|
if (abortControllerReference.current) {
|
|
12809
12738
|
abortControllerReference.current.abort();
|
|
12810
12739
|
}
|
|
@@ -12828,7 +12757,7 @@ var useStatus = () => {
|
|
|
12828
12757
|
}
|
|
12829
12758
|
}
|
|
12830
12759
|
}, [api]);
|
|
12831
|
-
(0,
|
|
12760
|
+
(0, import_react42.useEffect)(() => {
|
|
12832
12761
|
if (!hasFetchedReference.current) {
|
|
12833
12762
|
hasFetchedReference.current = true;
|
|
12834
12763
|
void checkStatus();
|
|
@@ -13054,11 +12983,11 @@ var createPaginationBuffer = (options) => {
|
|
|
13054
12983
|
};
|
|
13055
12984
|
|
|
13056
12985
|
// src/hooks/use-spans-ws.tsx
|
|
13057
|
-
var
|
|
12986
|
+
var import_react45 = require("react");
|
|
13058
12987
|
|
|
13059
12988
|
// src/context.tsx
|
|
12989
|
+
var import_react43 = require("react");
|
|
13060
12990
|
var import_react44 = require("react");
|
|
13061
|
-
var import_react45 = require("react");
|
|
13062
12991
|
|
|
13063
12992
|
// src/utils/time.ts
|
|
13064
12993
|
function unixNanoToDate(unixNanoString) {
|
|
@@ -13245,19 +13174,19 @@ var createApiClient = ({ localstackEndpoint }) => {
|
|
|
13245
13174
|
|
|
13246
13175
|
// src/context.tsx
|
|
13247
13176
|
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
13248
|
-
var AppInspectorContext = (0,
|
|
13177
|
+
var AppInspectorContext = (0, import_react43.createContext)(void 0);
|
|
13249
13178
|
var useAppInspector = () => {
|
|
13250
|
-
const context = (0,
|
|
13179
|
+
const context = (0, import_react43.useContext)(AppInspectorContext);
|
|
13251
13180
|
if (!context) {
|
|
13252
13181
|
throw new Error("@localstack-studio/ui: components must be used within a <AppInspectorContextProvider>");
|
|
13253
13182
|
}
|
|
13254
13183
|
return context;
|
|
13255
13184
|
};
|
|
13256
13185
|
var AppInspectorContextProvider = (props) => {
|
|
13257
|
-
const api = (0,
|
|
13186
|
+
const api = (0, import_react44.useMemo)(() => {
|
|
13258
13187
|
return false ? createApiClientMock() : createApiClient({ localstackEndpoint: props.localstackEndpoint });
|
|
13259
13188
|
}, [props.localstackEndpoint]);
|
|
13260
|
-
const resolveLink = (0,
|
|
13189
|
+
const resolveLink = (0, import_react44.useCallback)(
|
|
13261
13190
|
(options) => {
|
|
13262
13191
|
if (options.to === "settings") {
|
|
13263
13192
|
return `${props.routePrefix}/settings`;
|
|
@@ -13269,7 +13198,7 @@ var AppInspectorContextProvider = (props) => {
|
|
|
13269
13198
|
},
|
|
13270
13199
|
[props.routePrefix]
|
|
13271
13200
|
);
|
|
13272
|
-
const contextValue = (0,
|
|
13201
|
+
const contextValue = (0, import_react44.useMemo)(
|
|
13273
13202
|
() => ({
|
|
13274
13203
|
linkComponent: props.linkComponent,
|
|
13275
13204
|
localstackEndpoint: props.localstackEndpoint,
|
|
@@ -13283,15 +13212,15 @@ var AppInspectorContextProvider = (props) => {
|
|
|
13283
13212
|
// src/hooks/use-spans-ws.tsx
|
|
13284
13213
|
function useSpansWebSocket(options) {
|
|
13285
13214
|
const { onMessage } = options;
|
|
13286
|
-
const onMessageRef = (0,
|
|
13287
|
-
(0,
|
|
13215
|
+
const onMessageRef = (0, import_react45.useRef)(onMessage);
|
|
13216
|
+
(0, import_react45.useEffect)(() => {
|
|
13288
13217
|
onMessageRef.current = onMessage;
|
|
13289
13218
|
}, [onMessage]);
|
|
13290
|
-
const [connected, setConnected] = (0,
|
|
13291
|
-
const wsRef = (0,
|
|
13292
|
-
const reconnectRef = (0,
|
|
13219
|
+
const [connected, setConnected] = (0, import_react45.useState)(false);
|
|
13220
|
+
const wsRef = (0, import_react45.useRef)(void 0);
|
|
13221
|
+
const reconnectRef = (0, import_react45.useRef)(void 0);
|
|
13293
13222
|
const { localstackEndpoint } = useAppInspector();
|
|
13294
|
-
const connect = (0,
|
|
13223
|
+
const connect = (0, import_react45.useCallback)(() => {
|
|
13295
13224
|
if (wsRef.current !== void 0) return;
|
|
13296
13225
|
const url = new URL(getAppInspectorApiUrl(localstackEndpoint, API_ENDPOINTS.WEBSOCKET_SPANS));
|
|
13297
13226
|
url.protocol = globalThis.location.protocol === "https:" ? "wss" : "ws";
|
|
@@ -13317,7 +13246,7 @@ function useSpansWebSocket(options) {
|
|
|
13317
13246
|
}
|
|
13318
13247
|
});
|
|
13319
13248
|
}, [localstackEndpoint]);
|
|
13320
|
-
(0,
|
|
13249
|
+
(0, import_react45.useEffect)(() => {
|
|
13321
13250
|
connect();
|
|
13322
13251
|
return () => {
|
|
13323
13252
|
if (reconnectRef.current !== void 0) clearTimeout(reconnectRef.current);
|
|
@@ -13335,19 +13264,16 @@ function useSpansWebSocket(options) {
|
|
|
13335
13264
|
|
|
13336
13265
|
// src/hooks/use-spans.ts
|
|
13337
13266
|
var PAGE_SIZE = 50;
|
|
13338
|
-
var useSpans = (
|
|
13267
|
+
var useSpans = () => {
|
|
13339
13268
|
const api = useAppInspectorApi();
|
|
13340
|
-
const [spans, setSpans] = (0,
|
|
13341
|
-
const
|
|
13342
|
-
|
|
13343
|
-
const [
|
|
13344
|
-
const [
|
|
13345
|
-
const
|
|
13346
|
-
const [refetching, setRefetching] = (0, import_react47.useState)(false);
|
|
13347
|
-
const paginationBuffer = (0, import_react47.useRef)(createPaginationBuffer({
|
|
13269
|
+
const [spans, setSpans] = (0, import_react46.useState)();
|
|
13270
|
+
const [fetchError, setFetchError] = (0, import_react46.useState)();
|
|
13271
|
+
const [fetchingForward, setFetchingForward] = (0, import_react46.useState)(false);
|
|
13272
|
+
const [fetchingBackward, setFetchingBackward] = (0, import_react46.useState)(false);
|
|
13273
|
+
const [refetching, setRefetching] = (0, import_react46.useState)(false);
|
|
13274
|
+
const paginationBuffer = (0, import_react46.useRef)(createPaginationBuffer({
|
|
13348
13275
|
async fetchPage(token, limit) {
|
|
13349
13276
|
const response = await api.getSpans({
|
|
13350
|
-
is_write_operation: includeReadOperationsRef.current ? void 0 : true,
|
|
13351
13277
|
limit,
|
|
13352
13278
|
pagination_token: token
|
|
13353
13279
|
});
|
|
@@ -13374,26 +13300,26 @@ var useSpans = (options) => {
|
|
|
13374
13300
|
},
|
|
13375
13301
|
pageSize: PAGE_SIZE
|
|
13376
13302
|
}));
|
|
13377
|
-
const [hasMoreBackward, setHasMoreBackward] = (0,
|
|
13378
|
-
const [hasMoreForward, setHasMoreForward] = (0,
|
|
13379
|
-
const fetchForward = (0,
|
|
13303
|
+
const [hasMoreBackward, setHasMoreBackward] = (0, import_react46.useState)();
|
|
13304
|
+
const [hasMoreForward, setHasMoreForward] = (0, import_react46.useState)();
|
|
13305
|
+
const fetchForward = (0, import_react46.useCallback)(() => {
|
|
13380
13306
|
paginationBuffer.current.fetchForward();
|
|
13381
13307
|
}, []);
|
|
13382
|
-
const fetchBackward = (0,
|
|
13308
|
+
const fetchBackward = (0, import_react46.useCallback)(() => {
|
|
13383
13309
|
paginationBuffer.current.fetchBackward();
|
|
13384
13310
|
}, []);
|
|
13385
|
-
(0,
|
|
13311
|
+
(0, import_react46.useEffect)(() => {
|
|
13386
13312
|
fetchForward();
|
|
13387
13313
|
}, [fetchForward]);
|
|
13388
13314
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
13389
|
-
const refreshSpans = (0,
|
|
13315
|
+
const refreshSpans = (0, import_react46.useCallback)(() => {
|
|
13390
13316
|
paginationBuffer.current.refetchCurrent();
|
|
13391
13317
|
}, []);
|
|
13392
|
-
(0,
|
|
13318
|
+
(0, import_react46.useEffect)(() => {
|
|
13393
13319
|
refreshSpans();
|
|
13394
|
-
}, [
|
|
13395
|
-
const [clearingSpans, setClearingSpans] = (0,
|
|
13396
|
-
const clearSpans = (0,
|
|
13320
|
+
}, [refreshSpans]);
|
|
13321
|
+
const [clearingSpans, setClearingSpans] = (0, import_react46.useState)(false);
|
|
13322
|
+
const clearSpans = (0, import_react46.useCallback)(async () => {
|
|
13397
13323
|
setClearingSpans(true);
|
|
13398
13324
|
try {
|
|
13399
13325
|
await api.deleteSpans();
|
|
@@ -13433,12 +13359,12 @@ var useSpans = (options) => {
|
|
|
13433
13359
|
var import_icons_material11 = require("@mui/icons-material");
|
|
13434
13360
|
var import_material19 = require("@mui/material");
|
|
13435
13361
|
var import_styles = require("@mui/material/styles");
|
|
13436
|
-
var
|
|
13437
|
-
var
|
|
13362
|
+
var import_react59 = require("@xyflow/react");
|
|
13363
|
+
var import_react60 = require("react");
|
|
13438
13364
|
|
|
13439
13365
|
// src/components/event-details/event-details.tsx
|
|
13440
13366
|
var import_material14 = require("@mui/material");
|
|
13441
|
-
var
|
|
13367
|
+
var import_react50 = require("react");
|
|
13442
13368
|
|
|
13443
13369
|
// src/utils/iam-utils.ts
|
|
13444
13370
|
function determinePermissionStatus(payload) {
|
|
@@ -13672,7 +13598,7 @@ var import_material13 = require("@mui/material");
|
|
|
13672
13598
|
// src/components/event-details/event-detail.tsx
|
|
13673
13599
|
var import_icons_material7 = require("@mui/icons-material");
|
|
13674
13600
|
var import_material11 = require("@mui/material");
|
|
13675
|
-
var
|
|
13601
|
+
var import_react48 = require("react");
|
|
13676
13602
|
|
|
13677
13603
|
// src/components/status-icon.tsx
|
|
13678
13604
|
var import_icons_material4 = require("@mui/icons-material");
|
|
@@ -13823,7 +13749,7 @@ var IAMEventDetail = ({ event }) => {
|
|
|
13823
13749
|
// src/components/event-details/iam-permission-detail.tsx
|
|
13824
13750
|
var import_icons_material6 = require("@mui/icons-material");
|
|
13825
13751
|
var import_material10 = require("@mui/material");
|
|
13826
|
-
var
|
|
13752
|
+
var import_react47 = require("react");
|
|
13827
13753
|
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
13828
13754
|
var getChipColors = (status) => {
|
|
13829
13755
|
const isAllowed = status === "explicitly_allowed" || status === "implicitly_allowed";
|
|
@@ -13833,8 +13759,8 @@ var getChipColors = (status) => {
|
|
|
13833
13759
|
};
|
|
13834
13760
|
};
|
|
13835
13761
|
var IAMPermissionItem = ({ event }) => {
|
|
13836
|
-
const [isOpen, setIsOpen] = (0,
|
|
13837
|
-
const parsedData = (0,
|
|
13762
|
+
const [isOpen, setIsOpen] = (0, import_react47.useState)(false);
|
|
13763
|
+
const parsedData = (0, import_react47.useMemo)(() => {
|
|
13838
13764
|
const payloadString = event.attributes?.payload;
|
|
13839
13765
|
if (!payloadString) {
|
|
13840
13766
|
return;
|
|
@@ -13904,15 +13830,15 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime1
|
|
|
13904
13830
|
) : content })
|
|
13905
13831
|
] });
|
|
13906
13832
|
var EventMessage = ({ event }) => {
|
|
13907
|
-
const [isOpen, setIsOpen] = (0,
|
|
13908
|
-
const [isOverflowing, setIsOverflowing] = (0,
|
|
13909
|
-
const textReference = (0,
|
|
13910
|
-
const parsedMessage = (0,
|
|
13911
|
-
const isIAMPolicyEvent = (0,
|
|
13833
|
+
const [isOpen, setIsOpen] = (0, import_react48.useState)(false);
|
|
13834
|
+
const [isOverflowing, setIsOverflowing] = (0, import_react48.useState)(false);
|
|
13835
|
+
const textReference = (0, import_react48.useRef)(null);
|
|
13836
|
+
const parsedMessage = (0, import_react48.useMemo)(() => parseEventMessage(event), [event]);
|
|
13837
|
+
const isIAMPolicyEvent = (0, import_react48.useMemo)(
|
|
13912
13838
|
() => event.event_type === "iam.policy_evaluation" && event.attributes?.payload && typeof event.attributes.payload === "string",
|
|
13913
13839
|
[event]
|
|
13914
13840
|
);
|
|
13915
|
-
(0,
|
|
13841
|
+
(0, import_react48.useEffect)(() => {
|
|
13916
13842
|
const checkOverflow = () => {
|
|
13917
13843
|
const element = textReference.current;
|
|
13918
13844
|
if (element) {
|
|
@@ -13925,11 +13851,11 @@ var EventMessage = ({ event }) => {
|
|
|
13925
13851
|
window.removeEventListener("resize", checkOverflow);
|
|
13926
13852
|
};
|
|
13927
13853
|
}, [parsedMessage.headline]);
|
|
13928
|
-
const hasAdditionalContent = (0,
|
|
13854
|
+
const hasAdditionalContent = (0, import_react48.useMemo)(
|
|
13929
13855
|
() => parsedMessage.message || parsedMessage.details || isIAMPolicyEvent,
|
|
13930
13856
|
[parsedMessage.message, parsedMessage.details, isIAMPolicyEvent]
|
|
13931
13857
|
);
|
|
13932
|
-
const shouldShowToggle = (0,
|
|
13858
|
+
const shouldShowToggle = (0, import_react48.useMemo)(
|
|
13933
13859
|
() => isOverflowing || hasAdditionalContent,
|
|
13934
13860
|
[isOverflowing, hasAdditionalContent]
|
|
13935
13861
|
);
|
|
@@ -14071,10 +13997,10 @@ var EventDetail = ({
|
|
|
14071
13997
|
// src/components/event-details/toggle-section.tsx
|
|
14072
13998
|
var import_icons_material8 = require("@mui/icons-material");
|
|
14073
13999
|
var import_material12 = require("@mui/material");
|
|
14074
|
-
var
|
|
14000
|
+
var import_react49 = require("react");
|
|
14075
14001
|
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
14076
14002
|
var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
14077
|
-
const [isOpen, setIsOpen] = (0,
|
|
14003
|
+
const [isOpen, setIsOpen] = (0, import_react49.useState)(initialOpen);
|
|
14078
14004
|
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_material12.Box, { sx: { mt: 4 }, children: [
|
|
14079
14005
|
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
14080
14006
|
import_material12.Box,
|
|
@@ -14164,7 +14090,7 @@ var ATTRIBUTE_NAME_TRANSFORMATIONS = {
|
|
|
14164
14090
|
"localstack.aws.service.response": "Response"
|
|
14165
14091
|
};
|
|
14166
14092
|
var EventDetails = ({ onClose, selectedEvent }) => {
|
|
14167
|
-
const attributes = (0,
|
|
14093
|
+
const attributes = (0, import_react50.useMemo)(() => {
|
|
14168
14094
|
const attributes2 = Object.entries(selectedEvent?.attributes ?? {});
|
|
14169
14095
|
return attributes2.filter(([key]) => !ATTRIBUTES_TO_EXCLUDE.has(key));
|
|
14170
14096
|
}, [selectedEvent?.attributes]);
|
|
@@ -14273,22 +14199,22 @@ function renderKeyValue(key, value) {
|
|
|
14273
14199
|
// src/components/trace-graph/trace-graph.tsx
|
|
14274
14200
|
var import_base = require("@xyflow/react/dist/base.css");
|
|
14275
14201
|
var import_material18 = require("@mui/material");
|
|
14276
|
-
var
|
|
14277
|
-
var
|
|
14202
|
+
var import_react57 = require("@xyflow/react");
|
|
14203
|
+
var import_react58 = require("react");
|
|
14278
14204
|
|
|
14279
14205
|
// src/components/trace-graph/service-node.tsx
|
|
14280
14206
|
var import_material16 = require("@mui/material");
|
|
14281
14207
|
var import_style = require("@xyflow/react/dist/style.css");
|
|
14282
|
-
var
|
|
14283
|
-
var
|
|
14208
|
+
var import_react52 = require("@xyflow/react");
|
|
14209
|
+
var import_react53 = require("react");
|
|
14284
14210
|
|
|
14285
14211
|
// src/components/trace-graph/problem-indicator.tsx
|
|
14286
14212
|
var import_icons_material9 = require("@mui/icons-material");
|
|
14287
14213
|
var import_material15 = require("@mui/material");
|
|
14288
|
-
var
|
|
14214
|
+
var import_react51 = require("react");
|
|
14289
14215
|
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
14290
14216
|
var ProblemIndicator = ({ error }) => {
|
|
14291
|
-
const icon = (0,
|
|
14217
|
+
const icon = (0, import_react51.useMemo)(() => {
|
|
14292
14218
|
switch (error.level) {
|
|
14293
14219
|
case "error": {
|
|
14294
14220
|
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_icons_material9.Error, { sx: { color: "#d32f2f", fontSize: "14px" } });
|
|
@@ -14301,7 +14227,7 @@ var ProblemIndicator = ({ error }) => {
|
|
|
14301
14227
|
}
|
|
14302
14228
|
}
|
|
14303
14229
|
}, [error.level]);
|
|
14304
|
-
const color2 = (0,
|
|
14230
|
+
const color2 = (0, import_react51.useMemo)(() => {
|
|
14305
14231
|
switch (error.level) {
|
|
14306
14232
|
case "error": {
|
|
14307
14233
|
return "#d32f2f";
|
|
@@ -14340,7 +14266,7 @@ var handleStyle = {
|
|
|
14340
14266
|
borderColor: "lightgray",
|
|
14341
14267
|
opacity: 0
|
|
14342
14268
|
};
|
|
14343
|
-
var ServiceNode = (0,
|
|
14269
|
+
var ServiceNode = (0, import_react53.memo)(({ data, selected }) => {
|
|
14344
14270
|
const hasErrors = (data.event.errors && data.event.errors.length > 0) ?? false;
|
|
14345
14271
|
return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material16.Box, { sx: { maxWidth: 200 }, children: [
|
|
14346
14272
|
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
|
|
@@ -14364,8 +14290,8 @@ var ServiceNode = (0, import_react54.memo)(({ data, selected }) => {
|
|
|
14364
14290
|
},
|
|
14365
14291
|
tabIndex: 0,
|
|
14366
14292
|
children: [
|
|
14367
|
-
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
14368
|
-
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
14293
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_react52.Handle, { position: import_react52.Position.Left, style: handleStyle, type: "target" }),
|
|
14294
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_react52.Handle, { position: import_react52.Position.Right, style: handleStyle, type: "source" }),
|
|
14369
14295
|
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
14370
14296
|
ServiceCell,
|
|
14371
14297
|
{
|
|
@@ -14425,7 +14351,7 @@ var ServiceNode = (0, import_react54.memo)(({ data, selected }) => {
|
|
|
14425
14351
|
|
|
14426
14352
|
// src/components/trace-graph/utils.ts
|
|
14427
14353
|
var import_dagre = __toESM(require("@dagrejs/dagre"), 1);
|
|
14428
|
-
var
|
|
14354
|
+
var import_react54 = require("@xyflow/react");
|
|
14429
14355
|
var generateNodesAndEdges = (event, parentId) => {
|
|
14430
14356
|
const nodes = [];
|
|
14431
14357
|
const edges = [];
|
|
@@ -14441,8 +14367,8 @@ var generateNodesAndEdges = (event, parentId) => {
|
|
|
14441
14367
|
id: event.span_id,
|
|
14442
14368
|
position: { x: 0, y: 0 },
|
|
14443
14369
|
// Will be set by layout
|
|
14444
|
-
sourcePosition:
|
|
14445
|
-
targetPosition:
|
|
14370
|
+
sourcePosition: import_react54.Position.Right,
|
|
14371
|
+
targetPosition: import_react54.Position.Left,
|
|
14446
14372
|
type: "service"
|
|
14447
14373
|
});
|
|
14448
14374
|
if (parentId) {
|
|
@@ -14452,7 +14378,7 @@ var generateNodesAndEdges = (event, parentId) => {
|
|
|
14452
14378
|
markerEnd: {
|
|
14453
14379
|
color: "lightgray",
|
|
14454
14380
|
height: 16,
|
|
14455
|
-
type:
|
|
14381
|
+
type: import_react54.MarkerType.Arrow,
|
|
14456
14382
|
width: 16
|
|
14457
14383
|
},
|
|
14458
14384
|
source: parentId,
|
|
@@ -14505,8 +14431,8 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
|
|
|
14505
14431
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
14506
14432
|
var import_icons_material10 = require("@mui/icons-material");
|
|
14507
14433
|
var import_material17 = require("@mui/material");
|
|
14508
|
-
var
|
|
14509
|
-
var
|
|
14434
|
+
var import_react55 = require("@xyflow/react");
|
|
14435
|
+
var import_react56 = require("react");
|
|
14510
14436
|
|
|
14511
14437
|
// node_modules/zustand/esm/shallow.mjs
|
|
14512
14438
|
function shallow$1(objA, objB) {
|
|
@@ -14553,9 +14479,9 @@ var selector = (s) => ({
|
|
|
14553
14479
|
maxZoomReached: s.transform[2] >= s.maxZoom,
|
|
14554
14480
|
minZoomReached: s.transform[2] <= s.minZoom
|
|
14555
14481
|
});
|
|
14556
|
-
var Controls = (0,
|
|
14557
|
-
const { maxZoomReached, minZoomReached } = (0,
|
|
14558
|
-
const { fitView, zoomIn, zoomOut } = (0,
|
|
14482
|
+
var Controls = (0, import_react56.memo)(() => {
|
|
14483
|
+
const { maxZoomReached, minZoomReached } = (0, import_react55.useStore)(selector, shallow$1);
|
|
14484
|
+
const { fitView, zoomIn, zoomOut } = (0, import_react55.useReactFlow)();
|
|
14559
14485
|
const onZoomInHandler = () => {
|
|
14560
14486
|
void zoomIn();
|
|
14561
14487
|
};
|
|
@@ -14624,9 +14550,9 @@ var TraceGraph = ({
|
|
|
14624
14550
|
onRefresh,
|
|
14625
14551
|
spans
|
|
14626
14552
|
}) => {
|
|
14627
|
-
const [nodes, setNodes, onNodesChange] = (0,
|
|
14628
|
-
const [edges, setEdges] = (0,
|
|
14629
|
-
(0,
|
|
14553
|
+
const [nodes, setNodes, onNodesChange] = (0, import_react57.useNodesState)([]);
|
|
14554
|
+
const [edges, setEdges] = (0, import_react58.useState)([]);
|
|
14555
|
+
(0, import_react58.useEffect)(() => {
|
|
14630
14556
|
const spansMap = /* @__PURE__ */ new Map();
|
|
14631
14557
|
const rootSpans = [];
|
|
14632
14558
|
for (const span of spans.data ?? []) {
|
|
@@ -14678,7 +14604,7 @@ var TraceGraph = ({
|
|
|
14678
14604
|
}
|
|
14679
14605
|
),
|
|
14680
14606
|
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
|
|
14681
|
-
|
|
14607
|
+
import_react57.ReactFlow,
|
|
14682
14608
|
{
|
|
14683
14609
|
"data-testid": "trace-graph",
|
|
14684
14610
|
edges,
|
|
@@ -14697,7 +14623,7 @@ var TraceGraph = ({
|
|
|
14697
14623
|
children: [
|
|
14698
14624
|
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(Controls, {}),
|
|
14699
14625
|
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
14700
|
-
|
|
14626
|
+
import_react57.Background,
|
|
14701
14627
|
{
|
|
14702
14628
|
bgColor: theme.palette.background.paper,
|
|
14703
14629
|
color: theme.palette.text.disabled
|
|
@@ -14802,7 +14728,7 @@ var TraceGraphView = ({
|
|
|
14802
14728
|
height: "100%",
|
|
14803
14729
|
overflow: "auto"
|
|
14804
14730
|
},
|
|
14805
|
-
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
14731
|
+
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_react59.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
14806
14732
|
TraceGraph,
|
|
14807
14733
|
{
|
|
14808
14734
|
initialFocusEventId: spanId,
|
|
@@ -14829,15 +14755,13 @@ var TraceGraphView = ({
|
|
|
14829
14755
|
};
|
|
14830
14756
|
var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
14831
14757
|
const api = useAppInspectorApi();
|
|
14832
|
-
const [spans, setSpans] = (0,
|
|
14833
|
-
const [loading, setLoading] = (0,
|
|
14834
|
-
const
|
|
14835
|
-
const
|
|
14836
|
-
const fetchSpans = (0, import_react61.useCallback)(async () => {
|
|
14758
|
+
const [spans, setSpans] = (0, import_react60.useState)();
|
|
14759
|
+
const [loading, setLoading] = (0, import_react60.useState)(false);
|
|
14760
|
+
const [fetchError, setFetchError] = (0, import_react60.useState)();
|
|
14761
|
+
const fetchSpans = (0, import_react60.useCallback)(async () => {
|
|
14837
14762
|
setLoading(true);
|
|
14838
14763
|
try {
|
|
14839
14764
|
const response = await api.getSpans({
|
|
14840
|
-
is_write_operation: includeReadOperations ? void 0 : true,
|
|
14841
14765
|
trace_id: traceId
|
|
14842
14766
|
});
|
|
14843
14767
|
setSpans(response.spans);
|
|
@@ -14848,29 +14772,29 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
14848
14772
|
} finally {
|
|
14849
14773
|
setLoading(false);
|
|
14850
14774
|
}
|
|
14851
|
-
}, [api,
|
|
14852
|
-
(0,
|
|
14775
|
+
}, [api, traceId]);
|
|
14776
|
+
(0, import_react60.useEffect)(() => {
|
|
14853
14777
|
void fetchSpans();
|
|
14854
14778
|
}, [fetchSpans]);
|
|
14855
|
-
const [open, setOpen] = (0,
|
|
14856
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
14857
|
-
const spansReference = (0,
|
|
14858
|
-
(0,
|
|
14779
|
+
const [open, setOpen] = (0, import_react60.useState)(true);
|
|
14780
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react60.useState)(() => spans?.find((span) => span.span_id === spanId));
|
|
14781
|
+
const spansReference = (0, import_react60.useRef)();
|
|
14782
|
+
(0, import_react60.useEffect)(() => {
|
|
14859
14783
|
if (!spansReference.current && spans) {
|
|
14860
14784
|
setSelectedEvent(spans.find((span) => span.span_id === spanId));
|
|
14861
14785
|
spansReference.current = spans;
|
|
14862
14786
|
}
|
|
14863
14787
|
}, [spans, setSelectedEvent, spanId]);
|
|
14864
14788
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
14865
|
-
const handleEventSelect = (0,
|
|
14789
|
+
const handleEventSelect = (0, import_react60.useCallback)((spanId2) => {
|
|
14866
14790
|
const span = spans?.find((s) => s.span_id === spanId2);
|
|
14867
14791
|
setSelectedEvent(span);
|
|
14868
14792
|
setOpen(true);
|
|
14869
14793
|
}, [spans]);
|
|
14870
|
-
const handleRetry = (0,
|
|
14794
|
+
const handleRetry = (0, import_react60.useCallback)(() => {
|
|
14871
14795
|
void checkStatus();
|
|
14872
14796
|
}, [checkStatus]);
|
|
14873
|
-
const navigateToSpansList = (0,
|
|
14797
|
+
const navigateToSpansList = (0, import_react60.useCallback)(() => {
|
|
14874
14798
|
onClose?.();
|
|
14875
14799
|
}, [onClose]);
|
|
14876
14800
|
return /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
@@ -14899,7 +14823,6 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
14899
14823
|
// src/pages/spans-list-page.tsx
|
|
14900
14824
|
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
14901
14825
|
var SpansListPage = () => {
|
|
14902
|
-
const { includeReadOperations, setIncludeReadOperations } = useIncludeReadOperations();
|
|
14903
14826
|
const {
|
|
14904
14827
|
checkStatus,
|
|
14905
14828
|
clearingSpans,
|
|
@@ -14916,19 +14839,17 @@ var SpansListPage = () => {
|
|
|
14916
14839
|
spans,
|
|
14917
14840
|
status,
|
|
14918
14841
|
statusError
|
|
14919
|
-
} = useSpans(
|
|
14920
|
-
|
|
14921
|
-
});
|
|
14922
|
-
const clearSpansSync = (0, import_react62.useCallback)(() => {
|
|
14842
|
+
} = useSpans();
|
|
14843
|
+
const clearSpansSync = (0, import_react61.useCallback)(() => {
|
|
14923
14844
|
void clearSpans();
|
|
14924
14845
|
}, [clearSpans]);
|
|
14925
|
-
const [selectedTraceId, setSelectedTraceId] = (0,
|
|
14926
|
-
const [selectedSpanId, setSelectedSpanId] = (0,
|
|
14927
|
-
const navigateToSpan = (0,
|
|
14846
|
+
const [selectedTraceId, setSelectedTraceId] = (0, import_react61.useState)();
|
|
14847
|
+
const [selectedSpanId, setSelectedSpanId] = (0, import_react61.useState)();
|
|
14848
|
+
const navigateToSpan = (0, import_react61.useCallback)((span) => {
|
|
14928
14849
|
setSelectedTraceId(span.trace_id);
|
|
14929
14850
|
setSelectedSpanId(span.span_id);
|
|
14930
14851
|
}, []);
|
|
14931
|
-
const handleRetry = (0,
|
|
14852
|
+
const handleRetry = (0, import_react61.useCallback)(() => {
|
|
14932
14853
|
void checkStatus();
|
|
14933
14854
|
}, [checkStatus]);
|
|
14934
14855
|
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
@@ -14964,11 +14885,9 @@ var SpansListPage = () => {
|
|
|
14964
14885
|
fetchingForward,
|
|
14965
14886
|
hasMoreBackward,
|
|
14966
14887
|
hasMoreForward,
|
|
14967
|
-
includeReadOperations,
|
|
14968
14888
|
onClearSpans: clearSpansSync,
|
|
14969
14889
|
onFetchBackward: fetchBackward,
|
|
14970
14890
|
onFetchForward: fetchForward,
|
|
14971
|
-
onIncludeReadOperationsChange: setIncludeReadOperations,
|
|
14972
14891
|
onRefresh: refreshSpans,
|
|
14973
14892
|
onSpanClick: navigateToSpan,
|
|
14974
14893
|
refetching,
|