@perses-dev/tracing-gantt-chart-plugin 0.12.1 → 0.13.0-beta.1
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/785.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.b2e20301.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/260.9bec2000.js +39 -0
- package/__mf/js/async/{157.77f5f5a1.js.LICENSE.txt → 260.9bec2000.js.LICENSE.txt} +17 -1
- package/__mf/js/async/274.5c518455.js +2 -0
- package/__mf/js/async/356.fc2da489.js +1 -0
- 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/568.9ba2f5f6.js +24 -0
- package/__mf/js/async/{634.b68acb18.js.LICENSE.txt → 568.9ba2f5f6.js.LICENSE.txt} +0 -16
- 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/785.187cf92a.js +7 -0
- package/__mf/js/async/{12.c9423551.js.LICENSE.txt → 785.187cf92a.js.LICENSE.txt} +19 -1
- package/__mf/js/async/873.76af63d7.js +1 -0
- package/__mf/js/async/940.39b5cb1d.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.bcd10502.js +1 -0
- package/__mf/js/async/lib-router.69a7062a.js +2 -0
- package/__mf/js/main.6c69ae4f.js +7 -0
- package/lib/PanelActions.d.ts +1 -1
- package/lib/PanelActions.d.ts.map +1 -1
- package/lib/PanelActions.js.map +1 -1
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts +4 -3
- 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 +1 -1
- 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 +7 -1
- 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/TracingGanttChart/utils.js +1 -1
- package/lib/TracingGanttChart/utils.js.map +1 -1
- package/lib/TracingGanttChartPanel.d.ts +1 -1
- package/lib/TracingGanttChartPanel.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/lib/cjs/TracingGanttChart/utils.js +43 -2
- package/lib/test/convert/jaeger.d.ts +1 -1
- package/lib/test/convert/jaeger.d.ts.map +1 -1
- package/lib/test/convert/jaeger.js.map +1 -1
- package/mf-manifest.json +61 -50
- package/mf-stats.json +72 -50
- package/package.json +6 -5
- 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/{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
|
@@ -32,6 +32,9 @@ _export(exports, {
|
|
|
32
32
|
},
|
|
33
33
|
get TraceAttributes () {
|
|
34
34
|
return TraceAttributes;
|
|
35
|
+
},
|
|
36
|
+
get renderAttributeValue () {
|
|
37
|
+
return renderAttributeValue;
|
|
35
38
|
}
|
|
36
39
|
});
|
|
37
40
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -56,22 +59,59 @@ function TraceAttributes(props) {
|
|
|
56
59
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItem, {
|
|
57
60
|
name: "duration",
|
|
58
61
|
value: (0, _utils.formatDuration)(span.endTimeUnixMs - span.startTimeUnixMs)
|
|
62
|
+
}),
|
|
63
|
+
span.kind && /*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItem, {
|
|
64
|
+
name: "kind",
|
|
65
|
+
value: span.kind
|
|
66
|
+
}),
|
|
67
|
+
span.status.code && /*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItem, {
|
|
68
|
+
name: "status code",
|
|
69
|
+
value: span.status.code
|
|
70
|
+
}),
|
|
71
|
+
span.status.message && /*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItem, {
|
|
72
|
+
name: "status message",
|
|
73
|
+
value: span.status.message
|
|
59
74
|
})
|
|
60
75
|
]
|
|
61
76
|
}),
|
|
62
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {}),
|
|
63
77
|
span.attributes.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
64
78
|
children: [
|
|
79
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {}),
|
|
65
80
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeList, {
|
|
66
81
|
customLinks: customLinks,
|
|
67
82
|
attributes: span.attributes.toSorted((a, b)=>a.key.localeCompare(b.key))
|
|
68
|
-
})
|
|
69
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {})
|
|
83
|
+
})
|
|
70
84
|
]
|
|
71
85
|
}),
|
|
72
|
-
/*#__PURE__*/ (0, _jsxruntime.
|
|
73
|
-
|
|
74
|
-
|
|
86
|
+
span.resource.attributes.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
87
|
+
children: [
|
|
88
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {}),
|
|
89
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeList, {
|
|
90
|
+
customLinks: customLinks,
|
|
91
|
+
attributes: span.resource.attributes.toSorted((a, b)=>a.key.localeCompare(b.key))
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
}),
|
|
95
|
+
(span.scope.name || span.scope.version || span.scope.attributes && span.scope.attributes.length > 0) && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
96
|
+
children: [
|
|
97
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {}),
|
|
98
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.List, {
|
|
99
|
+
children: [
|
|
100
|
+
span.scope.name && /*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItem, {
|
|
101
|
+
name: "scope name",
|
|
102
|
+
value: span.scope.name
|
|
103
|
+
}),
|
|
104
|
+
span.scope.version && /*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItem, {
|
|
105
|
+
name: "scope version",
|
|
106
|
+
value: span.scope.version
|
|
107
|
+
}),
|
|
108
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(AttributeItems, {
|
|
109
|
+
customLinks: customLinks,
|
|
110
|
+
attributes: (span.scope.attributes ?? []).toSorted((a, b)=>a.key.localeCompare(b.key))
|
|
111
|
+
})
|
|
112
|
+
]
|
|
113
|
+
})
|
|
114
|
+
]
|
|
75
115
|
})
|
|
76
116
|
]
|
|
77
117
|
});
|
|
@@ -160,5 +200,5 @@ function renderAttributeValue(value) {
|
|
|
160
200
|
const values = value.arrayValue.values;
|
|
161
201
|
return values && values.length > 0 ? values.map(renderAttributeValue).join(', ') : '<empty array>';
|
|
162
202
|
}
|
|
163
|
-
return 'unknown';
|
|
203
|
+
return '<unknown type>';
|
|
164
204
|
}
|
|
@@ -24,34 +24,81 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _reactvirtuoso = require("react-virtuoso");
|
|
25
25
|
const _react = require("react");
|
|
26
26
|
const _material = require("@mui/material");
|
|
27
|
+
const _trace = require("../trace");
|
|
27
28
|
const _GanttTableProvider = require("./GanttTableProvider");
|
|
28
29
|
const _GanttTableRow = require("./GanttTableRow");
|
|
29
30
|
const _GanttTableHeader = require("./GanttTableHeader");
|
|
30
31
|
const _ResizableDivider = require("./ResizableDivider");
|
|
31
32
|
function GanttTable(props) {
|
|
32
|
-
const { options, customLinks, trace, viewport, selectedSpan, onSpanClick } = props;
|
|
33
|
-
const { collapsedSpans, setVisibleSpans } = (0, _GanttTableProvider.useGanttTableContext)();
|
|
33
|
+
const { options, customLinks, trace, viewport, selectedSpan, onSpanClick, matchingSpanIds, focusedSpanId } = props;
|
|
34
|
+
const { collapsedSpans, setCollapsedSpans, setVisibleSpans } = (0, _GanttTableProvider.useGanttTableContext)();
|
|
34
35
|
const [nameColumnWidth, setNameColumnWidth] = (0, _react.useState)(0.25);
|
|
35
36
|
const tableRef = (0, _react.useRef)(null);
|
|
37
|
+
const virtuosoRef = (0, _react.useRef)(null);
|
|
36
38
|
const theme = (0, _material.useTheme)();
|
|
39
|
+
// Recursively flatten the span tree to a list of rows, hiding collapsed child spans.
|
|
37
40
|
const rows = (0, _react.useMemo)(()=>{
|
|
38
41
|
const rows = [];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
(0, _trace.forEachSpan)(trace.rootSpans, (span)=>{
|
|
43
|
+
rows.push(span);
|
|
44
|
+
if (collapsedSpans.has(span.spanId)) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
42
48
|
return rows;
|
|
43
49
|
}, [
|
|
44
50
|
trace.rootSpans,
|
|
45
51
|
collapsedSpans
|
|
46
52
|
]);
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
const matchingSpanIdSet = (0, _react.useMemo)(()=>new Set(matchingSpanIds ?? []), [
|
|
54
|
+
matchingSpanIds
|
|
55
|
+
]);
|
|
56
|
+
// Auto-expand collapsed ancestors when focusing a search match
|
|
57
|
+
(0, _react.useEffect)(()=>{
|
|
58
|
+
if (!focusedSpanId) return;
|
|
59
|
+
const span = trace.spanById.get(focusedSpanId);
|
|
60
|
+
if (!span) return;
|
|
61
|
+
const ancestorIds = new Set();
|
|
62
|
+
let parent = span.parentSpan;
|
|
63
|
+
while(parent){
|
|
64
|
+
ancestorIds.add(parent.spanId);
|
|
65
|
+
parent = parent.parentSpan;
|
|
66
|
+
}
|
|
67
|
+
if (ancestorIds.size > 0) {
|
|
68
|
+
setCollapsedSpans((prev)=>{
|
|
69
|
+
const next = new Set(prev);
|
|
70
|
+
let changed = false;
|
|
71
|
+
for (const id of ancestorIds){
|
|
72
|
+
if (next.delete(id)) changed = true;
|
|
73
|
+
}
|
|
74
|
+
return changed ? next : prev;
|
|
75
|
+
});
|
|
53
76
|
}
|
|
54
|
-
|
|
77
|
+
}, [
|
|
78
|
+
focusedSpanId,
|
|
79
|
+
trace.spanById,
|
|
80
|
+
setCollapsedSpans
|
|
81
|
+
]);
|
|
82
|
+
// Scroll to focused span when using prev/next buttons in search bar.
|
|
83
|
+
(0, _react.useEffect)(()=>{
|
|
84
|
+
if (!focusedSpanId || !virtuosoRef.current) return;
|
|
85
|
+
const index = rows.findIndex((r)=>r.spanId === focusedSpanId);
|
|
86
|
+
if (index >= 0) {
|
|
87
|
+
virtuosoRef.current.scrollToIndex({
|
|
88
|
+
index,
|
|
89
|
+
align: 'center'
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}, [
|
|
93
|
+
focusedSpanId,
|
|
94
|
+
rows
|
|
95
|
+
]);
|
|
96
|
+
// Set the top most index in the Virtuoso table to the selected span
|
|
97
|
+
// Required e.g. when navigating from another page.
|
|
98
|
+
const initialTopMostSpanIndex = (0, _react.useMemo)(()=>{
|
|
99
|
+
if (!selectedSpan) return 0;
|
|
100
|
+
const index = rows.findIndex((r)=>r.spanId === selectedSpan.spanId);
|
|
101
|
+
return index >= 0 ? index : 0;
|
|
55
102
|
}, [
|
|
56
103
|
rows,
|
|
57
104
|
selectedSpan
|
|
@@ -85,14 +132,17 @@ function GanttTable(props) {
|
|
|
85
132
|
divider: divider
|
|
86
133
|
}),
|
|
87
134
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactvirtuoso.Virtuoso, {
|
|
135
|
+
ref: virtuosoRef,
|
|
88
136
|
data: rows,
|
|
89
|
-
initialTopMostItemIndex:
|
|
137
|
+
initialTopMostItemIndex: initialTopMostSpanIndex,
|
|
90
138
|
itemContent: (_, span)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_GanttTableRow.GanttTableRow, {
|
|
91
139
|
options: options,
|
|
92
140
|
customLinks: customLinks,
|
|
93
141
|
span: span,
|
|
94
142
|
viewport: viewport,
|
|
95
143
|
selected: span === selectedSpan,
|
|
144
|
+
matched: matchingSpanIdSet.has(span.spanId),
|
|
145
|
+
focused: span.spanId === focusedSpanId,
|
|
96
146
|
nameColumnWidth: nameColumnWidth,
|
|
97
147
|
divider: divider,
|
|
98
148
|
onClick: onSpanClick
|
|
@@ -102,14 +152,3 @@ function GanttTable(props) {
|
|
|
102
152
|
]
|
|
103
153
|
});
|
|
104
154
|
}
|
|
105
|
-
/**
|
|
106
|
-
* treeToRows recursively transforms the span tree to a list of rows and
|
|
107
|
-
* hides collapsed child spans.
|
|
108
|
-
*/ function treeToRows(rows, span, collapsedSpans) {
|
|
109
|
-
rows.push(span);
|
|
110
|
-
if (!collapsedSpans.includes(span.spanId)) {
|
|
111
|
-
for (const child of span.childSpans){
|
|
112
|
-
treeToRows(rows, child, collapsedSpans);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
@@ -36,7 +36,7 @@ const _react = require("react");
|
|
|
36
36
|
const GanttTableContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
37
37
|
function GanttTableProvider(props) {
|
|
38
38
|
const { children } = props;
|
|
39
|
-
const [collapsedSpans, setCollapsedSpans] = (0, _react.useState)(
|
|
39
|
+
const [collapsedSpans, setCollapsedSpans] = (0, _react.useState)(new Set());
|
|
40
40
|
const [visibleSpans, setVisibleSpans] = (0, _react.useState)([]);
|
|
41
41
|
const [hoveredParent, setHoveredParent] = (0, _react.useState)(undefined);
|
|
42
42
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(GanttTableContext.Provider, {
|
|
@@ -27,16 +27,28 @@ const _utils = require("../utils");
|
|
|
27
27
|
const _SpanName = require("./SpanName");
|
|
28
28
|
const _SpanDuration = require("./SpanDuration");
|
|
29
29
|
const GanttTableRow = /*#__PURE__*/ (0, _react.memo)(function GanttTableRow(props) {
|
|
30
|
-
const { options, customLinks, span, viewport, selected, nameColumnWidth, divider, onClick } = props;
|
|
30
|
+
const { options, customLinks, span, viewport, selected, matched, focused, nameColumnWidth, divider, onClick } = props;
|
|
31
31
|
const theme = (0, _material.useTheme)();
|
|
32
32
|
const handleOnClick = ()=>{
|
|
33
33
|
// ignore event if triggered by selecting text
|
|
34
34
|
if (document.getSelection()?.type === 'Range') return;
|
|
35
35
|
onClick(span);
|
|
36
36
|
};
|
|
37
|
+
let backgroundColor;
|
|
38
|
+
if (selected) {
|
|
39
|
+
backgroundColor = theme.palette.action.focus;
|
|
40
|
+
} else if (focused) {
|
|
41
|
+
backgroundColor = theme.palette.action.selected;
|
|
42
|
+
} else if (matched) {
|
|
43
|
+
backgroundColor = theme.palette.action.hover;
|
|
44
|
+
}
|
|
37
45
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(RowContainer, {
|
|
38
46
|
sx: {
|
|
39
|
-
backgroundColor
|
|
47
|
+
backgroundColor,
|
|
48
|
+
// overwrite hover if background color is set (selected, focused or matched)
|
|
49
|
+
'&:hover': backgroundColor ? {
|
|
50
|
+
backgroundColor
|
|
51
|
+
} : undefined
|
|
40
52
|
},
|
|
41
53
|
direction: "row",
|
|
42
54
|
onClick: handleOnClick,
|
|
@@ -35,8 +35,11 @@ function ResizableDivider(props) {
|
|
|
35
35
|
// need stable reference for window.removeEventListener() in useEffect() below
|
|
36
36
|
const handleMouseMove = (0, _pluginsystem.useEvent)((e)=>{
|
|
37
37
|
if (!parentRef.current) return;
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const parentRect = parentRef.current.getBoundingClientRect();
|
|
39
|
+
// The parent can be a flex row, for example: [leftPercent] [gap] [divider] [gap] [1-leftPercent].
|
|
40
|
+
// Without considering spacing, leftPercent would be wrong because it ignores the flex gap between the divider and the element.
|
|
41
|
+
const offsetX = e.clientX - parentRect.left + spacing;
|
|
42
|
+
const leftPercent = offsetX / parentRect.width;
|
|
40
43
|
if (0.05 <= leftPercent && leftPercent <= 0.95) {
|
|
41
44
|
onMove(leftPercent);
|
|
42
45
|
}
|
|
@@ -78,6 +81,7 @@ function ResizableDivider(props) {
|
|
|
78
81
|
const ResizableDividerBox = (0, _material.styled)(_material.Box)(({ theme })=>({
|
|
79
82
|
position: 'relative',
|
|
80
83
|
width: '1px',
|
|
84
|
+
minWidth: '1px',
|
|
81
85
|
height: '100%',
|
|
82
86
|
backgroundColor: theme.palette.divider,
|
|
83
87
|
cursor: 'col-resize',
|
|
@@ -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
|
+
}
|