Further alert implementation #17

This commit is contained in:
Ian Renton
2025-10-06 17:14:52 +01:00
parent fdb2a445b8
commit e0675a01f0
7 changed files with 280 additions and 22 deletions

View File

@@ -84,12 +84,12 @@ function updateTable() {
// Format a UTC time for display
var time = moment.unix(s["time"]).utc();
var time_formatted = time.format("HH:mm")
var time_formatted = time.format("HH:mm");
// Format dx country
var dx_country = s["dx_country"]
var dx_country = s["dx_country"];
if (dx_country == null) {
dx_country = "Unknown or not a country"
dx_country = "Unknown or not a country";
}
// Format the frequency
@@ -102,7 +102,7 @@ function updateTable() {
// Format the mode
mode_string = s["mode"];
if (s["mode"] == null) {
mode_string = "???"
mode_string = "???";
}
if (s["mode_source"] == "BANDPLAN") {
mode_string = mode_string + "<span class='mode-q hideonmobile'><i class='fa-solid fa-circle-question' title='The mode was not reported via the spotting service. This is a guess based on the frequency.'></i></span>"
@@ -121,9 +121,9 @@ function updateTable() {
}
// Format sig_refs
var sig_refs = ""
var sig_refs = "";
if (s["sig_refs"]) {
sig_refs = s["sig_refs"].join(", ")
sig_refs = s["sig_refs"].join(", ");
}
// Format DE flag
@@ -133,9 +133,9 @@ function updateTable() {
}
// Format de country
var de_country = s["de_country"]
var de_country = s["de_country"];
if (de_country == null) {
de_country = "Unknown or not a country"
de_country = "Unknown or not a country";
}
// CSS doesn't like classes with decimal points in, so we need to replace that in the same way as when we originally
@@ -199,7 +199,7 @@ function loadStatus() {
// Generate a status card
function generateStatusCard(title, textLines) {
let $col = $("<div class='col'>")
let $col = $("<div class='col'>");
let $card = $("<div class='card'>");
let $card_body = $("<div class='card-body'>");
$card_body.append(`<h5 class='card-title'>${title}</h5>`);
@@ -226,12 +226,12 @@ function loadOptions() {
$("#settings-container-2").append(generateFilterCard("Modes", "mode_type", options["mode_types"]));
$("#settings-container-2").append(generateFilterCard("Sources", "source", options["spot_sources"]));
// Load filter settings from settings storage
// Load settings from settings storage
loadSettings();
// Load spots and set up the timer
loadSpots();
setInterval(loadSpots, REFRESH_INTERVAL_SEC * 1000)
setInterval(loadSpots, REFRESH_INTERVAL_SEC * 1000);
});
}