@deephaven/console 0.5.2-matplotlib.2 → 0.6.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/dist/Console.d.ts +3 -0
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +807 -871
- package/dist/Console.js.map +1 -1
- package/dist/ConsoleInput.d.ts +1 -38
- package/dist/ConsoleInput.d.ts.map +1 -1
- package/dist/ConsoleInput.js +331 -436
- package/dist/ConsoleInput.js.map +1 -1
- package/dist/ConsoleMenu.js +159 -215
- package/dist/ConsoleMenu.js.map +1 -1
- package/dist/ConsolePropTypes.js +1 -1
- package/dist/ConsolePropTypes.js.map +1 -1
- package/dist/ConsoleShortcuts.js +2 -2
- package/dist/ConsoleShortcuts.js.map +1 -1
- package/dist/ConsoleStatusBar.js +85 -125
- package/dist/ConsoleStatusBar.js.map +1 -1
- package/dist/StoragePropTypes.js +2 -2
- package/dist/StoragePropTypes.js.map +1 -1
- package/dist/command-history/CommandHistory.css +5 -2
- package/dist/command-history/CommandHistory.css.map +1 -1
- package/dist/command-history/CommandHistory.d.ts +5 -0
- package/dist/command-history/CommandHistory.d.ts.map +1 -1
- package/dist/command-history/CommandHistory.js +303 -391
- package/dist/command-history/CommandHistory.js.map +1 -1
- package/dist/command-history/CommandHistoryActions.css +4 -0
- package/dist/command-history/CommandHistoryActions.css.map +1 -1
- package/dist/command-history/CommandHistoryActions.d.ts.map +1 -1
- package/dist/command-history/CommandHistoryActions.js +40 -79
- package/dist/command-history/CommandHistoryActions.js.map +1 -1
- package/dist/command-history/CommandHistoryItem.css +1 -1
- package/dist/command-history/CommandHistoryItem.d.ts +5 -0
- package/dist/command-history/CommandHistoryItem.d.ts.map +1 -1
- package/dist/command-history/CommandHistoryItem.js +15 -9
- package/dist/command-history/CommandHistoryItem.js.map +1 -1
- package/dist/command-history/CommandHistoryItemTooltip.d.ts +1 -40
- package/dist/command-history/CommandHistoryItemTooltip.d.ts.map +1 -1
- package/dist/command-history/CommandHistoryItemTooltip.js +139 -189
- package/dist/command-history/CommandHistoryItemTooltip.js.map +1 -1
- package/dist/command-history/CommandHistoryViewportUpdater.js +30 -35
- package/dist/command-history/CommandHistoryViewportUpdater.js.map +1 -1
- package/dist/command-history/index.js +5 -5
- package/dist/command-history/index.js.map +1 -1
- package/dist/common/Code.js +34 -70
- package/dist/common/Code.js.map +1 -1
- package/dist/common/ConsoleConstants.js +3 -24
- package/dist/common/ConsoleConstants.js.map +1 -1
- package/dist/common/ConsoleUtils.d.ts +1 -3
- package/dist/common/ConsoleUtils.d.ts.map +1 -1
- package/dist/common/ConsoleUtils.js +60 -94
- package/dist/common/ConsoleUtils.js.map +1 -1
- package/dist/common/ObjectIcon.js +4 -2
- package/dist/common/ObjectIcon.js.map +1 -1
- package/dist/common/index.d.js +1 -34
- package/dist/common/index.d.js.map +1 -1
- package/dist/common/index.js +4 -4
- package/dist/common/index.js.map +1 -1
- package/dist/console-history/ConsoleHistory.js +27 -63
- package/dist/console-history/ConsoleHistory.js.map +1 -1
- package/dist/console-history/ConsoleHistoryItem.js +116 -154
- package/dist/console-history/ConsoleHistoryItem.js.map +1 -1
- package/dist/console-history/ConsoleHistoryItemResult.js +4 -2
- package/dist/console-history/ConsoleHistoryItemResult.js.map +1 -1
- package/dist/console-history/ConsoleHistoryResultErrorMessage.js +94 -132
- package/dist/console-history/ConsoleHistoryResultErrorMessage.js.map +1 -1
- package/dist/console-history/ConsoleHistoryResultInProgress.js +42 -76
- package/dist/console-history/ConsoleHistoryResultInProgress.js.map +1 -1
- package/dist/console-history/index.js +5 -5
- package/dist/console-history/index.js.map +1 -1
- package/dist/csv/CsvFormats.js +14 -28
- package/dist/csv/CsvFormats.js.map +1 -1
- package/dist/csv/CsvInputBar.css +25 -23
- package/dist/csv/CsvInputBar.css.map +1 -1
- package/dist/csv/CsvInputBar.d.ts +2 -45
- package/dist/csv/CsvInputBar.d.ts.map +1 -1
- package/dist/csv/CsvInputBar.js +298 -372
- package/dist/csv/CsvInputBar.js.map +1 -1
- package/dist/csv/CsvOverlay.js +197 -243
- package/dist/csv/CsvOverlay.js.map +1 -1
- package/dist/csv/CsvParser.js +186 -209
- package/dist/csv/CsvParser.js.map +1 -1
- package/dist/csv/CsvTypeParser.js +185 -210
- package/dist/csv/CsvTypeParser.js.map +1 -1
- package/dist/csv/NewTableColumnTypes.js +1 -5
- package/dist/csv/NewTableColumnTypes.js.map +1 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/log/LogLevelMenuItem.js +24 -58
- package/dist/log/LogLevelMenuItem.js.map +1 -1
- package/dist/log/LogView.js +429 -484
- package/dist/log/LogView.js.map +1 -1
- package/dist/monaco/MonacoCompletionProvider.js +92 -124
- package/dist/monaco/MonacoCompletionProvider.js.map +1 -1
- package/dist/monaco/MonacoUtils.js +315 -331
- package/dist/monaco/MonacoUtils.js.map +1 -1
- package/dist/monaco/index.js +2 -2
- package/dist/monaco/index.js.map +1 -1
- package/dist/monaco/lang/db.js +3 -3
- package/dist/monaco/lang/db.js.map +1 -1
- package/dist/monaco/lang/groovy.js +3 -3
- package/dist/monaco/lang/groovy.js.map +1 -1
- package/dist/monaco/lang/log.js +3 -3
- package/dist/monaco/lang/log.js.map +1 -1
- package/dist/monaco/lang/python.js +3 -3
- package/dist/monaco/lang/python.js.map +1 -1
- package/dist/monaco/lang/scala.js +5 -5
- package/dist/monaco/lang/scala.js.map +1 -1
- package/dist/notebook/Editor.js +101 -141
- package/dist/notebook/Editor.js.map +1 -1
- package/dist/notebook/ScriptEditor.js +261 -301
- package/dist/notebook/ScriptEditor.js.map +1 -1
- package/dist/notebook/ScriptEditorUtils.js +26 -42
- package/dist/notebook/ScriptEditorUtils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -22
package/dist/log/LogView.js
CHANGED
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
-
|
|
3
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
4
2
|
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
4
|
|
|
7
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
-
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10
|
-
|
|
11
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
12
|
-
|
|
13
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
-
|
|
15
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
|
|
17
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
20
|
-
|
|
21
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
-
|
|
23
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
|
|
25
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
|
|
27
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
28
6
|
|
|
29
7
|
import React, { PureComponent } from 'react';
|
|
@@ -32,548 +10,515 @@ import { DropdownMenu, Tooltip } from '@deephaven/components';
|
|
|
32
10
|
import { vsGear, dhTrashUndo } from '@deephaven/icons';
|
|
33
11
|
import { PropTypes as APIPropTypes } from '@deephaven/jsapi-shim';
|
|
34
12
|
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
35
|
-
import ConsoleUtils from
|
|
36
|
-
import LogLevel from
|
|
13
|
+
import ConsoleUtils from "../common/ConsoleUtils.js";
|
|
14
|
+
import LogLevel from "./LogLevel.js";
|
|
37
15
|
import "./LogView.css";
|
|
38
|
-
import LogLevelMenuItem from
|
|
16
|
+
import LogLevelMenuItem from "./LogLevelMenuItem.js";
|
|
39
17
|
/**
|
|
40
18
|
* Log view contents. Uses a monaco editor to display/search the contents of the log.
|
|
41
19
|
*/
|
|
42
20
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
21
|
+
class LogView extends PureComponent {
|
|
22
|
+
/** ms to buffer log messages before processing them */
|
|
23
|
+
|
|
24
|
+
/** Maximum number of messages to store in the log */
|
|
25
|
+
static getLogText(logItem) {
|
|
26
|
+
var date = new Date(logItem.micros / 1000);
|
|
27
|
+
var timestamp = ConsoleUtils.formatTimestamp(date);
|
|
28
|
+
return "".concat(timestamp, " ").concat(logItem.logLevel, " ").concat(logItem.message);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
constructor(props) {
|
|
32
|
+
super(props);
|
|
33
|
+
this.handleClearClick = this.handleClearClick.bind(this);
|
|
34
|
+
this.handleFlushTimeout = this.handleFlushTimeout.bind(this);
|
|
35
|
+
this.handleLogMessage = this.handleLogMessage.bind(this);
|
|
36
|
+
this.handleMenuItemClick = this.handleMenuItemClick.bind(this);
|
|
37
|
+
this.handleResetClick = this.handleResetClick.bind(this);
|
|
38
|
+
this.handleResize = this.handleResize.bind(this);
|
|
39
|
+
this.handleToggleAllClick = this.handleToggleAllClick.bind(this);
|
|
40
|
+
this.cancelListener = null;
|
|
41
|
+
this.editor = null;
|
|
42
|
+
this.editorContainer = null;
|
|
43
|
+
this.logLevelMenuItems = {};
|
|
44
|
+
this.flushTimer = null;
|
|
45
|
+
this.bufferedMessages = [];
|
|
46
|
+
this.messages = [];
|
|
47
|
+
this.state = {
|
|
69
48
|
shownLogLevels: {}
|
|
70
49
|
};
|
|
71
|
-
return _this;
|
|
72
50
|
}
|
|
73
51
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
window.addEventListener('resize', this.handleResize);
|
|
81
|
-
}
|
|
82
|
-
}, {
|
|
83
|
-
key: "componentDidUpdate",
|
|
84
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
85
|
-
this.updateDimensions();
|
|
86
|
-
var shownLogLevels = this.state.shownLogLevels;
|
|
87
|
-
|
|
88
|
-
if (prevState.shownLogLevels !== shownLogLevels) {
|
|
89
|
-
this.refreshLogText();
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
var session = this.props.session;
|
|
52
|
+
componentDidMount() {
|
|
53
|
+
this.resetLogLevels();
|
|
54
|
+
this.initMonaco();
|
|
55
|
+
this.startListening();
|
|
56
|
+
window.addEventListener('resize', this.handleResize);
|
|
57
|
+
}
|
|
93
58
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
59
|
+
componentDidUpdate(prevProps, prevState) {
|
|
60
|
+
this.updateDimensions();
|
|
61
|
+
var {
|
|
62
|
+
shownLogLevels
|
|
63
|
+
} = this.state;
|
|
97
64
|
|
|
98
|
-
|
|
99
|
-
|
|
65
|
+
if (prevState.shownLogLevels !== shownLogLevels) {
|
|
66
|
+
this.refreshLogText();
|
|
100
67
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
68
|
+
|
|
69
|
+
var {
|
|
70
|
+
session
|
|
71
|
+
} = this.props;
|
|
72
|
+
|
|
73
|
+
if (prevProps.session !== session) {
|
|
105
74
|
this.stopListening();
|
|
106
|
-
this.
|
|
107
|
-
window.removeEventListener('resize', this.handleResize);
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "getMenuActions",
|
|
111
|
-
value: function getMenuActions(shownLogLevels) {
|
|
112
|
-
var _this2 = this;
|
|
75
|
+
this.startListening(); // clear logs when starting a new console
|
|
113
76
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
className: "log-level-menu-title"
|
|
118
|
-
}, "Display Log Levels"),
|
|
119
|
-
group: 1,
|
|
120
|
-
order: 10
|
|
121
|
-
});
|
|
77
|
+
this.clearLogs();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
122
80
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
order: i + 100,
|
|
130
|
-
menuElement: /*#__PURE__*/React.createElement(LogLevelMenuItem, {
|
|
131
|
-
logLevel: logLevel,
|
|
132
|
-
on: on,
|
|
133
|
-
onClick: _this2.handleMenuItemClick,
|
|
134
|
-
ref: function ref(element) {
|
|
135
|
-
_this2.logLevelMenuItems[logLevel] = element;
|
|
136
|
-
}
|
|
137
|
-
})
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
for (var i = 0; i < LogView.AllLogLevels.length; i += 1) {
|
|
142
|
-
_loop(i);
|
|
143
|
-
}
|
|
81
|
+
componentWillUnmount() {
|
|
82
|
+
this.stopFlushTimer();
|
|
83
|
+
this.stopListening();
|
|
84
|
+
this.destroyMonaco();
|
|
85
|
+
window.removeEventListener('resize', this.handleResize);
|
|
86
|
+
}
|
|
144
87
|
|
|
88
|
+
getMenuActions(shownLogLevels) {
|
|
89
|
+
var _this = this;
|
|
90
|
+
|
|
91
|
+
var actions = [];
|
|
92
|
+
actions.push({
|
|
93
|
+
menuElement: /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: "log-level-menu-title"
|
|
95
|
+
}, "Display Log Levels"),
|
|
96
|
+
group: 1,
|
|
97
|
+
order: 10
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
var _loop = function _loop(i) {
|
|
101
|
+
var logLevel = LogView.AllLogLevels[i];
|
|
102
|
+
var on = shownLogLevels[logLevel] != null ? shownLogLevels[logLevel] : false;
|
|
145
103
|
actions.push({
|
|
104
|
+
title: logLevel,
|
|
146
105
|
group: 1,
|
|
147
|
-
order:
|
|
148
|
-
menuElement: /*#__PURE__*/React.createElement(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
className: "btn btn-link",
|
|
157
|
-
onClick: this.handleResetClick
|
|
158
|
-
}, "Reset"))
|
|
106
|
+
order: i + 100,
|
|
107
|
+
menuElement: /*#__PURE__*/React.createElement(LogLevelMenuItem, {
|
|
108
|
+
logLevel: logLevel,
|
|
109
|
+
on: on,
|
|
110
|
+
onClick: _this.handleMenuItemClick,
|
|
111
|
+
ref: element => {
|
|
112
|
+
_this.logLevelMenuItems[logLevel] = element;
|
|
113
|
+
}
|
|
114
|
+
})
|
|
159
115
|
});
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
}, {
|
|
163
|
-
key: "resetLogLevels",
|
|
164
|
-
value: function resetLogLevels() {
|
|
165
|
-
var shownLogLevels = {};
|
|
166
|
-
|
|
167
|
-
for (var i = 0; i < LogView.AllLogLevels.length; i += 1) {
|
|
168
|
-
var logLevel = LogView.AllLogLevels[i];
|
|
169
|
-
var isEnabled = LogView.DefaultLogLevels.indexOf(logLevel) >= 0;
|
|
170
|
-
shownLogLevels[logLevel] = isEnabled;
|
|
171
|
-
}
|
|
116
|
+
};
|
|
172
117
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
});
|
|
118
|
+
for (var i = 0; i < LogView.AllLogLevels.length; i += 1) {
|
|
119
|
+
_loop(i);
|
|
176
120
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
lineDecorationsWidth: 0,
|
|
204
|
-
lineNumbers: '',
|
|
205
|
-
lineNumbersMinChars: 0,
|
|
206
|
-
minimap: {
|
|
207
|
-
enabled: false
|
|
208
|
-
},
|
|
209
|
-
readOnly: true,
|
|
210
|
-
renderLineHighlight: 'none',
|
|
211
|
-
scrollBeyondLastLine: false,
|
|
212
|
-
value: '',
|
|
213
|
-
wordWrap: 'on'
|
|
214
|
-
}); // When find widget is open, escape key closes it.
|
|
215
|
-
// Instead, capture it and do nothing. Same for shift-escape.
|
|
216
|
-
|
|
217
|
-
this.editor.addCommand(monaco.KeyCode.Escape, function () {});
|
|
218
|
-
this.editor.addCommand( // eslint-disable-next-line no-bitwise
|
|
219
|
-
monaco.KeyMod.Shift | monaco.KeyCode.Escape, function () {}); // Restore regular escape to clear selection, when editorText has focus.
|
|
220
|
-
|
|
221
|
-
this.editor.addCommand(monaco.KeyCode.Escape, function () {
|
|
222
|
-
_this3.editor.setPosition(_this3.editor.getPosition());
|
|
223
|
-
}, 'findWidgetVisible && editorTextFocus');
|
|
224
|
-
this.editor.addCommand( // eslint-disable-next-line no-bitwise
|
|
225
|
-
monaco.KeyMod.Shift | monaco.KeyCode.Escape, function () {
|
|
226
|
-
_this3.editor.setPosition(_this3.editor.getPosition());
|
|
227
|
-
}, 'findWidgetVisible && editorTextFocus');
|
|
121
|
+
|
|
122
|
+
actions.push({
|
|
123
|
+
group: 1,
|
|
124
|
+
order: 1000,
|
|
125
|
+
menuElement: /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
className: "log-level-menu-controls"
|
|
127
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
128
|
+
type: "button",
|
|
129
|
+
className: "btn btn-link log-level-toggle-all",
|
|
130
|
+
onClick: this.handleToggleAllClick
|
|
131
|
+
}, "Toggle All"), /*#__PURE__*/React.createElement("button", {
|
|
132
|
+
type: "button",
|
|
133
|
+
className: "btn btn-link",
|
|
134
|
+
onClick: this.handleResetClick
|
|
135
|
+
}, "Reset"))
|
|
136
|
+
});
|
|
137
|
+
return actions;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
resetLogLevels() {
|
|
141
|
+
var shownLogLevels = {};
|
|
142
|
+
|
|
143
|
+
for (var i = 0; i < LogView.AllLogLevels.length; i += 1) {
|
|
144
|
+
var logLevel = LogView.AllLogLevels[i];
|
|
145
|
+
var isEnabled = LogView.DefaultLogLevels.indexOf(logLevel) >= 0;
|
|
146
|
+
shownLogLevels[logLevel] = isEnabled;
|
|
228
147
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
148
|
+
|
|
149
|
+
this.setState({
|
|
150
|
+
shownLogLevels
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
startListening() {
|
|
155
|
+
var {
|
|
156
|
+
session
|
|
157
|
+
} = this.props;
|
|
158
|
+
this.cancelListener = session.onLogMessage(this.handleLogMessage);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
stopListening() {
|
|
162
|
+
if (this.cancelListener != null) {
|
|
163
|
+
this.cancelListener();
|
|
164
|
+
this.cancelListener = null;
|
|
236
165
|
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
initMonaco() {
|
|
169
|
+
this.editor = monaco.editor.create(this.editorContainer, {
|
|
170
|
+
copyWithSyntaxHighlighting: 'false',
|
|
171
|
+
fixedOverflowWidgets: true,
|
|
172
|
+
folding: false,
|
|
173
|
+
fontFamily: 'Fira Mono',
|
|
174
|
+
glyphMargin: false,
|
|
175
|
+
language: 'log',
|
|
176
|
+
lineDecorationsWidth: 0,
|
|
177
|
+
lineNumbers: '',
|
|
178
|
+
lineNumbersMinChars: 0,
|
|
179
|
+
minimap: {
|
|
180
|
+
enabled: false
|
|
181
|
+
},
|
|
182
|
+
readOnly: true,
|
|
183
|
+
renderLineHighlight: 'none',
|
|
184
|
+
scrollBeyondLastLine: false,
|
|
185
|
+
value: '',
|
|
186
|
+
wordWrap: 'on'
|
|
187
|
+
}); // When find widget is open, escape key closes it.
|
|
188
|
+
// Instead, capture it and do nothing. Same for shift-escape.
|
|
189
|
+
|
|
190
|
+
this.editor.addCommand(monaco.KeyCode.Escape, () => {});
|
|
191
|
+
this.editor.addCommand( // eslint-disable-next-line no-bitwise
|
|
192
|
+
monaco.KeyMod.Shift | monaco.KeyCode.Escape, () => {}); // Restore regular escape to clear selection, when editorText has focus.
|
|
193
|
+
|
|
194
|
+
this.editor.addCommand(monaco.KeyCode.Escape, () => {
|
|
195
|
+
this.editor.setPosition(this.editor.getPosition());
|
|
196
|
+
}, 'findWidgetVisible && editorTextFocus');
|
|
197
|
+
this.editor.addCommand( // eslint-disable-next-line no-bitwise
|
|
198
|
+
monaco.KeyMod.Shift | monaco.KeyCode.Escape, () => {
|
|
199
|
+
this.editor.setPosition(this.editor.getPosition());
|
|
200
|
+
}, 'findWidgetVisible && editorTextFocus');
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
destroyMonaco() {
|
|
204
|
+
if (this.editor) {
|
|
205
|
+
this.editor.dispose();
|
|
206
|
+
this.editor = null;
|
|
245
207
|
}
|
|
246
|
-
}
|
|
247
|
-
key: "toggleAll",
|
|
248
|
-
value: function toggleAll() {
|
|
249
|
-
var shownLogLevels = this.state.shownLogLevels;
|
|
250
|
-
var isAllEnabled = true;
|
|
251
|
-
|
|
252
|
-
for (var i = 0; i < LogView.AllLogLevels.length; i += 1) {
|
|
253
|
-
var logLevel = LogView.AllLogLevels[i];
|
|
254
|
-
|
|
255
|
-
if (!shownLogLevels[logLevel]) {
|
|
256
|
-
isAllEnabled = false;
|
|
257
|
-
break;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
208
|
+
}
|
|
260
209
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
210
|
+
triggerFindWidget() {
|
|
211
|
+
// The actions.find action can no longer be triggered when the editor is not in focus, with monaco 0.22.x.
|
|
212
|
+
// As a workaround, just focus the editor before triggering the action
|
|
213
|
+
// https://github.com/microsoft/monaco-editor/issues/2355
|
|
214
|
+
this.editor.focus();
|
|
215
|
+
this.editor.trigger('keyboard', 'actions.find');
|
|
216
|
+
}
|
|
267
217
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
218
|
+
toggleAll() {
|
|
219
|
+
var {
|
|
220
|
+
shownLogLevels
|
|
221
|
+
} = this.state;
|
|
222
|
+
var isAllEnabled = true;
|
|
272
223
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
224
|
+
for (var i = 0; i < LogView.AllLogLevels.length; i += 1) {
|
|
225
|
+
var logLevel = LogView.AllLogLevels[i];
|
|
226
|
+
|
|
227
|
+
if (!shownLogLevels[logLevel]) {
|
|
228
|
+
isAllEnabled = false;
|
|
229
|
+
break;
|
|
276
230
|
}
|
|
277
231
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
232
|
+
|
|
233
|
+
if (isAllEnabled) {
|
|
234
|
+
this.setState({
|
|
235
|
+
shownLogLevels: {}
|
|
236
|
+
});
|
|
237
|
+
} else {
|
|
283
238
|
var updatedLogLevels = {};
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
var shownLogLevels = this.state.shownLogLevels;
|
|
291
|
-
shownLogLevels = _objectSpread(_objectSpread({}, shownLogLevels), updatedLogLevels);
|
|
239
|
+
|
|
240
|
+
for (var _i = 0; _i < LogView.AllLogLevels.length; _i += 1) {
|
|
241
|
+
var _logLevel = LogView.AllLogLevels[_i];
|
|
242
|
+
updatedLogLevels[_logLevel] = true;
|
|
243
|
+
}
|
|
244
|
+
|
|
292
245
|
this.setState({
|
|
293
|
-
shownLogLevels:
|
|
246
|
+
shownLogLevels: updatedLogLevels
|
|
294
247
|
});
|
|
295
248
|
}
|
|
296
|
-
}
|
|
297
|
-
key: "appendLogText",
|
|
298
|
-
value: function appendLogText(text) {
|
|
299
|
-
if (!this.editor) {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
249
|
+
}
|
|
302
250
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
251
|
+
toggleLogLevel(logLevel) {
|
|
252
|
+
var {
|
|
253
|
+
shownLogLevels
|
|
254
|
+
} = this.state;
|
|
255
|
+
var isEnabled = shownLogLevels[logLevel];
|
|
256
|
+
var updatedLogLevels = {};
|
|
257
|
+
updatedLogLevels[logLevel] = !isEnabled;
|
|
258
|
+
this.updateLogLevels(updatedLogLevels);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
updateLogLevels(updatedLogLevels) {
|
|
262
|
+
var {
|
|
263
|
+
shownLogLevels
|
|
264
|
+
} = this.state;
|
|
265
|
+
shownLogLevels = _objectSpread(_objectSpread({}, shownLogLevels), updatedLogLevels);
|
|
266
|
+
this.setState({
|
|
267
|
+
shownLogLevels
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
appendLogText(text) {
|
|
272
|
+
if (!this.editor) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
var model = this.editor.getModel();
|
|
277
|
+
var line = model.getLineCount();
|
|
278
|
+
var column = model.getLineLength(line);
|
|
279
|
+
var isBottomVisible = this.isBottomVisible();
|
|
280
|
+
var edits = [];
|
|
323
281
|
|
|
282
|
+
if (column > 0) {
|
|
324
283
|
edits.push({
|
|
325
284
|
range: {
|
|
326
285
|
startLineNumber: line,
|
|
327
|
-
startColumn: column,
|
|
286
|
+
startColumn: column + 1,
|
|
328
287
|
endLineNumber: line,
|
|
329
|
-
endColumn: column
|
|
288
|
+
endColumn: column + 1
|
|
330
289
|
},
|
|
331
|
-
text:
|
|
290
|
+
text: '\n',
|
|
332
291
|
forceMoveMarkers: true
|
|
333
292
|
});
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
if (isBottomVisible) {
|
|
337
|
-
this.editor.revealLine(model.getLineCount(), 1);
|
|
338
|
-
}
|
|
293
|
+
line += 1;
|
|
294
|
+
column = 0;
|
|
339
295
|
}
|
|
340
|
-
/**
|
|
341
|
-
* Refresh the contents of the log component with the updated filter text
|
|
342
|
-
*/
|
|
343
|
-
|
|
344
|
-
}, {
|
|
345
|
-
key: "refreshLogText",
|
|
346
|
-
value: function refreshLogText() {
|
|
347
|
-
if (!this.editor) {
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
296
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
297
|
+
edits.push({
|
|
298
|
+
range: {
|
|
299
|
+
startLineNumber: line,
|
|
300
|
+
startColumn: column,
|
|
301
|
+
endLineNumber: line,
|
|
302
|
+
endColumn: column
|
|
303
|
+
},
|
|
304
|
+
text,
|
|
305
|
+
forceMoveMarkers: true
|
|
306
|
+
});
|
|
307
|
+
model.applyEdits(edits);
|
|
355
308
|
|
|
356
|
-
|
|
357
|
-
|
|
309
|
+
if (isBottomVisible) {
|
|
310
|
+
this.editor.revealLine(model.getLineCount(), 1);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Refresh the contents of the log component with the updated filter text
|
|
315
|
+
*/
|
|
358
316
|
|
|
359
|
-
if (shownLogLevels[message.logLevel]) {
|
|
360
|
-
var logText = LogView.getLogText(message);
|
|
361
317
|
|
|
362
|
-
|
|
363
|
-
|
|
318
|
+
refreshLogText() {
|
|
319
|
+
if (!this.editor) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
364
322
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
323
|
+
this.truncateLogIfNecessary();
|
|
324
|
+
var {
|
|
325
|
+
shownLogLevels
|
|
326
|
+
} = this.state;
|
|
327
|
+
var isBottomVisible = this.isBottomVisible();
|
|
328
|
+
var text = '';
|
|
371
329
|
|
|
372
|
-
|
|
373
|
-
this.
|
|
330
|
+
for (var i = 0; i < this.messages.length; i += 1) {
|
|
331
|
+
var message = this.messages[i];
|
|
374
332
|
|
|
375
|
-
if (
|
|
376
|
-
var
|
|
377
|
-
this.editor.revealLine(line, 1);
|
|
378
|
-
}
|
|
333
|
+
if (shownLogLevels[message.logLevel]) {
|
|
334
|
+
var logText = LogView.getLogText(message);
|
|
379
335
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
this.messages = this.messages.splice(this.messages.length - LogView.truncateSize);
|
|
336
|
+
if (logText.length > 0) {
|
|
337
|
+
text += logText;
|
|
338
|
+
|
|
339
|
+
if (logText.charAt(logText.length - 1) !== '\n') {
|
|
340
|
+
text += '\n';
|
|
341
|
+
}
|
|
342
|
+
}
|
|
388
343
|
}
|
|
389
344
|
}
|
|
390
|
-
}, {
|
|
391
|
-
key: "scrollToBottom",
|
|
392
|
-
value: function scrollToBottom() {
|
|
393
|
-
if (!this.editor) {
|
|
394
|
-
return;
|
|
395
|
-
}
|
|
396
345
|
|
|
346
|
+
text = text.trimRight();
|
|
347
|
+
this.editor.setValue(text);
|
|
348
|
+
|
|
349
|
+
if (isBottomVisible) {
|
|
397
350
|
var line = this.editor.getModel().getLineCount();
|
|
398
351
|
this.editor.revealLine(line, 1);
|
|
399
352
|
}
|
|
400
|
-
}, {
|
|
401
|
-
key: "isBottomVisible",
|
|
402
|
-
value: function isBottomVisible() {
|
|
403
|
-
if (!this.editor) {
|
|
404
|
-
return true;
|
|
405
|
-
}
|
|
406
353
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
354
|
+
this.stopFlushTimer();
|
|
355
|
+
this.bufferedMessages = [];
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
truncateLogIfNecessary() {
|
|
359
|
+
if (this.messages.length > LogView.maxLogSize) {
|
|
360
|
+
this.messages = this.messages.splice(this.messages.length - LogView.truncateSize);
|
|
410
361
|
}
|
|
411
|
-
}
|
|
412
|
-
key: "isLineVisible",
|
|
413
|
-
value: function isLineVisible(line) {
|
|
414
|
-
var visibleRanges = this.editor.getVisibleRanges();
|
|
362
|
+
}
|
|
415
363
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
364
|
+
scrollToBottom() {
|
|
365
|
+
if (!this.editor) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
419
368
|
|
|
420
|
-
|
|
421
|
-
|
|
369
|
+
var line = this.editor.getModel().getLineCount();
|
|
370
|
+
this.editor.revealLine(line, 1);
|
|
371
|
+
}
|
|
422
372
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
373
|
+
isBottomVisible() {
|
|
374
|
+
if (!this.editor) {
|
|
375
|
+
return true;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
var model = this.editor.getModel();
|
|
379
|
+
var line = model.getLineCount();
|
|
380
|
+
return this.isLineVisible(line);
|
|
381
|
+
}
|
|
427
382
|
|
|
383
|
+
isLineVisible(line) {
|
|
384
|
+
var visibleRanges = this.editor.getVisibleRanges();
|
|
385
|
+
|
|
386
|
+
if (visibleRanges == null || visibleRanges.length === 0) {
|
|
428
387
|
return false;
|
|
429
388
|
}
|
|
430
|
-
/** Checks if the given log message is visible with the current filters */
|
|
431
389
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
390
|
+
for (var i = 0; i < visibleRanges.length; i += 1) {
|
|
391
|
+
var range = visibleRanges[i];
|
|
392
|
+
|
|
393
|
+
if (range.startLineNumber <= line && line <= range.endLineNumber) {
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
437
396
|
}
|
|
438
|
-
}, {
|
|
439
|
-
key: "flush",
|
|
440
|
-
value: function flush() {
|
|
441
|
-
var text = '';
|
|
442
397
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
text += logText;
|
|
398
|
+
return false;
|
|
399
|
+
}
|
|
400
|
+
/** Checks if the given log message is visible with the current filters */
|
|
447
401
|
|
|
448
|
-
if (logText.charAt(logText.length - 1) !== '\n') {
|
|
449
|
-
text += '\n';
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
402
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
this.bufferedMessages.push(message);
|
|
403
|
+
isLogItemVisible(message) {
|
|
404
|
+
var {
|
|
405
|
+
shownLogLevels
|
|
406
|
+
} = this.state;
|
|
407
|
+
return shownLogLevels[message.logLevel];
|
|
408
|
+
}
|
|
460
409
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
410
|
+
flush() {
|
|
411
|
+
var text = '';
|
|
412
|
+
|
|
413
|
+
for (var i = 0; i < this.bufferedMessages.length; i += 1) {
|
|
414
|
+
var message = this.bufferedMessages[i];
|
|
415
|
+
var logText = LogView.getLogText(message);
|
|
416
|
+
text += logText;
|
|
417
|
+
|
|
418
|
+
if (logText.charAt(logText.length - 1) !== '\n') {
|
|
419
|
+
text += '\n';
|
|
471
420
|
}
|
|
472
421
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
422
|
+
|
|
423
|
+
this.bufferedMessages = [];
|
|
424
|
+
this.appendLogText(text);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
queue(message) {
|
|
428
|
+
this.bufferedMessages.push(message);
|
|
429
|
+
|
|
430
|
+
if (this.bufferedMessages.length === 1) {
|
|
431
|
+
this.flushTimer = setTimeout(this.handleFlushTimeout, LogView.bufferTimeout);
|
|
479
432
|
}
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
stopFlushTimer() {
|
|
436
|
+
if (this.flushTimer) {
|
|
437
|
+
clearTimeout(this.flushTimer);
|
|
438
|
+
this.flushTimer = null;
|
|
484
439
|
}
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
this.
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
updateDimensions() {
|
|
443
|
+
if (this.editor) {
|
|
444
|
+
this.editor.layout();
|
|
490
445
|
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
handleClearClick() {
|
|
449
|
+
this.clearLogs();
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
clearLogs() {
|
|
453
|
+
this.messages = [];
|
|
454
|
+
this.refreshLogText();
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
handleFlushTimeout() {
|
|
458
|
+
this.stopFlushTimer();
|
|
459
|
+
this.flush();
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
handleLogMessage(message) {
|
|
463
|
+
this.messages.push(message);
|
|
464
|
+
|
|
465
|
+
if (this.editor && this.isLogItemVisible(message)) {
|
|
466
|
+
this.queue(message);
|
|
496
467
|
}
|
|
497
|
-
}
|
|
498
|
-
key: "handleLogMessage",
|
|
499
|
-
value: function handleLogMessage(message) {
|
|
500
|
-
this.messages.push(message);
|
|
468
|
+
}
|
|
501
469
|
|
|
502
|
-
|
|
503
|
-
|
|
470
|
+
handleMenuItemClick(logLevel) {
|
|
471
|
+
this.toggleLogLevel(logLevel);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
handleResetClick() {
|
|
475
|
+
this.resetLogLevels();
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
handleResize() {
|
|
479
|
+
this.updateDimensions();
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
handleToggleAllClick() {
|
|
483
|
+
this.toggleAll();
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
render() {
|
|
487
|
+
var popperOptions = {
|
|
488
|
+
placement: 'bottom-end'
|
|
489
|
+
};
|
|
490
|
+
var {
|
|
491
|
+
shownLogLevels
|
|
492
|
+
} = this.state;
|
|
493
|
+
var actions = this.getMenuActions(shownLogLevels);
|
|
494
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
495
|
+
className: "log-pane h-100 w-100"
|
|
496
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
497
|
+
className: "log-pane-menu"
|
|
498
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
499
|
+
type: "button",
|
|
500
|
+
className: "btn btn-link btn-link-icon btn-clear-logs",
|
|
501
|
+
onClick: this.handleClearClick
|
|
502
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
503
|
+
icon: dhTrashUndo
|
|
504
|
+
}), /*#__PURE__*/React.createElement(Tooltip, null, "Clear log")), /*#__PURE__*/React.createElement("button", {
|
|
505
|
+
type: "button",
|
|
506
|
+
className: "btn btn-link btn-link-icon btn-overflow"
|
|
507
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
508
|
+
icon: vsGear
|
|
509
|
+
}), /*#__PURE__*/React.createElement(Tooltip, null, "Log Settings"), /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
510
|
+
actions: actions,
|
|
511
|
+
popperClassName: "log-level-menu-popper",
|
|
512
|
+
popperOptions: popperOptions
|
|
513
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
514
|
+
className: "log-pane-editor h-100 w-100",
|
|
515
|
+
ref: editorContainer => {
|
|
516
|
+
this.editorContainer = editorContainer;
|
|
504
517
|
}
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
key: "handleMenuItemClick",
|
|
508
|
-
value: function handleMenuItemClick(logLevel) {
|
|
509
|
-
this.toggleLogLevel(logLevel);
|
|
510
|
-
}
|
|
511
|
-
}, {
|
|
512
|
-
key: "handleResetClick",
|
|
513
|
-
value: function handleResetClick() {
|
|
514
|
-
this.resetLogLevels();
|
|
515
|
-
}
|
|
516
|
-
}, {
|
|
517
|
-
key: "handleResize",
|
|
518
|
-
value: function handleResize() {
|
|
519
|
-
this.updateDimensions();
|
|
520
|
-
}
|
|
521
|
-
}, {
|
|
522
|
-
key: "handleToggleAllClick",
|
|
523
|
-
value: function handleToggleAllClick() {
|
|
524
|
-
this.toggleAll();
|
|
525
|
-
}
|
|
526
|
-
}, {
|
|
527
|
-
key: "render",
|
|
528
|
-
value: function render() {
|
|
529
|
-
var _this4 = this;
|
|
530
|
-
|
|
531
|
-
var popperOptions = {
|
|
532
|
-
placement: 'bottom-end'
|
|
533
|
-
};
|
|
534
|
-
var shownLogLevels = this.state.shownLogLevels;
|
|
535
|
-
var actions = this.getMenuActions(shownLogLevels);
|
|
536
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
537
|
-
className: "log-pane h-100 w-100"
|
|
538
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
539
|
-
className: "log-pane-menu"
|
|
540
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
541
|
-
type: "button",
|
|
542
|
-
className: "btn btn-link btn-link-icon btn-clear-logs",
|
|
543
|
-
onClick: this.handleClearClick
|
|
544
|
-
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
545
|
-
icon: dhTrashUndo
|
|
546
|
-
}), /*#__PURE__*/React.createElement(Tooltip, null, "Clear log")), /*#__PURE__*/React.createElement("button", {
|
|
547
|
-
type: "button",
|
|
548
|
-
className: "btn btn-link btn-link-icon btn-overflow"
|
|
549
|
-
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
550
|
-
icon: vsGear
|
|
551
|
-
}), /*#__PURE__*/React.createElement(Tooltip, null, "Log Settings"), /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
552
|
-
actions: actions,
|
|
553
|
-
popperClassName: "log-level-menu-popper",
|
|
554
|
-
popperOptions: popperOptions
|
|
555
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
556
|
-
className: "log-pane-editor h-100 w-100",
|
|
557
|
-
ref: function ref(editorContainer) {
|
|
558
|
-
_this4.editorContainer = editorContainer;
|
|
559
|
-
}
|
|
560
|
-
}));
|
|
561
|
-
}
|
|
562
|
-
}], [{
|
|
563
|
-
key: "getLogText",
|
|
564
|
-
value:
|
|
565
|
-
/** ms to buffer log messages before processing them */
|
|
566
|
-
|
|
567
|
-
/** Maximum number of messages to store in the log */
|
|
568
|
-
function getLogText(logItem) {
|
|
569
|
-
var date = new Date(logItem.micros / 1000);
|
|
570
|
-
var timestamp = ConsoleUtils.formatTimestamp(date);
|
|
571
|
-
return "".concat(timestamp, " ").concat(logItem.logLevel, " ").concat(logItem.message);
|
|
572
|
-
}
|
|
573
|
-
}]);
|
|
518
|
+
}));
|
|
519
|
+
}
|
|
574
520
|
|
|
575
|
-
|
|
576
|
-
}(PureComponent);
|
|
521
|
+
}
|
|
577
522
|
|
|
578
523
|
_defineProperty(LogView, "DefaultLogLevels", [LogLevel.STDOUT, LogLevel.ERROR, LogLevel.FATAL, LogLevel.STDERR, LogLevel.WARN]);
|
|
579
524
|
|