allow people to use custom silhouettes

This commit is contained in:
Matthias Wirth
2021-01-28 18:08:46 +01:00
parent 3b9e324ea9
commit a1375edb7d
5 changed files with 23 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ alias.url += (
"/INSTANCE/data/" => "SOURCE_DIR/",
"/INSTANCE/chunks/" => "/run/SERVICE/",
"/INSTANCE/globe_history/" => "/var/globe_history/",
"/INSTANCE/aircraft_sil/" => "/usr/local/share/tar1090/aircraft_sil/",
"/INSTANCE/" => "HTMLPATH/"
)
@@ -69,6 +70,12 @@ $HTTP["url"] =~ "^/INSTANCE/flags-tiny" {
"Cache-Control" => "public, max-age=1209600",
)
}
$HTTP["url"] =~ "^/INSTANCE/aircraft_sil" {
setenv.add-response-header += (
"Cache-Control" => "public, max-age=1209600",
)
}
$HTTP["url"] =~ "^/INSTANCE/config.js$" {
setenv.add-response-header += (
"Cache-Control" => "public, must-revalidate",

View File

@@ -242,6 +242,13 @@ HideCols = [
]
// showing small pictures / silhouettes
//showPictures = true;
// this shows small pictures in the details but they need to be provided by the user in the folder /usr/local/share/tar1090/aircraft_sil
// pictures need to be named A330.png and so forth with the type code in the form TYPE.png
// provide ZZZZ.png to be shown when the type is not known.
// this feature is provided as is please don't expect tar1090's support for getting the pictures right.
//enableDWD = true;
// Display only the last leg of a flight in globeIndex mode.

View File

@@ -2039,7 +2039,7 @@ function refreshSelected() {
if (showPictures) {
let type = selected.icaoType ? selected.icaoType : 'ZZZZ';
let new_html = "<img width='151.11' height='35.55' src='aircraft_sil/" + type + ".png' />";
let new_html = "<img width='"+ 151.11 * globalScale + "' height='" + 35.55 * globalScale + "' src='aircraft_sil/" + type + ".png' />";
if (new_html != selectedPhotoCache) {
$('#selected_photo').html(new_html);
selectedPhotoCache = new_html;

View File

@@ -16,6 +16,8 @@ lighttpd=no
nginx=no
mkdir -p $ipath
mkdir -p $ipath/aircraft_sil
if ! id -u tar1090 &>/dev/null
then

View File

@@ -52,6 +52,12 @@ location /INSTANCE/chunks/ {
}
}
location /INSTANCE/aircraft_sil/ {
alias /usr/local/share/tar1090/aircraft_sil/;
add_header Cache-Control "public, max-age=1209600";
try_files $uri /aircraft_sil/ZZZZ.png;
}
location /INSTANCE {
alias HTMLPATH/;
try_files $uri $uri/ =404;