@perses-dev/logs-table-plugin 0.3.0 → 0.4.0-beta.2

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.
Files changed (205) hide show
  1. package/__mf/js/{LogsTable.f8cdc769.js → LogsTable.35f3dd46.js} +4 -4
  2. package/__mf/js/async/1432.fd6f8f2d.js +1 -0
  3. package/__mf/js/async/1616.eaaab35b.js +1 -0
  4. package/__mf/js/async/2043.8640face.js +2 -0
  5. package/__mf/js/async/243.74fe18c2.js +7 -0
  6. package/__mf/js/async/{8964.3e308de6.js.LICENSE.txt → 243.74fe18c2.js.LICENSE.txt} +41 -1
  7. package/__mf/js/async/{7445.009cf084.js → 3358.3c58ea5d.js} +8 -7
  8. package/__mf/js/async/392.8a5ab35e.js +2 -0
  9. package/__mf/js/async/3923.28684442.js +1 -0
  10. package/__mf/js/async/4077.178e3667.js +1 -0
  11. package/__mf/js/async/4121.0697bd8d.js +2 -0
  12. package/__mf/js/async/4141.5ccc905c.js +1 -0
  13. package/__mf/js/async/4496.0969f981.js +1 -0
  14. package/__mf/js/async/5002.98a39aa5.js +1 -0
  15. package/__mf/js/async/5010.d8f61123.js +1 -0
  16. package/__mf/js/async/5071.6e41eb5f.js +1 -0
  17. package/__mf/js/async/5587.cc780fc9.js +1 -0
  18. package/__mf/js/async/6157.66cd45ff.js +3 -0
  19. package/__mf/js/async/6205.4ac15eb5.js +1 -0
  20. package/__mf/js/async/6274.f93e4970.js +2 -0
  21. package/__mf/js/async/6458.c4aa26e7.js +1 -0
  22. package/__mf/js/async/6522.38816ee5.js +1 -0
  23. package/__mf/js/async/6802.e639baa6.js +1 -0
  24. package/__mf/js/async/7192.10e7ccf4.js +1 -0
  25. package/__mf/js/async/7633.4f097f9e.js +2 -0
  26. package/__mf/js/async/7705.ec6af857.js +22 -0
  27. package/__mf/js/async/7968.5fe4ec6a.js +1 -0
  28. package/__mf/js/async/7978.c3e990e8.js +1 -0
  29. package/__mf/js/async/8356.9aa70ee5.js +1 -0
  30. package/__mf/js/async/8470.f1ab476a.js +2 -0
  31. package/__mf/js/async/8608.090c4c59.js +1 -0
  32. package/__mf/js/async/8634.9f5cc5a4.js +2 -0
  33. package/__mf/js/async/873.ade4d4ea.js +1 -0
  34. package/__mf/js/async/8985.93a284c8.js +37 -0
  35. package/__mf/js/async/9148.a2c07101.js +1 -0
  36. package/__mf/js/async/9235.15674367.js +1 -0
  37. package/__mf/js/async/941.a9e7a00e.js +2 -0
  38. package/__mf/js/async/9588.dd41b58d.js +1 -0
  39. package/__mf/js/async/__federation_expose_LogsTable.da2aa607.js +1 -0
  40. package/__mf/js/async/lib-router.e3526b78.js +2 -0
  41. package/__mf/js/{main.4253925a.js → main.02081756.js} +3 -3
  42. package/lib/LogsTable.d.ts +2 -2
  43. package/lib/LogsTable.d.ts.map +1 -1
  44. package/lib/LogsTable.js +5 -5
  45. package/lib/LogsTable.js.map +1 -1
  46. package/lib/LogsTableComponent.d.ts +2 -2
  47. package/lib/LogsTableComponent.d.ts.map +1 -1
  48. package/lib/LogsTableComponent.js +4 -4
  49. package/lib/LogsTableComponent.js.map +1 -1
  50. package/lib/LogsTableCsvExportAction.d.ts +2 -2
  51. package/lib/LogsTableCsvExportAction.d.ts.map +1 -1
  52. package/lib/LogsTableCsvExportAction.js +7 -7
  53. package/lib/LogsTableCsvExportAction.js.map +1 -1
  54. package/lib/LogsTableExportAction.d.ts +1 -1
  55. package/lib/LogsTableExportAction.d.ts.map +1 -1
  56. package/lib/LogsTableExportAction.js +5 -5
  57. package/lib/LogsTableExportAction.js.map +1 -1
  58. package/lib/LogsTableItemSelectionActionsEditor.d.ts +2 -2
  59. package/lib/LogsTableItemSelectionActionsEditor.d.ts.map +1 -1
  60. package/lib/LogsTableItemSelectionActionsEditor.js +2 -2
  61. package/lib/LogsTableItemSelectionActionsEditor.js.map +1 -1
  62. package/lib/LogsTablePanel.d.ts +2 -2
  63. package/lib/LogsTablePanel.d.ts.map +1 -1
  64. package/lib/LogsTablePanel.js +3 -3
  65. package/lib/LogsTablePanel.js.map +1 -1
  66. package/lib/LogsTableSettingsEditor.d.ts +3 -3
  67. package/lib/LogsTableSettingsEditor.d.ts.map +1 -1
  68. package/lib/LogsTableSettingsEditor.js +3 -3
  69. package/lib/LogsTableSettingsEditor.js.map +1 -1
  70. package/lib/bootstrap.js +2 -2
  71. package/lib/components/EmptyLogsState.d.ts.map +1 -1
  72. package/lib/components/EmptyLogsState.js +2 -2
  73. package/lib/components/EmptyLogsState.js.map +1 -1
  74. package/lib/components/LogRow/LogDetailsTable.d.ts +2 -2
  75. package/lib/components/LogRow/LogDetailsTable.d.ts.map +1 -1
  76. package/lib/components/LogRow/LogDetailsTable.js +4 -4
  77. package/lib/components/LogRow/LogDetailsTable.js.map +1 -1
  78. package/lib/components/LogRow/LogRow.d.ts +3 -2
  79. package/lib/components/LogRow/LogRow.d.ts.map +1 -1
  80. package/lib/components/LogRow/LogRow.js +15 -15
  81. package/lib/components/LogRow/LogRow.js.map +1 -1
  82. package/lib/components/LogRow/LogTimestamp.js +1 -1
  83. package/lib/components/LogRow/LogsStyles.d.ts.map +1 -1
  84. package/lib/components/LogRow/LogsStyles.js +2 -2
  85. package/lib/components/LogRow/LogsStyles.js.map +1 -1
  86. package/lib/components/LogRow/index.js +2 -2
  87. package/lib/components/LogRow/index.js.map +1 -1
  88. package/lib/components/LogsList.d.ts +2 -2
  89. package/lib/components/LogsList.d.ts.map +1 -1
  90. package/lib/components/LogsList.js +5 -5
  91. package/lib/components/LogsList.js.map +1 -1
  92. package/lib/components/VirtualizedLogsList.d.ts +2 -2
  93. package/lib/components/VirtualizedLogsList.d.ts.map +1 -1
  94. package/lib/components/VirtualizedLogsList.js +18 -13
  95. package/lib/components/VirtualizedLogsList.js.map +1 -1
  96. package/lib/components/hooks/useExpandedRows.js +1 -1
  97. package/lib/components/hooks/useSeverity.d.ts +1 -1
  98. package/lib/components/hooks/useSeverity.d.ts.map +1 -1
  99. package/lib/components/hooks/useSeverity.js +2 -2
  100. package/lib/components/hooks/useSeverity.js.map +1 -1
  101. package/lib/components/utils.d.ts +1 -1
  102. package/lib/components/utils.d.ts.map +1 -1
  103. package/lib/components/utils.js.map +1 -1
  104. package/lib/getPluginModule.d.ts +1 -1
  105. package/lib/getPluginModule.d.ts.map +1 -1
  106. package/lib/getPluginModule.js +3 -1
  107. package/lib/getPluginModule.js.map +1 -1
  108. package/lib/index-federation.js +1 -1
  109. package/lib/index.js +3 -3
  110. package/lib/index.js.map +1 -1
  111. package/lib/model.d.ts +3 -3
  112. package/lib/model.d.ts.map +1 -1
  113. package/lib/model.js.map +1 -1
  114. package/lib/setup-tests.d.ts +1 -1
  115. package/lib/setup-tests.d.ts.map +1 -1
  116. package/lib/setup-tests.js +2 -2
  117. package/lib/setup-tests.js.map +1 -1
  118. package/lib/test/mock-query-results.d.ts +1 -1
  119. package/lib/test/mock-query-results.d.ts.map +1 -1
  120. package/lib/test/mock-query-results.js.map +1 -1
  121. package/lib/utils/ansi.js +2 -2
  122. package/lib/utils/copyHelpers.d.ts +1 -1
  123. package/lib/utils/copyHelpers.d.ts.map +1 -1
  124. package/lib/utils/copyHelpers.js +1 -1
  125. package/lib/utils/copyHelpers.js.map +1 -1
  126. package/mf-manifest.json +48 -48
  127. package/mf-stats.json +48 -48
  128. package/package.json +11 -11
  129. package/__mf/js/async/1603.89bfb1ad.js +0 -2
  130. package/__mf/js/async/1616.c3be409a.js +0 -1
  131. package/__mf/js/async/2043.dba84aa4.js +0 -2
  132. package/__mf/js/async/2546.6b3aab40.js +0 -3
  133. package/__mf/js/async/2842.610cb74b.js +0 -1
  134. package/__mf/js/async/304.21c30c64.js +0 -37
  135. package/__mf/js/async/3332.ab0338e8.js +0 -7
  136. package/__mf/js/async/3332.ab0338e8.js.LICENSE.txt +0 -39
  137. package/__mf/js/async/392.5cb44640.js +0 -2
  138. package/__mf/js/async/4077.32e3919d.js +0 -1
  139. package/__mf/js/async/4121.d4c9b3e3.js +0 -2
  140. package/__mf/js/async/4869.80345aa7.js +0 -1
  141. package/__mf/js/async/5002.1d6e3559.js +0 -1
  142. package/__mf/js/async/5071.be3352f1.js +0 -1
  143. package/__mf/js/async/5587.9e49a823.js +0 -1
  144. package/__mf/js/async/6274.fe68ed99.js +0 -2
  145. package/__mf/js/async/6458.de33906b.js +0 -1
  146. package/__mf/js/async/7177.8dd90707.js +0 -1
  147. package/__mf/js/async/7192.017cbe40.js +0 -1
  148. package/__mf/js/async/7250.05494519.js +0 -1
  149. package/__mf/js/async/7413.c2661694.js +0 -1
  150. package/__mf/js/async/7968.ec249f6f.js +0 -1
  151. package/__mf/js/async/7978.026a8b19.js +0 -1
  152. package/__mf/js/async/8356.f736e620.js +0 -1
  153. package/__mf/js/async/8470.f0bbed7d.js +0 -2
  154. package/__mf/js/async/8542.aa0c5fe3.js +0 -1
  155. package/__mf/js/async/8608.618e49dc.js +0 -1
  156. package/__mf/js/async/8634.231e1601.js +0 -2
  157. package/__mf/js/async/873.4fd8a061.js +0 -1
  158. package/__mf/js/async/8964.3e308de6.js +0 -2
  159. package/__mf/js/async/9126.a313fc37.js +0 -22
  160. package/__mf/js/async/9235.b68f4586.js +0 -1
  161. package/__mf/js/async/9293.ee3265d4.js +0 -2
  162. package/__mf/js/async/941.ad1062bb.js +0 -2
  163. package/__mf/js/async/9588.b214b983.js +0 -1
  164. package/__mf/js/async/__federation_expose_LogsTable.e6a243de.js +0 -1
  165. package/__mf/js/async/lib-router.c5e3aef3.js +0 -2
  166. package/lib/cjs/LogsTable.js +0 -58
  167. package/lib/cjs/LogsTableComponent.js +0 -47
  168. package/lib/cjs/LogsTableCsvExportAction.js +0 -124
  169. package/lib/cjs/LogsTableExportAction.js +0 -80
  170. package/lib/cjs/LogsTableItemSelectionActionsEditor.js +0 -44
  171. package/lib/cjs/LogsTablePanel.js +0 -42
  172. package/lib/cjs/LogsTableSettingsEditor.js +0 -57
  173. package/lib/cjs/bootstrap.js +0 -26
  174. package/lib/cjs/components/EmptyLogsState.js +0 -49
  175. package/lib/cjs/components/LogRow/LogDetailsTable.js +0 -126
  176. package/lib/cjs/components/LogRow/LogRow.js +0 -421
  177. package/lib/cjs/components/LogRow/LogTimestamp.js +0 -44
  178. package/lib/cjs/components/LogRow/LogsStyles.js +0 -87
  179. package/lib/cjs/components/LogRow/index.js +0 -37
  180. package/lib/cjs/components/LogsList.js +0 -44
  181. package/lib/cjs/components/VirtualizedLogsList.js +0 -547
  182. package/lib/cjs/components/hooks/useExpandedRows.js +0 -45
  183. package/lib/cjs/components/hooks/useSeverity.js +0 -47
  184. package/lib/cjs/components/utils.js +0 -78
  185. package/lib/cjs/env.d.js +0 -14
  186. package/lib/cjs/getPluginModule.js +0 -39
  187. package/lib/cjs/index-federation.js +0 -55
  188. package/lib/cjs/index.js +0 -38
  189. package/lib/cjs/model.js +0 -16
  190. package/lib/cjs/setup-tests.js +0 -19
  191. package/lib/cjs/test/mock-query-results.js +0 -133
  192. package/lib/cjs/utils/ansi.js +0 -60
  193. package/lib/cjs/utils/copyHelpers.js +0 -72
  194. /package/__mf/css/async/{3332.85c2cbf6.css → 243.85c2cbf6.css} +0 -0
  195. /package/__mf/js/async/{2043.dba84aa4.js.LICENSE.txt → 2043.8640face.js.LICENSE.txt} +0 -0
  196. /package/__mf/js/async/{7445.009cf084.js.LICENSE.txt → 3358.3c58ea5d.js.LICENSE.txt} +0 -0
  197. /package/__mf/js/async/{392.5cb44640.js.LICENSE.txt → 392.8a5ab35e.js.LICENSE.txt} +0 -0
  198. /package/__mf/js/async/{4121.d4c9b3e3.js.LICENSE.txt → 4121.0697bd8d.js.LICENSE.txt} +0 -0
  199. /package/__mf/js/async/{6274.fe68ed99.js.LICENSE.txt → 6274.f93e4970.js.LICENSE.txt} +0 -0
  200. /package/__mf/js/async/{1603.89bfb1ad.js.LICENSE.txt → 7633.4f097f9e.js.LICENSE.txt} +0 -0
  201. /package/__mf/js/async/{9126.a313fc37.js.LICENSE.txt → 7705.ec6af857.js.LICENSE.txt} +0 -0
  202. /package/__mf/js/async/{8470.f0bbed7d.js.LICENSE.txt → 8470.f1ab476a.js.LICENSE.txt} +0 -0
  203. /package/__mf/js/async/{8634.231e1601.js.LICENSE.txt → 8634.9f5cc5a4.js.LICENSE.txt} +0 -0
  204. /package/__mf/js/async/{941.ad1062bb.js.LICENSE.txt → 941.a9e7a00e.js.LICENSE.txt} +0 -0
  205. /package/__mf/js/async/{lib-router.c5e3aef3.js.LICENSE.txt → lib-router.e3526b78.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
- }
@@ -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
- };