@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,78 +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 getSeverity () {
25
- return getSeverity;
26
- },
27
- get severityAbbreviations () {
28
- return severityAbbreviations;
29
- }
30
- });
31
- const severityAbbreviations = {
32
- critical: [
33
- 'critical',
34
- 'emerg',
35
- 'fatal',
36
- 'alert',
37
- 'crit'
38
- ],
39
- error: [
40
- 'error',
41
- 'err',
42
- 'eror'
43
- ],
44
- debug: [
45
- 'debug',
46
- 'dbug'
47
- ],
48
- info: [
49
- 'info',
50
- 'inf',
51
- 'information',
52
- 'notice'
53
- ],
54
- trace: [
55
- 'trace'
56
- ],
57
- warning: [
58
- 'warn',
59
- 'warning'
60
- ],
61
- unknown: [
62
- 'unknown'
63
- ],
64
- other: [
65
- ''
66
- ]
67
- };
68
- const getSeverity = (log)=>{
69
- const level = log.labels?.level?.toLowerCase();
70
- if (level) {
71
- for (const [severity, abbreviations] of Object.entries(severityAbbreviations)){
72
- if (abbreviations.some((abbr)=>abbr && level.includes(abbr))) {
73
- return severity;
74
- }
75
- }
76
- }
77
- return 'unknown';
78
- };
package/lib/cjs/env.d.js DELETED
@@ -1,14 +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
- /// <reference types="@rsbuild/core/types" />
14
- "use strict";
@@ -1,39 +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, "getPluginModule", {
18
- enumerable: true,
19
- get: function() {
20
- return getPluginModule;
21
- }
22
- });
23
- const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
24
- function _interop_require_default(obj) {
25
- return obj && obj.__esModule ? obj : {
26
- default: obj
27
- };
28
- }
29
- function getPluginModule() {
30
- const { name, version, perses } = _packagejson.default;
31
- return {
32
- kind: 'PluginModule',
33
- metadata: {
34
- name,
35
- version
36
- },
37
- spec: perses
38
- };
39
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
- function _getRequireWildcardCache(nodeInterop) {
3
- if (typeof WeakMap !== "function") return null;
4
- var cacheBabelInterop = new WeakMap();
5
- var cacheNodeInterop = new WeakMap();
6
- return (_getRequireWildcardCache = function(nodeInterop) {
7
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
8
- })(nodeInterop);
9
- }
10
- function _interop_require_wildcard(obj, nodeInterop) {
11
- if (!nodeInterop && obj && obj.__esModule) {
12
- return obj;
13
- }
14
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
15
- return {
16
- default: obj
17
- };
18
- }
19
- var cache = _getRequireWildcardCache(nodeInterop);
20
- if (cache && cache.has(obj)) {
21
- return cache.get(obj);
22
- }
23
- var newObj = {
24
- __proto__: null
25
- };
26
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
27
- for(var key in obj){
28
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
29
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
30
- if (desc && (desc.get || desc.set)) {
31
- Object.defineProperty(newObj, key, desc);
32
- } else {
33
- newObj[key] = obj[key];
34
- }
35
- }
36
- }
37
- newObj.default = obj;
38
- if (cache) {
39
- cache.set(obj, newObj);
40
- }
41
- return newObj;
42
- }
43
- // Copyright The Perses Authors
44
- // Licensed under the Apache License, Version 2.0 (the "License");
45
- // you may not use this file except in compliance with the License.
46
- // You may obtain a copy of the License at
47
- //
48
- // http://www.apache.org/licenses/LICENSE-2.0
49
- //
50
- // Unless required by applicable law or agreed to in writing, software
51
- // distributed under the License is distributed on an "AS IS" BASIS,
52
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53
- // See the License for the specific language governing permissions and
54
- // limitations under the License.
55
- Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
package/lib/cjs/index.js DELETED
@@ -1,38 +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, "getPluginModule", {
18
- enumerable: true,
19
- get: function() {
20
- return _getPluginModule.getPluginModule;
21
- }
22
- });
23
- const _getPluginModule = require("./getPluginModule");
24
- _export_star(require("./model"), exports);
25
- _export_star(require("./LogsTable"), exports);
26
- function _export_star(from, to) {
27
- Object.keys(from).forEach(function(k) {
28
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
29
- Object.defineProperty(to, k, {
30
- enumerable: true,
31
- get: function() {
32
- return from[k];
33
- }
34
- });
35
- }
36
- });
37
- return from;
38
- }
package/lib/cjs/model.js DELETED
@@ -1,16 +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
- });
@@ -1,19 +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
- require("@testing-library/jest-dom");
18
- // Always mock e-charts during tests since we don't have a proper canvas in jsdom
19
- jest.mock('echarts/core');
@@ -1,133 +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 MOCK_LOGS_QUERY_DEFINITION () {
25
- return MOCK_LOGS_QUERY_DEFINITION;
26
- },
27
- get MOCK_LOGS_QUERY_RESULT () {
28
- return MOCK_LOGS_QUERY_RESULT;
29
- },
30
- get MOCK_LOGS_QUERY_RESULTS () {
31
- return MOCK_LOGS_QUERY_RESULTS;
32
- }
33
- });
34
- const MOCK_LOGS_QUERY_RESULT = {
35
- logs: {
36
- hasMore: false,
37
- timeRange: {
38
- start: new Date(1666625490),
39
- end: new Date(1666625535)
40
- },
41
- entries: [
42
- {
43
- timestamp: 1666625491,
44
- line: 'foo',
45
- labels: {
46
- device: '/dev/vda1',
47
- env: 'demo',
48
- fstype: 'ext4',
49
- instance: 'demo.do.prometheus.io:9100',
50
- job: 'node',
51
- mountpoint: '/'
52
- }
53
- },
54
- {
55
- timestamp: 1666625490,
56
- line: 'bar',
57
- labels: {
58
- device: '/dev/vda15',
59
- env: 'demo',
60
- fstype: 'vfat',
61
- instance: 'demo.do.prometheus.io:9100',
62
- job: 'node',
63
- mountpoint: '/boot/efi'
64
- }
65
- }
66
- ]
67
- }
68
- };
69
- const MOCK_LOGS_QUERY_RESULTS = [
70
- {
71
- logs: {
72
- entries: [
73
- {
74
- timestamp: 1769009811.4465687,
75
- line: '{"host":"120.180.160.121", "user-identifier":"-", "datetime":"21/Jan/2026:15:32:31 +0000", "method": "DELETE", "request": "/killer/pixy", "protocol":"HTTP/2.0", "status":200, "bytes":9821, "referer": "http://www.internationalend-to-end.com/e-business/web services"}',
76
- labels: {
77
- app: 'log-generator',
78
- bytes: '9821',
79
- datetime: '21/Jan/2026:15:32:31 +0000',
80
- detected_level: 'unknown',
81
- filename: '/var/log/fake/fake.log',
82
- host: '120.180.160.121',
83
- method: 'DELETE',
84
- protocol: 'HTTP/2.0',
85
- referer: 'http://www.internationalend-to-end.com/e-business/web services',
86
- request: '/killer/pixy',
87
- service_name: 'log-generator',
88
- status: '200',
89
- user_identifier: '-'
90
- }
91
- }
92
- ],
93
- totalCount: 1
94
- }
95
- },
96
- {
97
- logs: {
98
- entries: [
99
- {
100
- timestamp: 1769009890.5294495,
101
- line: '{"host":"18.178.231.77", "user-identifier":"cormier2584", "datetime":"21/Jan/2026:15:33:49 +0000", "method": "POST", "request": "/facilitate/mesh/methodologies/deploy", "protocol":"HTTP/1.1", "status":503, "bytes":9892, "referer": "http://www.direct.com/holistic"}',
102
- labels: {
103
- app: 'log-generator',
104
- bytes: '9892',
105
- datetime: '21/Jan/2026:15:33:49 +0000',
106
- detected_level: 'unknown',
107
- filename: '/var/log/fake/fake.log',
108
- host: '18.178.231.77',
109
- method: 'POST',
110
- protocol: 'HTTP/1.1',
111
- referer: 'http://www.direct.com/holistic',
112
- request: '/facilitate/mesh/methodologies/deploy',
113
- service_name: 'log-generator',
114
- status: '503',
115
- user_identifier: 'cormier2584'
116
- }
117
- }
118
- ],
119
- totalCount: 1
120
- }
121
- }
122
- ];
123
- const MOCK_LOGS_QUERY_DEFINITION = {
124
- kind: 'LogsQuery',
125
- spec: {
126
- plugin: {
127
- kind: 'LokiLogsQuery',
128
- spec: {
129
- query: ''
130
- }
131
- }
132
- }
133
- };
@@ -1,60 +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 ansiToSanitizedHtml () {
25
- return ansiToSanitizedHtml;
26
- },
27
- get stripAnsi () {
28
- return stripAnsi;
29
- }
30
- });
31
- const _ansi_up = require("ansi_up");
32
- const _dompurify = /*#__PURE__*/ _interop_require_default(require("dompurify"));
33
- function _interop_require_default(obj) {
34
- return obj && obj.__esModule ? obj : {
35
- default: obj
36
- };
37
- }
38
- const ansiUp = new _ansi_up.AnsiUp();
39
- ansiUp.use_classes = true;
40
- const ESC = String.fromCharCode(27);
41
- const ANSI_REGEX = new RegExp(ESC + '\\[[0-9;]*m');
42
- function ansiToSanitizedHtml(text) {
43
- if (!ANSI_REGEX.test(text)) {
44
- return null;
45
- }
46
- const html = ansiUp.ansi_to_html(text);
47
- return _dompurify.default.sanitize(html, {
48
- ALLOWED_TAGS: [
49
- 'span'
50
- ],
51
- ALLOWED_ATTR: [
52
- 'class',
53
- 'style'
54
- ]
55
- });
56
- }
57
- const ANSI_STRIP_REGEX = new RegExp(ESC + '\\[[0-9;]*m', 'g');
58
- function stripAnsi(text) {
59
- return text.replace(ANSI_STRIP_REGEX, '');
60
- }
@@ -1,72 +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 formatLabels () {
25
- return formatLabels;
26
- },
27
- get formatLogAsJson () {
28
- return formatLogAsJson;
29
- },
30
- get formatLogEntries () {
31
- return formatLogEntries;
32
- },
33
- get formatLogEntry () {
34
- return formatLogEntry;
35
- },
36
- get formatLogMessage () {
37
- return formatLogMessage;
38
- },
39
- get formatTimestamp () {
40
- return formatTimestamp;
41
- }
42
- });
43
- const _ansi = require("./ansi");
44
- function formatTimestamp(timestamp) {
45
- const date = typeof timestamp === 'number' ? new Date(timestamp * 1000) : parseTimestamp(timestamp);
46
- return date.toISOString();
47
- }
48
- /**
49
- * Parses a timestamp string to a Date object
50
- */ function parseTimestamp(timestamp) {
51
- return /^\d+$/.test(timestamp) ? new Date(parseInt(timestamp) * 1000) : new Date(Date.parse(timestamp));
52
- }
53
- function formatLabels(labels) {
54
- const entries = Object.entries(labels);
55
- if (entries.length === 0) return '';
56
- return entries.map(([key, value])=>`${key}="${value}"`).join(' ');
57
- }
58
- function formatLogEntry(log) {
59
- const timestamp = formatTimestamp(log.timestamp);
60
- const labels = formatLabels(log.labels || {});
61
- const cleanLine = (0, _ansi.stripAnsi)(log.line);
62
- return labels ? `${timestamp} ${labels} ${cleanLine}` : `${timestamp} ${cleanLine}`;
63
- }
64
- function formatLogMessage(log) {
65
- return (0, _ansi.stripAnsi)(log.line);
66
- }
67
- function formatLogAsJson(log) {
68
- return JSON.stringify(log, null, 2);
69
- }
70
- function formatLogEntries(logs) {
71
- return logs.map(formatLogEntry).join('\n');
72
- }