mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-04-20 22:05:13 +00:00
introduce some frontend to show messages
This commit is contained in:
parent
387d94b4ce
commit
476e4ebc5b
4 changed files with 46 additions and 0 deletions
|
|
@ -268,4 +268,46 @@ $.fn.pocsagMessagePanel = function() {
|
|||
this.data('panel', new PocsagMessagePanel(this));
|
||||
}
|
||||
return this.data('panel');
|
||||
};
|
||||
|
||||
AdsbMessagePanel = function(el) {
|
||||
MessagePanel.call(this, el);
|
||||
this.initClearTimer();
|
||||
}
|
||||
|
||||
AdsbMessagePanel.prototype = new MessagePanel();
|
||||
|
||||
AdsbMessagePanel.prototype.supportsMessage = function(message) {
|
||||
return message["mode"] === "ADSB";
|
||||
};
|
||||
|
||||
AdsbMessagePanel.prototype.render = function() {
|
||||
$(this.el).append($(
|
||||
'<table>' +
|
||||
'<thead><tr>' +
|
||||
'<th class="address">ICAO</th>' +
|
||||
'<th class="message">Message</th>' +
|
||||
'</tr></thead>' +
|
||||
'<tbody></tbody>' +
|
||||
'</table>'
|
||||
));
|
||||
};
|
||||
|
||||
|
||||
AdsbMessagePanel.prototype.pushMessage = function(message) {
|
||||
var $b = $(this.el).find('tbody');
|
||||
$b.append($(
|
||||
'<tr>' +
|
||||
'<td class="address"></td>' +
|
||||
'<td class="message">' + JSON.stringify(message) + '</td>' +
|
||||
'</tr>'
|
||||
));
|
||||
$b.scrollTop($b[0].scrollHeight);
|
||||
};
|
||||
|
||||
$.fn.adsbMessagePanel = function () {
|
||||
if (!this.data('panel')) {
|
||||
this.data('panel', new AdsbMessagePanel(this));
|
||||
}
|
||||
return this.data('panel');
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue