@perses-dev/logs-table-plugin 0.3.0 → 0.4.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/js/{LogsTable.f8cdc769.js → LogsTable.5f90fc7a.js} +3 -3
- package/__mf/js/async/10.bcca0993.js +1 -0
- package/__mf/js/async/121.0b393209.js +2 -0
- package/__mf/js/async/141.32e969e2.js +1 -0
- package/__mf/js/async/192.fc13839d.js +1 -0
- package/__mf/js/async/2.9fe1a207.js +1 -0
- package/__mf/js/async/205.68d26c79.js +1 -0
- package/__mf/js/async/235.b7fd9fbd.js +1 -0
- package/__mf/js/async/274.2b0ee3e5.js +2 -0
- package/__mf/js/async/356.2f0b1efb.js +1 -0
- package/__mf/js/async/358.d7e737b5.js +111 -0
- package/__mf/js/async/392.ed78da9c.js +2 -0
- package/__mf/js/async/413.22923ee3.js +1 -0
- package/__mf/js/async/432.481e486b.js +1 -0
- package/__mf/js/async/458.84b877ba.js +1 -0
- package/__mf/js/async/470.3af71569.js +2 -0
- package/__mf/js/async/522.0ab2b630.js +1 -0
- package/__mf/js/async/587.7956e241.js +1 -0
- package/__mf/js/async/597.a6830f1c.js +2 -0
- package/__mf/js/async/608.79199272.js +1 -0
- package/__mf/js/async/612.265f875c.js +3 -0
- package/__mf/js/async/616.04a2fde6.js +1 -0
- package/__mf/js/async/634.f0773d52.js +2 -0
- package/__mf/js/async/663.0b1c854a.js +1 -0
- package/__mf/js/async/705.d5f9313a.js +22 -0
- package/__mf/js/async/72.be3fbcf8.js +7 -0
- package/__mf/js/async/72.be3fbcf8.js.LICENSE.txt +102 -0
- package/__mf/js/async/77.8b8e4afd.js +1 -0
- package/__mf/js/async/802.f980a2b2.js +1 -0
- package/__mf/js/async/923.60207cc2.js +1 -0
- package/__mf/js/async/941.1064117a.js +2 -0
- package/__mf/js/async/968.21668c0c.js +1 -0
- package/__mf/js/async/985.5af87994.js +37 -0
- package/__mf/js/async/__federation_expose_LogsTable.c8f94043.js +1 -0
- package/__mf/js/async/lib-router.edb1af73.js +2 -0
- package/__mf/js/{main.4253925a.js → main.e5de84d3.js} +3 -3
- package/lib/LogsTable.d.ts +2 -2
- package/lib/LogsTable.d.ts.map +1 -1
- package/lib/LogsTable.js +5 -5
- package/lib/LogsTable.js.map +1 -1
- package/lib/LogsTableComponent.d.ts +2 -2
- package/lib/LogsTableComponent.d.ts.map +1 -1
- package/lib/LogsTableComponent.js +4 -4
- package/lib/LogsTableComponent.js.map +1 -1
- package/lib/LogsTableCsvExportAction.d.ts +2 -2
- package/lib/LogsTableCsvExportAction.d.ts.map +1 -1
- package/lib/LogsTableCsvExportAction.js +7 -7
- package/lib/LogsTableCsvExportAction.js.map +1 -1
- package/lib/LogsTableExportAction.d.ts +1 -1
- package/lib/LogsTableExportAction.d.ts.map +1 -1
- package/lib/LogsTableExportAction.js +5 -5
- package/lib/LogsTableExportAction.js.map +1 -1
- package/lib/LogsTableItemSelectionActionsEditor.d.ts +2 -2
- package/lib/LogsTableItemSelectionActionsEditor.d.ts.map +1 -1
- package/lib/LogsTableItemSelectionActionsEditor.js +2 -2
- package/lib/LogsTableItemSelectionActionsEditor.js.map +1 -1
- package/lib/LogsTablePanel.d.ts +2 -2
- package/lib/LogsTablePanel.d.ts.map +1 -1
- package/lib/LogsTablePanel.js +3 -3
- package/lib/LogsTablePanel.js.map +1 -1
- package/lib/LogsTableSettingsEditor.d.ts +3 -3
- package/lib/LogsTableSettingsEditor.d.ts.map +1 -1
- package/lib/LogsTableSettingsEditor.js +3 -3
- package/lib/LogsTableSettingsEditor.js.map +1 -1
- package/lib/bootstrap.js +2 -2
- package/lib/components/EmptyLogsState.d.ts.map +1 -1
- package/lib/components/EmptyLogsState.js +2 -2
- package/lib/components/EmptyLogsState.js.map +1 -1
- package/lib/components/LogRow/LogDetailsTable.d.ts +2 -2
- package/lib/components/LogRow/LogDetailsTable.d.ts.map +1 -1
- package/lib/components/LogRow/LogDetailsTable.js +4 -4
- package/lib/components/LogRow/LogDetailsTable.js.map +1 -1
- package/lib/components/LogRow/LogRow.d.ts +3 -2
- package/lib/components/LogRow/LogRow.d.ts.map +1 -1
- package/lib/components/LogRow/LogRow.js +15 -15
- package/lib/components/LogRow/LogRow.js.map +1 -1
- package/lib/components/LogRow/LogTimestamp.js +1 -1
- package/lib/components/LogRow/LogsStyles.d.ts.map +1 -1
- package/lib/components/LogRow/LogsStyles.js +2 -2
- package/lib/components/LogRow/LogsStyles.js.map +1 -1
- package/lib/components/LogRow/index.js +2 -2
- package/lib/components/LogRow/index.js.map +1 -1
- package/lib/components/LogsList.d.ts +2 -2
- package/lib/components/LogsList.d.ts.map +1 -1
- package/lib/components/LogsList.js +5 -5
- package/lib/components/LogsList.js.map +1 -1
- package/lib/components/VirtualizedLogsList.d.ts +2 -2
- package/lib/components/VirtualizedLogsList.d.ts.map +1 -1
- package/lib/components/VirtualizedLogsList.js +18 -13
- package/lib/components/VirtualizedLogsList.js.map +1 -1
- package/lib/components/hooks/useExpandedRows.js +1 -1
- package/lib/components/hooks/useSeverity.d.ts +1 -1
- package/lib/components/hooks/useSeverity.d.ts.map +1 -1
- package/lib/components/hooks/useSeverity.js +2 -2
- package/lib/components/hooks/useSeverity.js.map +1 -1
- package/lib/components/utils.d.ts +1 -1
- package/lib/components/utils.d.ts.map +1 -1
- package/lib/components/utils.js.map +1 -1
- package/lib/getPluginModule.d.ts +1 -1
- package/lib/getPluginModule.d.ts.map +1 -1
- package/lib/getPluginModule.js +3 -1
- package/lib/getPluginModule.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/model.d.ts +3 -3
- package/lib/model.d.ts.map +1 -1
- package/lib/model.js.map +1 -1
- package/lib/setup-tests.d.ts +1 -1
- package/lib/setup-tests.d.ts.map +1 -1
- package/lib/setup-tests.js +2 -2
- package/lib/setup-tests.js.map +1 -1
- package/lib/test/mock-query-results.d.ts +1 -1
- package/lib/test/mock-query-results.d.ts.map +1 -1
- package/lib/test/mock-query-results.js.map +1 -1
- package/lib/utils/ansi.js +2 -2
- package/lib/utils/copyHelpers.d.ts +1 -1
- package/lib/utils/copyHelpers.d.ts.map +1 -1
- package/lib/utils/copyHelpers.js +1 -1
- package/lib/utils/copyHelpers.js.map +1 -1
- package/mf-manifest.json +43 -86
- package/mf-stats.json +43 -94
- package/package.json +11 -11
- package/__mf/js/async/1603.89bfb1ad.js +0 -2
- package/__mf/js/async/1616.c3be409a.js +0 -1
- package/__mf/js/async/2043.dba84aa4.js +0 -2
- package/__mf/js/async/2043.dba84aa4.js.LICENSE.txt +0 -24
- package/__mf/js/async/2546.6b3aab40.js +0 -3
- package/__mf/js/async/2842.610cb74b.js +0 -1
- package/__mf/js/async/304.21c30c64.js +0 -37
- package/__mf/js/async/3332.ab0338e8.js +0 -7
- package/__mf/js/async/3332.ab0338e8.js.LICENSE.txt +0 -39
- package/__mf/js/async/392.5cb44640.js +0 -2
- package/__mf/js/async/4077.32e3919d.js +0 -1
- package/__mf/js/async/4121.d4c9b3e3.js +0 -2
- package/__mf/js/async/4869.80345aa7.js +0 -1
- package/__mf/js/async/5002.1d6e3559.js +0 -1
- package/__mf/js/async/5071.be3352f1.js +0 -1
- package/__mf/js/async/5587.9e49a823.js +0 -1
- package/__mf/js/async/6274.fe68ed99.js +0 -2
- package/__mf/js/async/6458.de33906b.js +0 -1
- package/__mf/js/async/7177.8dd90707.js +0 -1
- package/__mf/js/async/7192.017cbe40.js +0 -1
- package/__mf/js/async/7250.05494519.js +0 -1
- package/__mf/js/async/7413.c2661694.js +0 -1
- package/__mf/js/async/7445.009cf084.js +0 -110
- package/__mf/js/async/7968.ec249f6f.js +0 -1
- package/__mf/js/async/7978.026a8b19.js +0 -1
- package/__mf/js/async/8356.f736e620.js +0 -1
- package/__mf/js/async/8470.f0bbed7d.js +0 -2
- package/__mf/js/async/8542.aa0c5fe3.js +0 -1
- package/__mf/js/async/8608.618e49dc.js +0 -1
- package/__mf/js/async/8634.231e1601.js +0 -2
- package/__mf/js/async/873.4fd8a061.js +0 -1
- package/__mf/js/async/8964.3e308de6.js +0 -2
- package/__mf/js/async/8964.3e308de6.js.LICENSE.txt +0 -37
- package/__mf/js/async/9126.a313fc37.js +0 -22
- package/__mf/js/async/9235.b68f4586.js +0 -1
- package/__mf/js/async/9293.ee3265d4.js +0 -2
- package/__mf/js/async/941.ad1062bb.js +0 -2
- package/__mf/js/async/9588.b214b983.js +0 -1
- package/__mf/js/async/__federation_expose_LogsTable.e6a243de.js +0 -1
- package/__mf/js/async/lib-router.c5e3aef3.js +0 -2
- package/lib/cjs/LogsTable.js +0 -58
- package/lib/cjs/LogsTableComponent.js +0 -47
- package/lib/cjs/LogsTableCsvExportAction.js +0 -124
- package/lib/cjs/LogsTableExportAction.js +0 -80
- package/lib/cjs/LogsTableItemSelectionActionsEditor.js +0 -44
- package/lib/cjs/LogsTablePanel.js +0 -42
- package/lib/cjs/LogsTableSettingsEditor.js +0 -57
- package/lib/cjs/bootstrap.js +0 -26
- package/lib/cjs/components/EmptyLogsState.js +0 -49
- package/lib/cjs/components/LogRow/LogDetailsTable.js +0 -126
- package/lib/cjs/components/LogRow/LogRow.js +0 -421
- package/lib/cjs/components/LogRow/LogTimestamp.js +0 -44
- package/lib/cjs/components/LogRow/LogsStyles.js +0 -87
- package/lib/cjs/components/LogRow/index.js +0 -37
- package/lib/cjs/components/LogsList.js +0 -44
- package/lib/cjs/components/VirtualizedLogsList.js +0 -547
- package/lib/cjs/components/hooks/useExpandedRows.js +0 -45
- package/lib/cjs/components/hooks/useSeverity.js +0 -47
- package/lib/cjs/components/utils.js +0 -78
- package/lib/cjs/env.d.js +0 -14
- package/lib/cjs/getPluginModule.js +0 -39
- package/lib/cjs/index-federation.js +0 -55
- package/lib/cjs/index.js +0 -38
- package/lib/cjs/model.js +0 -16
- package/lib/cjs/setup-tests.js +0 -19
- package/lib/cjs/test/mock-query-results.js +0 -133
- package/lib/cjs/utils/ansi.js +0 -60
- package/lib/cjs/utils/copyHelpers.js +0 -72
- /package/__mf/css/async/{3332.85c2cbf6.css → 72.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{4121.d4c9b3e3.js.LICENSE.txt → 121.0b393209.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.fe68ed99.js.LICENSE.txt → 274.2b0ee3e5.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{7445.009cf084.js.LICENSE.txt → 358.d7e737b5.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.5cb44640.js.LICENSE.txt → 392.ed78da9c.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.f0bbed7d.js.LICENSE.txt → 470.3af71569.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{1603.89bfb1ad.js.LICENSE.txt → 597.a6830f1c.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8634.231e1601.js.LICENSE.txt → 634.f0773d52.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{9126.a313fc37.js.LICENSE.txt → 705.d5f9313a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.ad1062bb.js.LICENSE.txt → 941.1064117a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.c5e3aef3.js.LICENSE.txt → lib-router.edb1af73.js.LICENSE.txt} +0 -0
|
@@ -1,124 +0,0 @@
|
|
|
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 LogsTableCsvExportAction () {
|
|
25
|
-
return LogsTableCsvExportAction;
|
|
26
|
-
},
|
|
27
|
-
get buildLogsCsvString () {
|
|
28
|
-
return buildLogsCsvString;
|
|
29
|
-
},
|
|
30
|
-
get collectLabelKeys () {
|
|
31
|
-
return collectLabelKeys;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
35
|
-
const _components = require("@perses-dev/components");
|
|
36
|
-
const _material = require("@mui/material");
|
|
37
|
-
const _FileDelimitedOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/FileDelimitedOutline"));
|
|
38
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
39
|
-
const _react = require("react");
|
|
40
|
-
const _ansi = require("./utils/ansi");
|
|
41
|
-
function _interop_require_default(obj) {
|
|
42
|
-
return obj && obj.__esModule ? obj : {
|
|
43
|
-
default: obj
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function collectLabelKeys(entries) {
|
|
47
|
-
const keys = new Set();
|
|
48
|
-
for (const entry of entries){
|
|
49
|
-
for (const key of Object.keys(entry.labels)){
|
|
50
|
-
keys.add(key);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return Array.from(keys).sort();
|
|
54
|
-
}
|
|
55
|
-
function buildLogsCsvString(entries) {
|
|
56
|
-
const labelKeys = collectLabelKeys(entries);
|
|
57
|
-
const headerColumns = [
|
|
58
|
-
'timestamp',
|
|
59
|
-
'body',
|
|
60
|
-
...labelKeys
|
|
61
|
-
];
|
|
62
|
-
const headerRow = headerColumns.map(_pluginsystem.escapeCsvValue).join(',');
|
|
63
|
-
const dataRows = entries.map((entry)=>{
|
|
64
|
-
const timestamp = (0, _pluginsystem.escapeCsvValue)((0, _pluginsystem.formatTimestampISO)(entry.timestamp));
|
|
65
|
-
const body = (0, _pluginsystem.escapeCsvValue)((0, _ansi.stripAnsi)(entry.line));
|
|
66
|
-
const labels = labelKeys.map((key)=>(0, _pluginsystem.escapeCsvValue)(entry.labels[key] ?? ''));
|
|
67
|
-
return [
|
|
68
|
-
timestamp,
|
|
69
|
-
body,
|
|
70
|
-
...labels
|
|
71
|
-
].join(',');
|
|
72
|
-
});
|
|
73
|
-
return [
|
|
74
|
-
headerRow,
|
|
75
|
-
...dataRows
|
|
76
|
-
].join('\n') + '\n';
|
|
77
|
-
}
|
|
78
|
-
const LogsTableCsvExportAction = ({ queryResults, definition })=>{
|
|
79
|
-
const entries = (0, _react.useMemo)(()=>{
|
|
80
|
-
return queryResults.flatMap((q)=>q.data?.logs?.entries ?? []);
|
|
81
|
-
}, [
|
|
82
|
-
queryResults
|
|
83
|
-
]);
|
|
84
|
-
const isDisabled = !entries.length;
|
|
85
|
-
const handleDownload = (0, _react.useCallback)(()=>{
|
|
86
|
-
if (isDisabled) return;
|
|
87
|
-
try {
|
|
88
|
-
const csvString = buildLogsCsvString(entries);
|
|
89
|
-
const blob = new Blob([
|
|
90
|
-
csvString
|
|
91
|
-
], {
|
|
92
|
-
type: 'text/csv;charset=utf-8'
|
|
93
|
-
});
|
|
94
|
-
const url = URL.createObjectURL(blob);
|
|
95
|
-
const link = document.createElement('a');
|
|
96
|
-
link.href = url;
|
|
97
|
-
const title = definition?.spec?.display?.name || 'Logs Table Data';
|
|
98
|
-
const baseFilename = (0, _pluginsystem.sanitizeFilename)(title);
|
|
99
|
-
link.download = `${baseFilename}_data.csv`;
|
|
100
|
-
document.body.appendChild(link);
|
|
101
|
-
link.click();
|
|
102
|
-
document.body.removeChild(link);
|
|
103
|
-
URL.revokeObjectURL(url);
|
|
104
|
-
} catch (error) {
|
|
105
|
-
console.error('Logs table CSV export failed:', error);
|
|
106
|
-
}
|
|
107
|
-
}, [
|
|
108
|
-
definition,
|
|
109
|
-
entries,
|
|
110
|
-
isDisabled
|
|
111
|
-
]);
|
|
112
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
113
|
-
description: isDisabled ? 'No data to export' : 'Export as CSV',
|
|
114
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
115
|
-
disabled: isDisabled,
|
|
116
|
-
size: "small",
|
|
117
|
-
onClick: handleDownload,
|
|
118
|
-
"aria-label": "Export Logs Table Data as CSV",
|
|
119
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_FileDelimitedOutline.default, {
|
|
120
|
-
fontSize: "inherit"
|
|
121
|
-
})
|
|
122
|
-
})
|
|
123
|
-
});
|
|
124
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
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, "LogsTableExportAction", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return LogsTableExportAction;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _components = require("@perses-dev/components");
|
|
25
|
-
const _material = require("@mui/material");
|
|
26
|
-
const _Download = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Download"));
|
|
27
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
28
|
-
const _react = require("react");
|
|
29
|
-
function _interop_require_default(obj) {
|
|
30
|
-
return obj && obj.__esModule ? obj : {
|
|
31
|
-
default: obj
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const LogsTableExportAction = ({ queryResults, definition })=>{
|
|
35
|
-
const exportedResult = (0, _react.useMemo)(()=>{
|
|
36
|
-
return queryResults.flatMap((q)=>q.data?.logs?.entries ?? []);
|
|
37
|
-
}, [
|
|
38
|
-
queryResults
|
|
39
|
-
]);
|
|
40
|
-
const isDisabled = !exportedResult.length;
|
|
41
|
-
const handleDownload = (0, _react.useCallback)(()=>{
|
|
42
|
-
if (isDisabled) return;
|
|
43
|
-
try {
|
|
44
|
-
const jsonString = JSON.stringify(exportedResult, null, 2);
|
|
45
|
-
const blob = new Blob([
|
|
46
|
-
jsonString
|
|
47
|
-
], {
|
|
48
|
-
type: 'application/json'
|
|
49
|
-
});
|
|
50
|
-
const url = URL.createObjectURL(blob);
|
|
51
|
-
const link = document.createElement('a');
|
|
52
|
-
link.href = url;
|
|
53
|
-
const title = definition?.spec?.display?.name || 'Logs Table Data';
|
|
54
|
-
const baseFilename = (0, _pluginsystem.sanitizeFilename)(title);
|
|
55
|
-
link.download = `${baseFilename}_data.json`;
|
|
56
|
-
document.body.appendChild(link);
|
|
57
|
-
link.click();
|
|
58
|
-
document.body.removeChild(link);
|
|
59
|
-
URL.revokeObjectURL(url);
|
|
60
|
-
} catch (error) {
|
|
61
|
-
console.error('Logs table export failed:', error);
|
|
62
|
-
}
|
|
63
|
-
}, [
|
|
64
|
-
definition,
|
|
65
|
-
exportedResult,
|
|
66
|
-
isDisabled
|
|
67
|
-
]);
|
|
68
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
69
|
-
description: isDisabled ? 'No data to export' : 'Export as JSON',
|
|
70
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
71
|
-
disabled: isDisabled,
|
|
72
|
-
size: "small",
|
|
73
|
-
onClick: handleDownload,
|
|
74
|
-
"aria-label": "Export Logs Table Data as JSON",
|
|
75
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Download.default, {
|
|
76
|
-
fontSize: "inherit"
|
|
77
|
-
})
|
|
78
|
-
})
|
|
79
|
-
});
|
|
80
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
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, "LogsTableItemSelectionActionsEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return LogsTableItemSelectionActionsEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
-
function LogsTableItemSelectionActionsEditor({ value, onChange }) {
|
|
26
|
-
function handleActionsChange(actions) {
|
|
27
|
-
onChange({
|
|
28
|
-
...value,
|
|
29
|
-
actions: actions
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function handleSelectionChange(selection) {
|
|
33
|
-
onChange({
|
|
34
|
-
...value,
|
|
35
|
-
selection: selection
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.ItemSelectionActionsEditor, {
|
|
39
|
-
actionOptions: value.actions,
|
|
40
|
-
onChangeActions: handleActionsChange,
|
|
41
|
-
selectionOptions: value.selection,
|
|
42
|
-
onChangeSelection: handleSelectionChange
|
|
43
|
-
});
|
|
44
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
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, "LogsTablePanel", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return LogsTablePanel;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _material = require("@mui/material");
|
|
25
|
-
const _components = require("@perses-dev/components");
|
|
26
|
-
const _LogsTableComponent = require("./LogsTableComponent");
|
|
27
|
-
function LogsTablePanel(props) {
|
|
28
|
-
const { contentDimensions, queryResults, spec } = props;
|
|
29
|
-
const chartsTheme = (0, _components.useChartsTheme)();
|
|
30
|
-
const contentPadding = chartsTheme.container.padding.default;
|
|
31
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
32
|
-
sx: {
|
|
33
|
-
height: contentDimensions?.height || 0,
|
|
34
|
-
padding: `${contentPadding}px`,
|
|
35
|
-
overflowY: 'scroll'
|
|
36
|
-
},
|
|
37
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_LogsTableComponent.LogsTableComponent, {
|
|
38
|
-
queryResults: queryResults,
|
|
39
|
-
spec: spec
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
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, "LogsTableSettingsEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return LogsTableSettingsEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _components = require("@perses-dev/components");
|
|
25
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
26
|
-
function LogsTableSettingsEditor(props) {
|
|
27
|
-
const { onChange, value } = props;
|
|
28
|
-
const handleLegendChange = (newLegend)=>{
|
|
29
|
-
onChange({
|
|
30
|
-
...value,
|
|
31
|
-
legend: newLegend
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
const handleThresholdsChange = (thresholds)=>{
|
|
35
|
-
onChange({
|
|
36
|
-
...value,
|
|
37
|
-
thresholds
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.OptionsEditorGrid, {
|
|
41
|
-
children: [
|
|
42
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorColumn, {
|
|
43
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.LegendOptionsEditor, {
|
|
44
|
-
value: value.legend,
|
|
45
|
-
onChange: handleLegendChange
|
|
46
|
-
})
|
|
47
|
-
}),
|
|
48
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorColumn, {
|
|
49
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ThresholdsEditor, {
|
|
50
|
-
hideDefault: true,
|
|
51
|
-
thresholds: value.thresholds,
|
|
52
|
-
onChange: handleThresholdsChange
|
|
53
|
-
})
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
});
|
|
57
|
-
}
|
package/lib/cjs/bootstrap.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
18
|
-
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
19
|
-
const _client = /*#__PURE__*/ _interop_require_default(require("react-dom/client"));
|
|
20
|
-
function _interop_require_default(obj) {
|
|
21
|
-
return obj && obj.__esModule ? obj : {
|
|
22
|
-
default: obj
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const root = _client.default.createRoot(document.getElementById('root'));
|
|
26
|
-
root.render(/*#__PURE__*/ (0, _jsxruntime.jsx)(_react.default.StrictMode, {}));
|
|
@@ -1,49 +0,0 @@
|
|
|
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, "EmptyLogsState", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return EmptyLogsState;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
25
|
-
const _material = require("@mui/material");
|
|
26
|
-
function _interop_require_default(obj) {
|
|
27
|
-
return obj && obj.__esModule ? obj : {
|
|
28
|
-
default: obj
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
const EmptyLogsState = ({ message = 'No logs to display' })=>{
|
|
32
|
-
const theme = (0, _material.useTheme)();
|
|
33
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
34
|
-
sx: {
|
|
35
|
-
display: 'flex',
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
justifyContent: 'center',
|
|
38
|
-
height: '200px'
|
|
39
|
-
},
|
|
40
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
41
|
-
variant: "body2",
|
|
42
|
-
sx: {
|
|
43
|
-
color: theme.palette.text.secondary,
|
|
44
|
-
fontSize: '14px'
|
|
45
|
-
},
|
|
46
|
-
children: message
|
|
47
|
-
})
|
|
48
|
-
});
|
|
49
|
-
};
|
|
@@ -1,126 +0,0 @@
|
|
|
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, "LogDetailsTable", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return LogDetailsTable;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
25
|
-
const _material = require("@mui/material");
|
|
26
|
-
require("./ansiColors.css");
|
|
27
|
-
const _ansi = require("../../utils/ansi");
|
|
28
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
29
|
-
if (typeof WeakMap !== "function") return null;
|
|
30
|
-
var cacheBabelInterop = new WeakMap();
|
|
31
|
-
var cacheNodeInterop = new WeakMap();
|
|
32
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
33
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
34
|
-
})(nodeInterop);
|
|
35
|
-
}
|
|
36
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
37
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
38
|
-
return obj;
|
|
39
|
-
}
|
|
40
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
41
|
-
return {
|
|
42
|
-
default: obj
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
46
|
-
if (cache && cache.has(obj)) {
|
|
47
|
-
return cache.get(obj);
|
|
48
|
-
}
|
|
49
|
-
var newObj = {
|
|
50
|
-
__proto__: null
|
|
51
|
-
};
|
|
52
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
53
|
-
for(var key in obj){
|
|
54
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
55
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
56
|
-
if (desc && (desc.get || desc.set)) {
|
|
57
|
-
Object.defineProperty(newObj, key, desc);
|
|
58
|
-
} else {
|
|
59
|
-
newObj[key] = obj[key];
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
newObj.default = obj;
|
|
64
|
-
if (cache) {
|
|
65
|
-
cache.set(obj, newObj);
|
|
66
|
-
}
|
|
67
|
-
return newObj;
|
|
68
|
-
}
|
|
69
|
-
const AnsiValue = ({ value })=>{
|
|
70
|
-
const ansiHtml = (0, _react.useMemo)(()=>(0, _ansi.ansiToSanitizedHtml)(value), [
|
|
71
|
-
value
|
|
72
|
-
]);
|
|
73
|
-
if (ansiHtml) {
|
|
74
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
75
|
-
dangerouslySetInnerHTML: {
|
|
76
|
-
__html: ansiHtml
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
|
81
|
-
children: value
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
const LogDetailsTable = ({ log })=>{
|
|
85
|
-
const theme = (0, _material.useTheme)();
|
|
86
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Table, {
|
|
87
|
-
size: "small",
|
|
88
|
-
sx: {
|
|
89
|
-
border: `1px solid ${theme.palette.divider}`,
|
|
90
|
-
'& .MuiTableCell-root': {
|
|
91
|
-
border: 'none',
|
|
92
|
-
padding: '6px 8px',
|
|
93
|
-
fontSize: '12px'
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableBody, {
|
|
97
|
-
children: Object.entries(log).map(([key, value])=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
98
|
-
sx: {
|
|
99
|
-
'&:hover': {
|
|
100
|
-
backgroundColor: (0, _material.alpha)(theme.palette.action.hover, 0.04)
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
children: [
|
|
104
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
105
|
-
sx: {
|
|
106
|
-
color: theme.palette.text.secondary,
|
|
107
|
-
fontWeight: 500,
|
|
108
|
-
width: '33%'
|
|
109
|
-
},
|
|
110
|
-
children: key
|
|
111
|
-
}),
|
|
112
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
113
|
-
sx: {
|
|
114
|
-
color: theme.palette.text.primary,
|
|
115
|
-
wordBreak: 'break-word',
|
|
116
|
-
width: '67%'
|
|
117
|
-
},
|
|
118
|
-
children: value !== undefined && value !== null && value !== '' ? /*#__PURE__*/ (0, _jsxruntime.jsx)(AnsiValue, {
|
|
119
|
-
value: value
|
|
120
|
-
}) : '--'
|
|
121
|
-
})
|
|
122
|
-
]
|
|
123
|
-
}, key))
|
|
124
|
-
})
|
|
125
|
-
});
|
|
126
|
-
};
|