Skip to content

Commit

Permalink
Merge pull request #1038 from sdr-enthusiasts/extra-stats-and-set-FA-…
Browse files Browse the repository at this point in the history
…as-option

Extra stats and set fa as option
  • Loading branch information
fredclausen authored Nov 19, 2023
2 parents f4b3d4d + dd3bf40 commit 5824c76
Show file tree
Hide file tree
Showing 14 changed files with 532 additions and 441 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ rootfs/webapp/data/metadata.json
rootfs/webapp/data/ground-stations.json
libseccomp2-checker.sh
acarshub/node_modules
.venv
rootfs/webapp/bin
rootfs/webapp/lib
rootfs/webapp/lib64
rootfs/webapp/include
rootfs/webapp/__pycache__
rootfs/webapp/pyvenv.cfg
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,9 @@ rootfs/webapp/static
acarshub/node_modules
**/dist/**
.venv
rootfs/webapp/bin
rootfs/webapp/lib
rootfs/webapp/lib64
rootfs/webapp/include
rootfs/webapp/__pycache__
rootfs/webapp/pyvenv.cfg
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ RUN set -x && \
mkdir -p /webapp/data/ && \
# Download the airframes Ground Station and ACARS Label data
pushd /webapp/data/ && \
curl -O https://raw.githubusercontent.com/airframesio/data/master/json/vdl/ground-stations.json&& \
curl -O https://raw.githubusercontent.com/airframesio/data/master/json/vdl/ground-stations.json && \
curl -O https://raw.githubusercontent.com/airframesio/data/master/json/acars/metadata.json && \
# Clean up
rm -rf /src/* /tmp/* /var/lib/apt/lists/*
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ There are quite a few configuration options this container can accept.
| `TAR1090_URL` | Flights where the container is able to, it will generate a link to a tar1090 instance so that you can see the position of the aircraft that generated the message. By default, it will link to [ADSB Exchange](https://www.adsbexchange.com), but if desired, you can set the URL to be a local tar1090 instance. | No | Blank |
| `AUTO_VACUUM` | If you find your database size to be too large you can temporarily enable this and on the next container startup the database will attempt to reduce itself in size. When you do this startup time will take a few minutes. It is recommended to leave this flag disabled and only enable it temporarily. | No | `False` |
| `ALLOW_REMOTE_UPDATES` | If you do not want to allow users to update the alert terms (and potentially other things in the future) via the web interface, set this to `False` | No | `True` |
| `FLIGHT_TRACKING_URL` | If you want to link to a flight tracking site other than Flight Aware, set this to the URL of the site you want to link to. The url should be formatted to accept tail numbers at the end of the URL. | No | Blank |

Please note that for `TAR1090_URL` the required format is `http[s]://**HOSTNAME**` only. So if your tar1090 instance is at IP address `192.168.31.10` with no SSL, the TAR1090_URL would look like `http://192.168.31.10`

Expand Down
696 changes: 356 additions & 340 deletions acarshub-typescript/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions acarshub-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"license": "GPL-3.0-only",
"devDependencies": {
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.2",
"@types/jquery": "^3.5.25",
"@babel/preset-env": "^7.23.3",
"@types/jquery": "^3.5.27",
"@types/js-cookie": "^3.0.6",
"@types/leaflet": "^1.9.8",
"@types/node": "^20.9.0",
"@types/node": "^20.9.2",
"@types/showdown": "^2.0.4",
"@types/webpack-dev-server": "^4.7.2",
"autoprefixer": "^10.4.16",
Expand All @@ -32,7 +32,7 @@
"postcss-loader": "^7.3.3",
"script-loader": "^0.7.2",
"style-loader": "^3.3.3",
"ts-loader": "^9.5.0",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"webpack": "^5.89.0",
Expand Down
28 changes: 20 additions & 8 deletions acarshub-typescript/src/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -862,19 +862,31 @@ li.img_box svg {
letter-spacing: 0;
}

canvas {
max-height: 400px !important;
/* canvas {
width: 100% !important;
height: 100% !important;
} */

/* .canvas_wrapper {
position: relative;
width: 100%;
max-width: 1000px !important;
}
display: flex;
/* float: left;
} */

.canvas_wrapper {
.chart-container {
position: relative;
width: 1000px;
float: left;
/* min-height: auto; */
width: 100%;
max-width: 1000px !important;
height: 300px;
/* overflow: hidden; */
}

.chart-container {
width: 50%;
#chart_msg_good,
#chart_msg_empty {
height: 150px !important;
}

/* modal window stuff */
Expand Down
3 changes: 2 additions & 1 deletion acarshub-typescript/src/helpers/html_functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export let html_functions = {

show_footer_and_sidebar_text: function (
message: acars_msg,
flight_tracking_url: string,
footer: boolean = true
): string {
let html_output = "";
Expand All @@ -235,7 +236,7 @@ export let html_functions = {
html_output += !footer ? '<div class="show_when_small">' : "";

if (typeof message.tail !== "undefined") {
html_output += `<span class="tail-tooltip">Tail: <strong><a href=\"https://flightaware.com/live/flight/${
html_output += `<span class="tail-tooltip">Tail: <strong><a href=\"${flight_tracking_url}${
message.tail
}\" target=\"_blank\">${
typeof message.matched_tail !== "undefined" &&
Expand Down
12 changes: 10 additions & 2 deletions acarshub-typescript/src/helpers/html_generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// Input: live_page - default is false. This toggles on the checks for selected tabs
import { html_functions } from "./html_functions";
import { acars_msg } from "../interfaces";
import { get_flight_tracking_url } from "../index";

export function display_messages(
msgs_to_process: acars_msg[][],
Expand Down Expand Up @@ -299,15 +300,22 @@ export function display_message_group(
: "";

// Table footer row, tail & flight info, displayed in main body if screen is too small
html_output += html_functions.show_footer_and_sidebar_text(message, false);
html_output += html_functions.show_footer_and_sidebar_text(
message,
get_flight_tracking_url(),
false
);
//html_output += "</td></tr>";
html_output += html_functions.message_text(message);

// Text field is pre-processed
// we have a sub-table for the raw text field and if it was decoded, the decoded text as well

// Table footer row, tail & flight info
html_output += html_functions.show_footer_and_sidebar_text(message);
html_output += html_functions.show_footer_and_sidebar_text(
message,
get_flight_tracking_url()
);

// Finish table html
html_output += html_functions.end_message_box();
Expand Down
8 changes: 8 additions & 0 deletions acarshub-typescript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ let adsb_request_options = {
method: "GET",
} as RequestInit;
let allow_remote_updates = false;
let flight_tracking_url: string | undefined = undefined;

// @ts-expect-error
var hidden, visibilityChange;
Expand Down Expand Up @@ -257,6 +258,7 @@ $((): void => {
stats_page.decoders_enabled(msg);
menu.set_arch(msg.arch);
allow_remote_updates = msg.allow_remote_updates;
flight_tracking_url = msg.adsb.flight_tracking_url;
if (msg.adsb.enabled === true) {
adsb_enabled = true;
menu.set_adsb(true);
Expand Down Expand Up @@ -402,6 +404,12 @@ $((): void => {
}
});

export function get_flight_tracking_url(): string {
return flight_tracking_url
? flight_tracking_url
: "https://flightaware.com/live/flight/";
}

export function get_window_size(): window_size {
return { width: old_window_width, height: old_window_height } as window_size;
}
Expand Down
1 change: 1 addition & 0 deletions acarshub-typescript/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export interface decoders {
url: string;
bypass: boolean;
range_rings: boolean;
flight_tracking_url: string;
};
}

Expand Down
Loading

0 comments on commit 5824c76

Please sign in to comment.