Skip to content

Commit

Permalink
allow people to use custom silhouettes
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Jan 28, 2021
1 parent 3b9e324 commit a1375ed
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
7 changes: 7 additions & 0 deletions 88-tar1090.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
)

Expand Down Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions html/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ lighttpd=no
nginx=no

mkdir -p $ipath
mkdir -p $ipath/aircraft_sil


if ! id -u tar1090 &>/dev/null
then
Expand Down
6 changes: 6 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a1375ed

Please sign in to comment.