mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Toggle to allow DXpeditions to be displayed even if they exceed max_duration. Closes #17
This commit is contained in:
@@ -195,19 +195,25 @@ paths:
|
||||
type: integer
|
||||
- name: received_since
|
||||
in: query
|
||||
description: Limit the spots to only ones that the system found out about at this time or later. Time in UTC seconds since UNIX epoch. If you are using a front-end that tracks the last time it queried the API and requests spots since then, you want *this* version of the query parameter, not "since", because otherwise it may miss things. The logic is "greater than" rather than "greater than or equal to", so you can submit the time of the last received item back to this call and you will get all the more recent spots back, without duplicating the previous latest spot.
|
||||
description: Limit the alerts to only ones that the system found out about at this time or later. Time in UTC seconds since UNIX epoch. If you are using a front-end that tracks the last time it queried the API and requests alerts since then, you want *this* version of the query parameter, not "since", because otherwise it may miss things. The logic is "greater than" rather than "greater than or equal to", so you can submit the time of the last received item back to this call and you will get all the more recent alerts back, without duplicating the previous latest spot.
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
- name: max_duration
|
||||
in: query
|
||||
description: Limit the spots to only ones with a duration of this many seconds or less. Duration is end time minus start time, if end time is set, otherwise "now" minus start time. This is useful to filter out people who alert POTA activations lasting months or even years.
|
||||
description: Limit the alerts to only ones with a duration of this many seconds or less. Duration is end 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.
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
- name: dxpeditions_skip_max_duration_check
|
||||
in: query
|
||||
description: Return DXpedition 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 DXpeditions where the operator(s) likely *will* be on the air most of the time.
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
- name: source
|
||||
in: query
|
||||
description: "Limit the spots to only ones from one or more sources. To select more than one source, supply a comma-separated list."
|
||||
description: "Limit the alerts to only ones from one or more sources. To select more than one source, supply a comma-separated list."
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
@@ -224,7 +230,7 @@ paths:
|
||||
- APRS-IS
|
||||
- name: sig
|
||||
in: query
|
||||
description: "Limit the spots to only ones from one or more Special Interest Groups. To select more than one SIG, supply a comma-separated list."
|
||||
description: "Limit the alerts to only ones from one or more Special Interest Groups. To select more than one SIG, supply a comma-separated list."
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
@@ -237,7 +243,7 @@ paths:
|
||||
- HEMA
|
||||
- name: dx_continent
|
||||
in: query
|
||||
description: "Limit the spots to only ones where the DX (the operator being spotted) is on the given continent(s). To select more than one continent, supply a comma-separated list."
|
||||
description: "Limit the alerts to only ones where the DX (the operator being spotted) is on the given continent(s). To select more than one continent, supply a comma-separated list."
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
|
||||
@@ -30,6 +30,9 @@ function buildQueryString() {
|
||||
if (maxDur != "9999999999") {
|
||||
str = str + "&max_duration=" + maxDur;
|
||||
}
|
||||
if ($("#dxpeditions_skip_max_duration_check")[0].checked) {
|
||||
str = str + "&dxpeditions_skip_max_duration_check=true";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -210,7 +213,7 @@ function generateMaxDurationDropdownFilterCard(band_options) {
|
||||
let $col = $("<div class='col'>")
|
||||
let $card = $("<div class='card'>");
|
||||
let $card_body = $("<div class='card-body'>");
|
||||
$card_body.append(`<h5 class='card-title'>Duration Limit</h5>`);
|
||||
$card_body.append(`<h5 class='card-title'>Duration Limit <i class='fa-solid fa-circle-question' title='Some users create long-duration alerts for the period they will be generally in and around xOTA references, when they are not indending to be on the air most of the time. Use this control to restrict the maximum duration of spots that the software will display, and exclude any with a long duration, to avoid these filling up the list. By default, we allow DXpeditions to be displayed even if they are longer than this limit, because on a DXpedition the operators typically ARE on the air most of the time.'></i></h5>`);
|
||||
$p = $("<p class='card-text filter-card-text'>");
|
||||
$p.append("Hide any alerts lasting more than:<br/>");
|
||||
$p.append(`<select id="max-duration" class="storeable-select form-select" onclick="filtersUpdated();" style="width: 8em; display: inline-block;">
|
||||
@@ -221,9 +224,12 @@ function generateMaxDurationDropdownFilterCard(band_options) {
|
||||
<option value="2419200">4 weeks</option>
|
||||
<option value="9999999999">No limit</option>
|
||||
</select>`);
|
||||
$p.append(" <i class='fa-solid fa-circle-question' title='Some users create long-duration alerts for the period they will be generally in and around xOTA references, not just the times they are specifically on the air. Use this control to restrict the maximum duration of spots that the software will display, and exclude any with a long duration.'></i>");
|
||||
|
||||
$p2 = $("<p class='card-text filter-card-text' style='line-height: 1.5em !important;'>");
|
||||
$p2.append(`<input class="form-check-input storeable-checkbox" type="checkbox" value="" onclick="filtersUpdated();" id="dxpeditions_skip_max_duration_check" checked><label class="form-check-label ms-2" for="dxpeditions_skip_max_duration_check">Allow DXpeditions that are longer</label>`);
|
||||
// Compile HTML elements to return
|
||||
$card_body.append($p);
|
||||
$card_body.append($p2);
|
||||
$card.append($card_body);
|
||||
$col.append($card);
|
||||
return $col;
|
||||
|
||||
@@ -7,7 +7,8 @@ function loadStatus() {
|
||||
`Server Owner Callsign: ${jsonData["server-owner-callsign"]}`,
|
||||
`Server up since: ${moment().subtract(jsonData["uptime"], 'seconds').fromNow()}`,
|
||||
`Memory Use: ${jsonData["mem_use_mb"]} MB`,
|
||||
`Total Spots: ${jsonData["num_spots"]}`
|
||||
`Total Spots: ${jsonData["num_spots"]}`,
|
||||
`Total Alerts: ${jsonData["num_alerts"]}`
|
||||
]));
|
||||
$("#status-container").append(generateStatusCard("Web Server", [
|
||||
`Status: ${jsonData["webserver"]["status"]}`,
|
||||
|
||||
Reference in New Issue
Block a user