@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,421 +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, "LogRow", {
18
- enumerable: true,
19
- get: function() {
20
- return LogRow;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _material = require("@mui/material");
25
- const _Check = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Check"));
26
- const _ChevronDown = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronDown"));
27
- const _ChevronRight = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronRight"));
28
- const _CodeJson = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/CodeJson"));
29
- const _ContentCopy = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ContentCopy"));
30
- const _FormatQuoteClose = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/FormatQuoteClose"));
31
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
32
- const _ansi = require("../../utils/ansi");
33
- const _copyHelpers = require("../../utils/copyHelpers");
34
- const _useSeverity = require("../hooks/useSeverity");
35
- const _LogDetailsTable = require("./LogDetailsTable");
36
- const _LogTimestamp = require("./LogTimestamp");
37
- const _LogsStyles = require("./LogsStyles");
38
- require("./ansiColors.css");
39
- function _interop_require_default(obj) {
40
- return obj && obj.__esModule ? obj : {
41
- default: obj
42
- };
43
- }
44
- function _getRequireWildcardCache(nodeInterop) {
45
- if (typeof WeakMap !== "function") return null;
46
- var cacheBabelInterop = new WeakMap();
47
- var cacheNodeInterop = new WeakMap();
48
- return (_getRequireWildcardCache = function(nodeInterop) {
49
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
50
- })(nodeInterop);
51
- }
52
- function _interop_require_wildcard(obj, nodeInterop) {
53
- if (!nodeInterop && obj && obj.__esModule) {
54
- return obj;
55
- }
56
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
57
- return {
58
- default: obj
59
- };
60
- }
61
- var cache = _getRequireWildcardCache(nodeInterop);
62
- if (cache && cache.has(obj)) {
63
- return cache.get(obj);
64
- }
65
- var newObj = {
66
- __proto__: null
67
- };
68
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
69
- for(var key in obj){
70
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
71
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
72
- if (desc && (desc.get || desc.set)) {
73
- Object.defineProperty(newObj, key, desc);
74
- } else {
75
- newObj[key] = obj[key];
76
- }
77
- }
78
- }
79
- newObj.default = obj;
80
- if (cache) {
81
- cache.set(obj, newObj);
82
- }
83
- return newObj;
84
- }
85
- const COPY_SUCCESS_DURATION_MS = 1500;
86
- const DefaultLogRow = ({ log, isExpanded, index, onToggle, isExpandable = true, showTime = false, allowWrap = false, isSelected = false, onSelect, itemActionButtons })=>{
87
- const theme = (0, _material.useTheme)();
88
- const severityColor = (0, _useSeverity.useSeverityColor)(log);
89
- const ansiHtml = (0, _react.useMemo)(()=>log ? (0, _ansi.ansiToSanitizedHtml)(log.line) : null, [
90
- log
91
- ]);
92
- const [isHovered, setIsHovered] = (0, _react.useState)(false);
93
- const [anchorEl, setAnchorEl] = (0, _react.useState)(null);
94
- const [copySuccess, setCopySuccess] = (0, _react.useState)(false);
95
- const rowRef = (0, _react.useRef)(null);
96
- const copyTimeoutRef = (0, _react.useRef)(null);
97
- // Cleanup timeout on unmount
98
- (0, _react.useEffect)(()=>{
99
- return ()=>{
100
- if (copyTimeoutRef.current) {
101
- window.clearTimeout(copyTimeoutRef.current);
102
- }
103
- };
104
- }, []);
105
- const handleToggle = (0, _react.useCallback)((e)=>{
106
- if (isExpandable) {
107
- e.stopPropagation();
108
- onToggle(index);
109
- }
110
- }, [
111
- isExpandable,
112
- onToggle,
113
- index
114
- ]);
115
- const handleRowMouseDown = (0, _react.useCallback)((e)=>{
116
- if (onSelect) {
117
- onSelect(index, e);
118
- }
119
- }, [
120
- onSelect,
121
- index
122
- ]);
123
- const handleOpenMenu = (0, _react.useCallback)((e)=>{
124
- e.stopPropagation();
125
- setAnchorEl(e.currentTarget);
126
- }, []);
127
- const handleCloseMenu = (0, _react.useCallback)(()=>{
128
- setAnchorEl(null);
129
- setIsHovered(false);
130
- }, []);
131
- const handleCopy = (0, _react.useCallback)(async (format)=>{
132
- if (!log) return;
133
- let text;
134
- switch(format){
135
- case 'message':
136
- text = (0, _copyHelpers.formatLogMessage)(log);
137
- break;
138
- case 'json':
139
- text = (0, _copyHelpers.formatLogAsJson)(log);
140
- break;
141
- case 'full':
142
- default:
143
- text = (0, _copyHelpers.formatLogEntry)(log);
144
- }
145
- await navigator.clipboard.writeText(text);
146
- setCopySuccess(true);
147
- handleCloseMenu();
148
- // Clear existing timeout
149
- if (copyTimeoutRef.current) {
150
- window.clearTimeout(copyTimeoutRef.current);
151
- }
152
- // Reset success state after configured duration
153
- copyTimeoutRef.current = window.setTimeout(()=>{
154
- setCopySuccess(false);
155
- }, COPY_SUCCESS_DURATION_MS);
156
- }, [
157
- log,
158
- handleCloseMenu
159
- ]);
160
- if (!log) return null;
161
- const hasRowActions = itemActionButtons && itemActionButtons.length > 0;
162
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_LogsStyles.LogRowContainer, {
163
- severityColor: severityColor,
164
- ref: rowRef,
165
- onMouseEnter: ()=>setIsHovered(true),
166
- onMouseLeave: ()=>{
167
- if (!anchorEl) {
168
- setIsHovered(false);
169
- }
170
- },
171
- "data-log-index": index,
172
- "data-testid": `log-row-container-${index}`,
173
- children: [
174
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_LogsStyles.LogRowContent, {
175
- onMouseDown: handleRowMouseDown,
176
- isExpandable: isExpandable,
177
- isHighlighted: Boolean(anchorEl),
178
- hasRowActions: hasRowActions,
179
- isSelected: isSelected,
180
- children: [
181
- isExpandable && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
182
- onClick: handleToggle,
183
- sx: {
184
- display: 'flex',
185
- alignItems: 'center',
186
- width: '16px',
187
- justifyContent: 'center',
188
- cursor: 'pointer'
189
- },
190
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_LogsStyles.ExpandButton, {
191
- size: "small",
192
- isExpanded: isExpanded,
193
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronRight.default, {
194
- sx: {
195
- fontSize: '12px'
196
- }
197
- })
198
- })
199
- }),
200
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_LogTimestamp.LogTimestamp, {
201
- timestamp: log.timestamp
202
- }),
203
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
204
- sx: {
205
- display: 'flex',
206
- gap: '10px',
207
- marginLeft: '36px',
208
- alignItems: 'center'
209
- },
210
- children: [
211
- ansiHtml ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_LogsStyles.LogText, {
212
- variant: "body2",
213
- allowWrap: allowWrap,
214
- dangerouslySetInnerHTML: {
215
- __html: ansiHtml
216
- }
217
- }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_LogsStyles.LogText, {
218
- variant: "body2",
219
- allowWrap: allowWrap,
220
- children: log.line
221
- }),
222
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tooltip, {
223
- title: copySuccess ? 'Copied!' : 'Copy options',
224
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
225
- size: "small",
226
- onClick: handleOpenMenu,
227
- "aria-label": "Copy log options",
228
- sx: {
229
- padding: '4px',
230
- marginLeft: 'auto',
231
- color: copySuccess ? theme.palette.success.main : theme.palette.text.secondary,
232
- opacity: isHovered || Boolean(anchorEl) || copySuccess ? 1 : 0,
233
- pointerEvents: isHovered || Boolean(anchorEl) || copySuccess ? 'auto' : 'none',
234
- transition: 'opacity 0.08s ease, color 0.2s ease',
235
- '&:hover': {
236
- color: copySuccess ? theme.palette.success.main : theme.palette.primary.main,
237
- backgroundColor: theme.palette.action.hover
238
- },
239
- borderRadius: '4px',
240
- display: 'flex',
241
- gap: '2px'
242
- },
243
- children: copySuccess ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Check.default, {
244
- sx: {
245
- fontSize: '14px'
246
- }
247
- }) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
248
- children: [
249
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_ContentCopy.default, {
250
- sx: {
251
- fontSize: '14px'
252
- }
253
- }),
254
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronDown.default, {
255
- sx: {
256
- fontSize: '12px'
257
- }
258
- })
259
- ]
260
- })
261
- })
262
- }),
263
- hasRowActions && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
264
- sx: {
265
- display: 'flex',
266
- gap: '4px',
267
- alignItems: 'center',
268
- opacity: isHovered || Boolean(anchorEl) ? 1 : 0,
269
- pointerEvents: isHovered || Boolean(anchorEl) ? 'auto' : 'none',
270
- transition: 'opacity 0.08s ease'
271
- },
272
- children: itemActionButtons
273
- }),
274
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Menu, {
275
- anchorEl: anchorEl,
276
- open: Boolean(anchorEl),
277
- onClose: handleCloseMenu,
278
- onClick: (e)=>e.stopPropagation(),
279
- "aria-label": "Copy format options",
280
- anchorOrigin: {
281
- vertical: 'bottom',
282
- horizontal: 'right'
283
- },
284
- transformOrigin: {
285
- vertical: 'top',
286
- horizontal: 'right'
287
- },
288
- slotProps: {
289
- paper: {
290
- sx: {
291
- mt: 0.5,
292
- minWidth: 180,
293
- boxShadow: theme.shadows[3]
294
- }
295
- }
296
- },
297
- children: [
298
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.MenuItem, {
299
- onClick: ()=>handleCopy('full'),
300
- sx: {
301
- py: 1,
302
- '&:hover': {
303
- backgroundColor: theme.palette.action.hover
304
- }
305
- },
306
- children: [
307
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItemIcon, {
308
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ContentCopy.default, {
309
- fontSize: "small"
310
- })
311
- }),
312
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItemText, {
313
- primary: "Copy log",
314
- secondary: "Timestamp + labels + message",
315
- slotProps: {
316
- primary: {
317
- fontSize: '14px'
318
- },
319
- secondary: {
320
- fontSize: '11px'
321
- }
322
- }
323
- })
324
- ]
325
- }),
326
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.MenuItem, {
327
- onClick: ()=>handleCopy('message'),
328
- sx: {
329
- py: 1,
330
- '&:hover': {
331
- backgroundColor: theme.palette.action.hover
332
- }
333
- },
334
- children: [
335
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItemIcon, {
336
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_FormatQuoteClose.default, {
337
- fontSize: "small"
338
- })
339
- }),
340
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItemText, {
341
- primary: "Copy message",
342
- secondary: "Message text only",
343
- slotProps: {
344
- primary: {
345
- fontSize: '14px'
346
- },
347
- secondary: {
348
- fontSize: '11px'
349
- }
350
- }
351
- })
352
- ]
353
- }),
354
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.MenuItem, {
355
- onClick: ()=>handleCopy('json'),
356
- sx: {
357
- py: 1,
358
- '&:hover': {
359
- backgroundColor: theme.palette.action.hover
360
- }
361
- },
362
- children: [
363
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItemIcon, {
364
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_CodeJson.default, {
365
- fontSize: "small"
366
- })
367
- }),
368
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItemText, {
369
- primary: "Copy as JSON",
370
- secondary: "Full log entry",
371
- slotProps: {
372
- primary: {
373
- fontSize: '14px'
374
- },
375
- secondary: {
376
- fontSize: '11px'
377
- }
378
- }
379
- })
380
- ]
381
- })
382
- ]
383
- })
384
- ]
385
- })
386
- ]
387
- }),
388
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Collapse, {
389
- in: isExpanded,
390
- timeout: 200,
391
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
392
- sx: {
393
- padding: '8px'
394
- },
395
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
396
- sx: {
397
- display: 'grid',
398
- gridTemplateColumns: !showTime ? '1fr' : '8px minmax(160px, max-content) 1fr',
399
- gap: '12px'
400
- },
401
- children: [
402
- showTime && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
403
- children: [
404
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {}),
405
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {})
406
- ]
407
- }),
408
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
409
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_LogDetailsTable.LogDetailsTable, {
410
- log: log.labels
411
- })
412
- })
413
- ]
414
- })
415
- })
416
- })
417
- ]
418
- });
419
- };
420
- const LogRow = /*#__PURE__*/ (0, _react.memo)(DefaultLogRow);
421
- LogRow.displayName = 'LogRow';
@@ -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, "LogTimestamp", {
18
- enumerable: true,
19
- get: function() {
20
- return LogTimestamp;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
25
- function _interop_require_default(obj) {
26
- return obj && obj.__esModule ? obj : {
27
- default: obj
28
- };
29
- }
30
- const dateFromStr = (timestamp)=>{
31
- return /^\d+$/.test(timestamp) ? new Date(parseInt(timestamp) * 1000) : new Date(Date.parse(timestamp));
32
- };
33
- const LogTimestamp = ({ timestamp })=>{
34
- const date = typeof timestamp === 'number' ? new Date(timestamp * 1000) : dateFromStr(timestamp);
35
- return /*#__PURE__*/ (0, _jsxruntime.jsx)("time", {
36
- style: {
37
- fontSize: '12px',
38
- whiteSpace: 'nowrap',
39
- minWidth: 'max-content'
40
- },
41
- dateTime: date.toISOString(),
42
- children: date.toISOString()
43
- });
44
- };
@@ -1,87 +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 ExpandButton () {
25
- return ExpandButton;
26
- },
27
- get LogRowContainer () {
28
- return LogRowContainer;
29
- },
30
- get LogRowContent () {
31
- return LogRowContent;
32
- },
33
- get LogText () {
34
- return LogText;
35
- }
36
- });
37
- const _material = require("@mui/material");
38
- const LogRowContainer = (0, _material.styled)(_material.Box, {
39
- shouldForwardProp: (prop)=>prop !== 'severityColor'
40
- })(({ severityColor })=>({
41
- borderLeft: `4px solid ${severityColor}`,
42
- transition: 'all 0.2s ease',
43
- marginBottom: '4px',
44
- fontFamily: '"DejaVu Sans Mono", monospace',
45
- userSelect: 'text'
46
- }));
47
- const LogRowContent = (0, _material.styled)(_material.Box, {
48
- shouldForwardProp: (prop)=>prop !== 'isExpandable' && prop !== 'isHighlighted' && prop !== 'isSelected' && prop !== 'hasRowActions'
49
- })(({ theme, isExpandable, isHighlighted, isSelected, hasRowActions })=>({
50
- display: 'grid',
51
- gridTemplateColumns: isExpandable ? `16px minmax(160px, max-content) 1fr ${hasRowActions ? 'min-content' : ''}` : `minmax(160px, max-content) 1fr ${hasRowActions ? 'min-content' : ''}`,
52
- alignItems: 'flex-start',
53
- padding: '4px 8px',
54
- cursor: 'default',
55
- gap: '12px',
56
- backgroundColor: isHighlighted ? theme.palette.action.hover : isSelected ? theme.palette.action.selected : 'transparent',
57
- '&:hover': {
58
- backgroundColor: isSelected ? theme.palette.action.focus : theme.palette.action.hover
59
- }
60
- }));
61
- const ExpandButton = (0, _material.styled)(_material.IconButton, {
62
- shouldForwardProp: (prop)=>prop !== 'isExpanded'
63
- })(({ theme, isExpanded })=>({
64
- padding: 0,
65
- width: '16px',
66
- height: '16px',
67
- color: theme.palette.text.secondary,
68
- transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
69
- transition: 'transform 0.2s ease'
70
- }));
71
- const LogText = (0, _material.styled)(_material.Typography, {
72
- shouldForwardProp: (prop)=>prop !== 'allowWrap'
73
- })(({ allowWrap })=>({
74
- fontSize: '12px',
75
- flex: 1,
76
- lineHeight: 1.4,
77
- textAlign: 'left',
78
- ...allowWrap ? {
79
- wordBreak: 'break-word',
80
- whiteSpace: 'pre-wrap',
81
- overflow: 'visible',
82
- textOverflow: 'unset'
83
- } : {
84
- wordBreak: 'normal',
85
- whiteSpace: 'nowrap'
86
- }
87
- }));
@@ -1,37 +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, "LogRow", {
18
- enumerable: true,
19
- get: function() {
20
- return _LogRow.LogRow;
21
- }
22
- });
23
- const _LogRow = require("./LogRow");
24
- _export_star(require("./LogsStyles"), exports);
25
- function _export_star(from, to) {
26
- Object.keys(from).forEach(function(k) {
27
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
28
- Object.defineProperty(to, k, {
29
- enumerable: true,
30
- get: function() {
31
- return from[k];
32
- }
33
- });
34
- }
35
- });
36
- return from;
37
- }
@@ -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, "LogsList", {
18
- enumerable: true,
19
- get: function() {
20
- return LogsList;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
25
- const _EmptyLogsState = require("./EmptyLogsState");
26
- const _useExpandedRows = require("./hooks/useExpandedRows");
27
- const _VirtualizedLogsList = require("./VirtualizedLogsList");
28
- function _interop_require_default(obj) {
29
- return obj && obj.__esModule ? obj : {
30
- default: obj
31
- };
32
- }
33
- const LogsList = ({ logs, spec })=>{
34
- const { expandedRows, toggleExpand } = (0, _useExpandedRows.useExpandedRows)();
35
- if (!logs.length) {
36
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_EmptyLogsState.EmptyLogsState, {});
37
- }
38
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_VirtualizedLogsList.VirtualizedLogsList, {
39
- logs: logs,
40
- spec: spec,
41
- expandedRows: expandedRows,
42
- onToggleExpand: toggleExpand
43
- });
44
- };