@peers-app/peers-ui 0.7.22 → 0.7.23
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.
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.LogDisplay = void 0;
|
|
7
|
+
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
7
8
|
const moment_1 = __importDefault(require("moment"));
|
|
8
9
|
const react_1 = __importDefault(require("react"));
|
|
9
10
|
const getLevelColor = (level) => {
|
|
@@ -39,6 +40,12 @@ const LogDisplay = ({ log, columns }) => {
|
|
|
39
40
|
const column = columns.find(c => c.key === key);
|
|
40
41
|
return column ? `${column.width}px` : 'auto';
|
|
41
42
|
};
|
|
43
|
+
if (typeof log.context === 'string') {
|
|
44
|
+
try {
|
|
45
|
+
log.context = (0, peers_sdk_1.fromJSONString)(log.context);
|
|
46
|
+
}
|
|
47
|
+
catch (err) { }
|
|
48
|
+
}
|
|
42
49
|
return (react_1.default.createElement("tr", null,
|
|
43
50
|
react_1.default.createElement("td", { className: "text-nowrap", style: { fontSize: '0.75rem', width: getColumnWidth('timestamp'), padding: '0.5rem' } }, (0, moment_1.default)(log.timestamp).format('MM/DD HH:mm:ss.SSS')),
|
|
44
51
|
react_1.default.createElement("td", { style: { width: getColumnWidth('level'), padding: '0.5rem' } },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peers-app/peers-ui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.23",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/peers-app/peers-ui.git"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"bootstrap": "^5.3.3",
|
|
30
|
-
"@peers-app/peers-sdk": "^0.7.
|
|
30
|
+
"@peers-app/peers-sdk": "^0.7.23",
|
|
31
31
|
"react": "^18.0.0",
|
|
32
32
|
"react-dom": "^18.0.0"
|
|
33
33
|
},
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"jest": "^29.7.0",
|
|
58
58
|
"jest-environment-jsdom": "^30.0.5",
|
|
59
59
|
"path-browserify": "^1.0.1",
|
|
60
|
-
"@peers-app/peers-sdk": "0.7.
|
|
60
|
+
"@peers-app/peers-sdk": "0.7.23",
|
|
61
61
|
"react": "^18.0.0",
|
|
62
62
|
"react-dom": "^18.0.0",
|
|
63
63
|
"string-width": "^7.1.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IConsoleLog } from "@peers-app/peers-sdk";
|
|
1
|
+
import { fromJSONString, IConsoleLog } from "@peers-app/peers-sdk";
|
|
2
2
|
import moment from 'moment';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
@@ -49,6 +49,11 @@ export const LogDisplay = ({ log, columns }: LogDisplayProps) => {
|
|
|
49
49
|
const column = columns.find(c => c.key === key);
|
|
50
50
|
return column ? `${column.width}px` : 'auto';
|
|
51
51
|
};
|
|
52
|
+
if (typeof log.context === 'string') {
|
|
53
|
+
try {
|
|
54
|
+
log.context = fromJSONString(log.context);
|
|
55
|
+
} catch (err) {}
|
|
56
|
+
}
|
|
52
57
|
|
|
53
58
|
return (
|
|
54
59
|
<tr>
|