@perses-dev/tracing-gantt-chart-plugin 0.12.1 → 0.13.0-beta.0
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/__mf/css/async/558.85c2cbf6.css +1 -0
- package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
- package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
- package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
- package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
- package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
- package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
- package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
- package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
- package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
- package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
- package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
- package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
- package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
- package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
- package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
- package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
- package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
- package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
- package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
- package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
- package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
- package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
- package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
- package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
- package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
- package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
- package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
- package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
- package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
- package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
- package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
- package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
- package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
- package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
- package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
- package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
- package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
- package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
- package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
- package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
- package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
- package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
- package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
- package/__mf/js/TracingGanttChart.a69ad65c.js +7 -0
- package/__mf/js/async/121.5475779f.js +2 -0
- package/__mf/js/async/177.50257b88.js +1 -0
- package/__mf/js/async/192.a0a2e63b.js +1 -0
- package/__mf/js/async/2.d2c2e5a6.js +1 -0
- package/__mf/js/async/207.dcd0ae82.js +110 -0
- package/__mf/js/async/{666.4cf9c453.js.LICENSE.txt → 207.dcd0ae82.js.LICENSE.txt} +1 -1
- package/__mf/js/async/235.b42801b1.js +1 -0
- package/__mf/js/async/274.5c518455.js +2 -0
- package/__mf/js/async/356.fc2da489.js +1 -0
- package/__mf/js/async/366.0baba713.js +24 -0
- package/__mf/js/async/{634.b68acb18.js.LICENSE.txt → 366.0baba713.js.LICENSE.txt} +1 -1
- package/__mf/js/async/392.6c066266.js +2 -0
- package/__mf/js/async/43.e395f769.js +2 -0
- package/__mf/js/async/470.4e137e17.js +2 -0
- package/__mf/js/async/472.8aa138b3.js +1 -0
- package/__mf/js/async/558.c4505dfb.js +7 -0
- package/__mf/js/async/{12.c9423551.js.LICENSE.txt → 558.c4505dfb.js.LICENSE.txt} +19 -1
- package/__mf/js/async/581.530a1cbc.js +1 -0
- package/__mf/js/async/587.dbc05176.js +1 -0
- package/__mf/js/async/588.f5afdb25.js +1 -0
- package/__mf/js/async/616.268fac9b.js +1 -0
- package/__mf/js/async/71.79ef5248.js +1 -0
- package/__mf/js/async/729.b8d22843.js +39 -0
- package/__mf/js/async/873.76af63d7.js +1 -0
- package/__mf/js/async/895.7c3edbda.js +1 -0
- package/__mf/js/async/941.70c6480d.js +2 -0
- package/__mf/js/async/968.68803274.js +1 -0
- package/__mf/js/async/978.ca0b1b55.js +1 -0
- package/__mf/js/async/__federation_expose_TracingGanttChart.2f3100da.js +1 -0
- package/__mf/js/async/lib-router.69a7062a.js +2 -0
- package/__mf/js/main.62d36e4e.js +7 -0
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts +1 -0
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts.map +1 -1
- package/lib/TracingGanttChart/DetailPane/Attributes.js +45 -8
- package/lib/TracingGanttChart/DetailPane/Attributes.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts +2 -0
- package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTable.js +64 -25
- package/lib/TracingGanttChart/GanttTable/GanttTable.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts +2 -2
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts +5 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.js +14 -2
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js +6 -2
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanIndents.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js +10 -10
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/draw.d.ts.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/draw.js +2 -6
- package/lib/TracingGanttChart/MiniGanttChart/draw.js.map +1 -1
- package/lib/TracingGanttChart/Search.d.ts +15 -0
- package/lib/TracingGanttChart/Search.d.ts.map +1 -0
- package/lib/TracingGanttChart/Search.js +133 -0
- package/lib/TracingGanttChart/Search.js.map +1 -0
- package/lib/TracingGanttChart/TraceHeaderBar.d.ts +9 -0
- package/lib/TracingGanttChart/TraceHeaderBar.d.ts.map +1 -0
- package/lib/TracingGanttChart/TraceHeaderBar.js +126 -0
- package/lib/TracingGanttChart/TraceHeaderBar.js.map +1 -0
- package/lib/TracingGanttChart/TracingGanttChart.d.ts.map +1 -1
- package/lib/TracingGanttChart/TracingGanttChart.js +14 -8
- package/lib/TracingGanttChart/TracingGanttChart.js.map +1 -1
- package/lib/TracingGanttChart/trace.d.ts +5 -0
- package/lib/TracingGanttChart/trace.d.ts.map +1 -1
- package/lib/TracingGanttChart/trace.js +10 -0
- package/lib/TracingGanttChart/trace.js.map +1 -1
- package/lib/cjs/TracingGanttChart/DetailPane/Attributes.js +47 -7
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTable.js +63 -24
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableProvider.js +1 -1
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableRow.js +14 -2
- package/lib/cjs/TracingGanttChart/GanttTable/ResizableDivider.js +6 -2
- package/lib/cjs/TracingGanttChart/GanttTable/SpanIndents.js +10 -10
- package/lib/cjs/TracingGanttChart/MiniGanttChart/draw.js +2 -6
- package/lib/cjs/TracingGanttChart/Search.js +154 -0
- package/lib/cjs/TracingGanttChart/TraceHeaderBar.js +139 -0
- package/lib/cjs/TracingGanttChart/TracingGanttChart.js +13 -7
- package/lib/cjs/TracingGanttChart/trace.js +18 -3
- package/mf-manifest.json +61 -50
- package/mf-stats.json +72 -50
- package/package.json +5 -4
- package/__mf/css/async/442.d3010b86.css +0 -1
- package/__mf/css/async/61.d3010b86.css +0 -1
- package/__mf/css/async/823.d3010b86.css +0 -1
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/TracingGanttChart.f5573ac3.js +0 -6
- package/__mf/js/async/12.c9423551.js +0 -7
- package/__mf/js/async/121.cb300887.js +0 -2
- package/__mf/js/async/157.77f5f5a1.js +0 -39
- package/__mf/js/async/177.cf9df204.js +0 -1
- package/__mf/js/async/192.f723a636.js +0 -1
- package/__mf/js/async/2.e3ce4ee4.js +0 -1
- package/__mf/js/async/235.806ca841.js +0 -1
- package/__mf/js/async/274.457dda65.js +0 -2
- package/__mf/js/async/356.7ea3eee9.js +0 -1
- package/__mf/js/async/392.c563796d.js +0 -2
- package/__mf/js/async/43.55c495e3.js +0 -2
- package/__mf/js/async/439.63c7b180.js +0 -1
- package/__mf/js/async/470.f5dfd429.js +0 -2
- package/__mf/js/async/587.3a4d8eed.js +0 -1
- package/__mf/js/async/588.a1fce2da.js +0 -1
- package/__mf/js/async/616.25399954.js +0 -1
- package/__mf/js/async/634.b68acb18.js +0 -24
- package/__mf/js/async/666.4cf9c453.js +0 -110
- package/__mf/js/async/71.ec1919d7.js +0 -1
- package/__mf/js/async/751.b7c40fc8.js +0 -1
- package/__mf/js/async/873.0f298220.js +0 -1
- package/__mf/js/async/895.eb528fc2.js +0 -1
- package/__mf/js/async/941.065a3eec.js +0 -2
- package/__mf/js/async/968.5f7ccf5e.js +0 -1
- package/__mf/js/async/978.151ab551.js +0 -1
- package/__mf/js/async/__federation_expose_TracingGanttChart.3ea317ee.js +0 -1
- package/__mf/js/async/lib-router.aed93ee9.js +0 -2
- package/__mf/js/main.237de7d0.js +0 -6
- package/lib/TracingGanttChart/TraceDetails.d.ts +0 -7
- package/lib/TracingGanttChart/TraceDetails.d.ts.map +0 -1
- package/lib/TracingGanttChart/TraceDetails.js +0 -90
- package/lib/TracingGanttChart/TraceDetails.js.map +0 -1
- package/lib/cjs/TracingGanttChart/TraceDetails.js +0 -98
- /package/__mf/js/async/{121.cb300887.js.LICENSE.txt → 121.5475779f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{274.457dda65.js.LICENSE.txt → 274.5c518455.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.c563796d.js.LICENSE.txt → 392.6c066266.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{43.55c495e3.js.LICENSE.txt → 43.e395f769.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{470.f5dfd429.js.LICENSE.txt → 470.4e137e17.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{157.77f5f5a1.js.LICENSE.txt → 729.b8d22843.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.065a3eec.js.LICENSE.txt → 941.70c6480d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.aed93ee9.js.LICENSE.txt → lib-router.69a7062a.js.LICENSE.txt} +0 -0
|
@@ -39,17 +39,17 @@ function SpanIndents(props) {
|
|
|
39
39
|
const theme = (0, _material.useTheme)();
|
|
40
40
|
const handleToggleClick = (0, _react.useCallback)((e)=>{
|
|
41
41
|
e.stopPropagation();
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
span.spanId
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
setCollapsedSpans((prev)=>{
|
|
43
|
+
const next = new Set(prev);
|
|
44
|
+
if (next.has(span.spanId)) {
|
|
45
|
+
next.delete(span.spanId);
|
|
46
|
+
} else {
|
|
47
|
+
next.add(span.spanId);
|
|
48
|
+
}
|
|
49
|
+
return next;
|
|
50
|
+
});
|
|
50
51
|
}, [
|
|
51
52
|
span,
|
|
52
|
-
collapsedSpans,
|
|
53
53
|
setCollapsedSpans
|
|
54
54
|
]);
|
|
55
55
|
const handleIconMouseEnter = (0, _react.useCallback)(()=>{
|
|
@@ -75,7 +75,7 @@ function SpanIndents(props) {
|
|
|
75
75
|
},
|
|
76
76
|
onMouseEnter: ()=>setHoveredParent(span.parentSpanId ?? ''),
|
|
77
77
|
onMouseLeave: ()=>setHoveredParent(undefined),
|
|
78
|
-
children: i === spans.length - 1 && span.childSpans.length > 0 && (collapsedSpans.
|
|
78
|
+
children: i === spans.length - 1 && span.childSpans.length > 0 && (collapsedSpans.has(span.spanId) ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronRight.default, {
|
|
79
79
|
titleAccess: "expand",
|
|
80
80
|
onClick: handleToggleClick,
|
|
81
81
|
onMouseEnter: handleIconMouseEnter
|
|
@@ -20,6 +20,7 @@ Object.defineProperty(exports, "drawSpans", {
|
|
|
20
20
|
return drawSpans;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
+
const _trace = require("../trace");
|
|
23
24
|
const _utils = require("../utils");
|
|
24
25
|
const MIN_BAR_HEIGHT = 1;
|
|
25
26
|
const MAX_BAR_HEIGHT = 7;
|
|
@@ -39,11 +40,6 @@ function drawSpans(ctx, width, height, trace, spanColorGenerator) {
|
|
|
39
40
|
ctx.rect(Math.round(relativeStart * width), Math.round(y), Math.max(_utils.minSpanWidthPx, Math.round(relativeDuration * width)), barHeight);
|
|
40
41
|
ctx.fill();
|
|
41
42
|
y += yChange;
|
|
42
|
-
for (const childSpan of span.childSpans){
|
|
43
|
-
drawSpan(childSpan);
|
|
44
|
-
}
|
|
45
43
|
};
|
|
46
|
-
|
|
47
|
-
drawSpan(rootSpan);
|
|
48
|
-
}
|
|
44
|
+
(0, _trace.forEachSpan)(trace.rootSpans, drawSpan);
|
|
49
45
|
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get SearchBar () {
|
|
25
|
+
return SearchBar;
|
|
26
|
+
},
|
|
27
|
+
get useSpanSearch () {
|
|
28
|
+
return useSpanSearch;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
32
|
+
const _material = require("@mui/material");
|
|
33
|
+
const _ChevronUp = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronUp"));
|
|
34
|
+
const _ChevronDown = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronDown"));
|
|
35
|
+
const _Close = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Close"));
|
|
36
|
+
const _react = require("react");
|
|
37
|
+
const _Attributes = require("./DetailPane/Attributes");
|
|
38
|
+
const _trace = require("./trace");
|
|
39
|
+
function _interop_require_default(obj) {
|
|
40
|
+
return obj && obj.__esModule ? obj : {
|
|
41
|
+
default: obj
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function SearchBar(props) {
|
|
45
|
+
const { search } = props;
|
|
46
|
+
const { searchQuery, setSearchQuery, matchingSpanIds, focusedMatchIndex, setFocusedMatchIndex } = search;
|
|
47
|
+
const hasQuery = searchQuery.length > 0;
|
|
48
|
+
const matchCount = matchingSpanIds.length;
|
|
49
|
+
const hasMatches = matchCount > 0;
|
|
50
|
+
function handlePrev() {
|
|
51
|
+
if (!hasMatches) return;
|
|
52
|
+
setFocusedMatchIndex((focusedMatchIndex - 1 + matchCount) % matchCount);
|
|
53
|
+
}
|
|
54
|
+
function handleNext() {
|
|
55
|
+
if (!hasMatches) return;
|
|
56
|
+
setFocusedMatchIndex((focusedMatchIndex + 1) % matchCount);
|
|
57
|
+
}
|
|
58
|
+
function handleKeyDown(e) {
|
|
59
|
+
if (e.key === 'Enter') {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
if (e.shiftKey) {
|
|
62
|
+
handlePrev();
|
|
63
|
+
} else {
|
|
64
|
+
handleNext();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
69
|
+
direction: "row",
|
|
70
|
+
sx: {
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
gap: 0.5,
|
|
73
|
+
minWidth: 300
|
|
74
|
+
},
|
|
75
|
+
children: [
|
|
76
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
77
|
+
size: "small",
|
|
78
|
+
placeholder: "Search spans...",
|
|
79
|
+
value: searchQuery,
|
|
80
|
+
onChange: (e)=>setSearchQuery(e.target.value),
|
|
81
|
+
onKeyDown: handleKeyDown,
|
|
82
|
+
slotProps: {
|
|
83
|
+
input: {
|
|
84
|
+
endAdornment: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputAdornment, {
|
|
85
|
+
position: "end",
|
|
86
|
+
sx: {
|
|
87
|
+
visibility: hasQuery ? 'visible' : 'hidden',
|
|
88
|
+
whiteSpace: 'nowrap'
|
|
89
|
+
},
|
|
90
|
+
children: hasMatches ? `${focusedMatchIndex + 1}/${matchCount}` : '0/0'
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
sx: {
|
|
95
|
+
minWidth: 200
|
|
96
|
+
}
|
|
97
|
+
}),
|
|
98
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
99
|
+
size: "small",
|
|
100
|
+
disabled: !hasMatches,
|
|
101
|
+
"aria-label": "Previous match",
|
|
102
|
+
onClick: handlePrev,
|
|
103
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronUp.default, {})
|
|
104
|
+
}),
|
|
105
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
106
|
+
size: "small",
|
|
107
|
+
disabled: !hasMatches,
|
|
108
|
+
"aria-label": "Next match",
|
|
109
|
+
onClick: handleNext,
|
|
110
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronDown.default, {})
|
|
111
|
+
}),
|
|
112
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
113
|
+
size: "small",
|
|
114
|
+
disabled: !hasQuery,
|
|
115
|
+
"aria-label": "Clear search",
|
|
116
|
+
onClick: ()=>setSearchQuery(''),
|
|
117
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Close.default, {})
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function spanMatchesQuery(span, query) {
|
|
123
|
+
const attrMatches = (attr)=>attr.key.toLowerCase().includes(query) || (0, _Attributes.renderAttributeValue)(attr.value).toLowerCase().includes(query);
|
|
124
|
+
return span.resource.serviceName?.toLowerCase().includes(query) || span.name.toLowerCase().includes(query) || span.spanId.toLowerCase().includes(query) || span.attributes.some(attrMatches) || span.resource.attributes.some(attrMatches);
|
|
125
|
+
}
|
|
126
|
+
function useSpanSearch(trace) {
|
|
127
|
+
const [searchQuery, setSearchQueryRaw] = (0, _react.useState)('');
|
|
128
|
+
const [focusedMatchIndex, setFocusedMatchIndex] = (0, _react.useState)(0);
|
|
129
|
+
const matchingSpanIds = (0, _react.useMemo)(()=>{
|
|
130
|
+
if (searchQuery.length === 0) return [];
|
|
131
|
+
const query = searchQuery.toLowerCase();
|
|
132
|
+
const matches = [];
|
|
133
|
+
(0, _trace.forEachSpan)(trace.rootSpans, (span)=>{
|
|
134
|
+
if (spanMatchesQuery(span, query)) {
|
|
135
|
+
matches.push(span.spanId);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
return matches;
|
|
139
|
+
}, [
|
|
140
|
+
searchQuery,
|
|
141
|
+
trace.rootSpans
|
|
142
|
+
]);
|
|
143
|
+
const setSearchQuery = (0, _react.useCallback)((query)=>{
|
|
144
|
+
setSearchQueryRaw(query);
|
|
145
|
+
setFocusedMatchIndex(0);
|
|
146
|
+
}, []);
|
|
147
|
+
return {
|
|
148
|
+
searchQuery,
|
|
149
|
+
setSearchQuery,
|
|
150
|
+
matchingSpanIds,
|
|
151
|
+
focusedMatchIndex,
|
|
152
|
+
setFocusedMatchIndex
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "TraceHeaderBar", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return TraceHeaderBar;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _Magnify = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Magnify"));
|
|
26
|
+
const _react = require("react");
|
|
27
|
+
const _components = require("@perses-dev/components");
|
|
28
|
+
const _utils = require("./utils");
|
|
29
|
+
const _Search = require("./Search");
|
|
30
|
+
function _interop_require_default(obj) {
|
|
31
|
+
return obj && obj.__esModule ? obj : {
|
|
32
|
+
default: obj
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const DATE_FORMAT_OPTIONS = {
|
|
36
|
+
year: 'numeric',
|
|
37
|
+
month: 'long',
|
|
38
|
+
day: 'numeric',
|
|
39
|
+
hour: 'numeric',
|
|
40
|
+
minute: 'numeric',
|
|
41
|
+
second: 'numeric',
|
|
42
|
+
fractionalSecondDigits: 3,
|
|
43
|
+
timeZoneName: 'short'
|
|
44
|
+
};
|
|
45
|
+
function TraceHeaderBar(props) {
|
|
46
|
+
const { trace, search } = props;
|
|
47
|
+
const { dateFormatOptionsWithUserTimeZone } = (0, _components.useTimeZone)();
|
|
48
|
+
const dateFormatter = (0, _react.useMemo)(()=>{
|
|
49
|
+
const dateFormatOptions = dateFormatOptionsWithUserTimeZone(DATE_FORMAT_OPTIONS);
|
|
50
|
+
return new Intl.DateTimeFormat(undefined, dateFormatOptions);
|
|
51
|
+
}, [
|
|
52
|
+
dateFormatOptionsWithUserTimeZone
|
|
53
|
+
]);
|
|
54
|
+
const [showSearch, setShowSearch] = (0, _react.useState)(false);
|
|
55
|
+
const rootSpan = trace.rootSpans[0];
|
|
56
|
+
if (!rootSpan) {
|
|
57
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
58
|
+
children: "Trace contains no spans."
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
62
|
+
direction: "column",
|
|
63
|
+
sx: {
|
|
64
|
+
gap: 1
|
|
65
|
+
},
|
|
66
|
+
children: [
|
|
67
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
68
|
+
direction: "row",
|
|
69
|
+
sx: {
|
|
70
|
+
justifyContent: 'space-between'
|
|
71
|
+
},
|
|
72
|
+
children: [
|
|
73
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
74
|
+
direction: "row",
|
|
75
|
+
sx: {
|
|
76
|
+
gap: 1,
|
|
77
|
+
alignItems: 'center'
|
|
78
|
+
},
|
|
79
|
+
children: [
|
|
80
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
81
|
+
variant: "h3",
|
|
82
|
+
children: [
|
|
83
|
+
rootSpan.resource.serviceName,
|
|
84
|
+
": ",
|
|
85
|
+
rootSpan.name,
|
|
86
|
+
" (",
|
|
87
|
+
(0, _utils.formatDuration)(trace.endTimeUnixMs - trace.startTimeUnixMs),
|
|
88
|
+
")"
|
|
89
|
+
]
|
|
90
|
+
}),
|
|
91
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
92
|
+
size: "small",
|
|
93
|
+
onClick: ()=>setShowSearch((prev)=>!prev),
|
|
94
|
+
"aria-label": "Toggle search",
|
|
95
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Magnify.default, {
|
|
96
|
+
fontSize: "small"
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
}),
|
|
101
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
102
|
+
variant: "h4",
|
|
103
|
+
children: [
|
|
104
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
105
|
+
component: "span",
|
|
106
|
+
sx: {
|
|
107
|
+
px: 1
|
|
108
|
+
},
|
|
109
|
+
children: [
|
|
110
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
|
|
111
|
+
children: "Start:"
|
|
112
|
+
}),
|
|
113
|
+
" ",
|
|
114
|
+
dateFormatter.format(trace.startTimeUnixMs)
|
|
115
|
+
]
|
|
116
|
+
}),
|
|
117
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
118
|
+
component: "span",
|
|
119
|
+
sx: {
|
|
120
|
+
px: 1
|
|
121
|
+
},
|
|
122
|
+
children: [
|
|
123
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
|
|
124
|
+
children: "Trace ID:"
|
|
125
|
+
}),
|
|
126
|
+
" ",
|
|
127
|
+
rootSpan.traceId
|
|
128
|
+
]
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
})
|
|
132
|
+
]
|
|
133
|
+
}),
|
|
134
|
+
showSearch && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Search.SearchBar, {
|
|
135
|
+
search: search
|
|
136
|
+
})
|
|
137
|
+
]
|
|
138
|
+
});
|
|
139
|
+
}
|
|
@@ -29,10 +29,10 @@ const _GanttTable = require("./GanttTable/GanttTable");
|
|
|
29
29
|
const _GanttTableProvider = require("./GanttTable/GanttTableProvider");
|
|
30
30
|
const _ResizableDivider = require("./GanttTable/ResizableDivider");
|
|
31
31
|
const _trace = require("./trace");
|
|
32
|
-
const
|
|
32
|
+
const _TraceHeaderBar = require("./TraceHeaderBar");
|
|
33
|
+
const _Search = require("./Search");
|
|
33
34
|
function TracingGanttChart(props) {
|
|
34
35
|
const { options, customLinks, trace: otlpTrace } = props;
|
|
35
|
-
const theme = (0, _material.useTheme)();
|
|
36
36
|
const trace = (0, _react.useMemo)(()=>{
|
|
37
37
|
try {
|
|
38
38
|
return (0, _trace.getTraceModel)(otlpTrace);
|
|
@@ -47,11 +47,13 @@ function TracingGanttChart(props) {
|
|
|
47
47
|
endTimeUnixMs: trace.endTimeUnixMs
|
|
48
48
|
});
|
|
49
49
|
const [selectedSpan, setSelectedSpan] = (0, _react.useState)(()=>options.selectedSpanId ? trace.spanById.get(options.selectedSpanId) : undefined);
|
|
50
|
+
const search = (0, _Search.useSpanSearch)(trace);
|
|
50
51
|
const ganttChart = (0, _react.useRef)(null);
|
|
51
52
|
// tableWidth only comes to effect if the detail pane is visible.
|
|
52
53
|
// setTableWidth() is only called by <ResizableDivider />
|
|
53
54
|
const [tableWidth, setTableWidth] = (0, _react.useState)(0.82);
|
|
54
55
|
const gap = 2;
|
|
56
|
+
const spacing = ganttChart.current ? parseFloat(getComputedStyle(ganttChart.current).columnGap) || 0 : 0;
|
|
55
57
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
56
58
|
ref: ganttChart,
|
|
57
59
|
direction: "row",
|
|
@@ -67,8 +69,9 @@ function TracingGanttChart(props) {
|
|
|
67
69
|
gap
|
|
68
70
|
},
|
|
69
71
|
children: [
|
|
70
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
71
|
-
trace: trace
|
|
72
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_TraceHeaderBar.TraceHeaderBar, {
|
|
73
|
+
trace: trace,
|
|
74
|
+
search: search
|
|
72
75
|
}),
|
|
73
76
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_MiniGanttChart.MiniGanttChart, {
|
|
74
77
|
options: options,
|
|
@@ -83,7 +86,9 @@ function TracingGanttChart(props) {
|
|
|
83
86
|
trace: trace,
|
|
84
87
|
viewport: viewport,
|
|
85
88
|
selectedSpan: selectedSpan,
|
|
86
|
-
onSpanClick: setSelectedSpan
|
|
89
|
+
onSpanClick: setSelectedSpan,
|
|
90
|
+
matchingSpanIds: search.matchingSpanIds,
|
|
91
|
+
focusedSpanId: search.matchingSpanIds[search.focusedMatchIndex]
|
|
87
92
|
})
|
|
88
93
|
})
|
|
89
94
|
]
|
|
@@ -92,12 +97,13 @@ function TracingGanttChart(props) {
|
|
|
92
97
|
children: [
|
|
93
98
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ResizableDivider.ResizableDivider, {
|
|
94
99
|
parentRef: ganttChart,
|
|
95
|
-
spacing:
|
|
100
|
+
spacing: spacing,
|
|
96
101
|
onMove: setTableWidth
|
|
97
102
|
}),
|
|
98
103
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
99
104
|
style: {
|
|
100
|
-
width: `${(1 - tableWidth) * 100}
|
|
105
|
+
width: `${(1 - tableWidth) * 100}%`,
|
|
106
|
+
minWidth: `${(1 - tableWidth) * 100}%`
|
|
101
107
|
},
|
|
102
108
|
sx: {
|
|
103
109
|
overflow: 'auto'
|
|
@@ -14,9 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get forEachSpan () {
|
|
25
|
+
return forEachSpan;
|
|
26
|
+
},
|
|
27
|
+
get getTraceModel () {
|
|
20
28
|
return getTraceModel;
|
|
21
29
|
}
|
|
22
30
|
});
|
|
@@ -72,6 +80,13 @@ function getTraceModel(trace) {
|
|
|
72
80
|
endTimeUnixMs
|
|
73
81
|
};
|
|
74
82
|
}
|
|
83
|
+
function forEachSpan(spans, fn) {
|
|
84
|
+
for (const span of spans){
|
|
85
|
+
if (fn(span) !== false) {
|
|
86
|
+
forEachSpan(span.childSpans, fn);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
75
90
|
function parseResource(resource) {
|
|
76
91
|
let serviceName = 'unknown';
|
|
77
92
|
for (const attr of resource?.attributes ?? []){
|