@xh/hoist 73.0.0-SNAPSHOT.1744653564971 → 73.0.0-SNAPSHOT.1744672102009
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.
|
@@ -138,18 +138,23 @@ export class LogDisplayModel extends HoistModel {
|
|
|
138
138
|
sizingMode: 'tiny',
|
|
139
139
|
emptyText: 'No log entries found...',
|
|
140
140
|
sortBy: 'rowNum|asc',
|
|
141
|
+
autosizeOptions: {mode: 'disabled'},
|
|
141
142
|
store: {
|
|
142
143
|
idSpec: 'rowNum'
|
|
143
144
|
},
|
|
144
145
|
columns: [
|
|
145
146
|
{
|
|
146
147
|
field: {name: 'rowNum', type: 'number'},
|
|
147
|
-
width:
|
|
148
|
+
width: 60,
|
|
149
|
+
pinned: true,
|
|
148
150
|
cellClass: 'xh-log-display__row-number'
|
|
149
151
|
},
|
|
150
152
|
{
|
|
151
153
|
field: 'rowContent',
|
|
152
|
-
|
|
154
|
+
// Hard-code to a very wide value - allows us to avoid autosize overhead while
|
|
155
|
+
// ensuring that all but crazy-long lines are readable. We trust Admins can
|
|
156
|
+
// ignore excess horizontal scrolling for this component.
|
|
157
|
+
width: 5000,
|
|
153
158
|
autosizable: false,
|
|
154
159
|
cellClass: 'xh-log-display__row-content'
|
|
155
160
|
}
|
|
@@ -179,20 +184,11 @@ export class LogDisplayModel extends HoistModel {
|
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
private updateGridData(data) {
|
|
182
|
-
const {tailActive, gridModel} = this
|
|
183
|
-
|
|
184
|
-
const gridData = data.map(row => {
|
|
185
|
-
if (row[1].length > maxRowLength) {
|
|
186
|
-
maxRowLength = row[1].length;
|
|
187
|
-
}
|
|
188
|
-
return {
|
|
187
|
+
const {tailActive, gridModel} = this,
|
|
188
|
+
gridData = data.map(row => ({
|
|
189
189
|
rowNum: row[0],
|
|
190
190
|
rowContent: row[1]
|
|
191
|
-
};
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
// Estimate the length of the row in pixels based on (character count) * (font size)
|
|
195
|
-
gridModel.setColumnState([{colId: 'rowContent', width: maxRowLength * 6}]);
|
|
191
|
+
}));
|
|
196
192
|
|
|
197
193
|
gridModel.loadData(gridData);
|
|
198
194
|
|
|
@@ -83,6 +83,7 @@ export declare class WebSocketService extends HoistService {
|
|
|
83
83
|
private buildWebSocketUrl;
|
|
84
84
|
private maybeLogMessage;
|
|
85
85
|
private noteTelemetryEvent;
|
|
86
|
+
private ensureEnabled;
|
|
86
87
|
}
|
|
87
88
|
/**
|
|
88
89
|
* Wrapper class to encapsulate and manage a subscription to messages for a given topic + handler.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "73.0.0-SNAPSHOT.
|
|
3
|
+
"version": "73.0.0-SNAPSHOT.1744672102009",
|
|
4
4
|
"description": "Hoist add-on for building and deploying React Applications.",
|
|
5
5
|
"repository": "github:xh/hoist-react",
|
|
6
6
|
"homepage": "https://xh.io",
|
package/svc/WebSocketService.ts
CHANGED
|
@@ -108,6 +108,7 @@ export class WebSocketService extends HoistService {
|
|
|
108
108
|
* dispose of their subs on destroy.
|
|
109
109
|
*/
|
|
110
110
|
subscribe(topic: string, fn: (msg: WebSocketMessage) => any): WebSocketSubscription {
|
|
111
|
+
this.ensureEnabled();
|
|
111
112
|
const subs = this.getSubsForTopic(topic),
|
|
112
113
|
existingSub = find(subs, {fn});
|
|
113
114
|
|
|
@@ -125,6 +126,7 @@ export class WebSocketService extends HoistService {
|
|
|
125
126
|
* @param subscription - WebSocketSubscription returned when the subscription was established.
|
|
126
127
|
*/
|
|
127
128
|
unsubscribe(subscription: WebSocketSubscription) {
|
|
129
|
+
this.ensureEnabled();
|
|
128
130
|
const subs = this.getSubsForTopic(subscription.topic);
|
|
129
131
|
pull(subs, subscription);
|
|
130
132
|
this.telemetry.subscriptionCount--;
|
|
@@ -134,6 +136,7 @@ export class WebSocketService extends HoistService {
|
|
|
134
136
|
* Send a message back to the server via the connected websocket.
|
|
135
137
|
*/
|
|
136
138
|
sendMessage(message: WebSocketMessage) {
|
|
139
|
+
this.ensureEnabled();
|
|
137
140
|
this.updateConnectedStatus();
|
|
138
141
|
throwIf(!this.connected, 'Unable to send message via websocket - not connected.');
|
|
139
142
|
|
|
@@ -319,6 +322,10 @@ export class WebSocketService extends HoistService {
|
|
|
319
322
|
evtTel.count++;
|
|
320
323
|
evtTel.lastTime = Date.now();
|
|
321
324
|
}
|
|
325
|
+
|
|
326
|
+
private ensureEnabled() {
|
|
327
|
+
throwIf(!this.enabled, 'Operation not available. WebSocketService is disabled.');
|
|
328
|
+
}
|
|
322
329
|
}
|
|
323
330
|
|
|
324
331
|
/**
|