From 887aaeb369582d3835f6ca336959e98c813c8cbb Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Wed, 12 Feb 2025 09:00:03 -0700 Subject: [PATCH 1/3] force hex display to be 6 digits --- .../src/helpers/html_functions.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/acarshub-typescript/src/helpers/html_functions.ts b/acarshub-typescript/src/helpers/html_functions.ts index 4c84a94e5..96ab1771c 100644 --- a/acarshub-typescript/src/helpers/html_functions.ts +++ b/acarshub-typescript/src/helpers/html_functions.ts @@ -265,13 +265,17 @@ export let html_functions = { : ""; html_output += typeof message.matched_icao === "object" - ? this.replace_text(message.matched_icao, message.icao.toString()) + - `${!footer ? "
" : ""}` + ? this.replace_text( + message.matched_icao, + this.ensure_hex_is_uppercase_and_six_chars( + message.icao.toString() + ) + ) + `${!footer ? "
" : ""}` : `${message.icao}`; html_output += typeof message.icao_hex !== "undefined" && typeof message.matched_icao === "undefined" - ? `/${message.icao_hex}` + ? `/${this.ensure_hex_is_uppercase_and_six_chars(message.icao_hex)}` : ""; html_output += typeof message.icao_hex !== "undefined" && @@ -280,7 +284,9 @@ export let html_functions = { ? "/" + this.replace_text( message.matched_icao, - message.icao_hex.toString() + this.ensure_hex_is_uppercase_and_six_chars( + message.icao_hex.toString() + ) ) + `${!footer ? "
" : ""}` : ""; @@ -382,4 +388,8 @@ export let html_functions = { return html_output; }, + + ensure_hex_is_uppercase_and_six_chars: function (hex: string): string { + return "0x" + hex.toUpperCase().padStart(6, "0"); + }, }; From e01a0dabcb0d61ac361aa125d8f5b0b2477740fd Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Wed, 12 Feb 2025 09:05:38 -0700 Subject: [PATCH 2/3] Remove 0x and also cover station hex addrs --- acarshub-typescript/src/helpers/html_functions.ts | 2 +- acarshub-typescript/src/helpers/html_generator.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/acarshub-typescript/src/helpers/html_functions.ts b/acarshub-typescript/src/helpers/html_functions.ts index 96ab1771c..10168d5d3 100644 --- a/acarshub-typescript/src/helpers/html_functions.ts +++ b/acarshub-typescript/src/helpers/html_functions.ts @@ -390,6 +390,6 @@ export let html_functions = { }, ensure_hex_is_uppercase_and_six_chars: function (hex: string): string { - return "0x" + hex.toUpperCase().padStart(6, "0"); + return hex.toUpperCase().padStart(6, "0"); }, }; diff --git a/acarshub-typescript/src/helpers/html_generator.ts b/acarshub-typescript/src/helpers/html_generator.ts index ece688d7b..60704b665 100644 --- a/acarshub-typescript/src/helpers/html_generator.ts +++ b/acarshub-typescript/src/helpers/html_generator.ts @@ -212,7 +212,10 @@ export function display_message_group( "To Address", message.toaddr + (typeof message.toaddr_hex !== "undefined" - ? "/" + message.toaddr_hex + ? "/" + + html_functions.ensure_hex_is_uppercase_and_six_chars( + message.toaddr_hex + ) : "/?") ) : ""; @@ -231,7 +234,10 @@ export function display_message_group( "From Address", message.fromaddr + (typeof message.fromaddr_hex !== "undefined" - ? "/" + message.fromaddr_hex + ? "/" + + html_functions.ensure_hex_is_uppercase_and_six_chars( + message.fromaddr_hex + ) : "/?") ) : ""; From 640d5f38ba620b29258bdfff0597015037a0ca34 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Wed, 12 Feb 2025 09:06:21 -0700 Subject: [PATCH 3/3] bump version --- acarshub-typescript/package.json | 2 +- version-nextgen | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acarshub-typescript/package.json b/acarshub-typescript/package.json index f20fda546..f140115b4 100644 --- a/acarshub-typescript/package.json +++ b/acarshub-typescript/package.json @@ -1,6 +1,6 @@ { "name": "acarshub-typescript", - "version": "3.8.0", + "version": "3.8.1", "description": "Web front end for the docker-acarshub project", "main": "index.js", "repository": "https://github.com/sdr-enthusiasts/docker-acarshub", diff --git a/version-nextgen b/version-nextgen index 40c06ccb7..32f8572ea 100644 --- a/version-nextgen +++ b/version-nextgen @@ -1 +1 @@ -v3.8.0 +v3.8.1