@perses-dev/loki-plugin 0.1.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/css/async/1580.d3010b86.css +1 -0
- package/__mf/css/async/2341.d3010b86.css +1 -0
- package/__mf/css/async/6759.d3010b86.css +1 -0
- package/__mf/js/{Loki.3789d265.js → Loki.2f631825.js} +4 -4
- package/__mf/js/async/1360.2348e2a7.js +10 -0
- package/__mf/js/async/1580.c7d3c3f1.js +2 -0
- package/__mf/js/async/2178.c22bac1c.js +2 -0
- package/__mf/js/async/2226.a056d1a3.js +1 -0
- package/__mf/js/async/2472.75bb97e0.js +22 -0
- package/__mf/js/async/2652.7b7038d2.js +28 -0
- package/__mf/js/async/2708.9651e2da.js +1 -0
- package/__mf/js/async/282.6c4c5a94.js +1 -0
- package/__mf/js/async/{4075.ea5435c6.js → 4075.19dee570.js} +1 -1
- package/__mf/js/async/{4238.ac5f0a30.js → 4238.155e3b8a.js} +1 -1
- package/__mf/js/async/4310.b96a5c66.js +7 -0
- package/__mf/js/async/4421.5adcbc2d.js +1 -0
- package/__mf/js/async/529.f12e49de.js +2 -0
- package/__mf/js/async/6134.f7ee513c.js +38 -0
- package/__mf/js/async/6329.9c3a3698.js +2 -0
- package/__mf/js/async/9563.0375701c.js +2 -0
- package/__mf/js/async/{__federation_expose_LokiDatasource.875ecaed.js → __federation_expose_LokiDatasource.a9871645.js} +2 -2
- package/__mf/js/async/__federation_expose_LokiLogQuery.9b430d01.js +1 -0
- package/__mf/js/async/__federation_expose_LokiTimeSeriesQuery.61feff51.js +1 -0
- package/__mf/js/{main.925fc3bf.js → main.174be1bc.js} +4 -4
- package/lib/cjs/index.js +0 -1
- package/lib/cjs/queries/loki-log-query/LokiLogQueryEditor.js +28 -27
- package/lib/cjs/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +27 -27
- package/lib/cjs/queries/query-editor-model.js +53 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/model/loki-data-types.d.ts +3 -13
- package/lib/model/loki-data-types.d.ts.map +1 -1
- package/lib/model/loki-data-types.js.map +1 -1
- package/lib/queries/loki-log-query/LokiLogQueryEditor.d.ts.map +1 -1
- package/lib/queries/loki-log-query/LokiLogQueryEditor.js +30 -29
- package/lib/queries/loki-log-query/LokiLogQueryEditor.js.map +1 -1
- package/lib/queries/loki-log-query/get-loki-log-data.js.map +1 -1
- package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts +2 -3
- package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts.map +1 -1
- package/lib/queries/loki-log-query/log-query-plugin-interface.js.map +1 -1
- package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.d.ts.map +1 -1
- package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +28 -28
- package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js.map +1 -1
- package/lib/queries/query-editor-model.d.ts +20 -0
- package/lib/queries/query-editor-model.d.ts.map +1 -0
- package/lib/queries/query-editor-model.js +50 -0
- package/lib/queries/query-editor-model.js.map +1 -0
- package/mf-manifest.json +62 -125
- package/mf-stats.json +62 -127
- package/package.json +7 -16
- package/__mf/css/async/1320.7ad02b85.css +0 -1
- package/__mf/css/async/2341.7ad02b85.css +0 -1
- package/__mf/css/async/9479.7ad02b85.css +0 -1
- package/__mf/js/async/1320.ca6d65b6.js +0 -2
- package/__mf/js/async/2417.993ba27f.js +0 -2
- package/__mf/js/async/2448.6a132c1c.js +0 -10
- package/__mf/js/async/2470.ba894af3.js +0 -7
- package/__mf/js/async/282.3d82e785.js +0 -1
- package/__mf/js/async/3413.6dd92cfd.js +0 -1
- package/__mf/js/async/3849.c4035be2.js +0 -1
- package/__mf/js/async/4168.645bbaa1.js +0 -2
- package/__mf/js/async/4368.40ff20c1.js +0 -2
- package/__mf/js/async/4421.8aeb683a.js +0 -1
- package/__mf/js/async/4687.1af57d71.js +0 -2
- package/__mf/js/async/4693.ba67a5aa.js +0 -1
- package/__mf/js/async/5035.15709e1b.js +0 -73
- package/__mf/js/async/5713.3b303108.js +0 -1
- package/__mf/js/async/5876.5618763d.js +0 -2
- package/__mf/js/async/592.269748ce.js +0 -1
- package/__mf/js/async/6569.f33ecbef.js +0 -1
- package/__mf/js/async/6664.078084ff.js +0 -28
- package/__mf/js/async/9479.f74b4605.js +0 -1
- package/__mf/js/async/9654.575f5449.js +0 -37
- package/__mf/js/async/__federation_expose_LogsTable.0bf7a331.js +0 -2
- package/__mf/js/async/__federation_expose_LokiDatasource.875ecaed.js.LICENSE.txt +0 -9
- package/__mf/js/async/__federation_expose_LokiLogQuery.b5fd8404.js +0 -1
- package/__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8e1af800.js +0 -1
- package/lib/cjs/panels/index.js +0 -30
- package/lib/cjs/panels/logstable/LogsTable.js +0 -41
- package/lib/cjs/panels/logstable/LogsTableComponent.js +0 -43
- package/lib/cjs/panels/logstable/LogsTableSettingsEditor.js +0 -70
- package/lib/cjs/panels/logstable/components/EmptyLogsState.js +0 -49
- package/lib/cjs/panels/logstable/components/LogRow/LogRow.js +0 -158
- package/lib/cjs/panels/logstable/components/LogRow/LogTimestamp.js +0 -44
- package/lib/cjs/panels/logstable/components/LogRow/LogsLabelsTable.js +0 -74
- package/lib/cjs/panels/logstable/components/LogRow/LogsStyles.js +0 -77
- package/lib/cjs/panels/logstable/components/LogRow/index.js +0 -37
- package/lib/cjs/panels/logstable/components/LogsList.js +0 -44
- package/lib/cjs/panels/logstable/components/VirtualizedLogsList.js +0 -63
- package/lib/cjs/panels/logstable/components/index.js +0 -23
- package/lib/cjs/panels/logstable/components/utils.js +0 -39
- package/lib/cjs/panels/logstable/hooks/useExpandedRows.js +0 -45
- package/lib/cjs/panels/logstable/hooks/useSeverity.js +0 -43
- package/lib/cjs/panels/logstable/index.js +0 -33
- package/lib/cjs/panels/logstable/logs-types.js +0 -16
- package/lib/panels/index.d.ts +0 -2
- package/lib/panels/index.d.ts.map +0 -1
- package/lib/panels/index.js +0 -15
- package/lib/panels/index.js.map +0 -1
- package/lib/panels/logstable/LogsTable.d.ts +0 -4
- package/lib/panels/logstable/LogsTable.d.ts.map +0 -1
- package/lib/panels/logstable/LogsTable.js +0 -33
- package/lib/panels/logstable/LogsTable.js.map +0 -1
- package/lib/panels/logstable/LogsTableComponent.d.ts +0 -4
- package/lib/panels/logstable/LogsTableComponent.d.ts.map +0 -1
- package/lib/panels/logstable/LogsTableComponent.js +0 -35
- package/lib/panels/logstable/LogsTableComponent.js.map +0 -1
- package/lib/panels/logstable/LogsTableSettingsEditor.d.ts +0 -7
- package/lib/panels/logstable/LogsTableSettingsEditor.d.ts.map +0 -1
- package/lib/panels/logstable/LogsTableSettingsEditor.js +0 -62
- package/lib/panels/logstable/LogsTableSettingsEditor.js.map +0 -1
- package/lib/panels/logstable/components/EmptyLogsState.d.ts +0 -7
- package/lib/panels/logstable/components/EmptyLogsState.d.ts.map +0 -1
- package/lib/panels/logstable/components/EmptyLogsState.js +0 -36
- package/lib/panels/logstable/components/EmptyLogsState.js.map +0 -1
- package/lib/panels/logstable/components/LogRow/LogRow.d.ts +0 -14
- package/lib/panels/logstable/components/LogRow/LogRow.d.ts.map +0 -1
- package/lib/panels/logstable/components/LogRow/LogRow.js +0 -104
- package/lib/panels/logstable/components/LogRow/LogRow.js.map +0 -1
- package/lib/panels/logstable/components/LogRow/LogTimestamp.d.ts +0 -7
- package/lib/panels/logstable/components/LogRow/LogTimestamp.d.ts.map +0 -1
- package/lib/panels/logstable/components/LogRow/LogTimestamp.js +0 -31
- package/lib/panels/logstable/components/LogRow/LogTimestamp.js.map +0 -1
- package/lib/panels/logstable/components/LogRow/LogsLabelsTable.d.ts +0 -7
- package/lib/panels/logstable/components/LogRow/LogsLabelsTable.d.ts.map +0 -1
- package/lib/panels/logstable/components/LogRow/LogsLabelsTable.js +0 -61
- package/lib/panels/logstable/components/LogRow/LogsLabelsTable.js.map +0 -1
- package/lib/panels/logstable/components/LogRow/LogsStyles.d.ts +0 -22
- package/lib/panels/logstable/components/LogRow/LogsStyles.d.ts.map +0 -1
- package/lib/panels/logstable/components/LogRow/LogsStyles.js +0 -55
- package/lib/panels/logstable/components/LogRow/LogsStyles.js.map +0 -1
- package/lib/panels/logstable/components/LogRow/index.d.ts +0 -3
- package/lib/panels/logstable/components/LogRow/index.d.ts.map +0 -1
- package/lib/panels/logstable/components/LogRow/index.js +0 -16
- package/lib/panels/logstable/components/LogRow/index.js.map +0 -1
- package/lib/panels/logstable/components/LogsList.d.ts +0 -10
- package/lib/panels/logstable/components/LogsList.d.ts.map +0 -1
- package/lib/panels/logstable/components/LogsList.js +0 -31
- package/lib/panels/logstable/components/LogsList.js.map +0 -1
- package/lib/panels/logstable/components/VirtualizedLogsList.d.ts +0 -12
- package/lib/panels/logstable/components/VirtualizedLogsList.d.ts.map +0 -1
- package/lib/panels/logstable/components/VirtualizedLogsList.js +0 -50
- package/lib/panels/logstable/components/VirtualizedLogsList.js.map +0 -1
- package/lib/panels/logstable/components/index.d.ts +0 -2
- package/lib/panels/logstable/components/index.d.ts.map +0 -1
- package/lib/panels/logstable/components/index.js +0 -15
- package/lib/panels/logstable/components/index.js.map +0 -1
- package/lib/panels/logstable/components/utils.d.ts +0 -3
- package/lib/panels/logstable/components/utils.d.ts.map +0 -1
- package/lib/panels/logstable/components/utils.js +0 -31
- package/lib/panels/logstable/components/utils.js.map +0 -1
- package/lib/panels/logstable/hooks/useExpandedRows.d.ts +0 -6
- package/lib/panels/logstable/hooks/useExpandedRows.d.ts.map +0 -1
- package/lib/panels/logstable/hooks/useExpandedRows.js +0 -37
- package/lib/panels/logstable/hooks/useExpandedRows.js.map +0 -1
- package/lib/panels/logstable/hooks/useSeverity.d.ts +0 -3
- package/lib/panels/logstable/hooks/useSeverity.d.ts.map +0 -1
- package/lib/panels/logstable/hooks/useSeverity.js +0 -35
- package/lib/panels/logstable/hooks/useSeverity.js.map +0 -1
- package/lib/panels/logstable/index.d.ts +0 -5
- package/lib/panels/logstable/index.d.ts.map +0 -1
- package/lib/panels/logstable/index.js +0 -18
- package/lib/panels/logstable/index.js.map +0 -1
- package/lib/panels/logstable/logs-types.d.ts +0 -11
- package/lib/panels/logstable/logs-types.d.ts.map +0 -1
- package/lib/panels/logstable/logs-types.js +0 -15
- package/lib/panels/logstable/logs-types.js.map +0 -1
- /package/__mf/js/async/{2448.6a132c1c.js.LICENSE.txt → 1360.2348e2a7.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{1320.ca6d65b6.js.LICENSE.txt → 1580.c7d3c3f1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4368.40ff20c1.js.LICENSE.txt → 2178.c22bac1c.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5035.15709e1b.js.LICENSE.txt → 2472.75bb97e0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2470.ba894af3.js.LICENSE.txt → 4310.b96a5c66.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5876.5618763d.js.LICENSE.txt → 529.f12e49de.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2417.993ba27f.js.LICENSE.txt → 6329.9c3a3698.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4687.1af57d71.js.LICENSE.txt → 9563.0375701c.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_LogsTable.0bf7a331.js.LICENSE.txt → __federation_expose_LokiDatasource.a9871645.js.LICENSE.txt} +0 -0
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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 _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
25
|
-
const _material = require("@mui/material");
|
|
26
|
-
const _ChevronRight = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronRight"));
|
|
27
|
-
const _useSeverity = require("../../hooks/useSeverity");
|
|
28
|
-
const _LogTimestamp = require("./LogTimestamp");
|
|
29
|
-
const _LogsStyles = require("./LogsStyles");
|
|
30
|
-
const _LogsLabelsTable = require("./LogsLabelsTable");
|
|
31
|
-
function _interop_require_default(obj) {
|
|
32
|
-
return obj && obj.__esModule ? obj : {
|
|
33
|
-
default: obj
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
37
|
-
if (typeof WeakMap !== "function") return null;
|
|
38
|
-
var cacheBabelInterop = new WeakMap();
|
|
39
|
-
var cacheNodeInterop = new WeakMap();
|
|
40
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
41
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
42
|
-
})(nodeInterop);
|
|
43
|
-
}
|
|
44
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
45
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
46
|
-
return obj;
|
|
47
|
-
}
|
|
48
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
49
|
-
return {
|
|
50
|
-
default: obj
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
54
|
-
if (cache && cache.has(obj)) {
|
|
55
|
-
return cache.get(obj);
|
|
56
|
-
}
|
|
57
|
-
var newObj = {
|
|
58
|
-
__proto__: null
|
|
59
|
-
};
|
|
60
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
61
|
-
for(var key in obj){
|
|
62
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
63
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
64
|
-
if (desc && (desc.get || desc.set)) {
|
|
65
|
-
Object.defineProperty(newObj, key, desc);
|
|
66
|
-
} else {
|
|
67
|
-
newObj[key] = obj[key];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
newObj.default = obj;
|
|
72
|
-
if (cache) {
|
|
73
|
-
cache.set(obj, newObj);
|
|
74
|
-
}
|
|
75
|
-
return newObj;
|
|
76
|
-
}
|
|
77
|
-
const LogRow = /*#__PURE__*/ (0, _react.memo)(({ log, isExpanded, index, onToggle, isExpandable = false, time = false, wrap = false })=>{
|
|
78
|
-
const severityColor = (0, _useSeverity.useSeverityColor)(log);
|
|
79
|
-
const handleToggle = (0, _react.useCallback)(()=>{
|
|
80
|
-
if (isExpandable) {
|
|
81
|
-
onToggle(index);
|
|
82
|
-
}
|
|
83
|
-
}, [
|
|
84
|
-
isExpandable,
|
|
85
|
-
onToggle,
|
|
86
|
-
index
|
|
87
|
-
]);
|
|
88
|
-
if (!log) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_LogsStyles.LogRowContainer, {
|
|
92
|
-
severityColor: severityColor,
|
|
93
|
-
children: [
|
|
94
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_LogsStyles.LogRowContent, {
|
|
95
|
-
onClick: handleToggle,
|
|
96
|
-
isExpandable: isExpandable,
|
|
97
|
-
time: time,
|
|
98
|
-
children: [
|
|
99
|
-
isExpandable && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
100
|
-
sx: {
|
|
101
|
-
display: 'flex',
|
|
102
|
-
alignItems: 'center',
|
|
103
|
-
width: '16px',
|
|
104
|
-
justifyContent: 'center'
|
|
105
|
-
},
|
|
106
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_LogsStyles.ExpandButton, {
|
|
107
|
-
size: "small",
|
|
108
|
-
isExpanded: isExpanded,
|
|
109
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronRight.default, {
|
|
110
|
-
sx: {
|
|
111
|
-
fontSize: '12px'
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
})
|
|
115
|
-
}),
|
|
116
|
-
time && /*#__PURE__*/ (0, _jsxruntime.jsx)(_LogTimestamp.LogTimestamp, {
|
|
117
|
-
timestamp: log.timestamp
|
|
118
|
-
}),
|
|
119
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_LogsStyles.LogText, {
|
|
120
|
-
variant: "body2",
|
|
121
|
-
wrap: wrap,
|
|
122
|
-
children: log.line
|
|
123
|
-
})
|
|
124
|
-
]
|
|
125
|
-
}),
|
|
126
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Collapse, {
|
|
127
|
-
in: isExpanded,
|
|
128
|
-
timeout: 200,
|
|
129
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
130
|
-
sx: {
|
|
131
|
-
padding: '8px'
|
|
132
|
-
},
|
|
133
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
134
|
-
sx: {
|
|
135
|
-
display: 'grid',
|
|
136
|
-
gridTemplateColumns: !time ? '1fr' : '8px minmax(160px, max-content) 1fr',
|
|
137
|
-
gap: '12px'
|
|
138
|
-
},
|
|
139
|
-
children: [
|
|
140
|
-
time && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
141
|
-
children: [
|
|
142
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {}),
|
|
143
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {})
|
|
144
|
-
]
|
|
145
|
-
}),
|
|
146
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
147
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_LogsLabelsTable.LogLabelsTable, {
|
|
148
|
-
labels: log.labels
|
|
149
|
-
})
|
|
150
|
-
})
|
|
151
|
-
]
|
|
152
|
-
})
|
|
153
|
-
})
|
|
154
|
-
})
|
|
155
|
-
]
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
LogRow.displayName = 'LogRow';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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
|
-
const _material = require("@mui/material");
|
|
26
|
-
const _datefns = require("date-fns");
|
|
27
|
-
function _interop_require_default(obj) {
|
|
28
|
-
return obj && obj.__esModule ? obj : {
|
|
29
|
-
default: obj
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const LogTimestamp = ({ timestamp })=>{
|
|
33
|
-
const theme = (0, _material.useTheme)();
|
|
34
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
35
|
-
variant: "caption",
|
|
36
|
-
sx: {
|
|
37
|
-
color: theme.palette.text.secondary,
|
|
38
|
-
fontSize: '12px',
|
|
39
|
-
whiteSpace: 'nowrap',
|
|
40
|
-
minWidth: '160px'
|
|
41
|
-
},
|
|
42
|
-
children: (0, _datefns.format)((0, _datefns.fromUnixTime)(timestamp), 'yyyy-MM-dd HH:mm:ss')
|
|
43
|
-
});
|
|
44
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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, "LogLabelsTable", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return LogLabelsTable;
|
|
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 LogLabelsTable = ({ labels })=>{
|
|
32
|
-
const theme = (0, _material.useTheme)();
|
|
33
|
-
if (Object.keys(labels).length === 0) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Table, {
|
|
37
|
-
size: "small",
|
|
38
|
-
sx: {
|
|
39
|
-
border: `1px solid ${theme.palette.divider}`,
|
|
40
|
-
'& .MuiTableCell-root': {
|
|
41
|
-
border: 'none',
|
|
42
|
-
padding: '6px 8px',
|
|
43
|
-
fontSize: '12px'
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableBody, {
|
|
47
|
-
children: Object.entries(labels).map(([key, value])=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
48
|
-
sx: {
|
|
49
|
-
'&:hover': {
|
|
50
|
-
backgroundColor: (0, _material.alpha)(theme.palette.action.hover, 0.04)
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
children: [
|
|
54
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
55
|
-
sx: {
|
|
56
|
-
color: theme.palette.text.secondary,
|
|
57
|
-
fontWeight: 500,
|
|
58
|
-
width: '33%'
|
|
59
|
-
},
|
|
60
|
-
children: key
|
|
61
|
-
}),
|
|
62
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
63
|
-
sx: {
|
|
64
|
-
color: theme.palette.text.primary,
|
|
65
|
-
wordBreak: 'break-all',
|
|
66
|
-
width: '67%'
|
|
67
|
-
},
|
|
68
|
-
children: value
|
|
69
|
-
})
|
|
70
|
-
]
|
|
71
|
-
}, key))
|
|
72
|
-
})
|
|
73
|
-
});
|
|
74
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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: all[name]
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
ExpandButton: function() {
|
|
25
|
-
return ExpandButton;
|
|
26
|
-
},
|
|
27
|
-
LogRowContainer: function() {
|
|
28
|
-
return LogRowContainer;
|
|
29
|
-
},
|
|
30
|
-
LogRowContent: function() {
|
|
31
|
-
return LogRowContent;
|
|
32
|
-
},
|
|
33
|
-
LogText: function() {
|
|
34
|
-
return LogText;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const _material = require("@mui/material");
|
|
38
|
-
const LogRowContainer = (0, _material.styled)(_material.Box)(({ severityColor })=>({
|
|
39
|
-
borderLeft: `4px solid ${severityColor}`,
|
|
40
|
-
transition: 'all 0.2s ease',
|
|
41
|
-
marginBottom: '4px',
|
|
42
|
-
fontFamily: '"DejaVu Sans Mono", monospace'
|
|
43
|
-
}));
|
|
44
|
-
const LogRowContent = (0, _material.styled)(_material.Box)(({ theme, isExpandable })=>({
|
|
45
|
-
display: 'grid',
|
|
46
|
-
gridTemplateColumns: isExpandable ? '16px minmax(160px, max-content) 1fr' : 'minmax(160px, max-content) 1fr',
|
|
47
|
-
alignItems: 'flex-start',
|
|
48
|
-
padding: '4px 8px',
|
|
49
|
-
cursor: isExpandable ? 'pointer' : 'default',
|
|
50
|
-
gap: '12px',
|
|
51
|
-
'&:hover': {
|
|
52
|
-
backgroundColor: theme.palette.action.hover
|
|
53
|
-
}
|
|
54
|
-
}));
|
|
55
|
-
const ExpandButton = (0, _material.styled)(_material.IconButton)(({ theme, isExpanded })=>({
|
|
56
|
-
padding: 0,
|
|
57
|
-
width: '16px',
|
|
58
|
-
height: '16px',
|
|
59
|
-
color: theme.palette.text.secondary,
|
|
60
|
-
transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
61
|
-
transition: 'transform 0.2s ease'
|
|
62
|
-
}));
|
|
63
|
-
const LogText = (0, _material.styled)(_material.Typography)(({ wrap })=>({
|
|
64
|
-
fontSize: '12px',
|
|
65
|
-
flex: 1,
|
|
66
|
-
lineHeight: 1.4,
|
|
67
|
-
textAlign: 'left',
|
|
68
|
-
...wrap ? {
|
|
69
|
-
wordBreak: 'break-word',
|
|
70
|
-
whiteSpace: 'pre-wrap',
|
|
71
|
-
overflow: 'visible',
|
|
72
|
-
textOverflow: 'unset'
|
|
73
|
-
} : {
|
|
74
|
-
wordBreak: 'normal',
|
|
75
|
-
whiteSpace: 'nowrap'
|
|
76
|
-
}
|
|
77
|
-
}));
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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 2025 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 _useExpandedRows = require("../hooks/useExpandedRows");
|
|
26
|
-
const _EmptyLogsState = require("./EmptyLogsState");
|
|
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
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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, "VirtualizedLogsList", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return VirtualizedLogsList;
|
|
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
|
-
const _reactvirtuoso = require("react-virtuoso");
|
|
27
|
-
const _LogRow = require("./LogRow/LogRow");
|
|
28
|
-
function _interop_require_default(obj) {
|
|
29
|
-
return obj && obj.__esModule ? obj : {
|
|
30
|
-
default: obj
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const VirtualizedLogsList = ({ logs, spec, expandedRows, onToggleExpand })=>{
|
|
34
|
-
const theme = (0, _material.useTheme)();
|
|
35
|
-
const renderLogRow = (index)=>{
|
|
36
|
-
const log = logs[index];
|
|
37
|
-
if (!log) return null;
|
|
38
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_LogRow.LogRow, {
|
|
39
|
-
isExpandable: spec.enableDetails,
|
|
40
|
-
log: log,
|
|
41
|
-
index: index,
|
|
42
|
-
isExpanded: expandedRows.has(index),
|
|
43
|
-
onToggle: onToggleExpand,
|
|
44
|
-
wrap: spec.wrap,
|
|
45
|
-
time: spec.time
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
49
|
-
sx: {
|
|
50
|
-
height: '100%',
|
|
51
|
-
backgroundColor: theme.palette.background.default,
|
|
52
|
-
overflow: 'hidden',
|
|
53
|
-
boxShadow: theme.shadows[1]
|
|
54
|
-
},
|
|
55
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactvirtuoso.Virtuoso, {
|
|
56
|
-
style: {
|
|
57
|
-
height: '100%'
|
|
58
|
-
},
|
|
59
|
-
totalCount: logs.length,
|
|
60
|
-
itemContent: renderLogRow
|
|
61
|
-
})
|
|
62
|
-
});
|
|
63
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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.LogsList;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _LogsList = require("./LogsList");
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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, "getSeverity", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return getSeverity;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const getSeverity = (log)=>{
|
|
24
|
-
const message = log.line.toLowerCase();
|
|
25
|
-
const level = log.labels.level?.toLowerCase();
|
|
26
|
-
if (level) {
|
|
27
|
-
if (level.includes('error') || level.includes('err')) return 'error';
|
|
28
|
-
if (level.includes('warn')) return 'warn';
|
|
29
|
-
if (level.includes('info')) return 'info';
|
|
30
|
-
if (level.includes('debug')) return 'debug';
|
|
31
|
-
}
|
|
32
|
-
if (message.includes('error') || message.includes('exception') || message.includes('fail')) {
|
|
33
|
-
return 'error';
|
|
34
|
-
}
|
|
35
|
-
if (message.includes('warn')) return 'warn';
|
|
36
|
-
if (message.includes('info')) return 'info';
|
|
37
|
-
if (message.includes('debug')) return 'debug';
|
|
38
|
-
return 'unknown';
|
|
39
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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, "useExpandedRows", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return useExpandedRows;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _react = require("react");
|
|
24
|
-
const useExpandedRows = ()=>{
|
|
25
|
-
const [expandedRows, setExpandedRows] = (0, _react.useState)(new Set());
|
|
26
|
-
const toggleExpand = (0, _react.useCallback)((index)=>{
|
|
27
|
-
setExpandedRows((prev)=>{
|
|
28
|
-
const newSet = new Set(prev);
|
|
29
|
-
if (newSet.has(index)) {
|
|
30
|
-
newSet.delete(index);
|
|
31
|
-
} else {
|
|
32
|
-
newSet.add(index);
|
|
33
|
-
}
|
|
34
|
-
return newSet;
|
|
35
|
-
});
|
|
36
|
-
}, []);
|
|
37
|
-
const clearExpanded = (0, _react.useCallback)(()=>{
|
|
38
|
-
setExpandedRows(new Set());
|
|
39
|
-
}, []);
|
|
40
|
-
return {
|
|
41
|
-
expandedRows,
|
|
42
|
-
toggleExpand,
|
|
43
|
-
clearExpanded
|
|
44
|
-
};
|
|
45
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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, "useSeverityColor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return useSeverityColor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _material = require("@mui/material");
|
|
24
|
-
const _utils = require("../components/utils");
|
|
25
|
-
const useSeverityColor = (log)=>{
|
|
26
|
-
const theme = (0, _material.useTheme)();
|
|
27
|
-
if (!log) {
|
|
28
|
-
return theme.palette.text.secondary;
|
|
29
|
-
}
|
|
30
|
-
const severity = (0, _utils.getSeverity)(log);
|
|
31
|
-
switch(severity){
|
|
32
|
-
case 'error':
|
|
33
|
-
return theme.palette.error.main;
|
|
34
|
-
case 'warn':
|
|
35
|
-
return theme.palette.warning.main;
|
|
36
|
-
case 'info':
|
|
37
|
-
return theme.palette.info.main;
|
|
38
|
-
case 'debug':
|
|
39
|
-
return theme.palette.primary.main;
|
|
40
|
-
default:
|
|
41
|
-
return theme.palette.text.secondary;
|
|
42
|
-
}
|
|
43
|
-
};
|