@localstack/appinspector-ui 1.0.163 → 1.0.165
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 +918 -764
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +846 -692
- 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 {
|
|
@@ -7398,10 +7398,10 @@ var createHtmlRenderState = function() {
|
|
|
7398
7398
|
};
|
|
7399
7399
|
|
|
7400
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
|
|
7401
|
-
function copyRawValuesOnly(target,
|
|
7402
|
-
for (var key in
|
|
7403
|
-
if (!isMotionValue(
|
|
7404
|
-
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];
|
|
7405
7405
|
}
|
|
7406
7406
|
}
|
|
7407
7407
|
}
|
|
@@ -10187,22 +10187,22 @@ function isNear(value, target, maxDistance) {
|
|
|
10187
10187
|
}
|
|
10188
10188
|
return distance(value, target) < maxDistance;
|
|
10189
10189
|
}
|
|
10190
|
-
function calcAxisDelta(delta,
|
|
10190
|
+
function calcAxisDelta(delta, source2, target, origin) {
|
|
10191
10191
|
if (origin === void 0) {
|
|
10192
10192
|
origin = 0.5;
|
|
10193
10193
|
}
|
|
10194
10194
|
delta.origin = origin;
|
|
10195
|
-
delta.originPoint = mix(
|
|
10196
|
-
delta.scale = calcLength(target) / calcLength(
|
|
10195
|
+
delta.originPoint = mix(source2.min, source2.max, delta.origin);
|
|
10196
|
+
delta.scale = calcLength(target) / calcLength(source2);
|
|
10197
10197
|
if (isNear(delta.scale, 1, 1e-4) || isNaN(delta.scale))
|
|
10198
10198
|
delta.scale = 1;
|
|
10199
10199
|
delta.translate = mix(target.min, target.max, delta.origin) - delta.originPoint;
|
|
10200
10200
|
if (isNear(delta.translate) || isNaN(delta.translate))
|
|
10201
10201
|
delta.translate = 0;
|
|
10202
10202
|
}
|
|
10203
|
-
function calcBoxDelta(delta,
|
|
10204
|
-
calcAxisDelta(delta.x,
|
|
10205
|
-
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);
|
|
10206
10206
|
}
|
|
10207
10207
|
function calcRelativeAxis(target, relative, parent) {
|
|
10208
10208
|
target.min = parent.min + relative.min;
|
|
@@ -10259,14 +10259,14 @@ function calcViewportConstraints(layoutBox, constraintsBox) {
|
|
|
10259
10259
|
y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y)
|
|
10260
10260
|
};
|
|
10261
10261
|
}
|
|
10262
|
-
function calcOrigin2(
|
|
10262
|
+
function calcOrigin2(source2, target) {
|
|
10263
10263
|
var origin = 0.5;
|
|
10264
|
-
var sourceLength = calcLength(
|
|
10264
|
+
var sourceLength = calcLength(source2);
|
|
10265
10265
|
var targetLength = calcLength(target);
|
|
10266
10266
|
if (targetLength > sourceLength) {
|
|
10267
|
-
origin = progress(target.min, target.max - sourceLength,
|
|
10267
|
+
origin = progress(target.min, target.max - sourceLength, source2.min);
|
|
10268
10268
|
} else if (sourceLength > targetLength) {
|
|
10269
|
-
origin = progress(
|
|
10269
|
+
origin = progress(source2.min, source2.max - targetLength, target.min);
|
|
10270
10270
|
}
|
|
10271
10271
|
return clamp2(0, 1, origin);
|
|
10272
10272
|
}
|
|
@@ -13080,22 +13080,6 @@ var ResponsiveTimestampCell = (0, import_react31.memo)(({ date }) => {
|
|
|
13080
13080
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { display: "inline-block", width: "100%" }, children: formattedTime });
|
|
13081
13081
|
});
|
|
13082
13082
|
|
|
13083
|
-
// src/types/error-levels.ts
|
|
13084
|
-
var ErrorLevel = {
|
|
13085
|
-
ERROR: 3,
|
|
13086
|
-
// General error
|
|
13087
|
-
IAM_PERMISSION: 5,
|
|
13088
|
-
// IAM permission issues
|
|
13089
|
-
OK: 2,
|
|
13090
|
-
// OK
|
|
13091
|
-
// Standard OTEL status codes
|
|
13092
|
-
UNSET: 1,
|
|
13093
|
-
// Unset
|
|
13094
|
-
// Extended custom levels
|
|
13095
|
-
WARNING: 4
|
|
13096
|
-
// Warning
|
|
13097
|
-
};
|
|
13098
|
-
|
|
13099
13083
|
// src/utils/service-display-name.ts
|
|
13100
13084
|
var SERVICE_DISPLAY_NAME = {
|
|
13101
13085
|
"account": "Account",
|
|
@@ -15208,6 +15192,22 @@ ServiceCell.displayName = "ServiceCell";
|
|
|
15208
15192
|
var import_icons_material = require("@mui/icons-material");
|
|
15209
15193
|
var import_material4 = require("@mui/material");
|
|
15210
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
|
+
|
|
15211
15211
|
// src/utils/iam-utils.ts
|
|
15212
15212
|
function determinePermissionStatus(payload) {
|
|
15213
15213
|
if (payload.explicit_deny_count && payload.explicit_deny_count > 0) {
|
|
@@ -15294,25 +15294,7 @@ function parseIAMEvent(payloadString) {
|
|
|
15294
15294
|
}
|
|
15295
15295
|
}
|
|
15296
15296
|
|
|
15297
|
-
// src/
|
|
15298
|
-
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
15299
|
-
var StatusIcon = ({ errorLevel, operationStatus, spanStatusCode }) => {
|
|
15300
|
-
switch (errorLevel) {
|
|
15301
|
-
case ErrorLevel.ERROR: {
|
|
15302
|
-
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.Cancel, { sx: { color: "red" } });
|
|
15303
|
-
}
|
|
15304
|
-
case ErrorLevel.IAM_PERMISSION: {
|
|
15305
|
-
const isDenial = operationStatus ? operationStatus === "iam_explicit_deny" || operationStatus === "iam_implicit_deny" : spanStatusCode === 2;
|
|
15306
|
-
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.GppBad, { sx: { color: isDenial ? "red" : "warning.main" } });
|
|
15307
|
-
}
|
|
15308
|
-
case ErrorLevel.WARNING: {
|
|
15309
|
-
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_icons_material.Error, { sx: { color: "orange" } });
|
|
15310
|
-
}
|
|
15311
|
-
default: {
|
|
15312
|
-
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_jsx_runtime124.Fragment, {});
|
|
15313
|
-
}
|
|
15314
|
-
}
|
|
15315
|
-
};
|
|
15297
|
+
// src/utils/error-level.ts
|
|
15316
15298
|
var calculateHighestErrorLevel = (span) => {
|
|
15317
15299
|
if (span.operation_status) {
|
|
15318
15300
|
switch (span.operation_status) {
|
|
@@ -15344,6 +15326,26 @@ var calculateHighestErrorLevel = (span) => {
|
|
|
15344
15326
|
if (hasWarning) return ErrorLevel.WARNING;
|
|
15345
15327
|
return span.status_code || ErrorLevel.UNSET;
|
|
15346
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
|
+
};
|
|
15347
15349
|
var SPAN_STATUS_LABELS = {
|
|
15348
15350
|
0: "Unset",
|
|
15349
15351
|
1: "OK",
|
|
@@ -15503,47 +15505,26 @@ var SpanCountBadge = ({ licenseLimit, systemLimit, totalCount, visibleCount }) =
|
|
|
15503
15505
|
var import_icons_material3 = require("@mui/icons-material");
|
|
15504
15506
|
var import_material6 = require("@mui/material");
|
|
15505
15507
|
var import_react37 = require("react");
|
|
15506
|
-
|
|
15508
|
+
|
|
15509
|
+
// src/utils/spans-filters.ts
|
|
15507
15510
|
var EMPTY_FILTERS = {
|
|
15508
15511
|
consumerService: [],
|
|
15509
15512
|
producerService: [],
|
|
15510
15513
|
status: []
|
|
15511
15514
|
};
|
|
15512
15515
|
var EXTERNAL_PRODUCER_VALUE = "__external__";
|
|
15513
|
-
function applyFilters(spans, filters) {
|
|
15514
|
-
if (isFiltersEmpty(filters)) return spans;
|
|
15515
|
-
return spans.filter((span) => {
|
|
15516
|
-
if (filters.consumerService.length > 0 && !filters.consumerService.includes(span.service_name)) {
|
|
15517
|
-
return false;
|
|
15518
|
-
}
|
|
15519
|
-
if (filters.producerService.length > 0) {
|
|
15520
|
-
const includesExternal = filters.producerService.includes(EXTERNAL_PRODUCER_VALUE);
|
|
15521
|
-
const namedServices = filters.producerService.filter((value) => value !== EXTERNAL_PRODUCER_VALUE);
|
|
15522
|
-
const matchesExternal = includesExternal && !span.parent_service_name;
|
|
15523
|
-
const matchesNamed = namedServices.length > 0 && !!span.parent_service_name && namedServices.includes(span.parent_service_name);
|
|
15524
|
-
if (!matchesExternal && !matchesNamed) return false;
|
|
15525
|
-
}
|
|
15526
|
-
if (filters.status.length > 0) {
|
|
15527
|
-
if (!span.operation_status) return false;
|
|
15528
|
-
if (!filters.status.includes(collapseStatusValue(span.operation_status))) return false;
|
|
15529
|
-
}
|
|
15530
|
-
return true;
|
|
15531
|
-
});
|
|
15532
|
-
}
|
|
15533
15516
|
function isFiltersEmpty(filters) {
|
|
15534
15517
|
return filters.consumerService.length === 0 && filters.producerService.length === 0 && filters.status.length === 0;
|
|
15535
15518
|
}
|
|
15519
|
+
|
|
15520
|
+
// src/components/spans-list/spans-filter-bar.tsx
|
|
15521
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
15536
15522
|
var STATUS_LABELS = {
|
|
15537
15523
|
error: "Error",
|
|
15538
15524
|
iam_deny: "IAM Deny",
|
|
15539
15525
|
iam_warn: "IAM Warning",
|
|
15540
15526
|
ok: "Success"
|
|
15541
15527
|
};
|
|
15542
|
-
var collapseStatusValue = (status) => {
|
|
15543
|
-
if (status === "iam_explicit_deny" || status === "iam_implicit_deny") return "iam_deny";
|
|
15544
|
-
if (status === "iam_explicit_warn" || status === "iam_implicit_warn") return "iam_warn";
|
|
15545
|
-
return status;
|
|
15546
|
-
};
|
|
15547
15528
|
var statusOptionIcon = (value) => {
|
|
15548
15529
|
switch (value) {
|
|
15549
15530
|
case "error": {
|
|
@@ -15843,21 +15824,29 @@ var SpansDataGridRow = (0, import_react38.memo)(
|
|
|
15843
15824
|
);
|
|
15844
15825
|
var SpansDataGrid = ({
|
|
15845
15826
|
clearingSpans,
|
|
15827
|
+
consumerValues,
|
|
15846
15828
|
errorCount: _errorCount,
|
|
15847
15829
|
fetchingBackward,
|
|
15848
15830
|
fetchingForward,
|
|
15831
|
+
filteredErrorCount,
|
|
15832
|
+
filteredSpans,
|
|
15833
|
+
filteredWarningCount,
|
|
15834
|
+
filters,
|
|
15835
|
+
hasExternalProducer,
|
|
15849
15836
|
hasMoreBackward,
|
|
15850
15837
|
hasMoreForward,
|
|
15851
15838
|
licenseLimit,
|
|
15852
15839
|
onClearSpans,
|
|
15840
|
+
onFiltersChange,
|
|
15853
15841
|
onOrderChange,
|
|
15854
15842
|
onSearchChange,
|
|
15855
15843
|
onSpanClick,
|
|
15856
15844
|
order: order2,
|
|
15845
|
+
producerValues,
|
|
15857
15846
|
search,
|
|
15858
15847
|
searching,
|
|
15859
15848
|
searchSupported,
|
|
15860
|
-
|
|
15849
|
+
statusValues,
|
|
15861
15850
|
systemLimit,
|
|
15862
15851
|
totalCount,
|
|
15863
15852
|
warningCount: _warningCount
|
|
@@ -15872,7 +15861,6 @@ var SpansDataGrid = ({
|
|
|
15872
15861
|
clearTimeout(handle);
|
|
15873
15862
|
};
|
|
15874
15863
|
}, [searchDraft, onSearchChange]);
|
|
15875
|
-
const [filters, setFilters] = (0, import_react38.useState)(EMPTY_FILTERS);
|
|
15876
15864
|
const filtersActive = !isFiltersEmpty(filters);
|
|
15877
15865
|
const activeFilterNames = [
|
|
15878
15866
|
filters.producerService.length > 0 && "Producer",
|
|
@@ -15887,17 +15875,15 @@ var SpansDataGrid = ({
|
|
|
15887
15875
|
const handleClearAll = (0, import_react38.useCallback)(() => {
|
|
15888
15876
|
setSearchDraft("");
|
|
15889
15877
|
onSearchChange("");
|
|
15890
|
-
|
|
15891
|
-
}, [onSearchChange]);
|
|
15878
|
+
onFiltersChange(EMPTY_FILTERS);
|
|
15879
|
+
}, [onSearchChange, onFiltersChange]);
|
|
15892
15880
|
const handleClearSpans = (0, import_react38.useCallback)(() => {
|
|
15893
15881
|
setSearchDraft("");
|
|
15894
|
-
|
|
15882
|
+
onFiltersChange(EMPTY_FILTERS);
|
|
15895
15883
|
onClearSpans();
|
|
15896
|
-
}, [onClearSpans]);
|
|
15884
|
+
}, [onClearSpans, onFiltersChange]);
|
|
15897
15885
|
const producerOptions = (0, import_react38.useMemo)(() => {
|
|
15898
|
-
const services = new Set(
|
|
15899
|
-
spans?.map((span) => span.parent_service_name).filter(Boolean) ?? []
|
|
15900
|
-
);
|
|
15886
|
+
const services = new Set(producerValues);
|
|
15901
15887
|
for (const value of filters.producerService) {
|
|
15902
15888
|
if (value !== EXTERNAL_PRODUCER_VALUE) services.add(value);
|
|
15903
15889
|
}
|
|
@@ -15906,48 +15892,29 @@ var SpansDataGrid = ({
|
|
|
15906
15892
|
serviceCode: service,
|
|
15907
15893
|
value: service
|
|
15908
15894
|
}));
|
|
15909
|
-
const hasExternalProducer = spans?.some((span) => !span.parent_service_name);
|
|
15910
15895
|
if (hasExternalProducer || filters.producerService.includes(EXTERNAL_PRODUCER_VALUE)) {
|
|
15911
15896
|
options.push({ label: "External producer", value: EXTERNAL_PRODUCER_VALUE });
|
|
15912
15897
|
}
|
|
15913
15898
|
return options;
|
|
15914
|
-
}, [
|
|
15899
|
+
}, [producerValues, hasExternalProducer, filters.producerService]);
|
|
15915
15900
|
const consumerOptions = (0, import_react38.useMemo)(() => {
|
|
15916
|
-
const services = new Set(
|
|
15901
|
+
const services = new Set(consumerValues);
|
|
15917
15902
|
for (const value of filters.consumerService) services.add(value);
|
|
15918
15903
|
return [...services].toSorted().map((service) => ({
|
|
15919
15904
|
label: getServiceDisplayName(service),
|
|
15920
15905
|
serviceCode: service,
|
|
15921
15906
|
value: service
|
|
15922
15907
|
}));
|
|
15923
|
-
}, [
|
|
15908
|
+
}, [consumerValues, filters.consumerService]);
|
|
15924
15909
|
const statusOptions = (0, import_react38.useMemo)(() => {
|
|
15925
|
-
const statuses = new Set(
|
|
15926
|
-
spans?.map((span) => span.operation_status).filter(Boolean).map((s) => collapseStatusValue(s))
|
|
15927
|
-
);
|
|
15910
|
+
const statuses = new Set(statusValues);
|
|
15928
15911
|
for (const value of filters.status) statuses.add(value);
|
|
15929
15912
|
return [...statuses].toSorted().map((status) => ({
|
|
15930
15913
|
icon: statusOptionIcon(status),
|
|
15931
15914
|
label: STATUS_LABELS[status] ?? status,
|
|
15932
15915
|
value: status
|
|
15933
15916
|
}));
|
|
15934
|
-
}, [
|
|
15935
|
-
const filteredSpans = (0, import_react38.useMemo)(() => {
|
|
15936
|
-
if (!spans) return;
|
|
15937
|
-
if (!filtersActive) return spans;
|
|
15938
|
-
return applyFilters(spans, filters);
|
|
15939
|
-
}, [spans, filters, filtersActive]);
|
|
15940
|
-
const filteredErrorCount = (0, import_react38.useMemo)(
|
|
15941
|
-
() => filteredSpans?.filter((span) => {
|
|
15942
|
-
const level = calculateHighestErrorLevel(span);
|
|
15943
|
-
return level === ErrorLevel.ERROR || level === ErrorLevel.IAM_PERMISSION;
|
|
15944
|
-
}).length,
|
|
15945
|
-
[filteredSpans]
|
|
15946
|
-
);
|
|
15947
|
-
const filteredWarningCount = (0, import_react38.useMemo)(
|
|
15948
|
-
() => filteredSpans?.filter((span) => calculateHighestErrorLevel(span) === ErrorLevel.WARNING).length,
|
|
15949
|
-
[filteredSpans]
|
|
15950
|
-
);
|
|
15917
|
+
}, [statusValues, filters.status]);
|
|
15951
15918
|
const columns = (0, import_react38.useMemo)(() => [
|
|
15952
15919
|
columnHelper.accessor("startTime", {
|
|
15953
15920
|
cell: (props) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ResponsiveTimestampCell, { date: props.getValue() }),
|
|
@@ -16084,7 +16051,7 @@ var SpansDataGrid = ({
|
|
|
16084
16051
|
const element = containerRef.current;
|
|
16085
16052
|
if (!element || !isAtLiveEdgeRef.current) return;
|
|
16086
16053
|
element.scrollTop = element.scrollHeight;
|
|
16087
|
-
}, [order2,
|
|
16054
|
+
}, [order2, filteredSpans?.length, lastSpanId]);
|
|
16088
16055
|
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
|
|
16089
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: [
|
|
16090
16057
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material7.Box, { sx: { alignItems: "center", display: "flex", flexWrap: "wrap", gap: "0.5rem" }, children: [
|
|
@@ -16102,7 +16069,7 @@ var SpansDataGrid = ({
|
|
|
16102
16069
|
{
|
|
16103
16070
|
consumerOptions,
|
|
16104
16071
|
filters,
|
|
16105
|
-
onFiltersChange
|
|
16072
|
+
onFiltersChange,
|
|
16106
16073
|
producerOptions,
|
|
16107
16074
|
statusOptions
|
|
16108
16075
|
}
|
|
@@ -16221,7 +16188,7 @@ var SpansDataGrid = ({
|
|
|
16221
16188
|
)) }, headerGroup.id);
|
|
16222
16189
|
}) }),
|
|
16223
16190
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material7.TableBody, { children: [
|
|
16224
|
-
(
|
|
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 } }) }) }),
|
|
16225
16192
|
!clearingSpans && !searching && filteredSpans?.length === 0 && (searchActive || filtersActive ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
16226
16193
|
NoMatchRow,
|
|
16227
16194
|
{
|
|
@@ -16328,21 +16295,29 @@ var SpansList = (props) => {
|
|
|
16328
16295
|
SpansDataGrid,
|
|
16329
16296
|
{
|
|
16330
16297
|
clearingSpans: props.clearingSpans,
|
|
16298
|
+
consumerValues: props.consumerValues,
|
|
16331
16299
|
errorCount: props.errorCount,
|
|
16332
16300
|
fetchingBackward: props.fetchingBackward,
|
|
16333
16301
|
fetchingForward: props.fetchingForward,
|
|
16302
|
+
filteredErrorCount: props.filteredErrorCount,
|
|
16303
|
+
filteredSpans: props.filteredSpans,
|
|
16304
|
+
filteredWarningCount: props.filteredWarningCount,
|
|
16305
|
+
filters: props.filters,
|
|
16306
|
+
hasExternalProducer: props.hasExternalProducer,
|
|
16334
16307
|
hasMoreBackward: props.hasMoreBackward,
|
|
16335
16308
|
hasMoreForward: props.hasMoreForward,
|
|
16336
16309
|
licenseLimit: props.licenseLimit,
|
|
16337
16310
|
onClearSpans: props.onClearSpans,
|
|
16311
|
+
onFiltersChange: props.onFiltersChange,
|
|
16338
16312
|
onOrderChange: props.onOrderChange,
|
|
16339
16313
|
onSearchChange: props.onSearchChange,
|
|
16340
16314
|
onSpanClick: props.onSpanClick,
|
|
16341
16315
|
order: props.order,
|
|
16316
|
+
producerValues: props.producerValues,
|
|
16342
16317
|
search: props.search,
|
|
16343
16318
|
searching: props.searching,
|
|
16344
16319
|
searchSupported: props.searchSupported,
|
|
16345
|
-
|
|
16320
|
+
statusValues: props.statusValues,
|
|
16346
16321
|
systemLimit: props.systemLimit,
|
|
16347
16322
|
totalCount: props.totalCount,
|
|
16348
16323
|
warningCount: props.warningCount
|
|
@@ -16562,6 +16537,46 @@ var StatusMessage = ({
|
|
|
16562
16537
|
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_jsx_runtime129.Fragment, {});
|
|
16563
16538
|
};
|
|
16564
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
|
+
|
|
16565
16580
|
// src/hooks/status-provider.tsx
|
|
16566
16581
|
var import_react41 = require("react");
|
|
16567
16582
|
|
|
@@ -16648,11 +16663,11 @@ function useConnectionStateMachine() {
|
|
|
16648
16663
|
}
|
|
16649
16664
|
|
|
16650
16665
|
// src/hooks/status-provider.tsx
|
|
16651
|
-
var
|
|
16666
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
16652
16667
|
var AppInspectorStatusContext = (0, import_react41.createContext)(void 0);
|
|
16653
16668
|
var StatusProvider = ({ children }) => {
|
|
16654
16669
|
const value = useConnectionStateMachine();
|
|
16655
|
-
return /* @__PURE__ */ (0,
|
|
16670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(AppInspectorStatusContext.Provider, { value, children });
|
|
16656
16671
|
};
|
|
16657
16672
|
var useAppInspectorStatus = () => {
|
|
16658
16673
|
const value = (0, import_react41.useContext)(AppInspectorStatusContext);
|
|
@@ -16708,7 +16723,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
16708
16723
|
}
|
|
16709
16724
|
|
|
16710
16725
|
// src/hooks/use-spans.ts
|
|
16711
|
-
var
|
|
16726
|
+
var import_react48 = require("react");
|
|
16712
16727
|
|
|
16713
16728
|
// src/utils/pagination-buffer.ts
|
|
16714
16729
|
var insertSorted = (array, item, compareFunction, hint = "back") => {
|
|
@@ -16823,6 +16838,7 @@ var createPaginationBuffer = (options) => {
|
|
|
16823
16838
|
nextForwardToken = newPage.nextForwardToken;
|
|
16824
16839
|
hasMoreBackward ??= newPage.hasMoreBackward;
|
|
16825
16840
|
nextBackwardToken ??= newPage.nextBackwardToken;
|
|
16841
|
+
options.onPageFetched?.("forward", newPage.items);
|
|
16826
16842
|
reportDataChange();
|
|
16827
16843
|
} catch (error) {
|
|
16828
16844
|
if (controller.signal.aborted) {
|
|
@@ -16860,6 +16876,7 @@ var createPaginationBuffer = (options) => {
|
|
|
16860
16876
|
nextBackwardToken = newPage.nextBackwardToken;
|
|
16861
16877
|
hasMoreForward ??= newPage.hasMoreForward;
|
|
16862
16878
|
nextForwardToken ??= newPage.nextForwardToken;
|
|
16879
|
+
options.onPageFetched?.("backward", newPage.items);
|
|
16863
16880
|
reportDataChange();
|
|
16864
16881
|
} catch (error) {
|
|
16865
16882
|
if (controller.signal.aborted) {
|
|
@@ -16924,8 +16941,92 @@ var createPaginationBuffer = (options) => {
|
|
|
16924
16941
|
};
|
|
16925
16942
|
};
|
|
16926
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
|
+
|
|
16927
17028
|
// src/hooks/use-spans-ws.tsx
|
|
16928
|
-
var
|
|
17029
|
+
var import_react47 = require("react");
|
|
16929
17030
|
|
|
16930
17031
|
// src/config.ts
|
|
16931
17032
|
var APPINSPECTOR_API_PREFIX = "/_localstack/appinspector";
|
|
@@ -16954,8 +17055,8 @@ var getAppInspectorApiUrl = (localstackEndpoint, endpoint) => {
|
|
|
16954
17055
|
var LOCALSTACK_INFO_PATH = "/_localstack/info";
|
|
16955
17056
|
|
|
16956
17057
|
// src/context.tsx
|
|
16957
|
-
var import_react44 = require("react");
|
|
16958
17058
|
var import_react45 = require("react");
|
|
17059
|
+
var import_react46 = require("react");
|
|
16959
17060
|
|
|
16960
17061
|
// src/api/client.ts
|
|
16961
17062
|
var import_semver2 = __toESM(require_semver2(), 1);
|
|
@@ -17224,7 +17325,7 @@ var createApiClient = ({ localstackEndpoint }) => {
|
|
|
17224
17325
|
};
|
|
17225
17326
|
|
|
17226
17327
|
// src/hooks/use-appinspector-open-analytics.ts
|
|
17227
|
-
var
|
|
17328
|
+
var import_react44 = require("react");
|
|
17228
17329
|
|
|
17229
17330
|
// node_modules/.pnpm/ua-parser-js@2.0.9/node_modules/ua-parser-js/src/main/ua-parser.mjs
|
|
17230
17331
|
var LIBVERSION = "2.0.9";
|
|
@@ -19106,8 +19207,8 @@ var useAppInspectorOpenAnalytics = () => {
|
|
|
19106
19207
|
const api = useAppInspectorApi();
|
|
19107
19208
|
const { deploymentContainer } = useAppInspector();
|
|
19108
19209
|
const { status, statusError } = useAppInspectorStatus();
|
|
19109
|
-
const firedRef = (0,
|
|
19110
|
-
(0,
|
|
19210
|
+
const firedRef = (0, import_react44.useRef)(false);
|
|
19211
|
+
(0, import_react44.useEffect)(() => {
|
|
19111
19212
|
if (firedRef.current) {
|
|
19112
19213
|
return;
|
|
19113
19214
|
}
|
|
@@ -19127,10 +19228,10 @@ var useAppInspectorOpenAnalytics = () => {
|
|
|
19127
19228
|
};
|
|
19128
19229
|
|
|
19129
19230
|
// src/context.tsx
|
|
19130
|
-
var
|
|
19131
|
-
var AppInspectorContext = (0,
|
|
19231
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
19232
|
+
var AppInspectorContext = (0, import_react45.createContext)(void 0);
|
|
19132
19233
|
var useAppInspector = () => {
|
|
19133
|
-
const context = (0,
|
|
19234
|
+
const context = (0, import_react45.useContext)(AppInspectorContext);
|
|
19134
19235
|
if (!context) {
|
|
19135
19236
|
throw new Error("@localstack-studio/ui: components must be used within a <AppInspectorContextProvider>");
|
|
19136
19237
|
}
|
|
@@ -19138,14 +19239,14 @@ var useAppInspector = () => {
|
|
|
19138
19239
|
};
|
|
19139
19240
|
var AppInspectorAnalyticsBoundary = ({ children }) => {
|
|
19140
19241
|
useAppInspectorOpenAnalytics();
|
|
19141
|
-
return /* @__PURE__ */ (0,
|
|
19242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_jsx_runtime132.Fragment, { children });
|
|
19142
19243
|
};
|
|
19143
19244
|
var AppInspectorContextProvider = (props) => {
|
|
19144
|
-
const api = (0,
|
|
19245
|
+
const api = (0, import_react46.useMemo)(
|
|
19145
19246
|
() => createApiClient({ localstackEndpoint: props.localstackEndpoint }),
|
|
19146
19247
|
[props.localstackEndpoint]
|
|
19147
19248
|
);
|
|
19148
|
-
const resolveLink = (0,
|
|
19249
|
+
const resolveLink = (0, import_react46.useCallback)(
|
|
19149
19250
|
(options) => {
|
|
19150
19251
|
if (options.to === "settings") {
|
|
19151
19252
|
return `${props.routePrefix}/settings`;
|
|
@@ -19157,11 +19258,11 @@ var AppInspectorContextProvider = (props) => {
|
|
|
19157
19258
|
},
|
|
19158
19259
|
[props.routePrefix]
|
|
19159
19260
|
);
|
|
19160
|
-
const deploymentContainer = (0,
|
|
19261
|
+
const deploymentContainer = (0, import_react46.useMemo)(
|
|
19161
19262
|
() => props.deploymentContainer ?? { source: "web" },
|
|
19162
19263
|
[props.deploymentContainer]
|
|
19163
19264
|
);
|
|
19164
|
-
const contextValue = (0,
|
|
19265
|
+
const contextValue = (0, import_react46.useMemo)(
|
|
19165
19266
|
() => ({
|
|
19166
19267
|
deploymentContainer,
|
|
19167
19268
|
headerHeight: props.headerHeight ?? 0,
|
|
@@ -19171,7 +19272,7 @@ var AppInspectorContextProvider = (props) => {
|
|
|
19171
19272
|
}),
|
|
19172
19273
|
[deploymentContainer, props.headerHeight, props.linkComponent, props.localstackEndpoint, resolveLink]
|
|
19173
19274
|
);
|
|
19174
|
-
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 }) }) }) });
|
|
19175
19276
|
};
|
|
19176
19277
|
|
|
19177
19278
|
// src/hooks/use-spans-ws.tsx
|
|
@@ -19206,22 +19307,22 @@ var parseSpansWebSocketMessage = (raw) => {
|
|
|
19206
19307
|
};
|
|
19207
19308
|
function useSpansWebSocket(options) {
|
|
19208
19309
|
const { enabled, onClose, onMessage, onOpen } = options;
|
|
19209
|
-
const onMessageRef = (0,
|
|
19210
|
-
const onOpenRef = (0,
|
|
19211
|
-
const onCloseRef = (0,
|
|
19212
|
-
(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)(() => {
|
|
19213
19314
|
onMessageRef.current = onMessage;
|
|
19214
19315
|
}, [onMessage]);
|
|
19215
|
-
(0,
|
|
19316
|
+
(0, import_react47.useEffect)(() => {
|
|
19216
19317
|
onOpenRef.current = onOpen;
|
|
19217
19318
|
}, [onOpen]);
|
|
19218
|
-
(0,
|
|
19319
|
+
(0, import_react47.useEffect)(() => {
|
|
19219
19320
|
onCloseRef.current = onClose;
|
|
19220
19321
|
}, [onClose]);
|
|
19221
|
-
const [connected, setConnected] = (0,
|
|
19222
|
-
const wsRef = (0,
|
|
19322
|
+
const [connected, setConnected] = (0, import_react47.useState)(false);
|
|
19323
|
+
const wsRef = (0, import_react47.useRef)(void 0);
|
|
19223
19324
|
const { localstackEndpoint } = useAppInspector();
|
|
19224
|
-
const connect = (0,
|
|
19325
|
+
const connect = (0, import_react47.useCallback)(() => {
|
|
19225
19326
|
if (wsRef.current !== void 0) return;
|
|
19226
19327
|
const url = new URL(getAppInspectorApiUrl(localstackEndpoint, API_ENDPOINTS.WEBSOCKET_SPANS));
|
|
19227
19328
|
url.protocol = globalThis.location.protocol === "https:" ? "wss" : "ws";
|
|
@@ -19262,7 +19363,7 @@ function useSpansWebSocket(options) {
|
|
|
19262
19363
|
}
|
|
19263
19364
|
});
|
|
19264
19365
|
}, [localstackEndpoint]);
|
|
19265
|
-
(0,
|
|
19366
|
+
(0, import_react47.useEffect)(() => {
|
|
19266
19367
|
if (!enabled) {
|
|
19267
19368
|
if (wsRef.current !== void 0) {
|
|
19268
19369
|
wsRef.current.close();
|
|
@@ -19291,45 +19392,57 @@ var PAGE_SIZE = 100;
|
|
|
19291
19392
|
var useSpans = () => {
|
|
19292
19393
|
const api = useAppInspectorApi();
|
|
19293
19394
|
const { onWsClose, onWsOpen, status, wsEnabled } = useAppInspectorStatus();
|
|
19294
|
-
const
|
|
19295
|
-
const
|
|
19296
|
-
const [
|
|
19297
|
-
const
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
19301
|
-
const
|
|
19302
|
-
const
|
|
19303
|
-
const [
|
|
19304
|
-
const [
|
|
19305
|
-
const
|
|
19306
|
-
const [
|
|
19307
|
-
const
|
|
19308
|
-
const
|
|
19309
|
-
const [
|
|
19310
|
-
const
|
|
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)(() => {
|
|
19311
19419
|
void paginationBufferRef.current?.fetchForward();
|
|
19312
19420
|
}, []);
|
|
19313
|
-
const fetchBackward = (0,
|
|
19421
|
+
const fetchBackward = (0, import_react48.useCallback)(() => {
|
|
19314
19422
|
void paginationBufferRef.current?.fetchBackward();
|
|
19315
19423
|
}, []);
|
|
19316
|
-
const
|
|
19317
|
-
|
|
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) => {
|
|
19318
19430
|
if (observedEpoch === null || observedEpoch === void 0) {
|
|
19319
19431
|
return;
|
|
19320
19432
|
}
|
|
19321
19433
|
setEpoch(observedEpoch);
|
|
19322
19434
|
}, []);
|
|
19323
|
-
const clearCache = (0,
|
|
19435
|
+
const clearCache = (0, import_react48.useCallback)(() => {
|
|
19324
19436
|
paginationBufferRef.current?.clear();
|
|
19437
|
+
resetCorpus();
|
|
19325
19438
|
setTotalCount(void 0);
|
|
19326
19439
|
setErrorCount(void 0);
|
|
19327
19440
|
setWarningCount(void 0);
|
|
19328
19441
|
void paginationBufferRef.current?.fetchForward();
|
|
19329
|
-
}, []);
|
|
19330
|
-
const hasFetchedWithoutEpochRef = (0,
|
|
19331
|
-
const previousEpochRef = (0,
|
|
19332
|
-
(0,
|
|
19442
|
+
}, [resetCorpus]);
|
|
19443
|
+
const hasFetchedWithoutEpochRef = (0, import_react48.useRef)(false);
|
|
19444
|
+
const previousEpochRef = (0, import_react48.useRef)();
|
|
19445
|
+
(0, import_react48.useEffect)(() => {
|
|
19333
19446
|
if (epoch === void 0) {
|
|
19334
19447
|
return;
|
|
19335
19448
|
}
|
|
@@ -19340,7 +19453,7 @@ var useSpans = () => {
|
|
|
19340
19453
|
}
|
|
19341
19454
|
previousEpochRef.current = epoch;
|
|
19342
19455
|
}, [epoch, clearCache]);
|
|
19343
|
-
const applySearch = (0,
|
|
19456
|
+
const applySearch = (0, import_react48.useCallback)((term) => {
|
|
19344
19457
|
const normalized = term.trim();
|
|
19345
19458
|
if (normalized === searchRef.current) {
|
|
19346
19459
|
return;
|
|
@@ -19350,13 +19463,14 @@ var useSpans = () => {
|
|
|
19350
19463
|
const seq = ++searchSeqRef.current;
|
|
19351
19464
|
setSearching(true);
|
|
19352
19465
|
paginationBufferRef.current?.clear();
|
|
19466
|
+
resetCorpus();
|
|
19353
19467
|
void paginationBufferRef.current?.fetchForward().finally(() => {
|
|
19354
19468
|
if (searchSeqRef.current === seq) {
|
|
19355
19469
|
setSearching(false);
|
|
19356
19470
|
}
|
|
19357
19471
|
});
|
|
19358
|
-
}, []);
|
|
19359
|
-
(0,
|
|
19472
|
+
}, [resetCorpus]);
|
|
19473
|
+
(0, import_react48.useEffect)(() => {
|
|
19360
19474
|
const buffer = createPaginationBuffer({
|
|
19361
19475
|
async fetchPage(token, signal) {
|
|
19362
19476
|
const requestPage = async (paginationToken) => {
|
|
@@ -19391,31 +19505,34 @@ var useSpans = () => {
|
|
|
19391
19505
|
throw error;
|
|
19392
19506
|
}
|
|
19393
19507
|
},
|
|
19394
|
-
onDataChange: ({ hasMoreBackward: hasMoreBackward2, hasMoreForward: hasMoreForward2
|
|
19508
|
+
onDataChange: ({ hasMoreBackward: hasMoreBackward2, hasMoreForward: hasMoreForward2 }) => {
|
|
19395
19509
|
setFetchError(void 0);
|
|
19396
|
-
setSpans(items);
|
|
19397
19510
|
setHasMoreBackward(hasMoreBackward2);
|
|
19398
19511
|
setHasMoreForward(hasMoreForward2);
|
|
19512
|
+
setSpansLoaded(true);
|
|
19399
19513
|
},
|
|
19400
19514
|
onError: (error) => {
|
|
19401
19515
|
setFetchError(error);
|
|
19402
19516
|
},
|
|
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)));
|
|
19525
|
+
},
|
|
19403
19526
|
onStatusChange(status2) {
|
|
19404
19527
|
setFetchingBackward(status2.fetchingBackward);
|
|
19405
19528
|
setFetchingForward(status2.fetchingForward);
|
|
19406
|
-
},
|
|
19407
|
-
// The spans endpoint is sorted by span ingestion time, which might differ from
|
|
19408
|
-
// the span timestamp. In order to accomodate for this, we will sort the spans
|
|
19409
|
-
// in the frontend with the following sort comparator.
|
|
19410
|
-
sortComparator(a3, b3) {
|
|
19411
|
-
return a3.start_time_unix_nano < b3.start_time_unix_nano ? -1 : 1;
|
|
19412
19529
|
}
|
|
19413
19530
|
});
|
|
19414
19531
|
paginationBufferRef.current = buffer;
|
|
19415
19532
|
void buffer.fetchForward();
|
|
19416
|
-
}, [api, onEpochSeen]);
|
|
19417
|
-
const [clearingSpans, setClearingSpans] = (0,
|
|
19418
|
-
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 () => {
|
|
19419
19536
|
if (clearingSpans) {
|
|
19420
19537
|
return;
|
|
19421
19538
|
}
|
|
@@ -19427,6 +19544,7 @@ var useSpans = () => {
|
|
|
19427
19544
|
setSearch("");
|
|
19428
19545
|
setSearching(false);
|
|
19429
19546
|
paginationBufferRef.current?.clear();
|
|
19547
|
+
resetCorpus();
|
|
19430
19548
|
await paginationBufferRef.current?.fetchForward();
|
|
19431
19549
|
} catch (error) {
|
|
19432
19550
|
console.error("Failed to delete spans:", error);
|
|
@@ -19434,18 +19552,18 @@ var useSpans = () => {
|
|
|
19434
19552
|
} finally {
|
|
19435
19553
|
setClearingSpans(false);
|
|
19436
19554
|
}
|
|
19437
|
-
}, [clearingSpans, api]);
|
|
19438
|
-
(0,
|
|
19555
|
+
}, [clearingSpans, api, resetCorpus]);
|
|
19556
|
+
(0, import_react48.useEffect)(() => {
|
|
19439
19557
|
if (hasMoreForward === true && !fetchingForward) {
|
|
19440
19558
|
void paginationBufferRef.current?.fetchForward();
|
|
19441
19559
|
}
|
|
19442
19560
|
}, [hasMoreForward, fetchingForward]);
|
|
19443
|
-
(0,
|
|
19561
|
+
(0, import_react48.useEffect)(() => {
|
|
19444
19562
|
if (hasMoreBackward === true && !fetchingBackward && !fetchingForward) {
|
|
19445
19563
|
void paginationBufferRef.current?.fetchBackward();
|
|
19446
19564
|
}
|
|
19447
19565
|
}, [hasMoreBackward, fetchingBackward, fetchingForward]);
|
|
19448
|
-
const [previousStatusEpoch, setPreviousStatusEpoch] = (0,
|
|
19566
|
+
const [previousStatusEpoch, setPreviousStatusEpoch] = (0, import_react48.useState)();
|
|
19449
19567
|
if (status !== void 0 && status.epoch !== previousStatusEpoch) {
|
|
19450
19568
|
setPreviousStatusEpoch(status.epoch);
|
|
19451
19569
|
onEpochSeen(status.epoch);
|
|
@@ -19470,43 +19588,58 @@ var useSpans = () => {
|
|
|
19470
19588
|
fetchForward();
|
|
19471
19589
|
}
|
|
19472
19590
|
});
|
|
19473
|
-
const clearFetchError = (0,
|
|
19591
|
+
const clearFetchError = (0, import_react48.useCallback)(() => {
|
|
19474
19592
|
setFetchError(void 0);
|
|
19475
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]);
|
|
19476
19599
|
return {
|
|
19477
19600
|
clearFetchError,
|
|
19478
19601
|
clearingSpans,
|
|
19479
19602
|
clearSpans,
|
|
19603
|
+
consumerValues: computeResult.consumerValues,
|
|
19480
19604
|
errorCount,
|
|
19481
19605
|
fetchBackward,
|
|
19482
19606
|
fetchError,
|
|
19483
19607
|
fetchForward,
|
|
19484
19608
|
fetchingBackward,
|
|
19485
19609
|
fetchingForward,
|
|
19610
|
+
filteredErrorCount: computeResult.errorCount,
|
|
19611
|
+
filteredSpans,
|
|
19612
|
+
filteredWarningCount: computeResult.warningCount,
|
|
19613
|
+
filters,
|
|
19614
|
+
hasExternalProducer: computeResult.hasExternalProducer,
|
|
19486
19615
|
hasMoreBackward,
|
|
19487
19616
|
hasMoreForward,
|
|
19488
19617
|
licenseLimit,
|
|
19618
|
+
producerValues: computeResult.producerValues,
|
|
19619
|
+
retryWorker,
|
|
19489
19620
|
search,
|
|
19490
19621
|
searching,
|
|
19622
|
+
setFilters,
|
|
19491
19623
|
setSearch: applySearch,
|
|
19492
|
-
|
|
19624
|
+
statusValues: computeResult.statusValues,
|
|
19493
19625
|
systemLimit,
|
|
19494
19626
|
totalCount,
|
|
19495
|
-
warningCount
|
|
19627
|
+
warningCount,
|
|
19628
|
+
workerError
|
|
19496
19629
|
};
|
|
19497
19630
|
};
|
|
19498
19631
|
|
|
19499
19632
|
// src/pages/trace-graph-page.tsx
|
|
19500
|
-
var
|
|
19501
|
-
var
|
|
19633
|
+
var import_icons_material15 = require("@mui/icons-material");
|
|
19634
|
+
var import_material25 = require("@mui/material");
|
|
19502
19635
|
var import_styles = require("@mui/material/styles");
|
|
19503
|
-
var
|
|
19504
|
-
var
|
|
19636
|
+
var import_react65 = require("@xyflow/react");
|
|
19637
|
+
var import_react66 = require("react");
|
|
19505
19638
|
|
|
19506
19639
|
// src/components/event-details/event-details.tsx
|
|
19507
|
-
var
|
|
19508
|
-
var
|
|
19509
|
-
var
|
|
19640
|
+
var import_icons_material12 = require("@mui/icons-material");
|
|
19641
|
+
var import_material20 = require("@mui/material");
|
|
19642
|
+
var import_react56 = require("react");
|
|
19510
19643
|
|
|
19511
19644
|
// src/utils/event-utils.ts
|
|
19512
19645
|
var iamEventParser = (eventName, attributes) => {
|
|
@@ -19617,13 +19750,13 @@ var getEventGroupsByType = (events) => {
|
|
|
19617
19750
|
};
|
|
19618
19751
|
|
|
19619
19752
|
// src/components/event-details/copy-button.tsx
|
|
19620
|
-
var
|
|
19621
|
-
var
|
|
19622
|
-
var
|
|
19623
|
-
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");
|
|
19624
19757
|
var CopyButton = ({ value }) => {
|
|
19625
|
-
const [copied, setCopied] = (0,
|
|
19626
|
-
const handleCopy = (0,
|
|
19758
|
+
const [copied, setCopied] = (0, import_react49.useState)(false);
|
|
19759
|
+
const handleCopy = (0, import_react49.useCallback)(() => {
|
|
19627
19760
|
const text2 = typeof value === "string" ? value : JSON.stringify(value, void 0, 2);
|
|
19628
19761
|
void navigator.clipboard.writeText(text2).then(() => {
|
|
19629
19762
|
setCopied(true);
|
|
@@ -19632,83 +19765,83 @@ var CopyButton = ({ value }) => {
|
|
|
19632
19765
|
}, 1500);
|
|
19633
19766
|
});
|
|
19634
19767
|
}, [value]);
|
|
19635
|
-
return /* @__PURE__ */ (0,
|
|
19636
|
-
|
|
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,
|
|
19637
19770
|
{
|
|
19638
19771
|
className: "copy-btn",
|
|
19639
19772
|
onClick: handleCopy,
|
|
19640
19773
|
size: "small",
|
|
19641
19774
|
sx: { ml: 0.5, opacity: copied ? 1 : 0, p: 0.25, transition: "opacity 0.15s" },
|
|
19642
|
-
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 } })
|
|
19643
19776
|
}
|
|
19644
19777
|
) });
|
|
19645
19778
|
};
|
|
19646
19779
|
|
|
19647
19780
|
// src/components/event-details/event-detail.tsx
|
|
19648
|
-
var
|
|
19649
|
-
var
|
|
19650
|
-
var
|
|
19781
|
+
var import_icons_material10 = require("@mui/icons-material");
|
|
19782
|
+
var import_material17 = require("@mui/material");
|
|
19783
|
+
var import_react53 = require("react");
|
|
19651
19784
|
|
|
19652
19785
|
// src/components/status-icon.tsx
|
|
19653
|
-
var
|
|
19654
|
-
var
|
|
19655
|
-
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");
|
|
19656
19789
|
var StatusIcon2 = ({ errorLevel }) => {
|
|
19657
19790
|
switch (errorLevel) {
|
|
19658
19791
|
case EventLevel.LevelError: {
|
|
19659
|
-
return /* @__PURE__ */ (0,
|
|
19792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.Cancel, { sx: { color: "red" } });
|
|
19660
19793
|
}
|
|
19661
19794
|
case EventLevel.LevelInfo: {
|
|
19662
|
-
return /* @__PURE__ */ (0,
|
|
19795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.Info, { sx: { color: "gray" } });
|
|
19663
19796
|
}
|
|
19664
19797
|
case EventLevel.LevelPermission: {
|
|
19665
|
-
return /* @__PURE__ */ (0,
|
|
19798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.RemoveCircle, { sx: { color: "blue" } });
|
|
19666
19799
|
}
|
|
19667
19800
|
case EventLevel.LevelWarning: {
|
|
19668
|
-
return /* @__PURE__ */ (0,
|
|
19801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.Error, { sx: { color: "orange" } });
|
|
19669
19802
|
}
|
|
19670
19803
|
default: {
|
|
19671
|
-
return /* @__PURE__ */ (0,
|
|
19804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_icons_material8.CheckCircle, { sx: { color: "lightgray" } });
|
|
19672
19805
|
}
|
|
19673
19806
|
}
|
|
19674
19807
|
};
|
|
19675
19808
|
|
|
19676
19809
|
// src/components/event-details/iam-event-detail.tsx
|
|
19677
|
-
var
|
|
19678
|
-
var
|
|
19679
|
-
var
|
|
19680
|
-
var DetailRow = ({ content, label }) => /* @__PURE__ */ (0,
|
|
19681
|
-
/* @__PURE__ */ (0,
|
|
19682
|
-
/* @__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 })
|
|
19683
19816
|
] });
|
|
19684
19817
|
var PermissionIcon = ({ status }) => {
|
|
19685
19818
|
switch (status) {
|
|
19686
19819
|
case "explicitly_allowed":
|
|
19687
19820
|
case "implicitly_allowed": {
|
|
19688
|
-
return /* @__PURE__ */ (0,
|
|
19821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_icons_material9.CheckCircle, { sx: { color: "success.main", fontSize: "1rem" } });
|
|
19689
19822
|
}
|
|
19690
19823
|
case "explicitly_denied": {
|
|
19691
|
-
return /* @__PURE__ */ (0,
|
|
19824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_icons_material9.Error, { sx: { color: "error.main", fontSize: "1rem" } });
|
|
19692
19825
|
}
|
|
19693
19826
|
case "implicitly_denied": {
|
|
19694
|
-
return /* @__PURE__ */ (0,
|
|
19827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_icons_material9.Warning, { sx: { color: "warning.main", fontSize: "1rem" } });
|
|
19695
19828
|
}
|
|
19696
19829
|
}
|
|
19697
19830
|
};
|
|
19698
19831
|
var IAMEventDetail = ({ event }) => {
|
|
19699
19832
|
const payloadString = event.attributes?.payload;
|
|
19700
19833
|
if (!payloadString) {
|
|
19701
|
-
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" });
|
|
19702
19835
|
}
|
|
19703
19836
|
const parsedIAM = parseIAMEvent(payloadString);
|
|
19704
19837
|
if (!parsedIAM) {
|
|
19705
|
-
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" });
|
|
19706
19839
|
}
|
|
19707
|
-
return /* @__PURE__ */ (0,
|
|
19708
|
-
/* @__PURE__ */ (0,
|
|
19709
|
-
|
|
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,
|
|
19710
19843
|
{
|
|
19711
|
-
icon: /* @__PURE__ */ (0,
|
|
19844
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(PermissionIcon, { status: parsedIAM.permission }),
|
|
19712
19845
|
label: formatPermissionStatus(parsedIAM.permission),
|
|
19713
19846
|
size: "small",
|
|
19714
19847
|
sx: {
|
|
@@ -19718,36 +19851,36 @@ var IAMEventDetail = ({ event }) => {
|
|
|
19718
19851
|
variant: "outlined"
|
|
19719
19852
|
}
|
|
19720
19853
|
) }),
|
|
19721
|
-
/* @__PURE__ */ (0,
|
|
19722
|
-
/* @__PURE__ */ (0,
|
|
19723
|
-
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)(
|
|
19724
19857
|
DetailRow,
|
|
19725
19858
|
{
|
|
19726
|
-
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)) }),
|
|
19727
19860
|
label: "Actions"
|
|
19728
19861
|
}
|
|
19729
19862
|
),
|
|
19730
|
-
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)(
|
|
19731
19864
|
DetailRow,
|
|
19732
19865
|
{
|
|
19733
|
-
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)) }),
|
|
19734
19867
|
label: "Resources"
|
|
19735
19868
|
}
|
|
19736
19869
|
),
|
|
19737
|
-
(parsedIAM.details.explicitAllows !== void 0 || parsedIAM.details.explicitDenies !== void 0 || parsedIAM.details.implicitDenies !== void 0) && /* @__PURE__ */ (0,
|
|
19738
|
-
/* @__PURE__ */ (0,
|
|
19739
|
-
/* @__PURE__ */ (0,
|
|
19740
|
-
parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ (0,
|
|
19741
|
-
/* @__PURE__ */ (0,
|
|
19742
|
-
/* @__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" })
|
|
19743
19876
|
] }),
|
|
19744
|
-
parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ (0,
|
|
19745
|
-
/* @__PURE__ */ (0,
|
|
19746
|
-
/* @__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" })
|
|
19747
19880
|
] }),
|
|
19748
|
-
parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ (0,
|
|
19749
|
-
/* @__PURE__ */ (0,
|
|
19750
|
-
/* @__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" })
|
|
19751
19884
|
] })
|
|
19752
19885
|
] })
|
|
19753
19886
|
] })
|
|
@@ -19755,16 +19888,16 @@ var IAMEventDetail = ({ event }) => {
|
|
|
19755
19888
|
};
|
|
19756
19889
|
|
|
19757
19890
|
// src/components/event-details/iam-permission-detail.tsx
|
|
19758
|
-
var
|
|
19759
|
-
var
|
|
19760
|
-
var
|
|
19891
|
+
var import_material14 = require("@mui/material");
|
|
19892
|
+
var import_react50 = require("react");
|
|
19893
|
+
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
19761
19894
|
var getChipColor = (isAllowed, spanStatusCode) => {
|
|
19762
19895
|
if (isAllowed) return "success.main";
|
|
19763
19896
|
if (spanStatusCode === 2) return "error.main";
|
|
19764
19897
|
return "warning.main";
|
|
19765
19898
|
};
|
|
19766
19899
|
var IAMPermissionItem = ({ event, spanStatusCode }) => {
|
|
19767
|
-
const parsedData = (0,
|
|
19900
|
+
const parsedData = (0, import_react50.useMemo)(() => {
|
|
19768
19901
|
const payloadString = event.attributes?.payload;
|
|
19769
19902
|
if (!payloadString) return;
|
|
19770
19903
|
const parsedIAM2 = parseIAMEvent(payloadString);
|
|
@@ -19777,42 +19910,42 @@ var IAMPermissionItem = ({ event, spanStatusCode }) => {
|
|
|
19777
19910
|
const { parsedIAM } = parsedData;
|
|
19778
19911
|
const isAllowed = parsedIAM.permission === "explicitly_allowed" || parsedIAM.permission === "implicitly_allowed";
|
|
19779
19912
|
const chipColors = { backgroundColor: getChipColor(isAllowed, spanStatusCode), color: "white" };
|
|
19780
|
-
return /* @__PURE__ */ (0,
|
|
19781
|
-
/* @__PURE__ */ (0,
|
|
19782
|
-
/* @__PURE__ */ (0,
|
|
19783
|
-
/* @__PURE__ */ (0,
|
|
19784
|
-
/* @__PURE__ */ (0,
|
|
19785
|
-
/* @__PURE__ */ (0,
|
|
19786
|
-
/* @__PURE__ */ (0,
|
|
19787
|
-
/* @__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 })
|
|
19788
19921
|
] })
|
|
19789
19922
|
] }),
|
|
19790
|
-
parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ (0,
|
|
19791
|
-
/* @__PURE__ */ (0,
|
|
19792
|
-
parsedIAM.details.actions.map((action) => /* @__PURE__ */ (0,
|
|
19793
|
-
/* @__PURE__ */ (0,
|
|
19794
|
-
/* @__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 })
|
|
19795
19928
|
] }, action))
|
|
19796
19929
|
] }),
|
|
19797
|
-
parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ (0,
|
|
19798
|
-
/* @__PURE__ */ (0,
|
|
19799
|
-
parsedIAM.details.resources.map((resource) => /* @__PURE__ */ (0,
|
|
19800
|
-
/* @__PURE__ */ (0,
|
|
19801
|
-
/* @__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 })
|
|
19802
19935
|
] }, resource))
|
|
19803
19936
|
] })
|
|
19804
19937
|
] })
|
|
19805
19938
|
] });
|
|
19806
19939
|
};
|
|
19807
|
-
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}`)) });
|
|
19808
19941
|
|
|
19809
19942
|
// src/components/event-details/payload-viewer.tsx
|
|
19810
|
-
var
|
|
19943
|
+
var import_material16 = require("@mui/material");
|
|
19811
19944
|
|
|
19812
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
|
|
19813
|
-
var
|
|
19814
|
-
var
|
|
19815
|
-
var
|
|
19946
|
+
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
19947
|
+
var import_material15 = require("@mui/material");
|
|
19948
|
+
var import_react51 = require("react");
|
|
19816
19949
|
var import_zustand = require("zustand");
|
|
19817
19950
|
var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
|
|
19818
19951
|
function r(e2) {
|
|
@@ -19929,10 +20062,10 @@ var createJsonViewerStore = (props) => {
|
|
|
19929
20062
|
};
|
|
19930
20063
|
});
|
|
19931
20064
|
};
|
|
19932
|
-
var JsonViewerStoreContext = (0,
|
|
20065
|
+
var JsonViewerStoreContext = (0, import_react51.createContext)(void 0);
|
|
19933
20066
|
JsonViewerStoreContext.Provider;
|
|
19934
20067
|
var useJsonViewerStore = (selector2, equalityFn) => {
|
|
19935
|
-
const store = (0,
|
|
20068
|
+
const store = (0, import_react51.useContext)(JsonViewerStoreContext);
|
|
19936
20069
|
return (0, import_zustand.useStore)(store, selector2, equalityFn);
|
|
19937
20070
|
};
|
|
19938
20071
|
var useTextColor = () => {
|
|
@@ -20057,9 +20190,9 @@ async function copyString(value) {
|
|
|
20057
20190
|
}
|
|
20058
20191
|
function useClipboard() {
|
|
20059
20192
|
let { timeout = 2e3 } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
20060
|
-
const [copied, setCopied] = (0,
|
|
20061
|
-
const copyTimeout = (0,
|
|
20062
|
-
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) => {
|
|
20063
20196
|
const current = copyTimeout.current;
|
|
20064
20197
|
if (current) {
|
|
20065
20198
|
window.clearTimeout(current);
|
|
@@ -20070,7 +20203,7 @@ function useClipboard() {
|
|
|
20070
20203
|
timeout
|
|
20071
20204
|
]);
|
|
20072
20205
|
const onCopy = useJsonViewerStore((store) => store.onCopy);
|
|
20073
|
-
const copy = (0,
|
|
20206
|
+
const copy = (0, import_react51.useCallback)(async (path, value) => {
|
|
20074
20207
|
if (typeof onCopy === "function") {
|
|
20075
20208
|
try {
|
|
20076
20209
|
await onCopy(path, value, copyString);
|
|
@@ -20091,7 +20224,7 @@ function useClipboard() {
|
|
|
20091
20224
|
handleCopyResult,
|
|
20092
20225
|
onCopy
|
|
20093
20226
|
]);
|
|
20094
|
-
const reset = (0,
|
|
20227
|
+
const reset = (0, import_react51.useCallback)(() => {
|
|
20095
20228
|
setCopied(false);
|
|
20096
20229
|
if (copyTimeout.current) {
|
|
20097
20230
|
clearTimeout(copyTimeout.current);
|
|
@@ -20105,7 +20238,7 @@ function useClipboard() {
|
|
|
20105
20238
|
}
|
|
20106
20239
|
function useIsCycleReference(path, value) {
|
|
20107
20240
|
const rootValue = useJsonViewerStore((store) => store.value);
|
|
20108
|
-
return (0,
|
|
20241
|
+
return (0, import_react51.useMemo)(() => isCycleReference(rootValue, path, value), [
|
|
20109
20242
|
path,
|
|
20110
20243
|
value,
|
|
20111
20244
|
rootValue
|
|
@@ -20118,7 +20251,7 @@ function useInspect(path, value, nestedIndex) {
|
|
|
20118
20251
|
const setInspectCache = useJsonViewerStore((store) => store.setInspectCache);
|
|
20119
20252
|
const defaultInspectDepth = useJsonViewerStore((store) => store.defaultInspectDepth);
|
|
20120
20253
|
const defaultInspectControl = useJsonViewerStore((store) => store.defaultInspectControl);
|
|
20121
|
-
(0,
|
|
20254
|
+
(0, import_react51.useEffect)(() => {
|
|
20122
20255
|
const inspect2 = getInspectCache(path, nestedIndex);
|
|
20123
20256
|
if (inspect2 !== void 0) {
|
|
20124
20257
|
return;
|
|
@@ -20140,7 +20273,7 @@ function useInspect(path, value, nestedIndex) {
|
|
|
20140
20273
|
value,
|
|
20141
20274
|
setInspectCache
|
|
20142
20275
|
]);
|
|
20143
|
-
const [inspect, set] = (0,
|
|
20276
|
+
const [inspect, set] = (0, import_react51.useState)(() => {
|
|
20144
20277
|
const shouldInspect = getInspectCache(path, nestedIndex);
|
|
20145
20278
|
if (shouldInspect !== void 0) {
|
|
20146
20279
|
return shouldInspect;
|
|
@@ -20150,7 +20283,7 @@ function useInspect(path, value, nestedIndex) {
|
|
|
20150
20283
|
}
|
|
20151
20284
|
return isTrap ? false : typeof defaultInspectControl === "function" ? defaultInspectControl(path, value) : depth < defaultInspectDepth;
|
|
20152
20285
|
});
|
|
20153
|
-
const setInspect = (0,
|
|
20286
|
+
const setInspect = (0, import_react51.useCallback)((apply) => {
|
|
20154
20287
|
set((oldState) => {
|
|
20155
20288
|
const newState = typeof apply === "boolean" ? apply : apply(oldState);
|
|
20156
20289
|
setInspectCache(path, newState, nestedIndex);
|
|
@@ -20166,7 +20299,7 @@ function useInspect(path, value, nestedIndex) {
|
|
|
20166
20299
|
setInspect
|
|
20167
20300
|
];
|
|
20168
20301
|
}
|
|
20169
|
-
var DataBox = (props) => /* @__PURE__ */ (0,
|
|
20302
|
+
var DataBox = (props) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20170
20303
|
component: "div",
|
|
20171
20304
|
...props,
|
|
20172
20305
|
sx: {
|
|
@@ -20177,7 +20310,7 @@ var DataBox = (props) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_m
|
|
|
20177
20310
|
var DataTypeLabel = (param) => {
|
|
20178
20311
|
let { dataType, enable = true } = param;
|
|
20179
20312
|
if (!enable) return null;
|
|
20180
|
-
return /* @__PURE__ */ (0,
|
|
20313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
20181
20314
|
className: "data-type-label",
|
|
20182
20315
|
sx: {
|
|
20183
20316
|
mx: 0.5,
|
|
@@ -20190,23 +20323,23 @@ var DataTypeLabel = (param) => {
|
|
|
20190
20323
|
};
|
|
20191
20324
|
function defineEasyType(param) {
|
|
20192
20325
|
let { is, serialize, deserialize, type, colorKey, displayTypeLabel = true, Renderer } = param;
|
|
20193
|
-
const Render = /* @__PURE__ */ (0,
|
|
20326
|
+
const Render = /* @__PURE__ */ (0, import_react51.memo)(Renderer);
|
|
20194
20327
|
const EasyType = (props) => {
|
|
20195
20328
|
const storeDisplayDataTypes = useJsonViewerStore((store) => store.displayDataTypes);
|
|
20196
20329
|
const color2 = useJsonViewerStore((store) => store.colorspace[colorKey]);
|
|
20197
20330
|
const onSelect = useJsonViewerStore((store) => store.onSelect);
|
|
20198
|
-
return /* @__PURE__ */ (0,
|
|
20331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(DataBox, {
|
|
20199
20332
|
onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect(props.path, props.value),
|
|
20200
20333
|
sx: {
|
|
20201
20334
|
color: color2
|
|
20202
20335
|
},
|
|
20203
20336
|
children: [
|
|
20204
|
-
displayTypeLabel && storeDisplayDataTypes && /* @__PURE__ */ (0,
|
|
20337
|
+
displayTypeLabel && storeDisplayDataTypes && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataTypeLabel, {
|
|
20205
20338
|
dataType: type
|
|
20206
20339
|
}),
|
|
20207
|
-
/* @__PURE__ */ (0,
|
|
20340
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
20208
20341
|
className: "".concat(type, "-value"),
|
|
20209
|
-
children: /* @__PURE__ */ (0,
|
|
20342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(Render, {
|
|
20210
20343
|
path: props.path,
|
|
20211
20344
|
inspect: props.inspect,
|
|
20212
20345
|
setInspect: props.setInspect,
|
|
@@ -20227,7 +20360,7 @@ function defineEasyType(param) {
|
|
|
20227
20360
|
const EasyTypeEditor = (param2) => {
|
|
20228
20361
|
let { value, setValue, abortEditing, commitEditing } = param2;
|
|
20229
20362
|
const color2 = useJsonViewerStore((store) => store.colorspace[colorKey]);
|
|
20230
|
-
const handleKeyDown = (0,
|
|
20363
|
+
const handleKeyDown = (0, import_react51.useCallback)((event) => {
|
|
20231
20364
|
if (event.key === "Enter") {
|
|
20232
20365
|
event.preventDefault();
|
|
20233
20366
|
commitEditing(value);
|
|
@@ -20241,12 +20374,12 @@ function defineEasyType(param) {
|
|
|
20241
20374
|
commitEditing,
|
|
20242
20375
|
value
|
|
20243
20376
|
]);
|
|
20244
|
-
const handleChange = (0,
|
|
20377
|
+
const handleChange = (0, import_react51.useCallback)((event) => {
|
|
20245
20378
|
setValue(event.target.value);
|
|
20246
20379
|
}, [
|
|
20247
20380
|
setValue
|
|
20248
20381
|
]);
|
|
20249
|
-
return /* @__PURE__ */ (0,
|
|
20382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.InputBase, {
|
|
20250
20383
|
autoFocus: true,
|
|
20251
20384
|
value,
|
|
20252
20385
|
onChange: handleChange,
|
|
@@ -20286,7 +20419,7 @@ var booleanType = defineEasyType({
|
|
|
20286
20419
|
},
|
|
20287
20420
|
Renderer: (param) => {
|
|
20288
20421
|
let { value } = param;
|
|
20289
|
-
return /* @__PURE__ */ (0,
|
|
20422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
20290
20423
|
children: value ? "true" : "false"
|
|
20291
20424
|
});
|
|
20292
20425
|
}
|
|
@@ -20305,7 +20438,7 @@ var dateType = defineEasyType({
|
|
|
20305
20438
|
colorKey: "base0D",
|
|
20306
20439
|
Renderer: (param) => {
|
|
20307
20440
|
let { value } = param;
|
|
20308
|
-
return /* @__PURE__ */ (0,
|
|
20441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
20309
20442
|
children: value.toLocaleTimeString("en-us", displayOptions)
|
|
20310
20443
|
});
|
|
20311
20444
|
}
|
|
@@ -20334,12 +20467,12 @@ var functionName = (func) => {
|
|
|
20334
20467
|
var lb = "{";
|
|
20335
20468
|
var rb = "}";
|
|
20336
20469
|
var PreFunctionType = (props) => {
|
|
20337
|
-
return /* @__PURE__ */ (0,
|
|
20470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.NoSsr, {
|
|
20338
20471
|
children: [
|
|
20339
|
-
/* @__PURE__ */ (0,
|
|
20472
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataTypeLabel, {
|
|
20340
20473
|
dataType: "function"
|
|
20341
20474
|
}),
|
|
20342
|
-
/* @__PURE__ */ (0,
|
|
20475
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.Box, {
|
|
20343
20476
|
component: "span",
|
|
20344
20477
|
className: "data-function-start",
|
|
20345
20478
|
sx: {
|
|
@@ -20355,8 +20488,8 @@ var PreFunctionType = (props) => {
|
|
|
20355
20488
|
});
|
|
20356
20489
|
};
|
|
20357
20490
|
var PostFunctionType = () => {
|
|
20358
|
-
return /* @__PURE__ */ (0,
|
|
20359
|
-
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, {
|
|
20360
20493
|
component: "span",
|
|
20361
20494
|
className: "data-function-end",
|
|
20362
20495
|
children: rb
|
|
@@ -20365,15 +20498,15 @@ var PostFunctionType = () => {
|
|
|
20365
20498
|
};
|
|
20366
20499
|
var FunctionType = (props) => {
|
|
20367
20500
|
const functionColor = useJsonViewerStore((store) => store.colorspace.base05);
|
|
20368
|
-
return /* @__PURE__ */ (0,
|
|
20369
|
-
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, {
|
|
20370
20503
|
className: "data-function",
|
|
20371
20504
|
sx: {
|
|
20372
20505
|
display: props.inspect ? "block" : "inline-block",
|
|
20373
20506
|
pl: props.inspect ? 2 : 0,
|
|
20374
20507
|
color: functionColor
|
|
20375
20508
|
},
|
|
20376
|
-
children: props.inspect ? functionBody(props.value) : /* @__PURE__ */ (0,
|
|
20509
|
+
children: props.inspect ? functionBody(props.value) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20377
20510
|
component: "span",
|
|
20378
20511
|
className: "data-function-body",
|
|
20379
20512
|
onClick: () => props.setInspect(true),
|
|
@@ -20401,7 +20534,7 @@ var nullType = defineEasyType({
|
|
|
20401
20534
|
displayTypeLabel: false,
|
|
20402
20535
|
Renderer: () => {
|
|
20403
20536
|
const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
20404
|
-
return /* @__PURE__ */ (0,
|
|
20537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20405
20538
|
sx: {
|
|
20406
20539
|
fontSize: "0.8rem",
|
|
20407
20540
|
backgroundColor,
|
|
@@ -20424,7 +20557,7 @@ var nanType = defineEasyType({
|
|
|
20424
20557
|
deserialize: (value) => parseFloat(value),
|
|
20425
20558
|
Renderer: () => {
|
|
20426
20559
|
const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
20427
|
-
return /* @__PURE__ */ (0,
|
|
20560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20428
20561
|
sx: {
|
|
20429
20562
|
backgroundColor,
|
|
20430
20563
|
fontSize: "0.8rem",
|
|
@@ -20444,7 +20577,7 @@ var floatType = defineEasyType({
|
|
|
20444
20577
|
deserialize: (value) => parseFloat(value),
|
|
20445
20578
|
Renderer: (param) => {
|
|
20446
20579
|
let { value } = param;
|
|
20447
|
-
return /* @__PURE__ */ (0,
|
|
20580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
20448
20581
|
children: value
|
|
20449
20582
|
});
|
|
20450
20583
|
}
|
|
@@ -20458,7 +20591,7 @@ var intType = defineEasyType({
|
|
|
20458
20591
|
deserialize: (value) => parseFloat(value),
|
|
20459
20592
|
Renderer: (param) => {
|
|
20460
20593
|
let { value } = param;
|
|
20461
|
-
return /* @__PURE__ */ (0,
|
|
20594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
20462
20595
|
children: value
|
|
20463
20596
|
});
|
|
20464
20597
|
}
|
|
@@ -20471,16 +20604,16 @@ var bigIntType = defineEasyType({
|
|
|
20471
20604
|
deserialize: (value) => BigInt(value.replace(/\D/g, "")),
|
|
20472
20605
|
Renderer: (param) => {
|
|
20473
20606
|
let { value } = param;
|
|
20474
|
-
return /* @__PURE__ */ (0,
|
|
20607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
20475
20608
|
children: "".concat(value, "n")
|
|
20476
20609
|
});
|
|
20477
20610
|
}
|
|
20478
20611
|
});
|
|
20479
20612
|
var BaseIcon = (param) => {
|
|
20480
20613
|
let { d: d2, ...props } = param;
|
|
20481
|
-
return /* @__PURE__ */ (0,
|
|
20614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.SvgIcon, {
|
|
20482
20615
|
...props,
|
|
20483
|
-
children: /* @__PURE__ */ (0,
|
|
20616
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("path", {
|
|
20484
20617
|
d: d2
|
|
20485
20618
|
})
|
|
20486
20619
|
});
|
|
@@ -20495,55 +20628,55 @@ var Edit = "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.3
|
|
|
20495
20628
|
var ExpandMore = "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z";
|
|
20496
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";
|
|
20497
20630
|
var AddBoxIcon = (props) => {
|
|
20498
|
-
return /* @__PURE__ */ (0,
|
|
20631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20499
20632
|
d: AddBox,
|
|
20500
20633
|
...props
|
|
20501
20634
|
});
|
|
20502
20635
|
};
|
|
20503
20636
|
var CheckIcon = (props) => {
|
|
20504
|
-
return /* @__PURE__ */ (0,
|
|
20637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20505
20638
|
d: Check2,
|
|
20506
20639
|
...props
|
|
20507
20640
|
});
|
|
20508
20641
|
};
|
|
20509
20642
|
var ChevronRightIcon = (props) => {
|
|
20510
|
-
return /* @__PURE__ */ (0,
|
|
20643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20511
20644
|
d: ChevronRight,
|
|
20512
20645
|
...props
|
|
20513
20646
|
});
|
|
20514
20647
|
};
|
|
20515
20648
|
var CircularArrowsIcon = (props) => {
|
|
20516
|
-
return /* @__PURE__ */ (0,
|
|
20649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20517
20650
|
d: CircularArrows,
|
|
20518
20651
|
...props
|
|
20519
20652
|
});
|
|
20520
20653
|
};
|
|
20521
20654
|
var CloseIcon = (props) => {
|
|
20522
|
-
return /* @__PURE__ */ (0,
|
|
20655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20523
20656
|
d: Close2,
|
|
20524
20657
|
...props
|
|
20525
20658
|
});
|
|
20526
20659
|
};
|
|
20527
20660
|
var ContentCopyIcon = (props) => {
|
|
20528
|
-
return /* @__PURE__ */ (0,
|
|
20661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20529
20662
|
d: ContentCopy2,
|
|
20530
20663
|
...props
|
|
20531
20664
|
});
|
|
20532
20665
|
};
|
|
20533
20666
|
var EditIcon = (props) => {
|
|
20534
|
-
return /* @__PURE__ */ (0,
|
|
20667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20535
20668
|
d: Edit,
|
|
20536
20669
|
...props
|
|
20537
20670
|
});
|
|
20538
20671
|
};
|
|
20539
20672
|
var ExpandMoreIcon = (props) => {
|
|
20540
|
-
return /* @__PURE__ */ (0,
|
|
20673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20541
20674
|
d: ExpandMore,
|
|
20542
20675
|
...props
|
|
20543
20676
|
});
|
|
20544
20677
|
};
|
|
20545
20678
|
var DeleteIcon = (props) => {
|
|
20546
|
-
return /* @__PURE__ */ (0,
|
|
20679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(BaseIcon, {
|
|
20547
20680
|
d: Delete,
|
|
20548
20681
|
...props
|
|
20549
20682
|
});
|
|
@@ -20566,23 +20699,23 @@ function inspectMetadata(value) {
|
|
|
20566
20699
|
var PreObjectType = (props) => {
|
|
20567
20700
|
const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
|
|
20568
20701
|
const textColor = useTextColor();
|
|
20569
|
-
const isArrayLike = (0,
|
|
20702
|
+
const isArrayLike = (0, import_react51.useMemo)(() => Array.isArray(props.value) || props.value instanceof Set, [
|
|
20570
20703
|
props.value
|
|
20571
20704
|
]);
|
|
20572
|
-
const isEmptyValue = (0,
|
|
20705
|
+
const isEmptyValue = (0, import_react51.useMemo)(() => getValueSize(props.value) === 0, [
|
|
20573
20706
|
props.value
|
|
20574
20707
|
]);
|
|
20575
|
-
const sizeOfValue = (0,
|
|
20708
|
+
const sizeOfValue = (0, import_react51.useMemo)(() => inspectMetadata(props.value), [
|
|
20576
20709
|
props.value
|
|
20577
20710
|
]);
|
|
20578
20711
|
const displaySize = useJsonViewerStore((store) => store.displaySize);
|
|
20579
|
-
const shouldDisplaySize = (0,
|
|
20712
|
+
const shouldDisplaySize = (0, import_react51.useMemo)(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
|
|
20580
20713
|
displaySize,
|
|
20581
20714
|
props.path,
|
|
20582
20715
|
props.value
|
|
20583
20716
|
]);
|
|
20584
20717
|
const isTrap = useIsCycleReference(props.path, props.value);
|
|
20585
|
-
return /* @__PURE__ */ (0,
|
|
20718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.Box, {
|
|
20586
20719
|
component: "span",
|
|
20587
20720
|
className: "data-object-start",
|
|
20588
20721
|
sx: {
|
|
@@ -20590,7 +20723,7 @@ var PreObjectType = (props) => {
|
|
|
20590
20723
|
},
|
|
20591
20724
|
children: [
|
|
20592
20725
|
isArrayLike ? arrayLb : objectLb,
|
|
20593
|
-
shouldDisplaySize && props.inspect && !isEmptyValue && /* @__PURE__ */ (0,
|
|
20726
|
+
shouldDisplaySize && props.inspect && !isEmptyValue && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20594
20727
|
component: "span",
|
|
20595
20728
|
sx: {
|
|
20596
20729
|
pl: 0.5,
|
|
@@ -20600,16 +20733,16 @@ var PreObjectType = (props) => {
|
|
|
20600
20733
|
},
|
|
20601
20734
|
children: sizeOfValue
|
|
20602
20735
|
}),
|
|
20603
|
-
isTrap && !props.inspect && /* @__PURE__ */ (0,
|
|
20736
|
+
isTrap && !props.inspect && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, {
|
|
20604
20737
|
children: [
|
|
20605
|
-
/* @__PURE__ */ (0,
|
|
20738
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(CircularArrowsIcon, {
|
|
20606
20739
|
sx: {
|
|
20607
20740
|
fontSize: 12,
|
|
20608
20741
|
color: textColor,
|
|
20609
20742
|
mx: 0.5
|
|
20610
20743
|
}
|
|
20611
20744
|
}),
|
|
20612
|
-
/* @__PURE__ */ (0,
|
|
20745
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
20613
20746
|
sx: {
|
|
20614
20747
|
cursor: "pointer",
|
|
20615
20748
|
userSelect: "none"
|
|
@@ -20624,22 +20757,22 @@ var PreObjectType = (props) => {
|
|
|
20624
20757
|
var PostObjectType = (props) => {
|
|
20625
20758
|
const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
|
|
20626
20759
|
const textColor = useTextColor();
|
|
20627
|
-
const isArrayLike = (0,
|
|
20760
|
+
const isArrayLike = (0, import_react51.useMemo)(() => Array.isArray(props.value) || props.value instanceof Set, [
|
|
20628
20761
|
props.value
|
|
20629
20762
|
]);
|
|
20630
|
-
const isEmptyValue = (0,
|
|
20763
|
+
const isEmptyValue = (0, import_react51.useMemo)(() => getValueSize(props.value) === 0, [
|
|
20631
20764
|
props.value
|
|
20632
20765
|
]);
|
|
20633
|
-
const sizeOfValue = (0,
|
|
20766
|
+
const sizeOfValue = (0, import_react51.useMemo)(() => inspectMetadata(props.value), [
|
|
20634
20767
|
props.value
|
|
20635
20768
|
]);
|
|
20636
20769
|
const displaySize = useJsonViewerStore((store) => store.displaySize);
|
|
20637
|
-
const shouldDisplaySize = (0,
|
|
20770
|
+
const shouldDisplaySize = (0, import_react51.useMemo)(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
|
|
20638
20771
|
displaySize,
|
|
20639
20772
|
props.path,
|
|
20640
20773
|
props.value
|
|
20641
20774
|
]);
|
|
20642
|
-
return /* @__PURE__ */ (0,
|
|
20775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.Box, {
|
|
20643
20776
|
component: "span",
|
|
20644
20777
|
className: "data-object-end",
|
|
20645
20778
|
sx: {
|
|
@@ -20650,7 +20783,7 @@ var PostObjectType = (props) => {
|
|
|
20650
20783
|
},
|
|
20651
20784
|
children: [
|
|
20652
20785
|
isArrayLike ? arrayRb : objectRb,
|
|
20653
|
-
shouldDisplaySize && (isEmptyValue || !props.inspect) ? /* @__PURE__ */ (0,
|
|
20786
|
+
shouldDisplaySize && (isEmptyValue || !props.inspect) ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20654
20787
|
component: "span",
|
|
20655
20788
|
sx: {
|
|
20656
20789
|
pl: 0.5,
|
|
@@ -20671,9 +20804,9 @@ var ObjectType = (props) => {
|
|
|
20671
20804
|
const borderColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
20672
20805
|
const groupArraysAfterLength = useJsonViewerStore((store) => store.groupArraysAfterLength);
|
|
20673
20806
|
const isTrap = useIsCycleReference(props.path, props.value);
|
|
20674
|
-
const [displayLength, setDisplayLength] = (0,
|
|
20807
|
+
const [displayLength, setDisplayLength] = (0, import_react51.useState)(useJsonViewerStore((store) => store.maxDisplayLength));
|
|
20675
20808
|
const objectSortKeys = useJsonViewerStore((store) => store.objectSortKeys);
|
|
20676
|
-
const elements = (0,
|
|
20809
|
+
const elements = (0, import_react51.useMemo)(() => {
|
|
20677
20810
|
if (!props.inspect) {
|
|
20678
20811
|
return null;
|
|
20679
20812
|
}
|
|
@@ -20690,7 +20823,7 @@ var ObjectType = (props) => {
|
|
|
20690
20823
|
...props.path,
|
|
20691
20824
|
key
|
|
20692
20825
|
];
|
|
20693
|
-
elements3.push(/* @__PURE__ */ (0,
|
|
20826
|
+
elements3.push(/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
20694
20827
|
path,
|
|
20695
20828
|
value: value2,
|
|
20696
20829
|
prevValue: props.prevValue instanceof Map ? props.prevValue.get(k2) : void 0,
|
|
@@ -20706,7 +20839,7 @@ var ObjectType = (props) => {
|
|
|
20706
20839
|
while (true) {
|
|
20707
20840
|
const nextResult = iterator2.next();
|
|
20708
20841
|
var _nextResult_done;
|
|
20709
|
-
elements3.push(/* @__PURE__ */ (0,
|
|
20842
|
+
elements3.push(/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
20710
20843
|
path: [
|
|
20711
20844
|
...props.path,
|
|
20712
20845
|
"iterator:".concat(count2)
|
|
@@ -20734,7 +20867,7 @@ var ObjectType = (props) => {
|
|
|
20734
20867
|
...props.path,
|
|
20735
20868
|
index
|
|
20736
20869
|
];
|
|
20737
|
-
return /* @__PURE__ */ (0,
|
|
20870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
20738
20871
|
path,
|
|
20739
20872
|
value: value2,
|
|
20740
20873
|
prevValue: Array.isArray(props.prevValue) ? props.prevValue[index] : void 0,
|
|
@@ -20743,7 +20876,7 @@ var ObjectType = (props) => {
|
|
|
20743
20876
|
});
|
|
20744
20877
|
if (value.length > displayLength) {
|
|
20745
20878
|
const rest = value.length - displayLength;
|
|
20746
|
-
elements4.push(/* @__PURE__ */ (0,
|
|
20879
|
+
elements4.push(/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(DataBox, {
|
|
20747
20880
|
sx: {
|
|
20748
20881
|
cursor: "pointer",
|
|
20749
20882
|
lineHeight: 1.5,
|
|
@@ -20766,7 +20899,7 @@ var ObjectType = (props) => {
|
|
|
20766
20899
|
const prevElements = Array.isArray(props.prevValue) ? segmentArray(props.prevValue, groupArraysAfterLength) : void 0;
|
|
20767
20900
|
const elementsLastIndex = elements3.length - 1;
|
|
20768
20901
|
return elements3.map((list, index) => {
|
|
20769
|
-
return /* @__PURE__ */ (0,
|
|
20902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
20770
20903
|
path: props.path,
|
|
20771
20904
|
value: list,
|
|
20772
20905
|
nestedIndex: index,
|
|
@@ -20793,7 +20926,7 @@ var ObjectType = (props) => {
|
|
|
20793
20926
|
...props.path,
|
|
20794
20927
|
key
|
|
20795
20928
|
];
|
|
20796
|
-
return /* @__PURE__ */ (0,
|
|
20929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
20797
20930
|
path,
|
|
20798
20931
|
value: value2,
|
|
20799
20932
|
prevValue: (_props_prevValue = props.prevValue) === null || _props_prevValue === void 0 ? void 0 : _props_prevValue[key],
|
|
@@ -20802,7 +20935,7 @@ var ObjectType = (props) => {
|
|
|
20802
20935
|
});
|
|
20803
20936
|
if (entries.length > displayLength) {
|
|
20804
20937
|
const rest = entries.length - displayLength;
|
|
20805
|
-
elements2.push(/* @__PURE__ */ (0,
|
|
20938
|
+
elements2.push(/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(DataBox, {
|
|
20806
20939
|
sx: {
|
|
20807
20940
|
cursor: "pointer",
|
|
20808
20941
|
lineHeight: 1.5,
|
|
@@ -20834,13 +20967,13 @@ var ObjectType = (props) => {
|
|
|
20834
20967
|
const marginLeft = props.inspect ? 0.6 : 0;
|
|
20835
20968
|
const width = useJsonViewerStore((store) => store.indentWidth);
|
|
20836
20969
|
const indentWidth = props.inspect ? width - marginLeft : width;
|
|
20837
|
-
const isEmptyValue = (0,
|
|
20970
|
+
const isEmptyValue = (0, import_react51.useMemo)(() => getValueSize(props.value) === 0, [
|
|
20838
20971
|
props.value
|
|
20839
20972
|
]);
|
|
20840
20973
|
if (isEmptyValue) {
|
|
20841
20974
|
return null;
|
|
20842
20975
|
}
|
|
20843
|
-
return /* @__PURE__ */ (0,
|
|
20976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20844
20977
|
className: "data-object",
|
|
20845
20978
|
sx: {
|
|
20846
20979
|
display: props.inspect ? "block" : "inline-block",
|
|
@@ -20849,7 +20982,7 @@ var ObjectType = (props) => {
|
|
|
20849
20982
|
color: keyColor,
|
|
20850
20983
|
borderLeft: props.inspect ? "1px solid ".concat(borderColor) : "none"
|
|
20851
20984
|
},
|
|
20852
|
-
children: props.inspect ? elements : !isTrap && /* @__PURE__ */ (0,
|
|
20985
|
+
children: props.inspect ? elements : !isTrap && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20853
20986
|
component: "span",
|
|
20854
20987
|
className: "data-object-body",
|
|
20855
20988
|
onClick: () => props.setInspect(true),
|
|
@@ -20877,11 +21010,11 @@ var stringType = defineEasyType({
|
|
|
20877
21010
|
serialize: (value) => value,
|
|
20878
21011
|
deserialize: (value) => value,
|
|
20879
21012
|
Renderer: (props) => {
|
|
20880
|
-
const [showRest, setShowRest] = (0,
|
|
21013
|
+
const [showRest, setShowRest] = (0, import_react51.useState)(false);
|
|
20881
21014
|
const collapseStringsAfterLength = useJsonViewerStore((store) => store.collapseStringsAfterLength);
|
|
20882
21015
|
const value = showRest ? props.value : props.value.slice(0, collapseStringsAfterLength);
|
|
20883
21016
|
const hasRest = props.value.length > collapseStringsAfterLength;
|
|
20884
|
-
return /* @__PURE__ */ (0,
|
|
21017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.Box, {
|
|
20885
21018
|
component: "span",
|
|
20886
21019
|
sx: {
|
|
20887
21020
|
overflowWrap: "anywhere",
|
|
@@ -20899,7 +21032,7 @@ var stringType = defineEasyType({
|
|
|
20899
21032
|
children: [
|
|
20900
21033
|
'"',
|
|
20901
21034
|
value,
|
|
20902
|
-
hasRest && !showRest && /* @__PURE__ */ (0,
|
|
21035
|
+
hasRest && !showRest && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20903
21036
|
component: "span",
|
|
20904
21037
|
sx: {
|
|
20905
21038
|
padding: 0.5
|
|
@@ -20918,7 +21051,7 @@ var undefinedType = defineEasyType({
|
|
|
20918
21051
|
displayTypeLabel: false,
|
|
20919
21052
|
Renderer: () => {
|
|
20920
21053
|
const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
|
|
20921
|
-
return /* @__PURE__ */ (0,
|
|
21054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
20922
21055
|
sx: {
|
|
20923
21056
|
fontSize: "0.7rem",
|
|
20924
21057
|
backgroundColor,
|
|
@@ -20934,17 +21067,17 @@ function memorizeDataType(dataType) {
|
|
|
20934
21067
|
var _prevProps_path, _nextProps_path;
|
|
20935
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("."));
|
|
20936
21069
|
}
|
|
20937
|
-
dataType.Component = /* @__PURE__ */ (0,
|
|
21070
|
+
dataType.Component = /* @__PURE__ */ (0, import_react51.memo)(dataType.Component, compare);
|
|
20938
21071
|
if (dataType.Editor) {
|
|
20939
|
-
dataType.Editor = /* @__PURE__ */ (0,
|
|
21072
|
+
dataType.Editor = /* @__PURE__ */ (0, import_react51.memo)(dataType.Editor, function compare2(prevProps, nextProps) {
|
|
20940
21073
|
return Object.is(prevProps.value, nextProps.value);
|
|
20941
21074
|
});
|
|
20942
21075
|
}
|
|
20943
21076
|
if (dataType.PreComponent) {
|
|
20944
|
-
dataType.PreComponent = /* @__PURE__ */ (0,
|
|
21077
|
+
dataType.PreComponent = /* @__PURE__ */ (0, import_react51.memo)(dataType.PreComponent, compare);
|
|
20945
21078
|
}
|
|
20946
21079
|
if (dataType.PostComponent) {
|
|
20947
|
-
dataType.PostComponent = /* @__PURE__ */ (0,
|
|
21080
|
+
dataType.PostComponent = /* @__PURE__ */ (0, import_react51.memo)(dataType.PostComponent, compare);
|
|
20948
21081
|
}
|
|
20949
21082
|
return dataType;
|
|
20950
21083
|
}
|
|
@@ -20970,10 +21103,10 @@ var createTypeRegistryStore = () => {
|
|
|
20970
21103
|
}
|
|
20971
21104
|
}));
|
|
20972
21105
|
};
|
|
20973
|
-
var TypeRegistryStoreContext = /* @__PURE__ */ (0,
|
|
21106
|
+
var TypeRegistryStoreContext = /* @__PURE__ */ (0, import_react51.createContext)(void 0);
|
|
20974
21107
|
TypeRegistryStoreContext.Provider;
|
|
20975
21108
|
var useTypeRegistryStore = (selector2, equalityFn) => {
|
|
20976
|
-
const store = (0,
|
|
21109
|
+
const store = (0, import_react51.useContext)(TypeRegistryStoreContext);
|
|
20977
21110
|
return (0, import_zustand.useStore)(store, selector2, equalityFn);
|
|
20978
21111
|
};
|
|
20979
21112
|
function matchTypeComponents(value, path, registry) {
|
|
@@ -20993,13 +21126,13 @@ function matchTypeComponents(value, path, registry) {
|
|
|
20993
21126
|
}
|
|
20994
21127
|
function useTypeComponents(value, path) {
|
|
20995
21128
|
const registry = useTypeRegistryStore((store) => store.registry);
|
|
20996
|
-
return (0,
|
|
21129
|
+
return (0, import_react51.useMemo)(() => matchTypeComponents(value, path, registry), [
|
|
20997
21130
|
value,
|
|
20998
21131
|
path,
|
|
20999
21132
|
registry
|
|
21000
21133
|
]);
|
|
21001
21134
|
}
|
|
21002
|
-
var IconBox = (props) => /* @__PURE__ */ (0,
|
|
21135
|
+
var IconBox = (props) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
21003
21136
|
component: "span",
|
|
21004
21137
|
...props,
|
|
21005
21138
|
sx: {
|
|
@@ -21014,7 +21147,7 @@ var DataKeyPair = (props) => {
|
|
|
21014
21147
|
var _props_editable;
|
|
21015
21148
|
const propsEditable = (_props_editable = props.editable) !== null && _props_editable !== void 0 ? _props_editable : void 0;
|
|
21016
21149
|
const storeEditable = useJsonViewerStore((store) => store.editable);
|
|
21017
|
-
const editable = (0,
|
|
21150
|
+
const editable = (0, import_react51.useMemo)(() => {
|
|
21018
21151
|
if (storeEditable === false) {
|
|
21019
21152
|
return false;
|
|
21020
21153
|
}
|
|
@@ -21031,11 +21164,11 @@ var DataKeyPair = (props) => {
|
|
|
21031
21164
|
storeEditable,
|
|
21032
21165
|
value
|
|
21033
21166
|
]);
|
|
21034
|
-
const [tempValue, setTempValue] = (0,
|
|
21167
|
+
const [tempValue, setTempValue] = (0, import_react51.useState)("");
|
|
21035
21168
|
const depth = path.length;
|
|
21036
21169
|
const key = path[depth - 1];
|
|
21037
21170
|
const hoverPath = useJsonViewerStore((store) => store.hoverPath);
|
|
21038
|
-
const isHover = (0,
|
|
21171
|
+
const isHover = (0, import_react51.useMemo)(() => {
|
|
21039
21172
|
return hoverPath && path.every((value2, index) => value2 === hoverPath.path[index] && nestedIndex === hoverPath.nestedIndex);
|
|
21040
21173
|
}, [
|
|
21041
21174
|
hoverPath,
|
|
@@ -21045,7 +21178,7 @@ var DataKeyPair = (props) => {
|
|
|
21045
21178
|
const setHover = useJsonViewerStore((store) => store.setHover);
|
|
21046
21179
|
const root2 = useJsonViewerStore((store) => store.value);
|
|
21047
21180
|
const [inspect, setInspect] = useInspect(path, value, nestedIndex);
|
|
21048
|
-
const [editing, setEditing] = (0,
|
|
21181
|
+
const [editing, setEditing] = (0, import_react51.useState)(false);
|
|
21049
21182
|
const onChange = useJsonViewerStore((store) => store.onChange);
|
|
21050
21183
|
const keyColor = useTextColor();
|
|
21051
21184
|
const numberKeyColor = useJsonViewerStore((store) => store.colorspace.base0C);
|
|
@@ -21057,7 +21190,7 @@ var DataKeyPair = (props) => {
|
|
|
21057
21190
|
const isNumberKey = Number.isInteger(Number(key));
|
|
21058
21191
|
const storeEnableAdd = useJsonViewerStore((store) => store.enableAdd);
|
|
21059
21192
|
const onAdd = useJsonViewerStore((store) => store.onAdd);
|
|
21060
|
-
const enableAdd = (0,
|
|
21193
|
+
const enableAdd = (0, import_react51.useMemo)(() => {
|
|
21061
21194
|
if (!onAdd || nestedIndex !== void 0) return false;
|
|
21062
21195
|
if (storeEnableAdd === false) {
|
|
21063
21196
|
return false;
|
|
@@ -21082,7 +21215,7 @@ var DataKeyPair = (props) => {
|
|
|
21082
21215
|
]);
|
|
21083
21216
|
const storeEnableDelete = useJsonViewerStore((store) => store.enableDelete);
|
|
21084
21217
|
const onDelete = useJsonViewerStore((store) => store.onDelete);
|
|
21085
|
-
const enableDelete = (0,
|
|
21218
|
+
const enableDelete = (0, import_react51.useMemo)(() => {
|
|
21086
21219
|
if (!onDelete || nestedIndex !== void 0) return false;
|
|
21087
21220
|
if (isRoot) {
|
|
21088
21221
|
return false;
|
|
@@ -21109,7 +21242,7 @@ var DataKeyPair = (props) => {
|
|
|
21109
21242
|
const enableClipboard = useJsonViewerStore((store) => store.enableClipboard);
|
|
21110
21243
|
const { copy, copied } = useClipboard();
|
|
21111
21244
|
const highlightUpdates = useJsonViewerStore((store) => store.highlightUpdates);
|
|
21112
|
-
const isHighlight = (0,
|
|
21245
|
+
const isHighlight = (0, import_react51.useMemo)(() => {
|
|
21113
21246
|
if (!highlightUpdates || prevValue === void 0) return false;
|
|
21114
21247
|
if (typeof value !== typeof prevValue) {
|
|
21115
21248
|
return true;
|
|
@@ -21133,8 +21266,8 @@ var DataKeyPair = (props) => {
|
|
|
21133
21266
|
prevValue,
|
|
21134
21267
|
value
|
|
21135
21268
|
]);
|
|
21136
|
-
const highlightContainer = (0,
|
|
21137
|
-
(0,
|
|
21269
|
+
const highlightContainer = (0, import_react51.useRef)();
|
|
21270
|
+
(0, import_react51.useEffect)(() => {
|
|
21138
21271
|
if (highlightContainer.current && isHighlight && "animate" in highlightContainer.current) {
|
|
21139
21272
|
highlightContainer.current.animate([
|
|
21140
21273
|
{
|
|
@@ -21154,7 +21287,7 @@ var DataKeyPair = (props) => {
|
|
|
21154
21287
|
prevValue,
|
|
21155
21288
|
value
|
|
21156
21289
|
]);
|
|
21157
|
-
const startEditing = (0,
|
|
21290
|
+
const startEditing = (0, import_react51.useCallback)((event) => {
|
|
21158
21291
|
event.preventDefault();
|
|
21159
21292
|
if (serialize) setTempValue(serialize(value));
|
|
21160
21293
|
setEditing(true);
|
|
@@ -21162,14 +21295,14 @@ var DataKeyPair = (props) => {
|
|
|
21162
21295
|
serialize,
|
|
21163
21296
|
value
|
|
21164
21297
|
]);
|
|
21165
|
-
const abortEditing = (0,
|
|
21298
|
+
const abortEditing = (0, import_react51.useCallback)(() => {
|
|
21166
21299
|
setEditing(false);
|
|
21167
21300
|
setTempValue("");
|
|
21168
21301
|
}, [
|
|
21169
21302
|
setEditing,
|
|
21170
21303
|
setTempValue
|
|
21171
21304
|
]);
|
|
21172
|
-
const commitEditing = (0,
|
|
21305
|
+
const commitEditing = (0, import_react51.useCallback)((newValue) => {
|
|
21173
21306
|
setEditing(false);
|
|
21174
21307
|
if (!deserialize) return;
|
|
21175
21308
|
try {
|
|
@@ -21183,20 +21316,20 @@ var DataKeyPair = (props) => {
|
|
|
21183
21316
|
path,
|
|
21184
21317
|
value
|
|
21185
21318
|
]);
|
|
21186
|
-
const actionIcons = (0,
|
|
21319
|
+
const actionIcons = (0, import_react51.useMemo)(() => {
|
|
21187
21320
|
if (editing) {
|
|
21188
|
-
return /* @__PURE__ */ (0,
|
|
21321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, {
|
|
21189
21322
|
children: [
|
|
21190
|
-
/* @__PURE__ */ (0,
|
|
21191
|
-
children: /* @__PURE__ */ (0,
|
|
21323
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21324
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(CloseIcon, {
|
|
21192
21325
|
sx: {
|
|
21193
21326
|
fontSize: ".8rem"
|
|
21194
21327
|
},
|
|
21195
21328
|
onClick: abortEditing
|
|
21196
21329
|
})
|
|
21197
21330
|
}),
|
|
21198
|
-
/* @__PURE__ */ (0,
|
|
21199
|
-
children: /* @__PURE__ */ (0,
|
|
21331
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21332
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(CheckIcon, {
|
|
21200
21333
|
sx: {
|
|
21201
21334
|
fontSize: ".8rem"
|
|
21202
21335
|
},
|
|
@@ -21206,9 +21339,9 @@ var DataKeyPair = (props) => {
|
|
|
21206
21339
|
]
|
|
21207
21340
|
});
|
|
21208
21341
|
}
|
|
21209
|
-
return /* @__PURE__ */ (0,
|
|
21342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, {
|
|
21210
21343
|
children: [
|
|
21211
|
-
enableClipboard && /* @__PURE__ */ (0,
|
|
21344
|
+
enableClipboard && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21212
21345
|
onClick: (event) => {
|
|
21213
21346
|
event.preventDefault();
|
|
21214
21347
|
try {
|
|
@@ -21217,41 +21350,41 @@ var DataKeyPair = (props) => {
|
|
|
21217
21350
|
console.error(e2);
|
|
21218
21351
|
}
|
|
21219
21352
|
},
|
|
21220
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
21353
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(CheckIcon, {
|
|
21221
21354
|
sx: {
|
|
21222
21355
|
fontSize: ".8rem"
|
|
21223
21356
|
}
|
|
21224
|
-
}) : /* @__PURE__ */ (0,
|
|
21357
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ContentCopyIcon, {
|
|
21225
21358
|
sx: {
|
|
21226
21359
|
fontSize: ".8rem"
|
|
21227
21360
|
}
|
|
21228
21361
|
})
|
|
21229
21362
|
}),
|
|
21230
|
-
Editor && editable && serialize && deserialize && /* @__PURE__ */ (0,
|
|
21363
|
+
Editor && editable && serialize && deserialize && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21231
21364
|
onClick: startEditing,
|
|
21232
|
-
children: /* @__PURE__ */ (0,
|
|
21365
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(EditIcon, {
|
|
21233
21366
|
sx: {
|
|
21234
21367
|
fontSize: ".8rem"
|
|
21235
21368
|
}
|
|
21236
21369
|
})
|
|
21237
21370
|
}),
|
|
21238
|
-
enableAdd && /* @__PURE__ */ (0,
|
|
21371
|
+
enableAdd && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21239
21372
|
onClick: (event) => {
|
|
21240
21373
|
event.preventDefault();
|
|
21241
21374
|
onAdd === null || onAdd === void 0 ? void 0 : onAdd(path);
|
|
21242
21375
|
},
|
|
21243
|
-
children: /* @__PURE__ */ (0,
|
|
21376
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(AddBoxIcon, {
|
|
21244
21377
|
sx: {
|
|
21245
21378
|
fontSize: ".8rem"
|
|
21246
21379
|
}
|
|
21247
21380
|
})
|
|
21248
21381
|
}),
|
|
21249
|
-
enableDelete && /* @__PURE__ */ (0,
|
|
21382
|
+
enableDelete && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(IconBox, {
|
|
21250
21383
|
onClick: (event) => {
|
|
21251
21384
|
event.preventDefault();
|
|
21252
21385
|
onDelete === null || onDelete === void 0 ? void 0 : onDelete(path, value);
|
|
21253
21386
|
},
|
|
21254
|
-
children: /* @__PURE__ */ (0,
|
|
21387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DeleteIcon, {
|
|
21255
21388
|
sx: {
|
|
21256
21389
|
fontSize: ".9rem"
|
|
21257
21390
|
}
|
|
@@ -21279,12 +21412,12 @@ var DataKeyPair = (props) => {
|
|
|
21279
21412
|
abortEditing,
|
|
21280
21413
|
commitEditing
|
|
21281
21414
|
]);
|
|
21282
|
-
const isEmptyValue = (0,
|
|
21415
|
+
const isEmptyValue = (0, import_react51.useMemo)(() => getValueSize(value) === 0, [
|
|
21283
21416
|
value
|
|
21284
21417
|
]);
|
|
21285
21418
|
const expandable = !isEmptyValue && !!(PreComponent && PostComponent);
|
|
21286
21419
|
const KeyRenderer = useJsonViewerStore((store) => store.keyRenderer);
|
|
21287
|
-
const downstreamProps = (0,
|
|
21420
|
+
const downstreamProps = (0, import_react51.useMemo)(() => ({
|
|
21288
21421
|
path,
|
|
21289
21422
|
inspect,
|
|
21290
21423
|
setInspect,
|
|
@@ -21299,19 +21432,19 @@ var DataKeyPair = (props) => {
|
|
|
21299
21432
|
prevValue,
|
|
21300
21433
|
nestedIndex
|
|
21301
21434
|
]);
|
|
21302
|
-
return /* @__PURE__ */ (0,
|
|
21435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_material15.Box, {
|
|
21303
21436
|
className: "data-key-pair",
|
|
21304
21437
|
"data-testid": "data-key-pair" + path.join("."),
|
|
21305
21438
|
sx: {
|
|
21306
21439
|
userSelect: "text"
|
|
21307
21440
|
},
|
|
21308
|
-
onMouseEnter: (0,
|
|
21441
|
+
onMouseEnter: (0, import_react51.useCallback)(() => setHover(path, nestedIndex), [
|
|
21309
21442
|
setHover,
|
|
21310
21443
|
path,
|
|
21311
21444
|
nestedIndex
|
|
21312
21445
|
]),
|
|
21313
21446
|
children: [
|
|
21314
|
-
/* @__PURE__ */ (0,
|
|
21447
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(DataBox, {
|
|
21315
21448
|
component: "span",
|
|
21316
21449
|
className: "data-key",
|
|
21317
21450
|
sx: {
|
|
@@ -21320,7 +21453,7 @@ var DataKeyPair = (props) => {
|
|
|
21320
21453
|
letterSpacing: 0.5,
|
|
21321
21454
|
opacity: 0.8
|
|
21322
21455
|
},
|
|
21323
|
-
onClick: (0,
|
|
21456
|
+
onClick: (0, import_react51.useCallback)((event) => {
|
|
21324
21457
|
if (event.isDefaultPrevented()) {
|
|
21325
21458
|
return;
|
|
21326
21459
|
}
|
|
@@ -21332,7 +21465,7 @@ var DataKeyPair = (props) => {
|
|
|
21332
21465
|
setInspect
|
|
21333
21466
|
]),
|
|
21334
21467
|
children: [
|
|
21335
|
-
expandable ? inspect ? /* @__PURE__ */ (0,
|
|
21468
|
+
expandable ? inspect ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ExpandMoreIcon, {
|
|
21336
21469
|
className: "data-key-toggle-expanded",
|
|
21337
21470
|
sx: {
|
|
21338
21471
|
fontSize: ".8rem",
|
|
@@ -21340,7 +21473,7 @@ var DataKeyPair = (props) => {
|
|
|
21340
21473
|
cursor: "pointer"
|
|
21341
21474
|
}
|
|
21342
21475
|
}
|
|
21343
|
-
}) : /* @__PURE__ */ (0,
|
|
21476
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(ChevronRightIcon, {
|
|
21344
21477
|
className: "data-key-toggle-collapsed",
|
|
21345
21478
|
sx: {
|
|
21346
21479
|
fontSize: ".8rem",
|
|
@@ -21349,44 +21482,44 @@ var DataKeyPair = (props) => {
|
|
|
21349
21482
|
}
|
|
21350
21483
|
}
|
|
21351
21484
|
}) : null,
|
|
21352
|
-
/* @__PURE__ */ (0,
|
|
21485
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
21353
21486
|
ref: highlightContainer,
|
|
21354
21487
|
className: "data-key-key",
|
|
21355
21488
|
component: "span",
|
|
21356
|
-
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, {
|
|
21357
21490
|
children: [
|
|
21358
21491
|
'"',
|
|
21359
21492
|
rootName,
|
|
21360
21493
|
'"'
|
|
21361
21494
|
]
|
|
21362
|
-
}) : /* @__PURE__ */ (0,
|
|
21495
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
21363
21496
|
children: rootName
|
|
21364
|
-
}) : null : KeyRenderer.when(downstreamProps) ? /* @__PURE__ */ (0,
|
|
21497
|
+
}) : null : KeyRenderer.when(downstreamProps) ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(KeyRenderer, {
|
|
21365
21498
|
...downstreamProps
|
|
21366
|
-
}) : nestedIndex === void 0 && (isNumberKey ? /* @__PURE__ */ (0,
|
|
21499
|
+
}) : nestedIndex === void 0 && (isNumberKey ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
21367
21500
|
component: "span",
|
|
21368
21501
|
style: {
|
|
21369
21502
|
color: numberKeyColor,
|
|
21370
21503
|
userSelect: isNumberKey ? "none" : "auto"
|
|
21371
21504
|
},
|
|
21372
21505
|
children: key
|
|
21373
|
-
}) : quotesOnKeys ? /* @__PURE__ */ (0,
|
|
21506
|
+
}) : quotesOnKeys ? /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, {
|
|
21374
21507
|
children: [
|
|
21375
21508
|
'"',
|
|
21376
21509
|
key,
|
|
21377
21510
|
'"'
|
|
21378
21511
|
]
|
|
21379
|
-
}) : /* @__PURE__ */ (0,
|
|
21512
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_jsx_runtime137.Fragment, {
|
|
21380
21513
|
children: key
|
|
21381
21514
|
}))
|
|
21382
21515
|
}),
|
|
21383
|
-
isRoot ? rootName !== false && /* @__PURE__ */ (0,
|
|
21516
|
+
isRoot ? rootName !== false && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
21384
21517
|
className: "data-key-colon",
|
|
21385
21518
|
sx: {
|
|
21386
21519
|
mr: 0.5
|
|
21387
21520
|
},
|
|
21388
21521
|
children: ":"
|
|
21389
|
-
}) : nestedIndex === void 0 && /* @__PURE__ */ (0,
|
|
21522
|
+
}) : nestedIndex === void 0 && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
21390
21523
|
className: "data-key-colon",
|
|
21391
21524
|
sx: {
|
|
21392
21525
|
mr: 0.5,
|
|
@@ -21397,29 +21530,29 @@ var DataKeyPair = (props) => {
|
|
|
21397
21530
|
},
|
|
21398
21531
|
children: ":"
|
|
21399
21532
|
}),
|
|
21400
|
-
PreComponent && /* @__PURE__ */ (0,
|
|
21533
|
+
PreComponent && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(PreComponent, {
|
|
21401
21534
|
...downstreamProps
|
|
21402
21535
|
}),
|
|
21403
21536
|
isHover && expandable && inspect && actionIcons
|
|
21404
21537
|
]
|
|
21405
21538
|
}),
|
|
21406
|
-
editing && editable ? Editor && /* @__PURE__ */ (0,
|
|
21539
|
+
editing && editable ? Editor && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(Editor, {
|
|
21407
21540
|
path,
|
|
21408
21541
|
value: tempValue,
|
|
21409
21542
|
setValue: setTempValue,
|
|
21410
21543
|
abortEditing,
|
|
21411
21544
|
commitEditing
|
|
21412
|
-
}) : Component ? /* @__PURE__ */ (0,
|
|
21545
|
+
}) : Component ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(Component, {
|
|
21413
21546
|
...downstreamProps
|
|
21414
|
-
}) : /* @__PURE__ */ (0,
|
|
21547
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Box, {
|
|
21415
21548
|
component: "span",
|
|
21416
21549
|
className: "data-value-fallback",
|
|
21417
21550
|
children: "fallback: ".concat(value)
|
|
21418
21551
|
}),
|
|
21419
|
-
PostComponent && /* @__PURE__ */ (0,
|
|
21552
|
+
PostComponent && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(PostComponent, {
|
|
21420
21553
|
...downstreamProps
|
|
21421
21554
|
}),
|
|
21422
|
-
!last && displayComma && /* @__PURE__ */ (0,
|
|
21555
|
+
!last && displayComma && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataBox, {
|
|
21423
21556
|
children: ","
|
|
21424
21557
|
}),
|
|
21425
21558
|
isHover && expandable && !inspect && actionIcons,
|
|
@@ -21430,8 +21563,8 @@ var DataKeyPair = (props) => {
|
|
|
21430
21563
|
};
|
|
21431
21564
|
var query = "(prefers-color-scheme: dark)";
|
|
21432
21565
|
function useThemeDetector() {
|
|
21433
|
-
const [isDark, setIsDark] = (0,
|
|
21434
|
-
(0,
|
|
21566
|
+
const [isDark, setIsDark] = (0, import_react51.useState)(false);
|
|
21567
|
+
(0, import_react51.useEffect)(() => {
|
|
21435
21568
|
const listener = (e2) => setIsDark(e2.matches);
|
|
21436
21569
|
setIsDark(window.matchMedia(query).matches);
|
|
21437
21570
|
const queryMedia = window.matchMedia(query);
|
|
@@ -21441,8 +21574,8 @@ function useThemeDetector() {
|
|
|
21441
21574
|
return isDark;
|
|
21442
21575
|
}
|
|
21443
21576
|
function useSetIfNotUndefinedEffect(key, value) {
|
|
21444
|
-
const { setState } = (0,
|
|
21445
|
-
(0,
|
|
21577
|
+
const { setState } = (0, import_react51.useContext)(JsonViewerStoreContext);
|
|
21578
|
+
(0, import_react51.useEffect)(() => {
|
|
21446
21579
|
if (value !== void 0) {
|
|
21447
21580
|
setState({
|
|
21448
21581
|
[key]: value
|
|
@@ -21455,8 +21588,8 @@ function useSetIfNotUndefinedEffect(key, value) {
|
|
|
21455
21588
|
]);
|
|
21456
21589
|
}
|
|
21457
21590
|
var JsonViewerInner = (props) => {
|
|
21458
|
-
const { setState } = (0,
|
|
21459
|
-
(0,
|
|
21591
|
+
const { setState } = (0, import_react51.useContext)(JsonViewerStoreContext);
|
|
21592
|
+
(0, import_react51.useEffect)(() => {
|
|
21460
21593
|
setState((state) => ({
|
|
21461
21594
|
prevValue: state.value,
|
|
21462
21595
|
value: props.value
|
|
@@ -21484,7 +21617,7 @@ var JsonViewerInner = (props) => {
|
|
|
21484
21617
|
useSetIfNotUndefinedEffect("displaySize", props.displaySize);
|
|
21485
21618
|
useSetIfNotUndefinedEffect("displayComma", props.displayComma);
|
|
21486
21619
|
useSetIfNotUndefinedEffect("highlightUpdates", props.highlightUpdates);
|
|
21487
|
-
(0,
|
|
21620
|
+
(0, import_react51.useEffect)(() => {
|
|
21488
21621
|
if (props.theme === "light") {
|
|
21489
21622
|
setState({
|
|
21490
21623
|
colorspace: lightColorspace
|
|
@@ -21502,13 +21635,13 @@ var JsonViewerInner = (props) => {
|
|
|
21502
21635
|
setState,
|
|
21503
21636
|
props.theme
|
|
21504
21637
|
]);
|
|
21505
|
-
const themeCls = (0,
|
|
21638
|
+
const themeCls = (0, import_react51.useMemo)(() => {
|
|
21506
21639
|
if (typeof props.theme === "object") return "json-viewer-theme-custom";
|
|
21507
21640
|
return props.theme === "dark" ? "json-viewer-theme-dark" : "json-viewer-theme-light";
|
|
21508
21641
|
}, [
|
|
21509
21642
|
props.theme
|
|
21510
21643
|
]);
|
|
21511
|
-
const onceRef = (0,
|
|
21644
|
+
const onceRef = (0, import_react51.useRef)(true);
|
|
21512
21645
|
const registerTypes = useTypeRegistryStore((store) => store.registerTypes);
|
|
21513
21646
|
if (onceRef.current) {
|
|
21514
21647
|
const allTypes = props.valueTypes ? [
|
|
@@ -21520,7 +21653,7 @@ var JsonViewerInner = (props) => {
|
|
|
21520
21653
|
registerTypes(allTypes);
|
|
21521
21654
|
onceRef.current = false;
|
|
21522
21655
|
}
|
|
21523
|
-
(0,
|
|
21656
|
+
(0, import_react51.useEffect)(() => {
|
|
21524
21657
|
const allTypes = props.valueTypes ? [
|
|
21525
21658
|
...predefinedTypes,
|
|
21526
21659
|
...props.valueTypes
|
|
@@ -21534,12 +21667,12 @@ var JsonViewerInner = (props) => {
|
|
|
21534
21667
|
]);
|
|
21535
21668
|
const value = useJsonViewerStore((store) => store.value);
|
|
21536
21669
|
const prevValue = useJsonViewerStore((store) => store.prevValue);
|
|
21537
|
-
const emptyPath = (0,
|
|
21670
|
+
const emptyPath = (0, import_react51.useMemo)(() => [], []);
|
|
21538
21671
|
const setHover = useJsonViewerStore((store) => store.setHover);
|
|
21539
|
-
const onMouseLeave = (0,
|
|
21672
|
+
const onMouseLeave = (0, import_react51.useCallback)(() => setHover(null), [
|
|
21540
21673
|
setHover
|
|
21541
21674
|
]);
|
|
21542
|
-
return /* @__PURE__ */ (0,
|
|
21675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material15.Paper, {
|
|
21543
21676
|
elevation: 0,
|
|
21544
21677
|
className: clsx(themeCls, props.className),
|
|
21545
21678
|
style: props.style,
|
|
@@ -21550,7 +21683,7 @@ var JsonViewerInner = (props) => {
|
|
|
21550
21683
|
...props.sx
|
|
21551
21684
|
},
|
|
21552
21685
|
onMouseLeave,
|
|
21553
|
-
children: /* @__PURE__ */ (0,
|
|
21686
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(DataKeyPair, {
|
|
21554
21687
|
value,
|
|
21555
21688
|
prevValue,
|
|
21556
21689
|
path: emptyPath,
|
|
@@ -21565,17 +21698,17 @@ var JsonViewer = function JsonViewer2(props) {
|
|
|
21565
21698
|
}
|
|
21566
21699
|
}
|
|
21567
21700
|
const isAutoDarkTheme = useThemeDetector();
|
|
21568
|
-
const themeType = (0,
|
|
21701
|
+
const themeType = (0, import_react51.useMemo)(() => {
|
|
21569
21702
|
var _props_theme;
|
|
21570
21703
|
return props.theme === "auto" ? isAutoDarkTheme ? "dark" : "light" : (_props_theme = props.theme) !== null && _props_theme !== void 0 ? _props_theme : "light";
|
|
21571
21704
|
}, [
|
|
21572
21705
|
isAutoDarkTheme,
|
|
21573
21706
|
props.theme
|
|
21574
21707
|
]);
|
|
21575
|
-
const theme = (0,
|
|
21708
|
+
const theme = (0, import_react51.useMemo)(() => {
|
|
21576
21709
|
const backgroundColor = typeof themeType === "object" ? themeType.base00 : themeType === "dark" ? darkColorspace.base00 : lightColorspace.base00;
|
|
21577
21710
|
const foregroundColor = typeof themeType === "object" ? themeType.base07 : themeType === "dark" ? darkColorspace.base07 : lightColorspace.base07;
|
|
21578
|
-
return (0,
|
|
21711
|
+
return (0, import_material15.createTheme)({
|
|
21579
21712
|
components: {
|
|
21580
21713
|
MuiPaper: {
|
|
21581
21714
|
styleOverrides: {
|
|
@@ -21600,15 +21733,15 @@ var JsonViewer = function JsonViewer2(props) {
|
|
|
21600
21733
|
...props,
|
|
21601
21734
|
theme: themeType
|
|
21602
21735
|
};
|
|
21603
|
-
const jsonViewerStore = (0,
|
|
21604
|
-
const typeRegistryStore = (0,
|
|
21605
|
-
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, {
|
|
21606
21739
|
theme,
|
|
21607
|
-
children: /* @__PURE__ */ (0,
|
|
21740
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(TypeRegistryStoreContext.Provider, {
|
|
21608
21741
|
value: typeRegistryStore,
|
|
21609
|
-
children: /* @__PURE__ */ (0,
|
|
21742
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(JsonViewerStoreContext.Provider, {
|
|
21610
21743
|
value: jsonViewerStore,
|
|
21611
|
-
children: /* @__PURE__ */ (0,
|
|
21744
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(JsonViewerInner, {
|
|
21612
21745
|
...mixedProps
|
|
21613
21746
|
})
|
|
21614
21747
|
})
|
|
@@ -21617,8 +21750,8 @@ var JsonViewer = function JsonViewer2(props) {
|
|
|
21617
21750
|
};
|
|
21618
21751
|
|
|
21619
21752
|
// src/components/event-details/payload-viewer.tsx
|
|
21620
|
-
var
|
|
21621
|
-
var
|
|
21753
|
+
var import_react52 = require("react");
|
|
21754
|
+
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
21622
21755
|
function tryParseJson(value) {
|
|
21623
21756
|
if (typeof value !== "string") {
|
|
21624
21757
|
return value;
|
|
@@ -21629,9 +21762,9 @@ function tryParseJson(value) {
|
|
|
21629
21762
|
return value;
|
|
21630
21763
|
}
|
|
21631
21764
|
}
|
|
21632
|
-
var PayloadViewer = (0,
|
|
21633
|
-
const theme = (0,
|
|
21634
|
-
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)(
|
|
21635
21768
|
JsonViewer,
|
|
21636
21769
|
{
|
|
21637
21770
|
displayDataTypes: false,
|
|
@@ -21645,21 +21778,21 @@ var PayloadViewer = (0, import_react51.memo)(({ sx, testId, value }) => {
|
|
|
21645
21778
|
});
|
|
21646
21779
|
|
|
21647
21780
|
// src/components/event-details/event-detail.tsx
|
|
21648
|
-
var
|
|
21649
|
-
var DetailRow2 = ({ content, label }) => /* @__PURE__ */ (0,
|
|
21650
|
-
/* @__PURE__ */ (0,
|
|
21651
|
-
/* @__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 })
|
|
21652
21785
|
] });
|
|
21653
21786
|
var EventMessage = ({ event }) => {
|
|
21654
|
-
const [isOpen, setIsOpen] = (0,
|
|
21655
|
-
const [isOverflowing, setIsOverflowing] = (0,
|
|
21656
|
-
const textReference = (0,
|
|
21657
|
-
const parsedMessage = (0,
|
|
21658
|
-
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)(
|
|
21659
21792
|
() => event.event_type === "iam.policy_evaluation" && event.attributes?.payload && typeof event.attributes.payload === "string",
|
|
21660
21793
|
[event]
|
|
21661
21794
|
);
|
|
21662
|
-
(0,
|
|
21795
|
+
(0, import_react53.useEffect)(() => {
|
|
21663
21796
|
const checkOverflow = () => {
|
|
21664
21797
|
const element = textReference.current;
|
|
21665
21798
|
if (element) {
|
|
@@ -21672,29 +21805,29 @@ var EventMessage = ({ event }) => {
|
|
|
21672
21805
|
window.removeEventListener("resize", checkOverflow);
|
|
21673
21806
|
};
|
|
21674
21807
|
}, [parsedMessage.headline]);
|
|
21675
|
-
const hasAdditionalContent = (0,
|
|
21808
|
+
const hasAdditionalContent = (0, import_react53.useMemo)(
|
|
21676
21809
|
() => parsedMessage.message || parsedMessage.details || isIAMPolicyEvent,
|
|
21677
21810
|
[parsedMessage.message, parsedMessage.details, isIAMPolicyEvent]
|
|
21678
21811
|
);
|
|
21679
|
-
const shouldShowToggle = (0,
|
|
21812
|
+
const shouldShowToggle = (0, import_react53.useMemo)(
|
|
21680
21813
|
() => isOverflowing || hasAdditionalContent,
|
|
21681
21814
|
[isOverflowing, hasAdditionalContent]
|
|
21682
21815
|
);
|
|
21683
|
-
return /* @__PURE__ */ (0,
|
|
21684
|
-
/* @__PURE__ */ (0,
|
|
21685
|
-
Boolean(shouldShowToggle) && /* @__PURE__ */ (0,
|
|
21686
|
-
|
|
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,
|
|
21687
21820
|
{
|
|
21688
21821
|
onClick: () => {
|
|
21689
21822
|
setIsOpen(!isOpen);
|
|
21690
21823
|
},
|
|
21691
21824
|
size: "small",
|
|
21692
21825
|
sx: { mr: 1, p: 0 },
|
|
21693
|
-
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 } })
|
|
21694
21827
|
}
|
|
21695
21828
|
),
|
|
21696
|
-
/* @__PURE__ */ (0,
|
|
21697
|
-
|
|
21829
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
21830
|
+
import_material17.Typography,
|
|
21698
21831
|
{
|
|
21699
21832
|
ref: textReference,
|
|
21700
21833
|
sx: {
|
|
@@ -21711,12 +21844,12 @@ var EventMessage = ({ event }) => {
|
|
|
21711
21844
|
}
|
|
21712
21845
|
)
|
|
21713
21846
|
] }),
|
|
21714
|
-
isOpen && /* @__PURE__ */ (0,
|
|
21715
|
-
Boolean(parsedMessage.message) && /* @__PURE__ */ (0,
|
|
21716
|
-
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)(
|
|
21717
21850
|
DetailRow2,
|
|
21718
21851
|
{
|
|
21719
|
-
content: /* @__PURE__ */ (0,
|
|
21852
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(PayloadViewer, { sx: { px: 0 }, value: tryParseJson(parsedMessage.details) }),
|
|
21720
21853
|
label: "Details"
|
|
21721
21854
|
}
|
|
21722
21855
|
)
|
|
@@ -21749,15 +21882,15 @@ var EventDetail = ({
|
|
|
21749
21882
|
type
|
|
21750
21883
|
}) => {
|
|
21751
21884
|
if (type === "permission") {
|
|
21752
|
-
return /* @__PURE__ */ (0,
|
|
21885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(IAMPermissionDetail, { events, spanStatusCode });
|
|
21753
21886
|
}
|
|
21754
21887
|
const eventLevel = getEventLevelFromGroup(type);
|
|
21755
|
-
return /* @__PURE__ */ (0,
|
|
21756
|
-
/* @__PURE__ */ (0,
|
|
21757
|
-
/* @__PURE__ */ (0,
|
|
21758
|
-
/* @__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 })
|
|
21759
21892
|
] }),
|
|
21760
|
-
/* @__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}`)) })
|
|
21761
21894
|
] });
|
|
21762
21895
|
};
|
|
21763
21896
|
|
|
@@ -22199,18 +22332,18 @@ function toBase64(_input) {
|
|
|
22199
22332
|
// node_modules/.pnpm/@smithy+util-stream@4.5.25/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js
|
|
22200
22333
|
init_dist_es();
|
|
22201
22334
|
var Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array {
|
|
22202
|
-
static fromString(
|
|
22203
|
-
if (typeof
|
|
22335
|
+
static fromString(source2, encoding = "utf-8") {
|
|
22336
|
+
if (typeof source2 === "string") {
|
|
22204
22337
|
if (encoding === "base64") {
|
|
22205
|
-
return _Uint8ArrayBlobAdapter.mutate(fromBase64(
|
|
22338
|
+
return _Uint8ArrayBlobAdapter.mutate(fromBase64(source2));
|
|
22206
22339
|
}
|
|
22207
|
-
return _Uint8ArrayBlobAdapter.mutate(fromUtf8(
|
|
22340
|
+
return _Uint8ArrayBlobAdapter.mutate(fromUtf8(source2));
|
|
22208
22341
|
}
|
|
22209
|
-
throw new Error(`Unsupported conversion from ${typeof
|
|
22342
|
+
throw new Error(`Unsupported conversion from ${typeof source2} to Uint8ArrayBlobAdapter.`);
|
|
22210
22343
|
}
|
|
22211
|
-
static mutate(
|
|
22212
|
-
Object.setPrototypeOf(
|
|
22213
|
-
return
|
|
22344
|
+
static mutate(source2) {
|
|
22345
|
+
Object.setPrototypeOf(source2, _Uint8ArrayBlobAdapter.prototype);
|
|
22346
|
+
return source2;
|
|
22214
22347
|
}
|
|
22215
22348
|
transformToString(encoding = "utf-8") {
|
|
22216
22349
|
if (encoding === "base64") {
|
|
@@ -28435,7 +28568,7 @@ var SmithyMessageEncoderStream = class {
|
|
|
28435
28568
|
};
|
|
28436
28569
|
|
|
28437
28570
|
// node_modules/.pnpm/@smithy+eventstream-serde-universal@4.2.14/node_modules/@smithy/eventstream-serde-universal/dist-es/getChunkedStream.js
|
|
28438
|
-
function getChunkedStream(
|
|
28571
|
+
function getChunkedStream(source2) {
|
|
28439
28572
|
let currentMessageTotalLength = 0;
|
|
28440
28573
|
let currentMessagePendingLength = 0;
|
|
28441
28574
|
let currentMessage = null;
|
|
@@ -28451,7 +28584,7 @@ function getChunkedStream(source) {
|
|
|
28451
28584
|
currentMessageView.setUint32(0, size, false);
|
|
28452
28585
|
};
|
|
28453
28586
|
const iterator = async function* () {
|
|
28454
|
-
const sourceIterator =
|
|
28587
|
+
const sourceIterator = source2[Symbol.asyncIterator]();
|
|
28455
28588
|
while (true) {
|
|
28456
28589
|
const { value, done } = await sourceIterator.next();
|
|
28457
28590
|
if (done) {
|
|
@@ -31714,9 +31847,9 @@ var QueryStatus = {
|
|
|
31714
31847
|
};
|
|
31715
31848
|
|
|
31716
31849
|
// src/components/event-details/lambda-invoke-logs-section.tsx
|
|
31717
|
-
var
|
|
31718
|
-
var
|
|
31719
|
-
var
|
|
31850
|
+
var import_material18 = require("@mui/material");
|
|
31851
|
+
var import_react54 = require("react");
|
|
31852
|
+
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
31720
31853
|
var POLL_INTERVAL_MS2 = 1e3;
|
|
31721
31854
|
async function pollQueryResults(client, queryId) {
|
|
31722
31855
|
return client.send(new GetQueryResultsCommand({ queryId }));
|
|
@@ -31733,7 +31866,7 @@ async function startLambdaLogsQuery(client, functionName2, requestId, startTimeS
|
|
|
31733
31866
|
}
|
|
31734
31867
|
function useCloudWatchLogsClient(region) {
|
|
31735
31868
|
const { localstackEndpoint } = useAppInspector();
|
|
31736
|
-
const client = (0,
|
|
31869
|
+
const client = (0, import_react54.useMemo)(() => new CloudWatchLogsClient({
|
|
31737
31870
|
credentials: {
|
|
31738
31871
|
accessKeyId: "test",
|
|
31739
31872
|
secretAccessKey: "test"
|
|
@@ -31744,12 +31877,12 @@ function useCloudWatchLogsClient(region) {
|
|
|
31744
31877
|
return client;
|
|
31745
31878
|
}
|
|
31746
31879
|
function useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, endTimeNano) {
|
|
31747
|
-
const [loading, setLoading] = (0,
|
|
31748
|
-
const [logs, setLogs] = (0,
|
|
31749
|
-
const [error, setError] = (0,
|
|
31750
|
-
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);
|
|
31751
31884
|
const cloudWatchLogs = useCloudWatchLogsClient(region);
|
|
31752
|
-
(0,
|
|
31885
|
+
(0, import_react54.useEffect)(() => {
|
|
31753
31886
|
let cancelled = false;
|
|
31754
31887
|
const startTimeSec = Math.floor(Number(BigInt(startTimeNano) / BigInt(1e9)));
|
|
31755
31888
|
const endTimeSec = Math.ceil(Number(BigInt(endTimeNano) / BigInt(1e9)));
|
|
@@ -31806,30 +31939,30 @@ function useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, en
|
|
|
31806
31939
|
var LambdaInvokeLogsSection = ({ endTimeNano, functionName: functionName2, region, requestId, startTimeNano }) => {
|
|
31807
31940
|
const { error, loading, logs } = useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, endTimeNano);
|
|
31808
31941
|
if (loading) {
|
|
31809
|
-
return /* @__PURE__ */ (0,
|
|
31810
|
-
/* @__PURE__ */ (0,
|
|
31811
|
-
/* @__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" })
|
|
31812
31945
|
] });
|
|
31813
31946
|
}
|
|
31814
31947
|
if (error !== void 0) {
|
|
31815
|
-
return /* @__PURE__ */ (0,
|
|
31948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material18.Typography, { color: "error", variant: "body2", children: error.message });
|
|
31816
31949
|
}
|
|
31817
31950
|
if (logs.length === 0) {
|
|
31818
|
-
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." });
|
|
31819
31952
|
}
|
|
31820
|
-
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)) }) });
|
|
31821
31954
|
};
|
|
31822
31955
|
|
|
31823
31956
|
// src/components/event-details/toggle-section.tsx
|
|
31824
|
-
var
|
|
31825
|
-
var
|
|
31826
|
-
var
|
|
31827
|
-
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");
|
|
31828
31961
|
var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
|
|
31829
|
-
const [isOpen, setIsOpen] = (0,
|
|
31830
|
-
return /* @__PURE__ */ (0,
|
|
31831
|
-
/* @__PURE__ */ (0,
|
|
31832
|
-
|
|
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,
|
|
31833
31966
|
{
|
|
31834
31967
|
onClick: () => {
|
|
31835
31968
|
setIsOpen(!isOpen);
|
|
@@ -31842,8 +31975,8 @@ var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
|
|
|
31842
31975
|
mb: 1
|
|
31843
31976
|
},
|
|
31844
31977
|
children: [
|
|
31845
|
-
/* @__PURE__ */ (0,
|
|
31846
|
-
|
|
31978
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
31979
|
+
import_material19.Box,
|
|
31847
31980
|
{
|
|
31848
31981
|
role: "button",
|
|
31849
31982
|
sx: {
|
|
@@ -31852,23 +31985,23 @@ var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
|
|
|
31852
31985
|
gap: 1
|
|
31853
31986
|
},
|
|
31854
31987
|
children: [
|
|
31855
|
-
/* @__PURE__ */ (0,
|
|
31856
|
-
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 } })
|
|
31857
31990
|
]
|
|
31858
31991
|
}
|
|
31859
31992
|
),
|
|
31860
|
-
action !== false && /* @__PURE__ */ (0,
|
|
31993
|
+
action !== false && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material19.Box, { onClick: (event) => {
|
|
31861
31994
|
event.stopPropagation();
|
|
31862
31995
|
}, children: action })
|
|
31863
31996
|
]
|
|
31864
31997
|
}
|
|
31865
31998
|
),
|
|
31866
|
-
isOpen && /* @__PURE__ */ (0,
|
|
31999
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material19.Box, { children })
|
|
31867
32000
|
] });
|
|
31868
32001
|
};
|
|
31869
32002
|
|
|
31870
32003
|
// src/components/event-details/event-details.tsx
|
|
31871
|
-
var
|
|
32004
|
+
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
31872
32005
|
var checkIsLambdaInvoke = (span) => {
|
|
31873
32006
|
if (span.service_name !== "lambda") {
|
|
31874
32007
|
return false;
|
|
@@ -31883,13 +32016,13 @@ var checkIsSqsSendMessage = (span) => {
|
|
|
31883
32016
|
return span.operation_name.startsWith("SendMessage");
|
|
31884
32017
|
};
|
|
31885
32018
|
var EventDetails = ({ onClose, selectedEvent }) => {
|
|
31886
|
-
const eventGroups = (0,
|
|
32019
|
+
const eventGroups = (0, import_react56.useMemo)(
|
|
31887
32020
|
() => getEventGroupsByType(selectedEvent?.events ?? []),
|
|
31888
32021
|
[selectedEvent?.events]
|
|
31889
32022
|
);
|
|
31890
|
-
const [parseNestedJson, setParseNestedJson] = (0,
|
|
32023
|
+
const [parseNestedJson, setParseNestedJson] = (0, import_react56.useState)(true);
|
|
31891
32024
|
if (!selectedEvent) {
|
|
31892
|
-
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" }) });
|
|
31893
32026
|
}
|
|
31894
32027
|
const isLambdaInvoke = checkIsLambdaInvoke(selectedEvent);
|
|
31895
32028
|
const isSqsSendMessage = checkIsSqsSendMessage(selectedEvent);
|
|
@@ -31915,9 +32048,9 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
31915
32048
|
const exceptionPayload = tryParseJson(selectedEvent.attributes?.["localstack.aws.service.exception"]);
|
|
31916
32049
|
const hasPayloads = requestPayload !== void 0 || responsePayload !== void 0 || exceptionPayload !== void 0 || isResponseSuppressed;
|
|
31917
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;
|
|
31918
|
-
return /* @__PURE__ */ (0,
|
|
31919
|
-
/* @__PURE__ */ (0,
|
|
31920
|
-
|
|
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,
|
|
31921
32054
|
{
|
|
31922
32055
|
sx: {
|
|
31923
32056
|
alignItems: "center",
|
|
@@ -31929,91 +32062,91 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
31929
32062
|
py: 1
|
|
31930
32063
|
},
|
|
31931
32064
|
children: [
|
|
31932
|
-
/* @__PURE__ */ (0,
|
|
31933
|
-
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, {}) })
|
|
31934
32067
|
]
|
|
31935
32068
|
}
|
|
31936
32069
|
),
|
|
31937
|
-
/* @__PURE__ */ (0,
|
|
31938
|
-
/* @__PURE__ */ (0,
|
|
31939
|
-
/* @__PURE__ */ (0,
|
|
31940
|
-
/* @__PURE__ */ (0,
|
|
31941
|
-
/* @__PURE__ */ (0,
|
|
31942
|
-
/* @__PURE__ */ (0,
|
|
31943
|
-
/* @__PURE__ */ (0,
|
|
31944
|
-
/* @__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) })
|
|
31945
32078
|
] })
|
|
31946
32079
|
] }),
|
|
31947
|
-
/* @__PURE__ */ (0,
|
|
31948
|
-
/* @__PURE__ */ (0,
|
|
31949
|
-
/* @__PURE__ */ (0,
|
|
31950
|
-
/* @__PURE__ */ (0,
|
|
31951
|
-
/* @__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 })
|
|
31952
32085
|
] })
|
|
31953
32086
|
] })
|
|
31954
32087
|
] }),
|
|
31955
|
-
/* @__PURE__ */ (0,
|
|
31956
|
-
/* @__PURE__ */ (0,
|
|
31957
|
-
/* @__PURE__ */ (0,
|
|
31958
|
-
/* @__PURE__ */ (0,
|
|
31959
|
-
/* @__PURE__ */ (0,
|
|
31960
|
-
/* @__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 })
|
|
31961
32094
|
] })
|
|
31962
32095
|
] }),
|
|
31963
|
-
Boolean(cfnResourceType) && /* @__PURE__ */ (0,
|
|
31964
|
-
/* @__PURE__ */ (0,
|
|
31965
|
-
/* @__PURE__ */ (0,
|
|
31966
|
-
/* @__PURE__ */ (0,
|
|
31967
|
-
/* @__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 })
|
|
31968
32101
|
] })
|
|
31969
32102
|
] })
|
|
31970
32103
|
] }),
|
|
31971
|
-
Boolean(resourceArn) && /* @__PURE__ */ (0,
|
|
31972
|
-
/* @__PURE__ */ (0,
|
|
31973
|
-
/* @__PURE__ */ (0,
|
|
31974
|
-
/* @__PURE__ */ (0,
|
|
31975
|
-
/* @__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 })
|
|
31976
32109
|
] })
|
|
31977
32110
|
] }),
|
|
31978
|
-
/* @__PURE__ */ (0,
|
|
31979
|
-
/* @__PURE__ */ (0,
|
|
31980
|
-
/* @__PURE__ */ (0,
|
|
31981
|
-
/* @__PURE__ */ (0,
|
|
31982
|
-
/* @__PURE__ */ (0,
|
|
31983
|
-
/* @__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 })
|
|
31984
32117
|
] })
|
|
31985
32118
|
] }),
|
|
31986
|
-
/* @__PURE__ */ (0,
|
|
31987
|
-
/* @__PURE__ */ (0,
|
|
31988
|
-
/* @__PURE__ */ (0,
|
|
31989
|
-
/* @__PURE__ */ (0,
|
|
31990
|
-
/* @__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 })
|
|
31991
32124
|
] })
|
|
31992
32125
|
] })
|
|
31993
32126
|
] }),
|
|
31994
|
-
/* @__PURE__ */ (0,
|
|
31995
|
-
/* @__PURE__ */ (0,
|
|
31996
|
-
/* @__PURE__ */ (0,
|
|
31997
|
-
/* @__PURE__ */ (0,
|
|
31998
|
-
/* @__PURE__ */ (0,
|
|
31999
|
-
/* @__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() })
|
|
32000
32133
|
] })
|
|
32001
32134
|
] }),
|
|
32002
|
-
duration !== void 0 && /* @__PURE__ */ (0,
|
|
32003
|
-
/* @__PURE__ */ (0,
|
|
32004
|
-
/* @__PURE__ */ (0,
|
|
32005
|
-
/* @__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: [
|
|
32006
32139
|
duration,
|
|
32007
32140
|
"ms"
|
|
32008
32141
|
] }),
|
|
32009
|
-
/* @__PURE__ */ (0,
|
|
32142
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(CopyButton, { value: `${duration}ms` })
|
|
32010
32143
|
] })
|
|
32011
32144
|
] })
|
|
32012
32145
|
] }),
|
|
32013
|
-
/* @__PURE__ */ (0,
|
|
32014
|
-
/* @__PURE__ */ (0,
|
|
32015
|
-
/* @__PURE__ */ (0,
|
|
32016
|
-
|
|
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,
|
|
32017
32150
|
{
|
|
32018
32151
|
color: selectedEvent.status_code === 2 ? "error" : selectedEvent.status_code === 1 ? "success" : "default",
|
|
32019
32152
|
"data-testid": EVENT_DETAILS_STATUS_TEST_ID,
|
|
@@ -32023,50 +32156,50 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
32023
32156
|
) })
|
|
32024
32157
|
] })
|
|
32025
32158
|
] }) }),
|
|
32026
|
-
/* @__PURE__ */ (0,
|
|
32027
|
-
/* @__PURE__ */ (0,
|
|
32028
|
-
selectedEvent.iam_errors_suppressed && /* @__PURE__ */ (0,
|
|
32029
|
-
!selectedEvent.iam_errors_suppressed && !eventGroups.permissions && !eventGroups.errors && !eventGroups.warnings && /* @__PURE__ */ (0,
|
|
32030
|
-
eventGroups.permissions && /* @__PURE__ */ (0,
|
|
32031
|
-
eventGroups.errors && /* @__PURE__ */ (0,
|
|
32032
|
-
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" })
|
|
32033
32166
|
] }),
|
|
32034
|
-
hasPayloads && /* @__PURE__ */ (0,
|
|
32035
|
-
/* @__PURE__ */ (0,
|
|
32036
|
-
/* @__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)(
|
|
32037
32170
|
ToggleSection,
|
|
32038
32171
|
{
|
|
32039
|
-
action: /* @__PURE__ */ (0,
|
|
32040
|
-
|
|
32172
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
32173
|
+
import_material20.FormControlLabel,
|
|
32041
32174
|
{
|
|
32042
|
-
control: /* @__PURE__ */ (0,
|
|
32175
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Switch, { checked: !parseNestedJson, onChange: (event) => {
|
|
32043
32176
|
setParseNestedJson(!event.target.checked);
|
|
32044
32177
|
}, size: "small" }),
|
|
32045
|
-
label: /* @__PURE__ */ (0,
|
|
32178
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material20.Typography, { variant: "caption", children: "View raw data" }),
|
|
32046
32179
|
sx: { mr: 0 }
|
|
32047
32180
|
}
|
|
32048
32181
|
),
|
|
32049
32182
|
headline: "Payloads",
|
|
32050
|
-
children: /* @__PURE__ */ (0,
|
|
32051
|
-
requestPayload !== void 0 && /* @__PURE__ */ (0,
|
|
32052
|
-
/* @__PURE__ */ (0,
|
|
32053
|
-
/* @__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 })
|
|
32054
32187
|
] }),
|
|
32055
|
-
(responsePayload !== void 0 || isResponseSuppressed) && /* @__PURE__ */ (0,
|
|
32056
|
-
/* @__PURE__ */ (0,
|
|
32057
|
-
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 })
|
|
32058
32191
|
] }),
|
|
32059
|
-
exceptionPayload !== void 0 && /* @__PURE__ */ (0,
|
|
32060
|
-
/* @__PURE__ */ (0,
|
|
32061
|
-
/* @__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 })
|
|
32062
32195
|
] })
|
|
32063
32196
|
] })
|
|
32064
32197
|
}
|
|
32065
32198
|
)
|
|
32066
32199
|
] }),
|
|
32067
|
-
isLambdaInvoke && requestId !== void 0 && /* @__PURE__ */ (0,
|
|
32068
|
-
/* @__PURE__ */ (0,
|
|
32069
|
-
/* @__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)(
|
|
32070
32203
|
LambdaInvokeLogsSection,
|
|
32071
32204
|
{
|
|
32072
32205
|
endTimeNano: selectedEvent.end_time_unix_nano ?? selectedEvent.start_time_unix_nano,
|
|
@@ -32077,30 +32210,30 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
32077
32210
|
}
|
|
32078
32211
|
) })
|
|
32079
32212
|
] }),
|
|
32080
|
-
/* @__PURE__ */ (0,
|
|
32081
|
-
/* @__PURE__ */ (0,
|
|
32082
|
-
/* @__PURE__ */ (0,
|
|
32083
|
-
/* @__PURE__ */ (0,
|
|
32084
|
-
/* @__PURE__ */ (0,
|
|
32085
|
-
/* @__PURE__ */ (0,
|
|
32086
|
-
/* @__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 })
|
|
32087
32220
|
] })
|
|
32088
32221
|
] }),
|
|
32089
|
-
/* @__PURE__ */ (0,
|
|
32090
|
-
/* @__PURE__ */ (0,
|
|
32091
|
-
/* @__PURE__ */ (0,
|
|
32092
|
-
/* @__PURE__ */ (0,
|
|
32093
|
-
/* @__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 })
|
|
32094
32227
|
] })
|
|
32095
32228
|
] }),
|
|
32096
|
-
requestId !== void 0 && /* @__PURE__ */ (0,
|
|
32097
|
-
/* @__PURE__ */ (0,
|
|
32098
|
-
/* @__PURE__ */ (0,
|
|
32099
|
-
/* @__PURE__ */ (0,
|
|
32100
|
-
/* @__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 })
|
|
32101
32234
|
] })
|
|
32102
32235
|
] }),
|
|
32103
|
-
eventGroups.info && /* @__PURE__ */ (0,
|
|
32236
|
+
eventGroups.info && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(EventDetail, { displayText: "Info", events: eventGroups.info, type: "info" })
|
|
32104
32237
|
] }) })
|
|
32105
32238
|
] }) })
|
|
32106
32239
|
] });
|
|
@@ -32108,39 +32241,39 @@ var EventDetails = ({ onClose, selectedEvent }) => {
|
|
|
32108
32241
|
|
|
32109
32242
|
// src/components/trace-graph/trace-graph.tsx
|
|
32110
32243
|
var import_base = require("@xyflow/react/dist/base.css");
|
|
32111
|
-
var
|
|
32112
|
-
var
|
|
32113
|
-
var
|
|
32244
|
+
var import_material24 = require("@mui/material");
|
|
32245
|
+
var import_react63 = require("@xyflow/react");
|
|
32246
|
+
var import_react64 = require("react");
|
|
32114
32247
|
|
|
32115
32248
|
// src/components/trace-graph/service-node.tsx
|
|
32116
|
-
var
|
|
32117
|
-
var
|
|
32118
|
-
var
|
|
32249
|
+
var import_icons_material13 = require("@mui/icons-material");
|
|
32250
|
+
var import_material21 = require("@mui/material");
|
|
32251
|
+
var import_react57 = require("@xyflow/react");
|
|
32119
32252
|
var import_style = require("@xyflow/react/dist/style.css");
|
|
32120
32253
|
var React122 = require("react");
|
|
32121
|
-
var
|
|
32122
|
-
var
|
|
32254
|
+
var import_react58 = require("react");
|
|
32255
|
+
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
32123
32256
|
var handleStyle = {
|
|
32124
32257
|
backgroundColor: "white",
|
|
32125
32258
|
borderColor: "lightgray",
|
|
32126
32259
|
opacity: 0
|
|
32127
32260
|
};
|
|
32128
32261
|
var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning }) => {
|
|
32129
|
-
const theme = (0,
|
|
32130
|
-
return /* @__PURE__ */ (0,
|
|
32131
|
-
/* @__PURE__ */ (0,
|
|
32132
|
-
/* @__PURE__ */ (0,
|
|
32133
|
-
/* @__PURE__ */ (0,
|
|
32134
|
-
|
|
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,
|
|
32135
32268
|
{
|
|
32136
32269
|
alignItems: "center",
|
|
32137
32270
|
direction: "row",
|
|
32138
32271
|
sx: { gap: "8px", pb: "2px", pt: "6px", px: "8px" },
|
|
32139
32272
|
children: [
|
|
32140
|
-
/* @__PURE__ */ (0,
|
|
32141
|
-
/* @__PURE__ */ (0,
|
|
32142
|
-
/* @__PURE__ */ (0,
|
|
32143
|
-
|
|
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,
|
|
32144
32277
|
{
|
|
32145
32278
|
noWrap: !expanded,
|
|
32146
32279
|
sx: { fontWeight: 700, lineHeight: 1.25, ...expanded && { whiteSpace: "nowrap" } },
|
|
@@ -32148,8 +32281,8 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
|
|
|
32148
32281
|
children: getServiceDisplayName(event.service_name)
|
|
32149
32282
|
}
|
|
32150
32283
|
),
|
|
32151
|
-
event.resource_name != "" && /* @__PURE__ */ (0,
|
|
32152
|
-
|
|
32284
|
+
event.resource_name != "" && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32285
|
+
import_material21.Typography,
|
|
32153
32286
|
{
|
|
32154
32287
|
color: "text.secondary",
|
|
32155
32288
|
noWrap: !expanded,
|
|
@@ -32162,16 +32295,16 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
|
|
|
32162
32295
|
]
|
|
32163
32296
|
}
|
|
32164
32297
|
),
|
|
32165
|
-
/* @__PURE__ */ (0,
|
|
32166
|
-
/* @__PURE__ */ (0,
|
|
32167
|
-
|
|
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,
|
|
32168
32301
|
{
|
|
32169
32302
|
alignItems: "center",
|
|
32170
32303
|
direction: "row",
|
|
32171
32304
|
sx: expanded ? { pb: "5px", pr: "8px", pt: "1px" } : { minWidth: 0, pb: "5px", pr: "8px", pt: "1px" },
|
|
32172
32305
|
children: [
|
|
32173
|
-
/* @__PURE__ */ (0,
|
|
32174
|
-
|
|
32306
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
|
|
32307
|
+
import_material21.Box,
|
|
32175
32308
|
{
|
|
32176
32309
|
sx: {
|
|
32177
32310
|
alignItems: "center",
|
|
@@ -32181,13 +32314,13 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
|
|
|
32181
32314
|
width: "38px"
|
|
32182
32315
|
},
|
|
32183
32316
|
children: [
|
|
32184
|
-
(isError || isWarning) && hasPermissionEvents && /* @__PURE__ */ (0,
|
|
32185
|
-
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" } }) })
|
|
32186
32319
|
]
|
|
32187
32320
|
}
|
|
32188
32321
|
),
|
|
32189
|
-
/* @__PURE__ */ (0,
|
|
32190
|
-
|
|
32322
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32323
|
+
import_material21.Typography,
|
|
32191
32324
|
{
|
|
32192
32325
|
"data-testid": SERVICE_NODE_OPERATION_NAME_TEST_ID,
|
|
32193
32326
|
noWrap: !expanded,
|
|
@@ -32201,12 +32334,12 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
|
|
|
32201
32334
|
)
|
|
32202
32335
|
] });
|
|
32203
32336
|
};
|
|
32204
|
-
var ServiceNode = (0,
|
|
32205
|
-
const theme = (0,
|
|
32206
|
-
const [isHovered, setIsHovered] = (0,
|
|
32207
|
-
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);
|
|
32208
32341
|
const { operation_status } = data.event;
|
|
32209
|
-
const hasPermissionEventsLegacy = (0,
|
|
32342
|
+
const hasPermissionEventsLegacy = (0, import_react58.useMemo)(
|
|
32210
32343
|
() => data.event.events.some(
|
|
32211
32344
|
(event) => event.event_type === "iam.policy_evaluation" && event.name === "iam.policy.denied"
|
|
32212
32345
|
),
|
|
@@ -32237,8 +32370,8 @@ var ServiceNode = (0, import_react57.memo)(({ data, selected }) => {
|
|
|
32237
32370
|
const xyNode = nodeRef.current?.closest(".react-flow__node");
|
|
32238
32371
|
if (xyNode) xyNode.style.zIndex = "";
|
|
32239
32372
|
};
|
|
32240
|
-
return /* @__PURE__ */ (0,
|
|
32241
|
-
|
|
32373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
|
|
32374
|
+
import_material21.Box,
|
|
32242
32375
|
{
|
|
32243
32376
|
"data-testid": SERVICE_NODE_TEST_ID,
|
|
32244
32377
|
onMouseEnter: handleMouseEnter,
|
|
@@ -32248,8 +32381,8 @@ var ServiceNode = (0, import_react57.memo)(({ data, selected }) => {
|
|
|
32248
32381
|
sx: { display: "inline-block", position: "relative" },
|
|
32249
32382
|
tabIndex: 0,
|
|
32250
32383
|
children: [
|
|
32251
|
-
/* @__PURE__ */ (0,
|
|
32252
|
-
|
|
32384
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32385
|
+
import_material21.Box,
|
|
32253
32386
|
{
|
|
32254
32387
|
sx: {
|
|
32255
32388
|
...sharedBoxSx,
|
|
@@ -32257,11 +32390,11 @@ var ServiceNode = (0, import_react57.memo)(({ data, selected }) => {
|
|
|
32257
32390
|
maxWidth: 220,
|
|
32258
32391
|
overflow: "hidden"
|
|
32259
32392
|
},
|
|
32260
|
-
children: /* @__PURE__ */ (0,
|
|
32393
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(NodeContent, { ...contentProps, expanded: false })
|
|
32261
32394
|
}
|
|
32262
32395
|
),
|
|
32263
|
-
/* @__PURE__ */ (0,
|
|
32264
|
-
|
|
32396
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
32397
|
+
import_material21.Box,
|
|
32265
32398
|
{
|
|
32266
32399
|
onMouseLeave: handleMouseLeave,
|
|
32267
32400
|
sx: {
|
|
@@ -32275,7 +32408,7 @@ var ServiceNode = (0, import_react57.memo)(({ data, selected }) => {
|
|
|
32275
32408
|
width: "max-content",
|
|
32276
32409
|
zIndex: 10
|
|
32277
32410
|
},
|
|
32278
|
-
children: /* @__PURE__ */ (0,
|
|
32411
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(NodeContent, { ...contentProps, expanded: true })
|
|
32279
32412
|
}
|
|
32280
32413
|
)
|
|
32281
32414
|
]
|
|
@@ -32369,20 +32502,20 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
|
|
|
32369
32502
|
};
|
|
32370
32503
|
|
|
32371
32504
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
32372
|
-
var
|
|
32373
|
-
var
|
|
32374
|
-
var
|
|
32375
|
-
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");
|
|
32376
32509
|
var import_shallow = require("zustand/shallow");
|
|
32377
|
-
var
|
|
32510
|
+
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
32378
32511
|
var selector = (s) => ({
|
|
32379
32512
|
isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,
|
|
32380
32513
|
maxZoomReached: s.transform[2] >= s.maxZoom,
|
|
32381
32514
|
minZoomReached: s.transform[2] <= s.minZoom
|
|
32382
32515
|
});
|
|
32383
|
-
var Controls = (0,
|
|
32384
|
-
const { maxZoomReached, minZoomReached } = (0,
|
|
32385
|
-
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)();
|
|
32386
32519
|
const onZoomInHandler = () => {
|
|
32387
32520
|
void zoomIn();
|
|
32388
32521
|
};
|
|
@@ -32392,8 +32525,8 @@ var Controls = (0, import_react59.memo)(() => {
|
|
|
32392
32525
|
const onFitViewHandler = () => {
|
|
32393
32526
|
void fitView();
|
|
32394
32527
|
};
|
|
32395
|
-
return /* @__PURE__ */ (0,
|
|
32396
|
-
|
|
32528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
|
|
32529
|
+
import_material22.Box,
|
|
32397
32530
|
{
|
|
32398
32531
|
sx: {
|
|
32399
32532
|
bottom: 0,
|
|
@@ -32406,33 +32539,33 @@ var Controls = (0, import_react59.memo)(() => {
|
|
|
32406
32539
|
zIndex: 5
|
|
32407
32540
|
},
|
|
32408
32541
|
children: [
|
|
32409
|
-
/* @__PURE__ */ (0,
|
|
32410
|
-
|
|
32542
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
32543
|
+
import_material22.IconButton,
|
|
32411
32544
|
{
|
|
32412
32545
|
className: "react-flow__controls-zoomin",
|
|
32413
32546
|
disabled: maxZoomReached,
|
|
32414
32547
|
onClick: onZoomInHandler,
|
|
32415
32548
|
size: "small",
|
|
32416
|
-
children: /* @__PURE__ */ (0,
|
|
32549
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_icons_material14.Add, {})
|
|
32417
32550
|
}
|
|
32418
32551
|
),
|
|
32419
|
-
/* @__PURE__ */ (0,
|
|
32420
|
-
|
|
32552
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
32553
|
+
import_material22.IconButton,
|
|
32421
32554
|
{
|
|
32422
32555
|
className: "react-flow__controls-zoomout",
|
|
32423
32556
|
disabled: minZoomReached,
|
|
32424
32557
|
onClick: onZoomOutHandler,
|
|
32425
32558
|
size: "small",
|
|
32426
|
-
children: /* @__PURE__ */ (0,
|
|
32559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_icons_material14.Remove, {})
|
|
32427
32560
|
}
|
|
32428
32561
|
),
|
|
32429
|
-
/* @__PURE__ */ (0,
|
|
32430
|
-
|
|
32562
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
32563
|
+
import_material22.IconButton,
|
|
32431
32564
|
{
|
|
32432
32565
|
className: "react-flow__controls-fitview",
|
|
32433
32566
|
onClick: onFitViewHandler,
|
|
32434
32567
|
size: "small",
|
|
32435
|
-
children: /* @__PURE__ */ (0,
|
|
32568
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_icons_material14.FitScreen, {})
|
|
32436
32569
|
}
|
|
32437
32570
|
)
|
|
32438
32571
|
]
|
|
@@ -32441,14 +32574,14 @@ var Controls = (0, import_react59.memo)(() => {
|
|
|
32441
32574
|
});
|
|
32442
32575
|
|
|
32443
32576
|
// src/components/trace-graph/xyflow/minimap-node.tsx
|
|
32444
|
-
var
|
|
32445
|
-
var
|
|
32446
|
-
var
|
|
32447
|
-
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");
|
|
32448
32581
|
var ICON_FRACTION = 0.35;
|
|
32449
32582
|
var PADDING_FRACTION = 0.18;
|
|
32450
32583
|
var ICON_NATIVE_SIZE = 80;
|
|
32451
|
-
var MinimapServiceNode = (0,
|
|
32584
|
+
var MinimapServiceNode = (0, import_react62.memo)(({
|
|
32452
32585
|
height,
|
|
32453
32586
|
id: id2,
|
|
32454
32587
|
onClick,
|
|
@@ -32457,8 +32590,8 @@ var MinimapServiceNode = (0, import_react61.memo)(({
|
|
|
32457
32590
|
x,
|
|
32458
32591
|
y
|
|
32459
32592
|
}) => {
|
|
32460
|
-
const theme = (0,
|
|
32461
|
-
const node = (0,
|
|
32593
|
+
const theme = (0, import_material23.useTheme)();
|
|
32594
|
+
const node = (0, import_react61.useStore)((s) => s.nodeLookup.get(id2));
|
|
32462
32595
|
const event = node?.data.event;
|
|
32463
32596
|
const serviceName = event?.service_name;
|
|
32464
32597
|
const Icon = serviceName ? getServiceIconComponent(serviceName) : void 0;
|
|
@@ -32473,10 +32606,10 @@ var MinimapServiceNode = (0, import_react61.memo)(({
|
|
|
32473
32606
|
const dotY = y + height - padding - dotRadius;
|
|
32474
32607
|
const outlineColor = selected ? isError ? errorColor : "#1a73e8" : "#cccccc";
|
|
32475
32608
|
const outlineWidth = selected ? 2 : 1;
|
|
32476
|
-
return /* @__PURE__ */ (0,
|
|
32609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("g", { onClick: onClick ? (event2) => {
|
|
32477
32610
|
onClick(event2, id2);
|
|
32478
32611
|
} : void 0, children: [
|
|
32479
|
-
/* @__PURE__ */ (0,
|
|
32612
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
32480
32613
|
"rect",
|
|
32481
32614
|
{
|
|
32482
32615
|
fill: theme.palette.background.paper,
|
|
@@ -32490,7 +32623,7 @@ var MinimapServiceNode = (0, import_react61.memo)(({
|
|
|
32490
32623
|
y
|
|
32491
32624
|
}
|
|
32492
32625
|
),
|
|
32493
|
-
isError && /* @__PURE__ */ (0,
|
|
32626
|
+
isError && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
32494
32627
|
"rect",
|
|
32495
32628
|
{
|
|
32496
32629
|
fill: errorColor,
|
|
@@ -32502,8 +32635,8 @@ var MinimapServiceNode = (0, import_react61.memo)(({
|
|
|
32502
32635
|
y: y + 3
|
|
32503
32636
|
}
|
|
32504
32637
|
),
|
|
32505
|
-
Icon && /* @__PURE__ */ (0,
|
|
32506
|
-
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)(
|
|
32507
32640
|
"circle",
|
|
32508
32641
|
{
|
|
32509
32642
|
cx: dotX,
|
|
@@ -32516,15 +32649,15 @@ var MinimapServiceNode = (0, import_react61.memo)(({
|
|
|
32516
32649
|
});
|
|
32517
32650
|
|
|
32518
32651
|
// src/components/trace-graph/trace-graph.tsx
|
|
32519
|
-
var
|
|
32652
|
+
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
32520
32653
|
var nodeTypes = {
|
|
32521
32654
|
service: ServiceNode
|
|
32522
32655
|
};
|
|
32523
32656
|
var ExtentUpdater = ({ onUpdate, viewportRef }) => {
|
|
32524
|
-
const zoom = (0,
|
|
32525
|
-
const width = (0,
|
|
32526
|
-
const height = (0,
|
|
32527
|
-
(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)(() => {
|
|
32528
32661
|
viewportRef.current = { height, width, zoom };
|
|
32529
32662
|
onUpdate();
|
|
32530
32663
|
}, [zoom, width, height, onUpdate, viewportRef]);
|
|
@@ -32536,12 +32669,12 @@ var TraceGraph = ({
|
|
|
32536
32669
|
onRefresh,
|
|
32537
32670
|
spans
|
|
32538
32671
|
}) => {
|
|
32539
|
-
const [nodes2, setNodes, onNodesChange] = (0,
|
|
32540
|
-
const [edges, setEdges] = (0,
|
|
32541
|
-
const [translateExtent, setTranslateExtent] = (0,
|
|
32542
|
-
const nodeBoundsRef = (0,
|
|
32543
|
-
const viewportRef = (0,
|
|
32544
|
-
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)(() => {
|
|
32545
32678
|
const bounds = nodeBoundsRef.current;
|
|
32546
32679
|
const { height, width, zoom } = viewportRef.current;
|
|
32547
32680
|
if (!bounds || width === 0 || height === 0) return;
|
|
@@ -32554,7 +32687,7 @@ var TraceGraph = ({
|
|
|
32554
32687
|
[bounds.maxX + hMargin, bounds.maxY + vMargin]
|
|
32555
32688
|
]);
|
|
32556
32689
|
}, []);
|
|
32557
|
-
(0,
|
|
32690
|
+
(0, import_react64.useEffect)(() => {
|
|
32558
32691
|
const allNodes = [];
|
|
32559
32692
|
const allEdges = [];
|
|
32560
32693
|
for (const span of spans.data ?? []) {
|
|
@@ -32569,15 +32702,15 @@ var TraceGraph = ({
|
|
|
32569
32702
|
},
|
|
32570
32703
|
id: span.span_id,
|
|
32571
32704
|
position: { x: 0, y: 0 },
|
|
32572
|
-
sourcePosition:
|
|
32573
|
-
targetPosition:
|
|
32705
|
+
sourcePosition: import_react63.Position.Right,
|
|
32706
|
+
targetPosition: import_react63.Position.Left,
|
|
32574
32707
|
type: "service"
|
|
32575
32708
|
});
|
|
32576
32709
|
if (span.parent_span_id !== null) {
|
|
32577
32710
|
allEdges.push({
|
|
32578
32711
|
animated: false,
|
|
32579
32712
|
id: `e-${span.parent_span_id}-${span.span_id}`,
|
|
32580
|
-
markerEnd: { color: "lightgray", height: 16, type:
|
|
32713
|
+
markerEnd: { color: "lightgray", height: 16, type: import_react63.MarkerType.Arrow, width: 16 },
|
|
32581
32714
|
source: span.parent_span_id,
|
|
32582
32715
|
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
32583
32716
|
target: span.span_id
|
|
@@ -32586,7 +32719,7 @@ var TraceGraph = ({
|
|
|
32586
32719
|
for (const outgoingLinkSpanId of span.outgoing_link_span_ids ?? []) {
|
|
32587
32720
|
allEdges.push({
|
|
32588
32721
|
id: `e-link-${outgoingLinkSpanId}-${span.span_id}`,
|
|
32589
|
-
markerEnd: { color: "lightgray", height: 16, type:
|
|
32722
|
+
markerEnd: { color: "lightgray", height: 16, type: import_react63.MarkerType.Arrow, width: 16 },
|
|
32590
32723
|
source: outgoingLinkSpanId,
|
|
32591
32724
|
style: { stroke: "lightgray", strokeWidth: 1 },
|
|
32592
32725
|
// animated: true,
|
|
@@ -32626,12 +32759,12 @@ var TraceGraph = ({
|
|
|
32626
32759
|
updateExtent();
|
|
32627
32760
|
}
|
|
32628
32761
|
}, [spans.data, initialFocusEventId, setNodes, setEdges, updateExtent]);
|
|
32629
|
-
const theme = (0,
|
|
32630
|
-
return /* @__PURE__ */ (0,
|
|
32631
|
-
spans.error && /* @__PURE__ */ (0,
|
|
32632
|
-
|
|
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,
|
|
32633
32766
|
{
|
|
32634
|
-
action: /* @__PURE__ */ (0,
|
|
32767
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_material24.Button, { onClick: () => {
|
|
32635
32768
|
onRefresh();
|
|
32636
32769
|
}, children: "Retry" }),
|
|
32637
32770
|
severity: "error",
|
|
@@ -32643,8 +32776,8 @@ var TraceGraph = ({
|
|
|
32643
32776
|
]
|
|
32644
32777
|
}
|
|
32645
32778
|
),
|
|
32646
|
-
/* @__PURE__ */ (0,
|
|
32647
|
-
|
|
32779
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
|
|
32780
|
+
import_react63.ReactFlow,
|
|
32648
32781
|
{
|
|
32649
32782
|
colorMode: theme.palette.mode,
|
|
32650
32783
|
"data-testid": TRACE_GRAPH_TEST_ID,
|
|
@@ -32663,18 +32796,18 @@ var TraceGraph = ({
|
|
|
32663
32796
|
selectNodesOnDrag: false,
|
|
32664
32797
|
translateExtent,
|
|
32665
32798
|
children: [
|
|
32666
|
-
/* @__PURE__ */ (0,
|
|
32667
|
-
/* @__PURE__ */ (0,
|
|
32668
|
-
/* @__PURE__ */ (0,
|
|
32669
|
-
|
|
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,
|
|
32670
32803
|
{
|
|
32671
32804
|
nodeComponent: MinimapServiceNode,
|
|
32672
32805
|
pannable: true,
|
|
32673
32806
|
zoomable: true
|
|
32674
32807
|
}
|
|
32675
32808
|
),
|
|
32676
|
-
/* @__PURE__ */ (0,
|
|
32677
|
-
|
|
32809
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
32810
|
+
import_react63.Background,
|
|
32678
32811
|
{
|
|
32679
32812
|
bgColor: theme.palette.background.default,
|
|
32680
32813
|
color: theme.palette.text.disabled
|
|
@@ -32687,7 +32820,7 @@ var TraceGraph = ({
|
|
|
32687
32820
|
};
|
|
32688
32821
|
|
|
32689
32822
|
// src/pages/trace-graph-page.tsx
|
|
32690
|
-
var
|
|
32823
|
+
var import_jsx_runtime147 = require("react/jsx-runtime");
|
|
32691
32824
|
var DRAWER_WIDTH = "35%";
|
|
32692
32825
|
var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
|
|
32693
32826
|
flexGrow: 1,
|
|
@@ -32704,7 +32837,7 @@ var Main = (0, import_styles.styled)("main", { shouldForwardProp: (property) =>
|
|
|
32704
32837
|
})
|
|
32705
32838
|
}
|
|
32706
32839
|
}));
|
|
32707
|
-
var StyledDrawer = (0, import_styles.styled)(
|
|
32840
|
+
var StyledDrawer = (0, import_styles.styled)(import_material25.Drawer)({
|
|
32708
32841
|
"& .MuiDrawer-paper": {
|
|
32709
32842
|
bottom: 0,
|
|
32710
32843
|
boxSizing: "border-box",
|
|
@@ -32731,8 +32864,8 @@ var TraceGraphView = ({
|
|
|
32731
32864
|
spans,
|
|
32732
32865
|
traceId
|
|
32733
32866
|
}) => {
|
|
32734
|
-
return /* @__PURE__ */ (0,
|
|
32735
|
-
|
|
32867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(
|
|
32868
|
+
import_material25.Paper,
|
|
32736
32869
|
{
|
|
32737
32870
|
"data-testid": TRACE_GRAPH_PAGE_TEST_ID,
|
|
32738
32871
|
square: true,
|
|
@@ -32744,11 +32877,11 @@ var TraceGraphView = ({
|
|
|
32744
32877
|
width: "100%"
|
|
32745
32878
|
},
|
|
32746
32879
|
children: [
|
|
32747
|
-
/* @__PURE__ */ (0,
|
|
32748
|
-
/* @__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: () => {
|
|
32749
32882
|
navigateToSpansList();
|
|
32750
|
-
}, startIcon: /* @__PURE__ */ (0,
|
|
32751
|
-
/* @__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)(
|
|
32752
32885
|
TraceGraph,
|
|
32753
32886
|
{
|
|
32754
32887
|
initialFocusEventId: spanId,
|
|
@@ -32764,7 +32897,7 @@ var TraceGraphView = ({
|
|
|
32764
32897
|
}
|
|
32765
32898
|
) }) })
|
|
32766
32899
|
] }) }),
|
|
32767
|
-
/* @__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 }) })
|
|
32768
32901
|
]
|
|
32769
32902
|
}
|
|
32770
32903
|
);
|
|
@@ -32812,10 +32945,10 @@ async function fetchConnectedTracesWaterfall(api, traceIds, allSpans = /* @__PUR
|
|
|
32812
32945
|
}
|
|
32813
32946
|
var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
32814
32947
|
const api = useAppInspectorApi();
|
|
32815
|
-
const [spans, setSpans] = (0,
|
|
32816
|
-
const [loading, setLoading] = (0,
|
|
32817
|
-
const [fetchError, setFetchError] = (0,
|
|
32818
|
-
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 () => {
|
|
32819
32952
|
setLoading(true);
|
|
32820
32953
|
try {
|
|
32821
32954
|
const spans2 = await fetchConnectedTraces(api, traceId);
|
|
@@ -32828,27 +32961,27 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32828
32961
|
setLoading(false);
|
|
32829
32962
|
}
|
|
32830
32963
|
}, [api, traceId]);
|
|
32831
|
-
(0,
|
|
32964
|
+
(0, import_react66.useEffect)(() => {
|
|
32832
32965
|
void fetchSpans();
|
|
32833
32966
|
}, [fetchSpans]);
|
|
32834
|
-
const [open, setOpen] = (0,
|
|
32835
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
32836
|
-
const spansReference = (0,
|
|
32837
|
-
(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)(() => {
|
|
32838
32971
|
if (!spansReference.current && spans) {
|
|
32839
32972
|
setSelectedEvent(spans.find((span) => span.span_id === spanId));
|
|
32840
32973
|
spansReference.current = spans;
|
|
32841
32974
|
}
|
|
32842
32975
|
}, [spans, setSelectedEvent, spanId]);
|
|
32843
|
-
const handleEventSelect = (0,
|
|
32976
|
+
const handleEventSelect = (0, import_react66.useCallback)((spanId2) => {
|
|
32844
32977
|
const span = spans?.find((s) => s.span_id === spanId2);
|
|
32845
32978
|
setSelectedEvent(span);
|
|
32846
32979
|
setOpen(true);
|
|
32847
32980
|
}, [spans]);
|
|
32848
|
-
const navigateToSpansList = (0,
|
|
32981
|
+
const navigateToSpansList = (0, import_react66.useCallback)(() => {
|
|
32849
32982
|
onClose?.();
|
|
32850
32983
|
}, [onClose]);
|
|
32851
|
-
return /* @__PURE__ */ (0,
|
|
32984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
32852
32985
|
TraceGraphView,
|
|
32853
32986
|
{
|
|
32854
32987
|
fetchError,
|
|
@@ -32869,57 +33002,67 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
|
|
|
32869
33002
|
};
|
|
32870
33003
|
|
|
32871
33004
|
// src/pages/spans-list-page.tsx
|
|
32872
|
-
var
|
|
33005
|
+
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
32873
33006
|
var SpansListPage = () => {
|
|
32874
33007
|
const api = useAppInspectorApi();
|
|
32875
33008
|
const {
|
|
32876
33009
|
clearFetchError,
|
|
32877
33010
|
clearingSpans,
|
|
32878
33011
|
clearSpans,
|
|
33012
|
+
consumerValues,
|
|
32879
33013
|
errorCount,
|
|
32880
33014
|
fetchError,
|
|
32881
33015
|
fetchForward,
|
|
32882
33016
|
fetchingBackward,
|
|
32883
33017
|
fetchingForward,
|
|
33018
|
+
filteredErrorCount,
|
|
33019
|
+
filteredSpans,
|
|
33020
|
+
filteredWarningCount,
|
|
33021
|
+
filters,
|
|
33022
|
+
hasExternalProducer,
|
|
32884
33023
|
hasMoreBackward,
|
|
32885
33024
|
hasMoreForward,
|
|
32886
33025
|
licenseLimit,
|
|
33026
|
+
producerValues,
|
|
33027
|
+
retryWorker,
|
|
32887
33028
|
search,
|
|
32888
33029
|
searching,
|
|
33030
|
+
setFilters,
|
|
32889
33031
|
setSearch,
|
|
32890
|
-
|
|
33032
|
+
statusValues,
|
|
32891
33033
|
systemLimit,
|
|
32892
33034
|
totalCount,
|
|
32893
|
-
warningCount
|
|
33035
|
+
warningCount,
|
|
33036
|
+
workerError
|
|
32894
33037
|
} = useSpans();
|
|
32895
33038
|
const { checkStatus, phase, status, statusError } = useAppInspectorStatus();
|
|
32896
|
-
const clearSpansSync = (0,
|
|
33039
|
+
const clearSpansSync = (0, import_react67.useCallback)(() => {
|
|
32897
33040
|
void clearSpans();
|
|
32898
33041
|
}, [clearSpans]);
|
|
32899
33042
|
const localstackVersion = status?.localstackVersion ?? (statusError instanceof AppInspectorNotFoundError ? statusError.localstackVersion : void 0);
|
|
32900
33043
|
const versionCompatibility = checkEmulatorVersion(localstackVersion);
|
|
32901
33044
|
const searchSupported = emulatorSupportsSearch(localstackVersion);
|
|
32902
|
-
const [bannerDismissed, setBannerDismissed] = (0,
|
|
33045
|
+
const [bannerDismissed, setBannerDismissed] = (0, import_react67.useState)(false);
|
|
32903
33046
|
const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
|
|
32904
|
-
const [selectedTraceId, setSelectedTraceId] = (0,
|
|
32905
|
-
const [selectedSpanId, setSelectedSpanId] = (0,
|
|
32906
|
-
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) => {
|
|
32907
33050
|
setSelectedTraceId(span.trace_id);
|
|
32908
33051
|
setSelectedSpanId(span.span_id);
|
|
32909
33052
|
}, []);
|
|
32910
|
-
const handleRetry = (0,
|
|
33053
|
+
const handleRetry = (0, import_react67.useCallback)(() => {
|
|
32911
33054
|
checkStatus();
|
|
32912
33055
|
fetchForward();
|
|
32913
33056
|
}, [checkStatus, fetchForward]);
|
|
32914
|
-
const handleEnable = (0,
|
|
33057
|
+
const handleEnable = (0, import_react67.useCallback)(async () => {
|
|
32915
33058
|
await api.setStatus({ status: "ENABLED" });
|
|
32916
33059
|
clearFetchError();
|
|
32917
33060
|
checkStatus();
|
|
32918
33061
|
}, [api, checkStatus, clearFetchError]);
|
|
32919
|
-
const isDelayedRefetchRef = (0,
|
|
32920
|
-
const delayedRefetchTimerRef = (0,
|
|
32921
|
-
const prevFetchingForwardRef = (0,
|
|
32922
|
-
(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)(() => {
|
|
32923
33066
|
const wasFetching = prevFetchingForwardRef.current;
|
|
32924
33067
|
prevFetchingForwardRef.current = fetchingForward;
|
|
32925
33068
|
if (wasFetching && !fetchingForward) {
|
|
@@ -32940,10 +33083,10 @@ var SpansListPage = () => {
|
|
|
32940
33083
|
switch (phase) {
|
|
32941
33084
|
case "CHECKING_STATUS":
|
|
32942
33085
|
case "CONNECTING_WS": {
|
|
32943
|
-
return /* @__PURE__ */ (0,
|
|
33086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(StatusMessage, { phase });
|
|
32944
33087
|
}
|
|
32945
33088
|
case "DISABLED": {
|
|
32946
|
-
return /* @__PURE__ */ (0,
|
|
33089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
32947
33090
|
StatusMessage,
|
|
32948
33091
|
{
|
|
32949
33092
|
onEnable: handleEnable,
|
|
@@ -32952,7 +33095,7 @@ var SpansListPage = () => {
|
|
|
32952
33095
|
);
|
|
32953
33096
|
}
|
|
32954
33097
|
case "INCOMPATIBLE": {
|
|
32955
|
-
return /* @__PURE__ */ (0,
|
|
33098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
32956
33099
|
StatusMessage,
|
|
32957
33100
|
{
|
|
32958
33101
|
localstackVersion,
|
|
@@ -32962,10 +33105,13 @@ var SpansListPage = () => {
|
|
|
32962
33105
|
);
|
|
32963
33106
|
}
|
|
32964
33107
|
case "LIVE": {
|
|
33108
|
+
if (workerError) {
|
|
33109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(WorkerErrorMessage, { error: workerError, onRetry: retryWorker });
|
|
33110
|
+
}
|
|
32965
33111
|
break;
|
|
32966
33112
|
}
|
|
32967
33113
|
case "UNREACHABLE": {
|
|
32968
|
-
return /* @__PURE__ */ (0,
|
|
33114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
32969
33115
|
StatusMessage,
|
|
32970
33116
|
{
|
|
32971
33117
|
onRetry: handleRetry,
|
|
@@ -32974,9 +33120,9 @@ var SpansListPage = () => {
|
|
|
32974
33120
|
);
|
|
32975
33121
|
}
|
|
32976
33122
|
}
|
|
32977
|
-
return /* @__PURE__ */ (0,
|
|
32978
|
-
/* @__PURE__ */ (0,
|
|
32979
|
-
|
|
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,
|
|
32980
33126
|
{
|
|
32981
33127
|
"data-testid": SPANS_LIST_PAGE_TEST_ID,
|
|
32982
33128
|
sx: {
|
|
@@ -32991,7 +33137,7 @@ var SpansListPage = () => {
|
|
|
32991
33137
|
width: "100%"
|
|
32992
33138
|
},
|
|
32993
33139
|
children: [
|
|
32994
|
-
/* @__PURE__ */ (0,
|
|
33140
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
32995
33141
|
EmulatorVersionBanner,
|
|
32996
33142
|
{
|
|
32997
33143
|
compatibility: bannerDismissed && versionCompatibility === "warning" ? "ok" : versionCompatibility,
|
|
@@ -33001,27 +33147,35 @@ var SpansListPage = () => {
|
|
|
33001
33147
|
} : void 0
|
|
33002
33148
|
}
|
|
33003
33149
|
),
|
|
33004
|
-
/* @__PURE__ */ (0,
|
|
33150
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
33005
33151
|
SpansList,
|
|
33006
33152
|
{
|
|
33007
33153
|
clearingSpans,
|
|
33154
|
+
consumerValues,
|
|
33008
33155
|
errorCount,
|
|
33009
33156
|
fetchError,
|
|
33010
33157
|
fetchingBackward,
|
|
33011
33158
|
fetchingForward,
|
|
33159
|
+
filteredErrorCount,
|
|
33160
|
+
filteredSpans,
|
|
33161
|
+
filteredWarningCount,
|
|
33162
|
+
filters,
|
|
33163
|
+
hasExternalProducer,
|
|
33012
33164
|
hasMoreBackward,
|
|
33013
33165
|
hasMoreForward,
|
|
33014
33166
|
licenseLimit,
|
|
33015
33167
|
onClearSpans: clearSpansSync,
|
|
33016
33168
|
onFetchForward: fetchForward,
|
|
33169
|
+
onFiltersChange: setFilters,
|
|
33017
33170
|
onOrderChange: setOrder,
|
|
33018
33171
|
onSearchChange: setSearch,
|
|
33019
33172
|
onSpanClick: navigateToSpan,
|
|
33020
33173
|
order: order2,
|
|
33174
|
+
producerValues,
|
|
33021
33175
|
search,
|
|
33022
33176
|
searching,
|
|
33023
33177
|
searchSupported,
|
|
33024
|
-
|
|
33178
|
+
statusValues,
|
|
33025
33179
|
systemLimit,
|
|
33026
33180
|
totalCount,
|
|
33027
33181
|
warningCount
|
|
@@ -33030,7 +33184,7 @@ var SpansListPage = () => {
|
|
|
33030
33184
|
]
|
|
33031
33185
|
}
|
|
33032
33186
|
),
|
|
33033
|
-
selectedTraceId !== void 0 && /* @__PURE__ */ (0,
|
|
33187
|
+
selectedTraceId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(TraceGraphPage, { onClose: () => {
|
|
33034
33188
|
setSelectedTraceId(void 0);
|
|
33035
33189
|
}, spanId: selectedSpanId, traceId: selectedTraceId })
|
|
33036
33190
|
] });
|