@perses-dev/trace-table-plugin 0.10.0-beta.0 → 0.10.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/js/{TraceTable.c6c7597d.js → TraceTable.f0d0cb51.js} +5 -5
- package/__mf/js/async/196.5c494bea.js +7 -0
- package/__mf/js/async/392.8f099d88.js +2 -0
- package/__mf/js/async/{289.c722d41d.js → 587.6db21278.js} +10 -10
- package/__mf/js/async/648.26a0d707.js +22 -0
- package/__mf/js/async/734.aabfe3a4.js +2 -0
- package/__mf/js/async/824.2c0b9a86.js +2 -0
- package/__mf/js/async/{587.6b047404.js → 825.70097a96.js} +1 -1
- package/__mf/js/async/{670.41f6b1c0.js → 935.4f599ceb.js} +10 -10
- package/__mf/js/async/__federation_expose_TraceTable.767e72d3.js +1 -0
- package/__mf/js/async/lib-router.a75e6c79.js +2 -0
- package/__mf/js/async/{lib-router.d2b2e61c.js.LICENSE.txt → lib-router.a75e6c79.js.LICENSE.txt} +3 -3
- package/__mf/js/{main.7ceb822f.js → main.a6429794.js} +5 -5
- package/lib/DataTable.d.ts.map +1 -1
- package/lib/DataTable.js +120 -48
- package/lib/DataTable.js.map +1 -1
- package/lib/TraceTable.d.ts.map +1 -1
- package/lib/TraceTable.js +8 -1
- package/lib/TraceTable.js.map +1 -1
- package/lib/TraceTableItemSelectionActionsEditor.d.ts +7 -0
- package/lib/TraceTableItemSelectionActionsEditor.d.ts.map +1 -0
- package/lib/TraceTableItemSelectionActionsEditor.js +37 -0
- package/lib/TraceTableItemSelectionActionsEditor.js.map +1 -0
- package/lib/TraceTablePanel.js +1 -1
- package/lib/TraceTablePanel.js.map +1 -1
- package/lib/bootstrap.js +1 -1
- package/lib/bootstrap.js.map +1 -1
- package/lib/cjs/DataTable.js +119 -47
- package/lib/cjs/TraceTable.js +8 -1
- package/lib/cjs/TraceTableItemSelectionActionsEditor.js +45 -0
- package/lib/cjs/TraceTablePanel.js +1 -1
- package/lib/cjs/bootstrap.js +1 -1
- package/lib/cjs/env.d.js +1 -1
- package/lib/cjs/getPluginModule.js +12 -0
- package/lib/cjs/index-federation.js +1 -1
- package/lib/cjs/index.js +13 -0
- package/lib/cjs/setup-tests.js +1 -1
- package/lib/cjs/test/mock-trace-data.js +1 -1
- package/lib/cjs/trace-table-model.js +1 -4
- package/lib/cjs/utils/palette.js +1 -1
- package/lib/cjs/utils/utils.js +1 -1
- package/lib/env.d.js +1 -1
- package/lib/env.d.js.map +1 -1
- package/lib/getPluginModule.d.ts.map +1 -1
- package/lib/getPluginModule.js +12 -0
- package/lib/getPluginModule.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index-federation.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +13 -0
- package/lib/index.js.map +1 -1
- package/lib/setup-tests.js +1 -1
- package/lib/setup-tests.js.map +1 -1
- package/lib/test/mock-trace-data.js +1 -1
- package/lib/test/mock-trace-data.js.map +1 -1
- package/lib/trace-table-model.d.ts +3 -0
- package/lib/trace-table-model.d.ts.map +1 -1
- package/lib/trace-table-model.js +1 -4
- package/lib/trace-table-model.js.map +1 -1
- package/lib/utils/palette.js +1 -1
- package/lib/utils/palette.js.map +1 -1
- package/lib/utils/utils.js +1 -1
- package/lib/utils/utils.js.map +1 -1
- package/mf-manifest.json +19 -19
- package/mf-stats.json +21 -21
- package/package.json +4 -4
- package/__mf/js/async/252.97530343.js +0 -22
- package/__mf/js/async/352.82a86d42.js +0 -7
- package/__mf/js/async/392.ba8c2c55.js +0 -2
- package/__mf/js/async/549.fb982abf.js +0 -2
- package/__mf/js/async/894.f6f489dd.js +0 -2
- package/__mf/js/async/__federation_expose_TraceTable.a6b14cb7.js +0 -1
- package/__mf/js/async/lib-router.d2b2e61c.js +0 -2
- /package/__mf/js/async/{352.82a86d42.js.LICENSE.txt → 196.5c494bea.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.ba8c2c55.js.LICENSE.txt → 392.8f099d88.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{289.c722d41d.js.LICENSE.txt → 587.6db21278.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{252.97530343.js.LICENSE.txt → 648.26a0d707.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{549.fb982abf.js.LICENSE.txt → 734.aabfe3a4.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{894.f6f489dd.js.LICENSE.txt → 824.2c0b9a86.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{670.41f6b1c0.js.LICENSE.txt → 935.4f599ceb.js.LICENSE.txt} +0 -0
package/lib/DataTable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright The Perses Authors
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
5
5
|
// You may obtain a copy of the License at
|
|
@@ -14,8 +14,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
14
14
|
import { Avatar, Box, Chip, Link, Tooltip, Typography, useTheme } from '@mui/material';
|
|
15
15
|
import { formatDuration, msToPrometheusDuration } from '@perses-dev/core';
|
|
16
16
|
import { replaceVariablesInString, useAllVariableValues, useRouterContext } from '@perses-dev/plugin-system';
|
|
17
|
+
import { useSelectionItemActions } from '@perses-dev/dashboards';
|
|
17
18
|
import InformationIcon from 'mdi-material-ui/Information';
|
|
18
|
-
import { useChartsTheme } from '@perses-dev/components';
|
|
19
|
+
import { useChartsTheme, useSelection } from '@perses-dev/components';
|
|
19
20
|
import { DataGrid } from '@mui/x-data-grid';
|
|
20
21
|
import { useCallback, useMemo } from 'react';
|
|
21
22
|
import { getServiceColor } from './utils/utils';
|
|
@@ -33,27 +34,75 @@ export function DataTable(props) {
|
|
|
33
34
|
const muiTheme = useTheme();
|
|
34
35
|
const chartsTheme = useChartsTheme();
|
|
35
36
|
const variableValues = useAllVariableValues();
|
|
37
|
+
const selectionEnabled = options.selection?.enabled ?? false;
|
|
38
|
+
const { selectionMap, setSelection, clearSelection } = useSelection();
|
|
39
|
+
const itemActionsConfig = options.actions;
|
|
40
|
+
const showItemActions = itemActionsConfig?.enabled && itemActionsConfig?.displayWithItem;
|
|
41
|
+
const actionsList = showItemActions ? itemActionsConfig.actionsList : undefined;
|
|
42
|
+
const { getItemActionButtons, confirmDialog } = useSelectionItemActions({
|
|
43
|
+
actions: actionsList,
|
|
44
|
+
variableState: variableValues
|
|
45
|
+
});
|
|
46
|
+
// Convert selectionMap to DataGrid's row selection model
|
|
47
|
+
const rowSelectionModel = useMemo(()=>{
|
|
48
|
+
return Array.from(selectionMap.keys());
|
|
49
|
+
}, [
|
|
50
|
+
selectionMap
|
|
51
|
+
]);
|
|
36
52
|
const paletteMode = options.visual?.palette?.mode;
|
|
37
53
|
const serviceColorGenerator = useCallback((serviceName)=>getServiceColor(muiTheme, chartsTheme, paletteMode, serviceName), [
|
|
38
54
|
muiTheme,
|
|
39
55
|
chartsTheme,
|
|
40
56
|
paletteMode
|
|
41
57
|
]);
|
|
42
|
-
const rows =
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
const rows = useMemo(()=>{
|
|
59
|
+
const result_rows = [];
|
|
60
|
+
for (const query of result){
|
|
61
|
+
const pluginSpec = query.definition.spec.plugin.spec;
|
|
62
|
+
const datasourceName = pluginSpec?.datasource?.name;
|
|
63
|
+
for (const trace of query.data?.searchResult || []){
|
|
64
|
+
const traceLink = options.links?.trace ? replaceVariablesInString(options.links.trace, variableValues, {
|
|
65
|
+
datasourceName: datasourceName ?? '',
|
|
66
|
+
traceId: trace.traceId
|
|
67
|
+
}) : undefined;
|
|
68
|
+
result_rows.push({
|
|
69
|
+
...trace,
|
|
70
|
+
traceLink
|
|
71
|
+
});
|
|
72
|
+
}
|
|
55
73
|
}
|
|
56
|
-
|
|
74
|
+
return result_rows;
|
|
75
|
+
}, [
|
|
76
|
+
result,
|
|
77
|
+
options.links?.trace,
|
|
78
|
+
variableValues
|
|
79
|
+
]);
|
|
80
|
+
const rowsById = useMemo(()=>{
|
|
81
|
+
const map = new Map();
|
|
82
|
+
rows.forEach((row)=>map.set(row.traceId, row));
|
|
83
|
+
return map;
|
|
84
|
+
}, [
|
|
85
|
+
rows
|
|
86
|
+
]);
|
|
87
|
+
const handleRowSelectionModelChange = useCallback((newSelectionModel)=>{
|
|
88
|
+
const selectedIds = newSelectionModel;
|
|
89
|
+
if (selectedIds.length === 0) {
|
|
90
|
+
clearSelection();
|
|
91
|
+
} else {
|
|
92
|
+
const newSelection = selectedIds.map((id)=>{
|
|
93
|
+
const row = rowsById.get(id);
|
|
94
|
+
return row ? {
|
|
95
|
+
id,
|
|
96
|
+
item: row
|
|
97
|
+
} : null;
|
|
98
|
+
}).filter((entry)=>entry !== null);
|
|
99
|
+
setSelection(newSelection);
|
|
100
|
+
}
|
|
101
|
+
}, [
|
|
102
|
+
rowsById,
|
|
103
|
+
setSelection,
|
|
104
|
+
clearSelection
|
|
105
|
+
]);
|
|
57
106
|
const columns = useMemo(()=>[
|
|
58
107
|
{
|
|
59
108
|
field: 'name',
|
|
@@ -151,41 +200,64 @@ export function DataTable(props) {
|
|
|
151
200
|
children: DATE_FORMATTER(new Date(row.startTimeUnixMs))
|
|
152
201
|
}, `st-${row.traceId}`)
|
|
153
202
|
})
|
|
154
|
-
}
|
|
203
|
+
},
|
|
204
|
+
...actionsList && actionsList.length > 0 ? [
|
|
205
|
+
{
|
|
206
|
+
field: 'actions',
|
|
207
|
+
headerName: 'Actions',
|
|
208
|
+
flex: actionsList.length,
|
|
209
|
+
display: 'flex',
|
|
210
|
+
type: 'actions',
|
|
211
|
+
getActions: ({ row })=>getItemActionButtons({
|
|
212
|
+
id: row.traceId,
|
|
213
|
+
data: row
|
|
214
|
+
})
|
|
215
|
+
}
|
|
216
|
+
] : []
|
|
155
217
|
], [
|
|
156
|
-
serviceColorGenerator
|
|
218
|
+
serviceColorGenerator,
|
|
219
|
+
actionsList,
|
|
220
|
+
getItemActionButtons
|
|
157
221
|
]);
|
|
158
|
-
return /*#__PURE__*/
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
222
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
223
|
+
children: [
|
|
224
|
+
confirmDialog,
|
|
225
|
+
/*#__PURE__*/ _jsx(DataGrid, {
|
|
226
|
+
sx: {
|
|
227
|
+
borderWidth: 0
|
|
228
|
+
},
|
|
229
|
+
columns: columns,
|
|
230
|
+
rows: rows,
|
|
231
|
+
getRowId: (row)=>row.traceId,
|
|
232
|
+
getRowHeight: ()=>'auto',
|
|
233
|
+
getEstimatedRowHeight: ()=>66,
|
|
234
|
+
checkboxSelection: selectionEnabled,
|
|
235
|
+
rowSelectionModel: selectionEnabled ? rowSelectionModel : undefined,
|
|
236
|
+
onRowSelectionModelChange: selectionEnabled ? handleRowSelectionModelChange : undefined,
|
|
237
|
+
disableRowSelectionOnClick: !selectionEnabled,
|
|
238
|
+
pageSizeOptions: [
|
|
239
|
+
10,
|
|
240
|
+
20,
|
|
241
|
+
50,
|
|
242
|
+
100
|
|
243
|
+
],
|
|
244
|
+
initialState: {
|
|
245
|
+
pagination: {
|
|
246
|
+
paginationModel: {
|
|
247
|
+
pageSize: 20
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
sorting: {
|
|
251
|
+
sortModel: [
|
|
252
|
+
{
|
|
253
|
+
field: 'startTimeUnixMs',
|
|
254
|
+
sort: 'desc'
|
|
255
|
+
}
|
|
256
|
+
]
|
|
185
257
|
}
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
258
|
+
}
|
|
259
|
+
})
|
|
260
|
+
]
|
|
189
261
|
});
|
|
190
262
|
}
|
|
191
263
|
function TraceName({ row: trace }) {
|
package/lib/DataTable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/DataTable.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Avatar, Box, Chip, Link, Tooltip, Typography, useTheme } from '@mui/material';\nimport {\n QueryDefinition,\n ServiceStats,\n TraceData,\n TraceSearchResult,\n formatDuration,\n msToPrometheusDuration,\n} from '@perses-dev/core';\nimport { PanelData, replaceVariablesInString, useAllVariableValues, useRouterContext } from '@perses-dev/plugin-system';\nimport InformationIcon from 'mdi-material-ui/Information';\nimport { useChartsTheme } from '@perses-dev/components';\nimport { DataGrid, GridColDef } from '@mui/x-data-grid';\nimport { ReactElement, useCallback, useMemo } from 'react';\nimport { getServiceColor } from './utils/utils';\nimport { TraceTableOptions } from './trace-table-model';\n\nconst DATE_FORMATTER = new Intl.DateTimeFormat(undefined, {\n dateStyle: 'long',\n timeStyle: 'medium',\n}).format;\nconst UTC_DATE_FORMATTER = new Intl.DateTimeFormat(undefined, {\n dateStyle: 'long',\n timeStyle: 'long',\n timeZone: 'UTC',\n}).format;\n\nexport type TraceLink = (params: { query: QueryDefinition; traceId: string }) => string;\n\nexport interface DataTableProps {\n options: TraceTableOptions;\n result: Array<PanelData<TraceData>>;\n}\n\ninterface Row extends TraceSearchResult {\n traceLink?: string;\n}\n\nexport function DataTable(props: DataTableProps): ReactElement {\n const { options, result } = props;\n const muiTheme = useTheme();\n const chartsTheme = useChartsTheme();\n const variableValues = useAllVariableValues();\n\n const paletteMode = options.visual?.palette?.mode;\n const serviceColorGenerator = useCallback(\n (serviceName: string) => getServiceColor(muiTheme, chartsTheme, paletteMode, serviceName),\n [muiTheme, chartsTheme, paletteMode]\n );\n\n const rows: Row[] = [];\n for (const query of result) {\n const pluginSpec = query.definition.spec.plugin.spec as { datasource?: { name?: string } } | undefined;\n const datasourceName = pluginSpec?.datasource?.name;\n\n for (const trace of query.data?.searchResult || []) {\n const traceLink = options.links?.trace\n ? replaceVariablesInString(options.links.trace, variableValues, {\n datasourceName: datasourceName ?? '',\n traceId: trace.traceId,\n })\n : undefined;\n rows.push({\n ...trace,\n traceLink,\n });\n }\n }\n\n const columns = useMemo<Array<GridColDef<Row>>>(\n () => [\n {\n field: 'name',\n headerName: 'Trace name',\n type: 'string',\n flex: 4,\n display: 'flex',\n valueGetter: (_, trace): string => `${trace.rootServiceName}: ${trace.rootTraceName}`,\n renderCell: ({ row }): ReactElement => (\n <Box sx={{ my: 1 }}>\n <TraceName row={row} />\n <br />\n {Object.entries(row.serviceStats).map(([serviceName, stats]) => (\n <ServiceChip\n key={serviceName}\n serviceName={serviceName}\n stats={stats}\n serviceColor={serviceColorGenerator(serviceName)}\n />\n ))}\n </Box>\n ),\n },\n {\n field: 'spanCount',\n headerName: 'Spans',\n type: 'number',\n headerAlign: 'left',\n align: 'left',\n flex: 2,\n minWidth: 145,\n display: 'flex',\n valueGetter: (_, trace) => Object.values(trace.serviceStats).reduce((acc, val) => acc + val.spanCount, 0),\n renderCell: ({ row }): ReactElement => {\n let totalSpanCount = 0;\n let totalErrorCount = 0;\n for (const stats of Object.values(row.serviceStats)) {\n totalSpanCount += stats.spanCount;\n totalErrorCount += stats.errorCount ?? 0;\n }\n return (\n <>\n <Typography display=\"inline\">{totalSpanCount} spans</Typography>\n {totalErrorCount > 0 && (\n <Chip\n label={`${totalErrorCount} error${totalErrorCount === 1 ? '' : 's'}`}\n sx={{ marginLeft: '5px' }}\n icon={<InformationIcon />}\n variant=\"outlined\"\n size=\"small\"\n color=\"error\"\n />\n )}\n </>\n );\n },\n },\n {\n field: 'durationMs',\n headerName: 'Duration',\n type: 'number',\n headerAlign: 'left',\n align: 'left',\n flex: 1,\n minWidth: 70,\n display: 'flex',\n renderCell: ({ row }) => (\n <Typography display=\"inline\">\n {row.durationMs < 1 ? '<1ms' : formatDuration(msToPrometheusDuration(row.durationMs))}\n </Typography>\n ),\n },\n {\n field: 'startTimeUnixMs',\n headerName: 'Start time',\n type: 'number',\n headerAlign: 'left',\n align: 'left',\n flex: 3,\n minWidth: 240,\n display: 'flex',\n renderCell: ({ row }) => (\n <Tooltip title={UTC_DATE_FORMATTER(new Date(row.startTimeUnixMs))} placement=\"top\" arrow>\n <Typography display=\"inline\" key={`st-${row.traceId}`}>\n {DATE_FORMATTER(new Date(row.startTimeUnixMs))}\n </Typography>\n </Tooltip>\n ),\n },\n ],\n [serviceColorGenerator]\n );\n\n return (\n <DataGrid\n sx={{ borderWidth: 0 }}\n columns={columns}\n rows={rows}\n getRowId={(row) => row.traceId}\n getRowHeight={() => 'auto'}\n getEstimatedRowHeight={() => 66}\n disableRowSelectionOnClick={true}\n pageSizeOptions={[10, 20, 50, 100]}\n initialState={{\n pagination: { paginationModel: { pageSize: 20 } },\n sorting: {\n sortModel: [{ field: 'startTimeUnixMs', sort: 'desc' }],\n },\n }}\n />\n );\n}\n\ninterface TraceNameProps {\n row: Row;\n}\n\nfunction TraceName({ row: trace }: TraceNameProps): ReactElement {\n const { RouterComponent } = useRouterContext();\n\n if (RouterComponent && trace.traceLink) {\n return (\n <Link variant=\"body1\" color=\"inherit\" underline=\"hover\" component={RouterComponent} to={trace.traceLink}>\n <strong>{trace.rootServiceName}:</strong> {trace.rootTraceName}\n </Link>\n );\n }\n\n return (\n <Typography display=\"inline\">\n <strong>{trace.rootServiceName}:</strong> {trace.rootTraceName}\n </Typography>\n );\n}\n\ninterface ServiceChipProps {\n serviceName: string;\n stats: ServiceStats;\n serviceColor: string;\n}\n\nfunction ServiceChip({ serviceName, stats, serviceColor }: ServiceChipProps): ReactElement {\n return (\n <Chip\n label={serviceName}\n variant=\"outlined\"\n size=\"small\"\n style={{ ['--service-color' as string]: serviceColor }}\n sx={{ marginTop: '5px', marginRight: '5px', borderColor: 'var(--service-color)' }}\n avatar={\n <Avatar\n sx={{\n minWidth: 'fit-content', // by default width is fixed to 18px, which is not enough for multi-digit span counts\n padding: '6px',\n backgroundColor: 'var(--service-color)',\n fontSize: '0.65rem',\n fontWeight: 'bold',\n textShadow: '0 0 5px #fff',\n }}\n >\n {stats.spanCount}\n </Avatar>\n }\n />\n );\n}\n"],"names":["Avatar","Box","Chip","Link","Tooltip","Typography","useTheme","formatDuration","msToPrometheusDuration","replaceVariablesInString","useAllVariableValues","useRouterContext","InformationIcon","useChartsTheme","DataGrid","useCallback","useMemo","getServiceColor","DATE_FORMATTER","Intl","DateTimeFormat","undefined","dateStyle","timeStyle","format","UTC_DATE_FORMATTER","timeZone","DataTable","props","options","result","muiTheme","chartsTheme","variableValues","paletteMode","visual","palette","mode","serviceColorGenerator","serviceName","rows","query","pluginSpec","definition","spec","plugin","datasourceName","datasource","name","trace","data","searchResult","traceLink","links","traceId","push","columns","field","headerName","type","flex","display","valueGetter","_","rootServiceName","rootTraceName","renderCell","row","sx","my","TraceName","br","Object","entries","serviceStats","map","stats","ServiceChip","serviceColor","headerAlign","align","minWidth","values","reduce","acc","val","spanCount","totalSpanCount","totalErrorCount","errorCount","label","marginLeft","icon","variant","size","color","durationMs","title","Date","startTimeUnixMs","placement","arrow","borderWidth","getRowId","getRowHeight","getEstimatedRowHeight","disableRowSelectionOnClick","pageSizeOptions","initialState","pagination","paginationModel","pageSize","sorting","sortModel","sort","RouterComponent","underline","component","to","strong","style","marginTop","marginRight","borderColor","avatar","padding","backgroundColor","fontSize","fontWeight","textShadow"],"mappings":";AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,MAAM,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,gBAAgB;AACvF,SAKEC,cAAc,EACdC,sBAAsB,QACjB,mBAAmB;AAC1B,SAAoBC,wBAAwB,EAAEC,oBAAoB,EAAEC,gBAAgB,QAAQ,4BAA4B;AACxH,OAAOC,qBAAqB,8BAA8B;AAC1D,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,QAAQ,QAAoB,mBAAmB;AACxD,SAAuBC,WAAW,EAAEC,OAAO,QAAQ,QAAQ;AAC3D,SAASC,eAAe,QAAQ,gBAAgB;AAGhD,MAAMC,iBAAiB,IAAIC,KAAKC,cAAc,CAACC,WAAW;IACxDC,WAAW;IACXC,WAAW;AACb,GAAGC,MAAM;AACT,MAAMC,qBAAqB,IAAIN,KAAKC,cAAc,CAACC,WAAW;IAC5DC,WAAW;IACXC,WAAW;IACXG,UAAU;AACZ,GAAGF,MAAM;AAaT,OAAO,SAASG,UAAUC,KAAqB;IAC7C,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGF;IAC5B,MAAMG,WAAWzB;IACjB,MAAM0B,cAAcnB;IACpB,MAAMoB,iBAAiBvB;IAEvB,MAAMwB,cAAcL,QAAQM,MAAM,EAAEC,SAASC;IAC7C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AU;gBACV4C,SAAS;gBACTC,iBAAiB;gBACjBC,UAAU;gBACVC,YAAY;gBACZC,YAAY;YACd;sBAECrD,MAAMU,SAAS;;;AAK1B"}
|
|
1
|
+
{"version":3,"sources":["../../src/DataTable.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Avatar, Box, Chip, Link, Tooltip, Typography, useTheme } from '@mui/material';\nimport {\n QueryDefinition,\n ServiceStats,\n TraceData,\n TraceSearchResult,\n formatDuration,\n msToPrometheusDuration,\n} from '@perses-dev/core';\nimport { PanelData, replaceVariablesInString, useAllVariableValues, useRouterContext } from '@perses-dev/plugin-system';\nimport { useSelectionItemActions } from '@perses-dev/dashboards';\nimport InformationIcon from 'mdi-material-ui/Information';\nimport { useChartsTheme, useSelection } from '@perses-dev/components';\nimport { DataGrid, GridColDef, GridRowSelectionModel } from '@mui/x-data-grid';\nimport { ReactElement, useCallback, useMemo } from 'react';\nimport { getServiceColor } from './utils/utils';\nimport { TraceTableOptions } from './trace-table-model';\n\nconst DATE_FORMATTER = new Intl.DateTimeFormat(undefined, {\n dateStyle: 'long',\n timeStyle: 'medium',\n}).format;\nconst UTC_DATE_FORMATTER = new Intl.DateTimeFormat(undefined, {\n dateStyle: 'long',\n timeStyle: 'long',\n timeZone: 'UTC',\n}).format;\n\nexport type TraceLink = (params: { query: QueryDefinition; traceId: string }) => string;\n\nexport interface DataTableProps {\n options: TraceTableOptions;\n result: Array<PanelData<TraceData>>;\n}\n\ninterface Row extends TraceSearchResult {\n traceLink?: string;\n}\n\nexport function DataTable(props: DataTableProps): ReactElement {\n const { options, result } = props;\n const muiTheme = useTheme();\n const chartsTheme = useChartsTheme();\n const variableValues = useAllVariableValues();\n\n const selectionEnabled = options.selection?.enabled ?? false;\n const { selectionMap, setSelection, clearSelection } = useSelection<Row, string>();\n\n const itemActionsConfig = options.actions;\n const showItemActions = itemActionsConfig?.enabled && itemActionsConfig?.displayWithItem;\n const actionsList = showItemActions ? itemActionsConfig.actionsList : undefined;\n\n const { getItemActionButtons, confirmDialog } = useSelectionItemActions({\n actions: actionsList,\n variableState: variableValues,\n });\n\n // Convert selectionMap to DataGrid's row selection model\n const rowSelectionModel = useMemo((): GridRowSelectionModel => {\n return Array.from(selectionMap.keys()) as string[];\n }, [selectionMap]);\n\n const paletteMode = options.visual?.palette?.mode;\n const serviceColorGenerator = useCallback(\n (serviceName: string) => getServiceColor(muiTheme, chartsTheme, paletteMode, serviceName),\n [muiTheme, chartsTheme, paletteMode]\n );\n\n const rows: Row[] = useMemo(() => {\n const result_rows: Row[] = [];\n for (const query of result) {\n const pluginSpec = query.definition.spec.plugin.spec as { datasource?: { name?: string } } | undefined;\n const datasourceName = pluginSpec?.datasource?.name;\n\n for (const trace of query.data?.searchResult || []) {\n const traceLink = options.links?.trace\n ? replaceVariablesInString(options.links.trace, variableValues, {\n datasourceName: datasourceName ?? '',\n traceId: trace.traceId,\n })\n : undefined;\n result_rows.push({\n ...trace,\n traceLink,\n });\n }\n }\n return result_rows;\n }, [result, options.links?.trace, variableValues]);\n\n const rowsById = useMemo(() => {\n const map = new Map<string, Row>();\n rows.forEach((row) => map.set(row.traceId, row));\n return map;\n }, [rows]);\n\n const handleRowSelectionModelChange = useCallback(\n (newSelectionModel: GridRowSelectionModel) => {\n const selectedIds = newSelectionModel as string[];\n if (selectedIds.length === 0) {\n clearSelection();\n } else {\n const newSelection = selectedIds\n .map((id) => {\n const row = rowsById.get(id);\n return row ? { id, item: row } : null;\n })\n .filter((entry): entry is { id: string; item: Row } => entry !== null);\n setSelection(newSelection);\n }\n },\n [rowsById, setSelection, clearSelection]\n );\n\n const columns = useMemo<Array<GridColDef<Row>>>(\n () => [\n {\n field: 'name',\n headerName: 'Trace name',\n type: 'string',\n flex: 4,\n display: 'flex',\n valueGetter: (_, trace): string => `${trace.rootServiceName}: ${trace.rootTraceName}`,\n renderCell: ({ row }): ReactElement => (\n <Box sx={{ my: 1 }}>\n <TraceName row={row} />\n <br />\n {Object.entries(row.serviceStats).map(([serviceName, stats]) => (\n <ServiceChip\n key={serviceName}\n serviceName={serviceName}\n stats={stats}\n serviceColor={serviceColorGenerator(serviceName)}\n />\n ))}\n </Box>\n ),\n },\n {\n field: 'spanCount',\n headerName: 'Spans',\n type: 'number',\n headerAlign: 'left',\n align: 'left',\n flex: 2,\n minWidth: 145,\n display: 'flex',\n valueGetter: (_, trace) => Object.values(trace.serviceStats).reduce((acc, val) => acc + val.spanCount, 0),\n renderCell: ({ row }): ReactElement => {\n let totalSpanCount = 0;\n let totalErrorCount = 0;\n for (const stats of Object.values(row.serviceStats)) {\n totalSpanCount += stats.spanCount;\n totalErrorCount += stats.errorCount ?? 0;\n }\n return (\n <>\n <Typography display=\"inline\">{totalSpanCount} spans</Typography>\n {totalErrorCount > 0 && (\n <Chip\n label={`${totalErrorCount} error${totalErrorCount === 1 ? '' : 's'}`}\n sx={{ marginLeft: '5px' }}\n icon={<InformationIcon />}\n variant=\"outlined\"\n size=\"small\"\n color=\"error\"\n />\n )}\n </>\n );\n },\n },\n {\n field: 'durationMs',\n headerName: 'Duration',\n type: 'number',\n headerAlign: 'left',\n align: 'left',\n flex: 1,\n minWidth: 70,\n display: 'flex',\n renderCell: ({ row }) => (\n <Typography display=\"inline\">\n {row.durationMs < 1 ? '<1ms' : formatDuration(msToPrometheusDuration(row.durationMs))}\n </Typography>\n ),\n },\n {\n field: 'startTimeUnixMs',\n headerName: 'Start time',\n type: 'number',\n headerAlign: 'left',\n align: 'left',\n flex: 3,\n minWidth: 240,\n display: 'flex',\n renderCell: ({ row }) => (\n <Tooltip title={UTC_DATE_FORMATTER(new Date(row.startTimeUnixMs))} placement=\"top\" arrow>\n <Typography display=\"inline\" key={`st-${row.traceId}`}>\n {DATE_FORMATTER(new Date(row.startTimeUnixMs))}\n </Typography>\n </Tooltip>\n ),\n },\n ...(actionsList && actionsList.length > 0\n ? [\n {\n field: 'actions',\n headerName: 'Actions',\n flex: actionsList.length,\n display: 'flex' as const,\n type: 'actions' as const,\n getActions: ({ row }: { row: Row }) =>\n getItemActionButtons({ id: row.traceId, data: row as unknown as Record<string, unknown> }),\n },\n ]\n : []),\n ],\n [serviceColorGenerator, actionsList, getItemActionButtons]\n );\n\n return (\n <>\n {confirmDialog}\n <DataGrid\n sx={{ borderWidth: 0 }}\n columns={columns}\n rows={rows}\n getRowId={(row) => row.traceId}\n getRowHeight={() => 'auto'}\n getEstimatedRowHeight={() => 66}\n checkboxSelection={selectionEnabled}\n rowSelectionModel={selectionEnabled ? rowSelectionModel : undefined}\n onRowSelectionModelChange={selectionEnabled ? handleRowSelectionModelChange : undefined}\n disableRowSelectionOnClick={!selectionEnabled}\n pageSizeOptions={[10, 20, 50, 100]}\n initialState={{\n pagination: { paginationModel: { pageSize: 20 } },\n sorting: {\n sortModel: [{ field: 'startTimeUnixMs', sort: 'desc' }],\n },\n }}\n />\n </>\n );\n}\n\ninterface TraceNameProps {\n row: Row;\n}\n\nfunction TraceName({ row: trace }: TraceNameProps): ReactElement {\n const { RouterComponent } = useRouterContext();\n\n if (RouterComponent && trace.traceLink) {\n return (\n <Link variant=\"body1\" color=\"inherit\" underline=\"hover\" component={RouterComponent} to={trace.traceLink}>\n <strong>{trace.rootServiceName}:</strong> {trace.rootTraceName}\n </Link>\n );\n }\n\n return (\n <Typography display=\"inline\">\n <strong>{trace.rootServiceName}:</strong> {trace.rootTraceName}\n </Typography>\n );\n}\n\ninterface ServiceChipProps {\n serviceName: string;\n stats: ServiceStats;\n serviceColor: string;\n}\n\nfunction ServiceChip({ serviceName, stats, serviceColor }: ServiceChipProps): ReactElement {\n return (\n <Chip\n label={serviceName}\n variant=\"outlined\"\n size=\"small\"\n style={{ ['--service-color' as string]: serviceColor }}\n sx={{ marginTop: '5px', marginRight: '5px', borderColor: 'var(--service-color)' }}\n avatar={\n <Avatar\n sx={{\n minWidth: 'fit-content', // by default width is fixed to 18px, which is not enough for multi-digit span counts\n padding: '6px',\n backgroundColor: 'var(--service-color)',\n fontSize: '0.65rem',\n fontWeight: 'bold',\n textShadow: '0 0 5px #fff',\n }}\n >\n {stats.spanCount}\n </Avatar>\n }\n />\n );\n}\n"],"names":["Avatar","Box","Chip","Link","Tooltip","Typography","useTheme","formatDuration","msToPrometheusDuration","replaceVariablesInString","useAllVariableValues","useRouterContext","useSelectionItemActions","InformationIcon","useChartsTheme","useSelection","DataGrid","useCallback","useMemo","getServiceColor","DATE_FORMATTER","Intl","DateTimeFormat","undefined","dateStyle","timeStyle","format","UTC_DATE_FORMATTER","timeZone","DataTable","props","options","result","muiTheme","chartsTheme","variableValues","selectionEnabled","selection","enabled","selectionMap","setSelection","clearSelection","itemActionsConfig","actions","showItemActions","displayWithItem","actionsList","getItemActionButtons","confirmDialog","variableState","rowSelectionModel","Array","from","keys","paletteMode","visual","palette","mode","serviceColorGenerator","serviceName","rows","result_rows","query","pluginSpec","definition","spec","plugin","datasourceName","datasource","name","trace","data","searchResult","traceLink","links","traceId","push","rowsById","map","Map","forEach","row","set","handleRowSelectionModelChange","newSelectionModel","selectedIds","length","newSelection","id","get","item","filter","entry","columns","field","headerName","type","flex","display","valueGetter","_","rootServiceName","rootTraceName","renderCell","sx","my","TraceName","br","Object","entries","serviceStats","stats","ServiceChip","serviceColor","headerAlign","align","minWidth","values","reduce","acc","val","spanCount","totalSpanCount","totalErrorCount","errorCount","label","marginLeft","icon","variant","size","color","durationMs","title","Date","startTimeUnixMs","placement","arrow","getActions","borderWidth","getRowId","getRowHeight","getEstimatedRowHeight","checkboxSelection","onRowSelectionModelChange","disableRowSelectionOnClick","pageSizeOptions","initialState","pagination","paginationModel","pageSize","sorting","sortModel","sort","RouterComponent","underline","component","to","strong","style","marginTop","marginRight","borderColor","avatar","padding","backgroundColor","fontSize","fontWeight","textShadow"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,MAAM,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,gBAAgB;AACvF,SAKEC,cAAc,EACdC,sBAAsB,QACjB,mBAAmB;AAC1B,SAAoBC,wBAAwB,EAAEC,oBAAoB,EAAEC,gBAAgB,QAAQ,4BAA4B;AACxH,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,OAAOC,qBAAqB,8BAA8B;AAC1D,SAASC,cAAc,EAAEC,YAAY,QAAQ,yBAAyB;AACtE,SAASC,QAAQ,QAA2C,mBAAmB;AAC/E,SAAuBC,WAAW,EAAEC,OAAO,QAAQ,QAAQ;AAC3D,SAASC,eAAe,QAAQ,gBAAgB;AAGhD,MAAMC,iBAAiB,IAAIC,KAAKC,cAAc,CAACC,WAAW;IACxDC,WAAW;IACXC,WAAW;AACb,GAAGC,MAAM;AACT,MAAMC,qBAAqB,IAAIN,KAAKC,cAAc,CAACC,WAAW;IAC5DC,WAAW;IACXC,WAAW;IACXG,UAAU;AACZ,GAAGF,MAAM;AAaT,OAAO,SAASG,UAAUC,KAAqB;IAC7C,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGF;IAC5B,MAAMG,WAAW3B;IACjB,MAAM4B,cAAcpB;IACpB,MAAMqB,iBAAiBzB;IAEvB,MAAM0B,mBAAmBL,QAAQM,SAAS,EAAEC,WAAW;IACvD,MAAM,EAAEC,YAAY,EAAEC,YAAY,EAAEC,cAAc,EAAE,GAAG1B;IAEvD,MAAM2B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AMgC,aAAa;;;AAGpE;AAQA,SAASU,YAAY,EAAErD,WAAW,EAAEoD,KAAK,EAAEE,YAAY,EAAoB;IACzE,qBACE,KAAC/G;QACC2H,OAAOlE;QACPqE,SAAQ;QACRC,MAAK;QACL6B,OAAO;YAAE,CAAC,kBAA4B,EAAE7C;QAAa;QACrDT,IAAI;YAAEuD,WAAW;YAAOC,aAAa;YAAOC,aAAa;QAAuB;QAChFC,sBACE,KAAClK;YACCwG,IAAI;gBACFY,UAAU;gBACV+C,SAAS;gBACTC,iBAAiB;gBACjBC,UAAU;gBACVC,YAAY;gBACZC,YAAY;YACd;sBAECxD,MAAMU,SAAS;;;AAK1B"}
|
package/lib/TraceTable.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TraceTable.d.ts","sourceRoot":"","sources":["../../src/TraceTable.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"TraceTable.d.ts","sourceRoot":"","sources":["../../src/TraceTable.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAmB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAkC,MAAM,qBAAqB,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,iBAAiB,EAAE,oBAAoB,CAK3E,CAAC"}
|
package/lib/TraceTable.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -10,12 +10,19 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
+
import { TraceTableItemSelectionActionsEditor } from './TraceTableItemSelectionActionsEditor';
|
|
13
14
|
import { TraceTablePanel } from './TraceTablePanel';
|
|
14
15
|
import { createInitialTraceTableOptions } from './trace-table-model';
|
|
15
16
|
/**
|
|
16
17
|
* The core TraceTable panel plugin for Perses.
|
|
17
18
|
*/ export const TraceTable = {
|
|
18
19
|
PanelComponent: TraceTablePanel,
|
|
20
|
+
panelOptionsEditorComponents: [
|
|
21
|
+
{
|
|
22
|
+
label: 'Item Actions',
|
|
23
|
+
content: TraceTableItemSelectionActionsEditor
|
|
24
|
+
}
|
|
25
|
+
],
|
|
19
26
|
supportedQueryTypes: [
|
|
20
27
|
'TraceQuery'
|
|
21
28
|
],
|
package/lib/TraceTable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TraceTable.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/TraceTable.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelPlugin } from '@perses-dev/plugin-system';\nimport { TraceTableItemSelectionActionsEditor } from './TraceTableItemSelectionActionsEditor';\nimport { TraceTablePanel, TraceTablePanelProps } from './TraceTablePanel';\nimport { TraceTableOptions, createInitialTraceTableOptions } from './trace-table-model';\n\n/**\n * The core TraceTable panel plugin for Perses.\n */\nexport const TraceTable: PanelPlugin<TraceTableOptions, TraceTablePanelProps> = {\n PanelComponent: TraceTablePanel,\n panelOptionsEditorComponents: [{ label: 'Item Actions', content: TraceTableItemSelectionActionsEditor }],\n supportedQueryTypes: ['TraceQuery'],\n createInitialOptions: createInitialTraceTableOptions,\n};\n"],"names":["TraceTableItemSelectionActionsEditor","TraceTablePanel","createInitialTraceTableOptions","TraceTable","PanelComponent","panelOptionsEditorComponents","label","content","supportedQueryTypes","createInitialOptions"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,oCAAoC,QAAQ,yCAAyC;AAC9F,SAASC,eAAe,QAA8B,oBAAoB;AAC1E,SAA4BC,8BAA8B,QAAQ,sBAAsB;AAExF;;CAEC,GACD,OAAO,MAAMC,aAAmE;IAC9EC,gBAAgBH;IAChBI,8BAA8B;QAAC;YAAEC,OAAO;YAAgBC,SAASP;QAAqC;KAAE;IACxGQ,qBAAqB;QAAC;KAAa;IACnCC,sBAAsBP;AACxB,EAAE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OptionsEditorProps } from '@perses-dev/plugin-system';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { TraceTableOptions } from './trace-table-model';
|
|
4
|
+
type TraceTableItemSelectionActionsEditorProps = OptionsEditorProps<TraceTableOptions>;
|
|
5
|
+
export declare function TraceTableItemSelectionActionsEditor(props: TraceTableItemSelectionActionsEditorProps): ReactElement;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=TraceTableItemSelectionActionsEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraceTableItemSelectionActionsEditor.d.ts","sourceRoot":"","sources":["../../src/TraceTableItemSelectionActionsEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,KAAK,yCAAyC,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;AAEvF,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,yCAAyC,GAAG,YAAY,CAmBnH"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright The Perses Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { ItemSelectionActionsEditor } from '@perses-dev/plugin-system';
|
|
15
|
+
export function TraceTableItemSelectionActionsEditor(props) {
|
|
16
|
+
const { onChange, value } = props;
|
|
17
|
+
const handleActionsChange = (actions)=>{
|
|
18
|
+
onChange({
|
|
19
|
+
...value,
|
|
20
|
+
actions
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
const handleSelectionChange = (selection)=>{
|
|
24
|
+
onChange({
|
|
25
|
+
...value,
|
|
26
|
+
selection
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return /*#__PURE__*/ _jsx(ItemSelectionActionsEditor, {
|
|
30
|
+
actionOptions: value.actions,
|
|
31
|
+
onChangeActions: handleActionsChange,
|
|
32
|
+
selectionOptions: value.selection,
|
|
33
|
+
onChangeSelection: handleSelectionChange
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=TraceTableItemSelectionActionsEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/TraceTableItemSelectionActionsEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n ActionOptions,\n ItemSelectionActionsEditor,\n OptionsEditorProps,\n SelectionOptions,\n} from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { TraceTableOptions } from './trace-table-model';\n\ntype TraceTableItemSelectionActionsEditorProps = OptionsEditorProps<TraceTableOptions>;\n\nexport function TraceTableItemSelectionActionsEditor(props: TraceTableItemSelectionActionsEditorProps): ReactElement {\n const { onChange, value } = props;\n\n const handleActionsChange = (actions?: ActionOptions): void => {\n onChange({ ...value, actions });\n };\n\n const handleSelectionChange = (selection?: SelectionOptions): void => {\n onChange({ ...value, selection });\n };\n\n return (\n <ItemSelectionActionsEditor\n actionOptions={value.actions}\n onChangeActions={handleActionsChange}\n selectionOptions={value.selection}\n onChangeSelection={handleSelectionChange}\n />\n );\n}\n"],"names":["ItemSelectionActionsEditor","TraceTableItemSelectionActionsEditor","props","onChange","value","handleActionsChange","actions","handleSelectionChange","selection","actionOptions","onChangeActions","selectionOptions","onChangeSelection"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAEEA,0BAA0B,QAGrB,4BAA4B;AAMnC,OAAO,SAASC,qCAAqCC,KAAgD;IACnG,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAE5B,MAAMG,sBAAsB,CAACC;QAC3BH,SAAS;YAAE,GAAGC,KAAK;YAAEE;QAAQ;IAC/B;IAEA,MAAMC,wBAAwB,CAACC;QAC7BL,SAAS;YAAE,GAAGC,KAAK;YAAEI;QAAU;IACjC;IAEA,qBACE,KAACR;QACCS,eAAeL,MAAME,OAAO;QAC5BI,iBAAiBL;QACjBM,kBAAkBP,MAAMI,SAAS;QACjCI,mBAAmBL;;AAGzB"}
|
package/lib/TraceTablePanel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TraceTablePanel.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/TraceTablePanel.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport { Box } from '@mui/material';\nimport { NoDataOverlay, useChartsTheme } from '@perses-dev/components';\nimport { TraceData } from '@perses-dev/core';\nimport { ReactElement } from 'react';\nimport { DataTable } from './DataTable';\nimport { TraceTableOptions } from './trace-table-model';\n\nexport type TraceTablePanelProps = PanelProps<TraceTableOptions, TraceData>;\n\nexport function TraceTablePanel(props: TraceTablePanelProps): ReactElement {\n const { spec, queryResults } = props;\n\n const chartsTheme = useChartsTheme();\n const contentPadding = chartsTheme.container.padding.default;\n\n const tracesFound = queryResults.some((traceData) => (traceData.data?.searchResult ?? []).length > 0);\n if (!tracesFound) {\n return <NoDataOverlay resource=\"traces\" />;\n }\n\n return (\n <Box sx={{ height: '100%', padding: `${contentPadding}px`, overflowY: 'auto' }}>\n <DataTable options={spec} result={queryResults} />\n </Box>\n );\n}\n"],"names":["Box","NoDataOverlay","useChartsTheme","DataTable","TraceTablePanel","props","spec","queryResults","chartsTheme","contentPadding","container","padding","default","tracesFound","some","traceData","data","searchResult","length","resource","sx","height","overflowY","options","result"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,aAAa,EAAEC,cAAc,QAAQ,yBAAyB;AAGvE,SAASC,SAAS,QAAQ,cAAc;AAKxC,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,IAAI,EAAEC,YAAY,EAAE,GAAGF;IAE/B,MAAMG,cAAcN;IACpB,MAAMO,iBAAiBD,YAAYE,SAAS,CAACC,OAAO,CAACC,OAAO;IAE5D,MAAMC,cAAcN,aAAaO,IAAI,CAAC,CAACC,YAAc,AAACA,CAAAA,UAAUC,IAAI,EAAEC,gBAAgB,EAAE,AAAD,EAAGC,MAAM,GAAG;IACnG,IAAI,CAACL,aAAa;QAChB,qBAAO,KAACZ;YAAckB,UAAS;;IACjC;IAEA,qBACE,KAACnB;QAAIoB,IAAI;YAAEC,QAAQ;YAAQV,SAAS,GAAGF,eAAe,EAAE,CAAC;YAAEa,WAAW;QAAO;kBAC3E,cAAA,KAACnB;YAAUoB,SAASjB;YAAMkB,QAAQjB;;;AAGxC"}
|
package/lib/bootstrap.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright The Perses Authors
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
5
5
|
// You may obtain a copy of the License at
|
package/lib/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bootstrap.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/bootstrap.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\n\nconst root = ReactDOM.createRoot(document.getElementById('root')!);\nroot.render(<React.StrictMode></React.StrictMode>);\n"],"names":["React","ReactDOM","root","createRoot","document","getElementById","render","StrictMode"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAOA,WAAW,QAAQ;AAC1B,OAAOC,cAAc,mBAAmB;AAExC,MAAMC,OAAOD,SAASE,UAAU,CAACC,SAASC,cAAc,CAAC;AACzDH,KAAKI,MAAM,eAAC,KAACN,MAAMO,UAAU"}
|