mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Support RSGB contests
This commit is contained in:
@@ -19,8 +19,9 @@ info:
|
||||
|
||||
* Added DTMBA, FEA, BIWOTA, COTA & PGA SIGs
|
||||
* Removed the distinction between LSB & USB (both will now show as SSB) and between the various digital voice modes, which will now show as DV.
|
||||
* Added `sig_type`, `icon`, `region_flag` and `refs_globally_unique` to SIG information
|
||||
* Unknown modes and mode types now return "UNKNOWN" not null
|
||||
* Added `sig_type`, `icon`, `region_flag` and `refs_globally_unique` to SIG data
|
||||
* Added `alert_type` and `url` to alert data
|
||||
* Added `contests_skip_max_duration_check` to alert query parameters
|
||||
* SIG reference types (e.g. "Park") are now capitalised to match other enums
|
||||
|
||||
### 2.0
|
||||
@@ -209,6 +210,7 @@ paths:
|
||||
- $ref: '#/components/parameters/AlertReceivedSince'
|
||||
- $ref: '#/components/parameters/AlertMaxDuration'
|
||||
- $ref: '#/components/parameters/AlertDxpeditionsSkipMaxDurationCheck'
|
||||
- $ref: '#/components/parameters/AlertContestsSkipMaxDurationCheck'
|
||||
- $ref: '#/components/parameters/AlertSource'
|
||||
- $ref: '#/components/parameters/AlertSig'
|
||||
- $ref: '#/components/parameters/AlertDxContinent'
|
||||
@@ -243,6 +245,7 @@ paths:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/AlertMaxDuration'
|
||||
- $ref: '#/components/parameters/AlertDxpeditionsSkipMaxDurationCheck'
|
||||
- $ref: '#/components/parameters/AlertContestsSkipMaxDurationCheck'
|
||||
- $ref: '#/components/parameters/AlertSource'
|
||||
- $ref: '#/components/parameters/AlertSig'
|
||||
- $ref: '#/components/parameters/AlertDxContinent'
|
||||
@@ -661,8 +664,8 @@ components:
|
||||
time minus start time, if end time is set, otherwise the activation is assumed to be short and
|
||||
therefore to always pass this check. This is useful to filter out people who alert POTA
|
||||
activations lasting months or even years, but note it will also include multi-day or multi-week
|
||||
DXpeditions that you might otherwise be interested in. See the
|
||||
dxpeditions_skip_max_duration_check parameter for the workaround.
|
||||
DXpeditions or contests that you might otherwise be interested in. See the
|
||||
dxpeditions_skip_max_duration_check and contests_skip_max_duration_check parameters for the workaround.
|
||||
schema:
|
||||
type: integer
|
||||
AlertDxpeditionsSkipMaxDurationCheck:
|
||||
@@ -675,6 +678,16 @@ components:
|
||||
on the air most of the time.
|
||||
schema:
|
||||
type: boolean
|
||||
AlertContestsSkipMaxDurationCheck:
|
||||
name: contests_skip_max_duration_check
|
||||
in: query
|
||||
description: >
|
||||
Return contest alerts even if they last longer than max_duration. This allows the user to
|
||||
filter out multi-day/multi-week POTA alerts where the operator likely won't be on the air most
|
||||
of the time, but keep multi-day/multi-week contests where contesters likely *will* be
|
||||
on the air most of the time.
|
||||
schema:
|
||||
type: boolean
|
||||
AlertSource:
|
||||
name: source
|
||||
in: query
|
||||
@@ -903,9 +916,16 @@ components:
|
||||
- REGION
|
||||
- GRID
|
||||
- TOILET
|
||||
- UNKNOWN
|
||||
example: PARK
|
||||
|
||||
AlertType:
|
||||
type: string
|
||||
enum:
|
||||
- XOTA
|
||||
- DXPEDITION
|
||||
- CONTEST
|
||||
example: XOTA
|
||||
|
||||
Continent:
|
||||
type: string
|
||||
enum:
|
||||
@@ -970,7 +990,6 @@ components:
|
||||
- FSK
|
||||
- PKT
|
||||
- MSK144
|
||||
- UNKNOWN
|
||||
example: SSB
|
||||
|
||||
ModeType:
|
||||
@@ -979,7 +998,6 @@ components:
|
||||
- CW
|
||||
- PHONE
|
||||
- DATA
|
||||
- UNKNOWN
|
||||
example: CW
|
||||
|
||||
ModeSource:
|
||||
@@ -1433,6 +1451,13 @@ components:
|
||||
items:
|
||||
$ref: '#/components/schemas/SIGRef'
|
||||
description: SIG references. We allow multiple here for e.g. n-fer activations, unlike ADIF SIG_INFO
|
||||
alert_type:
|
||||
description: "The type of alert this is: xOTA, DXpedition, or Contest."
|
||||
$ref: "#/components/schemas/AlertType"
|
||||
url:
|
||||
type: string
|
||||
description: A URL linking to more information about the alert, e.g. DXpedition or contest info.
|
||||
example: "https://www.rsgbcc.org/cgi-bin/contest_rules.pl?year=2026&contest=144backpack1"
|
||||
source:
|
||||
type: string
|
||||
description: Where we got the alert from.
|
||||
|
||||
+11
-25
@@ -13,7 +13,6 @@ function loadAlerts() {
|
||||
url: '/api/v2/alerts' + buildQueryString(), dataType: 'json', success: function (jsonData) {
|
||||
// Store last updated time
|
||||
lastUpdateTime = moment.utc();
|
||||
updateRefreshDisplay();
|
||||
// Store data
|
||||
alerts = jsonData;
|
||||
// Update table
|
||||
@@ -38,6 +37,9 @@ function buildQueryString() {
|
||||
if ($("#dxpeditions_skip_max_duration_check")[0].checked) {
|
||||
str = str + "&dxpeditions_skip_max_duration_check=true";
|
||||
}
|
||||
if ($("#contests_skip_max_duration_check")[0].checked) {
|
||||
str = str + "&contests_skip_max_duration_check=true";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -208,10 +210,14 @@ function addAlertRowsToTable(tbody, alerts) {
|
||||
if (a["dx_calls"] != null) {
|
||||
dx_calls_html = a["dx_calls"].map(call => `<a class='dx-link' href='https://qrz.com/db/${call}' target='_new'>${call}</a>`).join(", ");
|
||||
}
|
||||
if (dx_calls_html === "" && a["alert_type"] === "CONTEST") {
|
||||
// Contest = true and no DX callsigns, so display "Contest"
|
||||
dx_calls_html = "Contest"
|
||||
}
|
||||
|
||||
// Format DXpedition country
|
||||
let dx_country_html = "";
|
||||
if (a["is_dxpedition"] === true && a["dx_country"] != null && a["dx_country"] !== "") {
|
||||
if (a["alert_type"] === "DXPEDITION" && a["dx_country"] != null && a["dx_country"] !== "") {
|
||||
dx_country_html = `<br/>${a["dx_country"]}`;
|
||||
}
|
||||
|
||||
@@ -226,6 +232,9 @@ function addAlertRowsToTable(tbody, alerts) {
|
||||
if (a["comment"] != null) {
|
||||
commentText = escapeHtml(a["comment"]);
|
||||
}
|
||||
if (a["url"] != null) {
|
||||
commentText = `<a href="${escapeHtml(a['url'])}" target="_new">${commentText}</a>`;
|
||||
}
|
||||
|
||||
// Sig or fallback to source
|
||||
let sigSourceText = a["source"];
|
||||
@@ -331,33 +340,10 @@ function filtersUpdated() {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
// Update the refresh timing display
|
||||
function updateRefreshDisplay() {
|
||||
if (lastUpdateTime != null) {
|
||||
let secSinceUpdate = moment.duration(moment().diff(lastUpdateTime)).asSeconds();
|
||||
let count = REFRESH_INTERVAL_SEC;
|
||||
let updatingString = "Updating..."
|
||||
if (secSinceUpdate < REFRESH_INTERVAL_SEC) {
|
||||
count = REFRESH_INTERVAL_SEC - secSinceUpdate;
|
||||
let number;
|
||||
if (count <= 60) {
|
||||
number = count.toFixed(0);
|
||||
updatingString = "<span class='nowrap'>Updating in " + number + " second" + (number !== "1" ? "s" : "") + ".</span>";
|
||||
} else {
|
||||
number = Math.round(count / 60.0).toFixed(0);
|
||||
updatingString = "<span class='nowrap'>Updating in " + number + " minute" + (number !== "1" ? "s" : "") + ".</span>";
|
||||
}
|
||||
}
|
||||
$("#timing-container").html("Last updated at " + lastUpdateTime.format('HH:mm') + " UTC. " + updatingString);
|
||||
}
|
||||
}
|
||||
|
||||
// Startup
|
||||
$(document).ready(function () {
|
||||
// Call loadOptions(), this will then trigger loading alerts and setting up timers.
|
||||
loadOptions();
|
||||
// Update the refresh timing display every second
|
||||
setInterval(updateRefreshDisplay, 1000);
|
||||
});
|
||||
|
||||
// Reload alerts on becoming visible. This forces a refresh when used as a PWA and the user switches back to the PWA
|
||||
|
||||
Reference in New Issue
Block a user