@localstack/appinspector-ui 1.0.162 → 1.0.164
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 +1051 -779
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +979 -707
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -2425,8 +2425,8 @@ __export(index_exports, {
|
|
|
2425
2425
|
module.exports = __toCommonJS(index_exports);
|
|
2426
2426
|
|
|
2427
2427
|
// src/pages/spans-list-page.tsx
|
|
2428
|
-
var
|
|
2429
|
-
var
|
|
2428
|
+
var import_material26 = require("@mui/material");
|
|
2429
|
+
var import_react67 = require("react");
|
|
2430
2430
|
|
|
2431
2431
|
// src/api/errors.ts
|
|
2432
2432
|
var AppInspectorDisabledError = class extends Error {
|
|
@@ -2452,6 +2452,13 @@ var ConnectionError = class extends Error {
|
|
|
2452
2452
|
this.cause = cause;
|
|
2453
2453
|
}
|
|
2454
2454
|
};
|
|
2455
|
+
var StaleTokenError = class extends Error {
|
|
2456
|
+
constructor(message, cause) {
|
|
2457
|
+
super(message);
|
|
2458
|
+
this.name = "StaleTokenError";
|
|
2459
|
+
this.cause = cause;
|
|
2460
|
+
}
|
|
2461
|
+
};
|
|
2455
2462
|
|
|
2456
2463
|
// src/api/use-api.tsx
|
|
2457
2464
|
var import_react = require("react");
|
|
@@ -7391,10 +7398,10 @@ var createHtmlRenderState = function() {
|
|
|
7391
7398
|
};
|
|
7392
7399
|
|
|
7393
7400
|
// node_modules/.pnpm/framer-motion@6.5.1_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/framer-motion/dist/es/render/html/use-props.mjs
|
|
7394
|
-
function copyRawValuesOnly(target,
|
|
7395
|
-
for (var key in
|
|
7396
|
-
if (!isMotionValue(
|
|
7397
|
-
target[key] =
|
|
7401
|
+
function copyRawValuesOnly(target, source2, props) {
|
|
7402
|
+
for (var key in source2) {
|
|
7403
|
+
if (!isMotionValue(source2[key]) && !isForcedMotionValue(key, props)) {
|
|
7404
|
+
target[key] = source2[key];
|
|
7398
7405
|
}
|
|
7399
7406
|
}
|
|
7400
7407
|
}
|
|
@@ -10180,22 +10187,22 @@ function isNear(value, target, maxDistance) {
|
|
|
10180
10187
|
}
|
|
10181
10188
|
return distance(value, target) < maxDistance;
|
|
10182
10189
|
}
|
|
10183
|
-
function calcAxisDelta(delta,
|
|
10190
|
+
function calcAxisDelta(delta, source2, target, origin) {
|
|
10184
10191
|
if (origin === void 0) {
|
|
10185
10192
|
origin = 0.5;
|
|
10186
10193
|
}
|
|
10187
10194
|
delta.origin = origin;
|
|
10188
|
-
delta.originPoint = mix(
|
|
10189
|
-
delta.scale = calcLength(target) / calcLength(
|
|
10195
|
+
delta.originPoint = mix(source2.min, source2.max, delta.origin);
|
|
10196
|
+
delta.scale = calcLength(target) / calcLength(source2);
|
|
10190
10197
|
if (isNear(delta.scale, 1, 1e-4) || isNaN(delta.scale))
|
|
10191
10198
|
delta.scale = 1;
|
|
10192
10199
|
delta.translate = mix(target.min, target.max, delta.origin) - delta.originPoint;
|
|
10193
10200
|
if (isNear(delta.translate) || isNaN(delta.translate))
|
|
10194
10201
|
delta.translate = 0;
|
|
10195
10202
|
}
|
|
10196
|
-
function calcBoxDelta(delta,
|
|
10197
|
-
calcAxisDelta(delta.x,
|
|
10198
|
-
calcAxisDelta(delta.y,
|
|
10203
|
+
function calcBoxDelta(delta, source2, target, origin) {
|
|
10204
|
+
calcAxisDelta(delta.x, source2.x, target.x, origin === null || origin === void 0 ? void 0 : origin.originX);
|
|
10205
|
+
calcAxisDelta(delta.y, source2.y, target.y, origin === null || origin === void 0 ? void 0 : origin.originY);
|
|
10199
10206
|
}
|
|
10200
10207
|
function calcRelativeAxis(target, relative, parent) {
|
|
10201
10208
|
target.min = parent.min + relative.min;
|
|
@@ -10252,14 +10259,14 @@ function calcViewportConstraints(layoutBox, constraintsBox) {
|
|
|
10252
10259
|
y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y)
|
|
10253
10260
|
};
|
|
10254
10261
|
}
|
|
10255
|
-
function calcOrigin2(
|
|
10262
|
+
function calcOrigin2(source2, target) {
|
|
10256
10263
|
var origin = 0.5;
|
|
10257
|
-
var sourceLength = calcLength(
|
|
10264
|
+
var sourceLength = calcLength(source2);
|
|
10258
10265
|
var targetLength = calcLength(target);
|
|
10259
10266
|
if (targetLength > sourceLength) {
|
|
10260
|
-
origin = progress(target.min, target.max - sourceLength,
|
|
10267
|
+
origin = progress(target.min, target.max - sourceLength, source2.min);
|
|
10261
10268
|
} else if (sourceLength > targetLength) {
|
|
10262
|
-
origin = progress(
|
|
10269
|
+
origin = progress(source2.min, source2.max - targetLength, target.min);
|
|
10263
10270
|
}
|
|
10264
10271
|
return clamp2(0, 1, origin);
|
|
10265
10272
|
}
|
|
@@ -13073,22 +13080,6 @@ var ResponsiveTimestampCell = (0, import_react31.memo)(({ date }) => {
|
|
|
13073
13080
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { display: "inline-block", width: "100%" }, children: formattedTime });
|
|
13074
13081
|
});
|
|
13075
13082
|
|
|
13076
|
-
// src/types/error-levels.ts
|
|
13077
|
-
var ErrorLevel = {
|
|
13078
|
-
ERROR: 3,
|
|
13079
|
-
// General error
|
|
13080
|
-
IAM_PERMISSION: 5,
|
|
13081
|
-
// IAM permission issues
|
|
13082
|
-
OK: 2,
|
|
13083
|
-
// OK
|
|
13084
|
-
// Standard OTEL status codes
|
|
13085
|
-
UNSET: 1,
|
|
13086
|
-
// Unset
|
|
13087
|
-
// Extended custom levels
|
|
13088
|
-
WARNING: 4
|
|
13089
|
-
// Warning
|
|
13090
|
-
};
|
|
13091
|
-
|
|
13092
13083
|
// src/utils/service-display-name.ts
|
|
13093
13084
|
var SERVICE_DISPLAY_NAME = {
|
|
13094
13085
|
"account": "Account",
|
|
@@ -15201,6 +15192,22 @@ ServiceCell.displayName = "ServiceCell";
|
|
|
15201
15192
|
var import_icons_material = require("@mui/icons-material");
|
|
15202
15193
|
var import_material4 = require("@mui/material");
|
|
15203
15194
|
|
|
15195
|
+
// src/types/error-levels.ts
|
|
15196
|
+
var ErrorLevel = {
|
|
15197
|
+
ERROR: 3,
|
|
15198
|
+
// General error
|
|
15199
|
+
IAM_PERMISSION: 5,
|
|
15200
|
+
// IAM permission issues
|
|
15201
|
+
OK: 2,
|
|
15202
|
+
// OK
|
|
15203
|
+
// Standard OTEL status codes
|
|
15204
|
+
UNSET: 1,
|
|
15205
|
+
// Unset
|
|
15206
|
+
// Extended custom levels
|
|
15207
|
+
WARNING: 4
|
|
15208
|
+
// Warning
|
|
15209
|
+
};
|
|
15210
|
+
|
|
15204
15211
|
// src/utils/iam-utils.ts
|
|
15205
15212
|
function determinePermissionStatus(payload) {
|
|
15206
15213
|
if (payload.explicit_deny_count && payload.explicit_deny_count > 0) {
|
|
@@ -15287,25 +15294,7 @@ function parseIAMEvent(payloadString) {
|
|
|
15287
15294
|
}
|
|
15288
15295
|
}
|
|
15289
15296
|
|
|
15290
|
-
// src/
|
|
15291
|
-
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
15292
|
-
var StatusIcon = ({ errorLevel, operationStatus, spanStatusCode }) => {
|
|
15293
|
-
switch (errorLevel) {
|
|
15294
|
-
case ErrorLevel.ERROR: {
|
|
15295
|
-
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.Cancel, { sx: { color: "red" } });
|
|
15296
|
-
}
|
|
15297
|
-
case ErrorLevel.IAM_PERMISSION: {
|
|
15298
|
-
const isDenial = operationStatus ? operationStatus === "iam_explicit_deny" || operationStatus === "iam_implicit_deny" : spanStatusCode === 2;
|
|
15299
|
-
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.GppBad, { sx: { color: isDenial ? "red" : "warning.main" } });
|
|
15300
|
-
}
|
|
15301
|
-
case ErrorLevel.WARNING: {
|
|
15302
|
-
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.Error, { sx: { color: "orange" } });
|
|
15303
|
-
}
|
|
15304
|
-
default: {
|
|
15305
|
-
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_jsx_runtime124.Fragment, {});
|
|
15306
|
-
}
|
|
15307
|
-
}
|
|
15308
|
-
};
|
|
15297
|
+
// src/utils/error-level.ts
|
|
15309
15298
|
var calculateHighestErrorLevel = (span) => {
|
|
15310
15299
|
if (span.operation_status) {
|
|
15311
15300
|
switch (span.operation_status) {
|
|
@@ -15337,6 +15326,26 @@ var calculateHighestErrorLevel = (span) => {
|
|
|
15337
15326
|
if (hasWarning) return ErrorLevel.WARNING;
|
|
15338
15327
|
return span.status_code || ErrorLevel.UNSET;
|
|
15339
15328
|
};
|
|
15329
|
+
|
|
15330
|
+
// src/components/cells/status-cell.tsx
|
|
15331
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
15332
|
+
var StatusIcon = ({ errorLevel, operationStatus, spanStatusCode }) => {
|
|
15333
|
+
switch (errorLevel) {
|
|
15334
|
+
case ErrorLevel.ERROR: {
|
|
15335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.Cancel, { sx: { color: "red" } });
|
|
15336
|
+
}
|
|
15337
|
+
case ErrorLevel.IAM_PERMISSION: {
|
|
15338
|
+
const isDenial = operationStatus ? operationStatus === "iam_explicit_deny" || operationStatus === "iam_implicit_deny" : spanStatusCode === 2;
|
|
15339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.GppBad, { sx: { color: isDenial ? "red" : "warning.main" } });
|
|
15340
|
+
}
|
|
15341
|
+
case ErrorLevel.WARNING: {
|
|
15342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.Error, { sx: { color: "orange" } });
|
|
15343
|
+
}
|
|
15344
|
+
default: {
|
|
15345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_jsx_runtime124.Fragment, {});
|
|
15346
|
+
}
|
|
15347
|
+
}
|
|
15348
|
+
};
|
|
15340
15349
|
var SPAN_STATUS_LABELS = {
|
|
15341
15350
|
0: "Unset",
|
|
15342
15351
|
1: "OK",
|
|
@@ -15496,47 +15505,26 @@ var SpanCountBadge = ({ licenseLimit, systemLimit, totalCount, visibleCount }) =
|
|
|
15496
15505
|
var import_icons_material3 = require("@mui/icons-material");
|
|
15497
15506
|
var import_material6 = require("@mui/material");
|
|
15498
15507
|
var import_react37 = require("react");
|
|
15499
|
-
|
|
15508
|
+
|
|
15509
|
+
// src/utils/spans-filters.ts
|
|
15500
15510
|
var EMPTY_FILTERS = {
|
|
15501
15511
|
consumerService: [],
|
|
15502
15512
|
producerService: [],
|
|
15503
15513
|
status: []
|
|
15504
15514
|
};
|
|
15505
15515
|
var EXTERNAL_PRODUCER_VALUE = "__external__";
|
|
15506
|
-
function applyFilters(spans, filters) {
|
|
15507
|
-
if (isFiltersEmpty(filters)) return spans;
|
|
15508
|
-
return spans.filter((span) => {
|
|
15509
|
-
if (filters.consumerService.length > 0 && !filters.consumerService.includes(span.service_name)) {
|
|
15510
|
-
return false;
|
|
15511
|
-
}
|
|
15512
|
-
if (filters.producerService.length > 0) {
|
|
15513
|
-
const includesExternal = filters.producerService.includes(EXTERNAL_PRODUCER_VALUE);
|
|
15514
|
-
const namedServices = filters.producerService.filter((value) => value !== EXTERNAL_PRODUCER_VALUE);
|
|
15515
|
-
const matchesExternal = includesExternal && !span.parent_service_name;
|
|
15516
|
-
const matchesNamed = namedServices.length > 0 && !!span.parent_service_name && namedServices.includes(span.parent_service_name);
|
|
15517
|
-
if (!matchesExternal && !matchesNamed) return false;
|
|
15518
|
-
}
|
|
15519
|
-
if (filters.status.length > 0) {
|
|
15520
|
-
if (!span.operation_status) return false;
|
|
15521
|
-
if (!filters.status.includes(collapseStatusValue(span.operation_status))) return false;
|
|
15522
|
-
}
|
|
15523
|
-
return true;
|
|
15524
|
-
});
|
|
15525
|
-
}
|
|
15526
15516
|
function isFiltersEmpty(filters) {
|
|
15527
15517
|
return filters.consumerService.length === 0 && filters.producerService.length === 0 && filters.status.length === 0;
|
|
15528
15518
|
}
|
|
15519
|
+
|
|
15520
|
+
// src/components/spans-list/spans-filter-bar.tsx
|
|
15521
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
15529
15522
|
var STATUS_LABELS = {
|
|
15530
15523
|
error: "Error",
|
|
15531
15524
|
iam_deny: "IAM Deny",
|
|
15532
15525
|
iam_warn: "IAM Warning",
|
|
15533
15526
|
ok: "Success"
|
|
15534
15527
|
};
|
|
15535
|
-
var collapseStatusValue = (status) => {
|
|
15536
|
-
if (status === "iam_explicit_deny" || status === "iam_implicit_deny") return "iam_deny";
|
|
15537
|
-
if (status === "iam_explicit_warn" || status === "iam_implicit_warn") return "iam_warn";
|
|
15538
|
-
return status;
|
|
15539
|
-
};
|
|
15540
15528
|
var statusOptionIcon = (value) => {
|
|
15541
15529
|
switch (value) {
|
|
15542
15530
|
case "error": {
|
|
@@ -15836,21 +15824,29 @@ var SpansDataGridRow = (0, import_react38.memo)(
|
|
|
15836
15824
|
);
|
|
15837
15825
|
var SpansDataGrid = ({
|
|
15838
15826
|
clearingSpans,
|
|
15827
|
+
consumerValues,
|
|
15839
15828
|
errorCount: _errorCount,
|
|
15840
15829
|
fetchingBackward,
|
|
15841
15830
|
fetchingForward,
|
|
15831
|
+
filteredErrorCount,
|
|
15832
|
+
filteredSpans,
|
|
15833
|
+
filteredWarningCount,
|
|
15834
|
+
filters,
|
|
15835
|
+
hasExternalProducer,
|
|
15842
15836
|
hasMoreBackward,
|
|
15843
15837
|
hasMoreForward,
|
|
15844
15838
|
licenseLimit,
|
|
15845
15839
|
onClearSpans,
|
|
15840
|
+
onFiltersChange,
|
|
15846
15841
|
onOrderChange,
|
|
15847
15842
|
onSearchChange,
|
|
15848
15843
|
onSpanClick,
|
|
15849
15844
|
order: order2,
|
|
15845
|
+
producerValues,
|
|
15850
15846
|
search,
|
|
15851
15847
|
searching,
|
|
15852
15848
|
searchSupported,
|
|
15853
|
-
|
|
15849
|
+
statusValues,
|
|
15854
15850
|
systemLimit,
|
|
15855
15851
|
totalCount,
|
|
15856
15852
|
warningCount: _warningCount
|
|
@@ -15865,7 +15861,6 @@ var SpansDataGrid = ({
|
|
|
15865
15861
|
clearTimeout(handle);
|
|
15866
15862
|
};
|
|
15867
15863
|
}, [searchDraft, onSearchChange]);
|
|
15868
|
-
const [filters, setFilters] = (0, import_react38.useState)(EMPTY_FILTERS);
|
|
15869
15864
|
const filtersActive = !isFiltersEmpty(filters);
|
|
15870
15865
|
const activeFilterNames = [
|
|
15871
15866
|
filters.producerService.length > 0 && "Producer",
|
|
@@ -15880,17 +15875,15 @@ var SpansDataGrid = ({
|
|
|
15880
15875
|
const handleClearAll = (0, import_react38.useCallback)(() => {
|
|
15881
15876
|
setSearchDraft("");
|
|
15882
15877
|
onSearchChange("");
|
|
15883
|
-
|
|
15884
|
-
}, [onSearchChange]);
|
|
15878
|
+
onFiltersChange(EMPTY_FILTERS);
|
|
15879
|
+
}, [onSearchChange, onFiltersChange]);
|
|
15885
15880
|
const handleClearSpans = (0, import_react38.useCallback)(() => {
|
|
15886
15881
|
setSearchDraft("");
|
|
15887
|
-
|
|
15882
|
+
onFiltersChange(EMPTY_FILTERS);
|
|
15888
15883
|
onClearSpans();
|
|
15889
|
-
}, [onClearSpans]);
|
|
15884
|
+
}, [onClearSpans, onFiltersChange]);
|
|
15890
15885
|
const producerOptions = (0, import_react38.useMemo)(() => {
|
|
15891
|
-
const services = new Set(
|
|
15892
|
-
spans?.map((span) => span.parent_service_name).filter(Boolean) ?? []
|
|
15893
|
-
);
|
|
15886
|
+
const services = new Set(producerValues);
|
|
15894
15887
|
for (const value of filters.producerService) {
|
|
15895
15888
|
if (value !== EXTERNAL_PRODUCER_VALUE) services.add(value);
|
|
15896
15889
|
}
|
|
@@ -15899,48 +15892,29 @@ var SpansDataGrid = ({
|
|
|
15899
15892
|
serviceCode: service,
|
|
15900
15893
|
value: service
|
|
15901
15894
|
}));
|
|
15902
|
-
const hasExternalProducer = spans?.some((span) => !span.parent_service_name);
|
|
15903
15895
|
if (hasExternalProducer || filters.producerService.includes(EXTERNAL_PRODUCER_VALUE)) {
|
|
15904
15896
|
options.push({ label: "External producer", value: EXTERNAL_PRODUCER_VALUE });
|
|
15905
15897
|
}
|
|
15906
15898
|
return options;
|
|
15907
|
-
}, [
|
|
15899
|
+
}, [producerValues, hasExternalProducer, filters.producerService]);
|
|
15908
15900
|
const consumerOptions = (0, import_react38.useMemo)(() => {
|
|
15909
|
-
const services = new Set(
|
|
15901
|
+
const services = new Set(consumerValues);
|
|
15910
15902
|
for (const value of filters.consumerService) services.add(value);
|
|
15911
15903
|
return [...services].toSorted().map((service) => ({
|
|
15912
15904
|
label: getServiceDisplayName(service),
|
|
15913
15905
|
serviceCode: service,
|
|
15914
15906
|
value: service
|
|
15915
15907
|
}));
|
|
15916
|
-
}, [
|
|
15908
|
+
}, [consumerValues, filters.consumerService]);
|
|
15917
15909
|
const statusOptions = (0, import_react38.useMemo)(() => {
|
|
15918
|
-
const statuses = new Set(
|
|
15919
|
-
spans?.map((span) => span.operation_status).filter(Boolean).map((s) => collapseStatusValue(s))
|
|
15920
|
-
);
|
|
15910
|
+
const statuses = new Set(statusValues);
|
|
15921
15911
|
for (const value of filters.status) statuses.add(value);
|
|
15922
15912
|
return [...statuses].toSorted().map((status) => ({
|
|
15923
15913
|
icon: statusOptionIcon(status),
|
|
15924
15914
|
label: STATUS_LABELS[status] ?? status,
|
|
15925
15915
|
value: status
|
|
15926
15916
|
}));
|
|
15927
|
-
}, [
|
|
15928
|
-
const filteredSpans = (0, import_react38.useMemo)(() => {
|
|
15929
|
-
if (!spans) return;
|
|
15930
|
-
if (!filtersActive) return spans;
|
|
15931
|
-
return applyFilters(spans, filters);
|
|
15932
|
-
}, [spans, filters, filtersActive]);
|
|
15933
|
-
const filteredErrorCount = (0, import_react38.useMemo)(
|
|
15934
|
-
() => filteredSpans?.filter((span) => {
|
|
15935
|
-
const level = calculateHighestErrorLevel(span);
|
|
15936
|
-
return level === ErrorLevel.ERROR || level === ErrorLevel.IAM_PERMISSION;
|
|
15937
|
-
}).length,
|
|
15938
|
-
[filteredSpans]
|
|
15939
|
-
);
|
|
15940
|
-
const filteredWarningCount = (0, import_react38.useMemo)(
|
|
15941
|
-
() => filteredSpans?.filter((span) => calculateHighestErrorLevel(span) === ErrorLevel.WARNING).length,
|
|
15942
|
-
[filteredSpans]
|
|
15943
|
-
);
|
|
15917
|
+
}, [statusValues, filters.status]);
|
|
15944
15918
|
const columns = (0, import_react38.useMemo)(() => [
|
|
15945
15919
|
columnHelper.accessor("startTime", {
|
|
15946
15920
|
cell: (props) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ResponsiveTimestampCell, { date: props.getValue() }),
|
|
@@ -16077,7 +16051,7 @@ var SpansDataGrid = ({
|
|
|
16077
16051
|
const element = containerRef.current;
|
|
16078
16052
|
if (!element || !isAtLiveEdgeRef.current) return;
|
|
16079
16053
|
element.scrollTop = element.scrollHeight;
|
|
16080
|
-
}, [order2,
|
|
16054
|
+
}, [order2, filteredSpans?.length, lastSpanId]);
|
|
16081
16055
|
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
|
|
16082
16056
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.Grid, { item: true, xs: 12, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material7.Box, { sx: { display: "flex", flexDirection: "column", gap: "0.5rem", pt: 1, px: 1 }, children: [
|
|
16083
16057
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material7.Box, { sx: { alignItems: "center", display: "flex", flexWrap: "wrap", gap: "0.5rem" }, children: [
|
|
@@ -16095,7 +16069,7 @@ var SpansDataGrid = ({
|
|
|
16095
16069
|
{
|
|
16096
16070
|
consumerOptions,
|
|
16097
16071
|
filters,
|
|
16098
|
-
onFiltersChange
|
|
16072
|
+
onFiltersChange,
|
|
16099
16073
|
producerOptions,
|
|
16100
16074
|
statusOptions
|
|
16101
16075
|
}
|
|
@@ -16214,7 +16188,7 @@ var SpansDataGrid = ({
|
|
|
16214
16188
|
)) }, headerGroup.id);
|
|
16215
16189
|
}) }),
|
|
16216
16190
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material7.TableBody, { children: [
|
|
16217
|
-
(
|
|
16191
|
+
(filteredSpans === void 0 || clearingSpans || searching) && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.CircularProgress, { size: 48, sx: { m: 4 } }) }) }),
|
|
16218
16192
|
!clearingSpans && !searching && filteredSpans?.length === 0 && (searchActive || filtersActive ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
16219
16193
|
NoMatchRow,
|
|
16220
16194
|
{
|
|
@@ -16321,21 +16295,29 @@ var SpansList = (props) => {
|
|
|
16321
16295
|
SpansDataGrid,
|
|
16322
16296
|
{
|
|
16323
16297
|
clearingSpans: props.clearingSpans,
|
|
16298
|
+
consumerValues: props.consumerValues,
|
|
16324
16299
|
errorCount: props.errorCount,
|
|
16325
16300
|
fetchingBackward: props.fetchingBackward,
|
|
16326
16301
|
fetchingForward: props.fetchingForward,
|
|
16302
|
+
filteredErrorCount: props.filteredErrorCount,
|
|
16303
|
+
filteredSpans: props.filteredSpans,
|
|
16304
|
+
filteredWarningCount: props.filteredWarningCount,
|
|
16305
|
+
filters: props.filters,
|
|
16306
|
+
hasExternalProducer: props.hasExternalProducer,
|
|
16327
16307
|
hasMoreBackward: props.hasMoreBackward,
|
|
16328
16308
|
hasMoreForward: props.hasMoreForward,
|
|
16329
16309
|
licenseLimit: props.licenseLimit,
|
|
16330
16310
|
onClearSpans: props.onClearSpans,
|
|
16311
|
+
onFiltersChange: props.onFiltersChange,
|
|
16331
16312
|
onOrderChange: props.onOrderChange,
|
|
16332
16313
|
onSearchChange: props.onSearchChange,
|
|
16333
16314
|
onSpanClick: props.onSpanClick,
|
|
16334
16315
|
order: props.order,
|
|
16316
|
+
producerValues: props.producerValues,
|
|
16335
16317
|
search: props.search,
|
|
16336
16318
|
searching: props.searching,
|
|
16337
16319
|
searchSupported: props.searchSupported,
|
|
16338
|
-
|
|
16320
|
+
statusValues: props.statusValues,
|
|
16339
16321
|
systemLimit: props.systemLimit,
|
|
16340
16322
|
totalCount: props.totalCount,
|
|
16341
16323
|
warningCount: props.warningCount
|
|
@@ -16555,6 +16537,46 @@ var StatusMessage = ({
|
|
|
16555
16537
|
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_jsx_runtime129.Fragment, {});
|
|
16556
16538
|
};
|
|
16557
16539
|
|
|
16540
|
+
// src/components/worker-error-message/worker-error-message.tsx
|
|
16541
|
+
var import_icons_material6 = require("@mui/icons-material");
|
|
16542
|
+
var import_material10 = require("@mui/material");
|
|
16543
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
16544
|
+
var WorkerErrorMessage = ({ error, onRetry }) => /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
16545
|
+
import_material10.Box,
|
|
16546
|
+
{
|
|
16547
|
+
sx: {
|
|
16548
|
+
alignItems: "center",
|
|
16549
|
+
display: "flex",
|
|
16550
|
+
flexDirection: "column",
|
|
16551
|
+
gap: 2,
|
|
16552
|
+
justifyContent: "center",
|
|
16553
|
+
p: 4
|
|
16554
|
+
},
|
|
16555
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
16556
|
+
import_material10.Alert,
|
|
16557
|
+
{
|
|
16558
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_icons_material6.ErrorOutline, { fontSize: "large" }),
|
|
16559
|
+
severity: "error",
|
|
16560
|
+
sx: { maxWidth: 600, width: "100%" },
|
|
16561
|
+
children: [
|
|
16562
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_material10.AlertTitle, { sx: { fontWeight: "bold" }, children: "Unable to Start Span Filtering" }),
|
|
16563
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_material10.Typography, { sx: { mb: 2 }, variant: "body2", children: "App Inspector couldn't start the background worker that filters and sorts operations. This is usually caused by a Content-Security-Policy blocking Web Workers in this environment." }),
|
|
16564
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_material10.Typography, { sx: { fontFamily: "monospace", mb: 2 }, variant: "caption", children: error.message }),
|
|
16565
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_material10.Box, { sx: { display: "flex", justifyContent: "flex-start" }, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
16566
|
+
import_material10.Button,
|
|
16567
|
+
{
|
|
16568
|
+
"aria-label": "Retry starting the spans filter worker",
|
|
16569
|
+
onClick: onRetry,
|
|
16570
|
+
variant: "outlined",
|
|
16571
|
+
children: "Retry"
|
|
16572
|
+
}
|
|
16573
|
+
) })
|
|
16574
|
+
]
|
|
16575
|
+
}
|
|
16576
|
+
)
|
|
16577
|
+
}
|
|
16578
|
+
);
|
|
16579
|
+
|
|
16558
16580
|
// src/hooks/status-provider.tsx
|
|
16559
16581
|
var import_react41 = require("react");
|
|
16560
16582
|
|
|
@@ -16641,11 +16663,11 @@ function useConnectionStateMachine() {
|
|
|
16641
16663
|
}
|
|
16642
16664
|
|
|
16643
16665
|
// src/hooks/status-provider.tsx
|
|
16644
|
-
var
|
|
16666
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
16645
16667
|
var AppInspectorStatusContext = (0, import_react41.createContext)(void 0);
|
|
16646
16668
|
var StatusProvider = ({ children }) => {
|
|
16647
16669
|
const value = useConnectionStateMachine();
|
|
16648
|
-
return /* @__PURE__ */ (0,
|
|
16670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(AppInspectorStatusContext.Provider, { value, children });
|
|
16649
16671
|
};
|
|
16650
16672
|
var useAppInspectorStatus = () => {
|
|
16651
16673
|
const value = (0, import_react41.useContext)(AppInspectorStatusContext);
|
|
@@ -16701,7 +16723,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
16701
16723
|
}
|
|
16702
16724
|
|
|
16703
16725
|
// src/hooks/use-spans.ts
|
|
16704
|
-
var
|
|
16726
|
+
var import_react48 = require("react");
|
|
16705
16727
|
|
|
16706
16728
|
// src/utils/pagination-buffer.ts
|
|
16707
16729
|
var insertSorted = (array, item, compareFunction, hint = "back") => {
|
|
@@ -16816,6 +16838,7 @@ var createPaginationBuffer = (options) => {
|
|
|
16816
16838
|
nextForwardToken = newPage.nextForwardToken;
|
|
16817
16839
|
hasMoreBackward ??= newPage.hasMoreBackward;
|
|
16818
16840
|
nextBackwardToken ??= newPage.nextBackwardToken;
|
|
16841
|
+
options.onPageFetched?.("forward", newPage.items);
|
|
16819
16842
|
reportDataChange();
|
|
16820
16843
|
} catch (error) {
|
|
16821
16844
|
if (controller.signal.aborted) {
|
|
@@ -16853,6 +16876,7 @@ var createPaginationBuffer = (options) => {
|
|
|
16853
16876
|
nextBackwardToken = newPage.nextBackwardToken;
|
|
16854
16877
|
hasMoreForward ??= newPage.hasMoreForward;
|
|
16855
16878
|
nextForwardToken ??= newPage.nextForwardToken;
|
|
16879
|
+
options.onPageFetched?.("backward", newPage.items);
|
|
16856
16880
|
reportDataChange();
|
|
16857
16881
|
} catch (error) {
|
|
16858
16882
|
if (controller.signal.aborted) {
|
|
@@ -16917,8 +16941,92 @@ var createPaginationBuffer = (options) => {
|
|
|
16917
16941
|
};
|
|
16918
16942
|
};
|
|
16919
16943
|
|
|
16944
|
+
// src/workers/spans-reducer.ts
|
|
16945
|
+
var toSpanFilterProjection = (span) => ({
|
|
16946
|
+
errors: span.errors?.map((error) => ({ level: error.level })),
|
|
16947
|
+
events: span.events.map((event) => ({
|
|
16948
|
+
attributes: typeof event.attributes?.payload === "string" ? { payload: event.attributes.payload } : void 0,
|
|
16949
|
+
event_type: event.event_type
|
|
16950
|
+
})),
|
|
16951
|
+
operation_status: span.operation_status,
|
|
16952
|
+
parent_service_name: span.parent_service_name,
|
|
16953
|
+
service_name: span.service_name,
|
|
16954
|
+
span_id: span.span_id,
|
|
16955
|
+
start_time_unix_nano: span.start_time_unix_nano,
|
|
16956
|
+
status_code: span.status_code
|
|
16957
|
+
});
|
|
16958
|
+
|
|
16959
|
+
// src/hooks/use-spans-compute.ts
|
|
16960
|
+
var import_react43 = require("react");
|
|
16961
|
+
|
|
16962
|
+
// inline-worker:/home/runner/work/localstack-appinspector-ui/localstack-appinspector-ui/src/workers/spans-worker.worker.ts
|
|
16963
|
+
var source = '(() => {\n // src/types/error-levels.ts\n var ErrorLevel = {\n ERROR: 3,\n // General error\n IAM_PERMISSION: 5,\n // IAM permission issues\n OK: 2,\n // OK\n // Standard OTEL status codes\n UNSET: 1,\n // Unset\n // Extended custom levels\n WARNING: 4\n // Warning\n };\n\n // src/utils/iam-utils.ts\n function determinePermissionStatus(payload) {\n if (payload.explicit_deny_count && payload.explicit_deny_count > 0) {\n return "explicitly_denied";\n }\n if (payload.is_allowed && payload.explicit_allow_count && payload.explicit_allow_count > 0) {\n return "explicitly_allowed";\n }\n if (payload.is_allowed) {\n return "implicitly_allowed";\n }\n return "implicitly_denied";\n }\n function parseIAMEvent(payloadString) {\n try {\n const payload = JSON.parse(payloadString);\n const permission = determinePermissionStatus(payload);\n const actions = [];\n const resources = [];\n if (payload.explicit_allows) {\n for (const allow of payload.explicit_allows) {\n if (!actions.includes(allow.action)) actions.push(allow.action);\n if (!resources.includes(allow.resource)) resources.push(allow.resource);\n }\n }\n if (payload.explicit_denies) {\n for (const deny of payload.explicit_denies) {\n if (!actions.includes(deny.action)) actions.push(deny.action);\n if (!resources.includes(deny.resource)) resources.push(deny.resource);\n }\n }\n if (payload.implicit_denies) {\n for (const deny of payload.implicit_denies) {\n if (!actions.includes(deny.action)) actions.push(deny.action);\n if (!resources.includes(deny.resource)) resources.push(deny.resource);\n }\n }\n return {\n details: {\n actions,\n explicitAllows: payload.explicit_allow_count,\n explicitDenies: payload.explicit_deny_count,\n implicitDenies: payload.implicit_deny_count,\n resources\n },\n operation: payload.operation,\n permission,\n principal: payload.principal_arn,\n service: payload.service\n };\n } catch (error) {\n console.error("Error parsing IAM event payload:", error);\n return void 0;\n }\n }\n\n // src/utils/error-level.ts\n var calculateHighestErrorLevel = (span) => {\n if (span.operation_status) {\n switch (span.operation_status) {\n case "error": {\n return ErrorLevel.ERROR;\n }\n case "iam_explicit_deny":\n case "iam_explicit_warn":\n case "iam_implicit_deny":\n case "iam_implicit_warn": {\n return ErrorLevel.IAM_PERMISSION;\n }\n default: {\n return ErrorLevel.OK;\n }\n }\n }\n const hasIamDenial = span.events.some((event) => {\n if (!event.event_type?.toLowerCase().includes("iam")) return false;\n if (typeof event.attributes?.payload !== "string") return false;\n const parsed = parseIAMEvent(event.attributes.payload);\n return parsed?.permission === "explicitly_denied" || parsed?.permission === "implicitly_denied";\n });\n if (hasIamDenial) return ErrorLevel.IAM_PERMISSION;\n if (span.status_code === 2) return ErrorLevel.ERROR;\n const hasErrorInErrors = span.errors?.some((error) => error.level === "error");\n if (hasErrorInErrors) return ErrorLevel.ERROR;\n const hasWarning = span.errors?.some((error) => error.level === "warning");\n if (hasWarning) return ErrorLevel.WARNING;\n return span.status_code || ErrorLevel.UNSET;\n };\n\n // src/utils/spans-filters.ts\n var EMPTY_FILTERS = {\n consumerService: [],\n producerService: [],\n status: []\n };\n var EXTERNAL_PRODUCER_VALUE = "__external__";\n function isFiltersEmpty(filters) {\n return filters.consumerService.length === 0 && filters.producerService.length === 0 && filters.status.length === 0;\n }\n var collapseStatusValue = (status) => {\n if (status === "iam_explicit_deny" || status === "iam_implicit_deny") return "iam_deny";\n if (status === "iam_explicit_warn" || status === "iam_implicit_warn") return "iam_warn";\n return status;\n };\n function applyFilters(spans, filters) {\n if (isFiltersEmpty(filters)) return spans;\n return spans.filter((span) => {\n if (filters.consumerService.length > 0 && !filters.consumerService.includes(span.service_name)) {\n return false;\n }\n if (filters.producerService.length > 0) {\n const includesExternal = filters.producerService.includes(EXTERNAL_PRODUCER_VALUE);\n const namedServices = filters.producerService.filter((value) => value !== EXTERNAL_PRODUCER_VALUE);\n const matchesExternal = includesExternal && !span.parent_service_name;\n const matchesNamed = namedServices.length > 0 && !!span.parent_service_name && namedServices.includes(span.parent_service_name);\n if (!matchesExternal && !matchesNamed) return false;\n }\n if (filters.status.length > 0) {\n if (!span.operation_status) return false;\n if (!filters.status.includes(collapseStatusValue(span.operation_status))) return false;\n }\n return true;\n });\n }\n\n // src/workers/spans-reducer.ts\n var compareByStartTime = (a, b) => a.start_time_unix_nano < b.start_time_unix_nano ? -1 : 1;\n var insertSorted = (array, item, compareFunction, hint) => {\n let left;\n let right;\n if (hint === "back") {\n left = array.length;\n right = array.length;\n let step = 1;\n while (left > 0 && compareFunction(array[left - 1], item) > 0) {\n right = left;\n left = Math.max(0, left - step);\n step *= 2;\n }\n } else {\n left = 0;\n right = 0;\n let step = 1;\n while (right < array.length && compareFunction(array[right], item) <= 0) {\n left = right + 1;\n right = Math.min(array.length, right + step);\n step *= 2;\n }\n }\n while (left < right) {\n const mid = left + right >>> 1;\n if (compareFunction(array[mid], item) <= 0) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n array.splice(left, 0, item);\n };\n var createSpansReducer = () => {\n let corpus = [];\n let filters = EMPTY_FILTERS;\n const computeResult = () => {\n const filtered = applyFilters(corpus, filters);\n let errorCount = 0;\n let warningCount = 0;\n const orderedFilteredIds = [];\n for (const entry of filtered) {\n orderedFilteredIds.push(entry.span_id);\n if (entry.errorLevel === ErrorLevel.ERROR || entry.errorLevel === ErrorLevel.IAM_PERMISSION) {\n errorCount++;\n } else if (entry.errorLevel === ErrorLevel.WARNING) {\n warningCount++;\n }\n }\n const producers = /* @__PURE__ */ new Set();\n const consumers = /* @__PURE__ */ new Set();\n const statuses = /* @__PURE__ */ new Set();\n let hasExternalProducer = false;\n for (const entry of corpus) {\n if (entry.parent_service_name) producers.add(entry.parent_service_name);\n else hasExternalProducer = true;\n consumers.add(entry.service_name);\n if (entry.operation_status) statuses.add(collapseStatusValue(entry.operation_status));\n }\n return {\n consumerValues: [...consumers].toSorted(),\n errorCount,\n hasExternalProducer,\n orderedFilteredIds,\n producerValues: [...producers].toSorted(),\n statusValues: [...statuses].toSorted(),\n warningCount\n };\n };\n return {\n addPage: (direction, projections) => {\n const hint = direction === "forward" ? "back" : "front";\n const sorted = projections.toSorted(compareByStartTime);\n for (const projection of sorted) {\n insertSorted(corpus, { ...projection, errorLevel: calculateHighestErrorLevel(projection) }, compareByStartTime, hint);\n }\n return computeResult();\n },\n clear: () => {\n corpus = [];\n filters = EMPTY_FILTERS;\n return computeResult();\n },\n setFilters: (next) => {\n filters = next;\n return computeResult();\n }\n };\n };\n\n // src/workers/spans-worker.worker.ts\n var context = globalThis;\n var reducer = createSpansReducer();\n context.addEventListener("message", (event) => {\n const request = event.data;\n const result = request.op === "addPage" ? reducer.addPage(request.direction, request.projections) : request.op === "setFilters" ? reducer.setFilters(request.filters) : reducer.clear();\n context.postMessage({ result, seq: request.seq });\n });\n})();\n';
|
|
16964
|
+
function createInlineWorker() {
|
|
16965
|
+
const url = URL.createObjectURL(new Blob([source], { type: "text/javascript" }));
|
|
16966
|
+
try {
|
|
16967
|
+
return new Worker(url);
|
|
16968
|
+
} finally {
|
|
16969
|
+
URL.revokeObjectURL(url);
|
|
16970
|
+
}
|
|
16971
|
+
}
|
|
16972
|
+
|
|
16973
|
+
// src/hooks/use-spans-compute.ts
|
|
16974
|
+
var EMPTY_RESULT = {
|
|
16975
|
+
consumerValues: [],
|
|
16976
|
+
errorCount: 0,
|
|
16977
|
+
hasExternalProducer: false,
|
|
16978
|
+
orderedFilteredIds: [],
|
|
16979
|
+
producerValues: [],
|
|
16980
|
+
statusValues: [],
|
|
16981
|
+
warningCount: 0
|
|
16982
|
+
};
|
|
16983
|
+
var useSpansCompute = () => {
|
|
16984
|
+
const [result, setResult] = (0, import_react43.useState)(EMPTY_RESULT);
|
|
16985
|
+
const [workerError, setWorkerError] = (0, import_react43.useState)();
|
|
16986
|
+
const [retryCount, setRetryCount] = (0, import_react43.useState)(0);
|
|
16987
|
+
const workerRef = (0, import_react43.useRef)();
|
|
16988
|
+
const seqRef = (0, import_react43.useRef)(0);
|
|
16989
|
+
const lastAppliedRef = (0, import_react43.useRef)(0);
|
|
16990
|
+
(0, import_react43.useEffect)(() => {
|
|
16991
|
+
try {
|
|
16992
|
+
const worker = createInlineWorker();
|
|
16993
|
+
worker.addEventListener("message", (event) => {
|
|
16994
|
+
const { result: nextResult, seq } = event.data;
|
|
16995
|
+
if (seq < lastAppliedRef.current) return;
|
|
16996
|
+
lastAppliedRef.current = seq;
|
|
16997
|
+
setResult(nextResult);
|
|
16998
|
+
});
|
|
16999
|
+
worker.addEventListener("error", (event) => {
|
|
17000
|
+
setWorkerError(new Error(event.message || "Spans filter worker crashed."));
|
|
17001
|
+
});
|
|
17002
|
+
workerRef.current = worker;
|
|
17003
|
+
return () => {
|
|
17004
|
+
worker.terminate();
|
|
17005
|
+
workerRef.current = void 0;
|
|
17006
|
+
};
|
|
17007
|
+
} catch (error) {
|
|
17008
|
+
setWorkerError(error instanceof Error ? error : new Error("Failed to start the spans filter worker."));
|
|
17009
|
+
return;
|
|
17010
|
+
}
|
|
17011
|
+
}, [retryCount]);
|
|
17012
|
+
const retryWorker = (0, import_react43.useCallback)(() => {
|
|
17013
|
+
setWorkerError(void 0);
|
|
17014
|
+
setRetryCount((count2) => count2 + 1);
|
|
17015
|
+
}, []);
|
|
17016
|
+
const addPage = (0, import_react43.useCallback)((direction, projections) => {
|
|
17017
|
+
workerRef.current?.postMessage({ direction, op: "addPage", projections, seq: ++seqRef.current });
|
|
17018
|
+
}, []);
|
|
17019
|
+
const setFilters = (0, import_react43.useCallback)((filters) => {
|
|
17020
|
+
workerRef.current?.postMessage({ filters, op: "setFilters", seq: ++seqRef.current });
|
|
17021
|
+
}, []);
|
|
17022
|
+
const clear = (0, import_react43.useCallback)(() => {
|
|
17023
|
+
workerRef.current?.postMessage({ op: "clear", seq: ++seqRef.current });
|
|
17024
|
+
}, []);
|
|
17025
|
+
return { addPage, clear, result, retryWorker, setFilters, workerError };
|
|
17026
|
+
};
|
|
17027
|
+
|
|
16920
17028
|
// src/hooks/use-spans-ws.tsx
|
|
16921
|
-
var
|
|
17029
|
+
var import_react47 = require("react");
|
|
16922
17030
|
|
|
16923
17031
|
// src/config.ts
|
|
16924
17032
|
var APPINSPECTOR_API_PREFIX = "/_localstack/appinspector";
|
|
@@ -16947,8 +17055,8 @@ var getAppInspectorApiUrl = (localstackEndpoint, endpoint) => {
|
|
|
16947
17055
|
var LOCALSTACK_INFO_PATH = "/_localstack/info";
|
|
16948
17056
|
|
|
16949
17057
|
// src/context.tsx
|
|
16950
|
-
var import_react44 = require("react");
|
|
16951
17058
|
var import_react45 = require("react");
|
|
17059
|
+
var import_react46 = require("react");
|
|
16952
17060
|
|
|
16953
17061
|
// src/api/client.ts
|
|
16954
17062
|
var import_semver2 = __toESM(require_semver2(), 1);
|
|
@@ -16957,7 +17065,8 @@ var import_semver2 = __toESM(require_semver2(), 1);
|
|
|
16957
17065
|
var ERROR_MESSAGES = {
|
|
16958
17066
|
APP_INSPECTOR_DISABLED: "App Inspector is currently disabled.",
|
|
16959
17067
|
APP_INSPECTOR_NOT_FOUND: "App Inspector API not found. Please ensure App Inspector is licensed and enabled.",
|
|
16960
|
-
CONNECTION_FAILED: "Failed to connect to LocalStack. Please ensure LocalStack is running and accessible."
|
|
17068
|
+
CONNECTION_FAILED: "Failed to connect to LocalStack. Please ensure LocalStack is running and accessible.",
|
|
17069
|
+
STALE_PAGINATION_TOKEN: "Pagination token is from a previous session."
|
|
16961
17070
|
};
|
|
16962
17071
|
|
|
16963
17072
|
// src/utils/logger.ts
|
|
@@ -17020,6 +17129,16 @@ function unixNanoToMilliseconds(unixNanoString) {
|
|
|
17020
17129
|
// src/api/client.ts
|
|
17021
17130
|
var apiLogger = createScopedLogger("API");
|
|
17022
17131
|
var analyticsLogger = createScopedLogger("ANALYTICS");
|
|
17132
|
+
var isStalePaginationTokenMessage = (body) => {
|
|
17133
|
+
let candidate = body;
|
|
17134
|
+
try {
|
|
17135
|
+
const parsed = JSON.parse(body);
|
|
17136
|
+
const messageField = [parsed.message, parsed.error, parsed.detail].find((value) => typeof value === "string");
|
|
17137
|
+
candidate = typeof messageField === "string" ? messageField : body;
|
|
17138
|
+
} catch {
|
|
17139
|
+
}
|
|
17140
|
+
return candidate.toLowerCase().includes("previous session");
|
|
17141
|
+
};
|
|
17023
17142
|
var makeRequest = async (options) => {
|
|
17024
17143
|
const url = getAppInspectorApiUrl(options.localstackEndpoint, options.endpoint);
|
|
17025
17144
|
try {
|
|
@@ -17043,6 +17162,15 @@ var makeRequest = async (options) => {
|
|
|
17043
17162
|
new Error(`503 from ${url}: ${response.statusText}`)
|
|
17044
17163
|
);
|
|
17045
17164
|
}
|
|
17165
|
+
if (response.status === 400) {
|
|
17166
|
+
const body = await response.text().catch(() => "");
|
|
17167
|
+
if (isStalePaginationTokenMessage(body)) {
|
|
17168
|
+
throw new StaleTokenError(
|
|
17169
|
+
ERROR_MESSAGES.STALE_PAGINATION_TOKEN,
|
|
17170
|
+
new Error(`400 from ${url}: ${response.statusText}`)
|
|
17171
|
+
);
|
|
17172
|
+
}
|
|
17173
|
+
}
|
|
17046
17174
|
throw new Error(`API request failed: ${response.status.toString()} ${response.statusText}`);
|
|
17047
17175
|
}
|
|
17048
17176
|
options.captureHeaders?.(response.headers);
|
|
@@ -17197,7 +17325,7 @@ var createApiClient = ({ localstackEndpoint }) => {
|
|
|
17197
17325
|
};
|
|
17198
17326
|
|
|
17199
17327
|
// src/hooks/use-appinspector-open-analytics.ts
|
|
17200
|
-
var
|
|
17328
|
+
var import_react44 = require("react");
|
|
17201
17329
|
|
|
17202
17330
|
// node_modules/.pnpm/ua-parser-js@2.0.9/node_modules/ua-parser-js/src/main/ua-parser.mjs
|
|
17203
17331
|
var LIBVERSION = "2.0.9";
|
|
@@ -19079,8 +19207,8 @@ var useAppInspectorOpenAnalytics = () => {
|
|
|
19079
19207
|
const api = useAppInspectorApi();
|
|
19080
19208
|
const { deploymentContainer } = useAppInspector();
|
|
19081
19209
|
const { status, statusError } = useAppInspectorStatus();
|
|
19082
|
-
const firedRef = (0,
|
|
19083
|
-
(0,
|
|
19210
|
+
const firedRef = (0, import_react44.useRef)(false);
|
|
19211
|
+
(0, import_react44.useEffect)(() => {
|
|
19084
19212
|
if (firedRef.current) {
|
|
19085
19213
|
return;
|
|
19086
19214
|
}
|
|
@@ -19100,10 +19228,10 @@ var useAppInspectorOpenAnalytics = () => {
|
|
|
19100
19228
|
};
|
|
19101
19229
|
|
|
19102
19230
|
// src/context.tsx
|
|
19103
|
-
var
|
|
19104
|
-
var AppInspectorContext = (0,
|
|
19231
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
19232
|
+
var AppInspectorContext = (0, import_react45.createContext)(void 0);
|
|
19105
19233
|
var useAppInspector = () => {
|
|
19106
|
-
const context = (0,
|
|
19234
|
+
const context = (0, import_react45.useContext)(AppInspectorContext);
|
|
19107
19235
|
if (!context) {
|
|
19108
19236
|
throw new Error("@localstack-studio/ui: components must be used within a <AppInspectorContextProvider>");
|
|
19109
19237
|
}
|
|
@@ -19111,14 +19239,14 @@ var useAppInspector = () => {
|
|
|
19111
19239
|
};
|
|
19112
19240
|
var AppInspectorAnalyticsBoundary = ({ children }) => {
|
|
19113
19241
|
useAppInspectorOpenAnalytics();
|
|
19114
|
-
return /* @__PURE__ */ (0,
|
|
19242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_jsx_runtime132.Fragment, { children });
|
|
19115
19243
|
};
|
|
19116
19244
|
var AppInspectorContextProvider = (props) => {
|
|
19117
|
-
const api = (0,
|
|
19245
|
+
const api = (0, import_react46.useMemo)(
|
|
19118
19246
|
() => createApiClient({ localstackEndpoint: props.localstackEndpoint }),
|
|
19119
19247
|
[props.localstackEndpoint]
|
|
19120
19248
|
);
|
|
19121
|
-
const resolveLink = (0,
|
|
19249
|
+
const resolveLink = (0, import_react46.useCallback)(
|
|
19122
19250
|
(options) => {
|
|
19123
19251
|
if (options.to === "settings") {
|
|
19124
19252
|
return `${props.routePrefix}/settings`;
|
|
@@ -19130,11 +19258,11 @@ var AppInspectorContextProvider = (props) => {
|
|
|
19130
19258
|
},
|
|
19131
19259
|
[props.routePrefix]
|
|
19132
19260
|
);
|
|
19133
|
-
const deploymentContainer = (0,
|
|
19261
|
+
const deploymentContainer = (0, import_react46.useMemo)(
|
|
19134
19262
|
() => props.deploymentContainer ?? { source: "web" },
|
|
19135
19263
|
[props.deploymentContainer]
|
|
19136
19264
|
);
|
|
19137
|
-
const contextValue = (0,
|
|
19265
|
+
const contextValue = (0, import_react46.useMemo)(
|
|
19138
19266
|
() => ({
|
|
19139
19267
|
deploymentContainer,
|
|
19140
19268
|
headerHeight: props.headerHeight ?? 0,
|
|
@@ -19144,31 +19272,61 @@ var AppInspectorContextProvider = (props) => {
|
|
|
19144
19272
|
}),
|
|
19145
19273
|
[deploymentContainer, props.headerHeight, props.linkComponent, props.localstackEndpoint, resolveLink]
|
|
19146
19274
|
);
|
|
19147
|
-
return /* @__PURE__ */ (0,
|
|
19275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(ApiProvider, { api, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(StatusProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(AppInspectorContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(AppInspectorAnalyticsBoundary, { children: props.children }) }) }) });
|
|
19148
19276
|
};
|
|
19149
19277
|
|
|
19150
19278
|
// src/hooks/use-spans-ws.tsx
|
|
19279
|
+
var wsLogger = createScopedLogger("WS");
|
|
19280
|
+
var isLegacySpanFields = (value) => {
|
|
19281
|
+
return typeof value.span_id === "string" && typeof value.trace_id === "string" && typeof value.timestamp === "string";
|
|
19282
|
+
};
|
|
19283
|
+
var parseSpansWebSocketMessage = (raw) => {
|
|
19284
|
+
const parsed = JSON.parse(raw);
|
|
19285
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
19286
|
+
return void 0;
|
|
19287
|
+
}
|
|
19288
|
+
const record = parsed;
|
|
19289
|
+
if (record.type === void 0) {
|
|
19290
|
+
return isLegacySpanFields(record) ? { data: record, type: "span" } : void 0;
|
|
19291
|
+
}
|
|
19292
|
+
if (record.type === "epoch" || record.type === "reset") {
|
|
19293
|
+
return typeof record.epoch === "string" ? { epoch: record.epoch, type: record.type } : void 0;
|
|
19294
|
+
}
|
|
19295
|
+
if (record.type === "span") {
|
|
19296
|
+
const data = record.data;
|
|
19297
|
+
if (typeof data !== "object" || data === null || !isLegacySpanFields(data)) {
|
|
19298
|
+
return void 0;
|
|
19299
|
+
}
|
|
19300
|
+
return {
|
|
19301
|
+
data,
|
|
19302
|
+
epoch: typeof record.epoch === "string" ? record.epoch : void 0,
|
|
19303
|
+
type: "span"
|
|
19304
|
+
};
|
|
19305
|
+
}
|
|
19306
|
+
return void 0;
|
|
19307
|
+
};
|
|
19151
19308
|
function useSpansWebSocket(options) {
|
|
19152
19309
|
const { enabled, onClose, onMessage, onOpen } = options;
|
|
19153
|
-
const onMessageRef = (0,
|
|
19154
|
-
const onOpenRef = (0,
|
|
19155
|
-
const onCloseRef = (0,
|
|
19156
|
-
(0,
|
|
19310
|
+
const onMessageRef = (0, import_react47.useRef)(onMessage);
|
|
19311
|
+
const onOpenRef = (0, import_react47.useRef)(onOpen);
|
|
19312
|
+
const onCloseRef = (0, import_react47.useRef)(onClose);
|
|
19313
|
+
(0, import_react47.useEffect)(() => {
|
|
19157
19314
|
onMessageRef.current = onMessage;
|
|
19158
19315
|
}, [onMessage]);
|
|
19159
|
-
(0,
|
|
19316
|
+
(0, import_react47.useEffect)(() => {
|
|
19160
19317
|
onOpenRef.current = onOpen;
|
|
19161
19318
|
}, [onOpen]);
|
|
19162
|
-
(0,
|
|
19319
|
+
(0, import_react47.useEffect)(() => {
|
|
19163
19320
|
onCloseRef.current = onClose;
|
|
19164
19321
|
}, [onClose]);
|
|
19165
|
-
const [connected, setConnected] = (0,
|
|
19166
|
-
const wsRef = (0,
|
|
19322
|
+
const [connected, setConnected] = (0, import_react47.useState)(false);
|
|
19323
|
+
const wsRef = (0, import_react47.useRef)(void 0);
|
|
19167
19324
|
const { localstackEndpoint } = useAppInspector();
|
|
19168
|
-
const connect = (0,
|
|
19325
|
+
const connect = (0, import_react47.useCallback)(() => {
|
|
19169
19326
|
if (wsRef.current !== void 0) return;
|
|
19170
19327
|
const url = new URL(getAppInspectorApiUrl(localstackEndpoint, API_ENDPOINTS.WEBSOCKET_SPANS));
|
|
19171
19328
|
url.protocol = globalThis.location.protocol === "https:" ? "wss" : "ws";
|
|
19329
|
+
url.searchParams.set("epoch", "1");
|
|
19172
19330
|
const ws = new WebSocket(url);
|
|
19173
19331
|
wsRef.current = ws;
|
|
19174
19332
|
ws.addEventListener("open", () => {
|
|
@@ -19176,9 +19334,20 @@ function useSpansWebSocket(options) {
|
|
|
19176
19334
|
setConnected(true);
|
|
19177
19335
|
onOpenRef.current();
|
|
19178
19336
|
});
|
|
19179
|
-
ws.addEventListener("message", () => {
|
|
19337
|
+
ws.addEventListener("message", (event) => {
|
|
19180
19338
|
if (wsRef.current !== ws) return;
|
|
19181
|
-
|
|
19339
|
+
let message;
|
|
19340
|
+
try {
|
|
19341
|
+
message = parseSpansWebSocketMessage(event.data);
|
|
19342
|
+
} catch (error) {
|
|
19343
|
+
wsLogger.warn("Failed to parse WS message:", { error });
|
|
19344
|
+
return;
|
|
19345
|
+
}
|
|
19346
|
+
if (message === void 0) {
|
|
19347
|
+
wsLogger.warn("Received unrecognized WS message shape:", { data: String(event.data) });
|
|
19348
|
+
return;
|
|
19349
|
+
}
|
|
19350
|
+
onMessageRef.current(message);
|
|
19182
19351
|
});
|
|
19183
19352
|
ws.addEventListener("close", () => {
|
|
19184
19353
|
if (wsRef.current !== ws) return;
|
|
@@ -19194,7 +19363,7 @@ function useSpansWebSocket(options) {
|
|
|
19194
19363
|
}
|
|
19195
19364
|
});
|
|
19196
19365
|
}, [localstackEndpoint]);
|
|
19197
|
-
(0,
|
|
19366
|
+
(0, import_react47.useEffect)(() => {
|
|
19198
19367
|
if (!enabled) {
|
|
19199
19368
|
if (wsRef.current !== void 0) {
|
|
19200
19369
|
wsRef.current.close();
|
|
@@ -19222,30 +19391,69 @@ function useSpansWebSocket(options) {
|
|
|
19222
19391
|
var PAGE_SIZE = 100;
|
|
19223
19392
|
var useSpans = () => {
|
|
19224
19393
|
const api = useAppInspectorApi();
|
|
19225
|
-
const { onWsClose, onWsOpen, wsEnabled } = useAppInspectorStatus();
|
|
19226
|
-
const
|
|
19227
|
-
const
|
|
19228
|
-
const [
|
|
19229
|
-
const
|
|
19230
|
-
|
|
19231
|
-
|
|
19232
|
-
|
|
19233
|
-
const
|
|
19234
|
-
const
|
|
19235
|
-
const [
|
|
19236
|
-
const [
|
|
19237
|
-
const
|
|
19238
|
-
const [
|
|
19239
|
-
const
|
|
19240
|
-
const
|
|
19241
|
-
const [
|
|
19242
|
-
const
|
|
19394
|
+
const { onWsClose, onWsOpen, status, wsEnabled } = useAppInspectorStatus();
|
|
19395
|
+
const { addPage, clear: clearCompute, result: computeResult, retryWorker, setFilters: setComputeFilters, workerError } = useSpansCompute();
|
|
19396
|
+
const spanMapRef = (0, import_react48.useRef)(/* @__PURE__ */ new Map());
|
|
19397
|
+
const [filters, setFiltersState] = (0, import_react48.useState)(EMPTY_FILTERS);
|
|
19398
|
+
const setFilters = (0, import_react48.useCallback)((next) => {
|
|
19399
|
+
setFiltersState(next);
|
|
19400
|
+
setComputeFilters(next);
|
|
19401
|
+
}, [setComputeFilters]);
|
|
19402
|
+
const [fetchError, setFetchError] = (0, import_react48.useState)();
|
|
19403
|
+
const [fetchingForward, setFetchingForward] = (0, import_react48.useState)(false);
|
|
19404
|
+
const [fetchingBackward, setFetchingBackward] = (0, import_react48.useState)(false);
|
|
19405
|
+
const [search, setSearch] = (0, import_react48.useState)("");
|
|
19406
|
+
const searchRef = (0, import_react48.useRef)("");
|
|
19407
|
+
const [searching, setSearching] = (0, import_react48.useState)(false);
|
|
19408
|
+
const searchSeqRef = (0, import_react48.useRef)(0);
|
|
19409
|
+
const paginationBufferRef = (0, import_react48.useRef)();
|
|
19410
|
+
const [totalCount, setTotalCount] = (0, import_react48.useState)();
|
|
19411
|
+
const [licenseLimit, setLicenseLimit] = (0, import_react48.useState)();
|
|
19412
|
+
const [systemLimit, setSystemLimit] = (0, import_react48.useState)();
|
|
19413
|
+
const [errorCount, setErrorCount] = (0, import_react48.useState)();
|
|
19414
|
+
const [warningCount, setWarningCount] = (0, import_react48.useState)();
|
|
19415
|
+
const [hasMoreBackward, setHasMoreBackward] = (0, import_react48.useState)();
|
|
19416
|
+
const [hasMoreForward, setHasMoreForward] = (0, import_react48.useState)();
|
|
19417
|
+
const [spansLoaded, setSpansLoaded] = (0, import_react48.useState)(false);
|
|
19418
|
+
const fetchForward = (0, import_react48.useCallback)(() => {
|
|
19243
19419
|
void paginationBufferRef.current?.fetchForward();
|
|
19244
19420
|
}, []);
|
|
19245
|
-
const fetchBackward = (0,
|
|
19421
|
+
const fetchBackward = (0, import_react48.useCallback)(() => {
|
|
19246
19422
|
void paginationBufferRef.current?.fetchBackward();
|
|
19247
19423
|
}, []);
|
|
19248
|
-
const
|
|
19424
|
+
const resetCorpus = (0, import_react48.useCallback)(() => {
|
|
19425
|
+
spanMapRef.current.clear();
|
|
19426
|
+
clearCompute();
|
|
19427
|
+
}, [clearCompute]);
|
|
19428
|
+
const [epoch, setEpoch] = (0, import_react48.useState)();
|
|
19429
|
+
const onEpochSeen = (0, import_react48.useCallback)((observedEpoch) => {
|
|
19430
|
+
if (observedEpoch === null || observedEpoch === void 0) {
|
|
19431
|
+
return;
|
|
19432
|
+
}
|
|
19433
|
+
setEpoch(observedEpoch);
|
|
19434
|
+
}, []);
|
|
19435
|
+
const clearCache = (0, import_react48.useCallback)(() => {
|
|
19436
|
+
paginationBufferRef.current?.clear();
|
|
19437
|
+
resetCorpus();
|
|
19438
|
+
setTotalCount(void 0);
|
|
19439
|
+
setErrorCount(void 0);
|
|
19440
|
+
setWarningCount(void 0);
|
|
19441
|
+
void paginationBufferRef.current?.fetchForward();
|
|
19442
|
+
}, [resetCorpus]);
|
|
19443
|
+
const hasFetchedWithoutEpochRef = (0, import_react48.useRef)(false);
|
|
19444
|
+
const previousEpochRef = (0, import_react48.useRef)();
|
|
19445
|
+
(0, import_react48.useEffect)(() => {
|
|
19446
|
+
if (epoch === void 0) {
|
|
19447
|
+
return;
|
|
19448
|
+
}
|
|
19449
|
+
const isEpochChange = previousEpochRef.current !== void 0 && previousEpochRef.current !== epoch;
|
|
19450
|
+
const isFirstEpochAfterUnknownBackend = previousEpochRef.current === void 0 && hasFetchedWithoutEpochRef.current;
|
|
19451
|
+
if (isEpochChange || isFirstEpochAfterUnknownBackend) {
|
|
19452
|
+
clearCache();
|
|
19453
|
+
}
|
|
19454
|
+
previousEpochRef.current = epoch;
|
|
19455
|
+
}, [epoch, clearCache]);
|
|
19456
|
+
const applySearch = (0, import_react48.useCallback)((term) => {
|
|
19249
19457
|
const normalized = term.trim();
|
|
19250
19458
|
if (normalized === searchRef.current) {
|
|
19251
19459
|
return;
|
|
@@ -19255,58 +19463,76 @@ var useSpans = () => {
|
|
|
19255
19463
|
const seq = ++searchSeqRef.current;
|
|
19256
19464
|
setSearching(true);
|
|
19257
19465
|
paginationBufferRef.current?.clear();
|
|
19466
|
+
resetCorpus();
|
|
19258
19467
|
void paginationBufferRef.current?.fetchForward().finally(() => {
|
|
19259
19468
|
if (searchSeqRef.current === seq) {
|
|
19260
19469
|
setSearching(false);
|
|
19261
19470
|
}
|
|
19262
19471
|
});
|
|
19263
|
-
}, []);
|
|
19264
|
-
(0,
|
|
19472
|
+
}, [resetCorpus]);
|
|
19473
|
+
(0, import_react48.useEffect)(() => {
|
|
19265
19474
|
const buffer = createPaginationBuffer({
|
|
19266
19475
|
async fetchPage(token, signal) {
|
|
19267
|
-
const
|
|
19268
|
-
|
|
19269
|
-
|
|
19270
|
-
|
|
19271
|
-
|
|
19272
|
-
|
|
19273
|
-
|
|
19274
|
-
|
|
19275
|
-
|
|
19276
|
-
|
|
19277
|
-
|
|
19278
|
-
|
|
19279
|
-
|
|
19280
|
-
|
|
19281
|
-
|
|
19282
|
-
|
|
19476
|
+
const requestPage = async (paginationToken) => {
|
|
19477
|
+
const response = await api.getSpans({
|
|
19478
|
+
limit: PAGE_SIZE,
|
|
19479
|
+
pagination_token: paginationToken,
|
|
19480
|
+
search: searchRef.current || void 0
|
|
19481
|
+
}, { signal });
|
|
19482
|
+
if (!response.pagination.epoch) {
|
|
19483
|
+
hasFetchedWithoutEpochRef.current = true;
|
|
19484
|
+
}
|
|
19485
|
+
onEpochSeen(response.pagination.epoch);
|
|
19486
|
+
setTotalCount(response.pagination.total_count);
|
|
19487
|
+
setLicenseLimit(response.limits.span_count_limit_license);
|
|
19488
|
+
setSystemLimit(response.limits.span_count_limit_system);
|
|
19489
|
+
setErrorCount(response.error_count);
|
|
19490
|
+
setWarningCount(response.warning_count);
|
|
19491
|
+
return {
|
|
19492
|
+
hasMoreBackward: response.pagination.has_prev,
|
|
19493
|
+
hasMoreForward: response.pagination.has_next,
|
|
19494
|
+
items: response.spans,
|
|
19495
|
+
nextBackwardToken: response.pagination.prev_cursor ?? void 0,
|
|
19496
|
+
nextForwardToken: response.pagination.next_cursor ?? void 0
|
|
19497
|
+
};
|
|
19283
19498
|
};
|
|
19499
|
+
try {
|
|
19500
|
+
return await requestPage(token);
|
|
19501
|
+
} catch (error) {
|
|
19502
|
+
if (error instanceof StaleTokenError && token !== void 0) {
|
|
19503
|
+
return await requestPage();
|
|
19504
|
+
}
|
|
19505
|
+
throw error;
|
|
19506
|
+
}
|
|
19284
19507
|
},
|
|
19285
|
-
onDataChange: ({ hasMoreBackward: hasMoreBackward2, hasMoreForward: hasMoreForward2
|
|
19508
|
+
onDataChange: ({ hasMoreBackward: hasMoreBackward2, hasMoreForward: hasMoreForward2 }) => {
|
|
19286
19509
|
setFetchError(void 0);
|
|
19287
|
-
setSpans(items);
|
|
19288
19510
|
setHasMoreBackward(hasMoreBackward2);
|
|
19289
19511
|
setHasMoreForward(hasMoreForward2);
|
|
19512
|
+
setSpansLoaded(true);
|
|
19290
19513
|
},
|
|
19291
19514
|
onError: (error) => {
|
|
19292
19515
|
setFetchError(error);
|
|
19293
19516
|
},
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
|
|
19517
|
+
// Each fetched page streams into the corpus: full spans into the Map (for render
|
|
19518
|
+
// lookup) and lean projections into the compute backend (for merge/filter/count).
|
|
19519
|
+
// Ordering is owned by the compute backend, so no main-thread sortComparator is needed.
|
|
19520
|
+
onPageFetched: (direction, items) => {
|
|
19521
|
+
for (const span of items) {
|
|
19522
|
+
spanMapRef.current.set(span.span_id, span);
|
|
19523
|
+
}
|
|
19524
|
+
addPage(direction, items.map((span) => toSpanFilterProjection(span)));
|
|
19297
19525
|
},
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
19301
|
-
sortComparator(a3, b3) {
|
|
19302
|
-
return a3.start_time_unix_nano < b3.start_time_unix_nano ? -1 : 1;
|
|
19526
|
+
onStatusChange(status2) {
|
|
19527
|
+
setFetchingBackward(status2.fetchingBackward);
|
|
19528
|
+
setFetchingForward(status2.fetchingForward);
|
|
19303
19529
|
}
|
|
19304
19530
|
});
|
|
19305
19531
|
paginationBufferRef.current = buffer;
|
|
19306
19532
|
void buffer.fetchForward();
|
|
19307
|
-
}, [api]);
|
|
19308
|
-
const [clearingSpans, setClearingSpans] = (0,
|
|
19309
|
-
const clearSpans = (0,
|
|
19533
|
+
}, [api, addPage, onEpochSeen, resetCorpus]);
|
|
19534
|
+
const [clearingSpans, setClearingSpans] = (0, import_react48.useState)(false);
|
|
19535
|
+
const clearSpans = (0, import_react48.useCallback)(async () => {
|
|
19310
19536
|
if (clearingSpans) {
|
|
19311
19537
|
return;
|
|
19312
19538
|
}
|
|
@@ -19318,6 +19544,7 @@ var useSpans = () => {
|
|
|
19318
19544
|
setSearch("");
|
|
19319
19545
|
setSearching(false);
|
|
19320
19546
|
paginationBufferRef.current?.clear();
|
|
19547
|
+
resetCorpus();
|
|
19321
19548
|
await paginationBufferRef.current?.fetchForward();
|
|
19322
19549
|
} catch (error) {
|
|
19323
19550
|
console.error("Failed to delete spans:", error);
|
|
@@ -19325,21 +19552,30 @@ var useSpans = () => {
|
|
|
19325
19552
|
} finally {
|
|
19326
19553
|
setClearingSpans(false);
|
|
19327
19554
|
}
|
|
19328
|
-
}, [clearingSpans, api]);
|
|
19329
|
-
(0,
|
|
19555
|
+
}, [clearingSpans, api, resetCorpus]);
|
|
19556
|
+
(0, import_react48.useEffect)(() => {
|
|
19330
19557
|
if (hasMoreForward === true && !fetchingForward) {
|
|
19331
19558
|
void paginationBufferRef.current?.fetchForward();
|
|
19332
19559
|
}
|
|
19333
19560
|
}, [hasMoreForward, fetchingForward]);
|
|
19334
|
-
(0,
|
|
19561
|
+
(0, import_react48.useEffect)(() => {
|
|
19335
19562
|
if (hasMoreBackward === true && !fetchingBackward && !fetchingForward) {
|
|
19336
19563
|
void paginationBufferRef.current?.fetchBackward();
|
|
19337
19564
|
}
|
|
19338
19565
|
}, [hasMoreBackward, fetchingBackward, fetchingForward]);
|
|
19566
|
+
const [previousStatusEpoch, setPreviousStatusEpoch] = (0, import_react48.useState)();
|
|
19567
|
+
if (status !== void 0 && status.epoch !== previousStatusEpoch) {
|
|
19568
|
+
setPreviousStatusEpoch(status.epoch);
|
|
19569
|
+
onEpochSeen(status.epoch);
|
|
19570
|
+
}
|
|
19339
19571
|
useSpansWebSocket({
|
|
19340
19572
|
enabled: wsEnabled,
|
|
19341
19573
|
onClose: onWsClose,
|
|
19342
|
-
onMessage: () => {
|
|
19574
|
+
onMessage: (message) => {
|
|
19575
|
+
onEpochSeen(message.epoch);
|
|
19576
|
+
if (message.type !== "span") {
|
|
19577
|
+
return;
|
|
19578
|
+
}
|
|
19343
19579
|
if (clearingSpans) {
|
|
19344
19580
|
return;
|
|
19345
19581
|
}
|
|
@@ -19352,43 +19588,58 @@ var useSpans = () => {
|
|
|
19352
19588
|
fetchForward();
|
|
19353
19589
|
}
|
|
19354
19590
|
});
|
|
19355
|
-
const clearFetchError = (0,
|
|
19591
|
+
const clearFetchError = (0, import_react48.useCallback)(() => {
|
|
19356
19592
|
setFetchError(void 0);
|
|
19357
19593
|
}, []);
|
|
19594
|
+
const filteredSpans = (0, import_react48.useMemo)(() => {
|
|
19595
|
+
if (!spansLoaded) return;
|
|
19596
|
+
const spanMap = spanMapRef.current;
|
|
19597
|
+
return computeResult.orderedFilteredIds.map((id2) => spanMap.get(id2)).filter((span) => span !== void 0);
|
|
19598
|
+
}, [computeResult, spansLoaded]);
|
|
19358
19599
|
return {
|
|
19359
19600
|
clearFetchError,
|
|
19360
19601
|
clearingSpans,
|
|
19361
19602
|
clearSpans,
|
|
19603
|
+
consumerValues: computeResult.consumerValues,
|
|
19362
19604
|
errorCount,
|
|
19363
19605
|
fetchBackward,
|
|
19364
19606
|
fetchError,
|
|
19365
19607
|
fetchForward,
|
|
19366
19608
|
fetchingBackward,
|
|
19367
19609
|
fetchingForward,
|
|
19610
|
+
filteredErrorCount: computeResult.errorCount,
|
|
19611
|
+
filteredSpans,
|
|
19612
|
+
filteredWarningCount: computeResult.warningCount,
|
|
19613
|
+
filters,
|
|
19614
|
+
hasExternalProducer: computeResult.hasExternalProducer,
|
|
19368
19615
|
hasMoreBackward,
|
|
19369
19616
|
hasMoreForward,
|
|
19370
19617
|
licenseLimit,
|
|
19618
|
+
producerValues: computeResult.producerValues,
|
|
19619
|
+
retryWorker,
|
|
19371
19620
|
search,
|
|
19372
19621
|
searching,
|
|
19622
|
+
setFilters,
|
|
19373
19623
|
setSearch: applySearch,
|
|
19374
|
-
|
|
19624
|
+
statusValues: computeResult.statusValues,
|
|
19375
19625
|
systemLimit,
|
|
19376
19626
|
totalCount,
|
|
19377
|
-
warningCount
|
|
19627
|
+
warningCount,
|
|
19628
|
+
workerError
|
|
19378
19629
|
};
|
|
19379
19630
|
};
|
|
19380
19631
|
|
|
19381
19632
|
// src/pages/trace-graph-page.tsx
|
|
19382
|
-
var
|
|
19383
|
-
var
|
|
19633
|
+
var import_icons_material15 = require("@mui/icons-material");
|
|
19634
|
+
var import_material25 = require("@mui/material");
|
|
19384
19635
|
var import_styles = require("@mui/material/styles");
|
|
19385
|
-
var
|
|
19386
|
-
var
|
|
19636
|
+
var import_react65 = require("@xyflow/react");
|
|
19637
|
+
var import_react66 = require("react");
|
|
19387
19638
|
|
|
19388
19639
|
// src/components/event-details/event-details.tsx
|
|
19389
|
-
var
|
|
19390
|
-
var
|
|
19391
|
-
var
|
|
19640
|
+
var import_icons_material12 = require("@mui/icons-material");
|
|
19641
|
+
var import_material20 = require("@mui/material");
|
|
19642
|
+
var import_react56 = require("react");
|
|
19392
19643
|
|
|
19393
19644
|
// src/utils/event-utils.ts
|
|
19394
19645
|
var iamEventParser = (eventName, attributes) => {
|
|
@@ -19499,13 +19750,13 @@ var getEventGroupsByType = (events) => {
|
|
|
19499
19750
|
};
|
|
19500
19751
|
|
|
19501
19752
|
// src/components/event-details/copy-button.tsx
|
|
19502
|
-
var
|
|
19503
|
-
var
|
|
19504
|
-
var
|
|
19505
|
-
var
|
|
19753
|
+
var import_icons_material7 = require("@mui/icons-material");
|
|
19754
|
+
var import_material11 = require("@mui/material");
|
|
19755
|
+
var import_react49 = require("react");
|
|
19756
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
19506
19757
|
var CopyButton = ({ value }) => {
|
|
19507
|
-
const [copied, setCopied] = (0,
|
|
19508
|
-
const handleCopy = (0,
|
|
19758
|
+
const [copied, setCopied] = (0, import_react49.useState)(false);
|
|
19759
|
+
const handleCopy = (0, import_react49.useCallback)(() => {
|
|
19509
19760
|
const text2 = typeof value === "string" ? value : JSON.stringify(value, void 0, 2);
|
|
19510
19761
|
void navigator.clipboard.writeText(text2).then(() => {
|
|
19511
19762
|
setCopied(true);
|
|
@@ -19514,83 +19765,83 @@ var CopyButton = ({ value }) => {
|
|
|
19514
19765
|
}, 1500);
|
|
19515
19766
|
});
|
|
19516
19767
|
}, [value]);
|
|
19517
|
-
return /* @__PURE__ */ (0,
|
|
19518
|
-
|
|
19768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material11.Tooltip, { title: copied ? "Copied!" : "Copy", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
19769
|
+
import_material11.IconButton,
|
|
19519
19770
|
{
|
|
19520
19771
|
className: "copy-btn",
|
|
19521
19772
|
onClick: handleCopy,
|
|
19522
19773
|
size: "small",
|
|
19523
19774
|
sx: { ml: 0.5, opacity: copied ? 1 : 0, p: 0.25, transition: "opacity 0.15s" },
|
|
19524
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
19775
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_icons_material7.Check, { sx: { fontSize: 14 } }) : /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_icons_material7.ContentCopy, { sx: { fontSize: 14 } })
|
|
19525
19776
|
}
|
|
19526
19777
|
) });
|
|
19527
19778
|
};
|
|
19528
19779
|
|
|
19529
19780
|
// src/components/event-details/event-detail.tsx
|
|
19530
|
-
var
|
|
19531
|
-
var
|
|
19532
|
-
var
|
|
19781
|
+
var import_icons_material10 = require("@mui/icons-material");
|
|
19782
|
+
var import_material17 = require("@mui/material");
|
|
19783
|
+
var import_react53 = require("react");
|
|
19533
19784
|
|
|
19534
19785
|
// src/components/status-icon.tsx
|
|
19535
|
-
var
|
|
19536
|
-
var
|
|
19537
|
-
var
|
|
19786
|
+
var import_icons_material8 = require("@mui/icons-material");
|
|
19787
|
+
var import_material12 = require("@mui/material");
|
|
19788
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
19538
19789
|
var StatusIcon2 = ({ errorLevel }) => {
|
|
19539
19790
|
switch (errorLevel) {
|
|
19540
19791
|
case EventLevel.LevelError: {
|
|
19541
|
-
return /* @__PURE__ */ (0,
|
|
19792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.Cancel, { sx: { color: "red" } });
|
|
19542
19793
|
}
|
|
19543
19794
|
case EventLevel.LevelInfo: {
|
|
19544
|
-
return /* @__PURE__ */ (0,
|
|
19795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.Info, { sx: { color: "gray" } });
|
|
19545
19796
|
}
|
|
19546
19797
|
case EventLevel.LevelPermission: {
|
|
19547
|
-
return /* @__PURE__ */ (0,
|
|
19798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.RemoveCircle, { sx: { color: "blue" } });
|
|
19548
19799
|
}
|
|
19549
19800
|
case EventLevel.LevelWarning: {
|
|
19550
|
-
return /* @__PURE__ */ (0,
|
|
19801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.Error, { sx: { color: "orange" } });
|
|
19551
19802
|
}
|
|
19552
19803
|
default: {
|
|
19553
|
-
return /* @__PURE__ */ (0,
|
|
19804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.CheckCircle, { sx: { color: "lightgray" } });
|
|
19554
19805
|
}
|
|
19555
19806
|
}
|
|
19556
19807
|
};
|
|
19557
19808
|
|
|
19558
19809
|
// src/components/event-details/iam-event-detail.tsx
|
|
19559
|
-
var
|
|
19560
|
-
var
|
|
19561
|
-
var
|
|
19562
|
-
var DetailRow = ({ content, label }) => /* @__PURE__ */ (0,
|
|
19563
|
-
/* @__PURE__ */ (0,
|
|
19564
|
-
/* @__PURE__ */ (0,
|
|
19810
|
+
var import_icons_material9 = require("@mui/icons-material");
|
|
19811
|
+
var import_material13 = require("@mui/material");
|
|
19812
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
19813
|
+
var DetailRow = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Box, { sx: { display: "grid", gap: 1, gridTemplateColumns: "72px 1fr", mb: 0.5 }, children: [
|
|
19814
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { color: "text.secondary", sx: { fontWeight: 600 }, variant: "caption", children: label }),
|
|
19815
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Box, { children: typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { sx: { color: "text.primary", wordBreak: "break-word" }, variant: "caption", children: content }) : content })
|
|
19565
19816
|
] });
|
|
19566
19817
|
var PermissionIcon = ({ status }) => {
|
|
19567
19818
|
switch (status) {
|
|
19568
19819
|
case "explicitly_allowed":
|
|
19569
19820
|
case "implicitly_allowed": {
|
|
19570
|
-
return /* @__PURE__ */ (0,
|
|
19821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_icons_material9.CheckCircle, { sx: { color: "success.main", fontSize: "1rem" } });
|
|
19571
19822
|
}
|
|
19572
19823
|
case "explicitly_denied": {
|
|
19573
|
-
return /* @__PURE__ */ (0,
|
|
19824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_icons_material9.Error, { sx: { color: "error.main", fontSize: "1rem" } });
|
|
19574
19825
|
}
|
|
19575
19826
|
case "implicitly_denied": {
|
|
19576
|
-
return /* @__PURE__ */ (0,
|
|
19827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_icons_material9.Warning, { sx: { color: "warning.main", fontSize: "1rem" } });
|
|
19577
19828
|
}
|
|
19578
19829
|
}
|
|
19579
19830
|
};
|
|
19580
19831
|
var IAMEventDetail = ({ event }) => {
|
|
19581
19832
|
const payloadString = event.attributes?.payload;
|
|
19582
19833
|
if (!payloadString) {
|
|
19583
|
-
return /* @__PURE__ */ (0,
|
|
19834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { color: "text.secondary", variant: "caption", children: "No IAM policy evaluation data available" });
|
|
19584
19835
|
}
|
|
19585
19836
|
const parsedIAM = parseIAMEvent(payloadString);
|
|
19586
19837
|
if (!parsedIAM) {
|
|
19587
|
-
return /* @__PURE__ */ (0,
|
|
19838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { color: "text.secondary", variant: "caption", children: "Failed to parse IAM event data" });
|
|
19588
19839
|
}
|
|
19589
|
-
return /* @__PURE__ */ (0,
|
|
19590
|
-
/* @__PURE__ */ (0,
|
|
19591
|
-
|
|
19840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Box, { children: [
|
|
19841
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Box, { sx: { mb: 1.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
19842
|
+
import_material13.Chip,
|
|
19592
19843
|
{
|
|
19593
|
-
icon: /* @__PURE__ */ (0,
|
|
19844
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(PermissionIcon, { status: parsedIAM.permission }),
|
|
19594
19845
|
label: formatPermissionStatus(parsedIAM.permission),
|
|
19595
19846
|
size: "small",
|
|
19596
19847
|
sx: {
|
|
@@ -19600,36 +19851,36 @@ var IAMEventDetail = ({ event }) => {
|
|
|
19600
19851
|
variant: "outlined"
|
|
19601
19852
|
}
|
|
19602
19853
|
) }),
|
|
19603
|
-
/* @__PURE__ */ (0,
|
|
19604
|
-
/* @__PURE__ */ (0,
|
|
19605
|
-
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ (0,
|
|
19854
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(DetailRow, { content: `${parsedIAM.service}:${parsedIAM.operation}`, label: "Operation" }),
|
|
19855
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(DetailRow, { content: parsedIAM.principal, label: "Principal" }),
|
|
19856
|
+
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
19606
19857
|
DetailRow,
|
|
19607
19858
|
{
|
|
19608
|
-
content: /* @__PURE__ */ (0,
|
|
19859
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Box, { children: parsedIAM.details.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { sx: { color: "text.primary", display: "block" }, variant: "caption", children: action }, action)) }),
|
|
19609
19860
|
label: "Actions"
|
|
19610
19861
|
}
|
|
19611
19862
|
),
|
|
19612
|
-
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ (0,
|
|
19863
|
+
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
19613
19864
|
DetailRow,
|
|
19614
19865
|
{
|
|
19615
|
-
content: /* @__PURE__ */ (0,
|
|
19866
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Box, { children: parsedIAM.details.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { sx: { color: "text.primary", display: "block", wordBreak: "break-all" }, variant: "caption", children: resource }, resource)) }),
|
|
19616
19867
|
label: "Resources"
|
|
19617
19868
|
}
|
|
19618
19869
|
),
|
|
19619
|
-
(parsedIAM.details.explicitAllows !== void 0 || parsedIAM.details.explicitDenies !== void 0 || parsedIAM.details.implicitDenies !== void 0) && /* @__PURE__ */ (0,
|
|
19620
|
-
/* @__PURE__ */ (0,
|
|
19621
|
-
/* @__PURE__ */ (0,
|
|
19622
|
-
parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ (0,
|
|
19623
|
-
/* @__PURE__ */ (0,
|
|
19624
|
-
/* @__PURE__ */ (0,
|
|
19870
|
+
(parsedIAM.details.explicitAllows !== void 0 || parsedIAM.details.explicitDenies !== void 0 || parsedIAM.details.implicitDenies !== void 0) && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Box, { sx: { mt: 1.5 }, children: [
|
|
19871
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { color: "text.secondary", sx: { display: "block", fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Policy Evaluation" }),
|
|
19872
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Box, { sx: { display: "grid", gap: 1, gridTemplateColumns: "repeat(3, 1fr)" }, children: [
|
|
19873
|
+
parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Box, { sx: { textAlign: "center" }, children: [
|
|
19874
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { color: "success.main", sx: { display: "block", fontWeight: "bold" }, variant: "subtitle2", children: parsedIAM.details.explicitAllows }),
|
|
19875
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { color: "text.secondary", variant: "caption", children: "Explicit Allows" })
|
|
19625
19876
|
] }),
|
|
19626
|
-
parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ (0,
|
|
19627
|
-
/* @__PURE__ */ (0,
|
|
19628
|
-
/* @__PURE__ */ (0,
|
|
19877
|
+
parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Box, { sx: { textAlign: "center" }, children: [
|
|
19878
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { color: "error.main", sx: { display: "block", fontWeight: "bold" }, variant: "subtitle2", children: parsedIAM.details.explicitDenies }),
|
|
19879
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { color: "text.secondary", variant: "caption", children: "Explicit Denies" })
|
|
19629
19880
|
] }),
|
|
19630
|
-
parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ (0,
|
|
19631
|
-
/* @__PURE__ */ (0,
|
|
19632
|
-
/* @__PURE__ */ (0,
|
|
19881
|
+
parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_material13.Box, { sx: { textAlign: "center" }, children: [
|
|
19882
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { color: "warning.main", sx: { display: "block", fontWeight: "bold" }, variant: "subtitle2", children: parsedIAM.details.implicitDenies }),
|
|
19883
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material13.Typography, { color: "text.secondary", variant: "caption", children: "Implicit Denies" })
|
|
19633
19884
|
] })
|
|
19634
19885
|
] })
|
|
19635
19886
|
] })
|
|
@@ -19637,16 +19888,16 @@ var IAMEventDetail = ({ event }) => {
|
|
|
19637
19888
|
};
|
|
19638
19889
|
|
|
19639
19890
|
// src/components/event-details/iam-permission-detail.tsx
|
|
19640
|
-
var
|
|
19641
|
-
var
|
|
19642
|
-
var
|
|
19891
|
+
var import_material14 = require("@mui/material");
|
|
19892
|
+
var import_react50 = require("react");
|
|
19893
|
+
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
19643
19894
|
var getChipColor = (isAllowed, spanStatusCode) => {
|
|
19644
19895
|
if (isAllowed) return "success.main";
|
|
19645
19896
|
if (spanStatusCode === 2) return "error.main";
|
|
19646
19897
|
return "warning.main";
|
|
19647
19898
|
};
|
|
19648
19899
|
var IAMPermissionItem = ({ event, spanStatusCode }) => {
|
|
19649
|
-
const parsedData = (0,
|
|
19900
|
+
const parsedData = (0, import_react50.useMemo)(() => {
|
|
19650
19901
|
const payloadString = event.attributes?.payload;
|
|
19651
19902
|
if (!payloadString) return;
|
|
19652
19903
|
const parsedIAM2 = parseIAMEvent(payloadString);
|
|
@@ -19659,42 +19910,42 @@ var IAMPermissionItem = ({ event, spanStatusCode }) => {
|
|
|
19659
19910
|
const { parsedIAM } = parsedData;
|
|
19660
19911
|
const isAllowed = parsedIAM.permission === "explicitly_allowed" || parsedIAM.permission === "implicitly_allowed";
|
|
19661
19912
|
const chipColors = { backgroundColor: getChipColor(isAllowed, spanStatusCode), color: "white" };
|
|
19662
|
-
return /* @__PURE__ */ (0,
|
|
19663
|
-
/* @__PURE__ */ (0,
|
|
19664
|
-
/* @__PURE__ */ (0,
|
|
19665
|
-
/* @__PURE__ */ (0,
|
|
19666
|
-
/* @__PURE__ */ (0,
|
|
19667
|
-
/* @__PURE__ */ (0,
|
|
19668
|
-
/* @__PURE__ */ (0,
|
|
19669
|
-
/* @__PURE__ */ (0,
|
|
19913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material14.Box, { sx: { mb: 0.5 }, children: [
|
|
19914
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material14.Box, { sx: { alignItems: "center", display: "flex", gap: 1, mb: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material14.Chip, { label: formatPermissionStatus(parsedIAM.permission), size: "small", sx: { ...chipColors, fontWeight: 500 } }) }),
|
|
19915
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material14.Stack, { spacing: 1, children: [
|
|
19916
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material14.Box, { "data-testid": EVENT_DETAILS_IAM_PRINCIPAL_TEST_ID, children: [
|
|
19917
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material14.Typography, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Principal" }),
|
|
19918
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material14.Stack, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
19919
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material14.Typography, { sx: { wordBreak: "break-all" }, variant: "body2", children: parsedIAM.principal }),
|
|
19920
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(CopyButton, { value: parsedIAM.principal })
|
|
19670
19921
|
] })
|
|
19671
19922
|
] }),
|
|
19672
|
-
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ (0,
|
|
19673
|
-
/* @__PURE__ */ (0,
|
|
19674
|
-
parsedIAM.details.actions.map((action) => /* @__PURE__ */ (0,
|
|
19675
|
-
/* @__PURE__ */ (0,
|
|
19676
|
-
/* @__PURE__ */ (0,
|
|
19923
|
+
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material14.Box, { "data-testid": EVENT_DETAILS_IAM_ACTIONS_TEST_ID, children: [
|
|
19924
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material14.Typography, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Actions" }),
|
|
19925
|
+
parsedIAM.details.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material14.Stack, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
19926
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material14.Typography, { sx: { display: "block" }, variant: "body2", children: action }),
|
|
19927
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(CopyButton, { value: action })
|
|
19677
19928
|
] }, action))
|
|
19678
19929
|
] }),
|
|
19679
|
-
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ (0,
|
|
19680
|
-
/* @__PURE__ */ (0,
|
|
19681
|
-
parsedIAM.details.resources.map((resource) => /* @__PURE__ */ (0,
|
|
19682
|
-
/* @__PURE__ */ (0,
|
|
19683
|
-
/* @__PURE__ */ (0,
|
|
19930
|
+
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material14.Box, { "data-testid": EVENT_DETAILS_IAM_RESOURCES_TEST_ID, children: [
|
|
19931
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material14.Typography, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Resources" }),
|
|
19932
|
+
parsedIAM.details.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material14.Stack, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
19933
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material14.Typography, { sx: { display: "block", wordBreak: "break-all" }, variant: "body2", children: resource }),
|
|
19934
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(CopyButton, { value: resource })
|
|
19684
19935
|
] }, resource))
|
|
19685
19936
|
] })
|
|
19686
19937
|
] })
|
|
19687
19938
|
] });
|
|
19688
19939
|
};
|
|
19689
|
-
var IAMPermissionDetail = ({ events, spanStatusCode }) => /* @__PURE__ */ (0,
|
|
19940
|
+
var IAMPermissionDetail = ({ events, spanStatusCode }) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material14.Box, { children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(IAMPermissionItem, { event, spanStatusCode }, `${event.span_id}-${event.event_id}`)) });
|
|
19690
19941
|
|
|
19691
19942
|
// src/components/event-details/payload-viewer.tsx
|
|
19692
|
-
var
|
|
19943
|
+
var import_material16 = require("@mui/material");
|
|
19693
19944
|
|
|
19694
19945
|
// node_modules/.pnpm/@textea+json-viewer@3.5.0_@emotion+react@11.14.0_@types+react@17.0.91_react@17.0.2__@em_040507e953752247cb848fd3f764690c/node_modules/@textea/json-viewer/dist/index.mjs
|
|
19695
|
-
var
|
|
19696
|
-
var
|
|
19697
|
-
var
|
|
19946
|
+
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
19947
|
+
var import_material15 = require("@mui/material");
|
|
19948
|
+
var import_react51 = require("react");
|
|
19698
19949
|
var import_zustand = require("zustand");
|
|
19699
19950
|
var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
|
|
19700
19951
|
function r(e2) {
|
|
@@ -19811,10 +20062,10 @@ var createJsonViewerStore = (props) => {
|
|
|
19811
20062
|
};
|
|
19812
20063
|
});
|
|
19813
20064
|
};
|
|
19814
|
-
var JsonViewerStoreContext = (0,
|
|
20065
|
+
var JsonViewerStoreContext = (0, import_react51.createContext)(void 0);
|
|
19815
20066
|
JsonViewerStoreContext.Provider;
|
|
19816
20067
|
var useJsonViewerStore = (selector2, equalityFn) => {
|
|
19817
|
-
const store = (0,
|
|
20068
|
+
const store = (0, import_react51.useContext)(JsonViewerStoreContext);
|
|
19818
20069
|
return (0, import_zustand.useStore)(store, selector2, equalityFn);
|
|
19819
20070
|
};
|
|
19820
20071
|
var useTextColor = () => {
|
|
@@ -19939,9 +20190,9 @@ async function copyString(value) {
|
|
|
19939
20190
|
}
|
|
19940
20191
|
function useClipboard() {
|
|
19941
20192
|
let { timeout = 2e3 } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
19942
|
-
const [copied, setCopied] = (0,
|
|
19943
|
-
const copyTimeout = (0,
|
|
19944
|
-
const handleCopyResult = (0,
|
|
20193
|
+
const [copied, setCopied] = (0, import_react51.useState)(false);
|
|
20194
|
+
const copyTimeout = (0, import_react51.useRef)(null);
|
|
20195
|
+
const handleCopyResult = (0, import_react51.useCallback)((value) => {
|
|
19945
20196
|
const current = copyTimeout.current;
|
|
19946
20197
|
if (current) {
|
|
19947
20198
|
window.clearTimeout(current);
|
|
@@ -19952,7 +20203,7 @@ function useClipboard() {
|
|
|
19952
20203
|
timeout
|
|
19953
20204
|
]);
|
|
19954
20205
|
const onCopy = useJsonViewerStore((store) => store.onCopy);
|
|
19955
|
-
const copy = (0,
|
|
20206
|
+
const copy = (0, import_react51.useCallback)(async (path, value) => {
|
|
19956
20207
|
if (typeof onCopy === "function") {
|
|
19957
20208
|
try {
|
|
19958
20209
|
await onCopy(path, value, copyString);
|
|
@@ -19973,7 +20224,7 @@ function useClipboard() {
|
|
|
19973
20224
|
handleCopyResult,
|
|
19974
20225
|
onCopy
|
|
19975
20226
|
]);
|
|
19976
|
-
const reset = (0,
|
|
20227
|
+
const reset = (0, import_react51.useCallback)(() => {
|
|
19977
20228
|
setCopied(false);
|
|
19978
20229
|
if (copyTimeout.current) {
|
|
19979
20230
|
clearTimeout(copyTimeout.current);
|
|
@@ -19987,7 +20238,7 @@ function useClipboard() {
|
|
|
19987
20238
|
}
|
|
19988
20239
|
function useIsCycleReference(path, value) {
|
|
19989
20240
|
const rootValue = useJsonViewerStore((store) => store.value);
|
|
19990
|
-
return (0,
|
|
20241
|
+
return (0, import_react51.useMemo)(() => isCycleReference(rootValue, path, value), [
|
|
19991
20242
|
path,
|
|
19992
20243
|
value,
|
|
19993
20244
|
rootValue
|
|
@@ -20000,7 +20251,7 @@ function useInspect(path, value, nestedIndex) {
|
|
|
20000
20251
|
const setInspectCache = useJsonViewerStore((store) => store.setInspectCache);
|
|
20001
20252
|
const defaultInspectDepth = useJsonViewerStore((store) => store.defaultInspectDepth);
|
|
20002
20253
|
const defaultInspectControl = useJsonViewerStore((store) => store.defaultInspectControl);
|
|
20003
|
-
(0,
|
|
20254
|
+
(0, import_react51.useEffect)(() => {
|
|
20004
20255
|
const inspect2 = getInspectCache(path, nestedIndex);
|
|
20005
20256
|
if (inspect2 !== void 0) {
|
|
20006
20257
|
return;
|
|
@@ -20022,7 +20273,7 @@ function useInspect(path, value, nestedIndex) {
|
|
|
20022
20273
|
value,
|
|
20023
20274
|
setInspectCache
|
|
20024
20275
|
]);
|
|
20025
|
-
const [inspect, set] = (0,
|
|
20276
|
+
const [inspect, set] = (0, import_react51.useState)(() => {
|
|
20026
20277
|
const shouldInspect = getInspectCache(path, nestedIndex);
|
|
20027
20278
|
if (shouldInspect !== void 0) {
|
|
20028
20279
|
return shouldInspect;
|
|
@@ -20032,7 +20283,7 @@ function useInspect(path, value, nestedIndex) {
|
|
|
20032
20283
|
}
|
|
20033
20284
|
return isTrap ? false : typeof defaultInspectControl === "function" ? defaultInspectControl(path, value) : depth < defaultInspectDepth;
|
|
20034
20285
|
});
|
|
20035
|
-
const setInspect = (0,
|
|
20286
|
+
const setInspect = (0, import_react51.useCallback)((apply) => {
|
|
20036
20287
|
set((oldState) => {
|
|
20037
20288
|
const newState = typeof apply === "boolean" ? apply : apply(oldState);
|
|
20038
20289
|
setInspectCache(path, newState, nestedIndex);
|
|
@@ -20048,7 +20299,7 @@ function useInspect(path, value, nestedIndex) {
|
|
|
20048
20299
|
setInspect
|
|
20049
20300
|
];
|
|
20050
20301
|
}
|
|
20051
|
-
var DataBox = (props) => /* @__PURE__ */ (0,
|
|
20302
|
+
var DataBox = (props) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20052
20303
|
component: "div",
|
|
20053
20304
|
...props,
|
|
20054
20305
|
sx: {
|
|
@@ -20059,7 +20310,7 @@ var DataBox = (props) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_m
|
|
|
20059
20310
|
var DataTypeLabel = (param) => {
|
|
20060
20311
|
let { dataType, enable = true } = param;
|
|
20061
20312
|
if (!enable) return null;
|
|
20062
|
-
return /* @__PURE__ */ (0,
|
|
20313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
20063
20314
|
className: "data-type-label",
|
|
20064
20315
|
sx: {
|
|
20065
20316
|
mx: 0.5,
|
|
@@ -20072,23 +20323,23 @@ var DataTypeLabel = (param) => {
|
|
|
20072
20323
|
};
|
|
20073
20324
|
function defineEasyType(param) {
|
|
20074
20325
|
let { is, serialize, deserialize, type, colorKey, displayTypeLabel = true, Renderer } = param;
|
|
20075
|
-
const Render = /* @__PURE__ */ (0,
|
|
20326
|
+
const Render = /* @__PURE__ */ (0, import_react51.memo)(Renderer);
|
|
20076
20327
|
const EasyType = (props) => {
|
|
20077
20328
|
const storeDisplayDataTypes = useJsonViewerStore((store) => store.displayDataTypes);
|
|
20078
20329
|
const color2 = useJsonViewerStore((store) => store.colorspace[colorKey]);
|
|
20079
20330
|
const onSelect = useJsonViewerStore((store) => store.onSelect);
|
|
20080
|
-
return /* @__PURE__ */ (0,
|
|
20331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(DataBox, {
|
|
20081
20332
|
onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect(props.path, props.value),
|
|
20082
20333
|
sx: {
|
|
20083
20334
|
color: color2
|
|
20084
20335
|
},
|
|
20085
20336
|
children: [
|
|
20086
|
-
displayTypeLabel && storeDisplayDataTypes && /* @__PURE__ */ (0,
|
|
20337
|
+
displayTypeLabel && storeDisplayDataTypes && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataTypeLabel, {
|
|
20087
20338
|
dataType: type
|
|
20088
20339
|
}),
|
|
20089
|
-
/* @__PURE__ */ (0,
|
|
20340
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
20090
20341
|
className: "".concat(type, "-value"),
|
|
20091
|
-
children: /* @__PURE__ */ (0,
|
|
20342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(Render, {
|
|
20092
20343
|
path: props.path,
|
|
20093
20344
|
inspect: props.inspect,
|
|
20094
20345
|
setInspect: props.setInspect,
|
|
@@ -20109,7 +20360,7 @@ function defineEasyType(param) {
|
|
|
20109
20360
|
const EasyTypeEditor = (param2) => {
|
|
20110
20361
|
let { value, setValue, abortEditing, commitEditing } = param2;
|
|
20111
20362
|
const color2 = useJsonViewerStore((store) => store.colorspace[colorKey]);
|
|
20112
|
-
const handleKeyDown = (0,
|
|
20363
|
+
const handleKeyDown = (0, import_react51.useCallback)((event) => {
|
|
20113
20364
|
if (event.key === "Enter") {
|
|
20114
20365
|
event.preventDefault();
|
|
20115
20366
|
commitEditing(value);
|
|
@@ -20123,12 +20374,12 @@ function defineEasyType(param) {
|
|
|
20123
20374
|
commitEditing,
|
|
20124
20375
|
value
|
|
20125
20376
|
]);
|
|
20126
|
-
const handleChange = (0,
|
|
20377
|
+
const handleChange = (0, import_react51.useCallback)((event) => {
|
|
20127
20378
|
setValue(event.target.value);
|
|
20128
20379
|
}, [
|
|
20129
20380
|
setValue
|
|
20130
20381
|
]);
|
|
20131
|
-
return /* @__PURE__ */ (0,
|
|
20382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.InputBase, {
|
|
20132
20383
|
autoFocus: true,
|
|
20133
20384
|
value,
|
|
20134
20385
|
onChange: handleChange,
|
|
@@ -20168,7 +20419,7 @@ var booleanType = defineEasyType({
|
|
|
20168
20419
|
},
|
|
20169
20420
|
Renderer: (param) => {
|
|
20170
20421
|
let { value } = param;
|
|
20171
|
-
return /* @__PURE__ */ (0,
|
|
20422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
20172
20423
|
children: value ? "true" : "false"
|
|
20173
20424
|
});
|
|
20174
20425
|
}
|
|
@@ -20187,7 +20438,7 @@ var dateType = defineEasyType({
|
|
|
20187
20438
|
colorKey: "base0D",
|
|
20188
20439
|
Renderer: (param) => {
|
|
20189
20440
|
let { value } = param;
|
|
20190
|
-
return /* @__PURE__ */ (0,
|
|
20441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
20191
20442
|
children: value.toLocaleTimeString("en-us", displayOptions)
|
|
20192
20443
|
});
|
|
20193
20444
|
}
|
|
@@ -20216,12 +20467,12 @@ var functionName = (func) => {
|
|
|
20216
20467
|
var lb = "{";
|
|
20217
20468
|
var rb = "}";
|
|
20218
20469
|
var PreFunctionType = (props) => {
|
|
20219
|
-
return /* @__PURE__ */ (0,
|
|
20470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.NoSsr, {
|
|
20220
20471
|
children: [
|
|
20221
|
-
/* @__PURE__ */ (0,
|
|
20472
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataTypeLabel, {
|
|
20222
20473
|
dataType: "function"
|
|
20223
20474
|
}),
|
|
20224
|
-
/* @__PURE__ */ (0,
|
|
20475
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.Box, {
|
|
20225
20476
|
component: "span",
|
|
20226
20477
|
className: "data-function-start",
|
|
20227
20478
|
sx: {
|
|
@@ -20237,8 +20488,8 @@ var PreFunctionType = (props) => {
|
|
|
20237
20488
|
});
|
|
20238
20489
|
};
|
|
20239
20490
|
var PostFunctionType = () => {
|
|
20240
|
-
return /* @__PURE__ */ (0,
|
|
20241
|
-
children: /* @__PURE__ */ (0,
|
|
20491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.NoSsr, {
|
|
20492
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20242
20493
|
component: "span",
|
|
20243
20494
|
className: "data-function-end",
|
|
20244
20495
|
children: rb
|
|
@@ -20247,15 +20498,15 @@ var PostFunctionType = () => {
|
|
|
20247
20498
|
};
|
|
20248
20499
|
var FunctionType = (props) => {
|
|
20249
20500
|
const functionColor = useJsonViewerStore((store) => store.colorspace.base05);
|
|
20250
|
-
return /* @__PURE__ */ (0,
|
|
20251
|
-
children: /* @__PURE__ */ (0,
|
|
20501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.NoSsr, {
|
|
20502
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20252
20503
|
className: "data-function",
|
|
20253
20504
|
sx: {
|
|
20254
20505
|
display: props.inspect ? "block" : "inline-block",
|
|
20255
20506
|
pl: props.inspect ? 2 : 0,
|
|
20256
20507
|
color: functionColor
|
|
20257
20508
|
},
|
|
20258
|
-
children: props.inspect ? functionBody(props.value) : /* @__PURE__ */ (0,
|
|
20509
|
+
children: props.inspect ? functionBody(props.value) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20259
20510
|
component: "span",
|
|
20260
20511
|
className: "data-function-body",
|
|
20261
20512
|
onClick: () => props.setInspect(true),
|
|
@@ -20283,7 +20534,7 @@ var nullType = defineEasyType({
|
|
|
20283
20534
|
displayTypeLabel: false,
|
|
20284
20535
|
Renderer: () => {
|
|
20285
20536
|
const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
20286
|
-
return /* @__PURE__ */ (0,
|
|
20537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20287
20538
|
sx: {
|
|
20288
20539
|
fontSize: "0.8rem",
|
|
20289
20540
|
backgroundColor,
|
|
@@ -20306,7 +20557,7 @@ var nanType = defineEasyType({
|
|
|
20306
20557
|
deserialize: (value) => parseFloat(value),
|
|
20307
20558
|
Renderer: () => {
|
|
20308
20559
|
const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
20309
|
-
return /* @__PURE__ */ (0,
|
|
20560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20310
20561
|
sx: {
|
|
20311
20562
|
backgroundColor,
|
|
20312
20563
|
fontSize: "0.8rem",
|
|
@@ -20326,7 +20577,7 @@ var floatType = defineEasyType({
|
|
|
20326
20577
|
deserialize: (value) => parseFloat(value),
|
|
20327
20578
|
Renderer: (param) => {
|
|
20328
20579
|
let { value } = param;
|
|
20329
|
-
return /* @__PURE__ */ (0,
|
|
20580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
20330
20581
|
children: value
|
|
20331
20582
|
});
|
|
20332
20583
|
}
|
|
@@ -20340,7 +20591,7 @@ var intType = defineEasyType({
|
|
|
20340
20591
|
deserialize: (value) => parseFloat(value),
|
|
20341
20592
|
Renderer: (param) => {
|
|
20342
20593
|
let { value } = param;
|
|
20343
|
-
return /* @__PURE__ */ (0,
|
|
20594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
20344
20595
|
children: value
|
|
20345
20596
|
});
|
|
20346
20597
|
}
|
|
@@ -20353,16 +20604,16 @@ var bigIntType = defineEasyType({
|
|
|
20353
20604
|
deserialize: (value) => BigInt(value.replace(/\D/g, "")),
|
|
20354
20605
|
Renderer: (param) => {
|
|
20355
20606
|
let { value } = param;
|
|
20356
|
-
return /* @__PURE__ */ (0,
|
|
20607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
20357
20608
|
children: "".concat(value, "n")
|
|
20358
20609
|
});
|
|
20359
20610
|
}
|
|
20360
20611
|
});
|
|
20361
20612
|
var BaseIcon = (param) => {
|
|
20362
20613
|
let { d: d2, ...props } = param;
|
|
20363
|
-
return /* @__PURE__ */ (0,
|
|
20614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.SvgIcon, {
|
|
20364
20615
|
...props,
|
|
20365
|
-
children: /* @__PURE__ */ (0,
|
|
20616
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("path", {
|
|
20366
20617
|
d: d2
|
|
20367
20618
|
})
|
|
20368
20619
|
});
|
|
@@ -20377,55 +20628,55 @@ var Edit = "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.3
|
|
|
20377
20628
|
var ExpandMore = "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z";
|
|
20378
20629
|
var Delete = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5l-1-1h-5l-1 1H5v2h14V4z";
|
|
20379
20630
|
var AddBoxIcon = (props) => {
|
|
20380
|
-
return /* @__PURE__ */ (0,
|
|
20631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20381
20632
|
d: AddBox,
|
|
20382
20633
|
...props
|
|
20383
20634
|
});
|
|
20384
20635
|
};
|
|
20385
20636
|
var CheckIcon = (props) => {
|
|
20386
|
-
return /* @__PURE__ */ (0,
|
|
20637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20387
20638
|
d: Check2,
|
|
20388
20639
|
...props
|
|
20389
20640
|
});
|
|
20390
20641
|
};
|
|
20391
20642
|
var ChevronRightIcon = (props) => {
|
|
20392
|
-
return /* @__PURE__ */ (0,
|
|
20643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20393
20644
|
d: ChevronRight,
|
|
20394
20645
|
...props
|
|
20395
20646
|
});
|
|
20396
20647
|
};
|
|
20397
20648
|
var CircularArrowsIcon = (props) => {
|
|
20398
|
-
return /* @__PURE__ */ (0,
|
|
20649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20399
20650
|
d: CircularArrows,
|
|
20400
20651
|
...props
|
|
20401
20652
|
});
|
|
20402
20653
|
};
|
|
20403
20654
|
var CloseIcon = (props) => {
|
|
20404
|
-
return /* @__PURE__ */ (0,
|
|
20655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20405
20656
|
d: Close2,
|
|
20406
20657
|
...props
|
|
20407
20658
|
});
|
|
20408
20659
|
};
|
|
20409
20660
|
var ContentCopyIcon = (props) => {
|
|
20410
|
-
return /* @__PURE__ */ (0,
|
|
20661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20411
20662
|
d: ContentCopy2,
|
|
20412
20663
|
...props
|
|
20413
20664
|
});
|
|
20414
20665
|
};
|
|
20415
20666
|
var EditIcon = (props) => {
|
|
20416
|
-
return /* @__PURE__ */ (0,
|
|
20667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20417
20668
|
d: Edit,
|
|
20418
20669
|
...props
|
|
20419
20670
|
});
|
|
20420
20671
|
};
|
|
20421
20672
|
var ExpandMoreIcon = (props) => {
|
|
20422
|
-
return /* @__PURE__ */ (0,
|
|
20673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20423
20674
|
d: ExpandMore,
|
|
20424
20675
|
...props
|
|
20425
20676
|
});
|
|
20426
20677
|
};
|
|
20427
20678
|
var DeleteIcon = (props) => {
|
|
20428
|
-
return /* @__PURE__ */ (0,
|
|
20679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20429
20680
|
d: Delete,
|
|
20430
20681
|
...props
|
|
20431
20682
|
});
|
|
@@ -20448,23 +20699,23 @@ function inspectMetadata(value) {
|
|
|
20448
20699
|
var PreObjectType = (props) => {
|
|
20449
20700
|
const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
|
|
20450
20701
|
const textColor = useTextColor();
|
|
20451
|
-
const isArrayLike = (0,
|
|
20702
|
+
const isArrayLike = (0, import_react51.useMemo)(() => Array.isArray(props.value) || props.value instanceof Set, [
|
|
20452
20703
|
props.value
|
|
20453
20704
|
]);
|
|
20454
|
-
const isEmptyValue = (0,
|
|
20705
|
+
const isEmptyValue = (0, import_react51.useMemo)(() => getValueSize(props.value) === 0, [
|
|
20455
20706
|
props.value
|
|
20456
20707
|
]);
|
|
20457
|
-
const sizeOfValue = (0,
|
|
20708
|
+
const sizeOfValue = (0, import_react51.useMemo)(() => inspectMetadata(props.value), [
|
|
20458
20709
|
props.value
|
|
20459
20710
|
]);
|
|
20460
20711
|
const displaySize = useJsonViewerStore((store) => store.displaySize);
|
|
20461
|
-
const shouldDisplaySize = (0,
|
|
20712
|
+
const shouldDisplaySize = (0, import_react51.useMemo)(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
|
|
20462
20713
|
displaySize,
|
|
20463
20714
|
props.path,
|
|
20464
20715
|
props.value
|
|
20465
20716
|
]);
|
|
20466
20717
|
const isTrap = useIsCycleReference(props.path, props.value);
|
|
20467
|
-
return /* @__PURE__ */ (0,
|
|
20718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.Box, {
|
|
20468
20719
|
component: "span",
|
|
20469
20720
|
className: "data-object-start",
|
|
20470
20721
|
sx: {
|
|
@@ -20472,7 +20723,7 @@ var PreObjectType = (props) => {
|
|
|
20472
20723
|
},
|
|
20473
20724
|
children: [
|
|
20474
20725
|
isArrayLike ? arrayLb : objectLb,
|
|
20475
|
-
shouldDisplaySize && props.inspect && !isEmptyValue && /* @__PURE__ */ (0,
|
|
20726
|
+
shouldDisplaySize && props.inspect && !isEmptyValue && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20476
20727
|
component: "span",
|
|
20477
20728
|
sx: {
|
|
20478
20729
|
pl: 0.5,
|
|
@@ -20482,16 +20733,16 @@ var PreObjectType = (props) => {
|
|
|
20482
20733
|
},
|
|
20483
20734
|
children: sizeOfValue
|
|
20484
20735
|
}),
|
|
20485
|
-
isTrap && !props.inspect && /* @__PURE__ */ (0,
|
|
20736
|
+
isTrap && !props.inspect && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, {
|
|
20486
20737
|
children: [
|
|
20487
|
-
/* @__PURE__ */ (0,
|
|
20738
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(CircularArrowsIcon, {
|
|
20488
20739
|
sx: {
|
|
20489
20740
|
fontSize: 12,
|
|
20490
20741
|
color: textColor,
|
|
20491
20742
|
mx: 0.5
|
|
20492
20743
|
}
|
|
20493
20744
|
}),
|
|
20494
|
-
/* @__PURE__ */ (0,
|
|
20745
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
20495
20746
|
sx: {
|
|
20496
20747
|
cursor: "pointer",
|
|
20497
20748
|
userSelect: "none"
|
|
@@ -20506,22 +20757,22 @@ var PreObjectType = (props) => {
|
|
|
20506
20757
|
var PostObjectType = (props) => {
|
|
20507
20758
|
const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
|
|
20508
20759
|
const textColor = useTextColor();
|
|
20509
|
-
const isArrayLike = (0,
|
|
20760
|
+
const isArrayLike = (0, import_react51.useMemo)(() => Array.isArray(props.value) || props.value instanceof Set, [
|
|
20510
20761
|
props.value
|
|
20511
20762
|
]);
|
|
20512
|
-
const isEmptyValue = (0,
|
|
20763
|
+
const isEmptyValue = (0, import_react51.useMemo)(() => getValueSize(props.value) === 0, [
|
|
20513
20764
|
props.value
|
|
20514
20765
|
]);
|
|
20515
|
-
const sizeOfValue = (0,
|
|
20766
|
+
const sizeOfValue = (0, import_react51.useMemo)(() => inspectMetadata(props.value), [
|
|
20516
20767
|
props.value
|
|
20517
20768
|
]);
|
|
20518
20769
|
const displaySize = useJsonViewerStore((store) => store.displaySize);
|
|
20519
|
-
const shouldDisplaySize = (0,
|
|
20770
|
+
const shouldDisplaySize = (0, import_react51.useMemo)(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
|
|
20520
20771
|
displaySize,
|
|
20521
20772
|
props.path,
|
|
20522
20773
|
props.value
|
|
20523
20774
|
]);
|
|
20524
|
-
return /* @__PURE__ */ (0,
|
|
20775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.Box, {
|
|
20525
20776
|
component: "span",
|
|
20526
20777
|
className: "data-object-end",
|
|
20527
20778
|
sx: {
|
|
@@ -20532,7 +20783,7 @@ var PostObjectType = (props) => {
|
|
|
20532
20783
|
},
|
|
20533
20784
|
children: [
|
|
20534
20785
|
isArrayLike ? arrayRb : objectRb,
|
|
20535
|
-
shouldDisplaySize && (isEmptyValue || !props.inspect) ? /* @__PURE__ */ (0,
|
|
20786
|
+
shouldDisplaySize && (isEmptyValue || !props.inspect) ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20536
20787
|
component: "span",
|
|
20537
20788
|
sx: {
|
|
20538
20789
|
pl: 0.5,
|
|
@@ -20553,9 +20804,9 @@ var ObjectType = (props) => {
|
|
|
20553
20804
|
const borderColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
20554
20805
|
const groupArraysAfterLength = useJsonViewerStore((store) => store.groupArraysAfterLength);
|
|
20555
20806
|
const isTrap = useIsCycleReference(props.path, props.value);
|
|
20556
|
-
const [displayLength, setDisplayLength] = (0,
|
|
20807
|
+
const [displayLength, setDisplayLength] = (0, import_react51.useState)(useJsonViewerStore((store) => store.maxDisplayLength));
|
|
20557
20808
|
const objectSortKeys = useJsonViewerStore((store) => store.objectSortKeys);
|
|
20558
|
-
const elements = (0,
|
|
20809
|
+
const elements = (0, import_react51.useMemo)(() => {
|
|
20559
20810
|
if (!props.inspect) {
|
|
20560
20811
|
return null;
|
|
20561
20812
|
}
|
|
@@ -20572,7 +20823,7 @@ var ObjectType = (props) => {
|
|
|
20572
20823
|
...props.path,
|
|
20573
20824
|
key
|
|
20574
20825
|
];
|
|
20575
|
-
elements3.push(/* @__PURE__ */ (0,
|
|
20826
|
+
elements3.push(/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
20576
20827
|
path,
|
|
20577
20828
|
value: value2,
|
|
20578
20829
|
prevValue: props.prevValue instanceof Map ? props.prevValue.get(k2) : void 0,
|
|
@@ -20588,7 +20839,7 @@ var ObjectType = (props) => {
|
|
|
20588
20839
|
while (true) {
|
|
20589
20840
|
const nextResult = iterator2.next();
|
|
20590
20841
|
var _nextResult_done;
|
|
20591
|
-
elements3.push(/* @__PURE__ */ (0,
|
|
20842
|
+
elements3.push(/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
20592
20843
|
path: [
|
|
20593
20844
|
...props.path,
|
|
20594
20845
|
"iterator:".concat(count2)
|
|
@@ -20616,7 +20867,7 @@ var ObjectType = (props) => {
|
|
|
20616
20867
|
...props.path,
|
|
20617
20868
|
index
|
|
20618
20869
|
];
|
|
20619
|
-
return /* @__PURE__ */ (0,
|
|
20870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
20620
20871
|
path,
|
|
20621
20872
|
value: value2,
|
|
20622
20873
|
prevValue: Array.isArray(props.prevValue) ? props.prevValue[index] : void 0,
|
|
@@ -20625,7 +20876,7 @@ var ObjectType = (props) => {
|
|
|
20625
20876
|
});
|
|
20626
20877
|
if (value.length > displayLength) {
|
|
20627
20878
|
const rest = value.length - displayLength;
|
|
20628
|
-
elements4.push(/* @__PURE__ */ (0,
|
|
20879
|
+
elements4.push(/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(DataBox, {
|
|
20629
20880
|
sx: {
|
|
20630
20881
|
cursor: "pointer",
|
|
20631
20882
|
lineHeight: 1.5,
|
|
@@ -20648,7 +20899,7 @@ var ObjectType = (props) => {
|
|
|
20648
20899
|
const prevElements = Array.isArray(props.prevValue) ? segmentArray(props.prevValue, groupArraysAfterLength) : void 0;
|
|
20649
20900
|
const elementsLastIndex = elements3.length - 1;
|
|
20650
20901
|
return elements3.map((list, index) => {
|
|
20651
|
-
return /* @__PURE__ */ (0,
|
|
20902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
20652
20903
|
path: props.path,
|
|
20653
20904
|
value: list,
|
|
20654
20905
|
nestedIndex: index,
|
|
@@ -20675,7 +20926,7 @@ var ObjectType = (props) => {
|
|
|
20675
20926
|
...props.path,
|
|
20676
20927
|
key
|
|
20677
20928
|
];
|
|
20678
|
-
return /* @__PURE__ */ (0,
|
|
20929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
20679
20930
|
path,
|
|
20680
20931
|
value: value2,
|
|
20681
20932
|
prevValue: (_props_prevValue = props.prevValue) === null || _props_prevValue === void 0 ? void 0 : _props_prevValue[key],
|
|
@@ -20684,7 +20935,7 @@ var ObjectType = (props) => {
|
|
|
20684
20935
|
});
|
|
20685
20936
|
if (entries.length > displayLength) {
|
|
20686
20937
|
const rest = entries.length - displayLength;
|
|
20687
|
-
elements2.push(/* @__PURE__ */ (0,
|
|
20938
|
+
elements2.push(/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(DataBox, {
|
|
20688
20939
|
sx: {
|
|
20689
20940
|
cursor: "pointer",
|
|
20690
20941
|
lineHeight: 1.5,
|
|
@@ -20716,13 +20967,13 @@ var ObjectType = (props) => {
|
|
|
20716
20967
|
const marginLeft = props.inspect ? 0.6 : 0;
|
|
20717
20968
|
const width = useJsonViewerStore((store) => store.indentWidth);
|
|
20718
20969
|
const indentWidth = props.inspect ? width - marginLeft : width;
|
|
20719
|
-
const isEmptyValue = (0,
|
|
20970
|
+
const isEmptyValue = (0, import_react51.useMemo)(() => getValueSize(props.value) === 0, [
|
|
20720
20971
|
props.value
|
|
20721
20972
|
]);
|
|
20722
20973
|
if (isEmptyValue) {
|
|
20723
20974
|
return null;
|
|
20724
20975
|
}
|
|
20725
|
-
return /* @__PURE__ */ (0,
|
|
20976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20726
20977
|
className: "data-object",
|
|
20727
20978
|
sx: {
|
|
20728
20979
|
display: props.inspect ? "block" : "inline-block",
|
|
@@ -20731,7 +20982,7 @@ var ObjectType = (props) => {
|
|
|
20731
20982
|
color: keyColor,
|
|
20732
20983
|
borderLeft: props.inspect ? "1px solid ".concat(borderColor) : "none"
|
|
20733
20984
|
},
|
|
20734
|
-
children: props.inspect ? elements : !isTrap && /* @__PURE__ */ (0,
|
|
20985
|
+
children: props.inspect ? elements : !isTrap && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20735
20986
|
component: "span",
|
|
20736
20987
|
className: "data-object-body",
|
|
20737
20988
|
onClick: () => props.setInspect(true),
|
|
@@ -20759,11 +21010,11 @@ var stringType = defineEasyType({
|
|
|
20759
21010
|
serialize: (value) => value,
|
|
20760
21011
|
deserialize: (value) => value,
|
|
20761
21012
|
Renderer: (props) => {
|
|
20762
|
-
const [showRest, setShowRest] = (0,
|
|
21013
|
+
const [showRest, setShowRest] = (0, import_react51.useState)(false);
|
|
20763
21014
|
const collapseStringsAfterLength = useJsonViewerStore((store) => store.collapseStringsAfterLength);
|
|
20764
21015
|
const value = showRest ? props.value : props.value.slice(0, collapseStringsAfterLength);
|
|
20765
21016
|
const hasRest = props.value.length > collapseStringsAfterLength;
|
|
20766
|
-
return /* @__PURE__ */ (0,
|
|
21017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.Box, {
|
|
20767
21018
|
component: "span",
|
|
20768
21019
|
sx: {
|
|
20769
21020
|
overflowWrap: "anywhere",
|
|
@@ -20781,7 +21032,7 @@ var stringType = defineEasyType({
|
|
|
20781
21032
|
children: [
|
|
20782
21033
|
'"',
|
|
20783
21034
|
value,
|
|
20784
|
-
hasRest && !showRest && /* @__PURE__ */ (0,
|
|
21035
|
+
hasRest && !showRest && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20785
21036
|
component: "span",
|
|
20786
21037
|
sx: {
|
|
20787
21038
|
padding: 0.5
|
|
@@ -20800,7 +21051,7 @@ var undefinedType = defineEasyType({
|
|
|
20800
21051
|
displayTypeLabel: false,
|
|
20801
21052
|
Renderer: () => {
|
|
20802
21053
|
const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
20803
|
-
return /* @__PURE__ */ (0,
|
|
21054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20804
21055
|
sx: {
|
|
20805
21056
|
fontSize: "0.7rem",
|
|
20806
21057
|
backgroundColor,
|
|
@@ -20816,17 +21067,17 @@ function memorizeDataType(dataType) {
|
|
|
20816
21067
|
var _prevProps_path, _nextProps_path;
|
|
20817
21068
|
return Object.is(prevProps.value, nextProps.value) && prevProps.inspect && nextProps.inspect && ((_prevProps_path = prevProps.path) === null || _prevProps_path === void 0 ? void 0 : _prevProps_path.join(".")) === ((_nextProps_path = nextProps.path) === null || _nextProps_path === void 0 ? void 0 : _nextProps_path.join("."));
|
|
20818
21069
|
}
|
|
20819
|
-
dataType.Component = /* @__PURE__ */ (0,
|
|
21070
|
+
dataType.Component = /* @__PURE__ */ (0, import_react51.memo)(dataType.Component, compare);
|
|
20820
21071
|
if (dataType.Editor) {
|
|
20821
|
-
dataType.Editor = /* @__PURE__ */ (0,
|
|
21072
|
+
dataType.Editor = /* @__PURE__ */ (0, import_react51.memo)(dataType.Editor, function compare2(prevProps, nextProps) {
|
|
20822
21073
|
return Object.is(prevProps.value, nextProps.value);
|
|
20823
21074
|
});
|
|
20824
21075
|
}
|
|
20825
21076
|
if (dataType.PreComponent) {
|
|
20826
|
-
dataType.PreComponent = /* @__PURE__ */ (0,
|
|
21077
|
+
dataType.PreComponent = /* @__PURE__ */ (0, import_react51.memo)(dataType.PreComponent, compare);
|
|
20827
21078
|
}
|
|
20828
21079
|
if (dataType.PostComponent) {
|
|
20829
|
-
dataType.PostComponent = /* @__PURE__ */ (0,
|
|
21080
|
+
dataType.PostComponent = /* @__PURE__ */ (0, import_react51.memo)(dataType.PostComponent, compare);
|
|
20830
21081
|
}
|
|
20831
21082
|
return dataType;
|
|
20832
21083
|
}
|
|
@@ -20852,10 +21103,10 @@ var createTypeRegistryStore = () => {
|
|
|
20852
21103
|
}
|
|
20853
21104
|
}));
|
|
20854
21105
|
};
|
|
20855
|
-
var TypeRegistryStoreContext = /* @__PURE__ */ (0,
|
|
21106
|
+
var TypeRegistryStoreContext = /* @__PURE__ */ (0, import_react51.createContext)(void 0);
|
|
20856
21107
|
TypeRegistryStoreContext.Provider;
|
|
20857
21108
|
var useTypeRegistryStore = (selector2, equalityFn) => {
|
|
20858
|
-
const store = (0,
|
|
21109
|
+
const store = (0, import_react51.useContext)(TypeRegistryStoreContext);
|
|
20859
21110
|
return (0, import_zustand.useStore)(store, selector2, equalityFn);
|
|
20860
21111
|
};
|
|
20861
21112
|
function matchTypeComponents(value, path, registry) {
|
|
@@ -20875,13 +21126,13 @@ function matchTypeComponents(value, path, registry) {
|
|
|
20875
21126
|
}
|
|
20876
21127
|
function useTypeComponents(value, path) {
|
|
20877
21128
|
const registry = useTypeRegistryStore((store) => store.registry);
|
|
20878
|
-
return (0,
|
|
21129
|
+
return (0, import_react51.useMemo)(() => matchTypeComponents(value, path, registry), [
|
|
20879
21130
|
value,
|
|
20880
21131
|
path,
|
|
20881
21132
|
registry
|
|
20882
21133
|
]);
|
|
20883
21134
|
}
|
|
20884
|
-
var IconBox = (props) => /* @__PURE__ */ (0,
|
|
21135
|
+
var IconBox = (props) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20885
21136
|
component: "span",
|
|
20886
21137
|
...props,
|
|
20887
21138
|
sx: {
|
|
@@ -20896,7 +21147,7 @@ var DataKeyPair = (props) => {
|
|
|
20896
21147
|
var _props_editable;
|
|
20897
21148
|
const propsEditable = (_props_editable = props.editable) !== null && _props_editable !== void 0 ? _props_editable : void 0;
|
|
20898
21149
|
const storeEditable = useJsonViewerStore((store) => store.editable);
|
|
20899
|
-
const editable = (0,
|
|
21150
|
+
const editable = (0, import_react51.useMemo)(() => {
|
|
20900
21151
|
if (storeEditable === false) {
|
|
20901
21152
|
return false;
|
|
20902
21153
|
}
|
|
@@ -20913,11 +21164,11 @@ var DataKeyPair = (props) => {
|
|
|
20913
21164
|
storeEditable,
|
|
20914
21165
|
value
|
|
20915
21166
|
]);
|
|
20916
|
-
const [tempValue, setTempValue] = (0,
|
|
21167
|
+
const [tempValue, setTempValue] = (0, import_react51.useState)("");
|
|
20917
21168
|
const depth = path.length;
|
|
20918
21169
|
const key = path[depth - 1];
|
|
20919
21170
|
const hoverPath = useJsonViewerStore((store) => store.hoverPath);
|
|
20920
|
-
const isHover = (0,
|
|
21171
|
+
const isHover = (0, import_react51.useMemo)(() => {
|
|
20921
21172
|
return hoverPath && path.every((value2, index) => value2 === hoverPath.path[index] && nestedIndex === hoverPath.nestedIndex);
|
|
20922
21173
|
}, [
|
|
20923
21174
|
hoverPath,
|
|
@@ -20927,7 +21178,7 @@ var DataKeyPair = (props) => {
|
|
|
20927
21178
|
const setHover = useJsonViewerStore((store) => store.setHover);
|
|
20928
21179
|
const root2 = useJsonViewerStore((store) => store.value);
|
|
20929
21180
|
const [inspect, setInspect] = useInspect(path, value, nestedIndex);
|
|
20930
|
-
const [editing, setEditing] = (0,
|
|
21181
|
+
const [editing, setEditing] = (0, import_react51.useState)(false);
|
|
20931
21182
|
const onChange = useJsonViewerStore((store) => store.onChange);
|
|
20932
21183
|
const keyColor = useTextColor();
|
|
20933
21184
|
const numberKeyColor = useJsonViewerStore((store) => store.colorspace.base0C);
|
|
@@ -20939,7 +21190,7 @@ var DataKeyPair = (props) => {
|
|
|
20939
21190
|
const isNumberKey = Number.isInteger(Number(key));
|
|
20940
21191
|
const storeEnableAdd = useJsonViewerStore((store) => store.enableAdd);
|
|
20941
21192
|
const onAdd = useJsonViewerStore((store) => store.onAdd);
|
|
20942
|
-
const enableAdd = (0,
|
|
21193
|
+
const enableAdd = (0, import_react51.useMemo)(() => {
|
|
20943
21194
|
if (!onAdd || nestedIndex !== void 0) return false;
|
|
20944
21195
|
if (storeEnableAdd === false) {
|
|
20945
21196
|
return false;
|
|
@@ -20964,7 +21215,7 @@ var DataKeyPair = (props) => {
|
|
|
20964
21215
|
]);
|
|
20965
21216
|
const storeEnableDelete = useJsonViewerStore((store) => store.enableDelete);
|
|
20966
21217
|
const onDelete = useJsonViewerStore((store) => store.onDelete);
|
|
20967
|
-
const enableDelete = (0,
|
|
21218
|
+
const enableDelete = (0, import_react51.useMemo)(() => {
|
|
20968
21219
|
if (!onDelete || nestedIndex !== void 0) return false;
|
|
20969
21220
|
if (isRoot) {
|
|
20970
21221
|
return false;
|
|
@@ -20991,7 +21242,7 @@ var DataKeyPair = (props) => {
|
|
|
20991
21242
|
const enableClipboard = useJsonViewerStore((store) => store.enableClipboard);
|
|
20992
21243
|
const { copy, copied } = useClipboard();
|
|
20993
21244
|
const highlightUpdates = useJsonViewerStore((store) => store.highlightUpdates);
|
|
20994
|
-
const isHighlight = (0,
|
|
21245
|
+
const isHighlight = (0, import_react51.useMemo)(() => {
|
|
20995
21246
|
if (!highlightUpdates || prevValue === void 0) return false;
|
|
20996
21247
|
if (typeof value !== typeof prevValue) {
|
|
20997
21248
|
return true;
|
|
@@ -21015,8 +21266,8 @@ var DataKeyPair = (props) => {
|
|
|
21015
21266
|
prevValue,
|
|
21016
21267
|
value
|
|
21017
21268
|
]);
|
|
21018
|
-
const highlightContainer = (0,
|
|
21019
|
-
(0,
|
|
21269
|
+
const highlightContainer = (0, import_react51.useRef)();
|
|
21270
|
+
(0, import_react51.useEffect)(() => {
|
|
21020
21271
|
if (highlightContainer.current && isHighlight && "animate" in highlightContainer.current) {
|
|
21021
21272
|
highlightContainer.current.animate([
|
|
21022
21273
|
{
|
|
@@ -21036,7 +21287,7 @@ var DataKeyPair = (props) => {
|
|
|
21036
21287
|
prevValue,
|
|
21037
21288
|
value
|
|
21038
21289
|
]);
|
|
21039
|
-
const startEditing = (0,
|
|
21290
|
+
const startEditing = (0, import_react51.useCallback)((event) => {
|
|
21040
21291
|
event.preventDefault();
|
|
21041
21292
|
if (serialize) setTempValue(serialize(value));
|
|
21042
21293
|
setEditing(true);
|
|
@@ -21044,14 +21295,14 @@ var DataKeyPair = (props) => {
|
|
|
21044
21295
|
serialize,
|
|
21045
21296
|
value
|
|
21046
21297
|
]);
|
|
21047
|
-
const abortEditing = (0,
|
|
21298
|
+
const abortEditing = (0, import_react51.useCallback)(() => {
|
|
21048
21299
|
setEditing(false);
|
|
21049
21300
|
setTempValue("");
|
|
21050
21301
|
}, [
|
|
21051
21302
|
setEditing,
|
|
21052
21303
|
setTempValue
|
|
21053
21304
|
]);
|
|
21054
|
-
const commitEditing = (0,
|
|
21305
|
+
const commitEditing = (0, import_react51.useCallback)((newValue) => {
|
|
21055
21306
|
setEditing(false);
|
|
21056
21307
|
if (!deserialize) return;
|
|
21057
21308
|
try {
|
|
@@ -21065,20 +21316,20 @@ var DataKeyPair = (props) => {
|
|
|
21065
21316
|
path,
|
|
21066
21317
|
value
|
|
21067
21318
|
]);
|
|
21068
|
-
const actionIcons = (0,
|
|
21319
|
+
const actionIcons = (0, import_react51.useMemo)(() => {
|
|
21069
21320
|
if (editing) {
|
|
21070
|
-
return /* @__PURE__ */ (0,
|
|
21321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, {
|
|
21071
21322
|
children: [
|
|
21072
|
-
/* @__PURE__ */ (0,
|
|
21073
|
-
children: /* @__PURE__ */ (0,
|
|
21323
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21324
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(CloseIcon, {
|
|
21074
21325
|
sx: {
|
|
21075
21326
|
fontSize: ".8rem"
|
|
21076
21327
|
},
|
|
21077
21328
|
onClick: abortEditing
|
|
21078
21329
|
})
|
|
21079
21330
|
}),
|
|
21080
|
-
/* @__PURE__ */ (0,
|
|
21081
|
-
children: /* @__PURE__ */ (0,
|
|
21331
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21332
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(CheckIcon, {
|
|
21082
21333
|
sx: {
|
|
21083
21334
|
fontSize: ".8rem"
|
|
21084
21335
|
},
|
|
@@ -21088,9 +21339,9 @@ var DataKeyPair = (props) => {
|
|
|
21088
21339
|
]
|
|
21089
21340
|
});
|
|
21090
21341
|
}
|
|
21091
|
-
return /* @__PURE__ */ (0,
|
|
21342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, {
|
|
21092
21343
|
children: [
|
|
21093
|
-
enableClipboard && /* @__PURE__ */ (0,
|
|
21344
|
+
enableClipboard && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21094
21345
|
onClick: (event) => {
|
|
21095
21346
|
event.preventDefault();
|
|
21096
21347
|
try {
|
|
@@ -21099,41 +21350,41 @@ var DataKeyPair = (props) => {
|
|
|
21099
21350
|
console.error(e2);
|
|
21100
21351
|
}
|
|
21101
21352
|
},
|
|
21102
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
21353
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(CheckIcon, {
|
|
21103
21354
|
sx: {
|
|
21104
21355
|
fontSize: ".8rem"
|
|
21105
21356
|
}
|
|
21106
|
-
}) : /* @__PURE__ */ (0,
|
|
21357
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ContentCopyIcon, {
|
|
21107
21358
|
sx: {
|
|
21108
21359
|
fontSize: ".8rem"
|
|
21109
21360
|
}
|
|
21110
21361
|
})
|
|
21111
21362
|
}),
|
|
21112
|
-
Editor && editable && serialize && deserialize && /* @__PURE__ */ (0,
|
|
21363
|
+
Editor && editable && serialize && deserialize && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21113
21364
|
onClick: startEditing,
|
|
21114
|
-
children: /* @__PURE__ */ (0,
|
|
21365
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(EditIcon, {
|
|
21115
21366
|
sx: {
|
|
21116
21367
|
fontSize: ".8rem"
|
|
21117
21368
|
}
|
|
21118
21369
|
})
|
|
21119
21370
|
}),
|
|
21120
|
-
enableAdd && /* @__PURE__ */ (0,
|
|
21371
|
+
enableAdd && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21121
21372
|
onClick: (event) => {
|
|
21122
21373
|
event.preventDefault();
|
|
21123
21374
|
onAdd === null || onAdd === void 0 ? void 0 : onAdd(path);
|
|
21124
21375
|
},
|
|
21125
|
-
children: /* @__PURE__ */ (0,
|
|
21376
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(AddBoxIcon, {
|
|
21126
21377
|
sx: {
|
|
21127
21378
|
fontSize: ".8rem"
|
|
21128
21379
|
}
|
|
21129
21380
|
})
|
|
21130
21381
|
}),
|
|
21131
|
-
enableDelete && /* @__PURE__ */ (0,
|
|
21382
|
+
enableDelete && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21132
21383
|
onClick: (event) => {
|
|
21133
21384
|
event.preventDefault();
|
|
21134
21385
|
onDelete === null || onDelete === void 0 ? void 0 : onDelete(path, value);
|
|
21135
21386
|
},
|
|
21136
|
-
children: /* @__PURE__ */ (0,
|
|
21387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DeleteIcon, {
|
|
21137
21388
|
sx: {
|
|
21138
21389
|
fontSize: ".9rem"
|
|
21139
21390
|
}
|
|
@@ -21161,12 +21412,12 @@ var DataKeyPair = (props) => {
|
|
|
21161
21412
|
abortEditing,
|
|
21162
21413
|
commitEditing
|
|
21163
21414
|
]);
|
|
21164
|
-
const isEmptyValue = (0,
|
|
21415
|
+
const isEmptyValue = (0, import_react51.useMemo)(() => getValueSize(value) === 0, [
|
|
21165
21416
|
value
|
|
21166
21417
|
]);
|
|
21167
21418
|
const expandable = !isEmptyValue && !!(PreComponent && PostComponent);
|
|
21168
21419
|
const KeyRenderer = useJsonViewerStore((store) => store.keyRenderer);
|
|
21169
|
-
const downstreamProps = (0,
|
|
21420
|
+
const downstreamProps = (0, import_react51.useMemo)(() => ({
|
|
21170
21421
|
path,
|
|
21171
21422
|
inspect,
|
|
21172
21423
|
setInspect,
|
|
@@ -21181,19 +21432,19 @@ var DataKeyPair = (props) => {
|
|
|
21181
21432
|
prevValue,
|
|
21182
21433
|
nestedIndex
|
|
21183
21434
|
]);
|
|
21184
|
-
return /* @__PURE__ */ (0,
|
|
21435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.Box, {
|
|
21185
21436
|
className: "data-key-pair",
|
|
21186
21437
|
"data-testid": "data-key-pair" + path.join("."),
|
|
21187
21438
|
sx: {
|
|
21188
21439
|
userSelect: "text"
|
|
21189
21440
|
},
|
|
21190
|
-
onMouseEnter: (0,
|
|
21441
|
+
onMouseEnter: (0, import_react51.useCallback)(() => setHover(path, nestedIndex), [
|
|
21191
21442
|
setHover,
|
|
21192
21443
|
path,
|
|
21193
21444
|
nestedIndex
|
|
21194
21445
|
]),
|
|
21195
21446
|
children: [
|
|
21196
|
-
/* @__PURE__ */ (0,
|
|
21447
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(DataBox, {
|
|
21197
21448
|
component: "span",
|
|
21198
21449
|
className: "data-key",
|
|
21199
21450
|
sx: {
|
|
@@ -21202,7 +21453,7 @@ var DataKeyPair = (props) => {
|
|
|
21202
21453
|
letterSpacing: 0.5,
|
|
21203
21454
|
opacity: 0.8
|
|
21204
21455
|
},
|
|
21205
|
-
onClick: (0,
|
|
21456
|
+
onClick: (0, import_react51.useCallback)((event) => {
|
|
21206
21457
|
if (event.isDefaultPrevented()) {
|
|
21207
21458
|
return;
|
|
21208
21459
|
}
|
|
@@ -21214,7 +21465,7 @@ var DataKeyPair = (props) => {
|
|
|
21214
21465
|
setInspect
|
|
21215
21466
|
]),
|
|
21216
21467
|
children: [
|
|
21217
|
-
expandable ? inspect ? /* @__PURE__ */ (0,
|
|
21468
|
+
expandable ? inspect ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ExpandMoreIcon, {
|
|
21218
21469
|
className: "data-key-toggle-expanded",
|
|
21219
21470
|
sx: {
|
|
21220
21471
|
fontSize: ".8rem",
|
|
@@ -21222,7 +21473,7 @@ var DataKeyPair = (props) => {
|
|
|
21222
21473
|
cursor: "pointer"
|
|
21223
21474
|
}
|
|
21224
21475
|
}
|
|
21225
|
-
}) : /* @__PURE__ */ (0,
|
|
21476
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ChevronRightIcon, {
|
|
21226
21477
|
className: "data-key-toggle-collapsed",
|
|
21227
21478
|
sx: {
|
|
21228
21479
|
fontSize: ".8rem",
|
|
@@ -21231,44 +21482,44 @@ var DataKeyPair = (props) => {
|
|
|
21231
21482
|
}
|
|
21232
21483
|
}
|
|
21233
21484
|
}) : null,
|
|
21234
|
-
/* @__PURE__ */ (0,
|
|
21485
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
21235
21486
|
ref: highlightContainer,
|
|
21236
21487
|
className: "data-key-key",
|
|
21237
21488
|
component: "span",
|
|
21238
|
-
children: isRoot && depth === 0 ? rootName !== false ? quotesOnKeys ? /* @__PURE__ */ (0,
|
|
21489
|
+
children: isRoot && depth === 0 ? rootName !== false ? quotesOnKeys ? /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, {
|
|
21239
21490
|
children: [
|
|
21240
21491
|
'"',
|
|
21241
21492
|
rootName,
|
|
21242
21493
|
'"'
|
|
21243
21494
|
]
|
|
21244
|
-
}) : /* @__PURE__ */ (0,
|
|
21495
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
21245
21496
|
children: rootName
|
|
21246
|
-
}) : null : KeyRenderer.when(downstreamProps) ? /* @__PURE__ */ (0,
|
|
21497
|
+
}) : null : KeyRenderer.when(downstreamProps) ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(KeyRenderer, {
|
|
21247
21498
|
...downstreamProps
|
|
21248
|
-
}) : nestedIndex === void 0 && (isNumberKey ? /* @__PURE__ */ (0,
|
|
21499
|
+
}) : nestedIndex === void 0 && (isNumberKey ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
21249
21500
|
component: "span",
|
|
21250
21501
|
style: {
|
|
21251
21502
|
color: numberKeyColor,
|
|
21252
21503
|
userSelect: isNumberKey ? "none" : "auto"
|
|
21253
21504
|
},
|
|
21254
21505
|
children: key
|
|
21255
|
-
}) : quotesOnKeys ? /* @__PURE__ */ (0,
|
|
21506
|
+
}) : quotesOnKeys ? /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, {
|
|
21256
21507
|
children: [
|
|
21257
21508
|
'"',
|
|
21258
21509
|
key,
|
|
21259
21510
|
'"'
|
|
21260
21511
|
]
|
|
21261
|
-
}) : /* @__PURE__ */ (0,
|
|
21512
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
21262
21513
|
children: key
|
|
21263
21514
|
}))
|
|
21264
21515
|
}),
|
|
21265
|
-
isRoot ? rootName !== false && /* @__PURE__ */ (0,
|
|
21516
|
+
isRoot ? rootName !== false && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
21266
21517
|
className: "data-key-colon",
|
|
21267
21518
|
sx: {
|
|
21268
21519
|
mr: 0.5
|
|
21269
21520
|
},
|
|
21270
21521
|
children: ":"
|
|
21271
|
-
}) : nestedIndex === void 0 && /* @__PURE__ */ (0,
|
|
21522
|
+
}) : nestedIndex === void 0 && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
21272
21523
|
className: "data-key-colon",
|
|
21273
21524
|
sx: {
|
|
21274
21525
|
mr: 0.5,
|
|
@@ -21279,29 +21530,29 @@ var DataKeyPair = (props) => {
|
|
|
21279
21530
|
},
|
|
21280
21531
|
children: ":"
|
|
21281
21532
|
}),
|
|
21282
|
-
PreComponent && /* @__PURE__ */ (0,
|
|
21533
|
+
PreComponent && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(PreComponent, {
|
|
21283
21534
|
...downstreamProps
|
|
21284
21535
|
}),
|
|
21285
21536
|
isHover && expandable && inspect && actionIcons
|
|
21286
21537
|
]
|
|
21287
21538
|
}),
|
|
21288
|
-
editing && editable ? Editor && /* @__PURE__ */ (0,
|
|
21539
|
+
editing && editable ? Editor && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(Editor, {
|
|
21289
21540
|
path,
|
|
21290
21541
|
value: tempValue,
|
|
21291
21542
|
setValue: setTempValue,
|
|
21292
21543
|
abortEditing,
|
|
21293
21544
|
commitEditing
|
|
21294
|
-
}) : Component ? /* @__PURE__ */ (0,
|
|
21545
|
+
}) : Component ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(Component, {
|
|
21295
21546
|
...downstreamProps
|
|
21296
|
-
}) : /* @__PURE__ */ (0,
|
|
21547
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
21297
21548
|
component: "span",
|
|
21298
21549
|
className: "data-value-fallback",
|
|
21299
21550
|
children: "fallback: ".concat(value)
|
|
21300
21551
|
}),
|
|
21301
|
-
PostComponent && /* @__PURE__ */ (0,
|
|
21552
|
+
PostComponent && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(PostComponent, {
|
|
21302
21553
|
...downstreamProps
|
|
21303
21554
|
}),
|
|
21304
|
-
!last && displayComma && /* @__PURE__ */ (0,
|
|
21555
|
+
!last && displayComma && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
21305
21556
|
children: ","
|
|
21306
21557
|
}),
|
|
21307
21558
|
isHover && expandable && !inspect && actionIcons,
|
|
@@ -21312,8 +21563,8 @@ var DataKeyPair = (props) => {
|
|
|
21312
21563
|
};
|
|
21313
21564
|
var query = "(prefers-color-scheme: dark)";
|
|
21314
21565
|
function useThemeDetector() {
|
|
21315
|
-
const [isDark, setIsDark] = (0,
|
|
21316
|
-
(0,
|
|
21566
|
+
const [isDark, setIsDark] = (0, import_react51.useState)(false);
|
|
21567
|
+
(0, import_react51.useEffect)(() => {
|
|
21317
21568
|
const listener = (e2) => setIsDark(e2.matches);
|
|
21318
21569
|
setIsDark(window.matchMedia(query).matches);
|
|
21319
21570
|
const queryMedia = window.matchMedia(query);
|
|
@@ -21323,8 +21574,8 @@ function useThemeDetector() {
|
|
|
21323
21574
|
return isDark;
|
|
21324
21575
|
}
|
|
21325
21576
|
function useSetIfNotUndefinedEffect(key, value) {
|
|
21326
|
-
const { setState } = (0,
|
|
21327
|
-
(0,
|
|
21577
|
+
const { setState } = (0, import_react51.useContext)(JsonViewerStoreContext);
|
|
21578
|
+
(0, import_react51.useEffect)(() => {
|
|
21328
21579
|
if (value !== void 0) {
|
|
21329
21580
|
setState({
|
|
21330
21581
|
[key]: value
|
|
@@ -21337,8 +21588,8 @@ function useSetIfNotUndefinedEffect(key, value) {
|
|
|
21337
21588
|
]);
|
|
21338
21589
|
}
|
|
21339
21590
|
var JsonViewerInner = (props) => {
|
|
21340
|
-
const { setState } = (0,
|
|
21341
|
-
(0,
|
|
21591
|
+
const { setState } = (0, import_react51.useContext)(JsonViewerStoreContext);
|
|
21592
|
+
(0, import_react51.useEffect)(() => {
|
|
21342
21593
|
setState((state) => ({
|
|
21343
21594
|
prevValue: state.value,
|
|
21344
21595
|
value: props.value
|
|
@@ -21366,7 +21617,7 @@ var JsonViewerInner = (props) => {
|
|
|
21366
21617
|
useSetIfNotUndefinedEffect("displaySize", props.displaySize);
|
|
21367
21618
|
useSetIfNotUndefinedEffect("displayComma", props.displayComma);
|
|
21368
21619
|
useSetIfNotUndefinedEffect("highlightUpdates", props.highlightUpdates);
|
|
21369
|
-
(0,
|
|
21620
|
+
(0, import_react51.useEffect)(() => {
|
|
21370
21621
|
if (props.theme === "light") {
|
|
21371
21622
|
setState({
|
|
21372
21623
|
colorspace: lightColorspace
|
|
@@ -21384,13 +21635,13 @@ var JsonViewerInner = (props) => {
|
|
|
21384
21635
|
setState,
|
|
21385
21636
|
props.theme
|
|
21386
21637
|
]);
|
|
21387
|
-
const themeCls = (0,
|
|
21638
|
+
const themeCls = (0, import_react51.useMemo)(() => {
|
|
21388
21639
|
if (typeof props.theme === "object") return "json-viewer-theme-custom";
|
|
21389
21640
|
return props.theme === "dark" ? "json-viewer-theme-dark" : "json-viewer-theme-light";
|
|
21390
21641
|
}, [
|
|
21391
21642
|
props.theme
|
|
21392
21643
|
]);
|
|
21393
|
-
const onceRef = (0,
|
|
21644
|
+
const onceRef = (0, import_react51.useRef)(true);
|
|
21394
21645
|
const registerTypes = useTypeRegistryStore((store) => store.registerTypes);
|
|
21395
21646
|
if (onceRef.current) {
|
|
21396
21647
|
const allTypes = props.valueTypes ? [
|
|
@@ -21402,7 +21653,7 @@ var JsonViewerInner = (props) => {
|
|
|
21402
21653
|
registerTypes(allTypes);
|
|
21403
21654
|
onceRef.current = false;
|
|
21404
21655
|
}
|
|
21405
|
-
(0,
|
|
21656
|
+
(0, import_react51.useEffect)(() => {
|
|
21406
21657
|
const allTypes = props.valueTypes ? [
|
|
21407
21658
|
...predefinedTypes,
|
|
21408
21659
|
...props.valueTypes
|
|
@@ -21416,12 +21667,12 @@ var JsonViewerInner = (props) => {
|
|
|
21416
21667
|
]);
|
|
21417
21668
|
const value = useJsonViewerStore((store) => store.value);
|
|
21418
21669
|
const prevValue = useJsonViewerStore((store) => store.prevValue);
|
|
21419
|
-
const emptyPath = (0,
|
|
21670
|
+
const emptyPath = (0, import_react51.useMemo)(() => [], []);
|
|
21420
21671
|
const setHover = useJsonViewerStore((store) => store.setHover);
|
|
21421
|
-
const onMouseLeave = (0,
|
|
21672
|
+
const onMouseLeave = (0, import_react51.useCallback)(() => setHover(null), [
|
|
21422
21673
|
setHover
|
|
21423
21674
|
]);
|
|
21424
|
-
return /* @__PURE__ */ (0,
|
|
21675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Paper, {
|
|
21425
21676
|
elevation: 0,
|
|
21426
21677
|
className: clsx(themeCls, props.className),
|
|
21427
21678
|
style: props.style,
|
|
@@ -21432,7 +21683,7 @@ var JsonViewerInner = (props) => {
|
|
|
21432
21683
|
...props.sx
|
|
21433
21684
|
},
|
|
21434
21685
|
onMouseLeave,
|
|
21435
|
-
children: /* @__PURE__ */ (0,
|
|
21686
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
21436
21687
|
value,
|
|
21437
21688
|
prevValue,
|
|
21438
21689
|
path: emptyPath,
|
|
@@ -21447,17 +21698,17 @@ var JsonViewer = function JsonViewer2(props) {
|
|
|
21447
21698
|
}
|
|
21448
21699
|
}
|
|
21449
21700
|
const isAutoDarkTheme = useThemeDetector();
|
|
21450
|
-
const themeType = (0,
|
|
21701
|
+
const themeType = (0, import_react51.useMemo)(() => {
|
|
21451
21702
|
var _props_theme;
|
|
21452
21703
|
return props.theme === "auto" ? isAutoDarkTheme ? "dark" : "light" : (_props_theme = props.theme) !== null && _props_theme !== void 0 ? _props_theme : "light";
|
|
21453
21704
|
}, [
|
|
21454
21705
|
isAutoDarkTheme,
|
|
21455
21706
|
props.theme
|
|
21456
21707
|
]);
|
|
21457
|
-
const theme = (0,
|
|
21708
|
+
const theme = (0, import_react51.useMemo)(() => {
|
|
21458
21709
|
const backgroundColor = typeof themeType === "object" ? themeType.base00 : themeType === "dark" ? darkColorspace.base00 : lightColorspace.base00;
|
|
21459
21710
|
const foregroundColor = typeof themeType === "object" ? themeType.base07 : themeType === "dark" ? darkColorspace.base07 : lightColorspace.base07;
|
|
21460
|
-
return (0,
|
|
21711
|
+
return (0, import_material15.createTheme)({
|
|
21461
21712
|
components: {
|
|
21462
21713
|
MuiPaper: {
|
|
21463
21714
|
styleOverrides: {
|
|
@@ -21482,15 +21733,15 @@ var JsonViewer = function JsonViewer2(props) {
|
|
|
21482
21733
|
...props,
|
|
21483
21734
|
theme: themeType
|
|
21484
21735
|
};
|
|
21485
|
-
const jsonViewerStore = (0,
|
|
21486
|
-
const typeRegistryStore = (0,
|
|
21487
|
-
return /* @__PURE__ */ (0,
|
|
21736
|
+
const jsonViewerStore = (0, import_react51.useMemo)(() => createJsonViewerStore(props), []);
|
|
21737
|
+
const typeRegistryStore = (0, import_react51.useMemo)(() => createTypeRegistryStore(), []);
|
|
21738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.ThemeProvider, {
|
|
21488
21739
|
theme,
|
|
21489
|
-
children: /* @__PURE__ */ (0,
|
|
21740
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(TypeRegistryStoreContext.Provider, {
|
|
21490
21741
|
value: typeRegistryStore,
|
|
21491
|
-
children: /* @__PURE__ */ (0,
|
|
21742
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(JsonViewerStoreContext.Provider, {
|
|
21492
21743
|
value: jsonViewerStore,
|
|
21493
|
-
children: /* @__PURE__ */ (0,
|
|
21744
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(JsonViewerInner, {
|
|
21494
21745
|
...mixedProps
|
|
21495
21746
|
})
|
|
21496
21747
|
})
|
|
@@ -21499,8 +21750,8 @@ var JsonViewer = function JsonViewer2(props) {
|
|
|
21499
21750
|
};
|
|
21500
21751
|
|
|
21501
21752
|
// src/components/event-details/payload-viewer.tsx
|
|
21502
|
-
var
|
|
21503
|
-
var
|
|
21753
|
+
var import_react52 = require("react");
|
|
21754
|
+
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
21504
21755
|
function tryParseJson(value) {
|
|
21505
21756
|
if (typeof value !== "string") {
|
|
21506
21757
|
return value;
|
|
@@ -21511,9 +21762,9 @@ function tryParseJson(value) {
|
|
|
21511
21762
|
return value;
|
|
21512
21763
|
}
|
|
21513
21764
|
}
|
|
21514
|
-
var PayloadViewer = (0,
|
|
21515
|
-
const theme = (0,
|
|
21516
|
-
return /* @__PURE__ */ (0,
|
|
21765
|
+
var PayloadViewer = (0, import_react52.memo)(({ sx, testId, value }) => {
|
|
21766
|
+
const theme = (0, import_material16.useTheme)();
|
|
21767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material16.Box, { "data-testid": testId, sx: { backgroundColor: "background.default", borderRadius: 1, fontSize: 12, overflow: "auto", p: 1, ...sx }, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
21517
21768
|
JsonViewer,
|
|
21518
21769
|
{
|
|
21519
21770
|
displayDataTypes: false,
|
|
@@ -21527,21 +21778,21 @@ var PayloadViewer = (0, import_react51.memo)(({ sx, testId, value }) => {
|
|
|
21527
21778
|
});
|
|
21528
21779
|
|
|
21529
21780
|
// src/components/event-details/event-detail.tsx
|
|
21530
|
-
var
|
|
21531
|
-
var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0,
|
|
21532
|
-
/* @__PURE__ */ (0,
|
|
21533
|
-
/* @__PURE__ */ (0,
|
|
21781
|
+
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
21782
|
+
var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(import_material17.Box, { sx: { display: "grid", gap: 1, gridTemplateColumns: "72px 1fr", mb: 0.5 }, children: [
|
|
21783
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_material17.Typography, { color: "text.secondary", sx: { fontWeight: 600 }, variant: "caption", children: label }),
|
|
21784
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_material17.Box, { children: typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_material17.Typography, { sx: { color: "text.primary", whiteSpace: "pre-wrap" }, variant: "caption", children: content }) : content })
|
|
21534
21785
|
] });
|
|
21535
21786
|
var EventMessage = ({ event }) => {
|
|
21536
|
-
const [isOpen, setIsOpen] = (0,
|
|
21537
|
-
const [isOverflowing, setIsOverflowing] = (0,
|
|
21538
|
-
const textReference = (0,
|
|
21539
|
-
const parsedMessage = (0,
|
|
21540
|
-
const isIAMPolicyEvent = (0,
|
|
21787
|
+
const [isOpen, setIsOpen] = (0, import_react53.useState)(false);
|
|
21788
|
+
const [isOverflowing, setIsOverflowing] = (0, import_react53.useState)(false);
|
|
21789
|
+
const textReference = (0, import_react53.useRef)(null);
|
|
21790
|
+
const parsedMessage = (0, import_react53.useMemo)(() => parseEventMessage(event), [event]);
|
|
21791
|
+
const isIAMPolicyEvent = (0, import_react53.useMemo)(
|
|
21541
21792
|
() => event.event_type === "iam.policy_evaluation" && event.attributes?.payload && typeof event.attributes.payload === "string",
|
|
21542
21793
|
[event]
|
|
21543
21794
|
);
|
|
21544
|
-
(0,
|
|
21795
|
+
(0, import_react53.useEffect)(() => {
|
|
21545
21796
|
const checkOverflow = () => {
|
|
21546
21797
|
const element = textReference.current;
|
|
21547
21798
|
if (element) {
|
|
@@ -21554,29 +21805,29 @@ var EventMessage = ({ event }) => {
|
|
|
21554
21805
|
window.removeEventListener("resize", checkOverflow);
|
|
21555
21806
|
};
|
|
21556
21807
|
}, [parsedMessage.headline]);
|
|
21557
|
-
const hasAdditionalContent = (0,
|
|
21808
|
+
const hasAdditionalContent = (0, import_react53.useMemo)(
|
|
21558
21809
|
() => parsedMessage.message || parsedMessage.details || isIAMPolicyEvent,
|
|
21559
21810
|
[parsedMessage.message, parsedMessage.details, isIAMPolicyEvent]
|
|
21560
21811
|
);
|
|
21561
|
-
const shouldShowToggle = (0,
|
|
21812
|
+
const shouldShowToggle = (0, import_react53.useMemo)(
|
|
21562
21813
|
() => isOverflowing || hasAdditionalContent,
|
|
21563
21814
|
[isOverflowing, hasAdditionalContent]
|
|
21564
21815
|
);
|
|
21565
|
-
return /* @__PURE__ */ (0,
|
|
21566
|
-
/* @__PURE__ */ (0,
|
|
21567
|
-
Boolean(shouldShowToggle) && /* @__PURE__ */ (0,
|
|
21568
|
-
|
|
21816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(import_material17.Box, { sx: { display: "flex", flexDirection: "column" }, children: [
|
|
21817
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(import_material17.Box, { sx: { alignItems: "center", display: "flex" }, children: [
|
|
21818
|
+
Boolean(shouldShowToggle) && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
21819
|
+
import_material17.IconButton,
|
|
21569
21820
|
{
|
|
21570
21821
|
onClick: () => {
|
|
21571
21822
|
setIsOpen(!isOpen);
|
|
21572
21823
|
},
|
|
21573
21824
|
size: "small",
|
|
21574
21825
|
sx: { mr: 1, p: 0 },
|
|
21575
|
-
children: isOpen ? /* @__PURE__ */ (0,
|
|
21826
|
+
children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_icons_material10.KeyboardArrowDown, { sx: { fontSize: 16 } }) : /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_icons_material10.KeyboardArrowRight, { sx: { fontSize: 16 } })
|
|
21576
21827
|
}
|
|
21577
21828
|
),
|
|
21578
|
-
/* @__PURE__ */ (0,
|
|
21579
|
-
|
|
21829
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
21830
|
+
import_material17.Typography,
|
|
21580
21831
|
{
|
|
21581
21832
|
ref: textReference,
|
|
21582
21833
|
sx: {
|
|
@@ -21593,12 +21844,12 @@ var EventMessage = ({ event }) => {
|
|
|
21593
21844
|
}
|
|
21594
21845
|
)
|
|
21595
21846
|
] }),
|
|
21596
|
-
isOpen && /* @__PURE__ */ (0,
|
|
21597
|
-
Boolean(parsedMessage.message) && /* @__PURE__ */ (0,
|
|
21598
|
-
Boolean(parsedMessage.details) && /* @__PURE__ */ (0,
|
|
21847
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_material17.Box, { sx: { borderColor: "divider", borderLeft: "2px solid", ml: 1, mt: 0.5, pl: 1.5, py: 0.5 }, children: isIAMPolicyEvent ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(IAMEventDetail, { event }) : /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(import_jsx_runtime139.Fragment, { children: [
|
|
21848
|
+
Boolean(parsedMessage.message) && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(DetailRow2, { content: parsedMessage.message, label: "Message" }),
|
|
21849
|
+
Boolean(parsedMessage.details) && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
21599
21850
|
DetailRow2,
|
|
21600
21851
|
{
|
|
21601
|
-
content: /* @__PURE__ */ (0,
|
|
21852
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(PayloadViewer, { sx: { px: 0 }, value: tryParseJson(parsedMessage.details) }),
|
|
21602
21853
|
label: "Details"
|
|
21603
21854
|
}
|
|
21604
21855
|
)
|
|
@@ -21631,15 +21882,15 @@ var EventDetail = ({
|
|
|
21631
21882
|
type
|
|
21632
21883
|
}) => {
|
|
21633
21884
|
if (type === "permission") {
|
|
21634
|
-
return /* @__PURE__ */ (0,
|
|
21885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(IAMPermissionDetail, { events, spanStatusCode });
|
|
21635
21886
|
}
|
|
21636
21887
|
const eventLevel = getEventLevelFromGroup(type);
|
|
21637
|
-
return /* @__PURE__ */ (0,
|
|
21638
|
-
/* @__PURE__ */ (0,
|
|
21639
|
-
/* @__PURE__ */ (0,
|
|
21640
|
-
/* @__PURE__ */ (0,
|
|
21888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(import_material17.Box, { children: [
|
|
21889
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(import_material17.Box, { sx: { alignItems: "center", display: "flex", mb: 0.5 }, children: [
|
|
21890
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(StatusIcon2, { errorLevel: eventLevel }),
|
|
21891
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_material17.Typography, { color: "text.secondary", sx: { fontWeight: 600, ml: 0.5 }, variant: "caption", children: displayText })
|
|
21641
21892
|
] }),
|
|
21642
|
-
/* @__PURE__ */ (0,
|
|
21893
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_material17.Box, { children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_material17.Box, { sx: { maxWidth: "100%", mb: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(EventMessage, { event }) }, `${event.span_id}-${event.event_id}`)) })
|
|
21643
21894
|
] });
|
|
21644
21895
|
};
|
|
21645
21896
|
|
|
@@ -22081,18 +22332,18 @@ function toBase64(_input) {
|
|
|
22081
22332
|
// node_modules/.pnpm/@smithy+util-stream@4.5.25/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js
|
|
22082
22333
|
init_dist_es();
|
|
22083
22334
|
var Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array {
|
|
22084
|
-
static fromString(
|
|
22085
|
-
if (typeof
|
|
22335
|
+
static fromString(source2, encoding = "utf-8") {
|
|
22336
|
+
if (typeof source2 === "string") {
|
|
22086
22337
|
if (encoding === "base64") {
|
|
22087
|
-
return _Uint8ArrayBlobAdapter.mutate(fromBase64(
|
|
22338
|
+
return _Uint8ArrayBlobAdapter.mutate(fromBase64(source2));
|
|
22088
22339
|
}
|
|
22089
|
-
return _Uint8ArrayBlobAdapter.mutate(fromUtf8(
|
|
22340
|
+
return _Uint8ArrayBlobAdapter.mutate(fromUtf8(source2));
|
|
22090
22341
|
}
|
|
22091
|
-
throw new Error(`Unsupported conversion from ${typeof
|
|
22342
|
+
throw new Error(`Unsupported conversion from ${typeof source2} to Uint8ArrayBlobAdapter.`);
|
|
22092
22343
|
}
|
|
22093
|
-
static mutate(
|
|
22094
|
-
Object.setPrototypeOf(
|
|
22095
|
-
return
|
|
22344
|
+
static mutate(source2) {
|
|
22345
|
+
Object.setPrototypeOf(source2, _Uint8ArrayBlobAdapter.prototype);
|
|
22346
|
+
return source2;
|
|
22096
22347
|
}
|
|
22097
22348
|
transformToString(encoding = "utf-8") {
|
|
22098
22349
|
if (encoding === "base64") {
|
|
@@ -28317,7 +28568,7 @@ var SmithyMessageEncoderStream = class {
|
|
|
28317
28568
|
};
|
|
28318
28569
|
|
|
28319
28570
|
// node_modules/.pnpm/@smithy+eventstream-serde-universal@4.2.14/node_modules/@smithy/eventstream-serde-universal/dist-es/getChunkedStream.js
|
|
28320
|
-
function getChunkedStream(
|
|
28571
|
+
function getChunkedStream(source2) {
|
|
28321
28572
|
let currentMessageTotalLength = 0;
|
|
28322
28573
|
let currentMessagePendingLength = 0;
|
|
28323
28574
|
let currentMessage = null;
|
|
@@ -28333,7 +28584,7 @@ function getChunkedStream(source) {
|
|
|
28333
28584
|
currentMessageView.setUint32(0, size, false);
|
|
28334
28585
|
};
|
|
28335
28586
|
const iterator = async function* () {
|
|
28336
|
-
const sourceIterator =
|
|
28587
|
+
const sourceIterator = source2[Symbol.asyncIterator]();
|
|
28337
28588
|
while (true) {
|
|
28338
28589
|
const { value, done } = await sourceIterator.next();
|
|
28339
28590
|
if (done) {
|
|
@@ -31596,9 +31847,9 @@ var QueryStatus = {
|
|
|
31596
31847
|
};
|
|
31597
31848
|
|
|
31598
31849
|
// src/components/event-details/lambda-invoke-logs-section.tsx
|
|
31599
|
-
var
|
|
31600
|
-
var
|
|
31601
|
-
var
|
|
31850
|
+
var import_material18 = require("@mui/material");
|
|
31851
|
+
var import_react54 = require("react");
|
|
31852
|
+
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
31602
31853
|
var POLL_INTERVAL_MS2 = 1e3;
|
|
31603
31854
|
async function pollQueryResults(client, queryId) {
|
|
31604
31855
|
return client.send(new GetQueryResultsCommand({ queryId }));
|
|
@@ -31615,7 +31866,7 @@ async function startLambdaLogsQuery(client, functionName2, requestId, startTimeS
|
|
|
31615
31866
|
}
|
|
31616
31867
|
function useCloudWatchLogsClient(region) {
|
|
31617
31868
|
const { localstackEndpoint } = useAppInspector();
|
|
31618
|
-
const client = (0,
|
|
31869
|
+
const client = (0, import_react54.useMemo)(() => new CloudWatchLogsClient({
|
|
31619
31870
|
credentials: {
|
|
31620
31871
|
accessKeyId: "test",
|
|
31621
31872
|
secretAccessKey: "test"
|
|
@@ -31626,12 +31877,12 @@ function useCloudWatchLogsClient(region) {
|
|
|
31626
31877
|
return client;
|
|
31627
31878
|
}
|
|
31628
31879
|
function useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, endTimeNano) {
|
|
31629
|
-
const [loading, setLoading] = (0,
|
|
31630
|
-
const [logs, setLogs] = (0,
|
|
31631
|
-
const [error, setError] = (0,
|
|
31632
|
-
const pollTimerRef = (0,
|
|
31880
|
+
const [loading, setLoading] = (0, import_react54.useState)(true);
|
|
31881
|
+
const [logs, setLogs] = (0, import_react54.useState)([]);
|
|
31882
|
+
const [error, setError] = (0, import_react54.useState)();
|
|
31883
|
+
const pollTimerRef = (0, import_react54.useRef)(null);
|
|
31633
31884
|
const cloudWatchLogs = useCloudWatchLogsClient(region);
|
|
31634
|
-
(0,
|
|
31885
|
+
(0, import_react54.useEffect)(() => {
|
|
31635
31886
|
let cancelled = false;
|
|
31636
31887
|
const startTimeSec = Math.floor(Number(BigInt(startTimeNano) / BigInt(1e9)));
|
|
31637
31888
|
const endTimeSec = Math.ceil(Number(BigInt(endTimeNano) / BigInt(1e9)));
|
|
@@ -31688,30 +31939,30 @@ function useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, en
|
|
|
31688
31939
|
var LambdaInvokeLogsSection = ({ endTimeNano, functionName: functionName2, region, requestId, startTimeNano }) => {
|
|
31689
31940
|
const { error, loading, logs } = useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, endTimeNano);
|
|
31690
31941
|
if (loading) {
|
|
31691
|
-
return /* @__PURE__ */ (0,
|
|
31692
|
-
/* @__PURE__ */ (0,
|
|
31693
|
-
/* @__PURE__ */ (0,
|
|
31942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_material18.Stack, { alignItems: "center", direction: "row", spacing: 1, children: [
|
|
31943
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material18.CircularProgress, { size: 14 }),
|
|
31944
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material18.Typography, { color: "text.secondary", variant: "body2", children: "Loading logs\u2026" })
|
|
31694
31945
|
] });
|
|
31695
31946
|
}
|
|
31696
31947
|
if (error !== void 0) {
|
|
31697
|
-
return /* @__PURE__ */ (0,
|
|
31948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material18.Typography, { color: "error", variant: "body2", children: error.message });
|
|
31698
31949
|
}
|
|
31699
31950
|
if (logs.length === 0) {
|
|
31700
|
-
return /* @__PURE__ */ (0,
|
|
31951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material18.Typography, { color: "text.secondary", variant: "body2", children: "No logs found for this invocation." });
|
|
31701
31952
|
}
|
|
31702
|
-
return /* @__PURE__ */ (0,
|
|
31953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material18.Box, { sx: { backgroundColor: (theme) => theme.palette.background.default, borderRadius: 1, p: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("pre", { style: { margin: 0, overflow: "auto" }, children: logs.map((log) => /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material18.Typography, { variant: "body2", children: `[${log.timestamp}] ${log.message}` }, log.ptr)) }) });
|
|
31703
31954
|
};
|
|
31704
31955
|
|
|
31705
31956
|
// src/components/event-details/toggle-section.tsx
|
|
31706
|
-
var
|
|
31707
|
-
var
|
|
31708
|
-
var
|
|
31709
|
-
var
|
|
31957
|
+
var import_icons_material11 = require("@mui/icons-material");
|
|
31958
|
+
var import_material19 = require("@mui/material");
|
|
31959
|
+
var import_react55 = require("react");
|
|
31960
|
+
var import_jsx_runtime141 = require("react/jsx-runtime");
|
|
31710
31961
|
var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
|
|
31711
|
-
const [isOpen, setIsOpen] = (0,
|
|
31712
|
-
return /* @__PURE__ */ (0,
|
|
31713
|
-
/* @__PURE__ */ (0,
|
|
31714
|
-
|
|
31962
|
+
const [isOpen, setIsOpen] = (0, import_react55.useState)(initialOpen);
|
|
31963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(import_material19.Box, { sx: { mt: 4 }, children: [
|
|
31964
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
31965
|
+
import_material19.Box,
|
|
31715
31966
|
{
|
|
31716
31967
|
onClick: () => {
|
|
31717
31968
|
setIsOpen(!isOpen);
|
|
@@ -31724,8 +31975,8 @@ var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
|
|
|
31724
31975
|
mb: 1
|
|
31725
31976
|
},
|
|
31726
31977
|
children: [
|
|
31727
|
-
/* @__PURE__ */ (0,
|
|
31728
|
-
|
|
31978
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
31979
|
+
import_material19.Box,
|
|
31729
31980
|
{
|
|
31730
31981
|
role: "button",
|
|
31731
31982
|
sx: {
|
|
@@ -31734,23 +31985,23 @@ var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
|
|
|
31734
31985
|
gap: 1
|
|
31735
31986
|
},
|
|
31736
31987
|
children: [
|
|
31737
|
-
/* @__PURE__ */ (0,
|
|
31738
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
31988
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material19.Typography, { sx: { fontWeight: 600 }, variant: "subtitle2", children: headline }),
|
|
31989
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_icons_material11.KeyboardArrowDown, { sx: { color: "text.secondary", height: 20, width: 20 } }) : /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_icons_material11.KeyboardArrowRight, { sx: { color: "text.secondary", height: 20, width: 20 } })
|
|
31739
31990
|
]
|
|
31740
31991
|
}
|
|
31741
31992
|
),
|
|
31742
|
-
action !== false && /* @__PURE__ */ (0,
|
|
31993
|
+
action !== false && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material19.Box, { onClick: (event) => {
|
|
31743
31994
|
event.stopPropagation();
|
|
31744
31995
|
}, children: action })
|
|
31745
31996
|
]
|
|
31746
31997
|
}
|
|
31747
31998
|
),
|
|
31748
|
-
isOpen && /* @__PURE__ */ (0,
|
|
31999
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material19.Box, { children })
|
|
31749
32000
|
] });
|
|
31750
32001
|
};
|
|
31751
32002
|
|
|
31752
32003
|
// src/components/event-details/event-details.tsx
|
|
31753
|
-
var
|
|
32004
|
+
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
31754
32005
|
var checkIsLambdaInvoke = (span) => {
|
|
31755
32006
|
if (span.service_name !== "lambda") {
|
|
31756
32007
|
return false;
|
|
@@ -31765,13 +32016,13 @@ var checkIsSqsSendMessage = (span) => {
|
|
|
31765
32016
|
return span.operation_name.startsWith("SendMessage");
|
|
31766
32017
|
};
|
|
31767
32018
|
var EventDetails = ({ onClose, selectedEvent }) => {
|
|
31768
|
-
const eventGroups = (0,
|
|
32019
|
+
const eventGroups = (0, import_react56.useMemo)(
|
|
31769
32020
|
() => getEventGroupsByType(selectedEvent?.events ?? []),
|
|
31770
32021
|
[selectedEvent?.events]
|
|
31771
32022
|
);
|
|
31772
|
-
const [parseNestedJson, setParseNestedJson] = (0,
|
|
32023
|
+
const [parseNestedJson, setParseNestedJson] = (0, import_react56.useState)(true);
|
|
31773
32024
|
if (!selectedEvent) {
|
|
31774
|
-
return /* @__PURE__ */ (0,
|
|
32025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Box, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { color: "text.secondary", variant: "body2", children: "Select an operation to view graph" }) });
|
|
31775
32026
|
}
|
|
31776
32027
|
const isLambdaInvoke = checkIsLambdaInvoke(selectedEvent);
|
|
31777
32028
|
const isSqsSendMessage = checkIsSqsSendMessage(selectedEvent);
|
|
@@ -31797,9 +32048,9 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
31797
32048
|
const exceptionPayload = tryParseJson(selectedEvent.attributes?.["localstack.aws.service.exception"]);
|
|
31798
32049
|
const hasPayloads = requestPayload !== void 0 || responsePayload !== void 0 || exceptionPayload !== void 0 || isResponseSuppressed;
|
|
31799
32050
|
const duration = selectedEvent.end_time_unix_nano ? ((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString() : void 0;
|
|
31800
|
-
return /* @__PURE__ */ (0,
|
|
31801
|
-
/* @__PURE__ */ (0,
|
|
31802
|
-
|
|
32051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { "data-testid": EVENT_DETAILS_TEST_ID, sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
32052
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
32053
|
+
import_material20.Box,
|
|
31803
32054
|
{
|
|
31804
32055
|
sx: {
|
|
31805
32056
|
alignItems: "center",
|
|
@@ -31811,91 +32062,91 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
31811
32062
|
py: 1
|
|
31812
32063
|
},
|
|
31813
32064
|
children: [
|
|
31814
|
-
/* @__PURE__ */ (0,
|
|
31815
|
-
onClose && /* @__PURE__ */ (0,
|
|
32065
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "h6", children: "Operation Details" }) }),
|
|
32066
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.IconButton, { "data-testid": EVENT_DETAILS_CLOSE_BUTTON_TEST_ID, onClick: onClose, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_icons_material12.Close, {}) })
|
|
31816
32067
|
]
|
|
31817
32068
|
}
|
|
31818
32069
|
),
|
|
31819
|
-
/* @__PURE__ */ (0,
|
|
31820
|
-
/* @__PURE__ */ (0,
|
|
31821
|
-
/* @__PURE__ */ (0,
|
|
31822
|
-
/* @__PURE__ */ (0,
|
|
31823
|
-
/* @__PURE__ */ (0,
|
|
31824
|
-
/* @__PURE__ */ (0,
|
|
31825
|
-
/* @__PURE__ */ (0,
|
|
31826
|
-
/* @__PURE__ */ (0,
|
|
32070
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Box, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { spacing: 2, children: [
|
|
32071
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { "data-testid": EVENT_DETAILS_SECTION_BASIC_INFORMATION_TEST_ID, spacing: 1, children: [
|
|
32072
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
|
|
32073
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32074
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Service" }),
|
|
32075
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32076
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { "data-testid": EVENT_DETAILS_SERVICE_NAME_TEST_ID, variant: "body2", children: getServiceDisplayName(selectedEvent.service_name) }),
|
|
32077
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: getServiceDisplayName(selectedEvent.service_name) })
|
|
31827
32078
|
] })
|
|
31828
32079
|
] }),
|
|
31829
|
-
/* @__PURE__ */ (0,
|
|
31830
|
-
/* @__PURE__ */ (0,
|
|
31831
|
-
/* @__PURE__ */ (0,
|
|
31832
|
-
/* @__PURE__ */ (0,
|
|
31833
|
-
/* @__PURE__ */ (0,
|
|
32080
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32081
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Action" }),
|
|
32082
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32083
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { "data-testid": EVENT_DETAILS_OPERATION_NAME_TEST_ID, variant: "body2", children: selectedEvent.operation_name }),
|
|
32084
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: selectedEvent.operation_name })
|
|
31834
32085
|
] })
|
|
31835
32086
|
] })
|
|
31836
32087
|
] }),
|
|
31837
|
-
/* @__PURE__ */ (0,
|
|
31838
|
-
/* @__PURE__ */ (0,
|
|
31839
|
-
/* @__PURE__ */ (0,
|
|
31840
|
-
/* @__PURE__ */ (0,
|
|
31841
|
-
/* @__PURE__ */ (0,
|
|
31842
|
-
/* @__PURE__ */ (0,
|
|
32088
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { sx: cfnResourceType ? { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" } : void 0, children: [
|
|
32089
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32090
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource" }),
|
|
32091
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", "data-testid": EVENT_DETAILS_RESOURCE_NAME_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32092
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { variant: "body2", children: selectedEvent.resource_name }),
|
|
32093
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: selectedEvent.resource_name })
|
|
31843
32094
|
] })
|
|
31844
32095
|
] }),
|
|
31845
|
-
Boolean(cfnResourceType) && /* @__PURE__ */ (0,
|
|
31846
|
-
/* @__PURE__ */ (0,
|
|
31847
|
-
/* @__PURE__ */ (0,
|
|
31848
|
-
/* @__PURE__ */ (0,
|
|
31849
|
-
/* @__PURE__ */ (0,
|
|
32096
|
+
Boolean(cfnResourceType) && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32097
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource Type" }),
|
|
32098
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32099
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { "data-testid": EVENT_DETAILS_CFN_RESOURCE_TYPE_TEST_ID, variant: "body2", children: cfnResourceType }),
|
|
32100
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: cfnResourceType })
|
|
31850
32101
|
] })
|
|
31851
32102
|
] })
|
|
31852
32103
|
] }),
|
|
31853
|
-
Boolean(resourceArn) && /* @__PURE__ */ (0,
|
|
31854
|
-
/* @__PURE__ */ (0,
|
|
31855
|
-
/* @__PURE__ */ (0,
|
|
31856
|
-
/* @__PURE__ */ (0,
|
|
31857
|
-
/* @__PURE__ */ (0,
|
|
32104
|
+
Boolean(resourceArn) && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32105
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource ARN" }),
|
|
32106
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", "data-testid": EVENT_DETAILS_RESOURCE_ARN_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32107
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { variant: "body2", children: resourceArn }),
|
|
32108
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: resourceArn })
|
|
31858
32109
|
] })
|
|
31859
32110
|
] }),
|
|
31860
|
-
/* @__PURE__ */ (0,
|
|
31861
|
-
/* @__PURE__ */ (0,
|
|
31862
|
-
/* @__PURE__ */ (0,
|
|
31863
|
-
/* @__PURE__ */ (0,
|
|
31864
|
-
/* @__PURE__ */ (0,
|
|
31865
|
-
/* @__PURE__ */ (0,
|
|
32111
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { sx: { display: "grid", gap: 1, gridTemplateColumns: "1.3fr 1fr" }, children: [
|
|
32112
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32113
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Account" }),
|
|
32114
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32115
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { "data-testid": EVENT_DETAILS_ACCOUNT_TEST_ID, variant: "body2", children: selectedEvent.account_id }),
|
|
32116
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: selectedEvent.account_id })
|
|
31866
32117
|
] })
|
|
31867
32118
|
] }),
|
|
31868
|
-
/* @__PURE__ */ (0,
|
|
31869
|
-
/* @__PURE__ */ (0,
|
|
31870
|
-
/* @__PURE__ */ (0,
|
|
31871
|
-
/* @__PURE__ */ (0,
|
|
31872
|
-
/* @__PURE__ */ (0,
|
|
32119
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32120
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Region" }),
|
|
32121
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32122
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { "data-testid": EVENT_DETAILS_REGION_TEST_ID, variant: "body2", children: selectedEvent.region }),
|
|
32123
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: selectedEvent.region })
|
|
31873
32124
|
] })
|
|
31874
32125
|
] })
|
|
31875
32126
|
] }),
|
|
31876
|
-
/* @__PURE__ */ (0,
|
|
31877
|
-
/* @__PURE__ */ (0,
|
|
31878
|
-
/* @__PURE__ */ (0,
|
|
31879
|
-
/* @__PURE__ */ (0,
|
|
31880
|
-
/* @__PURE__ */ (0,
|
|
31881
|
-
/* @__PURE__ */ (0,
|
|
32127
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { sx: { display: "grid", gap: 1, gridTemplateColumns: duration === void 0 ? "1fr" : "1.3fr 1fr" }, children: [
|
|
32128
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32129
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Start Time" }),
|
|
32130
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", "data-testid": EVENT_DETAILS_START_TIME_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32131
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(ResponsiveTimestampCell, { date: unixNanoToDate(selectedEvent.start_time_unix_nano) }) }),
|
|
32132
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
|
|
31882
32133
|
] })
|
|
31883
32134
|
] }),
|
|
31884
|
-
duration !== void 0 && /* @__PURE__ */ (0,
|
|
31885
|
-
/* @__PURE__ */ (0,
|
|
31886
|
-
/* @__PURE__ */ (0,
|
|
31887
|
-
/* @__PURE__ */ (0,
|
|
32135
|
+
duration !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32136
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Duration" }),
|
|
32137
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", "data-testid": EVENT_DETAILS_DURATION_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32138
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Typography, { variant: "body2", children: [
|
|
31888
32139
|
duration,
|
|
31889
32140
|
"ms"
|
|
31890
32141
|
] }),
|
|
31891
|
-
/* @__PURE__ */ (0,
|
|
32142
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: `${duration}ms` })
|
|
31892
32143
|
] })
|
|
31893
32144
|
] })
|
|
31894
32145
|
] }),
|
|
31895
|
-
/* @__PURE__ */ (0,
|
|
31896
|
-
/* @__PURE__ */ (0,
|
|
31897
|
-
/* @__PURE__ */ (0,
|
|
31898
|
-
|
|
32146
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32147
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Status" }),
|
|
32148
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Stack, { alignItems: "center", direction: "row", flexWrap: "wrap", gap: 1, sx: { mb: eventGroups.errors || eventGroups.warnings ? 1 : 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
32149
|
+
import_material20.Chip,
|
|
31899
32150
|
{
|
|
31900
32151
|
color: selectedEvent.status_code === 2 ? "error" : selectedEvent.status_code === 1 ? "success" : "default",
|
|
31901
32152
|
"data-testid": EVENT_DETAILS_STATUS_TEST_ID,
|
|
@@ -31905,50 +32156,50 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
31905
32156
|
) })
|
|
31906
32157
|
] })
|
|
31907
32158
|
] }) }),
|
|
31908
|
-
/* @__PURE__ */ (0,
|
|
31909
|
-
/* @__PURE__ */ (0,
|
|
31910
|
-
selectedEvent.iam_errors_suppressed && /* @__PURE__ */ (0,
|
|
31911
|
-
!selectedEvent.iam_errors_suppressed && !eventGroups.permissions && !eventGroups.errors && !eventGroups.warnings && /* @__PURE__ */ (0,
|
|
31912
|
-
eventGroups.permissions && /* @__PURE__ */ (0,
|
|
31913
|
-
eventGroups.errors && /* @__PURE__ */ (0,
|
|
31914
|
-
eventGroups.warnings && /* @__PURE__ */ (0,
|
|
32159
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Divider, {}),
|
|
32160
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(ToggleSection, { headline: "Permissions", children: [
|
|
32161
|
+
selectedEvent.iam_errors_suppressed && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Alert, { "data-testid": EVENT_DETAILS_IAM_ERRORS_SUPPRESSED_TEST_ID, severity: "warning", sx: { mb: 1 }, children: "IAM errors are suppressed \u2014 upgrade your license to view" }),
|
|
32162
|
+
!selectedEvent.iam_errors_suppressed && !eventGroups.permissions && !eventGroups.errors && !eventGroups.warnings && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { color: "text.secondary", variant: "body2", children: "There is no permission information available." }),
|
|
32163
|
+
eventGroups.permissions && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(EventDetail, { displayText: "Permissions", events: eventGroups.permissions, spanStatusCode: selectedEvent.status_code, type: "permission" }),
|
|
32164
|
+
eventGroups.errors && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(EventDetail, { displayText: "Error", events: eventGroups.errors, type: "error" }),
|
|
32165
|
+
eventGroups.warnings && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(EventDetail, { displayText: "Warning", events: eventGroups.warnings, type: "warning" })
|
|
31915
32166
|
] }),
|
|
31916
|
-
hasPayloads && /* @__PURE__ */ (0,
|
|
31917
|
-
/* @__PURE__ */ (0,
|
|
31918
|
-
/* @__PURE__ */ (0,
|
|
32167
|
+
hasPayloads && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_jsx_runtime142.Fragment, { children: [
|
|
32168
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Divider, {}),
|
|
32169
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
31919
32170
|
ToggleSection,
|
|
31920
32171
|
{
|
|
31921
|
-
action: /* @__PURE__ */ (0,
|
|
31922
|
-
|
|
32172
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
32173
|
+
import_material20.FormControlLabel,
|
|
31923
32174
|
{
|
|
31924
|
-
control: /* @__PURE__ */ (0,
|
|
32175
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Switch, { checked: !parseNestedJson, onChange: (event) => {
|
|
31925
32176
|
setParseNestedJson(!event.target.checked);
|
|
31926
32177
|
}, size: "small" }),
|
|
31927
|
-
label: /* @__PURE__ */ (0,
|
|
32178
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { variant: "caption", children: "View raw data" }),
|
|
31928
32179
|
sx: { mr: 0 }
|
|
31929
32180
|
}
|
|
31930
32181
|
),
|
|
31931
32182
|
headline: "Payloads",
|
|
31932
|
-
children: /* @__PURE__ */ (0,
|
|
31933
|
-
requestPayload !== void 0 && /* @__PURE__ */ (0,
|
|
31934
|
-
/* @__PURE__ */ (0,
|
|
31935
|
-
/* @__PURE__ */ (0,
|
|
32183
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { spacing: 2, children: [
|
|
32184
|
+
requestPayload !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32185
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Request" }),
|
|
32186
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(PayloadViewer, { testId: EVENT_DETAILS_REQUEST_PAYLOAD, value: requestPayload })
|
|
31936
32187
|
] }),
|
|
31937
|
-
(responsePayload !== void 0 || isResponseSuppressed) && /* @__PURE__ */ (0,
|
|
31938
|
-
/* @__PURE__ */ (0,
|
|
31939
|
-
isResponseSuppressed ? /* @__PURE__ */ (0,
|
|
32188
|
+
(responsePayload !== void 0 || isResponseSuppressed) && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32189
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Response" }),
|
|
32190
|
+
isResponseSuppressed ? /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Box, { sx: { py: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Alert, { severity: "warning", sx: { mb: 1 }, children: "Response payload is available \u2014 upgrade your license to view" }) }) : /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(PayloadViewer, { testId: EVENT_DETAILS_RESPONSE_PAYLOAD_TEST_ID, value: responsePayload })
|
|
31940
32191
|
] }),
|
|
31941
|
-
exceptionPayload !== void 0 && /* @__PURE__ */ (0,
|
|
31942
|
-
/* @__PURE__ */ (0,
|
|
31943
|
-
/* @__PURE__ */ (0,
|
|
32192
|
+
exceptionPayload !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32193
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Exception" }),
|
|
32194
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(PayloadViewer, { testId: EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID, value: exceptionPayload })
|
|
31944
32195
|
] })
|
|
31945
32196
|
] })
|
|
31946
32197
|
}
|
|
31947
32198
|
)
|
|
31948
32199
|
] }),
|
|
31949
|
-
isLambdaInvoke && requestId !== void 0 && /* @__PURE__ */ (0,
|
|
31950
|
-
/* @__PURE__ */ (0,
|
|
31951
|
-
/* @__PURE__ */ (0,
|
|
32200
|
+
isLambdaInvoke && requestId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_jsx_runtime142.Fragment, { children: [
|
|
32201
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Divider, {}),
|
|
32202
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(ToggleSection, { headline: "Lambda Logs", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
31952
32203
|
LambdaInvokeLogsSection,
|
|
31953
32204
|
{
|
|
31954
32205
|
endTimeNano: selectedEvent.end_time_unix_nano ?? selectedEvent.start_time_unix_nano,
|
|
@@ -31959,30 +32210,30 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
31959
32210
|
}
|
|
31960
32211
|
) })
|
|
31961
32212
|
] }),
|
|
31962
|
-
/* @__PURE__ */ (0,
|
|
31963
|
-
/* @__PURE__ */ (0,
|
|
31964
|
-
/* @__PURE__ */ (0,
|
|
31965
|
-
/* @__PURE__ */ (0,
|
|
31966
|
-
/* @__PURE__ */ (0,
|
|
31967
|
-
/* @__PURE__ */ (0,
|
|
31968
|
-
/* @__PURE__ */ (0,
|
|
32213
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Divider, {}),
|
|
32214
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(ToggleSection, { headline: "Advanced Information", initialOpen: false, children: /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { spacing: 1, children: [
|
|
32215
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32216
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Span ID" }),
|
|
32217
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32218
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { "data-testid": EVENT_DETAILS_SPAN_ID_TEST_ID, variant: "body2", children: selectedEvent.span_id }),
|
|
32219
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: selectedEvent.span_id })
|
|
31969
32220
|
] })
|
|
31970
32221
|
] }),
|
|
31971
|
-
/* @__PURE__ */ (0,
|
|
31972
|
-
/* @__PURE__ */ (0,
|
|
31973
|
-
/* @__PURE__ */ (0,
|
|
31974
|
-
/* @__PURE__ */ (0,
|
|
31975
|
-
/* @__PURE__ */ (0,
|
|
32222
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32223
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Trace ID" }),
|
|
32224
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32225
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { "data-testid": EVENT_DETAILS_TRACE_ID_TEST_ID, variant: "body2", children: selectedEvent.trace_id }),
|
|
32226
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: selectedEvent.trace_id })
|
|
31976
32227
|
] })
|
|
31977
32228
|
] }),
|
|
31978
|
-
requestId !== void 0 && /* @__PURE__ */ (0,
|
|
31979
|
-
/* @__PURE__ */ (0,
|
|
31980
|
-
/* @__PURE__ */ (0,
|
|
31981
|
-
/* @__PURE__ */ (0,
|
|
31982
|
-
/* @__PURE__ */ (0,
|
|
32229
|
+
requestId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Box, { children: [
|
|
32230
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { sx: { fontWeight: 600 }, variant: "caption", children: "Request ID" }),
|
|
32231
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material20.Stack, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
|
|
32232
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { "data-testid": EVENT_DETAILS_REQUEST_ID_TEST_ID, variant: "body2", children: requestId }),
|
|
32233
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: requestId })
|
|
31983
32234
|
] })
|
|
31984
32235
|
] }),
|
|
31985
|
-
eventGroups.info && /* @__PURE__ */ (0,
|
|
32236
|
+
eventGroups.info && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(EventDetail, { displayText: "Info", events: eventGroups.info, type: "info" })
|
|
31986
32237
|
] }) })
|
|
31987
32238
|
] }) })
|
|
31988
32239
|
] });
|
|
@@ -31990,39 +32241,39 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
31990
32241
|
|
|
31991
32242
|
// src/components/trace-graph/trace-graph.tsx
|
|
31992
32243
|
var import_base = require("@xyflow/react/dist/base.css");
|
|
31993
|
-
var
|
|
31994
|
-
var
|
|
31995
|
-
var
|
|
32244
|
+
var import_material24 = require("@mui/material");
|
|
32245
|
+
var import_react63 = require("@xyflow/react");
|
|
32246
|
+
var import_react64 = require("react");
|
|
31996
32247
|
|
|
31997
32248
|
// src/components/trace-graph/service-node.tsx
|
|
31998
|
-
var
|
|
31999
|
-
var
|
|
32000
|
-
var
|
|
32249
|
+
var import_icons_material13 = require("@mui/icons-material");
|
|
32250
|
+
var import_material21 = require("@mui/material");
|
|
32251
|
+
var import_react57 = require("@xyflow/react");
|
|
32001
32252
|
var import_style = require("@xyflow/react/dist/style.css");
|
|
32002
32253
|
var React122 = require("react");
|
|
32003
|
-
var
|
|
32004
|
-
var
|
|
32254
|
+
var import_react58 = require("react");
|
|
32255
|
+
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
32005
32256
|
var handleStyle = {
|
|
32006
32257
|
backgroundColor: "white",
|
|
32007
32258
|
borderColor: "lightgray",
|
|
32008
32259
|
opacity: 0
|
|
32009
32260
|
};
|
|
32010
32261
|
var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning }) => {
|
|
32011
|
-
const theme = (0,
|
|
32012
|
-
return /* @__PURE__ */ (0,
|
|
32013
|
-
/* @__PURE__ */ (0,
|
|
32014
|
-
/* @__PURE__ */ (0,
|
|
32015
|
-
/* @__PURE__ */ (0,
|
|
32016
|
-
|
|
32262
|
+
const theme = (0, import_material21.useTheme)();
|
|
32263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
|
|
32264
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_react57.Handle, { position: import_react57.Position.Left, style: handleStyle, type: "target" }),
|
|
32265
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_react57.Handle, { position: import_react57.Position.Right, style: handleStyle, type: "source" }),
|
|
32266
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
|
|
32267
|
+
import_material21.Stack,
|
|
32017
32268
|
{
|
|
32018
32269
|
alignItems: "center",
|
|
32019
32270
|
direction: "row",
|
|
32020
32271
|
sx: { gap: "8px", pb: "2px", pt: "6px", px: "8px" },
|
|
32021
32272
|
children: [
|
|
32022
|
-
/* @__PURE__ */ (0,
|
|
32023
|
-
/* @__PURE__ */ (0,
|
|
32024
|
-
/* @__PURE__ */ (0,
|
|
32025
|
-
|
|
32273
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_material21.Box, { sx: { borderRadius: "4px", flexShrink: 0, lineHeight: 0, overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(AwsServiceIcon, { hideTooltip: true, service: event.service_name, size: "medium" }) }),
|
|
32274
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_material21.Stack, { sx: expanded ? void 0 : { minWidth: 0 }, children: [
|
|
32275
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32276
|
+
import_material21.Typography,
|
|
32026
32277
|
{
|
|
32027
32278
|
noWrap: !expanded,
|
|
32028
32279
|
sx: { fontWeight: 700, lineHeight: 1.25, ...expanded && { whiteSpace: "nowrap" } },
|
|
@@ -32030,8 +32281,8 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
|
|
|
32030
32281
|
children: getServiceDisplayName(event.service_name)
|
|
32031
32282
|
}
|
|
32032
32283
|
),
|
|
32033
|
-
event.resource_name != "" && /* @__PURE__ */ (0,
|
|
32034
|
-
|
|
32284
|
+
event.resource_name != "" && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32285
|
+
import_material21.Typography,
|
|
32035
32286
|
{
|
|
32036
32287
|
color: "text.secondary",
|
|
32037
32288
|
noWrap: !expanded,
|
|
@@ -32044,16 +32295,16 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
|
|
|
32044
32295
|
]
|
|
32045
32296
|
}
|
|
32046
32297
|
),
|
|
32047
|
-
/* @__PURE__ */ (0,
|
|
32048
|
-
/* @__PURE__ */ (0,
|
|
32049
|
-
|
|
32298
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_material21.Divider, { sx: { ml: "38px", mr: "8px", my: "5px" } }),
|
|
32299
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
|
|
32300
|
+
import_material21.Stack,
|
|
32050
32301
|
{
|
|
32051
32302
|
alignItems: "center",
|
|
32052
32303
|
direction: "row",
|
|
32053
32304
|
sx: expanded ? { pb: "5px", pr: "8px", pt: "1px" } : { minWidth: 0, pb: "5px", pr: "8px", pt: "1px" },
|
|
32054
32305
|
children: [
|
|
32055
|
-
/* @__PURE__ */ (0,
|
|
32056
|
-
|
|
32306
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
|
|
32307
|
+
import_material21.Box,
|
|
32057
32308
|
{
|
|
32058
32309
|
sx: {
|
|
32059
32310
|
alignItems: "center",
|
|
@@ -32063,13 +32314,13 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
|
|
|
32063
32314
|
width: "38px"
|
|
32064
32315
|
},
|
|
32065
32316
|
children: [
|
|
32066
|
-
(isError || isWarning) && hasPermissionEvents && /* @__PURE__ */ (0,
|
|
32067
|
-
isError && !hasPermissionEvents && /* @__PURE__ */ (0,
|
|
32317
|
+
(isError || isWarning) && hasPermissionEvents && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_material21.Tooltip, { arrow: true, title: "Permission denied", children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_icons_material13.GppBad, { sx: { color: isError ? theme.palette.error.main : theme.palette.warning.main, fontSize: "16px" } }) }),
|
|
32318
|
+
isError && !hasPermissionEvents && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_material21.Tooltip, { arrow: true, title: "Error", children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_icons_material13.Cancel, { sx: { color: theme.palette.error.main, fontSize: "16px" } }) })
|
|
32068
32319
|
]
|
|
32069
32320
|
}
|
|
32070
32321
|
),
|
|
32071
|
-
/* @__PURE__ */ (0,
|
|
32072
|
-
|
|
32322
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32323
|
+
import_material21.Typography,
|
|
32073
32324
|
{
|
|
32074
32325
|
"data-testid": SERVICE_NODE_OPERATION_NAME_TEST_ID,
|
|
32075
32326
|
noWrap: !expanded,
|
|
@@ -32083,12 +32334,12 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
|
|
|
32083
32334
|
)
|
|
32084
32335
|
] });
|
|
32085
32336
|
};
|
|
32086
|
-
var ServiceNode = (0,
|
|
32087
|
-
const theme = (0,
|
|
32088
|
-
const [isHovered, setIsHovered] = (0,
|
|
32089
|
-
const nodeRef = (0,
|
|
32337
|
+
var ServiceNode = (0, import_react58.memo)(({ data, selected }) => {
|
|
32338
|
+
const theme = (0, import_material21.useTheme)();
|
|
32339
|
+
const [isHovered, setIsHovered] = (0, import_react58.useState)(false);
|
|
32340
|
+
const nodeRef = (0, import_react58.useRef)(null);
|
|
32090
32341
|
const { operation_status } = data.event;
|
|
32091
|
-
const hasPermissionEventsLegacy = (0,
|
|
32342
|
+
const hasPermissionEventsLegacy = (0, import_react58.useMemo)(
|
|
32092
32343
|
() => data.event.events.some(
|
|
32093
32344
|
(event) => event.event_type === "iam.policy_evaluation" && event.name === "iam.policy.denied"
|
|
32094
32345
|
),
|
|
@@ -32119,8 +32370,8 @@ var ServiceNode = (0, import_react57.memo)(({ data, selected }) => {
|
|
|
32119
32370
|
const xyNode = nodeRef.current?.closest(".react-flow__node");
|
|
32120
32371
|
if (xyNode) xyNode.style.zIndex = "";
|
|
32121
32372
|
};
|
|
32122
|
-
return /* @__PURE__ */ (0,
|
|
32123
|
-
|
|
32373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
|
|
32374
|
+
import_material21.Box,
|
|
32124
32375
|
{
|
|
32125
32376
|
"data-testid": SERVICE_NODE_TEST_ID,
|
|
32126
32377
|
onMouseEnter: handleMouseEnter,
|
|
@@ -32130,8 +32381,8 @@ var ServiceNode = (0, import_react57.memo)(({ data, selected }) => {
|
|
|
32130
32381
|
sx: { display: "inline-block", position: "relative" },
|
|
32131
32382
|
tabIndex: 0,
|
|
32132
32383
|
children: [
|
|
32133
|
-
/* @__PURE__ */ (0,
|
|
32134
|
-
|
|
32384
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32385
|
+
import_material21.Box,
|
|
32135
32386
|
{
|
|
32136
32387
|
sx: {
|
|
32137
32388
|
...sharedBoxSx,
|
|
@@ -32139,11 +32390,11 @@ var ServiceNode = (0, import_react57.memo)(({ data, selected }) => {
|
|
|
32139
32390
|
maxWidth: 220,
|
|
32140
32391
|
overflow: "hidden"
|
|
32141
32392
|
},
|
|
32142
|
-
children: /* @__PURE__ */ (0,
|
|
32393
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(NodeContent, { ...contentProps, expanded: false })
|
|
32143
32394
|
}
|
|
32144
32395
|
),
|
|
32145
|
-
/* @__PURE__ */ (0,
|
|
32146
|
-
|
|
32396
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32397
|
+
import_material21.Box,
|
|
32147
32398
|
{
|
|
32148
32399
|
onMouseLeave: handleMouseLeave,
|
|
32149
32400
|
sx: {
|
|
@@ -32157,7 +32408,7 @@ var ServiceNode = (0, import_react57.memo)(({ data, selected }) => {
|
|
|
32157
32408
|
width: "max-content",
|
|
32158
32409
|
zIndex: 10
|
|
32159
32410
|
},
|
|
32160
|
-
children: /* @__PURE__ */ (0,
|
|
32411
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(NodeContent, { ...contentProps, expanded: true })
|
|
32161
32412
|
}
|
|
32162
32413
|
)
|
|
32163
32414
|
]
|
|
@@ -32251,20 +32502,20 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
|
|
|
32251
32502
|
};
|
|
32252
32503
|
|
|
32253
32504
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
32254
|
-
var
|
|
32255
|
-
var
|
|
32256
|
-
var
|
|
32257
|
-
var
|
|
32505
|
+
var import_icons_material14 = require("@mui/icons-material");
|
|
32506
|
+
var import_material22 = require("@mui/material");
|
|
32507
|
+
var import_react59 = require("@xyflow/react");
|
|
32508
|
+
var import_react60 = require("react");
|
|
32258
32509
|
var import_shallow = require("zustand/shallow");
|
|
32259
|
-
var
|
|
32510
|
+
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
32260
32511
|
var selector = (s) => ({
|
|
32261
32512
|
isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,
|
|
32262
32513
|
maxZoomReached: s.transform[2] >= s.maxZoom,
|
|
32263
32514
|
minZoomReached: s.transform[2] <= s.minZoom
|
|
32264
32515
|
});
|
|
32265
|
-
var Controls = (0,
|
|
32266
|
-
const { maxZoomReached, minZoomReached } = (0,
|
|
32267
|
-
const { fitView, zoomIn, zoomOut } = (0,
|
|
32516
|
+
var Controls = (0, import_react60.memo)(() => {
|
|
32517
|
+
const { maxZoomReached, minZoomReached } = (0, import_react59.useStore)(selector, import_shallow.shallow);
|
|
32518
|
+
const { fitView, zoomIn, zoomOut } = (0, import_react59.useReactFlow)();
|
|
32268
32519
|
const onZoomInHandler = () => {
|
|
32269
32520
|
void zoomIn();
|
|
32270
32521
|
};
|
|
@@ -32274,8 +32525,8 @@ var Controls = (0, import_react59.memo)(() => {
|
|
|
32274
32525
|
const onFitViewHandler = () => {
|
|
32275
32526
|
void fitView();
|
|
32276
32527
|
};
|
|
32277
|
-
return /* @__PURE__ */ (0,
|
|
32278
|
-
|
|
32528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
|
|
32529
|
+
import_material22.Box,
|
|
32279
32530
|
{
|
|
32280
32531
|
sx: {
|
|
32281
32532
|
bottom: 0,
|
|
@@ -32288,33 +32539,33 @@ var Controls = (0, import_react59.memo)(() => {
|
|
|
32288
32539
|
zIndex: 5
|
|
32289
32540
|
},
|
|
32290
32541
|
children: [
|
|
32291
|
-
/* @__PURE__ */ (0,
|
|
32292
|
-
|
|
32542
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
32543
|
+
import_material22.IconButton,
|
|
32293
32544
|
{
|
|
32294
32545
|
className: "react-flow__controls-zoomin",
|
|
32295
32546
|
disabled: maxZoomReached,
|
|
32296
32547
|
onClick: onZoomInHandler,
|
|
32297
32548
|
size: "small",
|
|
32298
|
-
children: /* @__PURE__ */ (0,
|
|
32549
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_icons_material14.Add, {})
|
|
32299
32550
|
}
|
|
32300
32551
|
),
|
|
32301
|
-
/* @__PURE__ */ (0,
|
|
32302
|
-
|
|
32552
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
32553
|
+
import_material22.IconButton,
|
|
32303
32554
|
{
|
|
32304
32555
|
className: "react-flow__controls-zoomout",
|
|
32305
32556
|
disabled: minZoomReached,
|
|
32306
32557
|
onClick: onZoomOutHandler,
|
|
32307
32558
|
size: "small",
|
|
32308
|
-
children: /* @__PURE__ */ (0,
|
|
32559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_icons_material14.Remove, {})
|
|
32309
32560
|
}
|
|
32310
32561
|
),
|
|
32311
|
-
/* @__PURE__ */ (0,
|
|
32312
|
-
|
|
32562
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
32563
|
+
import_material22.IconButton,
|
|
32313
32564
|
{
|
|
32314
32565
|
className: "react-flow__controls-fitview",
|
|
32315
32566
|
onClick: onFitViewHandler,
|
|
32316
32567
|
size: "small",
|
|
32317
|
-
children: /* @__PURE__ */ (0,
|
|
32568
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_icons_material14.FitScreen, {})
|
|
32318
32569
|
}
|
|
32319
32570
|
)
|
|
32320
32571
|
]
|
|
@@ -32323,14 +32574,14 @@ var Controls = (0, import_react59.memo)(() => {
|
|
|
32323
32574
|
});
|
|
32324
32575
|
|
|
32325
32576
|
// src/components/trace-graph/xyflow/minimap-node.tsx
|
|
32326
|
-
var
|
|
32327
|
-
var
|
|
32328
|
-
var
|
|
32329
|
-
var
|
|
32577
|
+
var import_material23 = require("@mui/material");
|
|
32578
|
+
var import_react61 = require("@xyflow/react");
|
|
32579
|
+
var import_react62 = require("react");
|
|
32580
|
+
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
32330
32581
|
var ICON_FRACTION = 0.35;
|
|
32331
32582
|
var PADDING_FRACTION = 0.18;
|
|
32332
32583
|
var ICON_NATIVE_SIZE = 80;
|
|
32333
|
-
var MinimapServiceNode = (0,
|
|
32584
|
+
var MinimapServiceNode = (0, import_react62.memo)(({
|
|
32334
32585
|
height,
|
|
32335
32586
|
id: id2,
|
|
32336
32587
|
onClick,
|
|
@@ -32339,8 +32590,8 @@ var MinimapServiceNode = (0, import_react61.memo)(({
|
|
|
32339
32590
|
x,
|
|
32340
32591
|
y
|
|
32341
32592
|
}) => {
|
|
32342
|
-
const theme = (0,
|
|
32343
|
-
const node = (0,
|
|
32593
|
+
const theme = (0, import_material23.useTheme)();
|
|
32594
|
+
const node = (0, import_react61.useStore)((s) => s.nodeLookup.get(id2));
|
|
32344
32595
|
const event = node?.data.event;
|
|
32345
32596
|
const serviceName = event?.service_name;
|
|
32346
32597
|
const Icon = serviceName ? getServiceIconComponent(serviceName) : void 0;
|
|
@@ -32355,10 +32606,10 @@ var MinimapServiceNode = (0, import_react61.memo)(({
|
|
|
32355
32606
|
const dotY = y + height - padding - dotRadius;
|
|
32356
32607
|
const outlineColor = selected ? isError ? errorColor : "#1a73e8" : "#cccccc";
|
|
32357
32608
|
const outlineWidth = selected ? 2 : 1;
|
|
32358
|
-
return /* @__PURE__ */ (0,
|
|
32609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("g", { onClick: onClick ? (event2) => {
|
|
32359
32610
|
onClick(event2, id2);
|
|
32360
32611
|
} : void 0, children: [
|
|
32361
|
-
/* @__PURE__ */ (0,
|
|
32612
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
32362
32613
|
"rect",
|
|
32363
32614
|
{
|
|
32364
32615
|
fill: theme.palette.background.paper,
|
|
@@ -32372,7 +32623,7 @@ var MinimapServiceNode = (0, import_react61.memo)(({
|
|
|
32372
32623
|
y
|
|
32373
32624
|
}
|
|
32374
32625
|
),
|
|
32375
|
-
isError && /* @__PURE__ */ (0,
|
|
32626
|
+
isError && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
32376
32627
|
"rect",
|
|
32377
32628
|
{
|
|
32378
32629
|
fill: errorColor,
|
|
@@ -32384,8 +32635,8 @@ var MinimapServiceNode = (0, import_react61.memo)(({
|
|
|
32384
32635
|
y: y + 3
|
|
32385
32636
|
}
|
|
32386
32637
|
),
|
|
32387
|
-
Icon && /* @__PURE__ */ (0,
|
|
32388
|
-
isError && Icon && /* @__PURE__ */ (0,
|
|
32638
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("g", { transform: `translate(${String(x + padding)}, ${String(y + padding)}) scale(${String(scale2)})`, children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Icon, { height: ICON_NATIVE_SIZE, width: ICON_NATIVE_SIZE }) }),
|
|
32639
|
+
isError && Icon && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
32389
32640
|
"circle",
|
|
32390
32641
|
{
|
|
32391
32642
|
cx: dotX,
|
|
@@ -32398,15 +32649,15 @@ var MinimapServiceNode = (0, import_react61.memo)(({
|
|
|
32398
32649
|
});
|
|
32399
32650
|
|
|
32400
32651
|
// src/components/trace-graph/trace-graph.tsx
|
|
32401
|
-
var
|
|
32652
|
+
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
32402
32653
|
var nodeTypes = {
|
|
32403
32654
|
service: ServiceNode
|
|
32404
32655
|
};
|
|
32405
32656
|
var ExtentUpdater = ({ onUpdate, viewportRef }) => {
|
|
32406
|
-
const zoom = (0,
|
|
32407
|
-
const width = (0,
|
|
32408
|
-
const height = (0,
|
|
32409
|
-
(0,
|
|
32657
|
+
const zoom = (0, import_react63.useStore)((s) => s.transform[2]);
|
|
32658
|
+
const width = (0, import_react63.useStore)((s) => s.width);
|
|
32659
|
+
const height = (0, import_react63.useStore)((s) => s.height);
|
|
32660
|
+
(0, import_react64.useEffect)(() => {
|
|
32410
32661
|
viewportRef.current = { height, width, zoom };
|
|
32411
32662
|
onUpdate();
|
|
32412
32663
|
}, [zoom, width, height, onUpdate, viewportRef]);
|
|
@@ -32418,12 +32669,12 @@ var TraceGraph = ({
|
|
|
32418
32669
|
onRefresh,
|
|
32419
32670
|
spans
|
|
32420
32671
|
}) => {
|
|
32421
|
-
const [nodes2, setNodes, onNodesChange] = (0,
|
|
32422
|
-
const [edges, setEdges] = (0,
|
|
32423
|
-
const [translateExtent, setTranslateExtent] = (0,
|
|
32424
|
-
const nodeBoundsRef = (0,
|
|
32425
|
-
const viewportRef = (0,
|
|
32426
|
-
const updateExtent = (0,
|
|
32672
|
+
const [nodes2, setNodes, onNodesChange] = (0, import_react63.useNodesState)([]);
|
|
32673
|
+
const [edges, setEdges] = (0, import_react63.useEdgesState)([]);
|
|
32674
|
+
const [translateExtent, setTranslateExtent] = (0, import_react64.useState)();
|
|
32675
|
+
const nodeBoundsRef = (0, import_react64.useRef)(null);
|
|
32676
|
+
const viewportRef = (0, import_react64.useRef)({ height: 0, width: 0, zoom: 1 });
|
|
32677
|
+
const updateExtent = (0, import_react64.useCallback)(() => {
|
|
32427
32678
|
const bounds = nodeBoundsRef.current;
|
|
32428
32679
|
const { height, width, zoom } = viewportRef.current;
|
|
32429
32680
|
if (!bounds || width === 0 || height === 0) return;
|
|
@@ -32436,7 +32687,7 @@ var TraceGraph = ({
|
|
|
32436
32687
|
[bounds.maxX + hMargin, bounds.maxY + vMargin]
|
|
32437
32688
|
]);
|
|
32438
32689
|
}, []);
|
|
32439
|
-
(0,
|
|
32690
|
+
(0, import_react64.useEffect)(() => {
|
|
32440
32691
|
const allNodes = [];
|
|
32441
32692
|
const allEdges = [];
|
|
32442
32693
|
for (const span of spans.data ?? []) {
|
|
@@ -32451,15 +32702,15 @@ var TraceGraph = ({
|
|
|
32451
32702
|
},
|
|
32452
32703
|
id: span.span_id,
|
|
32453
32704
|
position: { x: 0, y: 0 },
|
|
32454
|
-
sourcePosition:
|
|
32455
|
-
targetPosition:
|
|
32705
|
+
sourcePosition: import_react63.Position.Right,
|
|
32706
|
+
targetPosition: import_react63.Position.Left,
|
|
32456
32707
|
type: "service"
|
|
32457
32708
|
});
|
|
32458
32709
|
if (span.parent_span_id !== null) {
|
|
32459
32710
|
allEdges.push({
|
|
32460
32711
|
animated: false,
|
|
32461
32712
|
id: `e-${span.parent_span_id}-${span.span_id}`,
|
|
32462
|
-
markerEnd: { color: "lightgray", height: 16, type:
|
|
32713
|
+
markerEnd: { color: "lightgray", height: 16, type: import_react63.MarkerType.Arrow, width: 16 },
|
|
32463
32714
|
source: span.parent_span_id,
|
|
32464
32715
|
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
32465
32716
|
target: span.span_id
|
|
@@ -32468,7 +32719,7 @@ var TraceGraph = ({
|
|
|
32468
32719
|
for (const outgoingLinkSpanId of span.outgoing_link_span_ids ?? []) {
|
|
32469
32720
|
allEdges.push({
|
|
32470
32721
|
id: `e-link-${outgoingLinkSpanId}-${span.span_id}`,
|
|
32471
|
-
markerEnd: { color: "lightgray", height: 16, type:
|
|
32722
|
+
markerEnd: { color: "lightgray", height: 16, type: import_react63.MarkerType.Arrow, width: 16 },
|
|
32472
32723
|
source: outgoingLinkSpanId,
|
|
32473
32724
|
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
32474
32725
|
// animated: true,
|
|
@@ -32508,12 +32759,12 @@ var TraceGraph = ({
|
|
|
32508
32759
|
updateExtent();
|
|
32509
32760
|
}
|
|
32510
32761
|
}, [spans.data, initialFocusEventId, setNodes, setEdges, updateExtent]);
|
|
32511
|
-
const theme = (0,
|
|
32512
|
-
return /* @__PURE__ */ (0,
|
|
32513
|
-
spans.error && /* @__PURE__ */ (0,
|
|
32514
|
-
|
|
32762
|
+
const theme = (0, import_material24.useTheme)();
|
|
32763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_jsx_runtime146.Fragment, { children: [
|
|
32764
|
+
spans.error && /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
|
|
32765
|
+
import_material24.Alert,
|
|
32515
32766
|
{
|
|
32516
|
-
action: /* @__PURE__ */ (0,
|
|
32767
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_material24.Button, { onClick: () => {
|
|
32517
32768
|
onRefresh();
|
|
32518
32769
|
}, children: "Retry" }),
|
|
32519
32770
|
severity: "error",
|
|
@@ -32525,8 +32776,8 @@ var TraceGraph = ({
|
|
|
32525
32776
|
]
|
|
32526
32777
|
}
|
|
32527
32778
|
),
|
|
32528
|
-
/* @__PURE__ */ (0,
|
|
32529
|
-
|
|
32779
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
|
|
32780
|
+
import_react63.ReactFlow,
|
|
32530
32781
|
{
|
|
32531
32782
|
colorMode: theme.palette.mode,
|
|
32532
32783
|
"data-testid": TRACE_GRAPH_TEST_ID,
|
|
@@ -32545,18 +32796,18 @@ var TraceGraph = ({
|
|
|
32545
32796
|
selectNodesOnDrag: false,
|
|
32546
32797
|
translateExtent,
|
|
32547
32798
|
children: [
|
|
32548
|
-
/* @__PURE__ */ (0,
|
|
32549
|
-
/* @__PURE__ */ (0,
|
|
32550
|
-
/* @__PURE__ */ (0,
|
|
32551
|
-
|
|
32799
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(ExtentUpdater, { onUpdate: updateExtent, viewportRef }),
|
|
32800
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Controls, {}),
|
|
32801
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
32802
|
+
import_react63.MiniMap,
|
|
32552
32803
|
{
|
|
32553
32804
|
nodeComponent: MinimapServiceNode,
|
|
32554
32805
|
pannable: true,
|
|
32555
32806
|
zoomable: true
|
|
32556
32807
|
}
|
|
32557
32808
|
),
|
|
32558
|
-
/* @__PURE__ */ (0,
|
|
32559
|
-
|
|
32809
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
32810
|
+
import_react63.Background,
|
|
32560
32811
|
{
|
|
32561
32812
|
bgColor: theme.palette.background.default,
|
|
32562
32813
|
color: theme.palette.text.disabled
|
|
@@ -32569,7 +32820,7 @@ var TraceGraph = ({
|
|
|
32569
32820
|
};
|
|
32570
32821
|
|
|
32571
32822
|
// src/pages/trace-graph-page.tsx
|
|
32572
|
-
var
|
|
32823
|
+
var import_jsx_runtime147 = require("react/jsx-runtime");
|
|
32573
32824
|
var DRAWER_WIDTH = "35%";
|
|
32574
32825
|
var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
|
|
32575
32826
|
flexGrow: 1,
|
|
@@ -32586,7 +32837,7 @@ var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) =>
|
|
|
32586
32837
|
})
|
|
32587
32838
|
}
|
|
32588
32839
|
}));
|
|
32589
|
-
var StyledDrawer = (0, import_styles.styled)(
|
|
32840
|
+
var StyledDrawer = (0, import_styles.styled)(import_material25.Drawer)({
|
|
32590
32841
|
"& .MuiDrawer-paper": {
|
|
32591
32842
|
bottom: 0,
|
|
32592
32843
|
boxSizing: "border-box",
|
|
@@ -32613,8 +32864,8 @@ var TraceGraphView = ({
|
|
|
32613
32864
|
spans,
|
|
32614
32865
|
traceId
|
|
32615
32866
|
}) => {
|
|
32616
|
-
return /* @__PURE__ */ (0,
|
|
32617
|
-
|
|
32867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(
|
|
32868
|
+
import_material25.Paper,
|
|
32618
32869
|
{
|
|
32619
32870
|
"data-testid": TRACE_GRAPH_PAGE_TEST_ID,
|
|
32620
32871
|
square: true,
|
|
@@ -32626,11 +32877,11 @@ var TraceGraphView = ({
|
|
|
32626
32877
|
width: "100%"
|
|
32627
32878
|
},
|
|
32628
32879
|
children: [
|
|
32629
|
-
/* @__PURE__ */ (0,
|
|
32630
|
-
/* @__PURE__ */ (0,
|
|
32880
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Main, { open, children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_material25.Box, { sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
32881
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material25.Box, { sx: { display: "flex", px: 1, py: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material25.Button, { onClick: () => {
|
|
32631
32882
|
navigateToSpansList();
|
|
32632
|
-
}, startIcon: /* @__PURE__ */ (0,
|
|
32633
|
-
/* @__PURE__ */ (0,
|
|
32883
|
+
}, startIcon: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_icons_material15.ArrowBack, {}), children: "Go back" }) }),
|
|
32884
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material25.Box, { sx: { flexGrow: 1, overflow: "auto" }, children: traceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_react65.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
32634
32885
|
TraceGraph,
|
|
32635
32886
|
{
|
|
32636
32887
|
initialFocusEventId: spanId,
|
|
@@ -32646,7 +32897,7 @@ var TraceGraphView = ({
|
|
|
32646
32897
|
}
|
|
32647
32898
|
) }) })
|
|
32648
32899
|
] }) }),
|
|
32649
|
-
/* @__PURE__ */ (0,
|
|
32900
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(EventDetails, { onClose: handleClose, selectedEvent }) })
|
|
32650
32901
|
]
|
|
32651
32902
|
}
|
|
32652
32903
|
);
|
|
@@ -32694,10 +32945,10 @@ async function fetchConnectedTracesWaterfall(api, traceIds, allSpans = /* @__PUR
|
|
|
32694
32945
|
}
|
|
32695
32946
|
var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
32696
32947
|
const api = useAppInspectorApi();
|
|
32697
|
-
const [spans, setSpans] = (0,
|
|
32698
|
-
const [loading, setLoading] = (0,
|
|
32699
|
-
const [fetchError, setFetchError] = (0,
|
|
32700
|
-
const fetchSpans = (0,
|
|
32948
|
+
const [spans, setSpans] = (0, import_react66.useState)();
|
|
32949
|
+
const [loading, setLoading] = (0, import_react66.useState)(false);
|
|
32950
|
+
const [fetchError, setFetchError] = (0, import_react66.useState)();
|
|
32951
|
+
const fetchSpans = (0, import_react66.useCallback)(async () => {
|
|
32701
32952
|
setLoading(true);
|
|
32702
32953
|
try {
|
|
32703
32954
|
const spans2 = await fetchConnectedTraces(api, traceId);
|
|
@@ -32710,27 +32961,27 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32710
32961
|
setLoading(false);
|
|
32711
32962
|
}
|
|
32712
32963
|
}, [api, traceId]);
|
|
32713
|
-
(0,
|
|
32964
|
+
(0, import_react66.useEffect)(() => {
|
|
32714
32965
|
void fetchSpans();
|
|
32715
32966
|
}, [fetchSpans]);
|
|
32716
|
-
const [open, setOpen] = (0,
|
|
32717
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
32718
|
-
const spansReference = (0,
|
|
32719
|
-
(0,
|
|
32967
|
+
const [open, setOpen] = (0, import_react66.useState)(true);
|
|
32968
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react66.useState)(() => spans?.find((span) => span.span_id === spanId));
|
|
32969
|
+
const spansReference = (0, import_react66.useRef)();
|
|
32970
|
+
(0, import_react66.useEffect)(() => {
|
|
32720
32971
|
if (!spansReference.current && spans) {
|
|
32721
32972
|
setSelectedEvent(spans.find((span) => span.span_id === spanId));
|
|
32722
32973
|
spansReference.current = spans;
|
|
32723
32974
|
}
|
|
32724
32975
|
}, [spans, setSelectedEvent, spanId]);
|
|
32725
|
-
const handleEventSelect = (0,
|
|
32976
|
+
const handleEventSelect = (0, import_react66.useCallback)((spanId2) => {
|
|
32726
32977
|
const span = spans?.find((s) => s.span_id === spanId2);
|
|
32727
32978
|
setSelectedEvent(span);
|
|
32728
32979
|
setOpen(true);
|
|
32729
32980
|
}, [spans]);
|
|
32730
|
-
const navigateToSpansList = (0,
|
|
32981
|
+
const navigateToSpansList = (0, import_react66.useCallback)(() => {
|
|
32731
32982
|
onClose?.();
|
|
32732
32983
|
}, [onClose]);
|
|
32733
|
-
return /* @__PURE__ */ (0,
|
|
32984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
32734
32985
|
TraceGraphView,
|
|
32735
32986
|
{
|
|
32736
32987
|
fetchError,
|
|
@@ -32751,57 +33002,67 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32751
33002
|
};
|
|
32752
33003
|
|
|
32753
33004
|
// src/pages/spans-list-page.tsx
|
|
32754
|
-
var
|
|
33005
|
+
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
32755
33006
|
var SpansListPage = () => {
|
|
32756
33007
|
const api = useAppInspectorApi();
|
|
32757
33008
|
const {
|
|
32758
33009
|
clearFetchError,
|
|
32759
33010
|
clearingSpans,
|
|
32760
33011
|
clearSpans,
|
|
33012
|
+
consumerValues,
|
|
32761
33013
|
errorCount,
|
|
32762
33014
|
fetchError,
|
|
32763
33015
|
fetchForward,
|
|
32764
33016
|
fetchingBackward,
|
|
32765
33017
|
fetchingForward,
|
|
33018
|
+
filteredErrorCount,
|
|
33019
|
+
filteredSpans,
|
|
33020
|
+
filteredWarningCount,
|
|
33021
|
+
filters,
|
|
33022
|
+
hasExternalProducer,
|
|
32766
33023
|
hasMoreBackward,
|
|
32767
33024
|
hasMoreForward,
|
|
32768
33025
|
licenseLimit,
|
|
33026
|
+
producerValues,
|
|
33027
|
+
retryWorker,
|
|
32769
33028
|
search,
|
|
32770
33029
|
searching,
|
|
33030
|
+
setFilters,
|
|
32771
33031
|
setSearch,
|
|
32772
|
-
|
|
33032
|
+
statusValues,
|
|
32773
33033
|
systemLimit,
|
|
32774
33034
|
totalCount,
|
|
32775
|
-
warningCount
|
|
33035
|
+
warningCount,
|
|
33036
|
+
workerError
|
|
32776
33037
|
} = useSpans();
|
|
32777
33038
|
const { checkStatus, phase, status, statusError } = useAppInspectorStatus();
|
|
32778
|
-
const clearSpansSync = (0,
|
|
33039
|
+
const clearSpansSync = (0, import_react67.useCallback)(() => {
|
|
32779
33040
|
void clearSpans();
|
|
32780
33041
|
}, [clearSpans]);
|
|
32781
33042
|
const localstackVersion = status?.localstackVersion ?? (statusError instanceof AppInspectorNotFoundError ? statusError.localstackVersion : void 0);
|
|
32782
33043
|
const versionCompatibility = checkEmulatorVersion(localstackVersion);
|
|
32783
33044
|
const searchSupported = emulatorSupportsSearch(localstackVersion);
|
|
32784
|
-
const [bannerDismissed, setBannerDismissed] = (0,
|
|
33045
|
+
const [bannerDismissed, setBannerDismissed] = (0, import_react67.useState)(false);
|
|
32785
33046
|
const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
|
|
32786
|
-
const [selectedTraceId, setSelectedTraceId] = (0,
|
|
32787
|
-
const [selectedSpanId, setSelectedSpanId] = (0,
|
|
32788
|
-
const navigateToSpan = (0,
|
|
33047
|
+
const [selectedTraceId, setSelectedTraceId] = (0, import_react67.useState)();
|
|
33048
|
+
const [selectedSpanId, setSelectedSpanId] = (0, import_react67.useState)();
|
|
33049
|
+
const navigateToSpan = (0, import_react67.useCallback)((span) => {
|
|
32789
33050
|
setSelectedTraceId(span.trace_id);
|
|
32790
33051
|
setSelectedSpanId(span.span_id);
|
|
32791
33052
|
}, []);
|
|
32792
|
-
const handleRetry = (0,
|
|
33053
|
+
const handleRetry = (0, import_react67.useCallback)(() => {
|
|
32793
33054
|
checkStatus();
|
|
32794
33055
|
fetchForward();
|
|
32795
33056
|
}, [checkStatus, fetchForward]);
|
|
32796
|
-
const handleEnable = (0,
|
|
33057
|
+
const handleEnable = (0, import_react67.useCallback)(async () => {
|
|
32797
33058
|
await api.setStatus({ status: "ENABLED" });
|
|
32798
33059
|
clearFetchError();
|
|
32799
33060
|
checkStatus();
|
|
32800
33061
|
}, [api, checkStatus, clearFetchError]);
|
|
32801
|
-
const isDelayedRefetchRef = (0,
|
|
32802
|
-
const delayedRefetchTimerRef = (0,
|
|
32803
|
-
const prevFetchingForwardRef = (0,
|
|
32804
|
-
(0,
|
|
33062
|
+
const isDelayedRefetchRef = (0, import_react67.useRef)(false);
|
|
33063
|
+
const delayedRefetchTimerRef = (0, import_react67.useRef)();
|
|
33064
|
+
const prevFetchingForwardRef = (0, import_react67.useRef)(false);
|
|
33065
|
+
(0, import_react67.useEffect)(() => {
|
|
32805
33066
|
const wasFetching = prevFetchingForwardRef.current;
|
|
32806
33067
|
prevFetchingForwardRef.current = fetchingForward;
|
|
32807
33068
|
if (wasFetching && !fetchingForward) {
|
|
@@ -32822,10 +33083,10 @@ var SpansListPage = () => {
|
|
|
32822
33083
|
switch (phase) {
|
|
32823
33084
|
case "CHECKING_STATUS":
|
|
32824
33085
|
case "CONNECTING_WS": {
|
|
32825
|
-
return /* @__PURE__ */ (0,
|
|
33086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(StatusMessage, { phase });
|
|
32826
33087
|
}
|
|
32827
33088
|
case "DISABLED": {
|
|
32828
|
-
return /* @__PURE__ */ (0,
|
|
33089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
32829
33090
|
StatusMessage,
|
|
32830
33091
|
{
|
|
32831
33092
|
onEnable: handleEnable,
|
|
@@ -32834,7 +33095,7 @@ var SpansListPage = () => {
|
|
|
32834
33095
|
);
|
|
32835
33096
|
}
|
|
32836
33097
|
case "INCOMPATIBLE": {
|
|
32837
|
-
return /* @__PURE__ */ (0,
|
|
33098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
32838
33099
|
StatusMessage,
|
|
32839
33100
|
{
|
|
32840
33101
|
localstackVersion,
|
|
@@ -32844,10 +33105,13 @@ var SpansListPage = () => {
|
|
|
32844
33105
|
);
|
|
32845
33106
|
}
|
|
32846
33107
|
case "LIVE": {
|
|
33108
|
+
if (workerError) {
|
|
33109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(WorkerErrorMessage, { error: workerError, onRetry: retryWorker });
|
|
33110
|
+
}
|
|
32847
33111
|
break;
|
|
32848
33112
|
}
|
|
32849
33113
|
case "UNREACHABLE": {
|
|
32850
|
-
return /* @__PURE__ */ (0,
|
|
33114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
32851
33115
|
StatusMessage,
|
|
32852
33116
|
{
|
|
32853
33117
|
onRetry: handleRetry,
|
|
@@ -32856,9 +33120,9 @@ var SpansListPage = () => {
|
|
|
32856
33120
|
);
|
|
32857
33121
|
}
|
|
32858
33122
|
}
|
|
32859
|
-
return /* @__PURE__ */ (0,
|
|
32860
|
-
/* @__PURE__ */ (0,
|
|
32861
|
-
|
|
33123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_material26.Paper, { square: true, sx: { display: "flex", flexDirection: "column", flexGrow: 1 }, children: [
|
|
33124
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(
|
|
33125
|
+
import_material26.Box,
|
|
32862
33126
|
{
|
|
32863
33127
|
"data-testid": SPANS_LIST_PAGE_TEST_ID,
|
|
32864
33128
|
sx: {
|
|
@@ -32873,7 +33137,7 @@ var SpansListPage = () => {
|
|
|
32873
33137
|
width: "100%"
|
|
32874
33138
|
},
|
|
32875
33139
|
children: [
|
|
32876
|
-
/* @__PURE__ */ (0,
|
|
33140
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
32877
33141
|
EmulatorVersionBanner,
|
|
32878
33142
|
{
|
|
32879
33143
|
compatibility: bannerDismissed && versionCompatibility === "warning" ? "ok" : versionCompatibility,
|
|
@@ -32883,27 +33147,35 @@ var SpansListPage = () => {
|
|
|
32883
33147
|
} : void 0
|
|
32884
33148
|
}
|
|
32885
33149
|
),
|
|
32886
|
-
/* @__PURE__ */ (0,
|
|
33150
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
32887
33151
|
SpansList,
|
|
32888
33152
|
{
|
|
32889
33153
|
clearingSpans,
|
|
33154
|
+
consumerValues,
|
|
32890
33155
|
errorCount,
|
|
32891
33156
|
fetchError,
|
|
32892
33157
|
fetchingBackward,
|
|
32893
33158
|
fetchingForward,
|
|
33159
|
+
filteredErrorCount,
|
|
33160
|
+
filteredSpans,
|
|
33161
|
+
filteredWarningCount,
|
|
33162
|
+
filters,
|
|
33163
|
+
hasExternalProducer,
|
|
32894
33164
|
hasMoreBackward,
|
|
32895
33165
|
hasMoreForward,
|
|
32896
33166
|
licenseLimit,
|
|
32897
33167
|
onClearSpans: clearSpansSync,
|
|
32898
33168
|
onFetchForward: fetchForward,
|
|
33169
|
+
onFiltersChange: setFilters,
|
|
32899
33170
|
onOrderChange: setOrder,
|
|
32900
33171
|
onSearchChange: setSearch,
|
|
32901
33172
|
onSpanClick: navigateToSpan,
|
|
32902
33173
|
order: order2,
|
|
33174
|
+
producerValues,
|
|
32903
33175
|
search,
|
|
32904
33176
|
searching,
|
|
32905
33177
|
searchSupported,
|
|
32906
|
-
|
|
33178
|
+
statusValues,
|
|
32907
33179
|
systemLimit,
|
|
32908
33180
|
totalCount,
|
|
32909
33181
|
warningCount
|
|
@@ -32912,7 +33184,7 @@ var SpansListPage = () => {
|
|
|
32912
33184
|
]
|
|
32913
33185
|
}
|
|
32914
33186
|
),
|
|
32915
|
-
selectedTraceId !== void 0 && /* @__PURE__ */ (0,
|
|
33187
|
+
selectedTraceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(TraceGraphPage, { onClose: () => {
|
|
32916
33188
|
setSelectedTraceId(void 0);
|
|
32917
33189
|
}, spanId: selectedSpanId, traceId: selectedTraceId })
|
|
32918
33190
|
] });
|