@localstack/appinspector-ui 1.0.32 → 1.0.34
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 +591 -650
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +524 -583
- package/dist/index.js.map +1 -1
- package/dist/routes.cjs +1 -2
- package/dist/routes.cjs.map +1 -1
- package/dist/routes.d.cts +0 -1
- package/dist/routes.d.ts +0 -1
- package/dist/routes.js +1 -2
- package/dist/routes.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -36,9 +36,8 @@ __export(index_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(index_exports);
|
|
37
37
|
|
|
38
38
|
// src/pages/spans-list-page.tsx
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var import_react_router_dom2 = require("react-router-dom");
|
|
39
|
+
var import_material21 = require("@mui/material");
|
|
40
|
+
var import_react21 = require("react");
|
|
42
41
|
|
|
43
42
|
// src/api/use-api.tsx
|
|
44
43
|
var import_react = require("react");
|
|
@@ -3270,169 +3269,10 @@ var StatusMessage = ({
|
|
|
3270
3269
|
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_jsx_runtime128.Fragment, {});
|
|
3271
3270
|
};
|
|
3272
3271
|
|
|
3273
|
-
// src/context.tsx
|
|
3274
|
-
var import_react5 = require("react");
|
|
3275
|
-
var import_react6 = require("react");
|
|
3276
|
-
|
|
3277
|
-
// src/constants/error-messages.ts
|
|
3278
|
-
var ERROR_MESSAGES = {
|
|
3279
|
-
APP_INSPECTOR_DISABLED: "App Inspector is currently disabled.",
|
|
3280
|
-
APP_INSPECTOR_NOT_FOUND: "App Inspector extension not found. Please ensure App Inspector is licensed and enabled.",
|
|
3281
|
-
CONNECTION_FAILED: "Failed to connect to LocalStack. Please ensure LocalStack is running and accessible."
|
|
3282
|
-
};
|
|
3283
|
-
|
|
3284
|
-
// src/api/client.ts
|
|
3285
|
-
var apiLogger = createScopedLogger("API");
|
|
3286
|
-
var makeRequest = async (options) => {
|
|
3287
|
-
const url = getAppInspectorApiUrl(options.localstackEndpoint, options.endpoint);
|
|
3288
|
-
try {
|
|
3289
|
-
apiLogger.info("Making request to:", { options, url });
|
|
3290
|
-
const headers = new Headers(options.request?.headers);
|
|
3291
|
-
headers.set("Content-Type", "application/json");
|
|
3292
|
-
const response = await fetch(url, {
|
|
3293
|
-
...options.request,
|
|
3294
|
-
headers
|
|
3295
|
-
});
|
|
3296
|
-
if (!response.ok) {
|
|
3297
|
-
if (response.status === 404) {
|
|
3298
|
-
throw new AppInspectorNotFoundError(
|
|
3299
|
-
ERROR_MESSAGES.APP_INSPECTOR_NOT_FOUND,
|
|
3300
|
-
new Error(`404 from ${url}: ${response.statusText}`)
|
|
3301
|
-
);
|
|
3302
|
-
}
|
|
3303
|
-
throw new Error(`API request failed: ${response.status.toString()} ${response.statusText}`);
|
|
3304
|
-
}
|
|
3305
|
-
return await response.json();
|
|
3306
|
-
} catch (error) {
|
|
3307
|
-
if (error instanceof TypeError) {
|
|
3308
|
-
const message = error.message.toLowerCase();
|
|
3309
|
-
const isNetworkError = message.includes("fetch") || message.includes("network") || message.includes("failed to fetch");
|
|
3310
|
-
if (isNetworkError) {
|
|
3311
|
-
throw new ConnectionError(ERROR_MESSAGES.CONNECTION_FAILED, error);
|
|
3312
|
-
}
|
|
3313
|
-
}
|
|
3314
|
-
if (error instanceof Error) {
|
|
3315
|
-
throw error;
|
|
3316
|
-
}
|
|
3317
|
-
throw new Error("Unknown error occurred");
|
|
3318
|
-
}
|
|
3319
|
-
};
|
|
3320
|
-
var buildSpansEndpoint = (request) => {
|
|
3321
|
-
if (!request) {
|
|
3322
|
-
return API_ENDPOINTS.SPANS;
|
|
3323
|
-
}
|
|
3324
|
-
const queryParameters = new URLSearchParams();
|
|
3325
|
-
if (request.limit !== void 0) {
|
|
3326
|
-
queryParameters.set("limit", request.limit.toString());
|
|
3327
|
-
}
|
|
3328
|
-
if (request.pagination_token) {
|
|
3329
|
-
queryParameters.set("pagination_token", request.pagination_token);
|
|
3330
|
-
}
|
|
3331
|
-
for (const [key, value] of Object.entries(request)) {
|
|
3332
|
-
if (value !== void 0 && key !== "limit" && key !== "pagination_token" && value !== null) {
|
|
3333
|
-
queryParameters.set(key, String(value));
|
|
3334
|
-
}
|
|
3335
|
-
}
|
|
3336
|
-
const queryString = queryParameters.toString();
|
|
3337
|
-
return queryString ? `${API_ENDPOINTS.SPANS}?${queryString}` : API_ENDPOINTS.SPANS;
|
|
3338
|
-
};
|
|
3339
|
-
var buildEventsEndpoint = (request) => {
|
|
3340
|
-
if (!request) {
|
|
3341
|
-
return API_ENDPOINTS.EVENTS;
|
|
3342
|
-
}
|
|
3343
|
-
const basePath = API_ENDPOINTS.EVENTS;
|
|
3344
|
-
const queryParameters = new URLSearchParams();
|
|
3345
|
-
if (request.limit !== void 0) {
|
|
3346
|
-
queryParameters.set("limit", request.limit.toString());
|
|
3347
|
-
}
|
|
3348
|
-
if (request.pagination_token) {
|
|
3349
|
-
queryParameters.set("pagination_token", request.pagination_token);
|
|
3350
|
-
}
|
|
3351
|
-
for (const [key, value] of Object.entries(request)) {
|
|
3352
|
-
if (value !== void 0 && key !== "limit" && key !== "pagination_token" && value !== null) {
|
|
3353
|
-
queryParameters.set(key, String(value));
|
|
3354
|
-
}
|
|
3355
|
-
}
|
|
3356
|
-
const queryString = queryParameters.toString();
|
|
3357
|
-
return queryString ? `${basePath}?${queryString}` : basePath;
|
|
3358
|
-
};
|
|
3359
|
-
var createApiClient = ({ localstackEndpoint }) => {
|
|
3360
|
-
return {
|
|
3361
|
-
deleteSpans: async (_request) => {
|
|
3362
|
-
return makeRequest({
|
|
3363
|
-
endpoint: API_ENDPOINTS.SPANS,
|
|
3364
|
-
localstackEndpoint,
|
|
3365
|
-
request: {
|
|
3366
|
-
method: "DELETE"
|
|
3367
|
-
}
|
|
3368
|
-
});
|
|
3369
|
-
},
|
|
3370
|
-
getEvents: async (request) => {
|
|
3371
|
-
const endpoint = buildEventsEndpoint(request);
|
|
3372
|
-
return makeRequest({ endpoint, localstackEndpoint });
|
|
3373
|
-
},
|
|
3374
|
-
getIamEvents: async (request) => {
|
|
3375
|
-
const iamEventsRequest = {
|
|
3376
|
-
...request,
|
|
3377
|
-
event_type: "iam.policy_evaluation"
|
|
3378
|
-
};
|
|
3379
|
-
const endpoint = buildEventsEndpoint(iamEventsRequest);
|
|
3380
|
-
return makeRequest({ endpoint, localstackEndpoint });
|
|
3381
|
-
},
|
|
3382
|
-
getSpans: async (request) => {
|
|
3383
|
-
const endpoint = buildSpansEndpoint(request);
|
|
3384
|
-
return makeRequest({ endpoint, localstackEndpoint });
|
|
3385
|
-
},
|
|
3386
|
-
getStatus: async () => {
|
|
3387
|
-
return makeRequest({
|
|
3388
|
-
endpoint: API_ENDPOINTS.STATUS,
|
|
3389
|
-
localstackEndpoint
|
|
3390
|
-
});
|
|
3391
|
-
}
|
|
3392
|
-
};
|
|
3393
|
-
};
|
|
3394
|
-
|
|
3395
|
-
// src/context.tsx
|
|
3396
|
-
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
3397
|
-
var AppInspectorContext = (0, import_react5.createContext)(void 0);
|
|
3398
|
-
var useAppInspector = () => {
|
|
3399
|
-
const context = (0, import_react5.useContext)(AppInspectorContext);
|
|
3400
|
-
if (!context) {
|
|
3401
|
-
throw new Error("@localstack-studio/ui: components must be used within a <AppInspectorContextProvider>");
|
|
3402
|
-
}
|
|
3403
|
-
return context;
|
|
3404
|
-
};
|
|
3405
|
-
var AppInspectorContextProvider = (props) => {
|
|
3406
|
-
const api = (0, import_react6.useMemo)(() => {
|
|
3407
|
-
return false ? createApiClientMock() : createApiClient({ localstackEndpoint: props.localstackEndpoint });
|
|
3408
|
-
}, [props.localstackEndpoint]);
|
|
3409
|
-
const resolveLink = (0, import_react6.useCallback)(
|
|
3410
|
-
(options) => {
|
|
3411
|
-
if (options.to === "settings") {
|
|
3412
|
-
return `${props.routePrefix}/settings`;
|
|
3413
|
-
}
|
|
3414
|
-
if (options.to === "trace-graph") {
|
|
3415
|
-
return `${props.routePrefix}/traces/${options.traceId}`;
|
|
3416
|
-
}
|
|
3417
|
-
return `${props.routePrefix}/spans`;
|
|
3418
|
-
},
|
|
3419
|
-
[props.routePrefix]
|
|
3420
|
-
);
|
|
3421
|
-
const contextValue = (0, import_react6.useMemo)(
|
|
3422
|
-
() => ({
|
|
3423
|
-
linkComponent: props.linkComponent,
|
|
3424
|
-
localstackEndpoint: props.localstackEndpoint,
|
|
3425
|
-
resolveLink
|
|
3426
|
-
}),
|
|
3427
|
-
[props.linkComponent, props.localstackEndpoint, resolveLink]
|
|
3428
|
-
);
|
|
3429
|
-
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(ApiProvider, { api, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(AppInspectorContext.Provider, { value: contextValue, children: props.children }) });
|
|
3430
|
-
};
|
|
3431
|
-
|
|
3432
3272
|
// src/hooks/use-local-storage.tsx
|
|
3433
|
-
var
|
|
3273
|
+
var import_react5 = require("react");
|
|
3434
3274
|
function useLocalStorage(key, initialValue) {
|
|
3435
|
-
const [storedValue, setStoredValue] = (0,
|
|
3275
|
+
const [storedValue, setStoredValue] = (0, import_react5.useState)(() => {
|
|
3436
3276
|
try {
|
|
3437
3277
|
const item = globalThis.localStorage.getItem(key);
|
|
3438
3278
|
return item ? JSON.parse(item) : initialValue;
|
|
@@ -3441,7 +3281,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
3441
3281
|
return initialValue;
|
|
3442
3282
|
}
|
|
3443
3283
|
});
|
|
3444
|
-
const setValue = (0,
|
|
3284
|
+
const setValue = (0, import_react5.useCallback)((value) => {
|
|
3445
3285
|
try {
|
|
3446
3286
|
setStoredValue(value);
|
|
3447
3287
|
globalThis.localStorage.setItem(key, JSON.stringify(value));
|
|
@@ -3453,7 +3293,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
3453
3293
|
console.error(`Error setting localStorage key "${key}":`, error);
|
|
3454
3294
|
}
|
|
3455
3295
|
}, [key]);
|
|
3456
|
-
(0,
|
|
3296
|
+
(0, import_react5.useEffect)(() => {
|
|
3457
3297
|
const handleStorageChange = (event) => {
|
|
3458
3298
|
if (event.key === key && event.newValue !== null) {
|
|
3459
3299
|
try {
|
|
@@ -3472,15 +3312,15 @@ function useLocalStorage(key, initialValue) {
|
|
|
3472
3312
|
}
|
|
3473
3313
|
|
|
3474
3314
|
// src/hooks/use-status.tsx
|
|
3475
|
-
var
|
|
3315
|
+
var import_react6 = require("react");
|
|
3476
3316
|
var useStatus = () => {
|
|
3477
3317
|
const api = useAppInspectorApi();
|
|
3478
|
-
const [checking, setChecking] = (0,
|
|
3479
|
-
const [status, setStatus] = (0,
|
|
3480
|
-
const [error, setError] = (0,
|
|
3481
|
-
const hasFetchedReference = (0,
|
|
3482
|
-
const abortControllerReference = (0,
|
|
3483
|
-
const checkStatus = (0,
|
|
3318
|
+
const [checking, setChecking] = (0, import_react6.useState)(true);
|
|
3319
|
+
const [status, setStatus] = (0, import_react6.useState)();
|
|
3320
|
+
const [error, setError] = (0, import_react6.useState)();
|
|
3321
|
+
const hasFetchedReference = (0, import_react6.useRef)(false);
|
|
3322
|
+
const abortControllerReference = (0, import_react6.useRef)(null);
|
|
3323
|
+
const checkStatus = (0, import_react6.useCallback)(async () => {
|
|
3484
3324
|
if (abortControllerReference.current) {
|
|
3485
3325
|
abortControllerReference.current.abort();
|
|
3486
3326
|
}
|
|
@@ -3504,7 +3344,7 @@ var useStatus = () => {
|
|
|
3504
3344
|
}
|
|
3505
3345
|
}
|
|
3506
3346
|
}, [api]);
|
|
3507
|
-
(0,
|
|
3347
|
+
(0, import_react6.useEffect)(() => {
|
|
3508
3348
|
if (!hasFetchedReference.current) {
|
|
3509
3349
|
hasFetchedReference.current = true;
|
|
3510
3350
|
void checkStatus();
|
|
@@ -3513,191 +3353,16 @@ var useStatus = () => {
|
|
|
3513
3353
|
return { checking, checkStatus, error, status };
|
|
3514
3354
|
};
|
|
3515
3355
|
|
|
3516
|
-
// src/utils/use-search-param-codec.ts
|
|
3517
|
-
var import_react9 = require("react");
|
|
3518
|
-
var import_react_router_dom = require("react-router-dom");
|
|
3519
|
-
var useSearchParamCodec = (key, codec) => {
|
|
3520
|
-
const [searchParams, setSearchParams] = (0, import_react_router_dom.useSearchParams)();
|
|
3521
|
-
const raw = searchParams.get(key) ?? void 0;
|
|
3522
|
-
const value = (0, import_react9.useMemo)(() => {
|
|
3523
|
-
return codec.decode(raw);
|
|
3524
|
-
}, [raw, codec]);
|
|
3525
|
-
const setValue = (0, import_react9.useCallback)(
|
|
3526
|
-
(next) => {
|
|
3527
|
-
setSearchParams((previous) => {
|
|
3528
|
-
const nextParams = new URLSearchParams(previous);
|
|
3529
|
-
nextParams.set(key, codec.encode(next));
|
|
3530
|
-
return nextParams;
|
|
3531
|
-
});
|
|
3532
|
-
},
|
|
3533
|
-
[key, codec, setSearchParams]
|
|
3534
|
-
);
|
|
3535
|
-
return [value, setValue];
|
|
3536
|
-
};
|
|
3537
|
-
|
|
3538
|
-
// src/pages/spans-list-page.tsx
|
|
3539
|
-
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
3540
|
-
var spansPerPageOptions = [25, 50, 100];
|
|
3541
|
-
var SpansListPage = () => {
|
|
3542
|
-
const api = useAppInspectorApi();
|
|
3543
|
-
const [spans, setSpans] = (0, import_react10.useState)();
|
|
3544
|
-
const [loading, setLoading] = (0, import_react10.useState)(false);
|
|
3545
|
-
const hasFetched = (0, import_react10.useRef)(false);
|
|
3546
|
-
const [filterWriteOperations, setFilterWriteOperations] = useLocalStorage("filterWriteOperations", true);
|
|
3547
|
-
const mapPageToNextCursor = (0, import_react10.useRef)({});
|
|
3548
|
-
const [page, setPage] = useSearchParamCodec("page", {
|
|
3549
|
-
decode: (raw) => {
|
|
3550
|
-
const defaultPage = 0;
|
|
3551
|
-
if (!raw) {
|
|
3552
|
-
return defaultPage;
|
|
3553
|
-
}
|
|
3554
|
-
const parsed = Number.parseInt(raw, 10);
|
|
3555
|
-
return Number.isNaN(parsed) || parsed < 0 ? defaultPage : parsed;
|
|
3556
|
-
},
|
|
3557
|
-
encode: (value) => value.toString()
|
|
3558
|
-
});
|
|
3559
|
-
const [pageSize, setPageSize] = useSearchParamCodec("pageSize", {
|
|
3560
|
-
decode: (raw) => {
|
|
3561
|
-
const defaultPageSize = 100;
|
|
3562
|
-
if (!raw) {
|
|
3563
|
-
return defaultPageSize;
|
|
3564
|
-
}
|
|
3565
|
-
const parsed = Number.parseInt(raw, 10);
|
|
3566
|
-
return spansPerPageOptions.includes(parsed) ? parsed : defaultPageSize;
|
|
3567
|
-
},
|
|
3568
|
-
encode: (value) => value.toString()
|
|
3569
|
-
});
|
|
3570
|
-
const [spanCount, setSpanCount] = (0, import_react10.useState)(0);
|
|
3571
|
-
const queryOptions = (0, import_react10.useMemo)(() => {
|
|
3572
|
-
return {
|
|
3573
|
-
is_write_operation: filterWriteOperations ? true : void 0,
|
|
3574
|
-
limit: pageSize,
|
|
3575
|
-
pagination_token: mapPageToNextCursor.current[page - 1]
|
|
3576
|
-
};
|
|
3577
|
-
}, [filterWriteOperations, pageSize, page]);
|
|
3578
|
-
const [fetchError, setFetchError] = (0, import_react10.useState)();
|
|
3579
|
-
const { checkStatus, error: statusError, status } = useStatus();
|
|
3580
|
-
const fetchSpans = (0, import_react10.useCallback)(async () => {
|
|
3581
|
-
setLoading(true);
|
|
3582
|
-
try {
|
|
3583
|
-
const response = await api.getSpans(queryOptions);
|
|
3584
|
-
setSpans(response.spans);
|
|
3585
|
-
setSpanCount(response.pagination.total_count);
|
|
3586
|
-
setFetchError(void 0);
|
|
3587
|
-
if (response.pagination.cursor) {
|
|
3588
|
-
mapPageToNextCursor.current[page] = response.pagination.cursor;
|
|
3589
|
-
}
|
|
3590
|
-
} catch (error) {
|
|
3591
|
-
console.error(error);
|
|
3592
|
-
setFetchError(error instanceof Error ? error : new Error("Unknown error", { cause: error }));
|
|
3593
|
-
} finally {
|
|
3594
|
-
setLoading(false);
|
|
3595
|
-
}
|
|
3596
|
-
}, [api, page, queryOptions]);
|
|
3597
|
-
const fetchSpansSync = (0, import_react10.useCallback)(() => {
|
|
3598
|
-
void fetchSpans();
|
|
3599
|
-
}, [fetchSpans]);
|
|
3600
|
-
(0, import_react10.useEffect)(() => {
|
|
3601
|
-
if (hasFetched.current) return;
|
|
3602
|
-
if (status?.status !== "ENABLED") return;
|
|
3603
|
-
hasFetched.current = true;
|
|
3604
|
-
void fetchSpans();
|
|
3605
|
-
}, [fetchSpans, status]);
|
|
3606
|
-
(0, import_react10.useEffect)(() => {
|
|
3607
|
-
if (!hasFetched.current) return;
|
|
3608
|
-
void fetchSpans();
|
|
3609
|
-
}, [fetchSpans]);
|
|
3610
|
-
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
3611
|
-
const { resolveLink } = useAppInspector();
|
|
3612
|
-
const navigateToSpan = (0, import_react10.useCallback)((span) => {
|
|
3613
|
-
const url = resolveLink({ to: "trace-graph", traceId: span.trace_id });
|
|
3614
|
-
const searchParams = new URLSearchParams({
|
|
3615
|
-
page: String(page),
|
|
3616
|
-
pageSize: String(pageSize),
|
|
3617
|
-
spanId: span.span_id
|
|
3618
|
-
});
|
|
3619
|
-
navigate(`${url}?${searchParams.toString()}`);
|
|
3620
|
-
}, [navigate, resolveLink, page, pageSize]);
|
|
3621
|
-
const clearSpans = (0, import_react10.useCallback)(async () => {
|
|
3622
|
-
setLoading(true);
|
|
3623
|
-
try {
|
|
3624
|
-
await api.deleteSpans();
|
|
3625
|
-
setSpans([]);
|
|
3626
|
-
setFetchError(void 0);
|
|
3627
|
-
await fetchSpans();
|
|
3628
|
-
} catch (error) {
|
|
3629
|
-
console.error("Failed to delete spans:", error);
|
|
3630
|
-
setFetchError(error instanceof Error ? error : new Error("Failed to delete spans", { cause: error }));
|
|
3631
|
-
} finally {
|
|
3632
|
-
setLoading(false);
|
|
3633
|
-
}
|
|
3634
|
-
}, [api, fetchSpans]);
|
|
3635
|
-
const handleRetry = (0, import_react10.useCallback)(() => {
|
|
3636
|
-
void checkStatus();
|
|
3637
|
-
}, [checkStatus]);
|
|
3638
|
-
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
3639
|
-
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
3640
|
-
import_material8.Box,
|
|
3641
|
-
{
|
|
3642
|
-
"data-testid": "spans-list-page",
|
|
3643
|
-
sx: {
|
|
3644
|
-
alignItems: "center",
|
|
3645
|
-
display: "flex",
|
|
3646
|
-
flexDirection: "column",
|
|
3647
|
-
flexGrow: 1,
|
|
3648
|
-
width: "100%"
|
|
3649
|
-
},
|
|
3650
|
-
children: shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
3651
|
-
StatusMessage,
|
|
3652
|
-
{
|
|
3653
|
-
error: statusError,
|
|
3654
|
-
onRetry: handleRetry,
|
|
3655
|
-
status
|
|
3656
|
-
}
|
|
3657
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
3658
|
-
SpansList,
|
|
3659
|
-
{
|
|
3660
|
-
filterWriteOperations,
|
|
3661
|
-
onClearSpans: () => {
|
|
3662
|
-
void clearSpans();
|
|
3663
|
-
},
|
|
3664
|
-
onFilterWriteOperationsChange: (value) => {
|
|
3665
|
-
setFilterWriteOperations(value);
|
|
3666
|
-
},
|
|
3667
|
-
onPageChange: setPage,
|
|
3668
|
-
onPageSizeChange: setPageSize,
|
|
3669
|
-
onRefresh: () => {
|
|
3670
|
-
fetchSpansSync();
|
|
3671
|
-
},
|
|
3672
|
-
onSpanClick: (span) => {
|
|
3673
|
-
navigateToSpan(span);
|
|
3674
|
-
},
|
|
3675
|
-
page,
|
|
3676
|
-
pageSize,
|
|
3677
|
-
spanCount,
|
|
3678
|
-
spans: {
|
|
3679
|
-
data: spans,
|
|
3680
|
-
error: fetchError,
|
|
3681
|
-
loading
|
|
3682
|
-
},
|
|
3683
|
-
spansPerPageOptions
|
|
3684
|
-
}
|
|
3685
|
-
)
|
|
3686
|
-
}
|
|
3687
|
-
);
|
|
3688
|
-
};
|
|
3689
|
-
|
|
3690
3356
|
// src/pages/trace-graph-page.tsx
|
|
3691
3357
|
var import_icons_material11 = require("@mui/icons-material");
|
|
3692
|
-
var
|
|
3358
|
+
var import_material20 = require("@mui/material");
|
|
3693
3359
|
var import_styles = require("@mui/material/styles");
|
|
3694
|
-
var
|
|
3695
|
-
var
|
|
3696
|
-
var import_react_router_dom3 = require("react-router-dom");
|
|
3360
|
+
var import_react19 = require("@xyflow/react");
|
|
3361
|
+
var import_react20 = require("react");
|
|
3697
3362
|
|
|
3698
3363
|
// src/components/event-details/event-details.tsx
|
|
3699
|
-
var
|
|
3700
|
-
var
|
|
3364
|
+
var import_material15 = require("@mui/material");
|
|
3365
|
+
var import_react10 = require("react");
|
|
3701
3366
|
|
|
3702
3367
|
// src/utils/iam-utils.ts
|
|
3703
3368
|
function determinePermissionStatus(payload) {
|
|
@@ -3895,11 +3560,11 @@ var getEventGroupsByType = (events) => {
|
|
|
3895
3560
|
|
|
3896
3561
|
// src/components/event-details/event-details-header.tsx
|
|
3897
3562
|
var import_icons_material3 = require("@mui/icons-material");
|
|
3898
|
-
var
|
|
3899
|
-
var
|
|
3563
|
+
var import_material8 = require("@mui/material");
|
|
3564
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
3900
3565
|
var EventDetailsHeader = ({ event, onClose }) => {
|
|
3901
|
-
return /* @__PURE__ */ (0,
|
|
3902
|
-
|
|
3566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
3567
|
+
import_material8.Box,
|
|
3903
3568
|
{
|
|
3904
3569
|
sx: {
|
|
3905
3570
|
alignItems: "center",
|
|
@@ -3910,60 +3575,60 @@ var EventDetailsHeader = ({ event, onClose }) => {
|
|
|
3910
3575
|
p: 2
|
|
3911
3576
|
},
|
|
3912
3577
|
children: [
|
|
3913
|
-
/* @__PURE__ */ (0,
|
|
3914
|
-
/* @__PURE__ */ (0,
|
|
3915
|
-
/* @__PURE__ */ (0,
|
|
3578
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_material8.Box, { children: [
|
|
3579
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_material8.Typography, { sx: { fontWeight: 600 }, variant: "h6", children: "Event Details" }),
|
|
3580
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_material8.Typography, { color: "text.secondary", variant: "body2", children: [
|
|
3916
3581
|
event.service_name,
|
|
3917
3582
|
" ",
|
|
3918
3583
|
"-",
|
|
3919
3584
|
event.operation_name
|
|
3920
3585
|
] })
|
|
3921
3586
|
] }),
|
|
3922
|
-
onClose && /* @__PURE__ */ (0,
|
|
3587
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_material8.IconButton, { onClick: onClose, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_icons_material3.Close, {}) })
|
|
3923
3588
|
]
|
|
3924
3589
|
}
|
|
3925
3590
|
);
|
|
3926
3591
|
};
|
|
3927
3592
|
|
|
3928
3593
|
// src/components/event-details/event-section.tsx
|
|
3929
|
-
var
|
|
3594
|
+
var import_material14 = require("@mui/material");
|
|
3930
3595
|
|
|
3931
3596
|
// src/components/event-details/event-detail.tsx
|
|
3932
3597
|
var import_icons_material7 = require("@mui/icons-material");
|
|
3933
|
-
var
|
|
3934
|
-
var
|
|
3598
|
+
var import_material12 = require("@mui/material");
|
|
3599
|
+
var import_react8 = require("react");
|
|
3935
3600
|
|
|
3936
3601
|
// src/components/status-icon.tsx
|
|
3937
3602
|
var import_icons_material4 = require("@mui/icons-material");
|
|
3938
|
-
var
|
|
3939
|
-
var
|
|
3603
|
+
var import_material9 = require("@mui/material");
|
|
3604
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
3940
3605
|
var StatusIcon = ({ errorLevel }) => {
|
|
3941
3606
|
switch (errorLevel) {
|
|
3942
3607
|
case EventLevel.LevelError: {
|
|
3943
|
-
return /* @__PURE__ */ (0,
|
|
3608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_icons_material4.Cancel, { sx: { color: "red" } });
|
|
3944
3609
|
}
|
|
3945
3610
|
case EventLevel.LevelInfo: {
|
|
3946
|
-
return /* @__PURE__ */ (0,
|
|
3611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_icons_material4.Info, { sx: { color: "gray" } });
|
|
3947
3612
|
}
|
|
3948
3613
|
case EventLevel.LevelPermission: {
|
|
3949
|
-
return /* @__PURE__ */ (0,
|
|
3614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_icons_material4.RemoveCircle, { sx: { color: "blue" } });
|
|
3950
3615
|
}
|
|
3951
3616
|
case EventLevel.LevelWarning: {
|
|
3952
|
-
return /* @__PURE__ */ (0,
|
|
3617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_icons_material4.Error, { sx: { color: "orange" } });
|
|
3953
3618
|
}
|
|
3954
3619
|
default: {
|
|
3955
|
-
return /* @__PURE__ */ (0,
|
|
3620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_icons_material4.CheckCircle, { sx: { color: "lightgray" } });
|
|
3956
3621
|
}
|
|
3957
3622
|
}
|
|
3958
3623
|
};
|
|
3959
3624
|
|
|
3960
3625
|
// src/components/event-details/iam-event-detail.tsx
|
|
3961
3626
|
var import_icons_material5 = require("@mui/icons-material");
|
|
3962
|
-
var
|
|
3963
|
-
var
|
|
3964
|
-
var DetailRow = ({ content, label }) => /* @__PURE__ */ (0,
|
|
3965
|
-
/* @__PURE__ */ (0,
|
|
3966
|
-
|
|
3627
|
+
var import_material10 = require("@mui/material");
|
|
3628
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
3629
|
+
var DetailRow = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Grid, { container: true, spacing: 0, sx: { mb: 1 }, children: [
|
|
3630
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Grid, { item: true, sx: { pr: 1 }, xs: 3, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
3631
|
+
import_material10.Typography,
|
|
3967
3632
|
{
|
|
3968
3633
|
sx: {
|
|
3969
3634
|
color: "text.secondary",
|
|
@@ -3973,8 +3638,8 @@ var DetailRow = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime13
|
|
|
3973
3638
|
children: label
|
|
3974
3639
|
}
|
|
3975
3640
|
) }),
|
|
3976
|
-
/* @__PURE__ */ (0,
|
|
3977
|
-
|
|
3641
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Grid, { item: true, xs: 9, children: typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
3642
|
+
import_material10.Typography,
|
|
3978
3643
|
{
|
|
3979
3644
|
sx: {
|
|
3980
3645
|
color: "text.primary",
|
|
@@ -3989,30 +3654,30 @@ var PermissionIcon = ({ status }) => {
|
|
|
3989
3654
|
switch (status) {
|
|
3990
3655
|
case "explicitly_allowed":
|
|
3991
3656
|
case "implicitly_allowed": {
|
|
3992
|
-
return /* @__PURE__ */ (0,
|
|
3657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_icons_material5.CheckCircle, { sx: { color: "success.main", fontSize: "1rem" } });
|
|
3993
3658
|
}
|
|
3994
3659
|
case "explicitly_denied": {
|
|
3995
|
-
return /* @__PURE__ */ (0,
|
|
3660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_icons_material5.Error, { sx: { color: "error.main", fontSize: "1rem" } });
|
|
3996
3661
|
}
|
|
3997
3662
|
case "implicitly_denied": {
|
|
3998
|
-
return /* @__PURE__ */ (0,
|
|
3663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_icons_material5.Warning, { sx: { color: "warning.main", fontSize: "1rem" } });
|
|
3999
3664
|
}
|
|
4000
3665
|
}
|
|
4001
3666
|
};
|
|
4002
3667
|
var IAMEventDetail = ({ event }) => {
|
|
4003
3668
|
const payloadString = event.attributes?.payload;
|
|
4004
3669
|
if (!payloadString) {
|
|
4005
|
-
return /* @__PURE__ */ (0,
|
|
3670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Box, { sx: { p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { sx: { fontWeight: 600 }, variant: "body2", children: "No IAM policy evaluation data available" }) });
|
|
4006
3671
|
}
|
|
4007
3672
|
const parsedIAM = parseIAMEvent(payloadString);
|
|
4008
3673
|
if (!parsedIAM) {
|
|
4009
|
-
return /* @__PURE__ */ (0,
|
|
3674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Box, { sx: { p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { sx: { fontWeight: 600 }, variant: "body2", children: "Failed to parse IAM event data" }) });
|
|
4010
3675
|
}
|
|
4011
|
-
return /* @__PURE__ */ (0,
|
|
4012
|
-
/* @__PURE__ */ (0,
|
|
4013
|
-
|
|
3676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { sx: { p: 2 }, children: [
|
|
3677
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Box, { sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
3678
|
+
import_material10.Chip,
|
|
4014
3679
|
{
|
|
4015
|
-
icon: /* @__PURE__ */ (0,
|
|
3680
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(PermissionIcon, { status: parsedIAM.permission }),
|
|
4016
3681
|
label: formatPermissionStatus(parsedIAM.permission),
|
|
4017
3682
|
size: "small",
|
|
4018
3683
|
sx: {
|
|
@@ -4022,13 +3687,13 @@ var IAMEventDetail = ({ event }) => {
|
|
|
4022
3687
|
variant: "outlined"
|
|
4023
3688
|
}
|
|
4024
3689
|
) }),
|
|
4025
|
-
/* @__PURE__ */ (0,
|
|
4026
|
-
/* @__PURE__ */ (0,
|
|
4027
|
-
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ (0,
|
|
3690
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(DetailRow, { content: `${parsedIAM.service}:${parsedIAM.operation}`, label: "Operation" }),
|
|
3691
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(DetailRow, { content: parsedIAM.principal, label: "Principal" }),
|
|
3692
|
+
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
4028
3693
|
DetailRow,
|
|
4029
3694
|
{
|
|
4030
|
-
content: /* @__PURE__ */ (0,
|
|
4031
|
-
|
|
3695
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Box, { children: parsedIAM.details.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
3696
|
+
import_material10.Typography,
|
|
4032
3697
|
{
|
|
4033
3698
|
sx: {
|
|
4034
3699
|
color: "text.primary"
|
|
@@ -4041,11 +3706,11 @@ var IAMEventDetail = ({ event }) => {
|
|
|
4041
3706
|
label: "Actions"
|
|
4042
3707
|
}
|
|
4043
3708
|
),
|
|
4044
|
-
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ (0,
|
|
3709
|
+
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
4045
3710
|
DetailRow,
|
|
4046
3711
|
{
|
|
4047
|
-
content: /* @__PURE__ */ (0,
|
|
4048
|
-
|
|
3712
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Box, { children: parsedIAM.details.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
3713
|
+
import_material10.Typography,
|
|
4049
3714
|
{
|
|
4050
3715
|
sx: {
|
|
4051
3716
|
color: "text.primary",
|
|
@@ -4059,20 +3724,20 @@ var IAMEventDetail = ({ event }) => {
|
|
|
4059
3724
|
label: "Resources"
|
|
4060
3725
|
}
|
|
4061
3726
|
),
|
|
4062
|
-
/* @__PURE__ */ (0,
|
|
4063
|
-
/* @__PURE__ */ (0,
|
|
4064
|
-
/* @__PURE__ */ (0,
|
|
4065
|
-
parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ (0,
|
|
4066
|
-
/* @__PURE__ */ (0,
|
|
4067
|
-
/* @__PURE__ */ (0,
|
|
3727
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { sx: { mt: 2 }, children: [
|
|
3728
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { sx: { fontWeight: 600, mb: 1 }, variant: "caption", children: "Policy Evaluation" }),
|
|
3729
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Grid, { container: true, spacing: 2, children: [
|
|
3730
|
+
parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Grid, { item: true, xs: 4, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { sx: { textAlign: "center" }, children: [
|
|
3731
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "success.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.explicitAllows }),
|
|
3732
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Allows" })
|
|
4068
3733
|
] }) }),
|
|
4069
|
-
parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ (0,
|
|
4070
|
-
/* @__PURE__ */ (0,
|
|
4071
|
-
/* @__PURE__ */ (0,
|
|
3734
|
+
parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Grid, { item: true, xs: 4, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { sx: { textAlign: "center" }, children: [
|
|
3735
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "error.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.explicitDenies }),
|
|
3736
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Explicit Denies" })
|
|
4072
3737
|
] }) }),
|
|
4073
|
-
parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ (0,
|
|
4074
|
-
/* @__PURE__ */ (0,
|
|
4075
|
-
/* @__PURE__ */ (0,
|
|
3738
|
+
parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Grid, { item: true, xs: 4, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_material10.Box, { sx: { textAlign: "center" }, children: [
|
|
3739
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { color: "warning.main", sx: { fontWeight: "bold" }, variant: "h6", children: parsedIAM.details.implicitDenies }),
|
|
3740
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material10.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Implicit Denies" })
|
|
4076
3741
|
] }) })
|
|
4077
3742
|
] })
|
|
4078
3743
|
] })
|
|
@@ -4081,9 +3746,9 @@ var IAMEventDetail = ({ event }) => {
|
|
|
4081
3746
|
|
|
4082
3747
|
// src/components/event-details/iam-permission-detail.tsx
|
|
4083
3748
|
var import_icons_material6 = require("@mui/icons-material");
|
|
4084
|
-
var
|
|
4085
|
-
var
|
|
4086
|
-
var
|
|
3749
|
+
var import_material11 = require("@mui/material");
|
|
3750
|
+
var import_react7 = require("react");
|
|
3751
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
4087
3752
|
var getChipColors = (status) => {
|
|
4088
3753
|
const isAllowed = status === "explicitly_allowed" || status === "implicitly_allowed";
|
|
4089
3754
|
return {
|
|
@@ -4092,8 +3757,8 @@ var getChipColors = (status) => {
|
|
|
4092
3757
|
};
|
|
4093
3758
|
};
|
|
4094
3759
|
var IAMPermissionItem = ({ event }) => {
|
|
4095
|
-
const [isOpen, setIsOpen] = (0,
|
|
4096
|
-
const parsedData = (0,
|
|
3760
|
+
const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
|
|
3761
|
+
const parsedData = (0, import_react7.useMemo)(() => {
|
|
4097
3762
|
const payloadString = event.attributes?.payload;
|
|
4098
3763
|
if (!payloadString) {
|
|
4099
3764
|
return;
|
|
@@ -4111,13 +3776,13 @@ var IAMPermissionItem = ({ event }) => {
|
|
|
4111
3776
|
return null;
|
|
4112
3777
|
}
|
|
4113
3778
|
const { chipColors, parsedIAM } = parsedData;
|
|
4114
|
-
return /* @__PURE__ */ (0,
|
|
4115
|
-
/* @__PURE__ */ (0,
|
|
4116
|
-
/* @__PURE__ */ (0,
|
|
3779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Box, { sx: { mb: 1 }, children: [
|
|
3780
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Box, { sx: { alignItems: "center", display: "flex" }, children: [
|
|
3781
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.IconButton, { onClick: () => {
|
|
4117
3782
|
setIsOpen(!isOpen);
|
|
4118
|
-
}, size: "small", sx: { mr: 1, p: 0 }, children: isOpen ? /* @__PURE__ */ (0,
|
|
4119
|
-
/* @__PURE__ */ (0,
|
|
4120
|
-
|
|
3783
|
+
}, size: "small", sx: { mr: 1, p: 0 }, children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_icons_material6.KeyboardArrowDown, {}) : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_icons_material6.KeyboardArrowRight, {}) }),
|
|
3784
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
3785
|
+
import_material11.Chip,
|
|
4121
3786
|
{
|
|
4122
3787
|
label: formatPermissionStatus(parsedIAM.permission),
|
|
4123
3788
|
size: "small",
|
|
@@ -4128,19 +3793,19 @@ var IAMPermissionItem = ({ event }) => {
|
|
|
4128
3793
|
}
|
|
4129
3794
|
)
|
|
4130
3795
|
] }),
|
|
4131
|
-
isOpen && /* @__PURE__ */ (0,
|
|
4132
|
-
/* @__PURE__ */ (0,
|
|
4133
|
-
/* @__PURE__ */ (0,
|
|
3796
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Box, { sx: { ml: 4, mt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material11.Box, { children: [
|
|
3797
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Principal" }),
|
|
3798
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Typography, { variant: "body2", children: parsedIAM.principal })
|
|
4134
3799
|
] }) })
|
|
4135
3800
|
] });
|
|
4136
3801
|
};
|
|
4137
|
-
var IAMPermissionDetail = ({ events }) => /* @__PURE__ */ (0,
|
|
3802
|
+
var IAMPermissionDetail = ({ events }) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material11.Box, { sx: { mt: 2 }, children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(IAMPermissionItem, { event }, `${event.span_id}-${event.event_id}`)) });
|
|
4138
3803
|
|
|
4139
3804
|
// src/components/event-details/event-detail.tsx
|
|
4140
|
-
var
|
|
4141
|
-
var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0,
|
|
4142
|
-
/* @__PURE__ */ (0,
|
|
4143
|
-
|
|
3805
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
3806
|
+
var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material12.Grid, { container: true, spacing: 0, sx: { mb: 1 }, children: [
|
|
3807
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material12.Grid, { item: true, sx: { pr: 1 }, xs: 3, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3808
|
+
import_material12.Typography,
|
|
4144
3809
|
{
|
|
4145
3810
|
sx: {
|
|
4146
3811
|
color: "text.primary",
|
|
@@ -4150,8 +3815,8 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime1
|
|
|
4150
3815
|
children: label
|
|
4151
3816
|
}
|
|
4152
3817
|
) }),
|
|
4153
|
-
/* @__PURE__ */ (0,
|
|
4154
|
-
|
|
3818
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material12.Grid, { item: true, xs: 9, children: typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3819
|
+
import_material12.Typography,
|
|
4155
3820
|
{
|
|
4156
3821
|
sx: {
|
|
4157
3822
|
color: "text.primary",
|
|
@@ -4163,15 +3828,15 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime1
|
|
|
4163
3828
|
) : content })
|
|
4164
3829
|
] });
|
|
4165
3830
|
var EventMessage = ({ event }) => {
|
|
4166
|
-
const [isOpen, setIsOpen] = (0,
|
|
4167
|
-
const [isOverflowing, setIsOverflowing] = (0,
|
|
4168
|
-
const textReference = (0,
|
|
4169
|
-
const parsedMessage = (0,
|
|
4170
|
-
const isIAMPolicyEvent = (0,
|
|
3831
|
+
const [isOpen, setIsOpen] = (0, import_react8.useState)(false);
|
|
3832
|
+
const [isOverflowing, setIsOverflowing] = (0, import_react8.useState)(false);
|
|
3833
|
+
const textReference = (0, import_react8.useRef)(null);
|
|
3834
|
+
const parsedMessage = (0, import_react8.useMemo)(() => parseEventMessage(event), [event]);
|
|
3835
|
+
const isIAMPolicyEvent = (0, import_react8.useMemo)(
|
|
4171
3836
|
() => event.event_type === "iam.policy_evaluation" && event.attributes?.payload && typeof event.attributes.payload === "string",
|
|
4172
3837
|
[event]
|
|
4173
3838
|
);
|
|
4174
|
-
(0,
|
|
3839
|
+
(0, import_react8.useEffect)(() => {
|
|
4175
3840
|
const checkOverflow = () => {
|
|
4176
3841
|
const element = textReference.current;
|
|
4177
3842
|
if (element) {
|
|
@@ -4184,29 +3849,29 @@ var EventMessage = ({ event }) => {
|
|
|
4184
3849
|
window.removeEventListener("resize", checkOverflow);
|
|
4185
3850
|
};
|
|
4186
3851
|
}, [parsedMessage.headline]);
|
|
4187
|
-
const hasAdditionalContent = (0,
|
|
3852
|
+
const hasAdditionalContent = (0, import_react8.useMemo)(
|
|
4188
3853
|
() => parsedMessage.message || parsedMessage.details || isIAMPolicyEvent,
|
|
4189
3854
|
[parsedMessage.message, parsedMessage.details, isIAMPolicyEvent]
|
|
4190
3855
|
);
|
|
4191
|
-
const shouldShowToggle = (0,
|
|
3856
|
+
const shouldShowToggle = (0, import_react8.useMemo)(
|
|
4192
3857
|
() => isOverflowing || hasAdditionalContent,
|
|
4193
3858
|
[isOverflowing, hasAdditionalContent]
|
|
4194
3859
|
);
|
|
4195
|
-
return /* @__PURE__ */ (0,
|
|
4196
|
-
/* @__PURE__ */ (0,
|
|
4197
|
-
Boolean(shouldShowToggle) && /* @__PURE__ */ (0,
|
|
4198
|
-
|
|
3860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material12.Box, { sx: { display: "flex", flexDirection: "column" }, children: [
|
|
3861
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material12.Box, { sx: { alignItems: "flex-start", display: "flex" }, children: [
|
|
3862
|
+
Boolean(shouldShowToggle) && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3863
|
+
import_material12.IconButton,
|
|
4199
3864
|
{
|
|
4200
3865
|
onClick: () => {
|
|
4201
3866
|
setIsOpen(!isOpen);
|
|
4202
3867
|
},
|
|
4203
3868
|
size: "small",
|
|
4204
3869
|
sx: { mr: 1, mt: -0.5, p: 0 },
|
|
4205
|
-
children: isOpen ? /* @__PURE__ */ (0,
|
|
3870
|
+
children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_icons_material7.KeyboardArrowDown, {}) : /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_icons_material7.KeyboardArrowRight, {})
|
|
4206
3871
|
}
|
|
4207
3872
|
),
|
|
4208
|
-
/* @__PURE__ */ (0,
|
|
4209
|
-
|
|
3873
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3874
|
+
import_material12.Typography,
|
|
4210
3875
|
{
|
|
4211
3876
|
ref: textReference,
|
|
4212
3877
|
sx: {
|
|
@@ -4223,9 +3888,9 @@ var EventMessage = ({ event }) => {
|
|
|
4223
3888
|
}
|
|
4224
3889
|
)
|
|
4225
3890
|
] }),
|
|
4226
|
-
isOpen && /* @__PURE__ */ (0,
|
|
4227
|
-
Boolean(parsedMessage.message) && /* @__PURE__ */ (0,
|
|
4228
|
-
Boolean(parsedMessage.details) && /* @__PURE__ */ (0,
|
|
3891
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material12.Box, { sx: { ml: 4, mt: 1 }, children: isIAMPolicyEvent ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(IAMEventDetail, { event }) : /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_jsx_runtime133.Fragment, { children: [
|
|
3892
|
+
Boolean(parsedMessage.message) && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(DetailRow2, { content: parsedMessage.message, label: "Message:" }),
|
|
3893
|
+
Boolean(parsedMessage.details) && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(DetailRow2, { content: parsedMessage.details, label: "Details:" })
|
|
4229
3894
|
] }) })
|
|
4230
3895
|
] });
|
|
4231
3896
|
};
|
|
@@ -4254,17 +3919,17 @@ var EventDetail = ({
|
|
|
4254
3919
|
type
|
|
4255
3920
|
}) => {
|
|
4256
3921
|
if (type === "permission") {
|
|
4257
|
-
return /* @__PURE__ */ (0,
|
|
4258
|
-
/* @__PURE__ */ (0,
|
|
4259
|
-
|
|
3922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material12.Box, { children: [
|
|
3923
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3924
|
+
import_material12.Box,
|
|
4260
3925
|
{
|
|
4261
3926
|
sx: {
|
|
4262
3927
|
alignItems: "left",
|
|
4263
3928
|
display: "flex",
|
|
4264
3929
|
mb: 1
|
|
4265
3930
|
},
|
|
4266
|
-
children: /* @__PURE__ */ (0,
|
|
4267
|
-
|
|
3931
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3932
|
+
import_material12.Typography,
|
|
4268
3933
|
{
|
|
4269
3934
|
sx: {
|
|
4270
3935
|
alignItems: "left",
|
|
@@ -4278,13 +3943,13 @@ var EventDetail = ({
|
|
|
4278
3943
|
)
|
|
4279
3944
|
}
|
|
4280
3945
|
),
|
|
4281
|
-
/* @__PURE__ */ (0,
|
|
3946
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(IAMPermissionDetail, { events })
|
|
4282
3947
|
] });
|
|
4283
3948
|
}
|
|
4284
3949
|
const eventLevel = getEventLevelFromGroup(type);
|
|
4285
|
-
return /* @__PURE__ */ (0,
|
|
4286
|
-
/* @__PURE__ */ (0,
|
|
4287
|
-
|
|
3950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_material12.Box, { children: [
|
|
3951
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
3952
|
+
import_material12.Box,
|
|
4288
3953
|
{
|
|
4289
3954
|
sx: {
|
|
4290
3955
|
alignItems: "left",
|
|
@@ -4293,9 +3958,9 @@ var EventDetail = ({
|
|
|
4293
3958
|
mb: 1
|
|
4294
3959
|
},
|
|
4295
3960
|
children: [
|
|
4296
|
-
/* @__PURE__ */ (0,
|
|
4297
|
-
/* @__PURE__ */ (0,
|
|
4298
|
-
|
|
3961
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(StatusIcon, { errorLevel: eventLevel }),
|
|
3962
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3963
|
+
import_material12.Typography,
|
|
4299
3964
|
{
|
|
4300
3965
|
sx: {
|
|
4301
3966
|
alignItems: "left",
|
|
@@ -4313,14 +3978,14 @@ var EventDetail = ({
|
|
|
4313
3978
|
]
|
|
4314
3979
|
}
|
|
4315
3980
|
),
|
|
4316
|
-
/* @__PURE__ */ (0,
|
|
4317
|
-
|
|
3981
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material12.Box, { sx: { mt: 2 }, children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
3982
|
+
import_material12.Box,
|
|
4318
3983
|
{
|
|
4319
3984
|
sx: {
|
|
4320
3985
|
maxWidth: "100%",
|
|
4321
3986
|
mb: 1
|
|
4322
3987
|
},
|
|
4323
|
-
children: /* @__PURE__ */ (0,
|
|
3988
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(EventMessage, { event })
|
|
4324
3989
|
},
|
|
4325
3990
|
`${event.span_id}-${event.event_id}`
|
|
4326
3991
|
)) })
|
|
@@ -4329,14 +3994,14 @@ var EventDetail = ({
|
|
|
4329
3994
|
|
|
4330
3995
|
// src/components/event-details/toggle-section.tsx
|
|
4331
3996
|
var import_icons_material8 = require("@mui/icons-material");
|
|
4332
|
-
var
|
|
4333
|
-
var
|
|
4334
|
-
var
|
|
3997
|
+
var import_material13 = require("@mui/material");
|
|
3998
|
+
var import_react9 = require("react");
|
|
3999
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
4335
4000
|
var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
4336
|
-
const [isOpen, setIsOpen] = (0,
|
|
4337
|
-
return /* @__PURE__ */ (0,
|
|
4338
|
-
/* @__PURE__ */ (0,
|
|
4339
|
-
|
|
4001
|
+
const [isOpen, setIsOpen] = (0, import_react9.useState)(initialOpen);
|
|
4002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_material13.Box, { sx: { mt: 4 }, children: [
|
|
4003
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
4004
|
+
import_material13.Box,
|
|
4340
4005
|
{
|
|
4341
4006
|
onClick: () => {
|
|
4342
4007
|
setIsOpen(!isOpen);
|
|
@@ -4345,8 +4010,8 @@ var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
|
4345
4010
|
cursor: "pointer",
|
|
4346
4011
|
mb: 1
|
|
4347
4012
|
},
|
|
4348
|
-
children: /* @__PURE__ */ (0,
|
|
4349
|
-
|
|
4013
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
4014
|
+
import_material13.Box,
|
|
4350
4015
|
{
|
|
4351
4016
|
role: "button",
|
|
4352
4017
|
sx: {
|
|
@@ -4355,24 +4020,24 @@ var ToggleSection = ({ children, headline, initialOpen = true }) => {
|
|
|
4355
4020
|
gap: 1
|
|
4356
4021
|
},
|
|
4357
4022
|
children: [
|
|
4358
|
-
/* @__PURE__ */ (0,
|
|
4359
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
4023
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material13.Typography, { sx: { fontWeight: 600 }, variant: "subtitle2", children: headline }),
|
|
4024
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.KeyboardArrowDown, { sx: { color: "text.secondary", height: 20, width: 20 } }) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.KeyboardArrowRight, { sx: { color: "text.secondary", height: 20, width: 20 } })
|
|
4360
4025
|
]
|
|
4361
4026
|
}
|
|
4362
4027
|
)
|
|
4363
4028
|
}
|
|
4364
4029
|
),
|
|
4365
|
-
isOpen && /* @__PURE__ */ (0,
|
|
4030
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material13.Box, { children })
|
|
4366
4031
|
] });
|
|
4367
4032
|
};
|
|
4368
4033
|
|
|
4369
4034
|
// src/components/event-details/event-section.tsx
|
|
4370
|
-
var
|
|
4035
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
4371
4036
|
var EventSection = ({
|
|
4372
4037
|
eventGroups,
|
|
4373
4038
|
headline
|
|
4374
|
-
}) => /* @__PURE__ */ (0,
|
|
4375
|
-
eventGroups.errors && /* @__PURE__ */ (0,
|
|
4039
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(ToggleSection, { headline, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material14.Box, { children: [
|
|
4040
|
+
eventGroups.errors && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4376
4041
|
EventDetail,
|
|
4377
4042
|
{
|
|
4378
4043
|
displayText: "Error",
|
|
@@ -4380,7 +4045,7 @@ var EventSection = ({
|
|
|
4380
4045
|
type: "error"
|
|
4381
4046
|
}
|
|
4382
4047
|
),
|
|
4383
|
-
eventGroups.warnings && /* @__PURE__ */ (0,
|
|
4048
|
+
eventGroups.warnings && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4384
4049
|
EventDetail,
|
|
4385
4050
|
{
|
|
4386
4051
|
displayText: "Warning",
|
|
@@ -4388,7 +4053,7 @@ var EventSection = ({
|
|
|
4388
4053
|
type: "warning"
|
|
4389
4054
|
}
|
|
4390
4055
|
),
|
|
4391
|
-
eventGroups.permissions && /* @__PURE__ */ (0,
|
|
4056
|
+
eventGroups.permissions && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4392
4057
|
EventDetail,
|
|
4393
4058
|
{
|
|
4394
4059
|
displayText: "IAM Permission",
|
|
@@ -4396,7 +4061,7 @@ var EventSection = ({
|
|
|
4396
4061
|
type: "permission"
|
|
4397
4062
|
}
|
|
4398
4063
|
),
|
|
4399
|
-
eventGroups.info && /* @__PURE__ */ (0,
|
|
4064
|
+
eventGroups.info && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
4400
4065
|
EventDetail,
|
|
4401
4066
|
{
|
|
4402
4067
|
displayText: "Info",
|
|
@@ -4407,77 +4072,77 @@ var EventSection = ({
|
|
|
4407
4072
|
] }) });
|
|
4408
4073
|
|
|
4409
4074
|
// src/components/event-details/event-details.tsx
|
|
4410
|
-
var
|
|
4075
|
+
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
4411
4076
|
var EventDetails = ({ onClose, selectedEvent }) => {
|
|
4412
|
-
const attributes = (0,
|
|
4077
|
+
const attributes = (0, import_react10.useMemo)(() => {
|
|
4413
4078
|
const attributes2 = Object.entries(selectedEvent?.attributes ?? {});
|
|
4414
4079
|
return attributes2.filter(([key]) => key !== "localstack.aws.account_id" && key !== "localstack.aws.service");
|
|
4415
4080
|
}, [selectedEvent?.attributes]);
|
|
4416
4081
|
if (!selectedEvent) {
|
|
4417
|
-
return /* @__PURE__ */ (0,
|
|
4082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Box, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { color: "text.secondary", variant: "body2", children: "Select an event to view details" }) });
|
|
4418
4083
|
}
|
|
4419
|
-
return /* @__PURE__ */ (0,
|
|
4420
|
-
/* @__PURE__ */ (0,
|
|
4421
|
-
/* @__PURE__ */ (0,
|
|
4422
|
-
/* @__PURE__ */ (0,
|
|
4423
|
-
/* @__PURE__ */ (0,
|
|
4424
|
-
/* @__PURE__ */ (0,
|
|
4425
|
-
/* @__PURE__ */ (0,
|
|
4084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Box, { "data-testid": "event-details", sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
4085
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(EventDetailsHeader, { event: selectedEvent, onClose }),
|
|
4086
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Box, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Stack, { spacing: 2, children: [
|
|
4087
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Stack, { spacing: 1, children: [
|
|
4088
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Box, { children: [
|
|
4089
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Span ID" }),
|
|
4090
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { variant: "body2", children: selectedEvent.span_id })
|
|
4426
4091
|
] }),
|
|
4427
|
-
/* @__PURE__ */ (0,
|
|
4428
|
-
/* @__PURE__ */ (0,
|
|
4429
|
-
/* @__PURE__ */ (0,
|
|
4092
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Box, { children: [
|
|
4093
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Trace ID" }),
|
|
4094
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { variant: "body2", children: selectedEvent.trace_id })
|
|
4430
4095
|
] }),
|
|
4431
|
-
/* @__PURE__ */ (0,
|
|
4432
|
-
/* @__PURE__ */ (0,
|
|
4433
|
-
/* @__PURE__ */ (0,
|
|
4096
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Box, { children: [
|
|
4097
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Operation" }),
|
|
4098
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { variant: "body2", children: selectedEvent.operation_name })
|
|
4434
4099
|
] })
|
|
4435
4100
|
] }) }),
|
|
4436
|
-
/* @__PURE__ */ (0,
|
|
4437
|
-
/* @__PURE__ */ (0,
|
|
4438
|
-
/* @__PURE__ */ (0,
|
|
4439
|
-
/* @__PURE__ */ (0,
|
|
4440
|
-
/* @__PURE__ */ (0,
|
|
4101
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Divider, {}),
|
|
4102
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(ToggleSection, { headline: "Service Information", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Stack, { spacing: 1, children: [
|
|
4103
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Box, { children: [
|
|
4104
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Service" }),
|
|
4105
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { variant: "body2", children: selectedEvent.service_name })
|
|
4441
4106
|
] }),
|
|
4442
|
-
/* @__PURE__ */ (0,
|
|
4443
|
-
/* @__PURE__ */ (0,
|
|
4444
|
-
/* @__PURE__ */ (0,
|
|
4107
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Box, { children: [
|
|
4108
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource" }),
|
|
4109
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { variant: "body2", children: selectedEvent.resource_name })
|
|
4445
4110
|
] }),
|
|
4446
|
-
Boolean(selectedEvent.region) && /* @__PURE__ */ (0,
|
|
4447
|
-
/* @__PURE__ */ (0,
|
|
4448
|
-
/* @__PURE__ */ (0,
|
|
4111
|
+
Boolean(selectedEvent.region) && /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Box, { children: [
|
|
4112
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Region" }),
|
|
4113
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { variant: "body2", children: selectedEvent.region })
|
|
4449
4114
|
] })
|
|
4450
4115
|
] }) }),
|
|
4451
|
-
/* @__PURE__ */ (0,
|
|
4452
|
-
/* @__PURE__ */ (0,
|
|
4453
|
-
/* @__PURE__ */ (0,
|
|
4454
|
-
/* @__PURE__ */ (0,
|
|
4455
|
-
/* @__PURE__ */ (0,
|
|
4116
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Divider, {}),
|
|
4117
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(ToggleSection, { headline: "Timing", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Stack, { spacing: 1, children: [
|
|
4118
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Box, { children: [
|
|
4119
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Start Time" }),
|
|
4120
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { variant: "body2", children: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
|
|
4456
4121
|
] }),
|
|
4457
|
-
Boolean(selectedEvent.end_time_unix_nano) && /* @__PURE__ */ (0,
|
|
4458
|
-
/* @__PURE__ */ (0,
|
|
4459
|
-
/* @__PURE__ */ (0,
|
|
4122
|
+
Boolean(selectedEvent.end_time_unix_nano) && /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Box, { children: [
|
|
4123
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Duration" }),
|
|
4124
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Typography, { variant: "body2", children: [
|
|
4460
4125
|
((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString(),
|
|
4461
4126
|
" ",
|
|
4462
4127
|
"ms"
|
|
4463
4128
|
] })
|
|
4464
4129
|
] })
|
|
4465
4130
|
] }) }),
|
|
4466
|
-
/* @__PURE__ */ (0,
|
|
4467
|
-
/* @__PURE__ */ (0,
|
|
4468
|
-
/* @__PURE__ */ (0,
|
|
4469
|
-
|
|
4131
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Divider, {}),
|
|
4132
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(ToggleSection, { headline: "Status", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Stack, { direction: "row", spacing: 1, children: [
|
|
4133
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
4134
|
+
import_material15.Chip,
|
|
4470
4135
|
{
|
|
4471
4136
|
color: selectedEvent.status_code === 2 ? "error" : selectedEvent.status_code === 1 ? "success" : "default",
|
|
4472
4137
|
label: selectedEvent.status_code === 2 ? "Error" : selectedEvent.status_code === 1 ? "OK" : "Unset",
|
|
4473
4138
|
size: "small"
|
|
4474
4139
|
}
|
|
4475
4140
|
),
|
|
4476
|
-
Boolean(selectedEvent.status_message) && /* @__PURE__ */ (0,
|
|
4141
|
+
Boolean(selectedEvent.status_message) && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { variant: "body2", children: selectedEvent.status_message })
|
|
4477
4142
|
] }) }),
|
|
4478
|
-
selectedEvent.events.length > 0 && /* @__PURE__ */ (0,
|
|
4479
|
-
/* @__PURE__ */ (0,
|
|
4480
|
-
/* @__PURE__ */ (0,
|
|
4143
|
+
selectedEvent.events.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_jsx_runtime136.Fragment, { children: [
|
|
4144
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Divider, {}),
|
|
4145
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
4481
4146
|
EventSection,
|
|
4482
4147
|
{
|
|
4483
4148
|
eventGroups: getEventGroupsByType(selectedEvent.events),
|
|
@@ -4485,10 +4150,10 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
4485
4150
|
}
|
|
4486
4151
|
)
|
|
4487
4152
|
] }),
|
|
4488
|
-
attributes.length > 0 && /* @__PURE__ */ (0,
|
|
4489
|
-
/* @__PURE__ */ (0,
|
|
4490
|
-
/* @__PURE__ */ (0,
|
|
4491
|
-
/* @__PURE__ */ (0,
|
|
4153
|
+
attributes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_jsx_runtime136.Fragment, { children: [
|
|
4154
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Divider, {}),
|
|
4155
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(ToggleSection, { headline: "Attributes", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Stack, { spacing: 1, children: attributes.map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material15.Box, { children: [
|
|
4156
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: key }),
|
|
4492
4157
|
renderKeyValue(key, value)
|
|
4493
4158
|
] }, key)) }) })
|
|
4494
4159
|
] })
|
|
@@ -4497,46 +4162,46 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
4497
4162
|
};
|
|
4498
4163
|
function renderKeyValue(key, value) {
|
|
4499
4164
|
if (typeof value === "string" && (key === "localstack.aws.service.request" || key === "localstack.aws.service.response" || key === "localstack.aws.service.exception")) {
|
|
4500
|
-
return /* @__PURE__ */ (0,
|
|
4165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Box, { sx: { backgroundColor: (theme) => theme.palette.background.default, borderRadius: 1, p: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("pre", { style: { margin: 0, overflow: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { variant: "body2", children: JSON.stringify(JSON.parse(value), void 0, 2) }) }) });
|
|
4501
4166
|
}
|
|
4502
4167
|
if (typeof value === "boolean") {
|
|
4503
|
-
return /* @__PURE__ */ (0,
|
|
4168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { variant: "body2", children: value ? "yes" : "no" });
|
|
4504
4169
|
}
|
|
4505
|
-
return /* @__PURE__ */ (0,
|
|
4170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material15.Typography, { variant: "body2", children: value });
|
|
4506
4171
|
}
|
|
4507
4172
|
|
|
4508
4173
|
// src/components/trace-graph/trace-graph.tsx
|
|
4509
4174
|
var import_base = require("@xyflow/react/dist/base.css");
|
|
4510
|
-
var
|
|
4511
|
-
var
|
|
4512
|
-
var
|
|
4175
|
+
var import_material19 = require("@mui/material");
|
|
4176
|
+
var import_react17 = require("@xyflow/react");
|
|
4177
|
+
var import_react18 = require("react");
|
|
4513
4178
|
|
|
4514
4179
|
// src/components/trace-graph/service-node.tsx
|
|
4515
|
-
var
|
|
4180
|
+
var import_material17 = require("@mui/material");
|
|
4516
4181
|
var import_style = require("@xyflow/react/dist/style.css");
|
|
4517
|
-
var
|
|
4518
|
-
var
|
|
4182
|
+
var import_react12 = require("@xyflow/react");
|
|
4183
|
+
var import_react13 = require("react");
|
|
4519
4184
|
|
|
4520
4185
|
// src/components/trace-graph/problem-indicator.tsx
|
|
4521
4186
|
var import_icons_material9 = require("@mui/icons-material");
|
|
4522
|
-
var
|
|
4523
|
-
var
|
|
4524
|
-
var
|
|
4187
|
+
var import_material16 = require("@mui/material");
|
|
4188
|
+
var import_react11 = require("react");
|
|
4189
|
+
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
4525
4190
|
var ProblemIndicator = ({ error }) => {
|
|
4526
|
-
const icon = (0,
|
|
4191
|
+
const icon = (0, import_react11.useMemo)(() => {
|
|
4527
4192
|
switch (error.level) {
|
|
4528
4193
|
case "error": {
|
|
4529
|
-
return /* @__PURE__ */ (0,
|
|
4194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_icons_material9.Error, { sx: { color: "#d32f2f", fontSize: "14px" } });
|
|
4530
4195
|
}
|
|
4531
4196
|
case "warning": {
|
|
4532
|
-
return /* @__PURE__ */ (0,
|
|
4197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_icons_material9.Warning, { sx: { color: "#ff9800", fontSize: "14px" } });
|
|
4533
4198
|
}
|
|
4534
4199
|
default: {
|
|
4535
|
-
return /* @__PURE__ */ (0,
|
|
4200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_icons_material9.Info, { sx: { color: "#2196f3", fontSize: "14px" } });
|
|
4536
4201
|
}
|
|
4537
4202
|
}
|
|
4538
4203
|
}, [error.level]);
|
|
4539
|
-
const color = (0,
|
|
4204
|
+
const color = (0, import_react11.useMemo)(() => {
|
|
4540
4205
|
switch (error.level) {
|
|
4541
4206
|
case "error": {
|
|
4542
4207
|
return "#d32f2f";
|
|
@@ -4549,8 +4214,8 @@ var ProblemIndicator = ({ error }) => {
|
|
|
4549
4214
|
}
|
|
4550
4215
|
}
|
|
4551
4216
|
}, [error.level]);
|
|
4552
|
-
return /* @__PURE__ */ (0,
|
|
4553
|
-
|
|
4217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material16.Tooltip, { arrow: true, title: error.message ?? "Issue detected", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
4218
|
+
import_material16.Box,
|
|
4554
4219
|
{
|
|
4555
4220
|
sx: {
|
|
4556
4221
|
alignItems: "center",
|
|
@@ -4569,17 +4234,17 @@ var ProblemIndicator = ({ error }) => {
|
|
|
4569
4234
|
};
|
|
4570
4235
|
|
|
4571
4236
|
// src/components/trace-graph/service-node.tsx
|
|
4572
|
-
var
|
|
4237
|
+
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
4573
4238
|
var handleStyle = {
|
|
4574
4239
|
backgroundColor: "white",
|
|
4575
4240
|
borderColor: "lightgray",
|
|
4576
4241
|
opacity: 0
|
|
4577
4242
|
};
|
|
4578
|
-
var ServiceNode = (0,
|
|
4243
|
+
var ServiceNode = (0, import_react13.memo)(({ data, selected }) => {
|
|
4579
4244
|
const hasErrors = (data.event.errors && data.event.errors.length > 0) ?? false;
|
|
4580
|
-
return /* @__PURE__ */ (0,
|
|
4581
|
-
/* @__PURE__ */ (0,
|
|
4582
|
-
|
|
4245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material17.Box, { sx: { maxWidth: 200 }, children: [
|
|
4246
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
|
|
4247
|
+
import_material17.Box,
|
|
4583
4248
|
{
|
|
4584
4249
|
role: "button",
|
|
4585
4250
|
sx: {
|
|
@@ -4599,9 +4264,9 @@ var ServiceNode = (0, import_react17.memo)(({ data, selected }) => {
|
|
|
4599
4264
|
},
|
|
4600
4265
|
tabIndex: 0,
|
|
4601
4266
|
children: [
|
|
4602
|
-
/* @__PURE__ */ (0,
|
|
4603
|
-
/* @__PURE__ */ (0,
|
|
4604
|
-
/* @__PURE__ */ (0,
|
|
4267
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_react12.Handle, { position: import_react12.Position.Left, style: handleStyle, type: "target" }),
|
|
4268
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_react12.Handle, { position: import_react12.Position.Right, style: handleStyle, type: "source" }),
|
|
4269
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
4605
4270
|
ServiceCell,
|
|
4606
4271
|
{
|
|
4607
4272
|
height: "32px",
|
|
@@ -4614,8 +4279,8 @@ var ServiceNode = (0, import_react17.memo)(({ data, selected }) => {
|
|
|
4614
4279
|
]
|
|
4615
4280
|
}
|
|
4616
4281
|
),
|
|
4617
|
-
/* @__PURE__ */ (0,
|
|
4618
|
-
|
|
4282
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
|
|
4283
|
+
import_material17.Stack,
|
|
4619
4284
|
{
|
|
4620
4285
|
alignItems: "center",
|
|
4621
4286
|
direction: "row",
|
|
@@ -4625,8 +4290,8 @@ var ServiceNode = (0, import_react17.memo)(({ data, selected }) => {
|
|
|
4625
4290
|
mt: 0.5
|
|
4626
4291
|
},
|
|
4627
4292
|
children: [
|
|
4628
|
-
hasErrors && /* @__PURE__ */ (0,
|
|
4629
|
-
|
|
4293
|
+
hasErrors && /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
4294
|
+
import_material17.Stack,
|
|
4630
4295
|
{
|
|
4631
4296
|
direction: "row",
|
|
4632
4297
|
spacing: 0.5,
|
|
@@ -4634,11 +4299,11 @@ var ServiceNode = (0, import_react17.memo)(({ data, selected }) => {
|
|
|
4634
4299
|
flexWrap: "wrap",
|
|
4635
4300
|
gap: "2px"
|
|
4636
4301
|
},
|
|
4637
|
-
children: data.event.errors?.map((error) => /* @__PURE__ */ (0,
|
|
4302
|
+
children: data.event.errors?.map((error) => /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ProblemIndicator, { error }, error.span_id))
|
|
4638
4303
|
}
|
|
4639
4304
|
),
|
|
4640
|
-
/* @__PURE__ */ (0,
|
|
4641
|
-
|
|
4305
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
4306
|
+
import_material17.Typography,
|
|
4642
4307
|
{
|
|
4643
4308
|
sx: {
|
|
4644
4309
|
fontSize: "0.9rem",
|
|
@@ -4660,7 +4325,7 @@ var ServiceNode = (0, import_react17.memo)(({ data, selected }) => {
|
|
|
4660
4325
|
|
|
4661
4326
|
// src/components/trace-graph/utils.ts
|
|
4662
4327
|
var import_dagre = __toESM(require("@dagrejs/dagre"), 1);
|
|
4663
|
-
var
|
|
4328
|
+
var import_react14 = require("@xyflow/react");
|
|
4664
4329
|
var generateNodesAndEdges = (event, parentId) => {
|
|
4665
4330
|
const nodes = [];
|
|
4666
4331
|
const edges = [];
|
|
@@ -4676,8 +4341,8 @@ var generateNodesAndEdges = (event, parentId) => {
|
|
|
4676
4341
|
id: event.span_id,
|
|
4677
4342
|
position: { x: 0, y: 0 },
|
|
4678
4343
|
// Will be set by layout
|
|
4679
|
-
sourcePosition:
|
|
4680
|
-
targetPosition:
|
|
4344
|
+
sourcePosition: import_react14.Position.Right,
|
|
4345
|
+
targetPosition: import_react14.Position.Left,
|
|
4681
4346
|
type: "service"
|
|
4682
4347
|
});
|
|
4683
4348
|
if (parentId) {
|
|
@@ -4687,7 +4352,7 @@ var generateNodesAndEdges = (event, parentId) => {
|
|
|
4687
4352
|
markerEnd: {
|
|
4688
4353
|
color: "lightgray",
|
|
4689
4354
|
height: 16,
|
|
4690
|
-
type:
|
|
4355
|
+
type: import_react14.MarkerType.Arrow,
|
|
4691
4356
|
width: 16
|
|
4692
4357
|
},
|
|
4693
4358
|
source: parentId,
|
|
@@ -4754,9 +4419,9 @@ var calculateCenterX = (focusNodeX, viewPortPixelWidth, minX, maxX) => {
|
|
|
4754
4419
|
|
|
4755
4420
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
4756
4421
|
var import_icons_material10 = require("@mui/icons-material");
|
|
4757
|
-
var
|
|
4758
|
-
var
|
|
4759
|
-
var
|
|
4422
|
+
var import_material18 = require("@mui/material");
|
|
4423
|
+
var import_react15 = require("@xyflow/react");
|
|
4424
|
+
var import_react16 = require("react");
|
|
4760
4425
|
|
|
4761
4426
|
// node_modules/zustand/esm/shallow.mjs
|
|
4762
4427
|
function shallow$1(objA, objB) {
|
|
@@ -4797,15 +4462,15 @@ function shallow$1(objA, objB) {
|
|
|
4797
4462
|
}
|
|
4798
4463
|
|
|
4799
4464
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
4800
|
-
var
|
|
4465
|
+
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
4801
4466
|
var selector = (s) => ({
|
|
4802
4467
|
isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,
|
|
4803
4468
|
maxZoomReached: s.transform[2] >= s.maxZoom,
|
|
4804
4469
|
minZoomReached: s.transform[2] <= s.minZoom
|
|
4805
4470
|
});
|
|
4806
|
-
var Controls = (0,
|
|
4807
|
-
const { maxZoomReached, minZoomReached } = (0,
|
|
4808
|
-
const { fitView, zoomIn, zoomOut } = (0,
|
|
4471
|
+
var Controls = (0, import_react16.memo)(() => {
|
|
4472
|
+
const { maxZoomReached, minZoomReached } = (0, import_react15.useStore)(selector, shallow$1);
|
|
4473
|
+
const { fitView, zoomIn, zoomOut } = (0, import_react15.useReactFlow)();
|
|
4809
4474
|
const onZoomInHandler = () => {
|
|
4810
4475
|
void zoomIn();
|
|
4811
4476
|
};
|
|
@@ -4815,8 +4480,8 @@ var Controls = (0, import_react20.memo)(() => {
|
|
|
4815
4480
|
const onFitViewHandler = () => {
|
|
4816
4481
|
void fitView();
|
|
4817
4482
|
};
|
|
4818
|
-
return /* @__PURE__ */ (0,
|
|
4819
|
-
|
|
4483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
4484
|
+
import_material18.Box,
|
|
4820
4485
|
{
|
|
4821
4486
|
sx: {
|
|
4822
4487
|
bottom: 0,
|
|
@@ -4829,33 +4494,33 @@ var Controls = (0, import_react20.memo)(() => {
|
|
|
4829
4494
|
zIndex: 5
|
|
4830
4495
|
},
|
|
4831
4496
|
children: [
|
|
4832
|
-
/* @__PURE__ */ (0,
|
|
4833
|
-
|
|
4497
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
4498
|
+
import_material18.IconButton,
|
|
4834
4499
|
{
|
|
4835
4500
|
className: "react-flow__controls-zoomin",
|
|
4836
4501
|
disabled: maxZoomReached,
|
|
4837
4502
|
onClick: onZoomInHandler,
|
|
4838
4503
|
size: "small",
|
|
4839
|
-
children: /* @__PURE__ */ (0,
|
|
4504
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_icons_material10.Add, {})
|
|
4840
4505
|
}
|
|
4841
4506
|
),
|
|
4842
|
-
/* @__PURE__ */ (0,
|
|
4843
|
-
|
|
4507
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
4508
|
+
import_material18.IconButton,
|
|
4844
4509
|
{
|
|
4845
4510
|
className: "react-flow__controls-zoomout",
|
|
4846
4511
|
disabled: minZoomReached,
|
|
4847
4512
|
onClick: onZoomOutHandler,
|
|
4848
4513
|
size: "small",
|
|
4849
|
-
children: /* @__PURE__ */ (0,
|
|
4514
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_icons_material10.Remove, {})
|
|
4850
4515
|
}
|
|
4851
4516
|
),
|
|
4852
|
-
/* @__PURE__ */ (0,
|
|
4853
|
-
|
|
4517
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
4518
|
+
import_material18.IconButton,
|
|
4854
4519
|
{
|
|
4855
4520
|
className: "react-flow__controls-fitview",
|
|
4856
4521
|
onClick: onFitViewHandler,
|
|
4857
4522
|
size: "small",
|
|
4858
|
-
children: /* @__PURE__ */ (0,
|
|
4523
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_icons_material10.FitScreen, {})
|
|
4859
4524
|
}
|
|
4860
4525
|
)
|
|
4861
4526
|
]
|
|
@@ -4864,7 +4529,7 @@ var Controls = (0, import_react20.memo)(() => {
|
|
|
4864
4529
|
});
|
|
4865
4530
|
|
|
4866
4531
|
// src/components/trace-graph/trace-graph.tsx
|
|
4867
|
-
var
|
|
4532
|
+
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
4868
4533
|
var nodeTypes = {
|
|
4869
4534
|
service: ServiceNode
|
|
4870
4535
|
};
|
|
@@ -4875,17 +4540,17 @@ var TraceGraph = ({
|
|
|
4875
4540
|
spans,
|
|
4876
4541
|
viewPortPixelWidth
|
|
4877
4542
|
}) => {
|
|
4878
|
-
const [nodes, setNodes] = (0,
|
|
4879
|
-
const [edges, setEdges] = (0,
|
|
4880
|
-
const [initialViewSet, setInitialViewSet] = (0,
|
|
4881
|
-
const { fitView, setCenter } = (0,
|
|
4882
|
-
const updateSelectedNode = (0,
|
|
4543
|
+
const [nodes, setNodes] = (0, import_react18.useState)([]);
|
|
4544
|
+
const [edges, setEdges] = (0, import_react18.useState)([]);
|
|
4545
|
+
const [initialViewSet, setInitialViewSet] = (0, import_react18.useState)(false);
|
|
4546
|
+
const { fitView, setCenter } = (0, import_react17.useReactFlow)();
|
|
4547
|
+
const updateSelectedNode = (0, import_react18.useCallback)((nodeId) => {
|
|
4883
4548
|
const toSelect = new Set(nodeId ? [nodeId] : []);
|
|
4884
4549
|
setNodes((previousNodes) => {
|
|
4885
4550
|
return previousNodes.map((node) => ({ ...node, selected: toSelect.has(node.id) }));
|
|
4886
4551
|
});
|
|
4887
4552
|
}, []);
|
|
4888
|
-
(0,
|
|
4553
|
+
(0, import_react18.useEffect)(() => {
|
|
4889
4554
|
const spansMap = /* @__PURE__ */ new Map();
|
|
4890
4555
|
const rootSpans = [];
|
|
4891
4556
|
for (const span of spans.data ?? []) {
|
|
@@ -4920,7 +4585,7 @@ var TraceGraph = ({
|
|
|
4920
4585
|
setNodes(layoutedNodes);
|
|
4921
4586
|
setEdges(layoutedEdges);
|
|
4922
4587
|
}, [spans.data, initialFocusEventId]);
|
|
4923
|
-
(0,
|
|
4588
|
+
(0, import_react18.useEffect)(() => {
|
|
4924
4589
|
const shouldSetInitialView = !spans.loading && nodes.length > 0 && !initialViewSet;
|
|
4925
4590
|
if (shouldSetInitialView) {
|
|
4926
4591
|
if (initialFocusEventId) {
|
|
@@ -4940,21 +4605,21 @@ var TraceGraph = ({
|
|
|
4940
4605
|
setInitialViewSet(true);
|
|
4941
4606
|
}
|
|
4942
4607
|
}, [spans.loading, nodes, initialFocusEventId, viewPortPixelWidth, setCenter, fitView, onEventSelect, initialViewSet]);
|
|
4943
|
-
(0,
|
|
4608
|
+
(0, import_react18.useEffect)(() => {
|
|
4944
4609
|
if (initialFocusEventId) {
|
|
4945
4610
|
updateSelectedNode(initialFocusEventId);
|
|
4946
4611
|
}
|
|
4947
4612
|
}, [initialFocusEventId, updateSelectedNode]);
|
|
4948
|
-
const onNodeClick = (0,
|
|
4613
|
+
const onNodeClick = (0, import_react18.useCallback)((_event, node) => {
|
|
4949
4614
|
onEventSelect(node.data.event);
|
|
4950
4615
|
updateSelectedNode(node.id);
|
|
4951
4616
|
}, [onEventSelect, updateSelectedNode]);
|
|
4952
|
-
const theme = (0,
|
|
4953
|
-
return /* @__PURE__ */ (0,
|
|
4954
|
-
spans.error && /* @__PURE__ */ (0,
|
|
4955
|
-
|
|
4617
|
+
const theme = (0, import_material19.useTheme)();
|
|
4618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
|
|
4619
|
+
spans.error && /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
|
|
4620
|
+
import_material19.Alert,
|
|
4956
4621
|
{
|
|
4957
|
-
action: /* @__PURE__ */ (0,
|
|
4622
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material19.Button, { onClick: () => {
|
|
4958
4623
|
onRefresh();
|
|
4959
4624
|
}, children: "Retry" }),
|
|
4960
4625
|
severity: "error",
|
|
@@ -4965,8 +4630,8 @@ var TraceGraph = ({
|
|
|
4965
4630
|
]
|
|
4966
4631
|
}
|
|
4967
4632
|
),
|
|
4968
|
-
/* @__PURE__ */ (0,
|
|
4969
|
-
|
|
4633
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
|
|
4634
|
+
import_react17.ReactFlow,
|
|
4970
4635
|
{
|
|
4971
4636
|
"data-testid": "trace-graph",
|
|
4972
4637
|
defaultViewport: { x: 0, y: 0, zoom: 1 },
|
|
@@ -4979,9 +4644,9 @@ var TraceGraph = ({
|
|
|
4979
4644
|
onNodeClick,
|
|
4980
4645
|
selectNodesOnDrag: false,
|
|
4981
4646
|
children: [
|
|
4982
|
-
/* @__PURE__ */ (0,
|
|
4983
|
-
/* @__PURE__ */ (0,
|
|
4984
|
-
|
|
4647
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(Controls, {}),
|
|
4648
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
4649
|
+
import_react17.Background,
|
|
4985
4650
|
{
|
|
4986
4651
|
bgColor: theme.palette.background.paper,
|
|
4987
4652
|
color: theme.palette.text.disabled
|
|
@@ -4994,7 +4659,7 @@ var TraceGraph = ({
|
|
|
4994
4659
|
};
|
|
4995
4660
|
|
|
4996
4661
|
// src/pages/trace-graph-page.tsx
|
|
4997
|
-
var
|
|
4662
|
+
var import_jsx_runtime141 = require("react/jsx-runtime");
|
|
4998
4663
|
var HEADER_HEIGHT = 56;
|
|
4999
4664
|
var DRAWER_WIDTH = "35%";
|
|
5000
4665
|
var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
|
|
@@ -5012,7 +4677,7 @@ var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) =>
|
|
|
5012
4677
|
})
|
|
5013
4678
|
}
|
|
5014
4679
|
}));
|
|
5015
|
-
var StyledDrawer = (0, import_styles.styled)(
|
|
4680
|
+
var StyledDrawer = (0, import_styles.styled)(import_material20.Drawer)(() => ({
|
|
5016
4681
|
"& .MuiDrawer-paper": {
|
|
5017
4682
|
bottom: 0,
|
|
5018
4683
|
boxSizing: "border-box",
|
|
@@ -5043,8 +4708,8 @@ var TraceGraphView = ({
|
|
|
5043
4708
|
viewPortPixelWidth
|
|
5044
4709
|
}) => {
|
|
5045
4710
|
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
5046
|
-
return /* @__PURE__ */ (0,
|
|
5047
|
-
|
|
4711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
4712
|
+
import_material20.Box,
|
|
5048
4713
|
{
|
|
5049
4714
|
"data-testid": "trace-graph-page",
|
|
5050
4715
|
sx: {
|
|
@@ -5056,14 +4721,14 @@ var TraceGraphView = ({
|
|
|
5056
4721
|
overflow: "hidden"
|
|
5057
4722
|
},
|
|
5058
4723
|
children: [
|
|
5059
|
-
/* @__PURE__ */ (0,
|
|
5060
|
-
/* @__PURE__ */ (0,
|
|
4724
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(import_material20.Box, { sx: { display: "flex", width: "100%" }, children: [
|
|
4725
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material20.Button, { onClick: () => {
|
|
5061
4726
|
navigateToSpansList();
|
|
5062
|
-
}, startIcon: /* @__PURE__ */ (0,
|
|
5063
|
-
/* @__PURE__ */ (0,
|
|
4727
|
+
}, startIcon: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_icons_material11.ArrowBack, {}), children: "Go back" }),
|
|
4728
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material20.Box, { sx: { flexGrow: 1 } })
|
|
5064
4729
|
] }),
|
|
5065
|
-
/* @__PURE__ */ (0,
|
|
5066
|
-
|
|
4730
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
4731
|
+
import_material20.Paper,
|
|
5067
4732
|
{
|
|
5068
4733
|
sx: {
|
|
5069
4734
|
display: "flex",
|
|
@@ -5072,22 +4737,22 @@ var TraceGraphView = ({
|
|
|
5072
4737
|
position: "relative",
|
|
5073
4738
|
width: "100%"
|
|
5074
4739
|
},
|
|
5075
|
-
children: shouldShowStatusMessage ? /* @__PURE__ */ (0,
|
|
4740
|
+
children: shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
5076
4741
|
StatusMessage,
|
|
5077
4742
|
{
|
|
5078
4743
|
error: statusError,
|
|
5079
4744
|
onRetry: handleRetry,
|
|
5080
4745
|
status
|
|
5081
4746
|
}
|
|
5082
|
-
) : /* @__PURE__ */ (0,
|
|
5083
|
-
/* @__PURE__ */ (0,
|
|
5084
|
-
|
|
4747
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(import_jsx_runtime141.Fragment, { children: [
|
|
4748
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(Main, { open, children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
4749
|
+
import_material20.Box,
|
|
5085
4750
|
{
|
|
5086
4751
|
sx: {
|
|
5087
4752
|
height: "100%",
|
|
5088
4753
|
overflow: "auto"
|
|
5089
4754
|
},
|
|
5090
|
-
children: traceId !== void 0 && /* @__PURE__ */ (0,
|
|
4755
|
+
children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_react19.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
5091
4756
|
TraceGraph,
|
|
5092
4757
|
{
|
|
5093
4758
|
initialFocusEventId: spanId,
|
|
@@ -5105,7 +4770,7 @@ var TraceGraphView = ({
|
|
|
5105
4770
|
) })
|
|
5106
4771
|
}
|
|
5107
4772
|
) }),
|
|
5108
|
-
/* @__PURE__ */ (0,
|
|
4773
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(EventDetails, { onClose: handleClose, selectedEvent }) })
|
|
5109
4774
|
] })
|
|
5110
4775
|
}
|
|
5111
4776
|
)
|
|
@@ -5113,15 +4778,12 @@ var TraceGraphView = ({
|
|
|
5113
4778
|
}
|
|
5114
4779
|
);
|
|
5115
4780
|
};
|
|
5116
|
-
var TraceGraphPage = () => {
|
|
5117
|
-
const { traceId } = (0, import_react_router_dom3.useParams)();
|
|
5118
|
-
const [searchParameters] = (0, import_react_router_dom3.useSearchParams)();
|
|
5119
|
-
const spanId = searchParameters.get("spanId");
|
|
4781
|
+
var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
5120
4782
|
const api = useAppInspectorApi();
|
|
5121
|
-
const [spans, setSpans] = (0,
|
|
5122
|
-
const [loading, setLoading] = (0,
|
|
5123
|
-
const [fetchError, setFetchError] = (0,
|
|
5124
|
-
const fetchSpans = (0,
|
|
4783
|
+
const [spans, setSpans] = (0, import_react20.useState)();
|
|
4784
|
+
const [loading, setLoading] = (0, import_react20.useState)(false);
|
|
4785
|
+
const [fetchError, setFetchError] = (0, import_react20.useState)();
|
|
4786
|
+
const fetchSpans = (0, import_react20.useCallback)(async () => {
|
|
5125
4787
|
setLoading(true);
|
|
5126
4788
|
try {
|
|
5127
4789
|
const response = await api.getSpans({
|
|
@@ -5136,14 +4798,14 @@ var TraceGraphPage = () => {
|
|
|
5136
4798
|
setLoading(false);
|
|
5137
4799
|
}
|
|
5138
4800
|
}, [api, traceId]);
|
|
5139
|
-
(0,
|
|
4801
|
+
(0, import_react20.useEffect)(() => {
|
|
5140
4802
|
void fetchSpans();
|
|
5141
4803
|
}, [fetchSpans]);
|
|
5142
|
-
const [open, setOpen] = (0,
|
|
5143
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
5144
|
-
const [viewPortPixelWidth, setViewPortPixelWidth] = (0,
|
|
4804
|
+
const [open, setOpen] = (0, import_react20.useState)(true);
|
|
4805
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react20.useState)();
|
|
4806
|
+
const [viewPortPixelWidth, setViewPortPixelWidth] = (0, import_react20.useState)(0);
|
|
5145
4807
|
const { checkStatus, error: statusError, status } = useStatus();
|
|
5146
|
-
const calculateDrawerWidth = (0,
|
|
4808
|
+
const calculateDrawerWidth = (0, import_react20.useCallback)(() => {
|
|
5147
4809
|
const percentageMatch = /(\d+)%/.exec(DRAWER_WIDTH);
|
|
5148
4810
|
if (percentageMatch && open) {
|
|
5149
4811
|
const percentage = Number.parseInt(percentageMatch[1], 10);
|
|
@@ -5151,7 +4813,7 @@ var TraceGraphPage = () => {
|
|
|
5151
4813
|
}
|
|
5152
4814
|
return 0;
|
|
5153
4815
|
}, [open]);
|
|
5154
|
-
(0,
|
|
4816
|
+
(0, import_react20.useEffect)(() => {
|
|
5155
4817
|
const updateViewportWidth = () => {
|
|
5156
4818
|
const totalWidth = window.innerWidth;
|
|
5157
4819
|
const drawerPixelWidth = open ? calculateDrawerWidth() : 0;
|
|
@@ -5165,24 +4827,17 @@ var TraceGraphPage = () => {
|
|
|
5165
4827
|
clearTimeout(timeoutId);
|
|
5166
4828
|
};
|
|
5167
4829
|
}, [open, calculateDrawerWidth]);
|
|
5168
|
-
const handleEventSelect = (0,
|
|
4830
|
+
const handleEventSelect = (0, import_react20.useCallback)((event) => {
|
|
5169
4831
|
setSelectedEvent(event);
|
|
5170
4832
|
setOpen(true);
|
|
5171
4833
|
}, []);
|
|
5172
|
-
const handleRetry = (0,
|
|
4834
|
+
const handleRetry = (0, import_react20.useCallback)(() => {
|
|
5173
4835
|
void checkStatus();
|
|
5174
4836
|
}, [checkStatus]);
|
|
5175
|
-
const
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
const searchParams = new URLSearchParams({
|
|
5180
|
-
page: searchParameters.get("page") ?? "",
|
|
5181
|
-
pageSize: searchParameters.get("pageSize") ?? ""
|
|
5182
|
-
});
|
|
5183
|
-
navigate(`${url}?${searchParams.toString()}`);
|
|
5184
|
-
}, [navigate, resolveLink, searchParameters]);
|
|
5185
|
-
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
4837
|
+
const navigateToSpansList = (0, import_react20.useCallback)(() => {
|
|
4838
|
+
onClose?.();
|
|
4839
|
+
}, [onClose]);
|
|
4840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
5186
4841
|
TraceGraphView,
|
|
5187
4842
|
{
|
|
5188
4843
|
fetchError,
|
|
@@ -5206,16 +4861,302 @@ var TraceGraphPage = () => {
|
|
|
5206
4861
|
);
|
|
5207
4862
|
};
|
|
5208
4863
|
|
|
4864
|
+
// src/pages/spans-list-page.tsx
|
|
4865
|
+
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
4866
|
+
var spansPerPageOptions = [25, 50, 100];
|
|
4867
|
+
var SpansListPage = () => {
|
|
4868
|
+
const api = useAppInspectorApi();
|
|
4869
|
+
const [spans, setSpans] = (0, import_react21.useState)();
|
|
4870
|
+
const [loading, setLoading] = (0, import_react21.useState)(false);
|
|
4871
|
+
const hasFetched = (0, import_react21.useRef)(false);
|
|
4872
|
+
const [filterWriteOperations, setFilterWriteOperations] = useLocalStorage("filterWriteOperations", true);
|
|
4873
|
+
const mapPageToNextCursor = (0, import_react21.useRef)({});
|
|
4874
|
+
const [page, setPage] = (0, import_react21.useState)(0);
|
|
4875
|
+
const [pageSize, setPageSize] = (0, import_react21.useState)(100);
|
|
4876
|
+
const [spanCount, setSpanCount] = (0, import_react21.useState)(0);
|
|
4877
|
+
const queryOptions = (0, import_react21.useMemo)(() => {
|
|
4878
|
+
return {
|
|
4879
|
+
is_write_operation: filterWriteOperations ? true : void 0,
|
|
4880
|
+
limit: pageSize,
|
|
4881
|
+
pagination_token: mapPageToNextCursor.current[page - 1]
|
|
4882
|
+
};
|
|
4883
|
+
}, [filterWriteOperations, pageSize, page]);
|
|
4884
|
+
const [fetchError, setFetchError] = (0, import_react21.useState)();
|
|
4885
|
+
const { checkStatus, error: statusError, status } = useStatus();
|
|
4886
|
+
const fetchSpans = (0, import_react21.useCallback)(async () => {
|
|
4887
|
+
setLoading(true);
|
|
4888
|
+
try {
|
|
4889
|
+
const response = await api.getSpans(queryOptions);
|
|
4890
|
+
setSpans(response.spans);
|
|
4891
|
+
setSpanCount(response.pagination.total_count);
|
|
4892
|
+
setFetchError(void 0);
|
|
4893
|
+
if (response.pagination.cursor) {
|
|
4894
|
+
mapPageToNextCursor.current[page] = response.pagination.cursor;
|
|
4895
|
+
}
|
|
4896
|
+
} catch (error) {
|
|
4897
|
+
console.error(error);
|
|
4898
|
+
setFetchError(error instanceof Error ? error : new Error("Unknown error", { cause: error }));
|
|
4899
|
+
} finally {
|
|
4900
|
+
setLoading(false);
|
|
4901
|
+
}
|
|
4902
|
+
}, [api, page, queryOptions]);
|
|
4903
|
+
const fetchSpansSync = (0, import_react21.useCallback)(() => {
|
|
4904
|
+
void fetchSpans();
|
|
4905
|
+
}, [fetchSpans]);
|
|
4906
|
+
(0, import_react21.useEffect)(() => {
|
|
4907
|
+
if (hasFetched.current) return;
|
|
4908
|
+
if (status?.status !== "ENABLED") return;
|
|
4909
|
+
hasFetched.current = true;
|
|
4910
|
+
void fetchSpans();
|
|
4911
|
+
}, [fetchSpans, status]);
|
|
4912
|
+
(0, import_react21.useEffect)(() => {
|
|
4913
|
+
if (!hasFetched.current) return;
|
|
4914
|
+
void fetchSpans();
|
|
4915
|
+
}, [fetchSpans]);
|
|
4916
|
+
const [selectedTraceId, setSelectedTraceId] = (0, import_react21.useState)();
|
|
4917
|
+
const [selectedSpanId, setSelectedSpanId] = (0, import_react21.useState)();
|
|
4918
|
+
const navigateToSpan = (0, import_react21.useCallback)((span) => {
|
|
4919
|
+
setSelectedTraceId(span.trace_id);
|
|
4920
|
+
setSelectedSpanId(span.span_id);
|
|
4921
|
+
}, []);
|
|
4922
|
+
const clearSpans = (0, import_react21.useCallback)(async () => {
|
|
4923
|
+
setLoading(true);
|
|
4924
|
+
try {
|
|
4925
|
+
await api.deleteSpans();
|
|
4926
|
+
setSpans([]);
|
|
4927
|
+
setFetchError(void 0);
|
|
4928
|
+
await fetchSpans();
|
|
4929
|
+
} catch (error) {
|
|
4930
|
+
console.error("Failed to delete spans:", error);
|
|
4931
|
+
setFetchError(error instanceof Error ? error : new Error("Failed to delete spans", { cause: error }));
|
|
4932
|
+
} finally {
|
|
4933
|
+
setLoading(false);
|
|
4934
|
+
}
|
|
4935
|
+
}, [api, fetchSpans]);
|
|
4936
|
+
const handleRetry = (0, import_react21.useCallback)(() => {
|
|
4937
|
+
void checkStatus();
|
|
4938
|
+
}, [checkStatus]);
|
|
4939
|
+
const shouldShowStatusMessage = Boolean(statusError) || status?.status === "DISABLED";
|
|
4940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_jsx_runtime142.Fragment, { children: [
|
|
4941
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
4942
|
+
import_material21.Box,
|
|
4943
|
+
{
|
|
4944
|
+
"data-testid": "spans-list-page",
|
|
4945
|
+
sx: {
|
|
4946
|
+
alignItems: "center",
|
|
4947
|
+
display: "flex",
|
|
4948
|
+
flexDirection: "column",
|
|
4949
|
+
// Do not consume vertical space if trace graph is open
|
|
4950
|
+
flexGrow: selectedTraceId ? 0 : 1,
|
|
4951
|
+
height: selectedTraceId ? 0 : void 0,
|
|
4952
|
+
// Do not show if trace graph is open
|
|
4953
|
+
visibility: selectedTraceId ? "hidden" : "visible",
|
|
4954
|
+
width: "100%"
|
|
4955
|
+
},
|
|
4956
|
+
children: shouldShowStatusMessage ? /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
4957
|
+
StatusMessage,
|
|
4958
|
+
{
|
|
4959
|
+
error: statusError,
|
|
4960
|
+
onRetry: handleRetry,
|
|
4961
|
+
status
|
|
4962
|
+
}
|
|
4963
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
4964
|
+
SpansList,
|
|
4965
|
+
{
|
|
4966
|
+
filterWriteOperations,
|
|
4967
|
+
onClearSpans: () => {
|
|
4968
|
+
void clearSpans();
|
|
4969
|
+
},
|
|
4970
|
+
onFilterWriteOperationsChange: (value) => {
|
|
4971
|
+
setFilterWriteOperations(value);
|
|
4972
|
+
},
|
|
4973
|
+
onPageChange: setPage,
|
|
4974
|
+
onPageSizeChange: setPageSize,
|
|
4975
|
+
onRefresh: () => {
|
|
4976
|
+
fetchSpansSync();
|
|
4977
|
+
},
|
|
4978
|
+
onSpanClick: (span) => {
|
|
4979
|
+
navigateToSpan(span);
|
|
4980
|
+
},
|
|
4981
|
+
page,
|
|
4982
|
+
pageSize,
|
|
4983
|
+
spanCount,
|
|
4984
|
+
spans: {
|
|
4985
|
+
data: spans,
|
|
4986
|
+
error: fetchError,
|
|
4987
|
+
loading
|
|
4988
|
+
},
|
|
4989
|
+
spansPerPageOptions
|
|
4990
|
+
}
|
|
4991
|
+
)
|
|
4992
|
+
}
|
|
4993
|
+
),
|
|
4994
|
+
selectedTraceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(TraceGraphPage, { onClose: () => {
|
|
4995
|
+
setSelectedTraceId(void 0);
|
|
4996
|
+
}, spanId: selectedSpanId, traceId: selectedTraceId })
|
|
4997
|
+
] });
|
|
4998
|
+
};
|
|
4999
|
+
|
|
5209
5000
|
// src/routes.ts
|
|
5210
5001
|
var routes = {
|
|
5211
|
-
APP_INSPECTOR_SPANS_LIST: "spans"
|
|
5212
|
-
|
|
5002
|
+
APP_INSPECTOR_SPANS_LIST: "spans"
|
|
5003
|
+
};
|
|
5004
|
+
|
|
5005
|
+
// src/context.tsx
|
|
5006
|
+
var import_react22 = require("react");
|
|
5007
|
+
var import_react23 = require("react");
|
|
5008
|
+
|
|
5009
|
+
// src/constants/error-messages.ts
|
|
5010
|
+
var ERROR_MESSAGES = {
|
|
5011
|
+
APP_INSPECTOR_DISABLED: "App Inspector is currently disabled.",
|
|
5012
|
+
APP_INSPECTOR_NOT_FOUND: "App Inspector extension not found. Please ensure App Inspector is licensed and enabled.",
|
|
5013
|
+
CONNECTION_FAILED: "Failed to connect to LocalStack. Please ensure LocalStack is running and accessible."
|
|
5014
|
+
};
|
|
5015
|
+
|
|
5016
|
+
// src/api/client.ts
|
|
5017
|
+
var apiLogger = createScopedLogger("API");
|
|
5018
|
+
var makeRequest = async (options) => {
|
|
5019
|
+
const url = getAppInspectorApiUrl(options.localstackEndpoint, options.endpoint);
|
|
5020
|
+
try {
|
|
5021
|
+
apiLogger.info("Making request to:", { options, url });
|
|
5022
|
+
const headers = new Headers(options.request?.headers);
|
|
5023
|
+
headers.set("Content-Type", "application/json");
|
|
5024
|
+
const response = await fetch(url, {
|
|
5025
|
+
...options.request,
|
|
5026
|
+
headers
|
|
5027
|
+
});
|
|
5028
|
+
if (!response.ok) {
|
|
5029
|
+
if (response.status === 404) {
|
|
5030
|
+
throw new AppInspectorNotFoundError(
|
|
5031
|
+
ERROR_MESSAGES.APP_INSPECTOR_NOT_FOUND,
|
|
5032
|
+
new Error(`404 from ${url}: ${response.statusText}`)
|
|
5033
|
+
);
|
|
5034
|
+
}
|
|
5035
|
+
throw new Error(`API request failed: ${response.status.toString()} ${response.statusText}`);
|
|
5036
|
+
}
|
|
5037
|
+
return await response.json();
|
|
5038
|
+
} catch (error) {
|
|
5039
|
+
if (error instanceof TypeError) {
|
|
5040
|
+
const message = error.message.toLowerCase();
|
|
5041
|
+
const isNetworkError = message.includes("fetch") || message.includes("network") || message.includes("failed to fetch");
|
|
5042
|
+
if (isNetworkError) {
|
|
5043
|
+
throw new ConnectionError(ERROR_MESSAGES.CONNECTION_FAILED, error);
|
|
5044
|
+
}
|
|
5045
|
+
}
|
|
5046
|
+
if (error instanceof Error) {
|
|
5047
|
+
throw error;
|
|
5048
|
+
}
|
|
5049
|
+
throw new Error("Unknown error occurred");
|
|
5050
|
+
}
|
|
5051
|
+
};
|
|
5052
|
+
var buildSpansEndpoint = (request) => {
|
|
5053
|
+
if (!request) {
|
|
5054
|
+
return API_ENDPOINTS.SPANS;
|
|
5055
|
+
}
|
|
5056
|
+
const queryParameters = new URLSearchParams();
|
|
5057
|
+
if (request.limit !== void 0) {
|
|
5058
|
+
queryParameters.set("limit", request.limit.toString());
|
|
5059
|
+
}
|
|
5060
|
+
if (request.pagination_token) {
|
|
5061
|
+
queryParameters.set("pagination_token", request.pagination_token);
|
|
5062
|
+
}
|
|
5063
|
+
for (const [key, value] of Object.entries(request)) {
|
|
5064
|
+
if (value !== void 0 && key !== "limit" && key !== "pagination_token" && value !== null) {
|
|
5065
|
+
queryParameters.set(key, String(value));
|
|
5066
|
+
}
|
|
5067
|
+
}
|
|
5068
|
+
const queryString = queryParameters.toString();
|
|
5069
|
+
return queryString ? `${API_ENDPOINTS.SPANS}?${queryString}` : API_ENDPOINTS.SPANS;
|
|
5070
|
+
};
|
|
5071
|
+
var buildEventsEndpoint = (request) => {
|
|
5072
|
+
if (!request) {
|
|
5073
|
+
return API_ENDPOINTS.EVENTS;
|
|
5074
|
+
}
|
|
5075
|
+
const basePath = API_ENDPOINTS.EVENTS;
|
|
5076
|
+
const queryParameters = new URLSearchParams();
|
|
5077
|
+
if (request.limit !== void 0) {
|
|
5078
|
+
queryParameters.set("limit", request.limit.toString());
|
|
5079
|
+
}
|
|
5080
|
+
if (request.pagination_token) {
|
|
5081
|
+
queryParameters.set("pagination_token", request.pagination_token);
|
|
5082
|
+
}
|
|
5083
|
+
for (const [key, value] of Object.entries(request)) {
|
|
5084
|
+
if (value !== void 0 && key !== "limit" && key !== "pagination_token" && value !== null) {
|
|
5085
|
+
queryParameters.set(key, String(value));
|
|
5086
|
+
}
|
|
5087
|
+
}
|
|
5088
|
+
const queryString = queryParameters.toString();
|
|
5089
|
+
return queryString ? `${basePath}?${queryString}` : basePath;
|
|
5090
|
+
};
|
|
5091
|
+
var createApiClient = ({ localstackEndpoint }) => {
|
|
5092
|
+
return {
|
|
5093
|
+
deleteSpans: async (_request) => {
|
|
5094
|
+
return makeRequest({
|
|
5095
|
+
endpoint: API_ENDPOINTS.SPANS,
|
|
5096
|
+
localstackEndpoint,
|
|
5097
|
+
request: {
|
|
5098
|
+
method: "DELETE"
|
|
5099
|
+
}
|
|
5100
|
+
});
|
|
5101
|
+
},
|
|
5102
|
+
getEvents: async (request) => {
|
|
5103
|
+
const endpoint = buildEventsEndpoint(request);
|
|
5104
|
+
return makeRequest({ endpoint, localstackEndpoint });
|
|
5105
|
+
},
|
|
5106
|
+
getIamEvents: async (request) => {
|
|
5107
|
+
const iamEventsRequest = {
|
|
5108
|
+
...request,
|
|
5109
|
+
event_type: "iam.policy_evaluation"
|
|
5110
|
+
};
|
|
5111
|
+
const endpoint = buildEventsEndpoint(iamEventsRequest);
|
|
5112
|
+
return makeRequest({ endpoint, localstackEndpoint });
|
|
5113
|
+
},
|
|
5114
|
+
getSpans: async (request) => {
|
|
5115
|
+
const endpoint = buildSpansEndpoint(request);
|
|
5116
|
+
return makeRequest({ endpoint, localstackEndpoint });
|
|
5117
|
+
},
|
|
5118
|
+
getStatus: async () => {
|
|
5119
|
+
return makeRequest({
|
|
5120
|
+
endpoint: API_ENDPOINTS.STATUS,
|
|
5121
|
+
localstackEndpoint
|
|
5122
|
+
});
|
|
5123
|
+
}
|
|
5124
|
+
};
|
|
5125
|
+
};
|
|
5126
|
+
|
|
5127
|
+
// src/context.tsx
|
|
5128
|
+
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
5129
|
+
var AppInspectorContext = (0, import_react22.createContext)(void 0);
|
|
5130
|
+
var AppInspectorContextProvider = (props) => {
|
|
5131
|
+
const api = (0, import_react23.useMemo)(() => {
|
|
5132
|
+
return false ? createApiClientMock() : createApiClient({ localstackEndpoint: props.localstackEndpoint });
|
|
5133
|
+
}, [props.localstackEndpoint]);
|
|
5134
|
+
const resolveLink = (0, import_react23.useCallback)(
|
|
5135
|
+
(options) => {
|
|
5136
|
+
if (options.to === "settings") {
|
|
5137
|
+
return `${props.routePrefix}/settings`;
|
|
5138
|
+
}
|
|
5139
|
+
if (options.to === "trace-graph") {
|
|
5140
|
+
return `${props.routePrefix}/traces/${options.traceId}`;
|
|
5141
|
+
}
|
|
5142
|
+
return `${props.routePrefix}/spans`;
|
|
5143
|
+
},
|
|
5144
|
+
[props.routePrefix]
|
|
5145
|
+
);
|
|
5146
|
+
const contextValue = (0, import_react23.useMemo)(
|
|
5147
|
+
() => ({
|
|
5148
|
+
linkComponent: props.linkComponent,
|
|
5149
|
+
localstackEndpoint: props.localstackEndpoint,
|
|
5150
|
+
resolveLink
|
|
5151
|
+
}),
|
|
5152
|
+
[props.linkComponent, props.localstackEndpoint, resolveLink]
|
|
5153
|
+
);
|
|
5154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(ApiProvider, { api, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(AppInspectorContext.Provider, { value: contextValue, children: props.children }) });
|
|
5213
5155
|
};
|
|
5214
5156
|
|
|
5215
5157
|
// src/index.ts
|
|
5216
5158
|
var pages = {
|
|
5217
|
-
APP_INSPECTOR_SPANS_LIST: [routes.APP_INSPECTOR_SPANS_LIST, SpansListPage]
|
|
5218
|
-
APP_INSPECTOR_TRACE_GRAPH: [routes.APP_INSPECTOR_TRACE_GRAPH, TraceGraphPage]
|
|
5159
|
+
APP_INSPECTOR_SPANS_LIST: [routes.APP_INSPECTOR_SPANS_LIST, SpansListPage]
|
|
5219
5160
|
};
|
|
5220
5161
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5221
5162
|
0 && (module.exports = {
|