add dumpvdl2 basic infrastructure

This commit is contained in:
Jakob Ketterl 2023-09-04 19:02:43 +02:00
parent f794f285f3
commit e934a3935c
9 changed files with 102 additions and 8 deletions

View file

@ -473,10 +473,7 @@ HfdlMessagePanel.prototype.render = function() {
$(this.el).append($(
'<table>' +
'<thead><tr>' +
'<th class="model">Model</th>' +
'<th class="id">ID</th>' +
'<th class="channel">Channel</th>' +
'<th class="data">Data</th>' +
'<th class="todo">TODO</th>' +
'</tr></thead>' +
'<tbody></tbody>' +
'</table>'
@ -488,7 +485,12 @@ HfdlMessagePanel.prototype.supportsMessage = function(message) {
};
HfdlMessagePanel.prototype.pushMessage = function(message) {
console.info(message);
var $b = $(this.el).find('tbody');
$b.append($(
'<tr>' +
'<td class="todo">' + JSON.stringify(message) + '</td>' +
'</tr>'
));
};
$.fn.hfdlMessagePanel = function() {
@ -496,4 +498,43 @@ $.fn.hfdlMessagePanel = function() {
this.data('panel', new HfdlMessagePanel(this));
}
return this.data('panel');
};
Vdl2MessagePanel = function(el) {
MessagePanel.apply(this, el);
this.initClearTimer();
}
Vdl2MessagePanel.prototype = new MessagePanel();
Vdl2MessagePanel.prototype.render = function() {
$(this.el).append($(
'<table>' +
'<thead><tr>' +
'<th class="todo">TODO</th>' +
'</tr></thead>' +
'<tbody></tbody>' +
'</table>'
));
};
Vdl2MessagePanel.prototype.supportsMessage = function(message) {
return message['mode'] === 'VDL2';
};
Vdl2MessagePanel.prototype.pushMessage = function(message) {
var $b = $(this.el).find('tbody');
$b.append($(
'<tr>' +
'<td class="todo">' + JSON.stringify(message) + '</td>' +
'</tr>'
));
this.scrollToBottom();
};
$.fn.vdl2MessagePanel = function() {
if (!this.data('panel')) {
this.data('panel', new Vdl2MessagePanel(this));
}
return this.data('panel');
};