Change styling for registration numbers that are used as idents. Hide UAT message rate if UAT is disabled.

This commit is contained in:
eric1tran 2021-02-25 15:42:16 +00:00
parent e23cd7e73b
commit e8fe48485e
3 changed files with 23 additions and 8 deletions

View File

@ -218,7 +218,7 @@
<tr class="infoblock_body"> <tr class="infoblock_body">
<td><span class="infoBlockTitleText">With Positions:</span> <span id="dump1090_total_ac_positions">n/a</span></td> <td><span class="infoBlockTitleText">With Positions:</span> <span id="dump1090_total_ac_positions">n/a</span></td>
<td><span class="infoBlockTitleText">UAT Message Rate:</span> <span id="uat_message_rate">n/a</span></td> <td id="uat_message_rate_row"><span class="infoBlockTitleText">UAT Message Rate:</span> <span id="uat_message_rate">n/a</span></td>
</tr> </tr>
<tr class="infoblock_body"> <tr class="infoblock_body">
<td><span class="infoBlockTitleText">Position History:</span> <span id="dump1090_total_history">n/a</span></td> <td><span class="infoBlockTitleText">Position History:</span> <span id="dump1090_total_history">n/a</span></td>

View File

@ -1307,8 +1307,13 @@ function refreshSelected() {
$('#dump1090_message_rate').text(MessageRate.toFixed(1) + '/sec'); $('#dump1090_message_rate').text(MessageRate.toFixed(1) + '/sec');
} }
if (UatMessageRate !== null) { if (UAT_Enabled) {
$('#uat_message_rate').text(UatMessageRate.toFixed(1) + '/sec'); $('#uat_message_rate_row').show();
if (UatMessageRate !== null) {
$('#uat_message_rate').text(UatMessageRate.toFixed(1) + '/sec');
}
} else {
$('#uat_message_rate_row').hide();
} }
setSelectedInfoBlockVisibility(); setSelectedInfoBlockVisibility();
@ -1692,10 +1697,16 @@ function refreshTableInfo() {
// ICAO doesn't change // ICAO doesn't change
if (tableplane.flight) { if (tableplane.flight) {
tableplane.tr.cells[2].innerHTML = getFlightAwareModeSLink(tableplane.icao, tableplane.flight, tableplane.flight); tableplane.tr.cells[2].innerHTML = getFlightAwareModeSLink(tableplane.icao, tableplane.flight, tableplane.flight);
tableplane.tr.cells[2].className = "ident_normal";
} else if (tableplane.registration !== null) {
// Show registration with special styling if ident is not present
tableplane.tr.cells[2].innerHTML = getFlightAwareIdentLink(tableplane.registration, tableplane.registration);
tableplane.tr.cells[2].className = "ident_fallback";
} else { } else {
// Show _registration if ident is not present tableplane.tr.cells[2].innerHTML = "";
tableplane.tr.cells[2].innerHTML = (tableplane.registration !== null ? getFlightAwareIdentLink(tableplane.registration, '_' + tableplane.registration) : ""); tableplane.tr.cells[2].className = "";
} }
tableplane.tr.cells[3].textContent = (tableplane.registration !== null ? tableplane.registration : ""); tableplane.tr.cells[3].textContent = (tableplane.registration !== null ? tableplane.registration : "");
tableplane.tr.cells[4].textContent = (tableplane.icaotype !== null ? tableplane.icaotype : ""); tableplane.tr.cells[4].textContent = (tableplane.icaotype !== null ? tableplane.icaotype : "");
tableplane.tr.cells[5].textContent = (tableplane.squawk !== null ? tableplane.squawk : ""); tableplane.tr.cells[5].textContent = (tableplane.squawk !== null ? tableplane.squawk : "");
@ -2424,7 +2435,7 @@ function getFlightAwareIdentLink(ident, linkText) {
if (!linkText) { if (!linkText) {
linkText = ident; linkText = ident;
} }
return "<a target=\"_blank\" href=\"https://flightaware.com/live/flight/" + ident.trim() + "\">" + linkText + "</a>"; return "<a target=\"_blank\" href=\"https://flightaware.com/live/flight/" + ident.trim() + "\"><span title=\"Bold ident indicates this is an aircraft registration number\"> " + linkText + "</span></a>";
} }
return ""; return "";

View File

@ -239,6 +239,7 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right:
background-color: #002F5D; background-color: #002F5D;
color: #FFFFFF; color: #FFFFFF;
cursor: pointer; cursor: pointer;
white-space: nowrap;
} }
.aircraft_table_header td { .aircraft_table_header td {
font-size: smaller; font-size: smaller;
@ -271,6 +272,9 @@ div#loader { z-index: 99; position: absolute; left: 0; top: 0; bottom: 0; right:
cursor: pointer; cursor: pointer;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
} }
.ident_normal { font-weight: normal; font-style: normal; }
.ident_fallback { font-weight: bold; font-style: italic; }
.hidden { display: none; } .hidden { display: none; }
.infoblock_heading { font-size: larger; } .infoblock_heading { font-size: larger; }
@ -950,4 +954,4 @@ select.error, textarea.error, input.error {
.ui-resizable { .ui-resizable {
min-width: 400px; min-width: 400px;
} }