Add Spot page to allow sig and sig_ref entries. Closes #71

This commit is contained in:
Ian Renton
2025-11-01 12:38:57 +00:00
parent 1ed543872a
commit 0570b39e09
4 changed files with 52 additions and 9 deletions

View File

@@ -13,6 +13,14 @@ function loadOptions() {
}));
});
// Populate SIG drop-down
$.each(options["sigs"], function (i, sig) {
$('#sig').append($('<option>', {
value: sig.name,
text : sig.name
}));
});
// Load settings from settings storage now all the controls are available
loadSettings();
});
@@ -28,6 +36,8 @@ function addSpot() {
var dx = $("#dx-call").val().toUpperCase();
var freqStr = $("#freq").val();
var mode = $("#mode")[0].value;
var sig = $("#sig")[0].value;
var sigRef = $("#sig-ref").val();
var dxGrid = $("#dx-grid").val();
var comment = $("#comment").val();
var de = $("#de-call").val().toUpperCase();
@@ -48,6 +58,12 @@ function addSpot() {
if (mode != "") {
spot["mode"] = mode;
}
if (sig != "") {
spot["sig"] = sig;
}
if (sigRef != "") {
spot["sig_refs"] = [{id: sigRef}];
}
if (dxGrid != "") {
spot["dx_grid"] = dxGrid;
}
@@ -68,7 +84,7 @@ function addSpot() {
type : 'POST',
timeout: 10000,
success: async function (result) {
$("#result-good").html("<button type='button' class='btn btn-success' style='margin-top: 2em;'><i class='fa-solid fa-check'></i> OK</button>");
$("#result-good").html("<div class='alert alert-success fade show mb-0 mt-4' role='alert'><i class='fa-solid fa-check'></i> Spot submitted. Returning you to the spots list...</div>");
$("#result-bad").html("");
setTimeout(() => {
$("#result-good").hide();