diff --git a/88-tar1090.conf b/88-tar1090.conf index bce3f4d..e9b5773 100644 --- a/88-tar1090.conf +++ b/88-tar1090.conf @@ -13,6 +13,13 @@ alias.url += ( "/INSTANCE/" => "HTMLPATH/" ) +$HTTP["url"] =~ "^/INSTANCE/data/.*\.binCraft$" { + compress.filetype = () + setenv.add-response-header += ( + "Cache-Control" => "no-cache", + "Content-Encoding" => "gzip", + ) +} $HTTP["url"] =~ "^/INSTANCE/chunks/chunk_.*gz$" { setenv.add-response-header += ( "Access-Control-Allow-Origin" => "*", diff --git a/html/early.js b/html/early.js index 3a42857..503921f 100644 --- a/html/early.js +++ b/html/early.js @@ -366,10 +366,10 @@ if (uuid != null) { Dump1090Version = data.version; RefreshInterval = data.refresh; nHistoryItems = (data.history < 2) ? 0 : data.history; - binCraft = data.binCraft ? true : false; + binCraft = data.binCraft ? true : false || data.aircraft_binCraft ? true : false; if (usp.has('noglobe') || usp.has('ptracks')) { data.globeIndexGrid = null; // disable globe on user request - binCraft = false; + binCraft = data.aircraft_binCraft ? true : false; } dbServer = (data.dbServer && data.globeIndexGrid != null) ? true : false; diff --git a/html/formatter.js b/html/formatter.js index ff181db..d3a98b3 100644 --- a/html/formatter.js +++ b/html/formatter.js @@ -346,7 +346,7 @@ function iOSVersion() { function wqi(data) { const buffer = data.buffer; - let vals = new Uint32Array(data.buffer, 0, 5); + let vals = new Uint32Array(data.buffer, 0, 8); data.now = vals[0] / 1000 + vals[1] * 4294967.296; let stride = vals[2]; data.global_ac_count_withpos = vals[3]; @@ -358,6 +358,8 @@ function wqi(data) { data.north = limits[2]; data.east = limits[3]; + data.messages = vals[7]; + data.aircraft = []; for (let off = stride; off < buffer.byteLength; off += stride) { let ac = {} diff --git a/html/markers.js b/html/markers.js index 5115bb2..e8e246a 100644 --- a/html/markers.js +++ b/html/markers.js @@ -988,6 +988,8 @@ let TypeDesignatorIcons = { 'GAZL': ['gazelle', 1.00], 'AS50': ['gazelle', 1.00], 'AS55': ['gazelle', 1.00], + 'ALO2': ['gazelle', 1.00], + 'ALO3': ['gazelle', 1.00], 'R22': ['helicopter', 0.92], 'R44': ['helicopter', 0.94], diff --git a/html/script.js b/html/script.js index 2e88b81..a4b4cc2 100644 --- a/html/script.js +++ b/html/script.js @@ -261,7 +261,7 @@ function processReceiverUpdate(data, init) { globeIndexNow[data.globeIndex] = data.now; } - if (!uat && !init && !globeIndex && !binCraft) + if (!uat && !init && !globeIndex) updateMessageRate(data); // Loop through all the planes in the data packet @@ -344,8 +344,10 @@ function fetchData(options) { ac_url.push('data/globe' + mid + indexes[i].toString().padStart(4, '0') + suffix); } } + } else if (binCraft) { + ac_url.push = 'data/aircraft.binCraft'; } else { - ac_url[0] = 'data/aircraft.json'; + ac_url.push = 'data/aircraft.json'; } pendingFetches = ac_url.length; @@ -5073,7 +5075,7 @@ function refreshInt() { // handle globe case - if (binCraft && onlyMilitary && OLMap.getView().getZoom() < 5.5) { + if (binCraft && globeIndex && onlyMilitary && OLMap.getView().getZoom() < 5.5) { refresh = 8000; } diff --git a/nginx.conf b/nginx.conf index 869fd48..3601c3e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -23,9 +23,9 @@ location /INSTANCE/data/ { add_header Cache-Control "public, max-age=0"; add_header Content-Encoding "gzip"; } - location ~ globe.*\.binCraft$ { + location ~ .*\.binCraft$ { gzip off; - add_header Cache-Control "public, max-age=0"; + add_header Cache-Control "no-cache"; add_header Content-Encoding "gzip"; } }