more work on extracting airplane infos

This commit is contained in:
Jakob Ketterl 2023-09-08 15:38:48 +02:00
parent 018104617d
commit 095bdf38bf
7 changed files with 186 additions and 39 deletions

View file

@ -469,6 +469,9 @@ AircraftMessagePanel = function(el) {
AircraftMessagePanel.prototype = Object.create(MessagePanel.prototype);
AircraftMessagePanel.prototype.renderAcars = function(acars) {
if (acars['more']) {
return '<h4>Partial ACARS message</h4>';
}
var details = '<h4>ACARS message</h4>';
if ('flight' in acars) {
details += '<div>Flight: ' + acars['flight'] + '</div>';
@ -505,6 +508,7 @@ AircraftMessagePanel.prototype.renderAcars = function(acars) {
}
} else {
// plain text
details += '<div>Label: ' + acars['label'] + '</div>';
details += '<div class="acars-message">' + acars['msg_text'] + '</div>';
}
return details;

View file

@ -404,10 +404,11 @@ $(function(){
};
var linkifyAircraft = function(source, identification) {
var aircraftString = identification || source.icao || source.flight;
var aircraftString = identification || source.humanReadable || source.flight || source.icao;
var link = false;
switch (aircraft_tracking_service) {
case 'flightaware':
if (!source.icao) break;
link = 'https://flightaware.com/live/modes/' + source.icao;
if (identification) link += "/ident/" + identification
link += '/redirect';